From 91f49a603b504762fc0c5daf50d4385bf604ce93 Mon Sep 17 00:00:00 2001 From: yusuke8h Date: Tue, 1 Sep 2026 12:29:05 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20[Feature]=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20/workspacelist=20=E5=BA=8F=E5=8F=B7?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=B7=A5=E4=BD=9C=E5=8C=BA=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 4 ++-- README.md | 4 ++-- src/channels/dingtalk/dingtalk-bridge.mjs | 2 +- src/channels/feishu/bridge.mjs | 1 + src/channels/qq/qq-bridge.mjs | 2 +- src/channels/shared/i18n-en/shared-a.mjs | 3 ++- src/channels/shared/i18n-en/shared-b.mjs | 9 ++++++--- src/channels/shared/text-harness-bridge.mjs | 2 +- src/channels/shared/workspace-command.mjs | 20 ++++++++++++++++---- src/channels/wecom/wecom-bridge.mjs | 2 +- src/channels/weixin/weixin-bridge.mjs | 2 +- test/workspace.test.mjs | 21 +++++++++++++++------ 12 files changed, 49 insertions(+), 23 deletions(-) diff --git a/README.en.md b/README.en.md index dff305a..59a919c 100644 --- a/README.en.md +++ b/README.en.md @@ -202,7 +202,7 @@ Do not modify the same profile through a terminal or plugin market during instal | `/cancel` | Cancel batch input and discard its collected messages. | | `/repair` | In a Feishu direct chat, incrementally repair the card callback and permissions required for media and the native Slash Command panel. | | `/compact` | Immediately compact older context in the Session bound to the current chat. | -| `/workspace ` | Switch the current bot's Harness workspace. | +| `/workspace ` | Switch the current bot's Harness workspace by `/workspacelist` index or absolute path. | | `/workspacelist` | List workspace absolute paths that still exist on the current Harness Host. | | `/sessionlist [workspace number or absolute path]`, `/sessions [...]` | Equivalent aliases that list every registered session ID and title in the selected workspace; omit the argument to use the current workspace. | | `/session ` | Bind the current chat to an existing Harness session. | @@ -236,7 +236,7 @@ If the Slack desktop app has no native Slash Command registered with the same na - Feishu `/repair` is available only in a direct chat and follows the current bot's channel access policy just like every other command; the plugin defines no separate administrator role. It incrementally adds the currently missing `card.action.trigger`, `im:message:readonly`, `im:resource`, `application:app_slash_command:read`, and `application:app_slash_command:write`, while the confirmation page shows only items the app is currently missing. The authorization page must be opened by an account that can access the target app in Feishu Open Platform. Bare `/repair` starts repair; if an older attempt is still awaiting authorization, it invalidates that one-time link before generating a new one. Use `/repair qr` for the current link's QR code, `/repair status` to inspect the attempt, `/repair verify` to refresh verification, and `/repair cancel` to cancel it; none of these four supplemental commands starts another authorization. Once Feishu has accepted the update and the bot is waiting for the test-button callback, a second repair is not started concurrently. - `/compact` acts only on the Harness Session already bound to the current chat and is never sent to the model. The bot reports the applicable status when the chat has no Session yet, the Session is generating a reply, or there is no compactable history. - The path must be an existing absolute directory. The bot returns an actionable error and the correct usage when validation fails. -- `/workspacelist` takes no arguments. It combines the Harness global registry with the current bot's path. When that current path still exists and is safe to display, it appears first and is marked as current. Any listed path can be copied directly into `/workspace`. +- `/workspacelist` takes no arguments. It combines the Harness global registry with the current bot's path. When that current path still exists and is safe to display, it appears first and is marked as current. `/workspace N` switches using the freshly resolved list order at execution time; absolute paths remain supported. - `/sessionlist` and `/sessions` are equivalent. A numeric argument uses the same freshly resolved order as `/workspacelist` at command execution time. An absolute path can also select a workspace directly, and the result echoes the resolved path. - Both session-list aliases include every session registered to the selected workspace. Archived sessions are marked as archived; blank and subagent sessions are included when they belong to that workspace; sessions without a title are shown as `No title yet`. Any listed ID can be passed directly to `/session Session ID`. - `/session` accepts exactly one Session ID obtained from `/sessionlist`. It neither creates a session nor immediately prompts the model; later messages in the current chat continue the bound session. Regular archived sessions can be bound without being unarchived, while subagent sessions cannot be bound. diff --git a/README.md b/README.md index 9acde72..b34e3f7 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ dsh plugin --profile web add -w --save-exact @xmanrui/dsh-im@3.1.0 --registry=ht | `/cancel` | 取消批量输入并丢弃已收集的消息。 | | `/repair` | 在飞书私聊中增量修复卡片回调,并补全媒体与原生 Slash Command 面板所需的权限。 | | `/compact` | 立即压缩当前聊天绑定会话的较早上下文。 | -| `/workspace <工作区绝对路径>` | 切换当前机器人的 Harness 工作区。 | +| `/workspace <工作区序号或绝对路径>` | 按 `/workspacelist` 序号或绝对路径切换当前机器人的 Harness 工作区。 | | `/workspacelist` | 列出当前 Harness Host 上仍然存在的工作区绝对路径。 | | `/sessionlist [工作区序号或绝对路径]`、`/sessions [...]` | 两个等价命令;列出指定工作区登记的所有会话 ID 和标题,省略参数时使用当前工作区。 | | `/session ` | 将当前聊天绑定到指定的已有 Harness 会话。 | @@ -239,7 +239,7 @@ Slack 桌面端若未注册同名的原生 Slash Command,会拦截直接以 `/ - 飞书 `/repair` 仅在私聊中可用,并与其他命令一样只服从当前飞书机器人的渠道访问策略;插件不另行区分管理员和普通用户。它增量补全当前缺少的 `card.action.trigger`、`im:message:readonly`、`im:resource`、`application:app_slash_command:read` 和 `application:app_slash_command:write`,确认页只显示当前应用缺少的项。授权页必须由在飞书开放平台中有权访问目标应用的账号打开。普通 `/repair` 会启动修复;若旧任务仍在等待授权,会先作废旧的一次性链接再生成新链接。发送 `/repair qr` 获取当前链接的二维码,`/repair status` 查询当前任务,`/repair verify` 重新查询验证状态,`/repair cancel` 取消任务;这四个补充命令均不会另起授权。平台已接受更新、正在等待测试按钮回调时,不会并发启动第二次修复。 - `/compact` 只作用于当前聊天已经绑定的 Harness 会话,不会把命令发送给模型。当前聊天尚未创建会话、会话正在生成回复或没有可压缩历史时,机器人会直接返回对应状态。 - 只接受已经存在的绝对目录;路径无效时机器人会返回具体提示和正确用法。 -- `/workspacelist` 不需要参数。它合并 Harness 全局登记项与当前机器人的路径;当前路径仍存在且可安全显示时会排在首位并标记为“当前”。结果可直接复制到 `/workspace` 命令。 +- `/workspacelist` 不需要参数。它合并 Harness 全局登记项与当前机器人的路径;当前路径仍存在且可安全显示时会排在首位并标记为“当前”。`/workspace N` 会在执行时按最新列表顺序切换,也可继续使用绝对路径。 - `/sessionlist` 和 `/sessions` 完全等价。数字参数按命令执行时与 `/workspacelist` 相同的最新顺序解析;也可使用绝对路径直接指定工作区。结果会回显最终选中的路径。 - 两个会话列表命令都会列出该工作区登记的所有会话。已归档会话会标记为“已归档”;空白会话和子代理会话在它们归属该工作区时也会列出;没有标题的会话显示为“暂无标题”。结果中的 ID 可直接用于 `/session Session ID`。 - `/session` 只接受一个由 `/sessionlist` 获得的 Session ID。它不会新建会话或立即向模型发送消息;绑定成功后,当前聊天的后续消息会继续该会话。普通归档会话可以绑定但不会自动取消归档,子代理会话不能绑定。 diff --git a/src/channels/dingtalk/dingtalk-bridge.mjs b/src/channels/dingtalk/dingtalk-bridge.mjs index ea8d7f2..a9fcd6f 100644 --- a/src/channels/dingtalk/dingtalk-bridge.mjs +++ b/src/channels/dingtalk/dingtalk-bridge.mjs @@ -74,7 +74,7 @@ const HELP_TEXT_LINES = [ '/new 开启一个全新会话', '/compact 压缩当前会话的较早上下文', '/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)', - '/workspace 工作区绝对路径 切换工作区', + '/workspace 工作区序号或绝对路径 切换工作区', '/workspacelist 列出工作区绝对路径', '/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题', '/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话', diff --git a/src/channels/feishu/bridge.mjs b/src/channels/feishu/bridge.mjs index 737f73f..ba999d9 100644 --- a/src/channels/feishu/bridge.mjs +++ b/src/channels/feishu/bridge.mjs @@ -153,6 +153,7 @@ function isFeishuLocalCommand(text, { hasImages = false, hasFiles = false } = {} /** Canonical workspace/session help advertised by every bridge family. */ const WORKSPACE_HELP_LINES = [ + '/workspace 工作区序号或绝对路径 切换工作区', '/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话', '/workspacelist 列出工作区绝对路径', '/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题', diff --git a/src/channels/qq/qq-bridge.mjs b/src/channels/qq/qq-bridge.mjs index 72673b8..a892c8d 100644 --- a/src/channels/qq/qq-bridge.mjs +++ b/src/channels/qq/qq-bridge.mjs @@ -85,7 +85,7 @@ function helpText() { t('/new 开启一个全新会话'), t('/compact 压缩当前会话的较早上下文'), t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'), - t('/workspace 工作区绝对路径 切换工作区'), + t('/workspace 工作区序号或绝对路径 切换工作区'), t('/workspacelist 列出工作区绝对路径'), t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'), t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'), diff --git a/src/channels/shared/i18n-en/shared-a.mjs b/src/channels/shared/i18n-en/shared-a.mjs index d538fd4..2a3dd18 100644 --- a/src/channels/shared/i18n-en/shared-a.mjs +++ b/src/channels/shared/i18n-en/shared-a.mjs @@ -120,7 +120,8 @@ export default { '{label}机器人已连接 DeepSeek Harness。': 'The {label} bot is connected to DeepSeek Harness.', '/new 开启一个全新会话': '/new Start a brand-new session', '/compact 压缩当前会话的较早上下文': '/compact Compact the earlier context of the current session', - '/workspace 工作区绝对路径 切换工作区': '/workspace Switch workspace', + '/workspace 工作区序号或绝对路径 切换工作区': + '/workspace Switch workspace', '/workspacelist 列出工作区绝对路径': '/workspacelist List absolute workspace paths', '/sessionlist [工作区序号或绝对路径] 列出会话 ID 和标题': '/sessionlist [workspace index or absolute path] List session IDs and titles', diff --git a/src/channels/shared/i18n-en/shared-b.mjs b/src/channels/shared/i18n-en/shared-b.mjs index 9ea23d2..e45584a 100644 --- a/src/channels/shared/i18n-en/shared-b.mjs +++ b/src/channels/shared/i18n-en/shared-b.mjs @@ -17,7 +17,8 @@ export default { '当前 Harness Host 上存在的工作区({count}):': 'Workspaces on the current Harness Host ({count}):', '(当前)': '(current)', - '切换用法:/workspace 工作区绝对路径': 'To switch: /workspace Workspace absolute path', + '切换用法:/workspace 工作区序号或绝对路径': + 'To switch: /workspace Workspace index or absolute path', '查看会话:/sessionlist 工作区序号或绝对路径': 'To view Sessions: /sessionlist Workspace index or absolute path', '机器人正在移除或已重新接入,无法列出原会话的工作区。': @@ -80,10 +81,12 @@ export default { '归档:{archived}': 'Archived: {archived}', '是': 'Yes', '否': 'No', - '用法:/workspace 工作区绝对路径': 'Usage: /workspace Workspace absolute path', + '用法:/workspace 工作区序号或绝对路径': + 'Usage: /workspace Workspace index or absolute path', '当前机器人暂不支持切换工作区。': 'This bot does not support switching Workspaces yet.', '工作区已切换为:{workspace}': 'Workspace switched to: {workspace}', - '{message}\n用法:/workspace 工作区绝对路径': '{message}\nUsage: /workspace Workspace absolute path', + '{message}\n用法:/workspace 工作区序号或绝对路径': + '{message}\nUsage: /workspace Workspace index or absolute path', '机器人正在移除或已重新接入,无法切换原会话的工作区。': 'The bot is being removed or has been reconnected; cannot switch the Workspace of the original Session.', diff --git a/src/channels/shared/text-harness-bridge.mjs b/src/channels/shared/text-harness-bridge.mjs index a40e0f0..08277fc 100644 --- a/src/channels/shared/text-harness-bridge.mjs +++ b/src/channels/shared/text-harness-bridge.mjs @@ -588,7 +588,7 @@ export class TextHarnessBridge { t('/new 开启一个全新会话'), t('/compact 压缩当前会话的较早上下文'), t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'), - t('/workspace 工作区绝对路径 切换工作区'), + t('/workspace 工作区序号或绝对路径 切换工作区'), t('/workspacelist 列出工作区绝对路径'), t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'), t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'), diff --git a/src/channels/shared/workspace-command.mjs b/src/channels/shared/workspace-command.mjs index b1e6a54..7a654bd 100644 --- a/src/channels/shared/workspace-command.mjs +++ b/src/channels/shared/workspace-command.mjs @@ -142,7 +142,7 @@ async function runWorkspaceListCommand(match, harness) { `${index + 1}. ${workspace}${workspace === current ? t('(当前)') : ''}` )), '', - t('切换用法:/workspace 工作区绝对路径'), + t('切换用法:/workspace 工作区序号或绝对路径'), t('查看会话:/sessionlist 工作区序号或绝对路径'), ]; const message = lines.join('\n'); @@ -366,18 +366,30 @@ export async function runWorkspaceCommand(text, harness, conversationKey) { if (!match) return null; const workspace = match[1]?.trim(); if (!workspace) { - return commandResult(t('用法:/workspace 工作区绝对路径')); + return commandResult(t('用法:/workspace 工作区序号或绝对路径')); } if (typeof harness?.switchWorkspace !== 'function') { return commandResult(t('当前机器人暂不支持切换工作区。')); } try { - const current = await harness.switchWorkspace(workspace); + let selected = workspace; + if (/^\d+$/u.test(workspace)) { + if (typeof harness?.listWorkspaces !== 'function') { + return commandResult(t('当前机器人暂不支持按序号选择工作区。')); + } + const { paths } = await workspacePathSnapshot(harness); + const position = Number(workspace); + if (!Number.isSafeInteger(position) || position < 1 || position > paths.length) { + return commandResult(t('工作区序号不存在,请先执行 /workspacelist。')); + } + selected = paths[position - 1]; + } + const current = await harness.switchWorkspace(selected); return commandResult(t('工作区已切换为:{workspace}', { workspace: current })); } catch (error) { if (['workspace-not-absolute', 'workspace-not-found', 'workspace-not-directory'].includes(error?.code)) { return commandResult(t(`{message} -用法:/workspace 工作区绝对路径`, { message: error.message })); +用法:/workspace 工作区序号或绝对路径`, { message: error.message })); } if (error?.code === 'workspace-bot-not-found') { return commandResult(t('机器人正在移除或已重新接入,无法切换原会话的工作区。')); diff --git a/src/channels/wecom/wecom-bridge.mjs b/src/channels/wecom/wecom-bridge.mjs index 9a2a178..2226f40 100644 --- a/src/channels/wecom/wecom-bridge.mjs +++ b/src/channels/wecom/wecom-bridge.mjs @@ -68,7 +68,7 @@ function helpText() { t('/new 开启一个全新会话'), t('/compact 压缩当前会话的较早上下文'), t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'), - t('/workspace 工作区绝对路径 切换工作区'), + t('/workspace 工作区序号或绝对路径 切换工作区'), t('/workspacelist 列出工作区绝对路径'), t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'), t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'), diff --git a/src/channels/weixin/weixin-bridge.mjs b/src/channels/weixin/weixin-bridge.mjs index 36b3238..de6de3e 100644 --- a/src/channels/weixin/weixin-bridge.mjs +++ b/src/channels/weixin/weixin-bridge.mjs @@ -75,7 +75,7 @@ const HELP_TEXT = () => [ t('/new 开启一个全新会话'), t('/compact 压缩当前会话的较早上下文'), t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'), - t('/workspace 工作区绝对路径 切换工作区'), + t('/workspace 工作区序号或绝对路径 切换工作区'), t('/workspacelist 列出工作区绝对路径'), t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'), t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'), diff --git a/test/workspace.test.mjs b/test/workspace.test.mjs index a2a3cda..01977c5 100644 --- a/test/workspace.test.mjs +++ b/test/workspace.test.mjs @@ -940,10 +940,15 @@ test('config-store removal observation retires workspaces after the config commi assert.equal(workspaces.has('bot_feishu'), false); }); -test('/workspace command preserves spaces and returns actionable validation messages', async (t) => { - const { alternateWorkspace } = await fixture(t); +test('/workspace command supports fresh list numbers, preserves paths, and returns actionable errors', async (t) => { + const { defaultWorkspace, alternateWorkspace } = await fixture(t); const switched = []; - const harness = { async switchWorkspace(path) { switched.push(path); return path; } }; + let listed = [alternateWorkspace]; + const harness = { + currentWorkspace() { return defaultWorkspace; }, + async listWorkspaces() { return listed; }, + async switchWorkspace(path) { switched.push(path); return path; }, + }; assert.equal(await runWorkspaceCommand('hello', harness), null); assert.match((await runWorkspaceCommand('/workspace', harness)).message, /用法/); @@ -951,7 +956,11 @@ test('/workspace command preserves spaces and returns actionable validation mess (await runWorkspaceCommand(`/workspace ${alternateWorkspace}`, harness)).message, new RegExp(alternateWorkspace.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')), ); - assert.deepEqual(switched, [alternateWorkspace]); + assert.match((await runWorkspaceCommand('/workspace 2', harness)).message, new RegExp(alternateWorkspace)); + listed = []; + assert.match((await runWorkspaceCommand('/workspace 1', harness)).message, new RegExp(defaultWorkspace)); + assert.match((await runWorkspaceCommand('/workspace 2', harness)).message, /workspacelist/); + assert.deepEqual(switched, [alternateWorkspace, alternateWorkspace, defaultWorkspace]); const invalidHarness = { async switchWorkspace() { @@ -962,7 +971,7 @@ test('/workspace command preserves spaces and returns actionable validation mess }; const invalid = await runWorkspaceCommand('/workspace /missing/workspace', invalidHarness); assert.match(invalid.message, /路径不存在/); - assert.match(invalid.message, /用法:\/workspace 工作区绝对路径/); + assert.match(invalid.message, /用法:\/workspace 工作区序号或绝对路径/); const removedHarness = { async switchWorkspace() { @@ -1004,7 +1013,7 @@ test('/workspacelist returns existing absolute paths with the current workspace assert.ok(result.message.indexOf(defaultWorkspace) < result.message.indexOf(alternateWorkspace)); assert.ok(result.message.indexOf(alternateWorkspace) < result.message.indexOf(thirdWorkspace)); assert.doesNotMatch(result.message, /missing|relative\/path/); - assert.match(result.message, /切换用法:\/workspace 工作区绝对路径/); + assert.match(result.message, /切换用法:\/workspace 工作区序号或绝对路径/); assert.match(result.message, /查看会话:\/sessionlist 工作区序号或绝对路径/); assert.equal(result.messages.join(''), result.message); assert.equal(listCalls, 1); From 959e5b9ad2eb4615b234f780b3316f76d879bad5 Mon Sep 17 00:00:00 2001 From: xmanrui <841206367@qq.com> Date: Tue, 1 Sep 2026 15:47:27 +0800 Subject: [PATCH 2/3] fix(feishu): document numbered workspace switching --- src/channels/feishu/feishu-cards.mjs | 4 ++-- src/channels/shared/i18n-en/feishu.mjs | 5 ++--- test/channels/feishu/feishu-cards.test.mjs | 10 ++++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/channels/feishu/feishu-cards.mjs b/src/channels/feishu/feishu-cards.mjs index 6b72346..4a59b1f 100644 --- a/src/channels/feishu/feishu-cards.mjs +++ b/src/channels/feishu/feishu-cards.mjs @@ -490,7 +490,7 @@ export function menuHelpText() { '/sessionlist 或 /sessions 列出工作区会话', '/session ID 绑定已有会话', '/workspacelist 列出工作区', - '/workspace 路径 切换工作区', + '/workspace 工作区序号或绝对路径 切换工作区', '/new 开启全新会话', '', '📊 状态 / 压缩', @@ -554,7 +554,7 @@ const HELP_TEXT_COMMANDS = [ '`/new` — 开启全新会话', '`/session ID` — 绑定已有会话', '`/sessionlist [工作区]` 或 `/sessions [工作区]` — 列出会话', - '`/workspace 路径` — 切换工作区', + '`/workspace 工作区序号或绝对路径` — 切换工作区', '`/workspacelist` — 列出工作区', '`/status` — 查看连接状态', '`/compact` — 压缩上下文', diff --git a/src/channels/shared/i18n-en/feishu.mjs b/src/channels/shared/i18n-en/feishu.mjs index 271541c..43fc6d7 100644 --- a/src/channels/shared/i18n-en/feishu.mjs +++ b/src/channels/shared/i18n-en/feishu.mjs @@ -227,7 +227,6 @@ export default { '/sessionlist or /sessions List workspace sessions', '/session ID 绑定已有会话': '/session ID Bind an existing session', '/workspacelist 列出工作区': '/workspacelist List workspaces', - '/workspace 路径 切换工作区': '/workspace PATH Switch workspace', '/new 开启全新会话': '/new Start a new session', '📊 状态 / 压缩': '📊 Status / compact', '/status 连接状态': '/status Connection status', @@ -247,8 +246,8 @@ export default { '/steer 指令 给 Agent 补充指令': '/steer INSTRUCTION Steer the Agent', '**📋 卡片功能**\n\n1. 会话下拉 — 切换当前绑定会话\n2. 工作区下拉 — 切换工作区\n3. 🤖 预设下拉 — 切换 Agent 预设\n4. 🧠 模型下拉 — 切换模型\n5. 🆕 新会话 — 开启全新会话\n6. 📋 会话/关注 — 查看/绑定会话,管理关注\n7. ⏹ 停止 — 停止当前任务\n8. 📐 压缩 — 压缩当前会话上下文\n9. 补充指令 — 给 Agent 发送指令\n10. 🗄 归档切换 — 显示/隐藏归档会话\n11. 📊 状态 — 查看系统连接状态\n12. 📖 帮助 — 查看本帮助': '**📋 Card features**\n\n1. Session dropdown — switch the bound session\n2. Workspace dropdown — switch workspace\n3. 🤖 Preset dropdown — switch Agent Preset\n4. 🧠 Model dropdown — switch model\n5. 🆕 New session — start fresh\n6. 📋 Sessions/watches — view or bind sessions and manage watches\n7. ⏹ Stop — stop the current task\n8. 📐 Compact — compact the current session context\n9. Steer task — send an instruction to the Agent\n10. 🗄 Archived toggle — show or hide archived sessions\n11. 📊 Status — view connection status\n12. 📖 Help — view this help', - '**⌨️ 文本命令**\n\n`/m` — 打开菜单卡片\n`/new` — 开启全新会话\n`/session ID` — 绑定已有会话\n`/sessionlist [工作区]` 或 `/sessions [工作区]` — 列出会话\n`/workspace 路径` — 切换工作区\n`/workspacelist` — 列出工作区\n`/status` — 查看连接状态\n`/compact` — 压缩上下文\n`/stop` — 停止当前任务\n`/steer 指令` — 补充指令\n`/watch ID` — 关注会话\n`/watchlist` — 关注列表\n`/unwatch ID` — 取消关注\n`/archived on/off` — 归档显隐\n`/presetlist` 或 `/presets` — 列出预设\n`/preset [序号/ID]` — 切换预设\n`/preset --default` — 跟随默认\n`/models` — 列出模型\n`/reasoninglist` 或 `/reasonings` — 按序号列出当前模型可用推理等级\n`/reasoning [序号、等级ID或 --default]` — 查看或切换当前推理等级\n`/model [序号或完整模型ID] [推理等级ID]` — 查看或切换当前会话模型\n`/batch` — 开启批量输入(仅私聊,最多 10 条文字)\n`/send` — 提交当前批次\n`/cancel` — 取消当前批次\n`/repair` — 补全飞书权限与卡片回调': - '**⌨️ Text commands**\n\n`/m` — open the menu card\n`/new` — start a new session\n`/session ID` — bind an existing session\n`/sessionlist [workspace]` or `/sessions [workspace]` — list sessions\n`/workspace PATH` — switch workspace\n`/workspacelist` — list workspaces\n`/status` — view connection status\n`/compact` — compact context\n`/stop` — stop the current task\n`/steer INSTRUCTION` — steer the task\n`/watch ID` — watch a session\n`/watchlist` — list watched sessions\n`/unwatch ID` — stop watching\n`/archived on/off` — show or hide archived sessions\n`/presetlist` or `/presets` — list presets\n`/preset [index/ID]` — switch preset\n`/preset --default` — follow default\n`/models` — list models\n`/reasoninglist` or `/reasonings` — list reasoning efforts for the current model\n`/reasoning [index, effort ID, or --default]` — show or switch reasoning effort\n`/model [index or full model ID] [reasoning effort ID]` — show or switch the current Session model\n`/batch` — start batch input (direct messages only, up to 10 text messages)\n`/send` — submit the current batch\n`/cancel` — cancel the current batch\n`/repair` — complete Feishu permissions and the card callback', + '**⌨️ 文本命令**\n\n`/m` — 打开菜单卡片\n`/new` — 开启全新会话\n`/session ID` — 绑定已有会话\n`/sessionlist [工作区]` 或 `/sessions [工作区]` — 列出会话\n`/workspace 工作区序号或绝对路径` — 切换工作区\n`/workspacelist` — 列出工作区\n`/status` — 查看连接状态\n`/compact` — 压缩上下文\n`/stop` — 停止当前任务\n`/steer 指令` — 补充指令\n`/watch ID` — 关注会话\n`/watchlist` — 关注列表\n`/unwatch ID` — 取消关注\n`/archived on/off` — 归档显隐\n`/presetlist` 或 `/presets` — 列出预设\n`/preset [序号/ID]` — 切换预设\n`/preset --default` — 跟随默认\n`/models` — 列出模型\n`/reasoninglist` 或 `/reasonings` — 按序号列出当前模型可用推理等级\n`/reasoning [序号、等级ID或 --default]` — 查看或切换当前推理等级\n`/model [序号或完整模型ID] [推理等级ID]` — 查看或切换当前会话模型\n`/batch` — 开启批量输入(仅私聊,最多 10 条文字)\n`/send` — 提交当前批次\n`/cancel` — 取消当前批次\n`/repair` — 补全飞书权限与卡片回调': + '**⌨️ Text commands**\n\n`/m` — open the menu card\n`/new` — start a new session\n`/session ID` — bind an existing session\n`/sessionlist [workspace]` or `/sessions [workspace]` — list sessions\n`/workspace ` — switch workspace\n`/workspacelist` — list workspaces\n`/status` — view connection status\n`/compact` — compact context\n`/stop` — stop the current task\n`/steer INSTRUCTION` — steer the task\n`/watch ID` — watch a session\n`/watchlist` — list watched sessions\n`/unwatch ID` — stop watching\n`/archived on/off` — show or hide archived sessions\n`/presetlist` or `/presets` — list presets\n`/preset [index/ID]` — switch preset\n`/preset --default` — follow default\n`/models` — list models\n`/reasoninglist` or `/reasonings` — list reasoning efforts for the current model\n`/reasoning [index, effort ID, or --default]` — show or switch reasoning effort\n`/model [index or full model ID] [reasoning effort ID]` — show or switch the current Session model\n`/batch` — start batch input (direct messages only, up to 10 text messages)\n`/send` — submit the current batch\n`/cancel` — cancel the current batch\n`/repair` — complete Feishu permissions and the card callback', '**💡 数字兜底**\n回复数字快速操作:\n**1**工作区列表 · **2**新会话 · **3**会话/关注\n**4**状态 · **5**补全权限 · **6**帮助': '**💡 Number fallback**\nReply with a number for a quick action:\n**1** Workspace list · **2** New session · **3** Sessions/watches\n**4** Status · **5** Complete permissions · **6** Help', '从下方下拉选择补充指令;最后一项可自定义输入。': diff --git a/test/channels/feishu/feishu-cards.test.mjs b/test/channels/feishu/feishu-cards.test.mjs index e3ec0ad..d0a3216 100644 --- a/test/channels/feishu/feishu-cards.test.mjs +++ b/test/channels/feishu/feishu-cards.test.mjs @@ -69,6 +69,7 @@ test('menu and card help advertise Agent Preset, reasoning, and batch commands', assert.match(help, /\/presetlist/); assert.match(help, /\/presets/); assert.match(help, /\/sessions/); + assert.match(help, /\/workspace 工作区序号或绝对路径/); assert.match(help, /\/preset \[序号或完整ID\]/); assert.match(help, /\/preset id:/); assert.match(help, /\/preset --default/); @@ -83,6 +84,7 @@ test('menu and card help advertise Agent Preset, reasoning, and batch commands', const card = helpCard(); assert.match(card, /\/presets/); assert.match(card, /\/sessions/); + assert.match(card, /\/workspace 工作区序号或绝对路径/); assert.match(card, /\/reasoninglist/); assert.match(card, /\/reasonings/); assert.match(card, /\/reasoning \[序号、等级ID或 --default\]/); @@ -215,6 +217,10 @@ test('reachable Feishu cards contain no Chinese literals in English mode', () => setImHostLanguage('en'); try { + const englishMenuHelp = menuHelpText(); + const englishCardHelp = helpCard(['Additional help']); + assert.match(englishMenuHelp, /\/workspace /); + assert.match(englishCardHelp, /\/workspace /); rendered.push( menuCard({ workspaces: ['/work'], @@ -234,7 +240,7 @@ test('reachable Feishu cards contain no Chinese literals in English mode', () => model: 'provider/model-two', sessionCount: 1, }), - helpCard(['Additional help']), + englishCardHelp, sessionListCard('/work', sessions, 0, 1), workspaceListCard(['/work'], '/work'), watchListCard( @@ -245,7 +251,7 @@ test('reachable Feishu cards contain no Chinese literals in English mode', () => steerCard({ hasSession: true }), customSteerCard(), cardActionProbeCard('0123456789abcdef0123456789abcdef'), - menuHelpText(), + englishMenuHelp, ); } finally { setImHostLanguage('zh'); From 9c4628a82130e13de4ae3ceca551f0e66dce5498 Mon Sep 17 00:00:00 2001 From: xmanrui <841206367@qq.com> Date: Tue, 1 Sep 2026 16:29:20 +0800 Subject: [PATCH 3/3] build: refresh host bundle after workspace updates --- lib/index.js | 190 +++++++++++++++++++++++++-------------------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/lib/index.js b/lib/index.js index a91bbbe..b37d260 100644 --- a/lib/index.js +++ b/lib/index.js @@ -4,8 +4,8 @@ import { fileURLToPath as __dshFileURLToPath } from 'node:url'; const require = __dshCreateRequire(import.meta.url); const __filename = __dshFileURLToPath(import.meta.url); const __dirname = __dshDirname(__filename); -var XIe=Object.create;var FM=Object.defineProperty;var $Ie=Object.getOwnPropertyDescriptor;var ele=Object.getOwnPropertyNames;var Ale=Object.getPrototypeOf,tle=Object.prototype.hasOwnProperty;var $e=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Ce=(n,t)=>()=>(n&&(t=n(n=0)),t);var $=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Fr=(n,t)=>{for(var o in t)FM(n,o,{get:t[o],enumerable:!0})},rle=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of ele(t))!tle.call(n,e)&&e!==o&&FM(n,e,{get:()=>t[e],enumerable:!(i=$Ie(t,e))||i.enumerable});return n};var qe=(n,t,o)=>(o=n!=null?XIe(Ale(n)):{},rle(t||!n||!n.__esModule?FM(o,"default",{value:n,enumerable:!0}):o,n));var O3=$((YrA,D3)=>{var w3=$e("stream").Stream,Ufe=$e("util");D3.exports=yn;function yn(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}Ufe.inherits(yn,w3);yn.create=function(n,t){var o=new this;t=t||{};for(var i in t)o[i]=t[i];o.source=n;var e=n.emit;return n.emit=function(){return o._handleEmit(arguments),e.apply(n,arguments)},n.on("error",function(){}),o.pauseStream&&n.pause(),o};Object.defineProperty(yn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});yn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};yn.prototype.resume=function(){this._released||this.release(),this.source.resume()};yn.prototype.pause=function(){this.source.pause()};yn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(n){this.emit.apply(this,n)}.bind(this)),this._bufferedEvents=[]};yn.prototype.pipe=function(){var n=w3.prototype.pipe.apply(this,arguments);return this.resume(),n};yn.prototype._handleEmit=function(n){if(this._released){this.emit.apply(this,n);return}n[0]==="data"&&(this.dataSize+=n[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(n)};yn.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(n))}}});var T3=$((jrA,_3)=>{var Hfe=$e("util"),M3=$e("stream").Stream,b3=O3();_3.exports=Qr;function Qr(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Hfe.inherits(Qr,M3);Qr.create=function(n){var t=new this;n=n||{};for(var o in n)t[o]=n[o];return t};Qr.isStreamLike=function(n){return typeof n!="function"&&typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&!Buffer.isBuffer(n)};Qr.prototype.append=function(n){var t=Qr.isStreamLike(n);if(t){if(!(n instanceof b3)){var o=b3.create(n,{maxDataSize:1/0,pauseStream:this.pauseStreams});n.on("data",this._checkDataSize.bind(this)),n=o}this._handleErrors(n),this.pauseStreams&&n.pause()}return this._streams.push(n),this};Qr.prototype.pipe=function(n,t){return M3.prototype.pipe.call(this,n,t),this.resume(),n};Qr.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};Qr.prototype._realGetNext=function(){var n=this._streams.shift();if(typeof n>"u"){this.end();return}if(typeof n!="function"){this._pipeNext(n);return}var t=n;t(function(o){var i=Qr.isStreamLike(o);i&&(o.on("data",this._checkDataSize.bind(this)),this._handleErrors(o)),this._pipeNext(o)}.bind(this))};Qr.prototype._pipeNext=function(n){this._currentStream=n;var t=Qr.isStreamLike(n);if(t){n.on("end",this._getNext.bind(this)),n.pipe(this,{end:!1});return}var o=n;this.write(o),this._getNext()};Qr.prototype._handleErrors=function(n){var t=this;n.on("error",function(o){t._emitError(o)})};Qr.prototype.write=function(n){this.emit("data",n)};Qr.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Qr.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};Qr.prototype.end=function(){this._reset(),this.emit("end")};Qr.prototype.destroy=function(){this._reset(),this.emit("close")};Qr.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Qr.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(n))}};Qr.prototype._updateDataSize=function(){this.dataSize=0;var n=this;this._streams.forEach(function(t){t.dataSize&&(n.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};Qr.prototype._emitError=function(n){this._reset(),this.emit("error",n)}});var N3=$((JrA,Kfe)=>{Kfe.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var k3=$((qrA,R3)=>{R3.exports=N3()});var G3=$(Fi=>{"use strict";var py=k3(),xfe=$e("path").extname,v3=/^\s*([^;\s]*)(?:;|\s|$)/,Yfe=/^text\//i;Fi.charset=P3;Fi.charsets={lookup:P3};Fi.contentType=jfe;Fi.extension=Jfe;Fi.extensions=Object.create(null);Fi.lookup=qfe;Fi.types=Object.create(null);zfe(Fi.extensions,Fi.types);function P3(n){if(!n||typeof n!="string")return!1;var t=v3.exec(n),o=t&&py[t[1].toLowerCase()];return o&&o.charset?o.charset:t&&Yfe.test(t[1])?"UTF-8":!1}function jfe(n){if(!n||typeof n!="string")return!1;var t=n.indexOf("/")===-1?Fi.lookup(n):n;if(!t)return!1;if(t.indexOf("charset")===-1){var o=Fi.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t}function Jfe(n){if(!n||typeof n!="string")return!1;var t=v3.exec(n),o=t&&Fi.extensions[t[1].toLowerCase()];return!o||!o.length?!1:o[0]}function qfe(n){if(!n||typeof n!="string")return!1;var t=xfe("x."+n).toLowerCase().substr(1);return t&&Fi.types[t]||!1}function zfe(n,t){var o=["nginx","apache",void 0,"iana"];Object.keys(py).forEach(function(e){var a=py[e],A=a.extensions;if(!(!A||!A.length)){n[e]=A;for(var r=0;rc||g===c&&t[s].substr(0,12)==="application/"))continue}t[s]=e}}})}});var L3=$((VrA,F3)=>{F3.exports=Vfe;function Vfe(n){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(n):setTimeout(n,0)}});var pT=$((WrA,H3)=>{var U3=L3();H3.exports=Wfe;function Wfe(n){var t=!1;return U3(function(){t=!0}),function(i,e){t?n(i,e):U3(function(){n(i,e)})}}});var dT=$((ZrA,K3)=>{K3.exports=Zfe;function Zfe(n){Object.keys(n.jobs).forEach(Xfe.bind(n)),n.jobs={}}function Xfe(n){typeof this.jobs[n]=="function"&&this.jobs[n]()}});var hT=$((XrA,Y3)=>{var x3=pT(),$fe=dT();Y3.exports=eQe;function eQe(n,t,o,i){var e=o.keyedList?o.keyedList[o.index]:o.index;o.jobs[e]=AQe(t,e,n[e],function(a,A){e in o.jobs&&(delete o.jobs[e],a?$fe(o):o.results[e]=A,i(a,o.results))})}function AQe(n,t,o,i){var e;return n.length==2?e=n(o,x3(i)):e=n(o,t,x3(i)),e}});var ET=$(($rA,j3)=>{j3.exports=tQe;function tQe(n,t){var o=!Array.isArray(n),i={index:0,keyedList:o||t?Object.keys(n):null,jobs:{},results:o?{}:[],size:o?Object.keys(n).length:n.length};return t&&i.keyedList.sort(o?t:function(e,a){return t(n[e],n[a])}),i}});var CT=$((eaA,J3)=>{var rQe=dT(),aQe=pT();J3.exports=iQe;function iQe(n){Object.keys(this.jobs).length&&(this.index=this.size,rQe(this),aQe(n)(null,this.results))}});var z3=$((AaA,q3)=>{var oQe=hT(),nQe=ET(),sQe=CT();q3.exports=gQe;function gQe(n,t,o){for(var i=nQe(n);i.index<(i.keyedList||n).length;)oQe(n,t,i,function(e,a){if(e){o(e,a);return}if(Object.keys(i.jobs).length===0){o(null,i.results);return}}),i.index++;return sQe.bind(i,o)}});var uT=$((taA,dy)=>{var V3=hT(),cQe=ET(),IQe=CT();dy.exports=lQe;dy.exports.ascending=W3;dy.exports.descending=pQe;function lQe(n,t,o,i){var e=cQe(n,o);return V3(n,t,e,function a(A,r){if(A){i(A,r);return}if(e.index++,e.index<(e.keyedList||n).length){V3(n,t,e,a);return}i(null,e.results)}),IQe.bind(e,i)}function W3(n,t){return nt?1:0}function pQe(n,t){return-1*W3(n,t)}});var X3=$((raA,Z3)=>{var dQe=uT();Z3.exports=hQe;function hQe(n,t,o){return dQe(n,t,null,o)}});var ej=$((aaA,$3)=>{$3.exports={parallel:z3(),serial:X3(),serialOrdered:uT()}});var BT=$((iaA,Aj)=>{"use strict";Aj.exports=Object});var rj=$((oaA,tj)=>{"use strict";tj.exports=Error});var ij=$((naA,aj)=>{"use strict";aj.exports=EvalError});var nj=$((saA,oj)=>{"use strict";oj.exports=RangeError});var gj=$((gaA,sj)=>{"use strict";sj.exports=ReferenceError});var Ij=$((caA,cj)=>{"use strict";cj.exports=SyntaxError});var Ec=$((IaA,lj)=>{"use strict";lj.exports=TypeError});var dj=$((laA,pj)=>{"use strict";pj.exports=URIError});var Ej=$((paA,hj)=>{"use strict";hj.exports=Math.abs});var uj=$((daA,Cj)=>{"use strict";Cj.exports=Math.floor});var fj=$((haA,Bj)=>{"use strict";Bj.exports=Math.max});var yj=$((EaA,Qj)=>{"use strict";Qj.exports=Math.min});var Sj=$((CaA,mj)=>{"use strict";mj.exports=Math.pow});var Dj=$((uaA,wj)=>{"use strict";wj.exports=Math.round});var bj=$((BaA,Oj)=>{"use strict";Oj.exports=Number.isNaN||function(t){return t!==t}});var _j=$((faA,Mj)=>{"use strict";var EQe=bj();Mj.exports=function(t){return EQe(t)||t===0?t:t<0?-1:1}});var Nj=$((QaA,Tj)=>{"use strict";Tj.exports=Object.getOwnPropertyDescriptor});var fT=$((yaA,Rj)=>{"use strict";var hy=Nj();if(hy)try{hy([],"length")}catch{hy=null}Rj.exports=hy});var QT=$((maA,kj)=>{"use strict";var Ey=Object.defineProperty||!1;if(Ey)try{Ey({},"a",{value:1})}catch{Ey=!1}kj.exports=Ey});var yT=$((SaA,vj)=>{"use strict";vj.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},o=Symbol("test"),i=Object(o);if(typeof o=="string"||Object.prototype.toString.call(o)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var e=42;t[o]=e;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var A=Object.getOwnPropertySymbols(t);if(A.length!==1||A[0]!==o||!Object.prototype.propertyIsEnumerable.call(t,o))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(t,o);if(r.value!==e||r.enumerable!==!0)return!1}return!0}});var Fj=$((waA,Gj)=>{"use strict";var Pj=typeof Symbol<"u"&&Symbol,CQe=yT();Gj.exports=function(){return typeof Pj!="function"||typeof Symbol!="function"||typeof Pj("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:CQe()}});var mT=$((DaA,Lj)=>{"use strict";Lj.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var ST=$((OaA,Uj)=>{"use strict";var uQe=BT();Uj.exports=uQe.getPrototypeOf||null});var xj=$((baA,Kj)=>{"use strict";var BQe="Function.prototype.bind called on incompatible ",fQe=Object.prototype.toString,QQe=Math.max,yQe="[object Function]",Hj=function(t,o){for(var i=[],e=0;e{"use strict";var wQe=xj();Yj.exports=Function.prototype.bind||wQe});var Cy=$((_aA,jj)=>{"use strict";jj.exports=Function.prototype.call});var wT=$((TaA,Jj)=>{"use strict";Jj.exports=Function.prototype.apply});var zj=$((NaA,qj)=>{"use strict";qj.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Wj=$((RaA,Vj)=>{"use strict";var DQe=hC(),OQe=wT(),bQe=Cy(),MQe=zj();Vj.exports=MQe||DQe.call(bQe,OQe)});var DT=$((kaA,Zj)=>{"use strict";var _Qe=hC(),TQe=Ec(),NQe=Cy(),RQe=Wj();Zj.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new TQe("a function is required");return RQe(_Qe,NQe,t)}});var rJ=$((vaA,tJ)=>{"use strict";var kQe=DT(),Xj=fT(),eJ;try{eJ=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var OT=!!eJ&&Xj&&Xj(Object.prototype,"__proto__"),AJ=Object,$j=AJ.getPrototypeOf;tJ.exports=OT&&typeof OT.get=="function"?kQe([OT.get]):typeof $j=="function"?function(t){return $j(t==null?t:AJ(t))}:!1});var sJ=$((PaA,nJ)=>{"use strict";var aJ=mT(),iJ=ST(),oJ=rJ();nJ.exports=aJ?function(t){return aJ(t)}:iJ?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return iJ(t)}:oJ?function(t){return oJ(t)}:null});var uy=$((GaA,gJ)=>{"use strict";var vQe=Function.prototype.call,PQe=Object.prototype.hasOwnProperty,GQe=hC();gJ.exports=GQe.call(vQe,PQe)});var BC=$((FaA,hJ)=>{"use strict";var it,FQe=BT(),LQe=rj(),UQe=ij(),HQe=nj(),KQe=gj(),id=Ij(),ad=Ec(),xQe=dj(),YQe=Ej(),jQe=uj(),JQe=fj(),qQe=yj(),zQe=Sj(),VQe=Dj(),WQe=_j(),pJ=Function,bT=function(n){try{return pJ('"use strict"; return ('+n+").constructor;")()}catch{}},EC=fT(),ZQe=QT(),MT=function(){throw new ad},XQe=EC?(function(){try{return arguments.callee,MT}catch{try{return EC(arguments,"callee").get}catch{return MT}}})():MT,td=Fj()(),ia=sJ(),$Qe=ST(),eye=mT(),dJ=wT(),CC=Cy(),rd={},Aye=typeof Uint8Array>"u"||!ia?it:ia(Uint8Array),jI={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?it:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?it:ArrayBuffer,"%ArrayIteratorPrototype%":td&&ia?ia([][Symbol.iterator]()):it,"%AsyncFromSyncIteratorPrototype%":it,"%AsyncFunction%":rd,"%AsyncGenerator%":rd,"%AsyncGeneratorFunction%":rd,"%AsyncIteratorPrototype%":rd,"%Atomics%":typeof Atomics>"u"?it:Atomics,"%BigInt%":typeof BigInt>"u"?it:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?it:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?it:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?it:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":LQe,"%eval%":eval,"%EvalError%":UQe,"%Float16Array%":typeof Float16Array>"u"?it:Float16Array,"%Float32Array%":typeof Float32Array>"u"?it:Float32Array,"%Float64Array%":typeof Float64Array>"u"?it:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?it:FinalizationRegistry,"%Function%":pJ,"%GeneratorFunction%":rd,"%Int8Array%":typeof Int8Array>"u"?it:Int8Array,"%Int16Array%":typeof Int16Array>"u"?it:Int16Array,"%Int32Array%":typeof Int32Array>"u"?it:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":td&&ia?ia(ia([][Symbol.iterator]())):it,"%JSON%":typeof JSON=="object"?JSON:it,"%Map%":typeof Map>"u"?it:Map,"%MapIteratorPrototype%":typeof Map>"u"||!td||!ia?it:ia(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":FQe,"%Object.getOwnPropertyDescriptor%":EC,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?it:Promise,"%Proxy%":typeof Proxy>"u"?it:Proxy,"%RangeError%":HQe,"%ReferenceError%":KQe,"%Reflect%":typeof Reflect>"u"?it:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?it:Set,"%SetIteratorPrototype%":typeof Set>"u"||!td||!ia?it:ia(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?it:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":td&&ia?ia(""[Symbol.iterator]()):it,"%Symbol%":td?Symbol:it,"%SyntaxError%":id,"%ThrowTypeError%":XQe,"%TypedArray%":Aye,"%TypeError%":ad,"%Uint8Array%":typeof Uint8Array>"u"?it:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?it:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?it:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?it:Uint32Array,"%URIError%":xQe,"%WeakMap%":typeof WeakMap>"u"?it:WeakMap,"%WeakRef%":typeof WeakRef>"u"?it:WeakRef,"%WeakSet%":typeof WeakSet>"u"?it:WeakSet,"%Function.prototype.call%":CC,"%Function.prototype.apply%":dJ,"%Object.defineProperty%":ZQe,"%Object.getPrototypeOf%":$Qe,"%Math.abs%":YQe,"%Math.floor%":jQe,"%Math.max%":JQe,"%Math.min%":qQe,"%Math.pow%":zQe,"%Math.round%":VQe,"%Math.sign%":WQe,"%Reflect.getPrototypeOf%":eye};if(ia)try{null.error}catch(n){cJ=ia(ia(n)),jI["%Error.prototype%"]=cJ}var cJ,tye=function n(t){var o;if(t==="%AsyncFunction%")o=bT("async function () {}");else if(t==="%GeneratorFunction%")o=bT("function* () {}");else if(t==="%AsyncGeneratorFunction%")o=bT("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(o=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var e=n("%AsyncGenerator%");e&&ia&&(o=ia(e.prototype))}return jI[t]=o,o},IJ={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},uC=hC(),By=uy(),rye=uC.call(CC,Array.prototype.concat),aye=uC.call(dJ,Array.prototype.splice),lJ=uC.call(CC,String.prototype.replace),fy=uC.call(CC,String.prototype.slice),iye=uC.call(CC,RegExp.prototype.exec),oye=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nye=/\\(\\)?/g,sye=function(t){var o=fy(t,0,1),i=fy(t,-1);if(o==="%"&&i!=="%")throw new id("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&o!=="%")throw new id("invalid intrinsic syntax, expected opening `%`");var e=[];return lJ(t,oye,function(a,A,r,s){e[e.length]=r?lJ(s,nye,"$1"):A||a}),e},gye=function(t,o){var i=t,e;if(By(IJ,i)&&(e=IJ[i],i="%"+e[0]+"%"),By(jI,i)){var a=jI[i];if(a===rd&&(a=tye(i)),typeof a>"u"&&!o)throw new ad("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:e,name:i,value:a}}throw new id("intrinsic "+t+" does not exist!")};hJ.exports=function(t,o){if(typeof t!="string"||t.length===0)throw new ad("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new ad('"allowMissing" argument must be a boolean');if(iye(/^%?[^%]*%?$/,t)===null)throw new id("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=sye(t),e=i.length>0?i[0]:"",a=gye("%"+e+"%",o),A=a.name,r=a.value,s=!1,g=a.alias;g&&(e=g[0],aye(i,rye([0,1],g)));for(var c=1,I=!0;c=i.length){var Q=EC(r,d);I=!!Q,I&&"get"in Q&&!("originalValue"in Q.get)?r=Q.get:r=r[d]}else I=By(r,d),r=r[d];I&&!s&&(jI[A]=r)}}return r}});var CJ=$((LaA,EJ)=>{"use strict";var cye=yT();EJ.exports=function(){return cye()&&!!Symbol.toStringTag}});var fJ=$((UaA,BJ)=>{"use strict";var Iye=BC(),uJ=Iye("%Object.defineProperty%",!0),lye=CJ()(),pye=uy(),dye=Ec(),Qy=lye?Symbol.toStringTag:null;BJ.exports=function(t,o){var i=arguments.length>2&&!!arguments[2]&&arguments[2].force,e=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof i<"u"&&typeof i!="boolean"||typeof e<"u"&&typeof e!="boolean")throw new dye("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Qy&&(i||!pye(t,Qy))&&(uJ?uJ(t,Qy,{configurable:!e,enumerable:!1,value:o,writable:!1}):t[Qy]=o)}});var yJ=$((HaA,QJ)=>{"use strict";QJ.exports=function(n,t){return Object.keys(t).forEach(function(o){n[o]=n[o]||t[o]}),n}});var wJ=$((KaA,SJ)=>{"use strict";var RT=T3(),hye=$e("util"),_T=$e("path"),Eye=$e("http"),Cye=$e("https"),uye=$e("url").parse,Bye=$e("fs"),fye=$e("stream").Stream,Qye=$e("crypto"),TT=G3(),yye=ej(),mye=fJ(),Cc=uy(),NT=yJ();function mJ(n){return String(n).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Et(n){if(!(this instanceof Et))return new Et(n);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],RT.call(this),n=n||{};for(var t in n)this[t]=n[t]}hye.inherits(Et,RT);Et.LINE_BREAK=`\r -`;Et.DEFAULT_CONTENT_TYPE="application/octet-stream";Et.prototype.append=function(n,t,o){o=o||{},typeof o=="string"&&(o={filename:o});var i=RT.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var e=this._multiPartHeader(n,t,o),a=this._multiPartFooter();i(e),i(t),i(a),this._trackLength(e,t,o)};Et.prototype._trackLength=function(n,t,o){var i=0;o.knownLength!=null?i+=Number(o.knownLength):Buffer.isBuffer(t)?i=t.length:typeof t=="string"&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(n)+Et.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Cc(t,"httpVersion"))&&!(t instanceof fye))&&(o.knownLength||this._valuesToMeasure.push(t))};Et.prototype._lengthRetriever=function(n,t){Cc(n,"fd")?n.end!=null&&n.end!=1/0&&n.start!=null?t(null,n.end+1-(n.start?n.start:0)):Bye.stat(n.path,function(o,i){if(o){t(o);return}var e=i.size-(n.start?n.start:0);t(null,e)}):Cc(n,"httpVersion")?t(null,Number(n.headers["content-length"])):Cc(n,"httpModule")?(n.on("response",function(o){n.pause(),t(null,Number(o.headers["content-length"]))}),n.resume()):t("Unknown stream")};Et.prototype._multiPartHeader=function(n,t,o){if(typeof o.header=="string")return o.header;var i=this._getContentDisposition(t,o),e=this._getContentType(t,o),a="",A={"Content-Disposition":["form-data",'name="'+mJ(n)+'"'].concat(i||[]),"Content-Type":[].concat(e||[])};typeof o.header=="object"&&NT(A,o.header);var r;for(var s in A)if(Cc(A,s)){if(r=A[s],r==null)continue;Array.isArray(r)||(r=[r]),r.length&&(a+=s+": "+r.join("; ")+Et.LINE_BREAK)}return"--"+this.getBoundary()+Et.LINE_BREAK+a+Et.LINE_BREAK};Et.prototype._getContentDisposition=function(n,t){var o;if(typeof t.filepath=="string"?o=_T.normalize(t.filepath).replace(/\\/g,"/"):t.filename||n&&(n.name||n.path)?o=_T.basename(t.filename||n&&(n.name||n.path)):n&&n.readable&&Cc(n,"httpVersion")&&(o=_T.basename(n.client._httpMessage.path||"")),o)return'filename="'+mJ(o)+'"'};Et.prototype._getContentType=function(n,t){var o=t.contentType;return!o&&n&&n.name&&(o=TT.lookup(n.name)),!o&&n&&n.path&&(o=TT.lookup(n.path)),!o&&n&&n.readable&&Cc(n,"httpVersion")&&(o=n.headers["content-type"]),!o&&(t.filepath||t.filename)&&(o=TT.lookup(t.filepath||t.filename)),!o&&n&&typeof n=="object"&&(o=Et.DEFAULT_CONTENT_TYPE),o};Et.prototype._multiPartFooter=function(){return function(n){var t=Et.LINE_BREAK,o=this._streams.length===0;o&&(t+=this._lastBoundary()),n(t)}.bind(this)};Et.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Et.LINE_BREAK};Et.prototype.getHeaders=function(n){var t,o={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in n)Cc(n,t)&&(o[t.toLowerCase()]=n[t]);return o};Et.prototype.setBoundary=function(n){if(typeof n!="string")throw new TypeError("FormData boundary must be a string");this._boundary=n};Et.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Et.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),t=this.getBoundary(),o=0,i=this._streams.length;o{var sd=1e3,gd=sd*60,cd=gd*60,zI=cd*24,qye=zI*7,zye=zI*365.25;UJ.exports=function(n,t){t=t||{};var o=typeof n;if(o==="string"&&n.length>0)return Vye(n);if(o==="number"&&isFinite(n))return t.long?Zye(n):Wye(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Vye(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var o=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return o*zye;case"weeks":case"week":case"w":return o*qye;case"days":case"day":case"d":return o*zI;case"hours":case"hour":case"hrs":case"hr":case"h":return o*cd;case"minutes":case"minute":case"mins":case"min":case"m":return o*gd;case"seconds":case"second":case"secs":case"sec":case"s":return o*sd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}function Wye(n){var t=Math.abs(n);return t>=zI?Math.round(n/zI)+"d":t>=cd?Math.round(n/cd)+"h":t>=gd?Math.round(n/gd)+"m":t>=sd?Math.round(n/sd)+"s":n+"ms"}function Zye(n){var t=Math.abs(n);return t>=zI?wy(n,t,zI,"day"):t>=cd?wy(n,t,cd,"hour"):t>=gd?wy(n,t,gd,"minute"):t>=sd?wy(n,t,sd,"second"):n+" ms"}function wy(n,t,o,i){var e=t>=o*1.5;return Math.round(n/o)+" "+i+(e?"s":"")}});var VT=$((jiA,KJ)=>{function Xye(n){o.debug=o,o.default=o,o.coerce=s,o.disable=A,o.enable=e,o.enabled=r,o.humanize=HJ(),o.destroy=g,Object.keys(n).forEach(c=>{o[c]=n[c]}),o.names=[],o.skips=[],o.formatters={};function t(c){let I=0;for(let d=0;d{if(L==="%%")return"%";R++;let q=o.formatters[F];if(typeof q=="function"){let V=y[R];L=q.call(m,V),y.splice(R,1),R--}return L}),o.formatArgs.call(m,y),(m.log||o.log).apply(m,y)}return Q.namespace=c,Q.useColors=o.useColors(),Q.color=o.selectColor(c),Q.extend=i,Q.destroy=o.destroy,Object.defineProperty(Q,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(B!==o.namespaces&&(B=o.namespaces,f=o.enabled(c)),f),set:y=>{d=y}}),typeof o.init=="function"&&o.init(Q),Q}function i(c,I){let d=o(this.namespace+(typeof I>"u"?":":I)+c);return d.log=this.log,d}function e(c){o.save(c),o.namespaces=c,o.names=[],o.skips=[];let I=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of I)d[0]==="-"?o.skips.push(d.slice(1)):o.names.push(d)}function a(c,I){let d=0,B=0,f=-1,Q=0;for(;d"-"+I)].join(",");return o.enable(""),c}function r(c){for(let I of o.skips)if(a(c,I))return!1;for(let I of o.names)if(a(c,I))return!0;return!1}function s(c){return c instanceof Error?c.stack||c.message:c}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}KJ.exports=Xye});var xJ=$((Li,Dy)=>{Li.formatArgs=eme;Li.save=Ame;Li.load=tme;Li.useColors=$ye;Li.storage=rme();Li.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Li.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $ye(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function eme(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Dy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,i=0;n[0].replace(/%[a-zA-Z%]/g,e=>{e!=="%%"&&(o++,e==="%c"&&(i=o))}),n.splice(i,0,t)}Li.log=console.debug||console.log||(()=>{});function Ame(n){try{n?Li.storage.setItem("debug",n):Li.storage.removeItem("debug")}catch{}}function tme(){let n;try{n=Li.storage.getItem("debug")||Li.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}function rme(){try{return localStorage}catch{}}Dy.exports=VT()(Li);var{formatters:ame}=Dy.exports;ame.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var jJ=$((oa,by)=>{var ime=$e("tty"),Oy=$e("util");oa.init=lme;oa.log=gme;oa.formatArgs=nme;oa.save=cme;oa.load=Ime;oa.useColors=ome;oa.destroy=Oy.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");oa.colors=[6,2,3,4,5,1];try{let n=$e("supports-color");n&&(n.stderr||n).level>=2&&(oa.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}oa.inspectOpts=Object.keys(process.env).filter(n=>/^debug_/i.test(n)).reduce((n,t)=>{let o=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,a)=>a.toUpperCase()),i=process.env[t];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),n[o]=i,n},{});function ome(){return"colors"in oa.inspectOpts?!!oa.inspectOpts.colors:ime.isatty(process.stderr.fd)}function nme(n){let{namespace:t,useColors:o}=this;if(o){let i=this.color,e="\x1B[3"+(i<8?i:"8;5;"+i),a=` ${e};1m${t} \x1B[0m`;n[0]=a+n[0].split(` +var XIe=Object.create;var FM=Object.defineProperty;var $Ie=Object.getOwnPropertyDescriptor;var ele=Object.getOwnPropertyNames;var Ale=Object.getPrototypeOf,tle=Object.prototype.hasOwnProperty;var $e=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Ce=(n,t)=>()=>(n&&(t=n(n=0)),t);var $=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Fr=(n,t)=>{for(var o in t)FM(n,o,{get:t[o],enumerable:!0})},rle=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of ele(t))!tle.call(n,e)&&e!==o&&FM(n,e,{get:()=>t[e],enumerable:!(i=$Ie(t,e))||i.enumerable});return n};var qe=(n,t,o)=>(o=n!=null?XIe(Ale(n)):{},rle(t||!n||!n.__esModule?FM(o,"default",{value:n,enumerable:!0}):o,n));var O3=$((YrA,D3)=>{var w3=$e("stream").Stream,Ufe=$e("util");D3.exports=yn;function yn(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}Ufe.inherits(yn,w3);yn.create=function(n,t){var o=new this;t=t||{};for(var i in t)o[i]=t[i];o.source=n;var e=n.emit;return n.emit=function(){return o._handleEmit(arguments),e.apply(n,arguments)},n.on("error",function(){}),o.pauseStream&&n.pause(),o};Object.defineProperty(yn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});yn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};yn.prototype.resume=function(){this._released||this.release(),this.source.resume()};yn.prototype.pause=function(){this.source.pause()};yn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(n){this.emit.apply(this,n)}.bind(this)),this._bufferedEvents=[]};yn.prototype.pipe=function(){var n=w3.prototype.pipe.apply(this,arguments);return this.resume(),n};yn.prototype._handleEmit=function(n){if(this._released){this.emit.apply(this,n);return}n[0]==="data"&&(this.dataSize+=n[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(n)};yn.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(n))}}});var T3=$((jrA,_3)=>{var Hfe=$e("util"),M3=$e("stream").Stream,b3=O3();_3.exports=Qr;function Qr(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Hfe.inherits(Qr,M3);Qr.create=function(n){var t=new this;n=n||{};for(var o in n)t[o]=n[o];return t};Qr.isStreamLike=function(n){return typeof n!="function"&&typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&!Buffer.isBuffer(n)};Qr.prototype.append=function(n){var t=Qr.isStreamLike(n);if(t){if(!(n instanceof b3)){var o=b3.create(n,{maxDataSize:1/0,pauseStream:this.pauseStreams});n.on("data",this._checkDataSize.bind(this)),n=o}this._handleErrors(n),this.pauseStreams&&n.pause()}return this._streams.push(n),this};Qr.prototype.pipe=function(n,t){return M3.prototype.pipe.call(this,n,t),this.resume(),n};Qr.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};Qr.prototype._realGetNext=function(){var n=this._streams.shift();if(typeof n>"u"){this.end();return}if(typeof n!="function"){this._pipeNext(n);return}var t=n;t(function(o){var i=Qr.isStreamLike(o);i&&(o.on("data",this._checkDataSize.bind(this)),this._handleErrors(o)),this._pipeNext(o)}.bind(this))};Qr.prototype._pipeNext=function(n){this._currentStream=n;var t=Qr.isStreamLike(n);if(t){n.on("end",this._getNext.bind(this)),n.pipe(this,{end:!1});return}var o=n;this.write(o),this._getNext()};Qr.prototype._handleErrors=function(n){var t=this;n.on("error",function(o){t._emitError(o)})};Qr.prototype.write=function(n){this.emit("data",n)};Qr.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Qr.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};Qr.prototype.end=function(){this._reset(),this.emit("end")};Qr.prototype.destroy=function(){this._reset(),this.emit("close")};Qr.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Qr.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(n))}};Qr.prototype._updateDataSize=function(){this.dataSize=0;var n=this;this._streams.forEach(function(t){t.dataSize&&(n.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};Qr.prototype._emitError=function(n){this._reset(),this.emit("error",n)}});var N3=$((JrA,Kfe)=>{Kfe.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var k3=$((qrA,R3)=>{R3.exports=N3()});var G3=$(Fi=>{"use strict";var py=k3(),xfe=$e("path").extname,v3=/^\s*([^;\s]*)(?:;|\s|$)/,Yfe=/^text\//i;Fi.charset=P3;Fi.charsets={lookup:P3};Fi.contentType=jfe;Fi.extension=Jfe;Fi.extensions=Object.create(null);Fi.lookup=qfe;Fi.types=Object.create(null);zfe(Fi.extensions,Fi.types);function P3(n){if(!n||typeof n!="string")return!1;var t=v3.exec(n),o=t&&py[t[1].toLowerCase()];return o&&o.charset?o.charset:t&&Yfe.test(t[1])?"UTF-8":!1}function jfe(n){if(!n||typeof n!="string")return!1;var t=n.indexOf("/")===-1?Fi.lookup(n):n;if(!t)return!1;if(t.indexOf("charset")===-1){var o=Fi.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t}function Jfe(n){if(!n||typeof n!="string")return!1;var t=v3.exec(n),o=t&&Fi.extensions[t[1].toLowerCase()];return!o||!o.length?!1:o[0]}function qfe(n){if(!n||typeof n!="string")return!1;var t=xfe("x."+n).toLowerCase().substr(1);return t&&Fi.types[t]||!1}function zfe(n,t){var o=["nginx","apache",void 0,"iana"];Object.keys(py).forEach(function(e){var a=py[e],A=a.extensions;if(!(!A||!A.length)){n[e]=A;for(var r=0;rc||g===c&&t[s].substr(0,12)==="application/"))continue}t[s]=e}}})}});var L3=$((VrA,F3)=>{F3.exports=Vfe;function Vfe(n){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(n):setTimeout(n,0)}});var pT=$((WrA,H3)=>{var U3=L3();H3.exports=Wfe;function Wfe(n){var t=!1;return U3(function(){t=!0}),function(i,e){t?n(i,e):U3(function(){n(i,e)})}}});var dT=$((ZrA,K3)=>{K3.exports=Zfe;function Zfe(n){Object.keys(n.jobs).forEach(Xfe.bind(n)),n.jobs={}}function Xfe(n){typeof this.jobs[n]=="function"&&this.jobs[n]()}});var hT=$((XrA,Y3)=>{var x3=pT(),$fe=dT();Y3.exports=eQe;function eQe(n,t,o,i){var e=o.keyedList?o.keyedList[o.index]:o.index;o.jobs[e]=AQe(t,e,n[e],function(a,A){e in o.jobs&&(delete o.jobs[e],a?$fe(o):o.results[e]=A,i(a,o.results))})}function AQe(n,t,o,i){var e;return n.length==2?e=n(o,x3(i)):e=n(o,t,x3(i)),e}});var ET=$(($rA,j3)=>{j3.exports=tQe;function tQe(n,t){var o=!Array.isArray(n),i={index:0,keyedList:o||t?Object.keys(n):null,jobs:{},results:o?{}:[],size:o?Object.keys(n).length:n.length};return t&&i.keyedList.sort(o?t:function(e,a){return t(n[e],n[a])}),i}});var CT=$((eaA,J3)=>{var rQe=dT(),aQe=pT();J3.exports=iQe;function iQe(n){Object.keys(this.jobs).length&&(this.index=this.size,rQe(this),aQe(n)(null,this.results))}});var z3=$((AaA,q3)=>{var oQe=hT(),nQe=ET(),sQe=CT();q3.exports=gQe;function gQe(n,t,o){for(var i=nQe(n);i.index<(i.keyedList||n).length;)oQe(n,t,i,function(e,a){if(e){o(e,a);return}if(Object.keys(i.jobs).length===0){o(null,i.results);return}}),i.index++;return sQe.bind(i,o)}});var uT=$((taA,dy)=>{var V3=hT(),cQe=ET(),IQe=CT();dy.exports=lQe;dy.exports.ascending=W3;dy.exports.descending=pQe;function lQe(n,t,o,i){var e=cQe(n,o);return V3(n,t,e,function a(A,r){if(A){i(A,r);return}if(e.index++,e.index<(e.keyedList||n).length){V3(n,t,e,a);return}i(null,e.results)}),IQe.bind(e,i)}function W3(n,t){return nt?1:0}function pQe(n,t){return-1*W3(n,t)}});var X3=$((raA,Z3)=>{var dQe=uT();Z3.exports=hQe;function hQe(n,t,o){return dQe(n,t,null,o)}});var ej=$((aaA,$3)=>{$3.exports={parallel:z3(),serial:X3(),serialOrdered:uT()}});var BT=$((iaA,Aj)=>{"use strict";Aj.exports=Object});var rj=$((oaA,tj)=>{"use strict";tj.exports=Error});var ij=$((naA,aj)=>{"use strict";aj.exports=EvalError});var nj=$((saA,oj)=>{"use strict";oj.exports=RangeError});var gj=$((gaA,sj)=>{"use strict";sj.exports=ReferenceError});var Ij=$((caA,cj)=>{"use strict";cj.exports=SyntaxError});var Ec=$((IaA,lj)=>{"use strict";lj.exports=TypeError});var dj=$((laA,pj)=>{"use strict";pj.exports=URIError});var Ej=$((paA,hj)=>{"use strict";hj.exports=Math.abs});var uj=$((daA,Cj)=>{"use strict";Cj.exports=Math.floor});var fj=$((haA,Bj)=>{"use strict";Bj.exports=Math.max});var yj=$((EaA,Qj)=>{"use strict";Qj.exports=Math.min});var Sj=$((CaA,mj)=>{"use strict";mj.exports=Math.pow});var Dj=$((uaA,wj)=>{"use strict";wj.exports=Math.round});var bj=$((BaA,Oj)=>{"use strict";Oj.exports=Number.isNaN||function(t){return t!==t}});var _j=$((faA,Mj)=>{"use strict";var EQe=bj();Mj.exports=function(t){return EQe(t)||t===0?t:t<0?-1:1}});var Nj=$((QaA,Tj)=>{"use strict";Tj.exports=Object.getOwnPropertyDescriptor});var fT=$((yaA,Rj)=>{"use strict";var hy=Nj();if(hy)try{hy([],"length")}catch{hy=null}Rj.exports=hy});var QT=$((maA,kj)=>{"use strict";var Ey=Object.defineProperty||!1;if(Ey)try{Ey({},"a",{value:1})}catch{Ey=!1}kj.exports=Ey});var yT=$((SaA,vj)=>{"use strict";vj.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},o=Symbol("test"),i=Object(o);if(typeof o=="string"||Object.prototype.toString.call(o)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var e=42;t[o]=e;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var A=Object.getOwnPropertySymbols(t);if(A.length!==1||A[0]!==o||!Object.prototype.propertyIsEnumerable.call(t,o))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(t,o);if(r.value!==e||r.enumerable!==!0)return!1}return!0}});var Fj=$((waA,Gj)=>{"use strict";var Pj=typeof Symbol<"u"&&Symbol,CQe=yT();Gj.exports=function(){return typeof Pj!="function"||typeof Symbol!="function"||typeof Pj("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:CQe()}});var mT=$((DaA,Lj)=>{"use strict";Lj.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var ST=$((OaA,Uj)=>{"use strict";var uQe=BT();Uj.exports=uQe.getPrototypeOf||null});var xj=$((baA,Kj)=>{"use strict";var BQe="Function.prototype.bind called on incompatible ",fQe=Object.prototype.toString,QQe=Math.max,yQe="[object Function]",Hj=function(t,o){for(var i=[],e=0;e{"use strict";var wQe=xj();Yj.exports=Function.prototype.bind||wQe});var Cy=$((_aA,jj)=>{"use strict";jj.exports=Function.prototype.call});var wT=$((TaA,Jj)=>{"use strict";Jj.exports=Function.prototype.apply});var zj=$((NaA,qj)=>{"use strict";qj.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Wj=$((RaA,Vj)=>{"use strict";var DQe=hC(),OQe=wT(),bQe=Cy(),MQe=zj();Vj.exports=MQe||DQe.call(bQe,OQe)});var DT=$((kaA,Zj)=>{"use strict";var _Qe=hC(),TQe=Ec(),NQe=Cy(),RQe=Wj();Zj.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new TQe("a function is required");return RQe(_Qe,NQe,t)}});var rJ=$((vaA,tJ)=>{"use strict";var kQe=DT(),Xj=fT(),eJ;try{eJ=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var OT=!!eJ&&Xj&&Xj(Object.prototype,"__proto__"),AJ=Object,$j=AJ.getPrototypeOf;tJ.exports=OT&&typeof OT.get=="function"?kQe([OT.get]):typeof $j=="function"?function(t){return $j(t==null?t:AJ(t))}:!1});var sJ=$((PaA,nJ)=>{"use strict";var aJ=mT(),iJ=ST(),oJ=rJ();nJ.exports=aJ?function(t){return aJ(t)}:iJ?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return iJ(t)}:oJ?function(t){return oJ(t)}:null});var uy=$((GaA,gJ)=>{"use strict";var vQe=Function.prototype.call,PQe=Object.prototype.hasOwnProperty,GQe=hC();gJ.exports=GQe.call(vQe,PQe)});var BC=$((FaA,hJ)=>{"use strict";var it,FQe=BT(),LQe=rj(),UQe=ij(),HQe=nj(),KQe=gj(),od=Ij(),id=Ec(),xQe=dj(),YQe=Ej(),jQe=uj(),JQe=fj(),qQe=yj(),zQe=Sj(),VQe=Dj(),WQe=_j(),pJ=Function,bT=function(n){try{return pJ('"use strict"; return ('+n+").constructor;")()}catch{}},EC=fT(),ZQe=QT(),MT=function(){throw new id},XQe=EC?(function(){try{return arguments.callee,MT}catch{try{return EC(arguments,"callee").get}catch{return MT}}})():MT,rd=Fj()(),ia=sJ(),$Qe=ST(),eye=mT(),dJ=wT(),CC=Cy(),ad={},Aye=typeof Uint8Array>"u"||!ia?it:ia(Uint8Array),jI={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?it:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?it:ArrayBuffer,"%ArrayIteratorPrototype%":rd&&ia?ia([][Symbol.iterator]()):it,"%AsyncFromSyncIteratorPrototype%":it,"%AsyncFunction%":ad,"%AsyncGenerator%":ad,"%AsyncGeneratorFunction%":ad,"%AsyncIteratorPrototype%":ad,"%Atomics%":typeof Atomics>"u"?it:Atomics,"%BigInt%":typeof BigInt>"u"?it:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?it:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?it:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?it:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":LQe,"%eval%":eval,"%EvalError%":UQe,"%Float16Array%":typeof Float16Array>"u"?it:Float16Array,"%Float32Array%":typeof Float32Array>"u"?it:Float32Array,"%Float64Array%":typeof Float64Array>"u"?it:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?it:FinalizationRegistry,"%Function%":pJ,"%GeneratorFunction%":ad,"%Int8Array%":typeof Int8Array>"u"?it:Int8Array,"%Int16Array%":typeof Int16Array>"u"?it:Int16Array,"%Int32Array%":typeof Int32Array>"u"?it:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":rd&&ia?ia(ia([][Symbol.iterator]())):it,"%JSON%":typeof JSON=="object"?JSON:it,"%Map%":typeof Map>"u"?it:Map,"%MapIteratorPrototype%":typeof Map>"u"||!rd||!ia?it:ia(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":FQe,"%Object.getOwnPropertyDescriptor%":EC,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?it:Promise,"%Proxy%":typeof Proxy>"u"?it:Proxy,"%RangeError%":HQe,"%ReferenceError%":KQe,"%Reflect%":typeof Reflect>"u"?it:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?it:Set,"%SetIteratorPrototype%":typeof Set>"u"||!rd||!ia?it:ia(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?it:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":rd&&ia?ia(""[Symbol.iterator]()):it,"%Symbol%":rd?Symbol:it,"%SyntaxError%":od,"%ThrowTypeError%":XQe,"%TypedArray%":Aye,"%TypeError%":id,"%Uint8Array%":typeof Uint8Array>"u"?it:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?it:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?it:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?it:Uint32Array,"%URIError%":xQe,"%WeakMap%":typeof WeakMap>"u"?it:WeakMap,"%WeakRef%":typeof WeakRef>"u"?it:WeakRef,"%WeakSet%":typeof WeakSet>"u"?it:WeakSet,"%Function.prototype.call%":CC,"%Function.prototype.apply%":dJ,"%Object.defineProperty%":ZQe,"%Object.getPrototypeOf%":$Qe,"%Math.abs%":YQe,"%Math.floor%":jQe,"%Math.max%":JQe,"%Math.min%":qQe,"%Math.pow%":zQe,"%Math.round%":VQe,"%Math.sign%":WQe,"%Reflect.getPrototypeOf%":eye};if(ia)try{null.error}catch(n){cJ=ia(ia(n)),jI["%Error.prototype%"]=cJ}var cJ,tye=function n(t){var o;if(t==="%AsyncFunction%")o=bT("async function () {}");else if(t==="%GeneratorFunction%")o=bT("function* () {}");else if(t==="%AsyncGeneratorFunction%")o=bT("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(o=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var e=n("%AsyncGenerator%");e&&ia&&(o=ia(e.prototype))}return jI[t]=o,o},IJ={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},uC=hC(),By=uy(),rye=uC.call(CC,Array.prototype.concat),aye=uC.call(dJ,Array.prototype.splice),lJ=uC.call(CC,String.prototype.replace),fy=uC.call(CC,String.prototype.slice),iye=uC.call(CC,RegExp.prototype.exec),oye=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nye=/\\(\\)?/g,sye=function(t){var o=fy(t,0,1),i=fy(t,-1);if(o==="%"&&i!=="%")throw new od("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&o!=="%")throw new od("invalid intrinsic syntax, expected opening `%`");var e=[];return lJ(t,oye,function(a,A,r,s){e[e.length]=r?lJ(s,nye,"$1"):A||a}),e},gye=function(t,o){var i=t,e;if(By(IJ,i)&&(e=IJ[i],i="%"+e[0]+"%"),By(jI,i)){var a=jI[i];if(a===ad&&(a=tye(i)),typeof a>"u"&&!o)throw new id("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:e,name:i,value:a}}throw new od("intrinsic "+t+" does not exist!")};hJ.exports=function(t,o){if(typeof t!="string"||t.length===0)throw new id("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new id('"allowMissing" argument must be a boolean');if(iye(/^%?[^%]*%?$/,t)===null)throw new od("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=sye(t),e=i.length>0?i[0]:"",a=gye("%"+e+"%",o),A=a.name,r=a.value,s=!1,g=a.alias;g&&(e=g[0],aye(i,rye([0,1],g)));for(var c=1,I=!0;c=i.length){var Q=EC(r,d);I=!!Q,I&&"get"in Q&&!("originalValue"in Q.get)?r=Q.get:r=r[d]}else I=By(r,d),r=r[d];I&&!s&&(jI[A]=r)}}return r}});var CJ=$((LaA,EJ)=>{"use strict";var cye=yT();EJ.exports=function(){return cye()&&!!Symbol.toStringTag}});var fJ=$((UaA,BJ)=>{"use strict";var Iye=BC(),uJ=Iye("%Object.defineProperty%",!0),lye=CJ()(),pye=uy(),dye=Ec(),Qy=lye?Symbol.toStringTag:null;BJ.exports=function(t,o){var i=arguments.length>2&&!!arguments[2]&&arguments[2].force,e=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof i<"u"&&typeof i!="boolean"||typeof e<"u"&&typeof e!="boolean")throw new dye("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Qy&&(i||!pye(t,Qy))&&(uJ?uJ(t,Qy,{configurable:!e,enumerable:!1,value:o,writable:!1}):t[Qy]=o)}});var yJ=$((HaA,QJ)=>{"use strict";QJ.exports=function(n,t){return Object.keys(t).forEach(function(o){n[o]=n[o]||t[o]}),n}});var wJ=$((KaA,SJ)=>{"use strict";var RT=T3(),hye=$e("util"),_T=$e("path"),Eye=$e("http"),Cye=$e("https"),uye=$e("url").parse,Bye=$e("fs"),fye=$e("stream").Stream,Qye=$e("crypto"),TT=G3(),yye=ej(),mye=fJ(),Cc=uy(),NT=yJ();function mJ(n){return String(n).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Et(n){if(!(this instanceof Et))return new Et(n);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],RT.call(this),n=n||{};for(var t in n)this[t]=n[t]}hye.inherits(Et,RT);Et.LINE_BREAK=`\r +`;Et.DEFAULT_CONTENT_TYPE="application/octet-stream";Et.prototype.append=function(n,t,o){o=o||{},typeof o=="string"&&(o={filename:o});var i=RT.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var e=this._multiPartHeader(n,t,o),a=this._multiPartFooter();i(e),i(t),i(a),this._trackLength(e,t,o)};Et.prototype._trackLength=function(n,t,o){var i=0;o.knownLength!=null?i+=Number(o.knownLength):Buffer.isBuffer(t)?i=t.length:typeof t=="string"&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(n)+Et.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Cc(t,"httpVersion"))&&!(t instanceof fye))&&(o.knownLength||this._valuesToMeasure.push(t))};Et.prototype._lengthRetriever=function(n,t){Cc(n,"fd")?n.end!=null&&n.end!=1/0&&n.start!=null?t(null,n.end+1-(n.start?n.start:0)):Bye.stat(n.path,function(o,i){if(o){t(o);return}var e=i.size-(n.start?n.start:0);t(null,e)}):Cc(n,"httpVersion")?t(null,Number(n.headers["content-length"])):Cc(n,"httpModule")?(n.on("response",function(o){n.pause(),t(null,Number(o.headers["content-length"]))}),n.resume()):t("Unknown stream")};Et.prototype._multiPartHeader=function(n,t,o){if(typeof o.header=="string")return o.header;var i=this._getContentDisposition(t,o),e=this._getContentType(t,o),a="",A={"Content-Disposition":["form-data",'name="'+mJ(n)+'"'].concat(i||[]),"Content-Type":[].concat(e||[])};typeof o.header=="object"&&NT(A,o.header);var r;for(var s in A)if(Cc(A,s)){if(r=A[s],r==null)continue;Array.isArray(r)||(r=[r]),r.length&&(a+=s+": "+r.join("; ")+Et.LINE_BREAK)}return"--"+this.getBoundary()+Et.LINE_BREAK+a+Et.LINE_BREAK};Et.prototype._getContentDisposition=function(n,t){var o;if(typeof t.filepath=="string"?o=_T.normalize(t.filepath).replace(/\\/g,"/"):t.filename||n&&(n.name||n.path)?o=_T.basename(t.filename||n&&(n.name||n.path)):n&&n.readable&&Cc(n,"httpVersion")&&(o=_T.basename(n.client._httpMessage.path||"")),o)return'filename="'+mJ(o)+'"'};Et.prototype._getContentType=function(n,t){var o=t.contentType;return!o&&n&&n.name&&(o=TT.lookup(n.name)),!o&&n&&n.path&&(o=TT.lookup(n.path)),!o&&n&&n.readable&&Cc(n,"httpVersion")&&(o=n.headers["content-type"]),!o&&(t.filepath||t.filename)&&(o=TT.lookup(t.filepath||t.filename)),!o&&n&&typeof n=="object"&&(o=Et.DEFAULT_CONTENT_TYPE),o};Et.prototype._multiPartFooter=function(){return function(n){var t=Et.LINE_BREAK,o=this._streams.length===0;o&&(t+=this._lastBoundary()),n(t)}.bind(this)};Et.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Et.LINE_BREAK};Et.prototype.getHeaders=function(n){var t,o={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in n)Cc(n,t)&&(o[t.toLowerCase()]=n[t]);return o};Et.prototype.setBoundary=function(n){if(typeof n!="string")throw new TypeError("FormData boundary must be a string");this._boundary=n};Et.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Et.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),t=this.getBoundary(),o=0,i=this._streams.length;o{var gd=1e3,cd=gd*60,Id=cd*60,zI=Id*24,qye=zI*7,zye=zI*365.25;UJ.exports=function(n,t){t=t||{};var o=typeof n;if(o==="string"&&n.length>0)return Vye(n);if(o==="number"&&isFinite(n))return t.long?Zye(n):Wye(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Vye(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var o=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return o*zye;case"weeks":case"week":case"w":return o*qye;case"days":case"day":case"d":return o*zI;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Id;case"minutes":case"minute":case"mins":case"min":case"m":return o*cd;case"seconds":case"second":case"secs":case"sec":case"s":return o*gd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}function Wye(n){var t=Math.abs(n);return t>=zI?Math.round(n/zI)+"d":t>=Id?Math.round(n/Id)+"h":t>=cd?Math.round(n/cd)+"m":t>=gd?Math.round(n/gd)+"s":n+"ms"}function Zye(n){var t=Math.abs(n);return t>=zI?wy(n,t,zI,"day"):t>=Id?wy(n,t,Id,"hour"):t>=cd?wy(n,t,cd,"minute"):t>=gd?wy(n,t,gd,"second"):n+" ms"}function wy(n,t,o,i){var e=t>=o*1.5;return Math.round(n/o)+" "+i+(e?"s":"")}});var VT=$((jiA,KJ)=>{function Xye(n){o.debug=o,o.default=o,o.coerce=s,o.disable=A,o.enable=e,o.enabled=r,o.humanize=HJ(),o.destroy=g,Object.keys(n).forEach(c=>{o[c]=n[c]}),o.names=[],o.skips=[],o.formatters={};function t(c){let I=0;for(let d=0;d{if(L==="%%")return"%";R++;let q=o.formatters[F];if(typeof q=="function"){let V=y[R];L=q.call(m,V),y.splice(R,1),R--}return L}),o.formatArgs.call(m,y),(m.log||o.log).apply(m,y)}return Q.namespace=c,Q.useColors=o.useColors(),Q.color=o.selectColor(c),Q.extend=i,Q.destroy=o.destroy,Object.defineProperty(Q,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(B!==o.namespaces&&(B=o.namespaces,f=o.enabled(c)),f),set:y=>{d=y}}),typeof o.init=="function"&&o.init(Q),Q}function i(c,I){let d=o(this.namespace+(typeof I>"u"?":":I)+c);return d.log=this.log,d}function e(c){o.save(c),o.namespaces=c,o.names=[],o.skips=[];let I=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of I)d[0]==="-"?o.skips.push(d.slice(1)):o.names.push(d)}function a(c,I){let d=0,B=0,f=-1,Q=0;for(;d"-"+I)].join(",");return o.enable(""),c}function r(c){for(let I of o.skips)if(a(c,I))return!1;for(let I of o.names)if(a(c,I))return!0;return!1}function s(c){return c instanceof Error?c.stack||c.message:c}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}KJ.exports=Xye});var xJ=$((Li,Dy)=>{Li.formatArgs=eme;Li.save=Ame;Li.load=tme;Li.useColors=$ye;Li.storage=rme();Li.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Li.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $ye(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function eme(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Dy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,i=0;n[0].replace(/%[a-zA-Z%]/g,e=>{e!=="%%"&&(o++,e==="%c"&&(i=o))}),n.splice(i,0,t)}Li.log=console.debug||console.log||(()=>{});function Ame(n){try{n?Li.storage.setItem("debug",n):Li.storage.removeItem("debug")}catch{}}function tme(){let n;try{n=Li.storage.getItem("debug")||Li.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}function rme(){try{return localStorage}catch{}}Dy.exports=VT()(Li);var{formatters:ame}=Dy.exports;ame.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var jJ=$((oa,by)=>{var ime=$e("tty"),Oy=$e("util");oa.init=lme;oa.log=gme;oa.formatArgs=nme;oa.save=cme;oa.load=Ime;oa.useColors=ome;oa.destroy=Oy.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");oa.colors=[6,2,3,4,5,1];try{let n=$e("supports-color");n&&(n.stderr||n).level>=2&&(oa.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}oa.inspectOpts=Object.keys(process.env).filter(n=>/^debug_/i.test(n)).reduce((n,t)=>{let o=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,a)=>a.toUpperCase()),i=process.env[t];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),n[o]=i,n},{});function ome(){return"colors"in oa.inspectOpts?!!oa.inspectOpts.colors:ime.isatty(process.stderr.fd)}function nme(n){let{namespace:t,useColors:o}=this;if(o){let i=this.color,e="\x1B[3"+(i<8?i:"8;5;"+i),a=` ${e};1m${t} \x1B[0m`;n[0]=a+n[0].split(` `).join(` `+a),n.push(e+"m+"+by.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=sme()+t+" "+n[0]}function sme(){return oa.inspectOpts.hideDate?"":new Date().toISOString()+" "}function gme(...n){return process.stderr.write(Oy.formatWithOptions(oa.inspectOpts,...n)+` `)}function cme(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function Ime(){return process.env.DEBUG}function lme(n){n.inspectOpts={};let t=Object.keys(oa.inspectOpts);for(let o=0;ot.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function My(n,t){return new My.Agent(n,t)}(function(n){class t extends dme.EventEmitter{constructor(i,e){super();let a=e;typeof i=="function"?this.callback=i:i&&(a=i),this.timeout=null,a&&typeof a.timeout=="number"&&(this.timeout=a.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:XT()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:XT()?"https:":"http:"}set protocol(i){this.explicitProtocol=i}callback(i,e,a){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(i,e){let a=Object.assign({},e);typeof a.secureEndpoint!="boolean"&&(a.secureEndpoint=XT()),a.host==null&&(a.host="localhost"),a.port==null&&(a.port=a.secureEndpoint?443:80),a.protocol==null&&(a.protocol=a.secureEndpoint?"https:":"http:"),a.host&&a.path&&delete a.path,delete a.agent,delete a.hostname,delete a._defaultAgent,delete a.defaultPort,delete a.createConnection,i._last=!0,i.shouldKeepAlive=!1;let A=!1,r=null,s=a.timeout||this.timeout,g=B=>{i._hadError||(i.emit("error",B),i._hadError=!0)},c=()=>{r=null,A=!0;let B=new Error(`A "socket" was not created for HTTP request before ${s}ms`);B.code="ETIMEOUT",g(B)},I=B=>{A||(r!==null&&(clearTimeout(r),r=null),g(B))},d=B=>{if(A)return;if(r!=null&&(clearTimeout(r),r=null),Cme(B)){yC("Callback returned another Agent instance %o",B.constructor.name),B.addRequest(i,a);return}if(B){B.once("free",()=>{this.freeSocket(B,a)}),i.onSocket(B);return}let f=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);g(f)};if(typeof this.callback!="function"){g(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(yC("Converting legacy callback function to promise"),this.promisifiedCallback=Eme.default(this.callback)):this.promisifiedCallback=this.callback),typeof s=="number"&&s>0&&(r=setTimeout(c,s)),"port"in a&&typeof a.port!="number"&&(a.port=Number(a.port));try{yC("Resolving socket for %o request: %o",a.protocol,`${i.method} ${i.path}`),Promise.resolve(this.promisifiedCallback(i,a)).then(d,I)}catch(B){Promise.reject(B).catch(I)}}freeSocket(i,e){yC("Freeing socket %o %o",i.constructor.name,e),i.destroy()}destroy(){yC("Destroying agent %o",this.constructor.name)}}n.Agent=t,n.prototype=n.Agent.prototype})(My||(My={}));zJ.exports=My});var WJ=$(SC=>{"use strict";var ume=SC&&SC.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(SC,"__esModule",{value:!0});var Bme=ume(ct()),mC=Bme.default("https-proxy-agent:parse-proxy-response");function fme(n){return new Promise((t,o)=>{let i=0,e=[];function a(){let I=n.read();I?c(I):n.once("readable",a)}function A(){n.removeListener("end",s),n.removeListener("error",g),n.removeListener("close",r),n.removeListener("readable",a)}function r(I){mC("onclose had error %o",I)}function s(){mC("onend")}function g(I){A(),mC("onerror %o",I),o(I)}function c(I){e.push(I),i+=I.length;let d=Buffer.concat(e,i);if(d.indexOf(`\r \r `)===-1){mC("have not received end of HTTP headers yet..."),a();return}let f=d.toString("ascii",0,d.indexOf(`\r -`)),Q=+f.split(" ")[1];mC("got proxy server response: %o",f),t({statusCode:Q,buffered:d})}n.on("error",g),n.on("close",r),n.on("end",s),a()})}SC.default=fme});var $J=$(VI=>{"use strict";var Qme=VI&&VI.__awaiter||function(n,t,o,i){function e(a){return a instanceof o?a:new o(function(A){A(a)})}return new(o||(o=Promise))(function(a,A){function r(c){try{g(i.next(c))}catch(I){A(I)}}function s(c){try{g(i.throw(c))}catch(I){A(I)}}function g(c){c.done?a(c.value):e(c.value).then(r,s)}g((i=i.apply(n,t||[])).next())})},Id=VI&&VI.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(VI,"__esModule",{value:!0});var ZJ=Id($e("net")),XJ=Id($e("tls")),yme=Id($e("url")),mme=Id($e("assert")),Sme=Id(ct()),wme=VJ(),Dme=Id(WJ()),wC=Sme.default("https-proxy-agent:agent"),eN=class extends wme.Agent{constructor(t){let o;if(typeof t=="string"?o=yme.default.parse(t):o=t,!o)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");wC("creating new HttpsProxyAgent instance: %o",o),super(o);let i=Object.assign({},o);this.secureProxy=o.secureProxy||Mme(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in i)&&(i.ALPNProtocols=["http 1.1"]),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(t,o){return Qme(this,void 0,void 0,function*(){let{proxy:i,secureProxy:e}=this,a;e?(wC("Creating `tls.Socket`: %o",i),a=XJ.default.connect(i)):(wC("Creating `net.Socket`: %o",i),a=ZJ.default.connect(i));let A=Object.assign({},i.headers),s=`CONNECT ${`${o.host}:${o.port}`} HTTP/1.1\r +`)),Q=+f.split(" ")[1];mC("got proxy server response: %o",f),t({statusCode:Q,buffered:d})}n.on("error",g),n.on("close",r),n.on("end",s),a()})}SC.default=fme});var $J=$(VI=>{"use strict";var Qme=VI&&VI.__awaiter||function(n,t,o,i){function e(a){return a instanceof o?a:new o(function(A){A(a)})}return new(o||(o=Promise))(function(a,A){function r(c){try{g(i.next(c))}catch(I){A(I)}}function s(c){try{g(i.throw(c))}catch(I){A(I)}}function g(c){c.done?a(c.value):e(c.value).then(r,s)}g((i=i.apply(n,t||[])).next())})},ld=VI&&VI.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(VI,"__esModule",{value:!0});var ZJ=ld($e("net")),XJ=ld($e("tls")),yme=ld($e("url")),mme=ld($e("assert")),Sme=ld(ct()),wme=VJ(),Dme=ld(WJ()),wC=Sme.default("https-proxy-agent:agent"),eN=class extends wme.Agent{constructor(t){let o;if(typeof t=="string"?o=yme.default.parse(t):o=t,!o)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");wC("creating new HttpsProxyAgent instance: %o",o),super(o);let i=Object.assign({},o);this.secureProxy=o.secureProxy||Mme(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in i)&&(i.ALPNProtocols=["http 1.1"]),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(t,o){return Qme(this,void 0,void 0,function*(){let{proxy:i,secureProxy:e}=this,a;e?(wC("Creating `tls.Socket`: %o",i),a=XJ.default.connect(i)):(wC("Creating `net.Socket`: %o",i),a=ZJ.default.connect(i));let A=Object.assign({},i.headers),s=`CONNECT ${`${o.host}:${o.port}`} HTTP/1.1\r `;i.auth&&(A["Proxy-Authorization"]=`Basic ${Buffer.from(i.auth).toString("base64")}`);let{host:g,port:c,secureEndpoint:I}=o;bme(c,I)||(g+=`:${c}`),A.Host=g,A.Connection="close";for(let y of Object.keys(A))s+=`${y}: ${A[y]}\r `;let d=Dme.default(a);a.write(`${s}\r -`);let{statusCode:B,buffered:f}=yield d;if(B===200){if(t.once("socket",Ome),o.secureEndpoint){wC("Upgrading socket connection to TLS");let y=o.servername||o.host;return XJ.default.connect(Object.assign(Object.assign({},_me(o,"host","hostname","path","port")),{socket:a,servername:y}))}return a}a.destroy();let Q=new ZJ.default.Socket({writable:!1});return Q.readable=!0,t.once("socket",y=>{wC("replaying proxy buffer for failed request"),mme.default(y.listenerCount("data")>0),y.push(f),y.push(null)}),Q})}};VI.default=eN;function Ome(n){n.resume()}function bme(n,t){return!!(!t&&n===80||t&&n===443)}function Mme(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function _me(n,...t){let o={},i;for(i in n)t.includes(i)||(o[i]=n[i]);return o}});var aN=$((rN,eq)=>{"use strict";var Tme=rN&&rN.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},AN=Tme($J());function tN(n){return new AN.default(n)}(function(n){n.HttpsProxyAgent=AN.default,n.prototype=AN.default.prototype})(tN||(tN={}));eq.exports=tN});var tq=$((WiA,Aq)=>{var DC;Aq.exports=function(){if(!DC){try{DC=ct()("follow-redirects")}catch{}typeof DC!="function"&&(DC=function(){})}DC.apply(null,arguments)}});var nq=$((ZiA,EN)=>{var bC=$e("url"),OC=bC.URL,Nme=$e("http"),Rme=$e("https"),gN=$e("stream").Writable,cN=$e("assert"),rq=tq();(function(){var t=typeof process<"u",o=typeof window<"u"&&typeof document<"u",i=ZI(Error.captureStackTrace);!t&&(o||!i)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var IN=!1;try{cN(new OC(""))}catch(n){IN=n.code==="ERR_INVALID_URL"}var kme=["Authorization","Proxy-Authorization","Cookie"],vme=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],lN=["abort","aborted","connect","error","socket","timeout"],pN=Object.create(null);lN.forEach(function(n){pN[n]=function(t,o,i){this._redirectable.emit(n,t,o,i)}});var oN=MC("ERR_INVALID_URL","Invalid URL",TypeError),nN=MC("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Pme=MC("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",nN),Gme=MC("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Fme=MC("ERR_STREAM_WRITE_AFTER_END","write after end"),Lme=gN.prototype.destroy||iq;function Ui(n,t){gN.call(this),this._sanitizeOptions(n),this._options=n,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var o=this;this._onNativeResponse=function(i){try{o._processResponse(i)}catch(e){o.emit("error",e instanceof nN?e:new nN({cause:e}))}},this._headerFilter=new RegExp("^(?:"+kme.concat(n.sensitiveHeaders).map(jme).join("|")+")$","i"),this._performRequest()}Ui.prototype=Object.create(gN.prototype);Ui.prototype.abort=function(){hN(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Ui.prototype.destroy=function(n){return hN(this._currentRequest,n),Lme.call(this,n),this};Ui.prototype.write=function(n,t,o){if(this._ending)throw new Fme;if(!WI(n)&&!xme(n))throw new TypeError("data should be a string, Buffer or Uint8Array");if(ZI(t)&&(o=t,t=null),n.length===0){o&&o();return}this._requestBodyLength+n.length<=this._options.maxBodyLength?(this._requestBodyLength+=n.length,this._requestBodyBuffers.push({data:n,encoding:t}),this._currentRequest.write(n,t,o)):(this.emit("error",new Gme),this.abort())};Ui.prototype.end=function(n,t,o){if(ZI(n)?(o=n,n=t=null):ZI(t)&&(o=t,t=null),!n)this._ended=this._ending=!0,this._currentRequest.end(null,null,o);else{var i=this,e=this._currentRequest;this.write(n,t,function(){i._ended=!0,e.end(null,null,o)}),this._ending=!0}};Ui.prototype.setHeader=function(n,t){this._options.headers[n]=t,this._currentRequest.setHeader(n,t)};Ui.prototype.removeHeader=function(n){delete this._options.headers[n],this._currentRequest.removeHeader(n)};Ui.prototype.setTimeout=function(n,t){var o=this;function i(A){A.setTimeout(n),A.removeListener("timeout",A.destroy),A.addListener("timeout",A.destroy)}function e(A){o._timeout&&clearTimeout(o._timeout),o._timeout=setTimeout(function(){o.emit("timeout"),a()},n),i(A)}function a(){o._timeout&&(clearTimeout(o._timeout),o._timeout=null),o.removeListener("abort",a),o.removeListener("error",a),o.removeListener("response",a),o.removeListener("close",a),t&&o.removeListener("timeout",t),o.socket||o._currentRequest.removeListener("socket",e)}return t&&this.on("timeout",t),this.socket?e(this.socket):this._currentRequest.once("socket",e),this.on("socket",i),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(n){Ui.prototype[n]=function(t,o){return this._currentRequest[n](t,o)}});["aborted","connection","socket"].forEach(function(n){Object.defineProperty(Ui.prototype,n,{get:function(){return this._currentRequest[n]}})});Ui.prototype._sanitizeOptions=function(n){if(n.headers||(n.headers={}),Kme(n.sensitiveHeaders)||(n.sensitiveHeaders=[]),n.host&&(n.hostname||(n.hostname=n.host),delete n.host),!n.pathname&&n.path){var t=n.path.indexOf("?");t<0?n.pathname=n.path:(n.pathname=n.path.substring(0,t),n.search=n.path.substring(t))}};Ui.prototype._performRequest=function(){var n=this._options.protocol,t=this._options.nativeProtocols[n];if(!t)throw new TypeError("Unsupported protocol "+n);if(this._options.agents){var o=n.slice(0,-1);this._options.agent=this._options.agents[o]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);i._redirectable=this;for(var e of lN)i.on(e,pN[e]);if(this._currentUrl=/^\//.test(this._options.path)?bC.format(this._options):this._options.path,this._isRedirect){var a=0,A=this,r=this._requestBodyBuffers;(function s(g){if(i===A._currentRequest)if(g)A.emit("error",g);else if(a=400){n.responseUrl=this._currentUrl,n.redirects=this._redirects,this.emit("response",n),this._requestBodyBuffers=[];return}if(hN(this._currentRequest),n.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Pme;var i,e=this._options.beforeRedirect;e&&(i=Object.assign({Host:n.req.getHeader("host")},this._options.headers));var a=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],iN(/^content-/i,this._options.headers));var A=iN(/^host$/i,this._options.headers),r=dN(this._currentUrl),s=A||r.host,g=/^\w+:/.test(o)?this._currentUrl:bC.format(Object.assign(r,{host:s})),c=Ume(o,g);if(rq("redirecting to",c.href),this._isRedirect=!0,sN(c,this._options),(c.protocol!==r.protocol&&c.protocol!=="https:"||c.host!==s&&!Hme(c.host,s))&&iN(this._headerFilter,this._options.headers),ZI(e)){var I={headers:n.headers,statusCode:t},d={url:g,method:a,headers:i};e(this._options,I,d),this._sanitizeOptions(this._options)}this._performRequest()};function aq(n){var t={maxRedirects:21,maxBodyLength:10485760},o={};return Object.keys(n).forEach(function(i){var e=i+":",a=o[e]=n[i],A=t[i]=Object.create(a);function r(g,c,I){return Yme(g)?g=sN(g):WI(g)?g=sN(dN(g)):(I=c,c=oq(g),g={protocol:e}),ZI(c)&&(I=c,c=null),c=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},g,c),c.nativeProtocols=o,!WI(c.host)&&!WI(c.hostname)&&(c.hostname="::1"),cN.equal(c.protocol,e,"protocol mismatch"),rq("options",c),new Ui(c,I)}function s(g,c,I){var d=A.request(g,c,I);return d.end(),d}Object.defineProperties(A,{request:{value:r,configurable:!0,enumerable:!0,writable:!0},get:{value:s,configurable:!0,enumerable:!0,writable:!0}})}),t}function iq(){}function dN(n){var t;if(IN)t=new OC(n);else if(t=oq(bC.parse(n)),!WI(t.protocol))throw new oN({input:n});return t}function Ume(n,t){return IN?new OC(n,t):dN(bC.resolve(t,n))}function oq(n){if(/^\[/.test(n.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(n.hostname))throw new oN({input:n.href||n});if(/^\[/.test(n.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(n.host))throw new oN({input:n.href||n});return n}function sN(n,t){var o=t||{};for(var i of vme)o[i]=n[i];return o.hostname.startsWith("[")&&(o.hostname=o.hostname.slice(1,-1)),o.port!==""&&(o.port=Number(o.port)),o.path=o.search?o.pathname+o.search:o.pathname,o}function iN(n,t){var o;for(var i in t)n.test(i)&&(o=t[i],delete t[i]);return o===null||typeof o>"u"?void 0:String(o).trim()}function MC(n,t,o){function i(e){ZI(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,e||{}),this.code=n,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(o||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+n+"]",enumerable:!1}}),i}function hN(n,t){for(var o of lN)n.removeListener(o,pN[o]);n.on("error",iq),n.destroy(t)}function Hme(n,t){cN(WI(n)&&WI(t));var o=n.length-t.length-1;return o>0&&n[o]==="."&&n.endsWith(t)}function Kme(n){return n instanceof Array}function WI(n){return typeof n=="string"||n instanceof String}function ZI(n){return typeof n=="function"}function xme(n){return typeof n=="object"&&"length"in n}function Yme(n){return OC&&n instanceof OC}function jme(n){return n.replace(/[\]\\/()*+?.$]/g,"\\$&")}EN.exports=aq({http:Nme,https:Rme});EN.exports.wrap=aq});var r4=$((EgA,t4)=>{t4.exports=$e("util").inspect});var UC=$((CgA,m4)=>{var zN=typeof Map=="function"&&Map.prototype,LN=Object.getOwnPropertyDescriptor&&zN?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Fy=zN&&LN&&typeof LN.get=="function"?LN.get:null,a4=zN&&Map.prototype.forEach,VN=typeof Set=="function"&&Set.prototype,UN=Object.getOwnPropertyDescriptor&&VN?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ly=VN&&UN&&typeof UN.get=="function"?UN.get:null,i4=VN&&Set.prototype.forEach,awe=typeof WeakMap=="function"&&WeakMap.prototype,GC=awe?WeakMap.prototype.has:null,iwe=typeof WeakSet=="function"&&WeakSet.prototype,FC=iwe?WeakSet.prototype.has:null,owe=typeof WeakRef=="function"&&WeakRef.prototype,o4=owe?WeakRef.prototype.deref:null,nwe=Boolean.prototype.valueOf,swe=Object.prototype.toString,gwe=Function.prototype.toString,cwe=String.prototype.match,WN=String.prototype.slice,fc=String.prototype.replace,Iwe=String.prototype.toUpperCase,n4=String.prototype.toLowerCase,E4=RegExp.prototype.test,s4=Array.prototype.concat,Is=Array.prototype.join,lwe=Array.prototype.slice,g4=Math.floor,xN=typeof BigInt=="function"?BigInt.prototype.valueOf:null,HN=Object.getOwnPropertySymbols,YN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hd=typeof Symbol=="function"&&typeof Symbol.iterator=="object",LC=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hd||!0)?Symbol.toStringTag:null,C4=Object.prototype.propertyIsEnumerable,c4=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function I4(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||E4.call(/e/,t))return t;var o=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var i=n<0?-g4(-n):g4(n);if(i!==n){var e=String(i),a=WN.call(t,e.length+1);return fc.call(e,o,"$&_")+"."+fc.call(fc.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fc.call(t,o,"$&_")}var jN=r4(),l4=jN.custom,p4=f4(l4)?l4:null,u4={__proto__:null,double:'"',single:"'"},pwe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};m4.exports=function n(t,o,i,e){var a=o||{};if(ug(a,"quoteStyle")&&!ug(u4,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ug(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var A=ug(a,"customInspect")?a.customInspect:!0;if(typeof A!="boolean"&&A!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ug(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ug(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=a.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return y4(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var s=String(t);return r?I4(t,s):s}if(typeof t=="bigint"){var g=String(t)+"n";return r?I4(t,g):g}var c=typeof a.depth>"u"?5:a.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return JN(t)?"[Array]":"[Object]";var I=Twe(a,i);if(typeof e>"u")e=[];else if(Q4(e,t)>=0)return"[Circular]";function d(U,N,k){if(N&&(e=lwe.call(e),e.push(N)),k){var z={depth:a.depth};return ug(a,"quoteStyle")&&(z.quoteStyle=a.quoteStyle),n(U,z,i+1,e)}return n(U,a,i+1,e)}if(typeof t=="function"&&!d4(t)){var B=ywe(t),f=Gy(t,d);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(f.length>0?" { "+Is.call(f,", ")+" }":"")}if(f4(t)){var Q=hd?fc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):YN.call(t);return typeof t=="object"&&!hd?PC(Q):Q}if(bwe(t)){for(var y="<"+n4.call(String(t.nodeName)),m=t.attributes||[],T=0;T",y}if(JN(t)){if(t.length===0)return"[]";var _=Gy(t,d);return I&&!_we(_)?"["+qN(_,I)+"]":"[ "+Is.call(_,", ")+" ]"}if(Ewe(t)){var R=Gy(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!C4.call(t,"cause")?"{ ["+String(t)+"] "+Is.call(s4.call("[cause]: "+d(t.cause),R),", ")+" }":R.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Is.call(R,", ")+" }"}if(typeof t=="object"&&A){if(p4&&typeof t[p4]=="function"&&jN)return jN(t,{depth:c-i});if(A!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(mwe(t)){var K=[];return a4&&a4.call(t,function(U,N){K.push(d(N,t,!0)+" => "+d(U,t))}),h4("Map",Fy.call(t),K,I)}if(Dwe(t)){var L=[];return i4&&i4.call(t,function(U){L.push(d(U,t))}),h4("Set",Ly.call(t),L,I)}if(Swe(t))return KN("WeakMap");if(Owe(t))return KN("WeakSet");if(wwe(t))return KN("WeakRef");if(uwe(t))return PC(d(Number(t)));if(fwe(t))return PC(d(xN.call(t)));if(Bwe(t))return PC(nwe.call(t));if(Cwe(t))return PC(d(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!hwe(t)&&!d4(t)){var F=Gy(t,d),q=c4?c4(t)===Object.prototype:t instanceof Object||t.constructor===Object,V=t instanceof Object?"":"null prototype",x=!q&&LC&&Object(t)===t&&LC in t?WN.call(Qc(t),8,-1):V?"Object":"",G=q||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",J=G+(x||V?"["+Is.call(s4.call([],x||[],V||[]),": ")+"] ":"");return F.length===0?J+"{}":I?J+"{"+qN(F,I)+"}":J+"{ "+Is.call(F,", ")+" }"}return String(t)};function B4(n,t,o){var i=o.quoteStyle||t,e=u4[i];return e+n+e}function dwe(n){return fc.call(String(n),/"/g,""")}function $I(n){return!LC||!(typeof n=="object"&&(LC in n||typeof n[LC]<"u"))}function JN(n){return Qc(n)==="[object Array]"&&$I(n)}function hwe(n){return Qc(n)==="[object Date]"&&$I(n)}function d4(n){return Qc(n)==="[object RegExp]"&&$I(n)}function Ewe(n){return Qc(n)==="[object Error]"&&$I(n)}function Cwe(n){return Qc(n)==="[object String]"&&$I(n)}function uwe(n){return Qc(n)==="[object Number]"&&$I(n)}function Bwe(n){return Qc(n)==="[object Boolean]"&&$I(n)}function f4(n){if(hd)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!YN)return!1;try{return YN.call(n),!0}catch{}return!1}function fwe(n){if(!n||typeof n!="object"||!xN)return!1;try{return xN.call(n),!0}catch{}return!1}var Qwe=Object.prototype.hasOwnProperty||function(n){return n in this};function ug(n,t){return Qwe.call(n,t)}function Qc(n){return swe.call(n)}function ywe(n){if(n.name)return n.name;var t=cwe.call(gwe.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function Q4(n,t){if(n.indexOf)return n.indexOf(t);for(var o=0,i=n.length;ot.maxStringLength){var o=n.length-t.maxStringLength,i="... "+o+" more character"+(o>1?"s":"");return y4(WN.call(n,0,t.maxStringLength),t)+i}var e=pwe[t.quoteStyle||"single"];e.lastIndex=0;var a=fc.call(fc.call(n,e,"\\$1"),/[\x00-\x1f]/g,Mwe);return B4(a,"single",t)}function Mwe(n){var t=n.charCodeAt(0),o={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return o?"\\"+o:"\\x"+(t<16?"0":"")+Iwe.call(t.toString(16))}function PC(n){return"Object("+n+")"}function KN(n){return n+" { ? }"}function h4(n,t,o,i){var e=i?qN(o,i):Is.call(o,", ");return n+" ("+t+") {"+e+"}"}function _we(n){for(var t=0;t{wC("replaying proxy buffer for failed request"),mme.default(y.listenerCount("data")>0),y.push(f),y.push(null)}),Q})}};VI.default=eN;function Ome(n){n.resume()}function bme(n,t){return!!(!t&&n===80||t&&n===443)}function Mme(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function _me(n,...t){let o={},i;for(i in n)t.includes(i)||(o[i]=n[i]);return o}});var aN=$((rN,eq)=>{"use strict";var Tme=rN&&rN.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},AN=Tme($J());function tN(n){return new AN.default(n)}(function(n){n.HttpsProxyAgent=AN.default,n.prototype=AN.default.prototype})(tN||(tN={}));eq.exports=tN});var tq=$((WiA,Aq)=>{var DC;Aq.exports=function(){if(!DC){try{DC=ct()("follow-redirects")}catch{}typeof DC!="function"&&(DC=function(){})}DC.apply(null,arguments)}});var nq=$((ZiA,EN)=>{var bC=$e("url"),OC=bC.URL,Nme=$e("http"),Rme=$e("https"),gN=$e("stream").Writable,cN=$e("assert"),rq=tq();(function(){var t=typeof process<"u",o=typeof window<"u"&&typeof document<"u",i=ZI(Error.captureStackTrace);!t&&(o||!i)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var IN=!1;try{cN(new OC(""))}catch(n){IN=n.code==="ERR_INVALID_URL"}var kme=["Authorization","Proxy-Authorization","Cookie"],vme=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],lN=["abort","aborted","connect","error","socket","timeout"],pN=Object.create(null);lN.forEach(function(n){pN[n]=function(t,o,i){this._redirectable.emit(n,t,o,i)}});var oN=MC("ERR_INVALID_URL","Invalid URL",TypeError),nN=MC("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Pme=MC("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",nN),Gme=MC("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Fme=MC("ERR_STREAM_WRITE_AFTER_END","write after end"),Lme=gN.prototype.destroy||iq;function Ui(n,t){gN.call(this),this._sanitizeOptions(n),this._options=n,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var o=this;this._onNativeResponse=function(i){try{o._processResponse(i)}catch(e){o.emit("error",e instanceof nN?e:new nN({cause:e}))}},this._headerFilter=new RegExp("^(?:"+kme.concat(n.sensitiveHeaders).map(jme).join("|")+")$","i"),this._performRequest()}Ui.prototype=Object.create(gN.prototype);Ui.prototype.abort=function(){hN(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Ui.prototype.destroy=function(n){return hN(this._currentRequest,n),Lme.call(this,n),this};Ui.prototype.write=function(n,t,o){if(this._ending)throw new Fme;if(!WI(n)&&!xme(n))throw new TypeError("data should be a string, Buffer or Uint8Array");if(ZI(t)&&(o=t,t=null),n.length===0){o&&o();return}this._requestBodyLength+n.length<=this._options.maxBodyLength?(this._requestBodyLength+=n.length,this._requestBodyBuffers.push({data:n,encoding:t}),this._currentRequest.write(n,t,o)):(this.emit("error",new Gme),this.abort())};Ui.prototype.end=function(n,t,o){if(ZI(n)?(o=n,n=t=null):ZI(t)&&(o=t,t=null),!n)this._ended=this._ending=!0,this._currentRequest.end(null,null,o);else{var i=this,e=this._currentRequest;this.write(n,t,function(){i._ended=!0,e.end(null,null,o)}),this._ending=!0}};Ui.prototype.setHeader=function(n,t){this._options.headers[n]=t,this._currentRequest.setHeader(n,t)};Ui.prototype.removeHeader=function(n){delete this._options.headers[n],this._currentRequest.removeHeader(n)};Ui.prototype.setTimeout=function(n,t){var o=this;function i(A){A.setTimeout(n),A.removeListener("timeout",A.destroy),A.addListener("timeout",A.destroy)}function e(A){o._timeout&&clearTimeout(o._timeout),o._timeout=setTimeout(function(){o.emit("timeout"),a()},n),i(A)}function a(){o._timeout&&(clearTimeout(o._timeout),o._timeout=null),o.removeListener("abort",a),o.removeListener("error",a),o.removeListener("response",a),o.removeListener("close",a),t&&o.removeListener("timeout",t),o.socket||o._currentRequest.removeListener("socket",e)}return t&&this.on("timeout",t),this.socket?e(this.socket):this._currentRequest.once("socket",e),this.on("socket",i),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(n){Ui.prototype[n]=function(t,o){return this._currentRequest[n](t,o)}});["aborted","connection","socket"].forEach(function(n){Object.defineProperty(Ui.prototype,n,{get:function(){return this._currentRequest[n]}})});Ui.prototype._sanitizeOptions=function(n){if(n.headers||(n.headers={}),Kme(n.sensitiveHeaders)||(n.sensitiveHeaders=[]),n.host&&(n.hostname||(n.hostname=n.host),delete n.host),!n.pathname&&n.path){var t=n.path.indexOf("?");t<0?n.pathname=n.path:(n.pathname=n.path.substring(0,t),n.search=n.path.substring(t))}};Ui.prototype._performRequest=function(){var n=this._options.protocol,t=this._options.nativeProtocols[n];if(!t)throw new TypeError("Unsupported protocol "+n);if(this._options.agents){var o=n.slice(0,-1);this._options.agent=this._options.agents[o]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);i._redirectable=this;for(var e of lN)i.on(e,pN[e]);if(this._currentUrl=/^\//.test(this._options.path)?bC.format(this._options):this._options.path,this._isRedirect){var a=0,A=this,r=this._requestBodyBuffers;(function s(g){if(i===A._currentRequest)if(g)A.emit("error",g);else if(a=400){n.responseUrl=this._currentUrl,n.redirects=this._redirects,this.emit("response",n),this._requestBodyBuffers=[];return}if(hN(this._currentRequest),n.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Pme;var i,e=this._options.beforeRedirect;e&&(i=Object.assign({Host:n.req.getHeader("host")},this._options.headers));var a=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],iN(/^content-/i,this._options.headers));var A=iN(/^host$/i,this._options.headers),r=dN(this._currentUrl),s=A||r.host,g=/^\w+:/.test(o)?this._currentUrl:bC.format(Object.assign(r,{host:s})),c=Ume(o,g);if(rq("redirecting to",c.href),this._isRedirect=!0,sN(c,this._options),(c.protocol!==r.protocol&&c.protocol!=="https:"||c.host!==s&&!Hme(c.host,s))&&iN(this._headerFilter,this._options.headers),ZI(e)){var I={headers:n.headers,statusCode:t},d={url:g,method:a,headers:i};e(this._options,I,d),this._sanitizeOptions(this._options)}this._performRequest()};function aq(n){var t={maxRedirects:21,maxBodyLength:10485760},o={};return Object.keys(n).forEach(function(i){var e=i+":",a=o[e]=n[i],A=t[i]=Object.create(a);function r(g,c,I){return Yme(g)?g=sN(g):WI(g)?g=sN(dN(g)):(I=c,c=oq(g),g={protocol:e}),ZI(c)&&(I=c,c=null),c=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},g,c),c.nativeProtocols=o,!WI(c.host)&&!WI(c.hostname)&&(c.hostname="::1"),cN.equal(c.protocol,e,"protocol mismatch"),rq("options",c),new Ui(c,I)}function s(g,c,I){var d=A.request(g,c,I);return d.end(),d}Object.defineProperties(A,{request:{value:r,configurable:!0,enumerable:!0,writable:!0},get:{value:s,configurable:!0,enumerable:!0,writable:!0}})}),t}function iq(){}function dN(n){var t;if(IN)t=new OC(n);else if(t=oq(bC.parse(n)),!WI(t.protocol))throw new oN({input:n});return t}function Ume(n,t){return IN?new OC(n,t):dN(bC.resolve(t,n))}function oq(n){if(/^\[/.test(n.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(n.hostname))throw new oN({input:n.href||n});if(/^\[/.test(n.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(n.host))throw new oN({input:n.href||n});return n}function sN(n,t){var o=t||{};for(var i of vme)o[i]=n[i];return o.hostname.startsWith("[")&&(o.hostname=o.hostname.slice(1,-1)),o.port!==""&&(o.port=Number(o.port)),o.path=o.search?o.pathname+o.search:o.pathname,o}function iN(n,t){var o;for(var i in t)n.test(i)&&(o=t[i],delete t[i]);return o===null||typeof o>"u"?void 0:String(o).trim()}function MC(n,t,o){function i(e){ZI(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,e||{}),this.code=n,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(o||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+n+"]",enumerable:!1}}),i}function hN(n,t){for(var o of lN)n.removeListener(o,pN[o]);n.on("error",iq),n.destroy(t)}function Hme(n,t){cN(WI(n)&&WI(t));var o=n.length-t.length-1;return o>0&&n[o]==="."&&n.endsWith(t)}function Kme(n){return n instanceof Array}function WI(n){return typeof n=="string"||n instanceof String}function ZI(n){return typeof n=="function"}function xme(n){return typeof n=="object"&&"length"in n}function Yme(n){return OC&&n instanceof OC}function jme(n){return n.replace(/[\]\\/()*+?.$]/g,"\\$&")}EN.exports=aq({http:Nme,https:Rme});EN.exports.wrap=aq});var r4=$((EgA,t4)=>{t4.exports=$e("util").inspect});var UC=$((CgA,m4)=>{var zN=typeof Map=="function"&&Map.prototype,LN=Object.getOwnPropertyDescriptor&&zN?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Fy=zN&&LN&&typeof LN.get=="function"?LN.get:null,a4=zN&&Map.prototype.forEach,VN=typeof Set=="function"&&Set.prototype,UN=Object.getOwnPropertyDescriptor&&VN?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ly=VN&&UN&&typeof UN.get=="function"?UN.get:null,i4=VN&&Set.prototype.forEach,awe=typeof WeakMap=="function"&&WeakMap.prototype,GC=awe?WeakMap.prototype.has:null,iwe=typeof WeakSet=="function"&&WeakSet.prototype,FC=iwe?WeakSet.prototype.has:null,owe=typeof WeakRef=="function"&&WeakRef.prototype,o4=owe?WeakRef.prototype.deref:null,nwe=Boolean.prototype.valueOf,swe=Object.prototype.toString,gwe=Function.prototype.toString,cwe=String.prototype.match,WN=String.prototype.slice,fc=String.prototype.replace,Iwe=String.prototype.toUpperCase,n4=String.prototype.toLowerCase,E4=RegExp.prototype.test,s4=Array.prototype.concat,Is=Array.prototype.join,lwe=Array.prototype.slice,g4=Math.floor,xN=typeof BigInt=="function"?BigInt.prototype.valueOf:null,HN=Object.getOwnPropertySymbols,YN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ed=typeof Symbol=="function"&&typeof Symbol.iterator=="object",LC=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ed||!0)?Symbol.toStringTag:null,C4=Object.prototype.propertyIsEnumerable,c4=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function I4(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||E4.call(/e/,t))return t;var o=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var i=n<0?-g4(-n):g4(n);if(i!==n){var e=String(i),a=WN.call(t,e.length+1);return fc.call(e,o,"$&_")+"."+fc.call(fc.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fc.call(t,o,"$&_")}var jN=r4(),l4=jN.custom,p4=f4(l4)?l4:null,u4={__proto__:null,double:'"',single:"'"},pwe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};m4.exports=function n(t,o,i,e){var a=o||{};if(ug(a,"quoteStyle")&&!ug(u4,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ug(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var A=ug(a,"customInspect")?a.customInspect:!0;if(typeof A!="boolean"&&A!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ug(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ug(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=a.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return y4(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var s=String(t);return r?I4(t,s):s}if(typeof t=="bigint"){var g=String(t)+"n";return r?I4(t,g):g}var c=typeof a.depth>"u"?5:a.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return JN(t)?"[Array]":"[Object]";var I=Twe(a,i);if(typeof e>"u")e=[];else if(Q4(e,t)>=0)return"[Circular]";function d(U,N,k){if(N&&(e=lwe.call(e),e.push(N)),k){var z={depth:a.depth};return ug(a,"quoteStyle")&&(z.quoteStyle=a.quoteStyle),n(U,z,i+1,e)}return n(U,a,i+1,e)}if(typeof t=="function"&&!d4(t)){var B=ywe(t),f=Gy(t,d);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(f.length>0?" { "+Is.call(f,", ")+" }":"")}if(f4(t)){var Q=Ed?fc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):YN.call(t);return typeof t=="object"&&!Ed?PC(Q):Q}if(bwe(t)){for(var y="<"+n4.call(String(t.nodeName)),m=t.attributes||[],T=0;T",y}if(JN(t)){if(t.length===0)return"[]";var _=Gy(t,d);return I&&!_we(_)?"["+qN(_,I)+"]":"[ "+Is.call(_,", ")+" ]"}if(Ewe(t)){var R=Gy(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!C4.call(t,"cause")?"{ ["+String(t)+"] "+Is.call(s4.call("[cause]: "+d(t.cause),R),", ")+" }":R.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Is.call(R,", ")+" }"}if(typeof t=="object"&&A){if(p4&&typeof t[p4]=="function"&&jN)return jN(t,{depth:c-i});if(A!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(mwe(t)){var K=[];return a4&&a4.call(t,function(U,N){K.push(d(N,t,!0)+" => "+d(U,t))}),h4("Map",Fy.call(t),K,I)}if(Dwe(t)){var L=[];return i4&&i4.call(t,function(U){L.push(d(U,t))}),h4("Set",Ly.call(t),L,I)}if(Swe(t))return KN("WeakMap");if(Owe(t))return KN("WeakSet");if(wwe(t))return KN("WeakRef");if(uwe(t))return PC(d(Number(t)));if(fwe(t))return PC(d(xN.call(t)));if(Bwe(t))return PC(nwe.call(t));if(Cwe(t))return PC(d(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!hwe(t)&&!d4(t)){var F=Gy(t,d),q=c4?c4(t)===Object.prototype:t instanceof Object||t.constructor===Object,V=t instanceof Object?"":"null prototype",x=!q&&LC&&Object(t)===t&&LC in t?WN.call(Qc(t),8,-1):V?"Object":"",G=q||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",J=G+(x||V?"["+Is.call(s4.call([],x||[],V||[]),": ")+"] ":"");return F.length===0?J+"{}":I?J+"{"+qN(F,I)+"}":J+"{ "+Is.call(F,", ")+" }"}return String(t)};function B4(n,t,o){var i=o.quoteStyle||t,e=u4[i];return e+n+e}function dwe(n){return fc.call(String(n),/"/g,""")}function $I(n){return!LC||!(typeof n=="object"&&(LC in n||typeof n[LC]<"u"))}function JN(n){return Qc(n)==="[object Array]"&&$I(n)}function hwe(n){return Qc(n)==="[object Date]"&&$I(n)}function d4(n){return Qc(n)==="[object RegExp]"&&$I(n)}function Ewe(n){return Qc(n)==="[object Error]"&&$I(n)}function Cwe(n){return Qc(n)==="[object String]"&&$I(n)}function uwe(n){return Qc(n)==="[object Number]"&&$I(n)}function Bwe(n){return Qc(n)==="[object Boolean]"&&$I(n)}function f4(n){if(Ed)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!YN)return!1;try{return YN.call(n),!0}catch{}return!1}function fwe(n){if(!n||typeof n!="object"||!xN)return!1;try{return xN.call(n),!0}catch{}return!1}var Qwe=Object.prototype.hasOwnProperty||function(n){return n in this};function ug(n,t){return Qwe.call(n,t)}function Qc(n){return swe.call(n)}function ywe(n){if(n.name)return n.name;var t=cwe.call(gwe.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function Q4(n,t){if(n.indexOf)return n.indexOf(t);for(var o=0,i=n.length;ot.maxStringLength){var o=n.length-t.maxStringLength,i="... "+o+" more character"+(o>1?"s":"");return y4(WN.call(n,0,t.maxStringLength),t)+i}var e=pwe[t.quoteStyle||"single"];e.lastIndex=0;var a=fc.call(fc.call(n,e,"\\$1"),/[\x00-\x1f]/g,Mwe);return B4(a,"single",t)}function Mwe(n){var t=n.charCodeAt(0),o={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return o?"\\"+o:"\\x"+(t<16?"0":"")+Iwe.call(t.toString(16))}function PC(n){return"Object("+n+")"}function KN(n){return n+" { ? }"}function h4(n,t,o,i){var e=i?qN(o,i):Is.call(o,", ");return n+" ("+t+") {"+e+"}"}function _we(n){for(var t=0;t=0)return!1;return!0}function Twe(n,t){var o;if(n.indent===" ")o=" ";else if(typeof n.indent=="number"&&n.indent>0)o=Is.call(Array(n.indent+1)," ");else return null;return{base:o,prev:Is.call(Array(t+1),o)}}function qN(n,t){if(n.length===0)return"";var o=` `+t.prev+t.base;return o+Is.call(n,","+o)+` -`+t.prev}function Gy(n,t){var o=JN(n),i=[];if(o){i.length=n.length;for(var e=0;e{"use strict";var Nwe=UC(),Rwe=Ec(),Uy=function(n,t,o){for(var i=n,e;(e=i.next)!=null;i=e)if(e.key===t)return i.next=e.next,o||(e.next=n.next,n.next=e),e},kwe=function(n,t){if(n){var o=Uy(n,t);return o&&o.value}},vwe=function(n,t,o){var i=Uy(n,t);i?i.value=o:n.next={key:t,next:n.next,value:o}},Pwe=function(n,t){return n?!!Uy(n,t):!1},Gwe=function(n,t){if(n)return Uy(n,t,!0)};S4.exports=function(){var t,o={assert:function(i){if(!o.has(i))throw new Rwe("Side channel does not contain "+Nwe(i))},delete:function(i){var e=Gwe(t,i);return e&&t&&!t.next&&(t=void 0),!!e},get:function(i){return kwe(t,i)},has:function(i){return Pwe(t,i)},set:function(i,e){t||(t={next:void 0}),vwe(t,i,e)}};return o}});var ZN=$((BgA,b4)=>{"use strict";var D4=BC(),O4=DT(),Fwe=O4([D4("%String.prototype.indexOf%")]);b4.exports=function(t,o){var i=D4(t,!!o);return typeof i=="function"&&Fwe(t,".prototype.")>-1?O4([i]):i}});var XN=$((fgA,_4)=>{"use strict";var Lwe=BC(),HC=ZN(),Uwe=UC(),Hwe=Ec(),M4=Lwe("%Map%",!0),Kwe=HC("Map.prototype.get",!0),xwe=HC("Map.prototype.set",!0),Ywe=HC("Map.prototype.has",!0),jwe=HC("Map.prototype.delete",!0),Jwe=HC("Map.prototype.size",!0);_4.exports=!!M4&&function(){var t,o={assert:function(i){if(!o.has(i))throw new Hwe("Side channel does not contain "+Uwe(i))},delete:function(i){if(t){var e=jwe(t,i);return Jwe(t)===0&&(t=void 0),e}return!1},get:function(i){if(t)return Kwe(t,i)},has:function(i){return t?Ywe(t,i):!1},set:function(i,e){t||(t=new M4),xwe(t,i,e)}};return o}});var N4=$((QgA,T4)=>{"use strict";var qwe=BC(),Ky=ZN(),zwe=UC(),Hy=XN(),Vwe=Ec(),Ed=qwe("%WeakMap%",!0),Wwe=Ky("WeakMap.prototype.get",!0),Zwe=Ky("WeakMap.prototype.set",!0),Xwe=Ky("WeakMap.prototype.has",!0),$we=Ky("WeakMap.prototype.delete",!0);T4.exports=Ed?function(){var t,o,i={assert:function(e){if(!i.has(e))throw new Vwe("Side channel does not contain "+zwe(e))},delete:function(e){if(Ed&&e&&(typeof e=="object"||typeof e=="function")){if(t)return $we(t,e)}else if(Hy&&o)return o.delete(e);return!1},get:function(e){return Ed&&e&&(typeof e=="object"||typeof e=="function")&&t?Wwe(t,e):o&&o.get(e)},has:function(e){return Ed&&e&&(typeof e=="object"||typeof e=="function")&&t?Xwe(t,e):!!o&&o.has(e)},set:function(e,a){Ed&&e&&(typeof e=="object"||typeof e=="function")?(t||(t=new Ed),Zwe(t,e,a)):Hy&&(o||(o=Hy()),o.set(e,a))}};return i}:Hy});var $N=$((ygA,R4)=>{"use strict";var eDe=Ec(),ADe=UC(),tDe=w4(),rDe=XN(),aDe=N4(),iDe=aDe||rDe||tDe;R4.exports=function(){var t,o={assert:function(i){if(!o.has(i)){var e=i&&Object(i)===i?"the given object key":ADe(i);throw new eDe("Side channel does not contain "+e)}},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,e){t||(t=iDe()),t.set(i,e)}};return o}});var xy=$((mgA,k4)=>{"use strict";var oDe=String.prototype.replace,nDe=/%20/g,e0={RFC1738:"RFC1738",RFC3986:"RFC3986"};k4.exports={default:e0.RFC3986,formatters:{RFC1738:function(n){return oDe.call(n,nDe,"+")},RFC3986:function(n){return String(n)}},RFC1738:e0.RFC1738,RFC3986:e0.RFC3986}});var a0=$((SgA,G4)=>{"use strict";var sDe=xy(),P4=$N(),v4=QT(),A0=Object.prototype.hasOwnProperty,el=Array.isArray,jy=P4(),Al=function(t,o){return jy.set(t,o),t},tl=function(t){return jy.has(t)},KC=function(t){return jy.get(t)},t0=function(t,o){jy.set(t,o)},ls=(function(){for(var n=[],t=0;t<256;++t)n[n.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return n})(),gDe=function(t){for(;t.length>1;){var o=t.pop(),i=o.obj[o.prop];if(el(i)){for(var e=[],a=0;a=i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Al(Cd(t.concat(o),i),e)}t[e]=o}else if(t&&typeof t=="object")if(tl(t)){var a=KC(t)+1;t[a]=o,t0(t,a)}else{if(i&&i.strictMerge)return[t,o];(i&&(i.plainObjects||i.allowPrototypes)||!A0.call(Object.prototype,o))&&(t[o]=!0)}else return[t,o];return t}if(!t||typeof t!="object"){if(tl(o)){for(var A=Object.keys(o),r=i&&i.plainObjects?{__proto__:null,0:t}:{0:t},s=0;si.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Al(Cd(c,i),c.length-1)}return c}var I=t;if(el(t)&&!el(o)&&(I=Cd(t,i)),el(t)&&el(o)){if(o.forEach(function(d,B){if(A0.call(t,B)){var f=t[B];f&&typeof f=="object"&&d&&typeof d=="object"?t[B]=n(f,d,i):t[t.length]=d}else t[B]=d}),i&&typeof i.arrayLimit=="number"&&t.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Al(Cd(t,i),t.length-1)}return t}return Object.keys(o).reduce(function(d,B){var f=o[B];if(A0.call(d,B)?r0(d,B,n(d[B],f,i)):r0(d,B,f),tl(o)&&!tl(d)&&Al(d,KC(o)),tl(d)){var Q=parseInt(B,10);String(Q)===B&&Q>=0&&Q>KC(d)&&t0(d,Q)}return d},I)},IDe=function(t,o){return Object.keys(o).reduce(function(i,e){return r0(i,e,o[e]),i},t)},lDe=function(n,t,o){var i=n.replace(/\+/g," ");if(o==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Yy=1024,pDe=function(t,o,i,e,a){if(t.length===0)return t;var A=t;if(typeof t=="symbol"?A=Symbol.prototype.toString.call(t):typeof t!="string"&&(A=String(t)),i==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var r="",s=0;s=Yy?A.slice(s,s+Yy):A;if(s+Yy=55296&&c<=56319&&(g=g.slice(0,-1),s-=1)}for(var I=[],d=0;d=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||a===sDe.RFC1738&&(B===40||B===41)){I[I.length]=g.charAt(d);continue}if(B<128){I[I.length]=ls[B];continue}if(B<2048){I[I.length]=ls[192|B>>6]+ls[128|B&63];continue}if(B<55296||B>=57344){I[I.length]=ls[224|B>>12]+ls[128|B>>6&63]+ls[128|B&63];continue}d+=1,B=65536+((B&1023)<<10|g.charCodeAt(d)&1023),I[I.length]=ls[240|B>>18]+ls[128|B>>12&63]+ls[128|B>>6&63]+ls[128|B&63]}r+=I.join("")}return r},dDe=function(t){for(var o=[{obj:{o:t},prop:"o"}],i=P4(),e=0;ei){if(a)throw new RangeError("Array limit exceeded. Only "+i+" element"+(i===1?"":"s")+" allowed in an array.");return Al(Cd(r,{plainObjects:e}),r.length-1)}return r},uDe=function(t,o){if(el(t)){for(var i=[],e=0;e{"use strict";var L4=$N(),Jy=a0(),xC=xy(),BDe=Object.prototype.hasOwnProperty,U4={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,o){return t+"["+o+"]"},repeat:function(t){return t}},ps=Array.isArray,fDe=Array.prototype.push,H4=function(n,t){fDe.apply(n,ps(t)?t:[t])},QDe=Date.prototype.toISOString,F4=xC.default,Ur={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Jy.encode,encodeValuesOnly:!1,filter:void 0,format:F4,formatter:xC.formatters[F4],indices:!1,serializeDate:function(t){return QDe.call(t)},skipNulls:!1,strictNullHandling:!1},yDe=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},i0={},mDe=function n(t,o,i,e,a,A,r,s,g,c,I,d,B,f,Q,y,m,T){for(var _=t,R=T,K=0,L=!1;(R=R.get(i0))!==void 0&&!L;){var F=R.get(t);if(K+=1,typeof F<"u"){if(F===K)throw new RangeError("Cyclic object value");L=!0}typeof R.get(i0)>"u"&&(K=0)}if(typeof c=="function"?_=c(o,_):_ instanceof Date?_=B(_):i==="comma"&&ps(_)&&(_=Jy.maybeMap(_,function(se){return se instanceof Date?B(se):se})),_===null){if(A)return Q(g&&!y?g(o,Ur.encoder,m,"key",f):o);_=""}if(yDe(_)||Jy.isBuffer(_)){if(g){var q=y?o:g(o,Ur.encoder,m,"key",f);return[Q(q)+"="+Q(g(_,Ur.encoder,m,"value",f))]}return[Q(o)+"="+Q(String(_))]}var V=[];if(typeof _>"u")return V;var x;if(i==="comma"&&ps(_))y&&g&&(_=Jy.maybeMap(_,function(se){return se==null?se:g(se)})),x=[{value:_.length>0?_.join(",")||null:void 0}];else if(ps(c))x=c;else{var G=Object.keys(_);x=I?G.sort(I):G}var J=s?String(o).replace(/\./g,"%2E"):String(o),U=e&&ps(_)&&_.length===1?J+"[]":J;if(a&&ps(_)&&_.length===0)return U+"[]";for(var N=0;N"u"?t.encodeDotInKeys===!0?!0:Ur.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Ur.addQueryPrefix,allowDots:r,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ur.allowEmptyArrays,arrayFormat:A,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ur.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Ur.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Ur.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Ur.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Ur.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Ur.encodeValuesOnly,filter:a,format:i,formatter:e,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Ur.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Ur.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ur.strictNullHandling}};K4.exports=function(n,t){var o=n,i=SDe(t),e,a;typeof i.filter=="function"?(a=i.filter,o=a("",o)):ps(i.filter)&&(a=i.filter,e=a);var A=[];if(typeof o!="object"||o===null)return"";var r=U4[i.arrayFormat],s=r==="comma"&&i.commaRoundTrip;e||(e=Object.keys(o)),i.sort&&e.sort(i.sort);for(var g=L4(),c=0;c"u"||I===null)){var d=o[I];i.skipNulls&&d===null||H4(A,mDe(d,I,r,s,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,g))}}var B=A.join(i.delimiter),f=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B"+i.delimiter:f+="utf8=%E2%9C%93"+i.delimiter),B.length>0?f+B:""}});var J4=$((DgA,j4)=>{"use strict";var ds=a0(),qy=Object.prototype.hasOwnProperty,o0=Array.isArray,sr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ds.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},wDe=function(n){return n.replace(/&#(\d+);/g,function(t,o){return String.fromCharCode(parseInt(o,10))})},Y4=function(n,t,o,i){if(n&&typeof n=="string"&&t.comma&&n.indexOf(",")>-1){if(i&&t.throwOnLimitExceeded)for(var e=0,a=n.indexOf(",");a>-1;){if(e+=1,e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");a=n.indexOf(",",a+1)}return n.split(",")}if(t.throwOnLimitExceeded&&o>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return n},DDe="utf8=%26%2310003%3B",ODe="utf8=%E2%9C%93",bDe=function(t,o){var i={__proto__:null},e=o.ignoreQueryPrefix?t.replace(/^\?/,""):t;e=e.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=o.parameterLimit===1/0?void 0:o.parameterLimit,A=e.split(o.delimiter,o.throwOnLimitExceeded&&typeof a<"u"?a+1:a);if(o.throwOnLimitExceeded&&typeof a<"u"&&A.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(a===1?"":"s")+" allowed.");var r=-1,s,g=o.charset;if(o.charsetSentinel)for(s=0;s-1&&(f=o0(f)?[f]:f),o.comma&&o0(f)&&f.length>o.arrayLimit&&(f=ds.combine([],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded)),B!==null){var Q=qy.call(i,B);Q&&(o.duplicates==="combine"||c.indexOf("[]=")>-1)?i[B]=ds.combine(i[B],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded):(!Q||o.duplicates==="last")&&(i[B]=f)}}return i},MDe=function(n,t,o,i){var e=0;if(n.length>0&&n[n.length-1]==="[]"){var a=n.slice(0,-1).join("");e=Array.isArray(t)&&t[a]?t[a].length:0}for(var A=i?t:Y4(t,o,e),r=n.length-1;r>=0;--r){var s,g=n[r];if(g==="[]"&&o.parseArrays)ds.isOverflow(A)?s=A:s=o.allowEmptyArrays&&(A===""||o.strictNullHandling&&A===null)?[]:ds.combine([],A,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded);else{s=o.plainObjects?{__proto__:null}:{};var c=g.charAt(0)==="["&&g.charAt(g.length-1)==="]"?g.slice(1,-1):g,I=o.decodeDotInKeys?c.replace(/%2E/g,"."):c,d=parseInt(I,10),B=!isNaN(d)&&g!==I&&String(d)===I&&d>=0&&o.parseArrays;if(!o.parseArrays&&I==="")s={0:A};else if(B&&d=0?i.slice(0,a):i;if(A){if(!o.plainObjects&&qy.call(Object.prototype,A)&&!o.allowPrototypes)return;e[e.length]=A}for(var r=i.length,s=a,g=0;s>=0&&g=0){if(o.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+o.depth+" and strictDepth is true");e[e.length]="["+i.slice(s)+"]"}return e},TDe=function(t,o,i,e){if(t){var a=_De(t,i);if(a)return MDe(a,o,i,e)}},NDe=function(t){if(!t)return sr;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var o=typeof t.charset>"u"?sr.charset:t.charset,i=typeof t.duplicates>"u"?sr.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var e=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:sr.allowDots:!!t.allowDots;return{allowDots:e,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:sr.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:sr.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:sr.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:sr.arrayLimit,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:sr.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:sr.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:sr.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:sr.decoder,delimiter:typeof t.delimiter=="string"||ds.isRegExp(t.delimiter)?t.delimiter:sr.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:sr.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:sr.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:sr.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:sr.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:sr.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:sr.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:sr.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};j4.exports=function(n,t){var o=NDe(t);if(n===""||n===null||typeof n>"u")return o.plainObjects?{__proto__:null}:{};for(var i=typeof n=="string"?bDe(n,o):n,e=o.plainObjects?{__proto__:null}:{},a=Object.keys(i),A=0;A{"use strict";var RDe=x4(),kDe=J4(),vDe=xy();q4.exports={formats:vDe,parse:kDe,stringify:RDe}});var W4=$((bgA,V4)=>{function PDe(n){return n}V4.exports=PDe});var R8=$((YC,Bd)=>{var GDe=200,FDe="Expected a function",u0="__lodash_hash_undefined__",em=1,fd=2,o8=1/0,n8=9007199254740991,zy="[object Arguments]",g0="[object Array]",s8="[object Boolean]",g8="[object Date]",c8="[object Error]",I8="[object Function]",LDe="[object GeneratorFunction]",Vy="[object Map]",l8="[object Number]",ud="[object Object]",Z4="[object Promise]",p8="[object RegExp]",Wy="[object Set]",d8="[object String]",h8="[object Symbol]",c0="[object WeakMap]",E8="[object ArrayBuffer]",Zy="[object DataView]",UDe="[object Float32Array]",HDe="[object Float64Array]",KDe="[object Int8Array]",xDe="[object Int16Array]",YDe="[object Int32Array]",jDe="[object Uint8Array]",JDe="[object Uint8ClampedArray]",qDe="[object Uint16Array]",zDe="[object Uint32Array]",VDe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,WDe=/^\w*$/,ZDe=/^\./,XDe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$De=/[\\^$.*+?()[\]{}|]/g,eOe=/\\(\\)?/g,AOe=/^\[object .+?Constructor\]$/,tOe=/^(?:0|[1-9]\d*)$/,Yt={};Yt[UDe]=Yt[HDe]=Yt[KDe]=Yt[xDe]=Yt[YDe]=Yt[jDe]=Yt[JDe]=Yt[qDe]=Yt[zDe]=!0;Yt[zy]=Yt[g0]=Yt[E8]=Yt[s8]=Yt[Zy]=Yt[g8]=Yt[c8]=Yt[I8]=Yt[Vy]=Yt[l8]=Yt[ud]=Yt[p8]=Yt[Wy]=Yt[d8]=Yt[c0]=!1;var C8=typeof global=="object"&&global&&global.Object===Object&&global,rOe=typeof self=="object"&&self&&self.Object===Object&&self,Sc=C8||rOe||Function("return this")(),u8=typeof YC=="object"&&YC&&!YC.nodeType&&YC,X4=u8&&typeof Bd=="object"&&Bd&&!Bd.nodeType&&Bd,aOe=X4&&X4.exports===u8,$4=aOe&&C8.process,e8=(function(){try{return $4&&$4.binding("util")}catch{}})(),A8=e8&&e8.isTypedArray;function B8(n,t){for(var o=-1,i=t.length,e=n.length;++o-1}function ROe(n,t){var o=this.__data__,i=tm(o,n);return i<0?o.push([n,t]):o[i][1]=t,this}fg.prototype.clear=MOe;fg.prototype.delete=_Oe;fg.prototype.get=TOe;fg.prototype.has=NOe;fg.prototype.set=ROe;function Qg(n){var t=-1,o=n?n.length:0;for(this.clear();++tr))return!1;var g=a.get(n);if(g&&a.get(t))return g==t;var c=-1,I=!0,d=e&em?new $y:void 0;for(a.set(n,t),a.set(t,n);++c-1&&n%1==0&&n-1&&n%1==0&&n<=n8}function qC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function om(n){return!!n&&typeof n=="object"}function S0(n){return typeof n=="symbol"||om(n)&&Qd.call(n)==h8}var Bbe=A8?sOe(A8):XOe;function fbe(n){return n==null?"":obe(n)}function Qbe(n,t,o){var i=n==null?void 0:y8(n,t);return i===void 0?o:i}function ybe(n,t){return n!=null&&pbe(n,t,zOe)}function C0(n){return y0(n)?Q8(n):ebe(n)}function mbe(n){return y0(n)?Q8(n,!0):Abe(n)}function Sbe(n,t){return n==null?{}:abe(n,gbe(n),$Oe(t))}function wbe(n){return n}function Dbe(n){return am(n)?oOe(im(n)):ibe(n)}function N8(){return[]}Bd.exports=Sbe});var sz=$((zC,md)=>{var Obe=200,x8="__lodash_hash_undefined__",bbe=800,Mbe=16,Y8=9007199254740991,j8="[object Arguments]",_be="[object Array]",Tbe="[object AsyncFunction]",Nbe="[object Boolean]",Rbe="[object Date]",kbe="[object Error]",J8="[object Function]",vbe="[object GeneratorFunction]",Pbe="[object Map]",Gbe="[object Number]",Fbe="[object Null]",q8="[object Object]",Lbe="[object Proxy]",Ube="[object RegExp]",Hbe="[object Set]",Kbe="[object String]",xbe="[object Undefined]",Ybe="[object WeakMap]",jbe="[object ArrayBuffer]",Jbe="[object DataView]",qbe="[object Float32Array]",zbe="[object Float64Array]",Vbe="[object Int8Array]",Wbe="[object Int16Array]",Zbe="[object Int32Array]",Xbe="[object Uint8Array]",$be="[object Uint8ClampedArray]",eMe="[object Uint16Array]",AMe="[object Uint32Array]",tMe=/[\\^$.*+?()[\]{}|]/g,rMe=/^\[object .+?Constructor\]$/,aMe=/^(?:0|[1-9]\d*)$/,jt={};jt[qbe]=jt[zbe]=jt[Vbe]=jt[Wbe]=jt[Zbe]=jt[Xbe]=jt[$be]=jt[eMe]=jt[AMe]=!0;jt[j8]=jt[_be]=jt[jbe]=jt[Nbe]=jt[Jbe]=jt[Rbe]=jt[kbe]=jt[J8]=jt[Pbe]=jt[Gbe]=jt[q8]=jt[Ube]=jt[Hbe]=jt[Kbe]=jt[Ybe]=!1;var z8=typeof global=="object"&&global&&global.Object===Object&&global,iMe=typeof self=="object"&&self&&self.Object===Object&&self,ZC=z8||iMe||Function("return this")(),V8=typeof zC=="object"&&zC&&!zC.nodeType&&zC,VC=V8&&typeof md=="object"&&md&&!md.nodeType&&md,W8=VC&&VC.exports===V8,w0=W8&&z8.process,k8=(function(){try{var n=VC&&VC.require&&VC.require("util").types;return n||w0&&w0.binding&&w0.binding("util")}catch{}})(),v8=k8&&k8.isTypedArray;function oMe(n,t,o){switch(o.length){case 0:return n.call(t);case 1:return n.call(t,o[0]);case 2:return n.call(t,o[0],o[1]);case 3:return n.call(t,o[0],o[1],o[2])}return n.apply(t,o)}function nMe(n,t){for(var o=-1,i=Array(n);++o-1}function MMe(n,t){var o=this.__data__,i=Im(o,n);return i<0?(++this.size,o.push([n,t])):o[i][1]=t,this}mg.prototype.clear=wMe;mg.prototype.delete=DMe;mg.prototype.get=OMe;mg.prototype.has=bMe;mg.prototype.set=MMe;function Sd(n){var t=-1,o=n==null?0:n.length;for(this.clear();++t1?o[e-1]:void 0,A=e>2?o[2]:void 0;for(a=n.length>3&&typeof a=="function"?(e--,a):void 0,A&&a_e(o[0],o[1],A)&&(a=e<3?void 0:a,e=1),t=Object(t);++i-1&&n%1==0&&n0){if(++t>=bbe)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function l_e(n){if(n!=null){try{return cm.call(n)}catch{}try{return n+""}catch{}}return""}function dm(n,t){return n===t||n!==n&&t!==t}var M0=K8((function(){return arguments})())?K8:function(n){return XC(n)&&yg.call(n,"callee")&&!hMe.call(n,"callee")},_0=Array.isArray;function R0(n){return n!=null&&az(n.length)&&!k0(n)}function p_e(n){return XC(n)&&R0(n)}var rz=CMe||u_e;function k0(n){if(!nl(n))return!1;var t=lm(n);return t==J8||t==vbe||t==Tbe||t==Lbe}function az(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Y8}function nl(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function XC(n){return n!=null&&typeof n=="object"}function d_e(n){if(!XC(n)||lm(n)!=q8)return!1;var t=X8(n);if(t===null)return!0;var o=yg.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&cm.call(o)==pMe}var iz=v8?sMe(v8):YMe;function h_e(n){return $Me(n,oz(n))}function oz(n){return R0(n)?UMe(n,!0):jMe(n)}var E_e=e_e(function(n,t,o){ez(n,t,o)});function C_e(n){return function(){return n}}function nz(n){return n}function u_e(){return!1}md.exports=E_e});var Sg=$((MgA,Iz)=>{"use strict";var gz=["nodebuffer","arraybuffer","fragments"],cz=typeof Blob<"u";cz&&gz.push("blob");Iz.exports={BINARY_TYPES:gz,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:cz,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var $C=$((_gA,hm)=>{"use strict";var{EMPTY_BUFFER:B_e}=Sg(),v0=Buffer[Symbol.species];function f_e(n,t){if(n.length===0)return B_e;if(n.length===1)return n[0];let o=Buffer.allocUnsafe(t),i=0;for(let e=0;e{"use strict";var dz=Symbol("kDone"),G0=Symbol("kRun"),F0=class{constructor(t){this[dz]=()=>{this.pending--,this[G0]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[G0]()}[G0](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[dz])}}};hz.exports=F0});var bd=$((NgA,fz)=>{"use strict";var eu=$e("zlib"),Cz=$C(),y_e=Ez(),{kStatusCode:uz}=Sg(),m_e=Buffer[Symbol.species],S_e=Buffer.from([0,0,255,255]),Cm=Symbol("permessage-deflate"),wg=Symbol("total-length"),Dd=Symbol("callback"),wc=Symbol("buffers"),Od=Symbol("error"),Em,L0=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Em){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Em=new y_e(o)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Dd];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let o=this._options,i=t.find(e=>!(o.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>e.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&(typeof e.client_max_window_bits=="number"?o.clientMaxWindowBits>e.client_max_window_bits:!e.client_max_window_bits)));if(!i)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(i.server_no_context_takeover=!0),o.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(i.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?i.client_max_window_bits=o.clientMaxWindowBits:(i.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let o=t[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(t){return t.forEach(o=>{Object.keys(o).forEach(i=>{let e=o[i];if(e.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(e=e[0],i==="client_max_window_bits"){if(e!==!0){let a=+e;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${e}`);e=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${e}`)}else if(i==="server_max_window_bits"){let a=+e;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${e}`);e=a}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(e!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${e}`)}else throw new Error(`Unknown parameter "${i}"`);o[i]=e})}),t}decompress(t,o,i){Em.add(e=>{this._decompress(t,o,(a,A)=>{e(),i(a,A)})})}compress(t,o,i){Em.add(e=>{this._compress(t,o,(a,A)=>{e(),i(a,A)})})}_decompress(t,o,i){let e=this._isServer?"client":"server";if(!this._inflate){let a=`${e}_max_window_bits`,A=typeof this.params[a]!="number"?eu.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=eu.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A}),this._inflate[Cm]=this,this._inflate[wg]=0,this._inflate[wc]=[],this._inflate.on("error",D_e),this._inflate.on("data",Bz)}this._inflate[Dd]=i,this._inflate.write(t),o&&this._inflate.write(S_e),this._inflate.flush(()=>{let a=this._inflate[Od];if(a){this._inflate.close(),this._inflate=null,i(a);return}let A=Cz.concat(this._inflate[wc],this._inflate[wg]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[wg]=0,this._inflate[wc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._inflate.reset()),i(null,A)})}_compress(t,o,i){let e=this._isServer?"server":"client";if(!this._deflate){let a=`${e}_max_window_bits`,A=typeof this.params[a]!="number"?eu.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=eu.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A}),this._deflate[wg]=0,this._deflate[wc]=[],this._deflate.on("data",w_e)}this._deflate[Dd]=i,this._deflate.write(t),this._deflate.flush(eu.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=Cz.concat(this._deflate[wc],this._deflate[wg]);o&&(a=new m_e(a.buffer,a.byteOffset,a.length-4)),this._deflate[Dd]=null,this._deflate[wg]=0,this._deflate[wc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._deflate.reset(),i(null,a)})}};fz.exports=L0;function w_e(n){this[wc].push(n),this[wg]+=n.length}function Bz(n){if(this[wg]+=n.length,this[Cm]._maxPayload<1||this[wg]<=this[Cm]._maxPayload){this[wc].push(n);return}this[Od]=new RangeError("Max payload size exceeded"),this[Od].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Od][uz]=1009,this.removeListener("data",Bz),this.reset()}function D_e(n){if(this[Cm]._inflate=null,this[Od]){this[Dd](this[Od]);return}n[uz]=1007,this[Dd](n)}});var Md=$((RgA,um)=>{"use strict";var{isUtf8:Qz}=$e("buffer"),{hasBlob:O_e}=Sg(),b_e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function M_e(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function U0(n){let t=n.length,o=0;for(;o=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||n[o]===224&&(n[o+1]&224)===128||n[o]===237&&(n[o+1]&224)===160)return!1;o+=3}else if((n[o]&248)===240){if(o+3>=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||(n[o+3]&192)!==128||n[o]===240&&(n[o+1]&240)===128||n[o]===244&&n[o+1]>143||n[o]>244)return!1;o+=4}else return!1;return!0}function __e(n){return O_e&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&(n[Symbol.toStringTag]==="Blob"||n[Symbol.toStringTag]==="File")}um.exports={isBlob:__e,isValidStatusCode:M_e,isValidUTF8:U0,tokenChars:b_e};if(Qz)um.exports.isValidUTF8=function(n){return n.length<24?U0(n):Qz(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=$e("utf-8-validate");um.exports.isValidUTF8=function(t){return t.length<32?U0(t):n(t)}}catch{}});var j0=$((kgA,bz)=>{"use strict";var{Writable:T_e}=$e("stream"),yz=bd(),{BINARY_TYPES:N_e,EMPTY_BUFFER:mz,kStatusCode:R_e,kWebSocket:k_e}=Sg(),{concat:H0,toArrayBuffer:v_e,unmask:P_e}=$C(),{isValidStatusCode:G_e,isValidUTF8:Sz}=Md(),Bm=Buffer[Symbol.species],Fo=0,wz=1,Dz=2,Oz=3,K0=4,x0=5,fm=6,Y0=class extends T_e{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||N_e[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[k_e]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Fo}_write(t,o,i){if(this._opcode===8&&this._state==Fo)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=i.length?o.set(this._buffers.shift(),e):(o.set(new Uint8Array(i.buffer,i.byteOffset,t),e),this._buffers[0]=new Bm(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return o}startLoop(t){this._loop=!0;do switch(this._state){case Fo:this.getInfo(t);break;case wz:this.getPayloadLength16(t);break;case Dz:this.getPayloadLength64(t);break;case Oz:this.getMask();break;case K0:this.getData(t);break;case x0:case fm:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let e=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(e);return}let i=(o[0]&64)===64;if(i&&!this._extensions[yz.extensionName]){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(i){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(!this._fragmented){let e=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let e=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(e);return}if(i){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let e=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(e);return}}else{let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let e=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(e);return}}else if(this._masked){let e=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(e);return}this._payloadLength===126?this._state=wz:this._payloadLength===127?this._state=Dz:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let o=this.consume(8),i=o.readUInt32BE(0);if(i>Math.pow(2,21)-1){let e=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(e);return}this._payloadLength=i*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._masked?this._state=Oz:this._state=K0}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=K0}getData(t){let o=mz;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(o,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(i);return}if(this._compressed){this._state=x0,this.decompress(o,t);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(t)}decompress(t,o){this._extensions[yz.extensionName].decompress(t,this._fin,(e,a)=>{if(e)return o(e);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let A=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(A);return}this._fragments.push(a)}this.dataMessage(o),this._state===Fo&&this.startLoop(o)})}dataMessage(t){if(!this._fin){this._state=Fo;return}let o=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let e;this._binaryType==="nodebuffer"?e=H0(i,o):this._binaryType==="arraybuffer"?e=v_e(H0(i,o)):this._binaryType==="blob"?e=new Blob(i):e=i,this._allowSynchronousEvents?(this.emit("message",e,!0),this._state=Fo):(this._state=fm,setImmediate(()=>{this.emit("message",e,!0),this._state=Fo,this.startLoop(t)}))}else{let e=H0(i,o);if(!this._skipUTF8Validation&&!Sz(e)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===x0||this._allowSynchronousEvents?(this.emit("message",e,!1),this._state=Fo):(this._state=fm,setImmediate(()=>{this.emit("message",e,!1),this._state=Fo,this.startLoop(t)}))}}controlMessage(t,o){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,mz),this.end();else{let i=t.readUInt16BE(0);if(!G_e(i)){let a=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(a);return}let e=new Bm(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Sz(e)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(a);return}this._loop=!1,this.emit("conclude",i,e),this.end()}this._state=Fo;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Fo):(this._state=fm,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Fo,this.startLoop(o)}))}createError(t,o,i,e,a){this._loop=!1,this._errored=!0;let A=new t(i?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(A,this.createError),A.code=a,A[R_e]=e,A}};bz.exports=Y0});var z0=$((PgA,Tz)=>{"use strict";var{Duplex:vgA}=$e("stream"),{randomFillSync:F_e}=$e("crypto"),{types:{isUint8Array:L_e}}=$e("util"),Mz=bd(),{EMPTY_BUFFER:U_e,kWebSocket:H_e,NOOP:K_e}=Sg(),{isBlob:_d,isValidStatusCode:x_e}=Md(),{mask:_z,toBuffer:sl}=$C(),Lo=Symbol("kByteLength"),Y_e=Buffer.alloc(4),Qm=8*1024,gl,Td=Qm,wn=0,j_e=1,J_e=2,J0=class n{constructor(t,o,i){this._extensions=o||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=wn,this.onerror=K_e,this[H_e]=void 0}static frame(t,o){let i,e=!1,a=2,A=!1;o.mask&&(i=o.maskBuffer||Y_e,o.generateMask?o.generateMask(i):(Td===Qm&&(gl===void 0&&(gl=Buffer.alloc(Qm)),F_e(gl,0,Qm),Td=0),i[0]=gl[Td++],i[1]=gl[Td++],i[2]=gl[Td++],i[3]=gl[Td++]),A=(i[0]|i[1]|i[2]|i[3])===0,a=6);let r;typeof t=="string"?(!o.mask||A)&&o[Lo]!==void 0?r=o[Lo]:(t=Buffer.from(t),r=t.length):(r=t.length,e=o.mask&&o.readOnly&&!A);let s=r;r>=65536?(a+=8,s=127):r>125&&(a+=2,s=126);let g=Buffer.allocUnsafe(e?r+a:a);return g[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(g[0]|=64),g[1]=s,s===126?g.writeUInt16BE(r,2):s===127&&(g[2]=g[3]=0,g.writeUIntBE(r,4,6)),o.mask?(g[1]|=128,g[a-4]=i[0],g[a-3]=i[1],g[a-2]=i[2],g[a-1]=i[3],A?[g,t]:e?(_z(t,i,g,a,r),[g]):(_z(t,i,t,0,r),[g,t])):[g,t]}close(t,o,i,e){let a;if(t===void 0)a=U_e;else{if(typeof t!="number"||!x_e(t))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let r=Buffer.byteLength(o);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");if(a=Buffer.allocUnsafe(2+r),a.writeUInt16BE(t,0),typeof o=="string")a.write(o,2);else if(L_e(o))a.set(o,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let A={[Lo]:a.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wn?this.enqueue([this.dispatch,a,!1,A,e]):this.sendFrame(n.frame(a,A),e)}ping(t,o,i){let e,a;if(typeof t=="string"?(e=Buffer.byteLength(t),a=!1):_d(t)?(e=t.size,a=!1):(t=sl(t),e=t.length,a=sl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[Lo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};_d(t)?this._state!==wn?this.enqueue([this.getBlobData,t,!1,A,i]):this.getBlobData(t,!1,A,i):this._state!==wn?this.enqueue([this.dispatch,t,!1,A,i]):this.sendFrame(n.frame(t,A),i)}pong(t,o,i){let e,a;if(typeof t=="string"?(e=Buffer.byteLength(t),a=!1):_d(t)?(e=t.size,a=!1):(t=sl(t),e=t.length,a=sl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[Lo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};_d(t)?this._state!==wn?this.enqueue([this.getBlobData,t,!1,A,i]):this.getBlobData(t,!1,A,i):this._state!==wn?this.enqueue([this.dispatch,t,!1,A,i]):this.sendFrame(n.frame(t,A),i)}send(t,o,i){let e=this._extensions[Mz.extensionName],a=o.binary?2:1,A=o.compress,r,s;typeof t=="string"?(r=Buffer.byteLength(t),s=!1):_d(t)?(r=t.size,s=!1):(t=sl(t),r=t.length,s=sl.readOnly),this._firstFragment?(this._firstFragment=!1,A&&e&&e.params[e._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(A=r>=e._threshold),this._compress=A):(A=!1,a=0),o.fin&&(this._firstFragment=!0);let g={[Lo]:r,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:s,rsv1:A};_d(t)?this._state!==wn?this.enqueue([this.getBlobData,t,this._compress,g,i]):this.getBlobData(t,this._compress,g,i):this._state!==wn?this.enqueue([this.dispatch,t,this._compress,g,i]):this.dispatch(t,this._compress,g,i)}getBlobData(t,o,i,e){this._bufferedBytes+=i[Lo],this._state=J_e,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let r=new Error("The socket was closed while the blob was being read");process.nextTick(q0,this,r,e);return}this._bufferedBytes-=i[Lo];let A=sl(a);o?this.dispatch(A,o,i,e):(this._state=wn,this.sendFrame(n.frame(A,i),e),this.dequeue())}).catch(a=>{process.nextTick(q_e,this,a,e)})}dispatch(t,o,i,e){if(!o){this.sendFrame(n.frame(t,i),e);return}let a=this._extensions[Mz.extensionName];this._bufferedBytes+=i[Lo],this._state=j_e,a.compress(t,i.fin,(A,r)=>{if(this._socket.destroyed){let s=new Error("The socket was closed while data was being compressed");q0(this,s,e);return}this._bufferedBytes-=i[Lo],this._state=wn,i.readOnly=!1,this.sendFrame(n.frame(r,i),e),this.dequeue()})}dequeue(){for(;this._state===wn&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Lo],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Lo],this._queue.push(t)}sendFrame(t,o){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],o),this._socket.uncork()):this._socket.write(t[0],o)}};Tz.exports=J0;function q0(n,t,o){typeof o=="function"&&o(t);for(let i=0;i{"use strict";var{kForOnEventAttribute:Au,kListener:V0}=Sg(),Nz=Symbol("kCode"),Rz=Symbol("kData"),kz=Symbol("kError"),vz=Symbol("kMessage"),Pz=Symbol("kReason"),Nd=Symbol("kTarget"),Gz=Symbol("kType"),Fz=Symbol("kWasClean"),Dg=class{constructor(t){this[Nd]=null,this[Gz]=t}get target(){return this[Nd]}get type(){return this[Gz]}};Object.defineProperty(Dg.prototype,"target",{enumerable:!0});Object.defineProperty(Dg.prototype,"type",{enumerable:!0});var cl=class extends Dg{constructor(t,o={}){super(t),this[Nz]=o.code===void 0?0:o.code,this[Pz]=o.reason===void 0?"":o.reason,this[Fz]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[Nz]}get reason(){return this[Pz]}get wasClean(){return this[Fz]}};Object.defineProperty(cl.prototype,"code",{enumerable:!0});Object.defineProperty(cl.prototype,"reason",{enumerable:!0});Object.defineProperty(cl.prototype,"wasClean",{enumerable:!0});var Rd=class extends Dg{constructor(t,o={}){super(t),this[kz]=o.error===void 0?null:o.error,this[vz]=o.message===void 0?"":o.message}get error(){return this[kz]}get message(){return this[vz]}};Object.defineProperty(Rd.prototype,"error",{enumerable:!0});Object.defineProperty(Rd.prototype,"message",{enumerable:!0});var tu=class extends Dg{constructor(t,o={}){super(t),this[Rz]=o.data===void 0?null:o.data}get data(){return this[Rz]}};Object.defineProperty(tu.prototype,"data",{enumerable:!0});var z_e={addEventListener(n,t,o={}){for(let e of this.listeners(n))if(!o[Au]&&e[V0]===t&&!e[Au])return;let i;if(n==="message")i=function(a,A){let r=new tu("message",{data:A?a:a.toString()});r[Nd]=this,ym(t,this,r)};else if(n==="close")i=function(a,A){let r=new cl("close",{code:a,reason:A.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[Nd]=this,ym(t,this,r)};else if(n==="error")i=function(a){let A=new Rd("error",{error:a,message:a.message});A[Nd]=this,ym(t,this,A)};else if(n==="open")i=function(){let a=new Dg("open");a[Nd]=this,ym(t,this,a)};else return;i[Au]=!!o[Au],i[V0]=t,o.once?this.once(n,i):this.on(n,i)},removeEventListener(n,t){for(let o of this.listeners(n))if(o[V0]===t&&!o[Au]){this.removeListener(n,o);break}}};Lz.exports={CloseEvent:cl,ErrorEvent:Rd,Event:Dg,EventTarget:z_e,MessageEvent:tu};function ym(n,t,o){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,o):n.call(t,o)}});var mm=$((FgA,Hz)=>{"use strict";var{tokenChars:ru}=Md();function Es(n,t,o){n[t]===void 0?n[t]=[o]:n[t].push(o)}function V_e(n){let t=Object.create(null),o=Object.create(null),i=!1,e=!1,a=!1,A,r,s=-1,g=-1,c=-1,I=0;for(;I{let o=n[t];return Array.isArray(o)||(o=[o]),o.map(i=>[t].concat(Object.keys(i).map(e=>{let a=i[e];return Array.isArray(a)||(a=[a]),a.map(A=>A===!0?e:`${e}=${A}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Hz.exports={format:W_e,parse:V_e}});var Om=$((HgA,$z)=>{"use strict";var Z_e=$e("events"),X_e=$e("https"),$_e=$e("http"),Yz=$e("net"),eTe=$e("tls"),{randomBytes:ATe,createHash:tTe}=$e("crypto"),{Duplex:LgA,Readable:UgA}=$e("stream"),{URL:W0}=$e("url"),Dc=bd(),rTe=j0(),aTe=z0(),{isBlob:iTe}=Md(),{BINARY_TYPES:Kz,CLOSE_TIMEOUT:oTe,EMPTY_BUFFER:Sm,GUID:nTe,kForOnEventAttribute:Z0,kListener:sTe,kStatusCode:gTe,kWebSocket:na,NOOP:jz}=Sg(),{EventTarget:{addEventListener:cTe,removeEventListener:ITe}}=Uz(),{format:lTe,parse:pTe}=mm(),{toBuffer:dTe}=$C(),Jz=Symbol("kAborted"),X0=[8,13],Og=["CONNECTING","OPEN","CLOSING","CLOSED"],hTe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Xt=class n extends Z_e{constructor(t,o,i){super(),this._binaryType=Kz[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Sm,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(i=o,o=[]):o=[o]),qz(this,t,o,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Kz.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,o,i){let e=new rTe({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),a=new aTe(t,this._extensions,i.generateMask);this._receiver=e,this._sender=a,this._socket=t,e[na]=this,a[na]=this,t[na]=this,e.on("conclude",uTe),e.on("drain",BTe),e.on("error",fTe),e.on("message",QTe),e.on("ping",yTe),e.on("pong",mTe),a.onerror=STe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),o.length>0&&t.unshift(o),t.on("close",Wz),t.on("data",Dm),t.on("end",Zz),t.on("error",Xz),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Dc.extensionName]&&this._extensions[Dc.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,o){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){no(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,o,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Vz(this)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,o,i){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=o=void 0):typeof o=="function"&&(i=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){$0(this,t,i);return}o===void 0&&(o=!this._isServer),this._sender.ping(t||Sm,o,i)}pong(t,o,i){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=o=void 0):typeof o=="function"&&(i=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){$0(this,t,i);return}o===void 0&&(o=!this._isServer),this._sender.pong(t||Sm,o,i)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,o,i){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(i=o,o={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){$0(this,t,i);return}let e={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[Dc.extensionName]||(e.compress=!1),this._sender.send(t||Sm,e,i)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){no(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(Xt,"CONNECTING",{enumerable:!0,value:Og.indexOf("CONNECTING")});Object.defineProperty(Xt.prototype,"CONNECTING",{enumerable:!0,value:Og.indexOf("CONNECTING")});Object.defineProperty(Xt,"OPEN",{enumerable:!0,value:Og.indexOf("OPEN")});Object.defineProperty(Xt.prototype,"OPEN",{enumerable:!0,value:Og.indexOf("OPEN")});Object.defineProperty(Xt,"CLOSING",{enumerable:!0,value:Og.indexOf("CLOSING")});Object.defineProperty(Xt.prototype,"CLOSING",{enumerable:!0,value:Og.indexOf("CLOSING")});Object.defineProperty(Xt,"CLOSED",{enumerable:!0,value:Og.indexOf("CLOSED")});Object.defineProperty(Xt.prototype,"CLOSED",{enumerable:!0,value:Og.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(Xt.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(Xt.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[Z0])return t[sTe];return null},set(t){for(let o of this.listeners(n))if(o[Z0]){this.removeListener(n,o);break}typeof t=="function"&&this.addEventListener(n,t,{[Z0]:!0})}})});Xt.prototype.addEventListener=cTe;Xt.prototype.removeEventListener=ITe;$z.exports=Xt;function qz(n,t,o,i){let e={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:oTe,protocolVersion:X0[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=e.autoPong,n._closeTimeout=e.closeTimeout,!X0.includes(e.protocolVersion))throw new RangeError(`Unsupported protocol version: ${e.protocolVersion} (supported versions: ${X0.join(", ")})`);let a;if(t instanceof W0)a=t;else try{a=new W0(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),n._url=a.href;let A=a.protocol==="wss:",r=a.protocol==="ws+unix:",s;if(a.protocol!=="ws:"&&!A&&!r?s=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:r&&!a.pathname?s="The URL's pathname is empty":a.hash&&(s="The URL contains a fragment identifier"),s){let Q=new SyntaxError(s);if(n._redirects===0)throw Q;wm(n,Q);return}let g=A?443:80,c=ATe(16).toString("base64"),I=A?X_e.request:$_e.request,d=new Set,B;if(e.createConnection=e.createConnection||(A?CTe:ETe),e.defaultPort=e.defaultPort||g,e.port=a.port||g,e.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,e.headers={...e.headers,"Sec-WebSocket-Version":e.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},e.path=a.pathname+a.search,e.timeout=e.handshakeTimeout,e.perMessageDeflate&&(B=new Dc({...e.perMessageDeflate,isServer:!1,maxPayload:e.maxPayload}),e.headers["Sec-WebSocket-Extensions"]=lTe({[Dc.extensionName]:B.offer()})),o.length){for(let Q of o){if(typeof Q!="string"||!hTe.test(Q)||d.has(Q))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(Q)}e.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(e.origin&&(e.protocolVersion<13?e.headers["Sec-WebSocket-Origin"]=e.origin:e.headers.Origin=e.origin),(a.username||a.password)&&(e.auth=`${a.username}:${a.password}`),r){let Q=e.path.split(":");e.socketPath=Q[0],e.path=Q[1]}let f;if(e.followRedirects){if(n._redirects===0){n._originalIpc=r,n._originalSecure=A,n._originalHostOrSocketPath=r?e.socketPath:a.host;let Q=i&&i.headers;if(i={...i,headers:{}},Q)for(let[y,m]of Object.entries(Q))i.headers[y.toLowerCase()]=m}else if(n.listenerCount("redirect")===0){let Q=r?n._originalIpc?e.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:a.host===n._originalHostOrSocketPath;(!Q||n._originalSecure&&!A)&&(delete e.headers.authorization,delete e.headers.cookie,Q||delete e.headers.host,e.auth=void 0)}e.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(e.auth).toString("base64")),f=n._req=I(e),n._redirects&&n.emit("redirect",n.url,f)}else f=n._req=I(e);e.timeout&&f.on("timeout",()=>{no(n,f,"Opening handshake has timed out")}),f.on("error",Q=>{f===null||f[Jz]||(f=n._req=null,wm(n,Q))}),f.on("response",Q=>{let y=Q.headers.location,m=Q.statusCode;if(y&&e.followRedirects&&m>=300&&m<400){if(++n._redirects>e.maxRedirects){no(n,f,"Maximum redirects exceeded");return}f.abort();let T;try{T=new W0(y,t)}catch{let R=new SyntaxError(`Invalid URL: ${y}`);wm(n,R);return}qz(n,T,o,i)}else n.emit("unexpected-response",f,Q)||no(n,f,`Unexpected server response: ${Q.statusCode}`)}),f.on("upgrade",(Q,y,m)=>{if(n.emit("upgrade",Q),n.readyState!==Xt.CONNECTING)return;f=n._req=null;let T=Q.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){no(n,y,"Invalid Upgrade header");return}let _=tTe("sha1").update(c+nTe).digest("base64");if(Q.headers["sec-websocket-accept"]!==_){no(n,y,"Invalid Sec-WebSocket-Accept header");return}let R=Q.headers["sec-websocket-protocol"],K;if(R!==void 0?d.size?d.has(R)||(K="Server sent an invalid subprotocol"):K="Server sent a subprotocol but none was requested":d.size&&(K="Server sent no subprotocol"),K){no(n,y,K);return}R&&(n._protocol=R);let L=Q.headers["sec-websocket-extensions"];if(L!==void 0){if(!B){no(n,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=pTe(L)}catch{no(n,y,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(F);if(q.length!==1||q[0]!==Dc.extensionName){no(n,y,"Server indicated an extension that was not requested");return}try{B.accept(F[Dc.extensionName])}catch{no(n,y,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[Dc.extensionName]=B}n.setSocket(y,m,{allowSynchronousEvents:e.allowSynchronousEvents,generateMask:e.generateMask,maxBufferedChunks:e.maxBufferedChunks,maxFragments:e.maxFragments,maxPayload:e.maxPayload,skipUTF8Validation:e.skipUTF8Validation})}),e.finishRequest?e.finishRequest(f,n):f.end()}function wm(n,t){n._readyState=Xt.CLOSING,n._errorEmitted=!0,n.emit("error",t),n.emitClose()}function ETe(n){return n.path=n.socketPath,Yz.connect(n)}function CTe(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=Yz.isIP(n.host)?"":n.host),eTe.connect(n)}function no(n,t,o){n._readyState=Xt.CLOSING;let i=new Error(o);Error.captureStackTrace(i,no),t.setHeader?(t[Jz]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(wm,n,i)):(t.destroy(i),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function $0(n,t,o){if(t){let i=iTe(t)?t.size:dTe(t).length;n._socket?n._sender._bufferedBytes+=i:n._bufferedAmount+=i}if(o){let i=new Error(`WebSocket is not open: readyState ${n.readyState} (${Og[n.readyState]})`);process.nextTick(o,i)}}function uTe(n,t){let o=this[na];o._closeFrameReceived=!0,o._closeMessage=t,o._closeCode=n,o._socket[na]!==void 0&&(o._socket.removeListener("data",Dm),process.nextTick(zz,o._socket),n===1005?o.close():o.close(n,t))}function BTe(){let n=this[na];n.isPaused||n._socket.resume()}function fTe(n){let t=this[na];t._socket[na]!==void 0&&(t._socket.removeListener("data",Dm),process.nextTick(zz,t._socket),t.close(n[gTe])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n))}function xz(){this[na].emitClose()}function QTe(n,t){this[na].emit("message",n,t)}function yTe(n){let t=this[na];t._autoPong&&t.pong(n,!this._isServer,jz),t.emit("ping",n)}function mTe(n){this[na].emit("pong",n)}function zz(n){n.resume()}function STe(n){let t=this[na];t.readyState!==Xt.CLOSED&&(t.readyState===Xt.OPEN&&(t._readyState=Xt.CLOSING,Vz(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n)))}function Vz(n){n._closeTimer=setTimeout(n._socket.destroy.bind(n._socket),n._closeTimeout)}function Wz(){let n=this[na];if(this.removeListener("close",Wz),this.removeListener("data",Dm),this.removeListener("end",Zz),n._readyState=Xt.CLOSING,!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);n._receiver.write(t)}n._receiver.end(),this[na]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",xz),n._receiver.on("finish",xz))}function Dm(n){this[na]._receiver.write(n)||this.pause()}function Zz(){let n=this[na];n._readyState=Xt.CLOSING,n._receiver.end(),this.end()}function Xz(){let n=this[na];this.removeListener("error",Xz),this.on("error",jz),n&&(n._readyState=Xt.CLOSING,this.destroy())}});var rV=$((xgA,tV)=>{"use strict";var KgA=Om(),{Duplex:wTe}=$e("stream");function eV(n){n.emit("close")}function DTe(){!this.destroyed&&this._writableState.finished&&this.destroy()}function AV(n){this.removeListener("error",AV),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function OTe(n,t){let o=!0,i=new wTe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(a,A){let r=!A&&i._readableState.objectMode?a.toString():a;i.push(r)||n.pause()}),n.once("error",function(a){i.destroyed||(o=!1,i.destroy(a))}),n.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(e,a){if(n.readyState===n.CLOSED){a(e),process.nextTick(eV,i);return}let A=!1;n.once("error",function(s){A=!0,a(s)}),n.once("close",function(){A||a(e),process.nextTick(eV,i)}),o&&n.terminate()},i._final=function(e){if(n.readyState===n.CONNECTING){n.once("open",function(){i._final(e)});return}n._socket!==null&&(n._socket._writableState.finished?(e(),i._readableState.endEmitted&&i.destroy()):(n._socket.once("finish",function(){e()}),n.close()))},i._read=function(){n.isPaused&&n.resume()},i._write=function(e,a,A){if(n.readyState===n.CONNECTING){n.once("open",function(){i._write(e,a,A)});return}n.send(e,A)},i.on("end",DTe),i.on("error",AV),i}tV.exports=OTe});var eR=$((YgA,aV)=>{"use strict";var{tokenChars:bTe}=Md();function MTe(n){let t=new Set,o=-1,i=-1,e=0;for(e;e{"use strict";var _Te=$e("events"),bm=$e("http"),{Duplex:jgA}=$e("stream"),{createHash:TTe}=$e("crypto"),iV=mm(),Il=bd(),NTe=eR(),RTe=Om(),{CLOSE_TIMEOUT:kTe,GUID:vTe,kWebSocket:PTe}=Sg(),GTe=/^[+/0-9A-Za-z]{22}==$/,oV=0,nV=1,gV=2,AR=class extends _Te{constructor(t,o){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:kTe,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:RTe,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=bm.createServer((i,e)=>{let a=bm.STATUS_CODES[426];e.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),e.end(a)}),this._server.listen(t.port,t.host,t.backlog,o)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=FTe(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,a,A)=>{this.handleUpgrade(e,a,A,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=oV}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===gV){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(au,this);return}if(t&&this.once("close",t),this._state!==nV)if(this._state=nV,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(au,this):process.nextTick(au,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{au(this)})}}shouldHandle(t){if(this.options.path){let o=t.url.indexOf("?");if((o!==-1?t.url.slice(0,o):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,o,i,e){o.on("error",sV);let a=t.headers["sec-websocket-key"],A=t.headers.upgrade,r=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ll(this,t,o,405,"Invalid HTTP method");return}if(A===void 0||A.toLowerCase()!=="websocket"){ll(this,t,o,400,"Invalid Upgrade header");return}if(a===void 0||!GTe.test(a)){ll(this,t,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(r!==13&&r!==8){ll(this,t,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){iu(o,400);return}let s=t.headers["sec-websocket-protocol"],g=new Set;if(s!==void 0)try{g=NTe.parse(s)}catch{ll(this,t,o,400,"Invalid Sec-WebSocket-Protocol header");return}let c=t.headers["sec-websocket-extensions"],I={};if(this.options.perMessageDeflate&&c!==void 0){let d=new Il({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let B=iV.parse(c);B[Il.extensionName]&&(d.accept(B[Il.extensionName]),I[Il.extensionName]=d)}catch{ll(this,t,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:t.headers[`${r===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(B,f,Q,y)=>{if(!B)return iu(o,f||401,Q,y);this.completeUpgrade(I,a,g,t,o,i,e)});return}if(!this.options.verifyClient(d))return iu(o,401)}this.completeUpgrade(I,a,g,t,o,i,e)}completeUpgrade(t,o,i,e,a,A,r){if(!a.readable||!a.writable)return a.destroy();if(a[PTe])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>oV)return iu(a,503);let g=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${TTe("sha1").update(o+vTe).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(i.size){let I=this.options.handleProtocols?this.options.handleProtocols(i,e):i.values().next().value;I&&(g.push(`Sec-WebSocket-Protocol: ${I}`),c._protocol=I)}if(t[Il.extensionName]){let I=t[Il.extensionName].params,d=iV.format({[Il.extensionName]:[I]});g.push(`Sec-WebSocket-Extensions: ${d}`),c._extensions=t}this.emit("headers",g,e),a.write(g.concat(`\r +`+t.prev}function Gy(n,t){var o=JN(n),i=[];if(o){i.length=n.length;for(var e=0;e{"use strict";var Nwe=UC(),Rwe=Ec(),Uy=function(n,t,o){for(var i=n,e;(e=i.next)!=null;i=e)if(e.key===t)return i.next=e.next,o||(e.next=n.next,n.next=e),e},kwe=function(n,t){if(n){var o=Uy(n,t);return o&&o.value}},vwe=function(n,t,o){var i=Uy(n,t);i?i.value=o:n.next={key:t,next:n.next,value:o}},Pwe=function(n,t){return n?!!Uy(n,t):!1},Gwe=function(n,t){if(n)return Uy(n,t,!0)};S4.exports=function(){var t,o={assert:function(i){if(!o.has(i))throw new Rwe("Side channel does not contain "+Nwe(i))},delete:function(i){var e=Gwe(t,i);return e&&t&&!t.next&&(t=void 0),!!e},get:function(i){return kwe(t,i)},has:function(i){return Pwe(t,i)},set:function(i,e){t||(t={next:void 0}),vwe(t,i,e)}};return o}});var ZN=$((BgA,b4)=>{"use strict";var D4=BC(),O4=DT(),Fwe=O4([D4("%String.prototype.indexOf%")]);b4.exports=function(t,o){var i=D4(t,!!o);return typeof i=="function"&&Fwe(t,".prototype.")>-1?O4([i]):i}});var XN=$((fgA,_4)=>{"use strict";var Lwe=BC(),HC=ZN(),Uwe=UC(),Hwe=Ec(),M4=Lwe("%Map%",!0),Kwe=HC("Map.prototype.get",!0),xwe=HC("Map.prototype.set",!0),Ywe=HC("Map.prototype.has",!0),jwe=HC("Map.prototype.delete",!0),Jwe=HC("Map.prototype.size",!0);_4.exports=!!M4&&function(){var t,o={assert:function(i){if(!o.has(i))throw new Hwe("Side channel does not contain "+Uwe(i))},delete:function(i){if(t){var e=jwe(t,i);return Jwe(t)===0&&(t=void 0),e}return!1},get:function(i){if(t)return Kwe(t,i)},has:function(i){return t?Ywe(t,i):!1},set:function(i,e){t||(t=new M4),xwe(t,i,e)}};return o}});var N4=$((QgA,T4)=>{"use strict";var qwe=BC(),Ky=ZN(),zwe=UC(),Hy=XN(),Vwe=Ec(),Cd=qwe("%WeakMap%",!0),Wwe=Ky("WeakMap.prototype.get",!0),Zwe=Ky("WeakMap.prototype.set",!0),Xwe=Ky("WeakMap.prototype.has",!0),$we=Ky("WeakMap.prototype.delete",!0);T4.exports=Cd?function(){var t,o,i={assert:function(e){if(!i.has(e))throw new Vwe("Side channel does not contain "+zwe(e))},delete:function(e){if(Cd&&e&&(typeof e=="object"||typeof e=="function")){if(t)return $we(t,e)}else if(Hy&&o)return o.delete(e);return!1},get:function(e){return Cd&&e&&(typeof e=="object"||typeof e=="function")&&t?Wwe(t,e):o&&o.get(e)},has:function(e){return Cd&&e&&(typeof e=="object"||typeof e=="function")&&t?Xwe(t,e):!!o&&o.has(e)},set:function(e,a){Cd&&e&&(typeof e=="object"||typeof e=="function")?(t||(t=new Cd),Zwe(t,e,a)):Hy&&(o||(o=Hy()),o.set(e,a))}};return i}:Hy});var $N=$((ygA,R4)=>{"use strict";var eDe=Ec(),ADe=UC(),tDe=w4(),rDe=XN(),aDe=N4(),iDe=aDe||rDe||tDe;R4.exports=function(){var t,o={assert:function(i){if(!o.has(i)){var e=i&&Object(i)===i?"the given object key":ADe(i);throw new eDe("Side channel does not contain "+e)}},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,e){t||(t=iDe()),t.set(i,e)}};return o}});var xy=$((mgA,k4)=>{"use strict";var oDe=String.prototype.replace,nDe=/%20/g,e0={RFC1738:"RFC1738",RFC3986:"RFC3986"};k4.exports={default:e0.RFC3986,formatters:{RFC1738:function(n){return oDe.call(n,nDe,"+")},RFC3986:function(n){return String(n)}},RFC1738:e0.RFC1738,RFC3986:e0.RFC3986}});var a0=$((SgA,G4)=>{"use strict";var sDe=xy(),P4=$N(),v4=QT(),A0=Object.prototype.hasOwnProperty,el=Array.isArray,jy=P4(),Al=function(t,o){return jy.set(t,o),t},tl=function(t){return jy.has(t)},KC=function(t){return jy.get(t)},t0=function(t,o){jy.set(t,o)},ls=(function(){for(var n=[],t=0;t<256;++t)n[n.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return n})(),gDe=function(t){for(;t.length>1;){var o=t.pop(),i=o.obj[o.prop];if(el(i)){for(var e=[],a=0;a=i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Al(ud(t.concat(o),i),e)}t[e]=o}else if(t&&typeof t=="object")if(tl(t)){var a=KC(t)+1;t[a]=o,t0(t,a)}else{if(i&&i.strictMerge)return[t,o];(i&&(i.plainObjects||i.allowPrototypes)||!A0.call(Object.prototype,o))&&(t[o]=!0)}else return[t,o];return t}if(!t||typeof t!="object"){if(tl(o)){for(var A=Object.keys(o),r=i&&i.plainObjects?{__proto__:null,0:t}:{0:t},s=0;si.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Al(ud(c,i),c.length-1)}return c}var I=t;if(el(t)&&!el(o)&&(I=ud(t,i)),el(t)&&el(o)){if(o.forEach(function(d,B){if(A0.call(t,B)){var f=t[B];f&&typeof f=="object"&&d&&typeof d=="object"?t[B]=n(f,d,i):t[t.length]=d}else t[B]=d}),i&&typeof i.arrayLimit=="number"&&t.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(i.arrayLimit===1?"":"s")+" allowed in an array.");return Al(ud(t,i),t.length-1)}return t}return Object.keys(o).reduce(function(d,B){var f=o[B];if(A0.call(d,B)?r0(d,B,n(d[B],f,i)):r0(d,B,f),tl(o)&&!tl(d)&&Al(d,KC(o)),tl(d)){var Q=parseInt(B,10);String(Q)===B&&Q>=0&&Q>KC(d)&&t0(d,Q)}return d},I)},IDe=function(t,o){return Object.keys(o).reduce(function(i,e){return r0(i,e,o[e]),i},t)},lDe=function(n,t,o){var i=n.replace(/\+/g," ");if(o==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},Yy=1024,pDe=function(t,o,i,e,a){if(t.length===0)return t;var A=t;if(typeof t=="symbol"?A=Symbol.prototype.toString.call(t):typeof t!="string"&&(A=String(t)),i==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var r="",s=0;s=Yy?A.slice(s,s+Yy):A;if(s+Yy=55296&&c<=56319&&(g=g.slice(0,-1),s-=1)}for(var I=[],d=0;d=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||a===sDe.RFC1738&&(B===40||B===41)){I[I.length]=g.charAt(d);continue}if(B<128){I[I.length]=ls[B];continue}if(B<2048){I[I.length]=ls[192|B>>6]+ls[128|B&63];continue}if(B<55296||B>=57344){I[I.length]=ls[224|B>>12]+ls[128|B>>6&63]+ls[128|B&63];continue}d+=1,B=65536+((B&1023)<<10|g.charCodeAt(d)&1023),I[I.length]=ls[240|B>>18]+ls[128|B>>12&63]+ls[128|B>>6&63]+ls[128|B&63]}r+=I.join("")}return r},dDe=function(t){for(var o=[{obj:{o:t},prop:"o"}],i=P4(),e=0;ei){if(a)throw new RangeError("Array limit exceeded. Only "+i+" element"+(i===1?"":"s")+" allowed in an array.");return Al(ud(r,{plainObjects:e}),r.length-1)}return r},uDe=function(t,o){if(el(t)){for(var i=[],e=0;e{"use strict";var L4=$N(),Jy=a0(),xC=xy(),BDe=Object.prototype.hasOwnProperty,U4={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,o){return t+"["+o+"]"},repeat:function(t){return t}},ps=Array.isArray,fDe=Array.prototype.push,H4=function(n,t){fDe.apply(n,ps(t)?t:[t])},QDe=Date.prototype.toISOString,F4=xC.default,Ur={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Jy.encode,encodeValuesOnly:!1,filter:void 0,format:F4,formatter:xC.formatters[F4],indices:!1,serializeDate:function(t){return QDe.call(t)},skipNulls:!1,strictNullHandling:!1},yDe=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},i0={},mDe=function n(t,o,i,e,a,A,r,s,g,c,I,d,B,f,Q,y,m,T){for(var _=t,R=T,K=0,L=!1;(R=R.get(i0))!==void 0&&!L;){var F=R.get(t);if(K+=1,typeof F<"u"){if(F===K)throw new RangeError("Cyclic object value");L=!0}typeof R.get(i0)>"u"&&(K=0)}if(typeof c=="function"?_=c(o,_):_ instanceof Date?_=B(_):i==="comma"&&ps(_)&&(_=Jy.maybeMap(_,function(se){return se instanceof Date?B(se):se})),_===null){if(A)return Q(g&&!y?g(o,Ur.encoder,m,"key",f):o);_=""}if(yDe(_)||Jy.isBuffer(_)){if(g){var q=y?o:g(o,Ur.encoder,m,"key",f);return[Q(q)+"="+Q(g(_,Ur.encoder,m,"value",f))]}return[Q(o)+"="+Q(String(_))]}var V=[];if(typeof _>"u")return V;var x;if(i==="comma"&&ps(_))y&&g&&(_=Jy.maybeMap(_,function(se){return se==null?se:g(se)})),x=[{value:_.length>0?_.join(",")||null:void 0}];else if(ps(c))x=c;else{var G=Object.keys(_);x=I?G.sort(I):G}var J=s?String(o).replace(/\./g,"%2E"):String(o),U=e&&ps(_)&&_.length===1?J+"[]":J;if(a&&ps(_)&&_.length===0)return U+"[]";for(var N=0;N"u"?t.encodeDotInKeys===!0?!0:Ur.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Ur.addQueryPrefix,allowDots:r,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ur.allowEmptyArrays,arrayFormat:A,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ur.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Ur.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Ur.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Ur.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Ur.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Ur.encodeValuesOnly,filter:a,format:i,formatter:e,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Ur.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Ur.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ur.strictNullHandling}};K4.exports=function(n,t){var o=n,i=SDe(t),e,a;typeof i.filter=="function"?(a=i.filter,o=a("",o)):ps(i.filter)&&(a=i.filter,e=a);var A=[];if(typeof o!="object"||o===null)return"";var r=U4[i.arrayFormat],s=r==="comma"&&i.commaRoundTrip;e||(e=Object.keys(o)),i.sort&&e.sort(i.sort);for(var g=L4(),c=0;c"u"||I===null)){var d=o[I];i.skipNulls&&d===null||H4(A,mDe(d,I,r,s,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,g))}}var B=A.join(i.delimiter),f=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B"+i.delimiter:f+="utf8=%E2%9C%93"+i.delimiter),B.length>0?f+B:""}});var J4=$((DgA,j4)=>{"use strict";var ds=a0(),qy=Object.prototype.hasOwnProperty,o0=Array.isArray,sr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ds.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},wDe=function(n){return n.replace(/&#(\d+);/g,function(t,o){return String.fromCharCode(parseInt(o,10))})},Y4=function(n,t,o,i){if(n&&typeof n=="string"&&t.comma&&n.indexOf(",")>-1){if(i&&t.throwOnLimitExceeded)for(var e=0,a=n.indexOf(",");a>-1;){if(e+=1,e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");a=n.indexOf(",",a+1)}return n.split(",")}if(t.throwOnLimitExceeded&&o>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return n},DDe="utf8=%26%2310003%3B",ODe="utf8=%E2%9C%93",bDe=function(t,o){var i={__proto__:null},e=o.ignoreQueryPrefix?t.replace(/^\?/,""):t;e=e.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=o.parameterLimit===1/0?void 0:o.parameterLimit,A=e.split(o.delimiter,o.throwOnLimitExceeded&&typeof a<"u"?a+1:a);if(o.throwOnLimitExceeded&&typeof a<"u"&&A.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(a===1?"":"s")+" allowed.");var r=-1,s,g=o.charset;if(o.charsetSentinel)for(s=0;s-1&&(f=o0(f)?[f]:f),o.comma&&o0(f)&&f.length>o.arrayLimit&&(f=ds.combine([],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded)),B!==null){var Q=qy.call(i,B);Q&&(o.duplicates==="combine"||c.indexOf("[]=")>-1)?i[B]=ds.combine(i[B],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded):(!Q||o.duplicates==="last")&&(i[B]=f)}}return i},MDe=function(n,t,o,i){var e=0;if(n.length>0&&n[n.length-1]==="[]"){var a=n.slice(0,-1).join("");e=Array.isArray(t)&&t[a]?t[a].length:0}for(var A=i?t:Y4(t,o,e),r=n.length-1;r>=0;--r){var s,g=n[r];if(g==="[]"&&o.parseArrays)ds.isOverflow(A)?s=A:s=o.allowEmptyArrays&&(A===""||o.strictNullHandling&&A===null)?[]:ds.combine([],A,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded);else{s=o.plainObjects?{__proto__:null}:{};var c=g.charAt(0)==="["&&g.charAt(g.length-1)==="]"?g.slice(1,-1):g,I=o.decodeDotInKeys?c.replace(/%2E/g,"."):c,d=parseInt(I,10),B=!isNaN(d)&&g!==I&&String(d)===I&&d>=0&&o.parseArrays;if(!o.parseArrays&&I==="")s={0:A};else if(B&&d=0?i.slice(0,a):i;if(A){if(!o.plainObjects&&qy.call(Object.prototype,A)&&!o.allowPrototypes)return;e[e.length]=A}for(var r=i.length,s=a,g=0;s>=0&&g=0){if(o.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+o.depth+" and strictDepth is true");e[e.length]="["+i.slice(s)+"]"}return e},TDe=function(t,o,i,e){if(t){var a=_De(t,i);if(a)return MDe(a,o,i,e)}},NDe=function(t){if(!t)return sr;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var o=typeof t.charset>"u"?sr.charset:t.charset,i=typeof t.duplicates>"u"?sr.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var e=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:sr.allowDots:!!t.allowDots;return{allowDots:e,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:sr.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:sr.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:sr.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:sr.arrayLimit,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:sr.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:sr.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:sr.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:sr.decoder,delimiter:typeof t.delimiter=="string"||ds.isRegExp(t.delimiter)?t.delimiter:sr.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:sr.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:sr.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:sr.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:sr.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:sr.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:sr.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:sr.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};j4.exports=function(n,t){var o=NDe(t);if(n===""||n===null||typeof n>"u")return o.plainObjects?{__proto__:null}:{};for(var i=typeof n=="string"?bDe(n,o):n,e=o.plainObjects?{__proto__:null}:{},a=Object.keys(i),A=0;A{"use strict";var RDe=x4(),kDe=J4(),vDe=xy();q4.exports={formats:vDe,parse:kDe,stringify:RDe}});var W4=$((bgA,V4)=>{function PDe(n){return n}V4.exports=PDe});var R8=$((YC,fd)=>{var GDe=200,FDe="Expected a function",u0="__lodash_hash_undefined__",em=1,Qd=2,o8=1/0,n8=9007199254740991,zy="[object Arguments]",g0="[object Array]",s8="[object Boolean]",g8="[object Date]",c8="[object Error]",I8="[object Function]",LDe="[object GeneratorFunction]",Vy="[object Map]",l8="[object Number]",Bd="[object Object]",Z4="[object Promise]",p8="[object RegExp]",Wy="[object Set]",d8="[object String]",h8="[object Symbol]",c0="[object WeakMap]",E8="[object ArrayBuffer]",Zy="[object DataView]",UDe="[object Float32Array]",HDe="[object Float64Array]",KDe="[object Int8Array]",xDe="[object Int16Array]",YDe="[object Int32Array]",jDe="[object Uint8Array]",JDe="[object Uint8ClampedArray]",qDe="[object Uint16Array]",zDe="[object Uint32Array]",VDe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,WDe=/^\w*$/,ZDe=/^\./,XDe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$De=/[\\^$.*+?()[\]{}|]/g,eOe=/\\(\\)?/g,AOe=/^\[object .+?Constructor\]$/,tOe=/^(?:0|[1-9]\d*)$/,Yt={};Yt[UDe]=Yt[HDe]=Yt[KDe]=Yt[xDe]=Yt[YDe]=Yt[jDe]=Yt[JDe]=Yt[qDe]=Yt[zDe]=!0;Yt[zy]=Yt[g0]=Yt[E8]=Yt[s8]=Yt[Zy]=Yt[g8]=Yt[c8]=Yt[I8]=Yt[Vy]=Yt[l8]=Yt[Bd]=Yt[p8]=Yt[Wy]=Yt[d8]=Yt[c0]=!1;var C8=typeof global=="object"&&global&&global.Object===Object&&global,rOe=typeof self=="object"&&self&&self.Object===Object&&self,Sc=C8||rOe||Function("return this")(),u8=typeof YC=="object"&&YC&&!YC.nodeType&&YC,X4=u8&&typeof fd=="object"&&fd&&!fd.nodeType&&fd,aOe=X4&&X4.exports===u8,$4=aOe&&C8.process,e8=(function(){try{return $4&&$4.binding("util")}catch{}})(),A8=e8&&e8.isTypedArray;function B8(n,t){for(var o=-1,i=t.length,e=n.length;++o-1}function ROe(n,t){var o=this.__data__,i=tm(o,n);return i<0?o.push([n,t]):o[i][1]=t,this}fg.prototype.clear=MOe;fg.prototype.delete=_Oe;fg.prototype.get=TOe;fg.prototype.has=NOe;fg.prototype.set=ROe;function Qg(n){var t=-1,o=n?n.length:0;for(this.clear();++tr))return!1;var g=a.get(n);if(g&&a.get(t))return g==t;var c=-1,I=!0,d=e&em?new $y:void 0;for(a.set(n,t),a.set(t,n);++c-1&&n%1==0&&n-1&&n%1==0&&n<=n8}function qC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function om(n){return!!n&&typeof n=="object"}function S0(n){return typeof n=="symbol"||om(n)&&yd.call(n)==h8}var Bbe=A8?sOe(A8):XOe;function fbe(n){return n==null?"":obe(n)}function Qbe(n,t,o){var i=n==null?void 0:y8(n,t);return i===void 0?o:i}function ybe(n,t){return n!=null&&pbe(n,t,zOe)}function C0(n){return y0(n)?Q8(n):ebe(n)}function mbe(n){return y0(n)?Q8(n,!0):Abe(n)}function Sbe(n,t){return n==null?{}:abe(n,gbe(n),$Oe(t))}function wbe(n){return n}function Dbe(n){return am(n)?oOe(im(n)):ibe(n)}function N8(){return[]}fd.exports=Sbe});var sz=$((zC,Sd)=>{var Obe=200,x8="__lodash_hash_undefined__",bbe=800,Mbe=16,Y8=9007199254740991,j8="[object Arguments]",_be="[object Array]",Tbe="[object AsyncFunction]",Nbe="[object Boolean]",Rbe="[object Date]",kbe="[object Error]",J8="[object Function]",vbe="[object GeneratorFunction]",Pbe="[object Map]",Gbe="[object Number]",Fbe="[object Null]",q8="[object Object]",Lbe="[object Proxy]",Ube="[object RegExp]",Hbe="[object Set]",Kbe="[object String]",xbe="[object Undefined]",Ybe="[object WeakMap]",jbe="[object ArrayBuffer]",Jbe="[object DataView]",qbe="[object Float32Array]",zbe="[object Float64Array]",Vbe="[object Int8Array]",Wbe="[object Int16Array]",Zbe="[object Int32Array]",Xbe="[object Uint8Array]",$be="[object Uint8ClampedArray]",eMe="[object Uint16Array]",AMe="[object Uint32Array]",tMe=/[\\^$.*+?()[\]{}|]/g,rMe=/^\[object .+?Constructor\]$/,aMe=/^(?:0|[1-9]\d*)$/,jt={};jt[qbe]=jt[zbe]=jt[Vbe]=jt[Wbe]=jt[Zbe]=jt[Xbe]=jt[$be]=jt[eMe]=jt[AMe]=!0;jt[j8]=jt[_be]=jt[jbe]=jt[Nbe]=jt[Jbe]=jt[Rbe]=jt[kbe]=jt[J8]=jt[Pbe]=jt[Gbe]=jt[q8]=jt[Ube]=jt[Hbe]=jt[Kbe]=jt[Ybe]=!1;var z8=typeof global=="object"&&global&&global.Object===Object&&global,iMe=typeof self=="object"&&self&&self.Object===Object&&self,ZC=z8||iMe||Function("return this")(),V8=typeof zC=="object"&&zC&&!zC.nodeType&&zC,VC=V8&&typeof Sd=="object"&&Sd&&!Sd.nodeType&&Sd,W8=VC&&VC.exports===V8,w0=W8&&z8.process,k8=(function(){try{var n=VC&&VC.require&&VC.require("util").types;return n||w0&&w0.binding&&w0.binding("util")}catch{}})(),v8=k8&&k8.isTypedArray;function oMe(n,t,o){switch(o.length){case 0:return n.call(t);case 1:return n.call(t,o[0]);case 2:return n.call(t,o[0],o[1]);case 3:return n.call(t,o[0],o[1],o[2])}return n.apply(t,o)}function nMe(n,t){for(var o=-1,i=Array(n);++o-1}function MMe(n,t){var o=this.__data__,i=Im(o,n);return i<0?(++this.size,o.push([n,t])):o[i][1]=t,this}mg.prototype.clear=wMe;mg.prototype.delete=DMe;mg.prototype.get=OMe;mg.prototype.has=bMe;mg.prototype.set=MMe;function wd(n){var t=-1,o=n==null?0:n.length;for(this.clear();++t1?o[e-1]:void 0,A=e>2?o[2]:void 0;for(a=n.length>3&&typeof a=="function"?(e--,a):void 0,A&&a_e(o[0],o[1],A)&&(a=e<3?void 0:a,e=1),t=Object(t);++i-1&&n%1==0&&n0){if(++t>=bbe)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function l_e(n){if(n!=null){try{return cm.call(n)}catch{}try{return n+""}catch{}}return""}function dm(n,t){return n===t||n!==n&&t!==t}var M0=K8((function(){return arguments})())?K8:function(n){return XC(n)&&yg.call(n,"callee")&&!hMe.call(n,"callee")},_0=Array.isArray;function R0(n){return n!=null&&az(n.length)&&!k0(n)}function p_e(n){return XC(n)&&R0(n)}var rz=CMe||u_e;function k0(n){if(!nl(n))return!1;var t=lm(n);return t==J8||t==vbe||t==Tbe||t==Lbe}function az(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Y8}function nl(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function XC(n){return n!=null&&typeof n=="object"}function d_e(n){if(!XC(n)||lm(n)!=q8)return!1;var t=X8(n);if(t===null)return!0;var o=yg.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&cm.call(o)==pMe}var iz=v8?sMe(v8):YMe;function h_e(n){return $Me(n,oz(n))}function oz(n){return R0(n)?UMe(n,!0):jMe(n)}var E_e=e_e(function(n,t,o){ez(n,t,o)});function C_e(n){return function(){return n}}function nz(n){return n}function u_e(){return!1}Sd.exports=E_e});var Sg=$((MgA,Iz)=>{"use strict";var gz=["nodebuffer","arraybuffer","fragments"],cz=typeof Blob<"u";cz&&gz.push("blob");Iz.exports={BINARY_TYPES:gz,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:cz,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var $C=$((_gA,hm)=>{"use strict";var{EMPTY_BUFFER:B_e}=Sg(),v0=Buffer[Symbol.species];function f_e(n,t){if(n.length===0)return B_e;if(n.length===1)return n[0];let o=Buffer.allocUnsafe(t),i=0;for(let e=0;e{"use strict";var dz=Symbol("kDone"),G0=Symbol("kRun"),F0=class{constructor(t){this[dz]=()=>{this.pending--,this[G0]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[G0]()}[G0](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[dz])}}};hz.exports=F0});var Md=$((NgA,fz)=>{"use strict";var eu=$e("zlib"),Cz=$C(),y_e=Ez(),{kStatusCode:uz}=Sg(),m_e=Buffer[Symbol.species],S_e=Buffer.from([0,0,255,255]),Cm=Symbol("permessage-deflate"),wg=Symbol("total-length"),Od=Symbol("callback"),wc=Symbol("buffers"),bd=Symbol("error"),Em,L0=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Em){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Em=new y_e(o)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Od];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let o=this._options,i=t.find(e=>!(o.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>e.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&(typeof e.client_max_window_bits=="number"?o.clientMaxWindowBits>e.client_max_window_bits:!e.client_max_window_bits)));if(!i)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(i.server_no_context_takeover=!0),o.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(i.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?i.client_max_window_bits=o.clientMaxWindowBits:(i.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let o=t[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(t){return t.forEach(o=>{Object.keys(o).forEach(i=>{let e=o[i];if(e.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(e=e[0],i==="client_max_window_bits"){if(e!==!0){let a=+e;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${e}`);e=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${e}`)}else if(i==="server_max_window_bits"){let a=+e;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${e}`);e=a}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(e!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${e}`)}else throw new Error(`Unknown parameter "${i}"`);o[i]=e})}),t}decompress(t,o,i){Em.add(e=>{this._decompress(t,o,(a,A)=>{e(),i(a,A)})})}compress(t,o,i){Em.add(e=>{this._compress(t,o,(a,A)=>{e(),i(a,A)})})}_decompress(t,o,i){let e=this._isServer?"client":"server";if(!this._inflate){let a=`${e}_max_window_bits`,A=typeof this.params[a]!="number"?eu.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=eu.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A}),this._inflate[Cm]=this,this._inflate[wg]=0,this._inflate[wc]=[],this._inflate.on("error",D_e),this._inflate.on("data",Bz)}this._inflate[Od]=i,this._inflate.write(t),o&&this._inflate.write(S_e),this._inflate.flush(()=>{let a=this._inflate[bd];if(a){this._inflate.close(),this._inflate=null,i(a);return}let A=Cz.concat(this._inflate[wc],this._inflate[wg]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[wg]=0,this._inflate[wc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._inflate.reset()),i(null,A)})}_compress(t,o,i){let e=this._isServer?"server":"client";if(!this._deflate){let a=`${e}_max_window_bits`,A=typeof this.params[a]!="number"?eu.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=eu.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A}),this._deflate[wg]=0,this._deflate[wc]=[],this._deflate.on("data",w_e)}this._deflate[Od]=i,this._deflate.write(t),this._deflate.flush(eu.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=Cz.concat(this._deflate[wc],this._deflate[wg]);o&&(a=new m_e(a.buffer,a.byteOffset,a.length-4)),this._deflate[Od]=null,this._deflate[wg]=0,this._deflate[wc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._deflate.reset(),i(null,a)})}};fz.exports=L0;function w_e(n){this[wc].push(n),this[wg]+=n.length}function Bz(n){if(this[wg]+=n.length,this[Cm]._maxPayload<1||this[wg]<=this[Cm]._maxPayload){this[wc].push(n);return}this[bd]=new RangeError("Max payload size exceeded"),this[bd].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[bd][uz]=1009,this.removeListener("data",Bz),this.reset()}function D_e(n){if(this[Cm]._inflate=null,this[bd]){this[Od](this[bd]);return}n[uz]=1007,this[Od](n)}});var _d=$((RgA,um)=>{"use strict";var{isUtf8:Qz}=$e("buffer"),{hasBlob:O_e}=Sg(),b_e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function M_e(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function U0(n){let t=n.length,o=0;for(;o=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||n[o]===224&&(n[o+1]&224)===128||n[o]===237&&(n[o+1]&224)===160)return!1;o+=3}else if((n[o]&248)===240){if(o+3>=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||(n[o+3]&192)!==128||n[o]===240&&(n[o+1]&240)===128||n[o]===244&&n[o+1]>143||n[o]>244)return!1;o+=4}else return!1;return!0}function __e(n){return O_e&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&(n[Symbol.toStringTag]==="Blob"||n[Symbol.toStringTag]==="File")}um.exports={isBlob:__e,isValidStatusCode:M_e,isValidUTF8:U0,tokenChars:b_e};if(Qz)um.exports.isValidUTF8=function(n){return n.length<24?U0(n):Qz(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=$e("utf-8-validate");um.exports.isValidUTF8=function(t){return t.length<32?U0(t):n(t)}}catch{}});var j0=$((kgA,bz)=>{"use strict";var{Writable:T_e}=$e("stream"),yz=Md(),{BINARY_TYPES:N_e,EMPTY_BUFFER:mz,kStatusCode:R_e,kWebSocket:k_e}=Sg(),{concat:H0,toArrayBuffer:v_e,unmask:P_e}=$C(),{isValidStatusCode:G_e,isValidUTF8:Sz}=_d(),Bm=Buffer[Symbol.species],Fo=0,wz=1,Dz=2,Oz=3,K0=4,x0=5,fm=6,Y0=class extends T_e{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||N_e[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[k_e]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Fo}_write(t,o,i){if(this._opcode===8&&this._state==Fo)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=i.length?o.set(this._buffers.shift(),e):(o.set(new Uint8Array(i.buffer,i.byteOffset,t),e),this._buffers[0]=new Bm(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return o}startLoop(t){this._loop=!0;do switch(this._state){case Fo:this.getInfo(t);break;case wz:this.getPayloadLength16(t);break;case Dz:this.getPayloadLength64(t);break;case Oz:this.getMask();break;case K0:this.getData(t);break;case x0:case fm:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let e=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(e);return}let i=(o[0]&64)===64;if(i&&!this._extensions[yz.extensionName]){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(i){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(!this._fragmented){let e=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let e=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(e);return}if(i){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let e=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(e);return}}else{let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let e=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(e);return}}else if(this._masked){let e=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(e);return}this._payloadLength===126?this._state=wz:this._payloadLength===127?this._state=Dz:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let o=this.consume(8),i=o.readUInt32BE(0);if(i>Math.pow(2,21)-1){let e=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(e);return}this._payloadLength=i*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._masked?this._state=Oz:this._state=K0}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=K0}getData(t){let o=mz;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(o,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(i);return}if(this._compressed){this._state=x0,this.decompress(o,t);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(t)}decompress(t,o){this._extensions[yz.extensionName].decompress(t,this._fin,(e,a)=>{if(e)return o(e);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let A=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(A);return}this._fragments.push(a)}this.dataMessage(o),this._state===Fo&&this.startLoop(o)})}dataMessage(t){if(!this._fin){this._state=Fo;return}let o=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let e;this._binaryType==="nodebuffer"?e=H0(i,o):this._binaryType==="arraybuffer"?e=v_e(H0(i,o)):this._binaryType==="blob"?e=new Blob(i):e=i,this._allowSynchronousEvents?(this.emit("message",e,!0),this._state=Fo):(this._state=fm,setImmediate(()=>{this.emit("message",e,!0),this._state=Fo,this.startLoop(t)}))}else{let e=H0(i,o);if(!this._skipUTF8Validation&&!Sz(e)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===x0||this._allowSynchronousEvents?(this.emit("message",e,!1),this._state=Fo):(this._state=fm,setImmediate(()=>{this.emit("message",e,!1),this._state=Fo,this.startLoop(t)}))}}controlMessage(t,o){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,mz),this.end();else{let i=t.readUInt16BE(0);if(!G_e(i)){let a=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(a);return}let e=new Bm(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Sz(e)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(a);return}this._loop=!1,this.emit("conclude",i,e),this.end()}this._state=Fo;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Fo):(this._state=fm,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Fo,this.startLoop(o)}))}createError(t,o,i,e,a){this._loop=!1,this._errored=!0;let A=new t(i?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(A,this.createError),A.code=a,A[R_e]=e,A}};bz.exports=Y0});var z0=$((PgA,Tz)=>{"use strict";var{Duplex:vgA}=$e("stream"),{randomFillSync:F_e}=$e("crypto"),{types:{isUint8Array:L_e}}=$e("util"),Mz=Md(),{EMPTY_BUFFER:U_e,kWebSocket:H_e,NOOP:K_e}=Sg(),{isBlob:Td,isValidStatusCode:x_e}=_d(),{mask:_z,toBuffer:sl}=$C(),Lo=Symbol("kByteLength"),Y_e=Buffer.alloc(4),Qm=8*1024,gl,Nd=Qm,wn=0,j_e=1,J_e=2,J0=class n{constructor(t,o,i){this._extensions=o||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=wn,this.onerror=K_e,this[H_e]=void 0}static frame(t,o){let i,e=!1,a=2,A=!1;o.mask&&(i=o.maskBuffer||Y_e,o.generateMask?o.generateMask(i):(Nd===Qm&&(gl===void 0&&(gl=Buffer.alloc(Qm)),F_e(gl,0,Qm),Nd=0),i[0]=gl[Nd++],i[1]=gl[Nd++],i[2]=gl[Nd++],i[3]=gl[Nd++]),A=(i[0]|i[1]|i[2]|i[3])===0,a=6);let r;typeof t=="string"?(!o.mask||A)&&o[Lo]!==void 0?r=o[Lo]:(t=Buffer.from(t),r=t.length):(r=t.length,e=o.mask&&o.readOnly&&!A);let s=r;r>=65536?(a+=8,s=127):r>125&&(a+=2,s=126);let g=Buffer.allocUnsafe(e?r+a:a);return g[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(g[0]|=64),g[1]=s,s===126?g.writeUInt16BE(r,2):s===127&&(g[2]=g[3]=0,g.writeUIntBE(r,4,6)),o.mask?(g[1]|=128,g[a-4]=i[0],g[a-3]=i[1],g[a-2]=i[2],g[a-1]=i[3],A?[g,t]:e?(_z(t,i,g,a,r),[g]):(_z(t,i,t,0,r),[g,t])):[g,t]}close(t,o,i,e){let a;if(t===void 0)a=U_e;else{if(typeof t!="number"||!x_e(t))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let r=Buffer.byteLength(o);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");if(a=Buffer.allocUnsafe(2+r),a.writeUInt16BE(t,0),typeof o=="string")a.write(o,2);else if(L_e(o))a.set(o,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let A={[Lo]:a.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wn?this.enqueue([this.dispatch,a,!1,A,e]):this.sendFrame(n.frame(a,A),e)}ping(t,o,i){let e,a;if(typeof t=="string"?(e=Buffer.byteLength(t),a=!1):Td(t)?(e=t.size,a=!1):(t=sl(t),e=t.length,a=sl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[Lo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};Td(t)?this._state!==wn?this.enqueue([this.getBlobData,t,!1,A,i]):this.getBlobData(t,!1,A,i):this._state!==wn?this.enqueue([this.dispatch,t,!1,A,i]):this.sendFrame(n.frame(t,A),i)}pong(t,o,i){let e,a;if(typeof t=="string"?(e=Buffer.byteLength(t),a=!1):Td(t)?(e=t.size,a=!1):(t=sl(t),e=t.length,a=sl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[Lo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};Td(t)?this._state!==wn?this.enqueue([this.getBlobData,t,!1,A,i]):this.getBlobData(t,!1,A,i):this._state!==wn?this.enqueue([this.dispatch,t,!1,A,i]):this.sendFrame(n.frame(t,A),i)}send(t,o,i){let e=this._extensions[Mz.extensionName],a=o.binary?2:1,A=o.compress,r,s;typeof t=="string"?(r=Buffer.byteLength(t),s=!1):Td(t)?(r=t.size,s=!1):(t=sl(t),r=t.length,s=sl.readOnly),this._firstFragment?(this._firstFragment=!1,A&&e&&e.params[e._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(A=r>=e._threshold),this._compress=A):(A=!1,a=0),o.fin&&(this._firstFragment=!0);let g={[Lo]:r,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:s,rsv1:A};Td(t)?this._state!==wn?this.enqueue([this.getBlobData,t,this._compress,g,i]):this.getBlobData(t,this._compress,g,i):this._state!==wn?this.enqueue([this.dispatch,t,this._compress,g,i]):this.dispatch(t,this._compress,g,i)}getBlobData(t,o,i,e){this._bufferedBytes+=i[Lo],this._state=J_e,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let r=new Error("The socket was closed while the blob was being read");process.nextTick(q0,this,r,e);return}this._bufferedBytes-=i[Lo];let A=sl(a);o?this.dispatch(A,o,i,e):(this._state=wn,this.sendFrame(n.frame(A,i),e),this.dequeue())}).catch(a=>{process.nextTick(q_e,this,a,e)})}dispatch(t,o,i,e){if(!o){this.sendFrame(n.frame(t,i),e);return}let a=this._extensions[Mz.extensionName];this._bufferedBytes+=i[Lo],this._state=j_e,a.compress(t,i.fin,(A,r)=>{if(this._socket.destroyed){let s=new Error("The socket was closed while data was being compressed");q0(this,s,e);return}this._bufferedBytes-=i[Lo],this._state=wn,i.readOnly=!1,this.sendFrame(n.frame(r,i),e),this.dequeue()})}dequeue(){for(;this._state===wn&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Lo],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Lo],this._queue.push(t)}sendFrame(t,o){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],o),this._socket.uncork()):this._socket.write(t[0],o)}};Tz.exports=J0;function q0(n,t,o){typeof o=="function"&&o(t);for(let i=0;i{"use strict";var{kForOnEventAttribute:Au,kListener:V0}=Sg(),Nz=Symbol("kCode"),Rz=Symbol("kData"),kz=Symbol("kError"),vz=Symbol("kMessage"),Pz=Symbol("kReason"),Rd=Symbol("kTarget"),Gz=Symbol("kType"),Fz=Symbol("kWasClean"),Dg=class{constructor(t){this[Rd]=null,this[Gz]=t}get target(){return this[Rd]}get type(){return this[Gz]}};Object.defineProperty(Dg.prototype,"target",{enumerable:!0});Object.defineProperty(Dg.prototype,"type",{enumerable:!0});var cl=class extends Dg{constructor(t,o={}){super(t),this[Nz]=o.code===void 0?0:o.code,this[Pz]=o.reason===void 0?"":o.reason,this[Fz]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[Nz]}get reason(){return this[Pz]}get wasClean(){return this[Fz]}};Object.defineProperty(cl.prototype,"code",{enumerable:!0});Object.defineProperty(cl.prototype,"reason",{enumerable:!0});Object.defineProperty(cl.prototype,"wasClean",{enumerable:!0});var kd=class extends Dg{constructor(t,o={}){super(t),this[kz]=o.error===void 0?null:o.error,this[vz]=o.message===void 0?"":o.message}get error(){return this[kz]}get message(){return this[vz]}};Object.defineProperty(kd.prototype,"error",{enumerable:!0});Object.defineProperty(kd.prototype,"message",{enumerable:!0});var tu=class extends Dg{constructor(t,o={}){super(t),this[Rz]=o.data===void 0?null:o.data}get data(){return this[Rz]}};Object.defineProperty(tu.prototype,"data",{enumerable:!0});var z_e={addEventListener(n,t,o={}){for(let e of this.listeners(n))if(!o[Au]&&e[V0]===t&&!e[Au])return;let i;if(n==="message")i=function(a,A){let r=new tu("message",{data:A?a:a.toString()});r[Rd]=this,ym(t,this,r)};else if(n==="close")i=function(a,A){let r=new cl("close",{code:a,reason:A.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[Rd]=this,ym(t,this,r)};else if(n==="error")i=function(a){let A=new kd("error",{error:a,message:a.message});A[Rd]=this,ym(t,this,A)};else if(n==="open")i=function(){let a=new Dg("open");a[Rd]=this,ym(t,this,a)};else return;i[Au]=!!o[Au],i[V0]=t,o.once?this.once(n,i):this.on(n,i)},removeEventListener(n,t){for(let o of this.listeners(n))if(o[V0]===t&&!o[Au]){this.removeListener(n,o);break}}};Lz.exports={CloseEvent:cl,ErrorEvent:kd,Event:Dg,EventTarget:z_e,MessageEvent:tu};function ym(n,t,o){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,o):n.call(t,o)}});var mm=$((FgA,Hz)=>{"use strict";var{tokenChars:ru}=_d();function Es(n,t,o){n[t]===void 0?n[t]=[o]:n[t].push(o)}function V_e(n){let t=Object.create(null),o=Object.create(null),i=!1,e=!1,a=!1,A,r,s=-1,g=-1,c=-1,I=0;for(;I{let o=n[t];return Array.isArray(o)||(o=[o]),o.map(i=>[t].concat(Object.keys(i).map(e=>{let a=i[e];return Array.isArray(a)||(a=[a]),a.map(A=>A===!0?e:`${e}=${A}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Hz.exports={format:W_e,parse:V_e}});var Om=$((HgA,$z)=>{"use strict";var Z_e=$e("events"),X_e=$e("https"),$_e=$e("http"),Yz=$e("net"),eTe=$e("tls"),{randomBytes:ATe,createHash:tTe}=$e("crypto"),{Duplex:LgA,Readable:UgA}=$e("stream"),{URL:W0}=$e("url"),Dc=Md(),rTe=j0(),aTe=z0(),{isBlob:iTe}=_d(),{BINARY_TYPES:Kz,CLOSE_TIMEOUT:oTe,EMPTY_BUFFER:Sm,GUID:nTe,kForOnEventAttribute:Z0,kListener:sTe,kStatusCode:gTe,kWebSocket:na,NOOP:jz}=Sg(),{EventTarget:{addEventListener:cTe,removeEventListener:ITe}}=Uz(),{format:lTe,parse:pTe}=mm(),{toBuffer:dTe}=$C(),Jz=Symbol("kAborted"),X0=[8,13],Og=["CONNECTING","OPEN","CLOSING","CLOSED"],hTe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Xt=class n extends Z_e{constructor(t,o,i){super(),this._binaryType=Kz[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Sm,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(i=o,o=[]):o=[o]),qz(this,t,o,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Kz.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,o,i){let e=new rTe({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),a=new aTe(t,this._extensions,i.generateMask);this._receiver=e,this._sender=a,this._socket=t,e[na]=this,a[na]=this,t[na]=this,e.on("conclude",uTe),e.on("drain",BTe),e.on("error",fTe),e.on("message",QTe),e.on("ping",yTe),e.on("pong",mTe),a.onerror=STe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),o.length>0&&t.unshift(o),t.on("close",Wz),t.on("data",Dm),t.on("end",Zz),t.on("error",Xz),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Dc.extensionName]&&this._extensions[Dc.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,o){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){no(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,o,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Vz(this)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,o,i){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=o=void 0):typeof o=="function"&&(i=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){$0(this,t,i);return}o===void 0&&(o=!this._isServer),this._sender.ping(t||Sm,o,i)}pong(t,o,i){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=o=void 0):typeof o=="function"&&(i=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){$0(this,t,i);return}o===void 0&&(o=!this._isServer),this._sender.pong(t||Sm,o,i)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,o,i){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(i=o,o={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){$0(this,t,i);return}let e={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[Dc.extensionName]||(e.compress=!1),this._sender.send(t||Sm,e,i)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){no(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(Xt,"CONNECTING",{enumerable:!0,value:Og.indexOf("CONNECTING")});Object.defineProperty(Xt.prototype,"CONNECTING",{enumerable:!0,value:Og.indexOf("CONNECTING")});Object.defineProperty(Xt,"OPEN",{enumerable:!0,value:Og.indexOf("OPEN")});Object.defineProperty(Xt.prototype,"OPEN",{enumerable:!0,value:Og.indexOf("OPEN")});Object.defineProperty(Xt,"CLOSING",{enumerable:!0,value:Og.indexOf("CLOSING")});Object.defineProperty(Xt.prototype,"CLOSING",{enumerable:!0,value:Og.indexOf("CLOSING")});Object.defineProperty(Xt,"CLOSED",{enumerable:!0,value:Og.indexOf("CLOSED")});Object.defineProperty(Xt.prototype,"CLOSED",{enumerable:!0,value:Og.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(Xt.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(Xt.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[Z0])return t[sTe];return null},set(t){for(let o of this.listeners(n))if(o[Z0]){this.removeListener(n,o);break}typeof t=="function"&&this.addEventListener(n,t,{[Z0]:!0})}})});Xt.prototype.addEventListener=cTe;Xt.prototype.removeEventListener=ITe;$z.exports=Xt;function qz(n,t,o,i){let e={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:oTe,protocolVersion:X0[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=e.autoPong,n._closeTimeout=e.closeTimeout,!X0.includes(e.protocolVersion))throw new RangeError(`Unsupported protocol version: ${e.protocolVersion} (supported versions: ${X0.join(", ")})`);let a;if(t instanceof W0)a=t;else try{a=new W0(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),n._url=a.href;let A=a.protocol==="wss:",r=a.protocol==="ws+unix:",s;if(a.protocol!=="ws:"&&!A&&!r?s=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:r&&!a.pathname?s="The URL's pathname is empty":a.hash&&(s="The URL contains a fragment identifier"),s){let Q=new SyntaxError(s);if(n._redirects===0)throw Q;wm(n,Q);return}let g=A?443:80,c=ATe(16).toString("base64"),I=A?X_e.request:$_e.request,d=new Set,B;if(e.createConnection=e.createConnection||(A?CTe:ETe),e.defaultPort=e.defaultPort||g,e.port=a.port||g,e.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,e.headers={...e.headers,"Sec-WebSocket-Version":e.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},e.path=a.pathname+a.search,e.timeout=e.handshakeTimeout,e.perMessageDeflate&&(B=new Dc({...e.perMessageDeflate,isServer:!1,maxPayload:e.maxPayload}),e.headers["Sec-WebSocket-Extensions"]=lTe({[Dc.extensionName]:B.offer()})),o.length){for(let Q of o){if(typeof Q!="string"||!hTe.test(Q)||d.has(Q))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(Q)}e.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(e.origin&&(e.protocolVersion<13?e.headers["Sec-WebSocket-Origin"]=e.origin:e.headers.Origin=e.origin),(a.username||a.password)&&(e.auth=`${a.username}:${a.password}`),r){let Q=e.path.split(":");e.socketPath=Q[0],e.path=Q[1]}let f;if(e.followRedirects){if(n._redirects===0){n._originalIpc=r,n._originalSecure=A,n._originalHostOrSocketPath=r?e.socketPath:a.host;let Q=i&&i.headers;if(i={...i,headers:{}},Q)for(let[y,m]of Object.entries(Q))i.headers[y.toLowerCase()]=m}else if(n.listenerCount("redirect")===0){let Q=r?n._originalIpc?e.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:a.host===n._originalHostOrSocketPath;(!Q||n._originalSecure&&!A)&&(delete e.headers.authorization,delete e.headers.cookie,Q||delete e.headers.host,e.auth=void 0)}e.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(e.auth).toString("base64")),f=n._req=I(e),n._redirects&&n.emit("redirect",n.url,f)}else f=n._req=I(e);e.timeout&&f.on("timeout",()=>{no(n,f,"Opening handshake has timed out")}),f.on("error",Q=>{f===null||f[Jz]||(f=n._req=null,wm(n,Q))}),f.on("response",Q=>{let y=Q.headers.location,m=Q.statusCode;if(y&&e.followRedirects&&m>=300&&m<400){if(++n._redirects>e.maxRedirects){no(n,f,"Maximum redirects exceeded");return}f.abort();let T;try{T=new W0(y,t)}catch{let R=new SyntaxError(`Invalid URL: ${y}`);wm(n,R);return}qz(n,T,o,i)}else n.emit("unexpected-response",f,Q)||no(n,f,`Unexpected server response: ${Q.statusCode}`)}),f.on("upgrade",(Q,y,m)=>{if(n.emit("upgrade",Q),n.readyState!==Xt.CONNECTING)return;f=n._req=null;let T=Q.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){no(n,y,"Invalid Upgrade header");return}let _=tTe("sha1").update(c+nTe).digest("base64");if(Q.headers["sec-websocket-accept"]!==_){no(n,y,"Invalid Sec-WebSocket-Accept header");return}let R=Q.headers["sec-websocket-protocol"],K;if(R!==void 0?d.size?d.has(R)||(K="Server sent an invalid subprotocol"):K="Server sent a subprotocol but none was requested":d.size&&(K="Server sent no subprotocol"),K){no(n,y,K);return}R&&(n._protocol=R);let L=Q.headers["sec-websocket-extensions"];if(L!==void 0){if(!B){no(n,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=pTe(L)}catch{no(n,y,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(F);if(q.length!==1||q[0]!==Dc.extensionName){no(n,y,"Server indicated an extension that was not requested");return}try{B.accept(F[Dc.extensionName])}catch{no(n,y,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[Dc.extensionName]=B}n.setSocket(y,m,{allowSynchronousEvents:e.allowSynchronousEvents,generateMask:e.generateMask,maxBufferedChunks:e.maxBufferedChunks,maxFragments:e.maxFragments,maxPayload:e.maxPayload,skipUTF8Validation:e.skipUTF8Validation})}),e.finishRequest?e.finishRequest(f,n):f.end()}function wm(n,t){n._readyState=Xt.CLOSING,n._errorEmitted=!0,n.emit("error",t),n.emitClose()}function ETe(n){return n.path=n.socketPath,Yz.connect(n)}function CTe(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=Yz.isIP(n.host)?"":n.host),eTe.connect(n)}function no(n,t,o){n._readyState=Xt.CLOSING;let i=new Error(o);Error.captureStackTrace(i,no),t.setHeader?(t[Jz]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(wm,n,i)):(t.destroy(i),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function $0(n,t,o){if(t){let i=iTe(t)?t.size:dTe(t).length;n._socket?n._sender._bufferedBytes+=i:n._bufferedAmount+=i}if(o){let i=new Error(`WebSocket is not open: readyState ${n.readyState} (${Og[n.readyState]})`);process.nextTick(o,i)}}function uTe(n,t){let o=this[na];o._closeFrameReceived=!0,o._closeMessage=t,o._closeCode=n,o._socket[na]!==void 0&&(o._socket.removeListener("data",Dm),process.nextTick(zz,o._socket),n===1005?o.close():o.close(n,t))}function BTe(){let n=this[na];n.isPaused||n._socket.resume()}function fTe(n){let t=this[na];t._socket[na]!==void 0&&(t._socket.removeListener("data",Dm),process.nextTick(zz,t._socket),t.close(n[gTe])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n))}function xz(){this[na].emitClose()}function QTe(n,t){this[na].emit("message",n,t)}function yTe(n){let t=this[na];t._autoPong&&t.pong(n,!this._isServer,jz),t.emit("ping",n)}function mTe(n){this[na].emit("pong",n)}function zz(n){n.resume()}function STe(n){let t=this[na];t.readyState!==Xt.CLOSED&&(t.readyState===Xt.OPEN&&(t._readyState=Xt.CLOSING,Vz(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n)))}function Vz(n){n._closeTimer=setTimeout(n._socket.destroy.bind(n._socket),n._closeTimeout)}function Wz(){let n=this[na];if(this.removeListener("close",Wz),this.removeListener("data",Dm),this.removeListener("end",Zz),n._readyState=Xt.CLOSING,!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);n._receiver.write(t)}n._receiver.end(),this[na]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",xz),n._receiver.on("finish",xz))}function Dm(n){this[na]._receiver.write(n)||this.pause()}function Zz(){let n=this[na];n._readyState=Xt.CLOSING,n._receiver.end(),this.end()}function Xz(){let n=this[na];this.removeListener("error",Xz),this.on("error",jz),n&&(n._readyState=Xt.CLOSING,this.destroy())}});var rV=$((xgA,tV)=>{"use strict";var KgA=Om(),{Duplex:wTe}=$e("stream");function eV(n){n.emit("close")}function DTe(){!this.destroyed&&this._writableState.finished&&this.destroy()}function AV(n){this.removeListener("error",AV),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function OTe(n,t){let o=!0,i=new wTe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(a,A){let r=!A&&i._readableState.objectMode?a.toString():a;i.push(r)||n.pause()}),n.once("error",function(a){i.destroyed||(o=!1,i.destroy(a))}),n.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(e,a){if(n.readyState===n.CLOSED){a(e),process.nextTick(eV,i);return}let A=!1;n.once("error",function(s){A=!0,a(s)}),n.once("close",function(){A||a(e),process.nextTick(eV,i)}),o&&n.terminate()},i._final=function(e){if(n.readyState===n.CONNECTING){n.once("open",function(){i._final(e)});return}n._socket!==null&&(n._socket._writableState.finished?(e(),i._readableState.endEmitted&&i.destroy()):(n._socket.once("finish",function(){e()}),n.close()))},i._read=function(){n.isPaused&&n.resume()},i._write=function(e,a,A){if(n.readyState===n.CONNECTING){n.once("open",function(){i._write(e,a,A)});return}n.send(e,A)},i.on("end",DTe),i.on("error",AV),i}tV.exports=OTe});var eR=$((YgA,aV)=>{"use strict";var{tokenChars:bTe}=_d();function MTe(n){let t=new Set,o=-1,i=-1,e=0;for(e;e{"use strict";var _Te=$e("events"),bm=$e("http"),{Duplex:jgA}=$e("stream"),{createHash:TTe}=$e("crypto"),iV=mm(),Il=Md(),NTe=eR(),RTe=Om(),{CLOSE_TIMEOUT:kTe,GUID:vTe,kWebSocket:PTe}=Sg(),GTe=/^[+/0-9A-Za-z]{22}==$/,oV=0,nV=1,gV=2,AR=class extends _Te{constructor(t,o){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:kTe,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:RTe,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=bm.createServer((i,e)=>{let a=bm.STATUS_CODES[426];e.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),e.end(a)}),this._server.listen(t.port,t.host,t.backlog,o)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=FTe(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,a,A)=>{this.handleUpgrade(e,a,A,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=oV}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===gV){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(au,this);return}if(t&&this.once("close",t),this._state!==nV)if(this._state=nV,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(au,this):process.nextTick(au,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{au(this)})}}shouldHandle(t){if(this.options.path){let o=t.url.indexOf("?");if((o!==-1?t.url.slice(0,o):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,o,i,e){o.on("error",sV);let a=t.headers["sec-websocket-key"],A=t.headers.upgrade,r=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ll(this,t,o,405,"Invalid HTTP method");return}if(A===void 0||A.toLowerCase()!=="websocket"){ll(this,t,o,400,"Invalid Upgrade header");return}if(a===void 0||!GTe.test(a)){ll(this,t,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(r!==13&&r!==8){ll(this,t,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){iu(o,400);return}let s=t.headers["sec-websocket-protocol"],g=new Set;if(s!==void 0)try{g=NTe.parse(s)}catch{ll(this,t,o,400,"Invalid Sec-WebSocket-Protocol header");return}let c=t.headers["sec-websocket-extensions"],I={};if(this.options.perMessageDeflate&&c!==void 0){let d=new Il({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let B=iV.parse(c);B[Il.extensionName]&&(d.accept(B[Il.extensionName]),I[Il.extensionName]=d)}catch{ll(this,t,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:t.headers[`${r===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(B,f,Q,y)=>{if(!B)return iu(o,f||401,Q,y);this.completeUpgrade(I,a,g,t,o,i,e)});return}if(!this.options.verifyClient(d))return iu(o,401)}this.completeUpgrade(I,a,g,t,o,i,e)}completeUpgrade(t,o,i,e,a,A,r){if(!a.readable||!a.writable)return a.destroy();if(a[PTe])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>oV)return iu(a,503);let g=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${TTe("sha1").update(o+vTe).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(i.size){let I=this.options.handleProtocols?this.options.handleProtocols(i,e):i.values().next().value;I&&(g.push(`Sec-WebSocket-Protocol: ${I}`),c._protocol=I)}if(t[Il.extensionName]){let I=t[Il.extensionName].params,d=iV.format({[Il.extensionName]:[I]});g.push(`Sec-WebSocket-Extensions: ${d}`),c._extensions=t}this.emit("headers",g,e),a.write(g.concat(`\r `).join(`\r `)),a.removeListener("error",sV),c.setSocket(a,A,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(au,this)})),r(c,e)}};cV.exports=AR;function FTe(n,t){for(let o of Object.keys(t))n.on(o,t[o]);return function(){for(let i of Object.keys(t))n.removeListener(i,t[i])}}function au(n){n._state=gV,n.emit("close")}function sV(){this.destroy()}function iu(n,t,o,i){o=o||bm.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(o),...i},n.once("finish",n.destroy),n.end(`HTTP/1.1 ${t} ${bm.STATUS_CODES[t]}\r `+Object.keys(i).map(e=>`${e}: ${i[e]}`).join(`\r `)+`\r \r -`+o)}function ll(n,t,o,i,e,a){if(n.listenerCount("wsClientError")){let A=new Error(e);Error.captureStackTrace(A,ll),n.emit("wsClientError",A,o,t)}else iu(o,i,e,a)}});var dV=$((zgA,pV)=>{"use strict";pV.exports=JTe;function JTe(n,t){for(var o=new Array(arguments.length-1),i=0,e=2,a=!0;e{"use strict";var Mm=CV;Mm.length=function(t){var o=t.length;if(!o)return 0;for(var i=0;--o%4>1&&t.charAt(o)==="=";)++i;return Math.ceil(t.length*3)/4-i};var kd=new Array(64),EV=new Array(123);for(Dn=0;Dn<64;)EV[kd[Dn]=Dn<26?Dn+65:Dn<52?Dn+71:Dn<62?Dn-4:Dn-59|43]=Dn++;var Dn;Mm.encode=function(t,o,i){for(var e=null,a=[],A=0,r=0,s;o>2],s=(g&3)<<4,r=1;break;case 1:a[A++]=kd[s|g>>4],s=(g&15)<<2,r=2;break;case 2:a[A++]=kd[s|g>>6],a[A++]=kd[g&63],r=0;break}A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,a)),A=0)}return r&&(a[A++]=kd[s],a[A++]=61,r===1&&(a[A++]=61)),e?(A&&e.push(String.fromCharCode.apply(String,a.slice(0,A))),e.join("")):String.fromCharCode.apply(String,a.slice(0,A))};var hV="invalid encoding";Mm.decode=function(t,o,i){for(var e=i,a=0,A,r=0;r1)break;if((s=EV[s])===void 0)throw Error(hV);switch(a){case 0:A=s,a=1;break;case 1:o[i++]=A<<2|(s&48)>>4,A=s,a=2;break;case 2:o[i++]=(A&15)<<4|(s&60)>>2,A=s,a=3;break;case 3:o[i++]=(A&3)<<6|s,a=0;break}}if(a===1)throw Error(hV);return i-e};Mm.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var fV=$((WgA,BV)=>{"use strict";BV.exports=_m;function _m(){this._listeners=Object.create(null)}_m.prototype.on=function(t,o,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:o,ctx:i||this}),this};_m.prototype.off=function(t,o){if(t===void 0)this._listeners=Object.create(null);else if(o===void 0)this._listeners[t]=[];else{var i=this._listeners[t];if(!i)return this;for(var e=0;e{"use strict";DV.exports=QV(QV);function QV(n){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),o=new Uint8Array(t.buffer),i=o[3]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3]}function a(s,g,c){t[0]=s,g[c]=o[3],g[c+1]=o[2],g[c+2]=o[1],g[c+3]=o[0]}n.writeFloatLE=i?e:a,n.writeFloatBE=i?a:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],t[0]}function r(s,g){return o[3]=s[g],o[2]=s[g+1],o[1]=s[g+2],o[0]=s[g+3],t[0]}n.readFloatLE=i?A:r,n.readFloatBE=i?r:A})():(function(){function t(i,e,a,A){var r=e<0?1:0;if(r&&(e=-e),e===0)i(1/e>0?0:2147483648,a,A);else if(isNaN(e))i(2143289344,a,A);else if(e>34028234663852886e22)i((r<<31|2139095040)>>>0,a,A);else if(e<11754943508222875e-54)i((r<<31|Math.round(e/1401298464324817e-60))>>>0,a,A);else{var s=Math.floor(Math.log(e)/Math.LN2),g=Math.round(e*Math.pow(2,-s)*8388608)&8388607;i((r<<31|s+127<<23|g)>>>0,a,A)}}n.writeFloatLE=t.bind(null,yV),n.writeFloatBE=t.bind(null,mV);function o(i,e,a){var A=i(e,a),r=(A>>31)*2+1,s=A>>>23&255,g=A&8388607;return s===255?g?NaN:r*(1/0):s===0?r*1401298464324817e-60*g:r*Math.pow(2,s-150)*(g+8388608)}n.readFloatLE=o.bind(null,SV),n.readFloatBE=o.bind(null,wV)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),o=new Uint8Array(t.buffer),i=o[7]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3],g[c+4]=o[4],g[c+5]=o[5],g[c+6]=o[6],g[c+7]=o[7]}function a(s,g,c){t[0]=s,g[c]=o[7],g[c+1]=o[6],g[c+2]=o[5],g[c+3]=o[4],g[c+4]=o[3],g[c+5]=o[2],g[c+6]=o[1],g[c+7]=o[0]}n.writeDoubleLE=i?e:a,n.writeDoubleBE=i?a:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],o[4]=s[g+4],o[5]=s[g+5],o[6]=s[g+6],o[7]=s[g+7],t[0]}function r(s,g){return o[7]=s[g],o[6]=s[g+1],o[5]=s[g+2],o[4]=s[g+3],o[3]=s[g+4],o[2]=s[g+5],o[1]=s[g+6],o[0]=s[g+7],t[0]}n.readDoubleLE=i?A:r,n.readDoubleBE=i?r:A})():(function(){function t(i,e,a,A,r,s){var g=A<0?1:0;if(g&&(A=-A),A===0)i(0,r,s+e),i(1/A>0?0:2147483648,r,s+a);else if(isNaN(A))i(0,r,s+e),i(2146959360,r,s+a);else if(A>17976931348623157e292)i(0,r,s+e),i((g<<31|2146435072)>>>0,r,s+a);else{var c;if(A<22250738585072014e-324)c=A/5e-324,i(c>>>0,r,s+e),i((g<<31|c/4294967296)>>>0,r,s+a);else{var I=Math.floor(Math.log(A)/Math.LN2);I===1024&&(I=1023),c=A*Math.pow(2,-I),i(c*4503599627370496>>>0,r,s+e),i((g<<31|I+1023<<20|c*1048576&1048575)>>>0,r,s+a)}}}n.writeDoubleLE=t.bind(null,yV,0,4),n.writeDoubleBE=t.bind(null,mV,4,0);function o(i,e,a,A,r){var s=i(A,r+e),g=i(A,r+a),c=(g>>31)*2+1,I=g>>>20&2047,d=4294967296*(g&1048575)+s;return I===2047?d?NaN:c*(1/0):I===0?c*5e-324*d:c*Math.pow(2,I-1075)*(d+4503599627370496)}n.readDoubleLE=o.bind(null,SV,0,4),n.readDoubleBE=o.bind(null,wV,4,0)})(),n}function yV(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}function mV(n,t,o){t[o]=n>>>24,t[o+1]=n>>>16&255,t[o+2]=n>>>8&255,t[o+3]=n&255}function SV(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function wV(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}});var MV=$(bV=>{"use strict";var rR=bV,tR=65533;rR.length=function(t){for(var o=0,i=0,e=0;e=192&&r<224?(g=(r&31)<<6|t[o++]&63,a[A++]=g>=128?g:tR):r>=224&&r<240?(c=(r&15)<<12|(t[o++]&63)<<6|t[o++]&63,a[A++]=c>=2048?c:tR):r>=240&&(s=(r&7)<<18|(t[o++]&63)<<12|(t[o++]&63)<<6|t[o++]&63,s<65536||s>1114111?a[A++]=tR:(s-=65536,a[A++]=55296+(s>>10),a[A++]=56320+(s&1023))),A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,a.slice(0,A))),A=0);return e?(A&&e.push(String.fromCharCode.apply(String,a.slice(0,A))),e.join("")):String.fromCharCode.apply(String,a.slice(0,A))};rR.write=function(t,o,i){for(var e=i,a,A,r=0;r>6|192,o[i++]=a&63|128):(a&64512)===55296&&((A=t.charCodeAt(r+1))&64512)===56320?(a=65536+((a&1023)<<10)+(A&1023),++r,o[i++]=a>>18|240,o[i++]=a>>12&63|128,o[i++]=a>>6&63|128,o[i++]=a&63|128):(o[i++]=a>>12|224,o[i++]=a>>6&63|128,o[i++]=a&63|128);return i-e}});var TV=$(($gA,_V)=>{"use strict";_V.exports=qTe;function qTe(n,t,o){var i=o||8192,e=i>>>1,a=null,A=i;return function(s){if(s<1||s>e)return n(s);A+s>i&&(a=n(i),A=0);var g=t.call(a,A,A+=s);return A&7&&(A=(A|7)+1),g}}});var RV=$((ecA,NV)=>{"use strict";NV.exports=sa;var ou=bc();function sa(n,t){this.lo=n>>>0,this.hi=t>>>0}var pl=sa.zero=new sa(0,0);pl.toNumber=function(){return 0};pl.zzEncode=pl.zzDecode=function(){return this};pl.length=function(){return 1};var zTe=sa.zeroHash="\0\0\0\0\0\0\0\0";sa.fromNumber=function(t){if(t===0)return pl;var o=t<0;o&&(t=-t);var i=t>>>0,e=(t-i)/4294967296>>>0;return o&&(e=~e>>>0,i=~i>>>0,++i>4294967295&&(i=0,++e>4294967295&&(e=0))),new sa(i,e)};sa.from=function(t){if(typeof t=="number")return sa.fromNumber(t);if(ou.isString(t))if(ou.Long)t=ou.Long.fromString(t);else return sa.fromNumber(parseInt(t,10));return t.low||t.high?new sa(t.low>>>0,t.high>>>0):pl};sa.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var o=~this.lo+1>>>0,i=~this.hi>>>0;return o||(i=i+1>>>0),-(o+i*4294967296)}return this.lo+this.hi*4294967296};sa.prototype.toLong=function(t){return ou.Long?new ou.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var Oc=String.prototype.charCodeAt;sa.fromHash=function(t){return t===zTe?pl:new sa((Oc.call(t,0)|Oc.call(t,1)<<8|Oc.call(t,2)<<16|Oc.call(t,3)<<24)>>>0,(Oc.call(t,4)|Oc.call(t,5)<<8|Oc.call(t,6)<<16|Oc.call(t,7)<<24)>>>0)};sa.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};sa.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};sa.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};sa.prototype.length=function(){var t=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?o===0?t<16384?t<128?1:2:t<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:i<128?9:10}});var kV=$((nu,aR)=>{(function(n,t){function o(i){return i.default||i}typeof define=="function"&&define.amd?define([],function(){var i={};return t(i),o(i)}):typeof nu=="object"?(t(nu),typeof aR=="object"&&(aR.exports=o(nu))):(function(){var i={};t(i),n.Long=o(i)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:nu,function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function o(U,N,k){this.low=U|0,this.high=N|0,this.unsigned=!!k}o.prototype.__isLong__,Object.defineProperty(o.prototype,"__isLong__",{value:!0});function i(U){return(U&&U.__isLong__)===!0}function e(U){var N=Math.clz32(U&-U);return U?31-N:N}o.isLong=i;var a={},A={};function r(U,N){var k,z,Ae;return N?(U>>>=0,(Ae=0<=U&&U<256)&&(z=A[U],z)?z:(k=g(U,0,!0),Ae&&(A[U]=k),k)):(U|=0,(Ae=-128<=U&&U<128)&&(z=a[U],z)?z:(k=g(U,U<0?-1:0,!1),Ae&&(a[U]=k),k))}o.fromInt=r;function s(U,N){if(isNaN(U))return N?R:_;if(N){if(U<0)return R;if(U>=y)return V}else{if(U<=-m)return x;if(U+1>=m)return q}return U<0?s(-U,N).neg():g(U%Q|0,U/Q|0,N)}o.fromNumber=s;function g(U,N,k){return new o(U,N,k)}o.fromBits=g;var c=Math.pow;function I(U,N,k){if(U.length===0)throw Error("empty string");if(typeof N=="number"?(k=N,N=!1):N=!!N,U==="NaN"||U==="Infinity"||U==="+Infinity"||U==="-Infinity")return N?R:_;if(k=k||10,k<2||360)throw Error("interior hyphen");if(z===0)return I(U.substring(1),N,k).neg();for(var Ae=s(c(k,8)),ie=_,we=0;we>>0:this.low},G.toNumber=function(){return this.unsigned?(this.high>>>0)*Q+(this.low>>>0):this.high*Q+(this.low>>>0)},G.toString=function(N){if(N=N||10,N<2||36>>0,ke=fe.toString(N);if(we=Te,we.isZero())return ke+se;for(;ke.length<6;)ke="0"+ke;se=""+ke+se}},G.getHighBits=function(){return this.high},G.getHighBitsUnsigned=function(){return this.high>>>0},G.getLowBits=function(){return this.low},G.getLowBitsUnsigned=function(){return this.low>>>0},G.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var N=this.high!=0?this.high:this.low,k=31;k>0&&(N&1<>21;return N?this.unsigned?!1:N===-1&&!(this.low===0&&this.high===-2097152):!0},G.isZero=function(){return this.high===0&&this.low===0},G.eqz=G.isZero,G.isNegative=function(){return!this.unsigned&&this.high<0},G.isPositive=function(){return this.unsigned||this.high>=0},G.isOdd=function(){return(this.low&1)===1},G.isEven=function(){return(this.low&1)===0},G.equals=function(N){return i(N)||(N=d(N)),this.unsigned!==N.unsigned&&this.high>>>31===1&&N.high>>>31===1?!1:this.high===N.high&&this.low===N.low},G.eq=G.equals,G.notEquals=function(N){return!this.eq(N)},G.neq=G.notEquals,G.ne=G.notEquals,G.lessThan=function(N){return this.comp(N)<0},G.lt=G.lessThan,G.lessThanOrEqual=function(N){return this.comp(N)<=0},G.lte=G.lessThanOrEqual,G.le=G.lessThanOrEqual,G.greaterThan=function(N){return this.comp(N)>0},G.gt=G.greaterThan,G.greaterThanOrEqual=function(N){return this.comp(N)>=0},G.gte=G.greaterThanOrEqual,G.ge=G.greaterThanOrEqual,G.compare=function(N){if(i(N)||(N=d(N)),this.eq(N))return 0;var k=this.isNegative(),z=N.isNegative();return k&&!z?-1:!k&&z?1:this.unsigned?N.high>>>0>this.high>>>0||N.high===this.high&&N.low>>>0>this.low>>>0?-1:1:this.sub(N).isNegative()?-1:1},G.comp=G.compare,G.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(K)},G.neg=G.negate,G.add=function(N){i(N)||(N=d(N));var k=this.high>>>16,z=this.high&65535,Ae=this.low>>>16,ie=this.low&65535,we=N.high>>>16,se=N.high&65535,Te=N.low>>>16,fe=N.low&65535,ke=0,Re=0,We=0,ve=0;return ve+=ie+fe,We+=ve>>>16,ve&=65535,We+=Ae+Te,Re+=We>>>16,We&=65535,Re+=z+se,ke+=Re>>>16,Re&=65535,ke+=k+we,ke&=65535,g(We<<16|ve,ke<<16|Re,this.unsigned)},G.subtract=function(N){return i(N)||(N=d(N)),this.add(N.neg())},G.sub=G.subtract,G.multiply=function(N){if(this.isZero())return this;if(i(N)||(N=d(N)),t){var k=t.mul(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(N.isZero())return this.unsigned?R:_;if(this.eq(x))return N.isOdd()?x:_;if(N.eq(x))return this.isOdd()?x:_;if(this.isNegative())return N.isNegative()?this.neg().mul(N.neg()):this.neg().mul(N).neg();if(N.isNegative())return this.mul(N.neg()).neg();if(this.lt(T)&&N.lt(T))return s(this.toNumber()*N.toNumber(),this.unsigned);var z=this.high>>>16,Ae=this.high&65535,ie=this.low>>>16,we=this.low&65535,se=N.high>>>16,Te=N.high&65535,fe=N.low>>>16,ke=N.low&65535,Re=0,We=0,ve=0,aA=0;return aA+=we*ke,ve+=aA>>>16,aA&=65535,ve+=ie*ke,We+=ve>>>16,ve&=65535,ve+=we*fe,We+=ve>>>16,ve&=65535,We+=Ae*ke,Re+=We>>>16,We&=65535,We+=ie*fe,Re+=We>>>16,We&=65535,We+=we*Te,Re+=We>>>16,We&=65535,Re+=z*ke+Ae*fe+ie*Te+we*se,Re&=65535,g(ve<<16|aA,Re<<16|We,this.unsigned)},G.mul=G.multiply,G.divide=function(N){if(i(N)||(N=d(N)),N.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&N.low===-1&&N.high===-1)return this;var k=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?R:_;var z,Ae,ie;if(this.unsigned){if(N.unsigned||(N=N.toUnsigned()),N.gt(this))return R;if(N.gt(this.shru(1)))return L;ie=R}else{if(this.eq(x)){if(N.eq(K)||N.eq(F))return x;if(N.eq(x))return K;var we=this.shr(1);return z=we.div(N).shl(1),z.eq(_)?N.isNegative()?K:F:(Ae=this.sub(N.mul(z)),ie=z.add(Ae.div(N)),ie)}else if(N.eq(x))return this.unsigned?R:_;if(this.isNegative())return N.isNegative()?this.neg().div(N.neg()):this.neg().div(N).neg();if(N.isNegative())return this.div(N.neg()).neg();ie=_}for(Ae=this;Ae.gte(N);){z=Math.max(1,Math.floor(Ae.toNumber()/N.toNumber()));for(var se=Math.ceil(Math.log(z)/Math.LN2),Te=se<=48?1:c(2,se-48),fe=s(z),ke=fe.mul(N);ke.isNegative()||ke.gt(Ae);)z-=Te,fe=s(z,this.unsigned),ke=fe.mul(N);fe.isZero()&&(fe=K),ie=ie.add(fe),Ae=Ae.sub(ke)}return ie},G.div=G.divide,G.modulo=function(N){if(i(N)||(N=d(N)),t){var k=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}return this.sub(this.div(N).mul(N))},G.mod=G.modulo,G.rem=G.modulo,G.not=function(){return g(~this.low,~this.high,this.unsigned)},G.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},G.clz=G.countLeadingZeros,G.countTrailingZeros=function(){return this.low?e(this.low):e(this.high)+32},G.ctz=G.countTrailingZeros,G.and=function(N){return i(N)||(N=d(N)),g(this.low&N.low,this.high&N.high,this.unsigned)},G.or=function(N){return i(N)||(N=d(N)),g(this.low|N.low,this.high|N.high,this.unsigned)},G.xor=function(N){return i(N)||(N=d(N)),g(this.low^N.low,this.high^N.high,this.unsigned)},G.shiftLeft=function(N){return i(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low<>>32-N,this.unsigned):g(0,this.low<>>N|this.high<<32-N,this.high>>N,this.unsigned):g(this.high>>N-32,this.high>=0?0:-1,this.unsigned)},G.shr=G.shiftRight,G.shiftRightUnsigned=function(N){return i(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low>>>N|this.high<<32-N,this.high>>>N,this.unsigned):N===32?g(this.high,0,this.unsigned):g(this.high>>>N-32,0,this.unsigned)},G.shru=G.shiftRightUnsigned,G.shr_u=G.shiftRightUnsigned,G.rotateLeft=function(N){var k;return i(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.low<>>k,this.high<>>k,this.unsigned)):(N-=32,k=32-N,g(this.high<>>k,this.low<>>k,this.unsigned))},G.rotl=G.rotateLeft,G.rotateRight=function(N){var k;return i(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.high<>>N,this.low<>>N,this.unsigned)):(N-=32,k=32-N,g(this.low<>>N,this.high<>>N,this.unsigned))},G.rotr=G.rotateRight,G.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},G.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},G.toBytes=function(N){return N?this.toBytesLE():this.toBytesBE()},G.toBytesLE=function(){var N=this.high,k=this.low;return[k&255,k>>>8&255,k>>>16&255,k>>>24,N&255,N>>>8&255,N>>>16&255,N>>>24]},G.toBytesBE=function(){var N=this.high,k=this.low;return[N>>>24,N>>>16&255,N>>>8&255,N&255,k>>>24,k>>>16&255,k>>>8&255,k&255]},o.fromBytes=function(N,k,z){return z?o.fromBytesLE(N,k):o.fromBytesBE(N,k)},o.fromBytesLE=function(N,k){return new o(N[0]|N[1]<<8|N[2]<<16|N[3]<<24,N[4]|N[5]<<8|N[6]<<16|N[7]<<24,k)},o.fromBytesBE=function(N,k){return new o(N[4]<<24|N[5]<<16|N[6]<<8|N[7],N[0]<<24|N[1]<<16|N[2]<<8|N[3],k)},typeof BigInt=="function"&&(o.fromBigInt=function(N,k){var z=Number(BigInt.asIntN(32,N)),Ae=Number(BigInt.asIntN(32,N>>BigInt(32)));return g(z,Ae,k)},o.fromValue=function(N,k){return typeof N=="bigint"?o.fromBigInt(N,k):d(N,k)},G.toBigInt=function(){var N=BigInt(this.low>>>0),k=BigInt(this.unsigned?this.high>>>0:this.high);return k<{"use strict";var BA=iR;BA.asPromise=dV();BA.base64=uV();BA.EventEmitter=fV();BA.float=OV();BA.utf8=MV();BA.pool=TV();BA.LongBits=RV();function vV(n){return n==="__proto__"||n==="prototype"||n==="constructor"}BA.isUnsafeProperty=vV;BA.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);BA.global=BA.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||iR;BA.emptyArray=Object.freeze?Object.freeze([]):[];BA.emptyObject=Object.freeze?Object.freeze({}):{};BA.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};BA.isString=function(t){return typeof t=="string"||t instanceof String};BA.isObject=function(t){return t&&typeof t=="object"};BA.isset=BA.isSet=function(t,o){var i=t[o];return i!=null&&Object.hasOwnProperty.call(t,o)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1};BA.Buffer=(function(){try{var n=BA.global.Buffer;return n.prototype.utf8Write?n:null}catch{return null}})();BA._Buffer_from=null;BA._Buffer_allocUnsafe=null;BA.newBuffer=function(t){return typeof t=="number"?BA.Buffer?BA._Buffer_allocUnsafe(t):new BA.Array(t):BA.Buffer?BA._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};BA.Array=typeof Uint8Array<"u"?Uint8Array:Array;BA.Long=BA.global.dcodeIO&&BA.global.dcodeIO.Long||BA.global.Long||(function(){try{var n=kV();return n&&n.isLong?n:null}catch{return null}})();BA.key2Re=/^true|false|0|1$/;BA.key32Re=/^-?(?:0|[1-9][0-9]*)$/;BA.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;BA.longToHash=function(t){return t?BA.LongBits.from(t).toHash():BA.LongBits.zeroHash};BA.longFromHash=function(t,o){var i=BA.LongBits.fromHash(t);return BA.Long?BA.Long.fromBits(i.lo,i.hi,o):i.toNumber(!!o)};function PV(n){var t=typeof arguments[arguments.length-1]=="boolean",o=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var i=1;i-1;--a)if(o[e[a]]===1&&this[e[a]]!==void 0&&this[e[a]]!==null)return e[a]}};BA.oneOfSetter=function(t){return function(o){for(var i=0;i{"use strict";HV.exports=ft;var Ho=bc(),oR,Tm=Ho.LongBits,FV=Ho.base64,LV=Ho.utf8;function su(n,t,o){this.fn=n,this.len=t,this.next=void 0,this.val=o}function sR(){}function VTe(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function ft(){this.len=0,this.head=new su(sR,0,0),this.tail=this.head,this.states=null}var UV=function(){return Ho.Buffer?function(){return(ft.create=function(){return new oR})()}:function(){return new ft}};ft.create=UV();ft.alloc=function(t){return new Ho.Array(t)};Ho.Array!==Array&&(ft.alloc=Ho.pool(ft.alloc,Ho.Array.prototype.subarray));ft.prototype._push=function(t,o,i){return this.tail=this.tail.next=new su(t,o,i),this.len+=o,this};function gR(n,t,o){t[o]=n&255}function WTe(n,t,o){for(;n>127;)t[o++]=n&127|128,n>>>=7;t[o]=n}function cR(n,t){this.len=n,this.next=void 0,this.val=t}cR.prototype=Object.create(su.prototype);cR.prototype.fn=WTe;ft.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new cR((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};ft.prototype.int32=function(t){return(t|=0)<0?this._push(IR,10,Tm.fromNumber(t)):this.uint32(t)};ft.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function IR(n,t,o){for(var i=n.lo,e=n.hi;e;)t[o++]=i&127|128,i=(i>>>7|e<<25)>>>0,e>>>=7;for(;i>127;)t[o++]=i&127|128,i=i>>>7;t[o++]=i}ft.prototype.uint64=function(t){var o=Tm.from(t);return this._push(IR,o.length(),o)};ft.prototype.int64=ft.prototype.uint64;ft.prototype.sint64=function(t){var o=Tm.from(t).zzEncode();return this._push(IR,o.length(),o)};ft.prototype.bool=function(t){return this._push(gR,1,t?1:0)};function nR(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}ft.prototype.fixed32=function(t){return this._push(nR,4,t>>>0)};ft.prototype.sfixed32=ft.prototype.fixed32;ft.prototype.fixed64=function(t){var o=Tm.from(t);return this._push(nR,4,o.lo)._push(nR,4,o.hi)};ft.prototype.sfixed64=ft.prototype.fixed64;ft.prototype.float=function(t){return this._push(Ho.float.writeFloatLE,4,t)};ft.prototype.double=function(t){return this._push(Ho.float.writeDoubleLE,8,t)};var ZTe=Ho.Array.prototype.set?function(t,o,i){o.set(t,i)}:function(t,o,i){for(var e=0;e>>0;if(!o)return this._push(gR,1,0);if(Ho.isString(t)){var i=ft.alloc(o=FV.length(t));FV.decode(t,i,0),t=i}return this.uint32(o)._push(ZTe,o,t)};ft.prototype.string=function(t){var o=LV.length(t);return o?this.uint32(o)._push(LV.write,o,t):this._push(gR,1,0)};ft.prototype.fork=function(){return this.states=new VTe(this),this.head=this.tail=new su(sR,0,0),this.len=0,this};ft.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new su(sR,0,0),this.len=0),this};ft.prototype.ldelim=function(){var t=this.head,o=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=o,this.len+=i),this};ft.prototype.finish=function(){for(var t=this.head.next,o=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,o,i),i+=t.len,t=t.next;return o};ft._configure=function(n){oR=n,ft.create=UV(),oR._configure()}});var YV=$((rcA,xV)=>{"use strict";xV.exports=Cs;var KV=lR();(Cs.prototype=Object.create(KV.prototype)).constructor=Cs;var Mc=bc();function Cs(){KV.call(this)}Cs._configure=function(){Cs.alloc=Mc._Buffer_allocUnsafe,Cs.writeBytesBuffer=Mc.Buffer&&Mc.Buffer.prototype instanceof Uint8Array&&Mc.Buffer.prototype.set.name==="set"?function(t,o,i){o.set(t,i)}:function(t,o,i){if(t.copy)t.copy(o,i,0,t.length);else for(var e=0;e>>0;return this.uint32(o),o&&this._push(Cs.writeBytesBuffer,o,t),this};function XTe(n,t,o){n.length<40?Mc.utf8.write(n,t,o):t.utf8Write?t.utf8Write(n,o):t.write(n,o)}Cs.prototype.string=function(t){var o=Mc.Buffer.byteLength(t);return this.uint32(o),o&&this._push(XTe,o,t),this};Cs._configure()});var hR=$((acA,VV)=>{"use strict";VV.exports=gr;var Ko=bc(),dR,qV=Ko.LongBits,$Te=Ko.utf8;function On(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function gr(n){this.buf=n,this.pos=0,this.len=n.length}var jV=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new gr(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new gr(t);throw Error("illegal buffer")},zV=function(){return Ko.Buffer?function(o){return(gr.create=function(e){return Ko.Buffer.isBuffer(e)?new dR(e):jV(e)})(o)}:jV};gr.create=zV();gr.prototype._slice=Ko.Array.prototype.subarray||Ko.Array.prototype.slice;gr.prototype.uint32=(function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,On(this,10);return t}})();gr.prototype.int32=function(){return this.uint32()|0};gr.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function pR(){var n=new qV(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw On(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw On(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}gr.prototype.bool=function(){return this.uint32()!==0};function Nm(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}gr.prototype.fixed32=function(){if(this.pos+4>this.len)throw On(this,4);return Nm(this.buf,this.pos+=4)};gr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw On(this,4);return Nm(this.buf,this.pos+=4)|0};function JV(){if(this.pos+8>this.len)throw On(this,8);return new qV(Nm(this.buf,this.pos+=4),Nm(this.buf,this.pos+=4))}gr.prototype.float=function(){if(this.pos+4>this.len)throw On(this,4);var t=Ko.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};gr.prototype.double=function(){if(this.pos+8>this.len)throw On(this,4);var t=Ko.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};gr.prototype.bytes=function(){var t=this.uint32(),o=this.pos,i=this.pos+t;if(i>this.len)throw On(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(o,i);if(o===i){var e=Ko.Buffer;return e?e.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,o,i)};gr.prototype.string=function(){var t=this.bytes();return $Te.read(t,0,t.length)};gr.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw On(this,t);this.pos+=t}else do if(this.pos>=this.len)throw On(this);while(this.buf[this.pos++]&128);return this};gr.recursionLimit=Ko.recursionLimit;gr.prototype.skipType=function(n,t){if(t===void 0&&(t=0),t>gr.recursionLimit)throw Error("maximum nesting depth exceeded");switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n,t+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this};gr._configure=function(n){dR=n,gr.create=zV(),dR._configure();var t=Ko.Long?"toLong":"toNumber";Ko.merge(gr.prototype,{int64:function(){return pR.call(this)[t](!1)},uint64:function(){return pR.call(this)[t](!0)},sint64:function(){return pR.call(this).zzDecode()[t](!1)},fixed64:function(){return JV.call(this)[t](!0)},sfixed64:function(){return JV.call(this)[t](!1)}})}});var $V=$((icA,XV)=>{"use strict";XV.exports=dl;var ZV=hR();(dl.prototype=Object.create(ZV.prototype)).constructor=dl;var WV=bc();function dl(n){ZV.call(this,n)}dl._configure=function(){WV.Buffer&&(dl.prototype._slice=WV.Buffer.prototype.slice)};dl.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};dl._configure()});var AW=$((ocA,eW)=>{"use strict";eW.exports=gu;var ER=bc();(gu.prototype=Object.create(ER.EventEmitter.prototype)).constructor=gu;function gu(n,t,o){if(typeof n!="function")throw TypeError("rpcImpl must be a function");ER.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!o}gu.prototype.rpcCall=function n(t,o,i,e,a){if(!e)throw TypeError("request must be specified");var A=this;if(!a)return ER.asPromise(n,A,t,o,i,e);if(!A.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return A.rpcImpl(t,o[A.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(s,g){if(s)return A.emit("error",s,t),a(s);if(g===null){A.end(!0);return}if(!(g instanceof i))try{g=i[A.responseDelimited?"decodeDelimited":"decode"](g)}catch(c){return A.emit("error",c,t),a(c)}return A.emit("data",g,t),a(null,g)})}catch(r){A.emit("error",r,t),setTimeout(function(){a(r)},0);return}};gu.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var rW=$(tW=>{"use strict";var eNe=tW;eNe.Service=AW()});var iW=$((scA,aW)=>{"use strict";aW.exports=Object.create(null)});var sW=$(nW=>{"use strict";var Hi=nW;Hi.build="minimal";Hi.Writer=lR();Hi.BufferWriter=YV();Hi.Reader=hR();Hi.BufferReader=$V();Hi.util=bc();Hi.rpc=rW();Hi.roots=iW();Hi.configure=oW;function oW(){Hi.util._configure(),Hi.Writer._configure(Hi.BufferWriter),Hi.Reader._configure(Hi.BufferReader)}oW()});var Rm=$((ccA,gW)=>{"use strict";gW.exports=sW()});var n5=$(ot=>{"use strict";var Pu=Symbol.for("react.element"),dve=Symbol.for("react.portal"),hve=Symbol.for("react.fragment"),Eve=Symbol.for("react.strict_mode"),Cve=Symbol.for("react.profiler"),uve=Symbol.for("react.provider"),Bve=Symbol.for("react.context"),fve=Symbol.for("react.forward_ref"),Qve=Symbol.for("react.suspense"),yve=Symbol.for("react.memo"),mve=Symbol.for("react.lazy"),W6=Symbol.iterator;function Sve(n){return n===null||typeof n!="object"?null:(n=W6&&n[W6]||n["@@iterator"],typeof n=="function"?n:null)}var $6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e5=Object.assign,A5={};function jd(n,t,o){this.props=n,this.context=t,this.refs=A5,this.updater=o||$6}jd.prototype.isReactComponent={};jd.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};jd.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function t5(){}t5.prototype=jd.prototype;function bP(n,t,o){this.props=n,this.context=t,this.refs=A5,this.updater=o||$6}var MP=bP.prototype=new t5;MP.constructor=bP;e5(MP,jd.prototype);MP.isPureReactComponent=!0;var Z6=Array.isArray,r5=Object.prototype.hasOwnProperty,_P={current:null},a5={key:!0,ref:!0,__self:!0,__source:!0};function i5(n,t,o){var i,e={},a=null,A=null;if(t!=null)for(i in t.ref!==void 0&&(A=t.ref),t.key!==void 0&&(a=""+t.key),t)r5.call(t,i)&&!a5.hasOwnProperty(i)&&(e[i]=t[i]);var r=arguments.length-2;if(r===1)e.children=o;else if(1{"use strict";process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",t=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),r=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),f=Symbol.iterator,Q="@@iterator";function y(H){if(H===null||typeof H!="object")return null;var te=f&&H[f]||H[Q];return typeof te=="function"?te:null}var m={current:null},T={transition:null},_={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},K={},L=null;function F(H){L=H}K.setExtraStackFrame=function(H){L=H},K.getCurrentStack=null,K.getStackAddendum=function(){var H="";L&&(H+=L);var te=K.getCurrentStack;return te&&(H+=te()||""),H};var q=!1,V=!1,x=!1,G=!1,J=!1,U={ReactCurrentDispatcher:m,ReactCurrentBatchConfig:T,ReactCurrentOwner:R};U.ReactDebugCurrentFrame=K,U.ReactCurrentActQueue=_;function N(H){{for(var te=arguments.length,de=new Array(te>1?te-1:0),me=1;me1?te-1:0),me=1;me1){for(var Vt=Array(Pt),Wt=0;Wt1){for(var ir=Array(Wt),_r=0;_r is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Provider},set:function(CA){te.Provider=CA}},_currentValue:{get:function(){return te._currentValue},set:function(CA){te._currentValue=CA}},_currentValue2:{get:function(){return te._currentValue2},set:function(CA){te._currentValue2=CA}},_threadCount:{get:function(){return te._threadCount},set:function(CA){te._threadCount=CA}},Consumer:{get:function(){return de||(de=!0,k("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Consumer}},displayName:{get:function(){return te.displayName},set:function(CA){ze||(N("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",CA),ze=!0)}}}),te.Consumer=TA}return te._currentRenderer=null,te._currentRenderer2=null,te}var he=-1,ye=0,Je=1,IA=2;function yA(H){if(H._status===he){var te=H._result,de=te();if(de.then(function(TA){if(H._status===ye||H._status===he){var CA=H;CA._status=Je,CA._result=TA}},function(TA){if(H._status===ye||H._status===he){var CA=H;CA._status=IA,CA._result=TA}}),H._status===he){var me=H;me._status=ye,me._result=de}}if(H._status===Je){var ze=H._result;return ze===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s +`+o)}function ll(n,t,o,i,e,a){if(n.listenerCount("wsClientError")){let A=new Error(e);Error.captureStackTrace(A,ll),n.emit("wsClientError",A,o,t)}else iu(o,i,e,a)}});var dV=$((zgA,pV)=>{"use strict";pV.exports=JTe;function JTe(n,t){for(var o=new Array(arguments.length-1),i=0,e=2,a=!0;e{"use strict";var Mm=CV;Mm.length=function(t){var o=t.length;if(!o)return 0;for(var i=0;--o%4>1&&t.charAt(o)==="=";)++i;return Math.ceil(t.length*3)/4-i};var vd=new Array(64),EV=new Array(123);for(Dn=0;Dn<64;)EV[vd[Dn]=Dn<26?Dn+65:Dn<52?Dn+71:Dn<62?Dn-4:Dn-59|43]=Dn++;var Dn;Mm.encode=function(t,o,i){for(var e=null,a=[],A=0,r=0,s;o>2],s=(g&3)<<4,r=1;break;case 1:a[A++]=vd[s|g>>4],s=(g&15)<<2,r=2;break;case 2:a[A++]=vd[s|g>>6],a[A++]=vd[g&63],r=0;break}A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,a)),A=0)}return r&&(a[A++]=vd[s],a[A++]=61,r===1&&(a[A++]=61)),e?(A&&e.push(String.fromCharCode.apply(String,a.slice(0,A))),e.join("")):String.fromCharCode.apply(String,a.slice(0,A))};var hV="invalid encoding";Mm.decode=function(t,o,i){for(var e=i,a=0,A,r=0;r1)break;if((s=EV[s])===void 0)throw Error(hV);switch(a){case 0:A=s,a=1;break;case 1:o[i++]=A<<2|(s&48)>>4,A=s,a=2;break;case 2:o[i++]=(A&15)<<4|(s&60)>>2,A=s,a=3;break;case 3:o[i++]=(A&3)<<6|s,a=0;break}}if(a===1)throw Error(hV);return i-e};Mm.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var fV=$((WgA,BV)=>{"use strict";BV.exports=_m;function _m(){this._listeners=Object.create(null)}_m.prototype.on=function(t,o,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:o,ctx:i||this}),this};_m.prototype.off=function(t,o){if(t===void 0)this._listeners=Object.create(null);else if(o===void 0)this._listeners[t]=[];else{var i=this._listeners[t];if(!i)return this;for(var e=0;e{"use strict";DV.exports=QV(QV);function QV(n){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),o=new Uint8Array(t.buffer),i=o[3]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3]}function a(s,g,c){t[0]=s,g[c]=o[3],g[c+1]=o[2],g[c+2]=o[1],g[c+3]=o[0]}n.writeFloatLE=i?e:a,n.writeFloatBE=i?a:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],t[0]}function r(s,g){return o[3]=s[g],o[2]=s[g+1],o[1]=s[g+2],o[0]=s[g+3],t[0]}n.readFloatLE=i?A:r,n.readFloatBE=i?r:A})():(function(){function t(i,e,a,A){var r=e<0?1:0;if(r&&(e=-e),e===0)i(1/e>0?0:2147483648,a,A);else if(isNaN(e))i(2143289344,a,A);else if(e>34028234663852886e22)i((r<<31|2139095040)>>>0,a,A);else if(e<11754943508222875e-54)i((r<<31|Math.round(e/1401298464324817e-60))>>>0,a,A);else{var s=Math.floor(Math.log(e)/Math.LN2),g=Math.round(e*Math.pow(2,-s)*8388608)&8388607;i((r<<31|s+127<<23|g)>>>0,a,A)}}n.writeFloatLE=t.bind(null,yV),n.writeFloatBE=t.bind(null,mV);function o(i,e,a){var A=i(e,a),r=(A>>31)*2+1,s=A>>>23&255,g=A&8388607;return s===255?g?NaN:r*(1/0):s===0?r*1401298464324817e-60*g:r*Math.pow(2,s-150)*(g+8388608)}n.readFloatLE=o.bind(null,SV),n.readFloatBE=o.bind(null,wV)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),o=new Uint8Array(t.buffer),i=o[7]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3],g[c+4]=o[4],g[c+5]=o[5],g[c+6]=o[6],g[c+7]=o[7]}function a(s,g,c){t[0]=s,g[c]=o[7],g[c+1]=o[6],g[c+2]=o[5],g[c+3]=o[4],g[c+4]=o[3],g[c+5]=o[2],g[c+6]=o[1],g[c+7]=o[0]}n.writeDoubleLE=i?e:a,n.writeDoubleBE=i?a:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],o[4]=s[g+4],o[5]=s[g+5],o[6]=s[g+6],o[7]=s[g+7],t[0]}function r(s,g){return o[7]=s[g],o[6]=s[g+1],o[5]=s[g+2],o[4]=s[g+3],o[3]=s[g+4],o[2]=s[g+5],o[1]=s[g+6],o[0]=s[g+7],t[0]}n.readDoubleLE=i?A:r,n.readDoubleBE=i?r:A})():(function(){function t(i,e,a,A,r,s){var g=A<0?1:0;if(g&&(A=-A),A===0)i(0,r,s+e),i(1/A>0?0:2147483648,r,s+a);else if(isNaN(A))i(0,r,s+e),i(2146959360,r,s+a);else if(A>17976931348623157e292)i(0,r,s+e),i((g<<31|2146435072)>>>0,r,s+a);else{var c;if(A<22250738585072014e-324)c=A/5e-324,i(c>>>0,r,s+e),i((g<<31|c/4294967296)>>>0,r,s+a);else{var I=Math.floor(Math.log(A)/Math.LN2);I===1024&&(I=1023),c=A*Math.pow(2,-I),i(c*4503599627370496>>>0,r,s+e),i((g<<31|I+1023<<20|c*1048576&1048575)>>>0,r,s+a)}}}n.writeDoubleLE=t.bind(null,yV,0,4),n.writeDoubleBE=t.bind(null,mV,4,0);function o(i,e,a,A,r){var s=i(A,r+e),g=i(A,r+a),c=(g>>31)*2+1,I=g>>>20&2047,d=4294967296*(g&1048575)+s;return I===2047?d?NaN:c*(1/0):I===0?c*5e-324*d:c*Math.pow(2,I-1075)*(d+4503599627370496)}n.readDoubleLE=o.bind(null,SV,0,4),n.readDoubleBE=o.bind(null,wV,4,0)})(),n}function yV(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}function mV(n,t,o){t[o]=n>>>24,t[o+1]=n>>>16&255,t[o+2]=n>>>8&255,t[o+3]=n&255}function SV(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function wV(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}});var MV=$(bV=>{"use strict";var rR=bV,tR=65533;rR.length=function(t){for(var o=0,i=0,e=0;e=192&&r<224?(g=(r&31)<<6|t[o++]&63,a[A++]=g>=128?g:tR):r>=224&&r<240?(c=(r&15)<<12|(t[o++]&63)<<6|t[o++]&63,a[A++]=c>=2048?c:tR):r>=240&&(s=(r&7)<<18|(t[o++]&63)<<12|(t[o++]&63)<<6|t[o++]&63,s<65536||s>1114111?a[A++]=tR:(s-=65536,a[A++]=55296+(s>>10),a[A++]=56320+(s&1023))),A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,a.slice(0,A))),A=0);return e?(A&&e.push(String.fromCharCode.apply(String,a.slice(0,A))),e.join("")):String.fromCharCode.apply(String,a.slice(0,A))};rR.write=function(t,o,i){for(var e=i,a,A,r=0;r>6|192,o[i++]=a&63|128):(a&64512)===55296&&((A=t.charCodeAt(r+1))&64512)===56320?(a=65536+((a&1023)<<10)+(A&1023),++r,o[i++]=a>>18|240,o[i++]=a>>12&63|128,o[i++]=a>>6&63|128,o[i++]=a&63|128):(o[i++]=a>>12|224,o[i++]=a>>6&63|128,o[i++]=a&63|128);return i-e}});var TV=$(($gA,_V)=>{"use strict";_V.exports=qTe;function qTe(n,t,o){var i=o||8192,e=i>>>1,a=null,A=i;return function(s){if(s<1||s>e)return n(s);A+s>i&&(a=n(i),A=0);var g=t.call(a,A,A+=s);return A&7&&(A=(A|7)+1),g}}});var RV=$((ecA,NV)=>{"use strict";NV.exports=sa;var ou=bc();function sa(n,t){this.lo=n>>>0,this.hi=t>>>0}var pl=sa.zero=new sa(0,0);pl.toNumber=function(){return 0};pl.zzEncode=pl.zzDecode=function(){return this};pl.length=function(){return 1};var zTe=sa.zeroHash="\0\0\0\0\0\0\0\0";sa.fromNumber=function(t){if(t===0)return pl;var o=t<0;o&&(t=-t);var i=t>>>0,e=(t-i)/4294967296>>>0;return o&&(e=~e>>>0,i=~i>>>0,++i>4294967295&&(i=0,++e>4294967295&&(e=0))),new sa(i,e)};sa.from=function(t){if(typeof t=="number")return sa.fromNumber(t);if(ou.isString(t))if(ou.Long)t=ou.Long.fromString(t);else return sa.fromNumber(parseInt(t,10));return t.low||t.high?new sa(t.low>>>0,t.high>>>0):pl};sa.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var o=~this.lo+1>>>0,i=~this.hi>>>0;return o||(i=i+1>>>0),-(o+i*4294967296)}return this.lo+this.hi*4294967296};sa.prototype.toLong=function(t){return ou.Long?new ou.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var Oc=String.prototype.charCodeAt;sa.fromHash=function(t){return t===zTe?pl:new sa((Oc.call(t,0)|Oc.call(t,1)<<8|Oc.call(t,2)<<16|Oc.call(t,3)<<24)>>>0,(Oc.call(t,4)|Oc.call(t,5)<<8|Oc.call(t,6)<<16|Oc.call(t,7)<<24)>>>0)};sa.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};sa.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};sa.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};sa.prototype.length=function(){var t=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?o===0?t<16384?t<128?1:2:t<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:i<128?9:10}});var kV=$((nu,aR)=>{(function(n,t){function o(i){return i.default||i}typeof define=="function"&&define.amd?define([],function(){var i={};return t(i),o(i)}):typeof nu=="object"?(t(nu),typeof aR=="object"&&(aR.exports=o(nu))):(function(){var i={};t(i),n.Long=o(i)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:nu,function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function o(U,N,k){this.low=U|0,this.high=N|0,this.unsigned=!!k}o.prototype.__isLong__,Object.defineProperty(o.prototype,"__isLong__",{value:!0});function i(U){return(U&&U.__isLong__)===!0}function e(U){var N=Math.clz32(U&-U);return U?31-N:N}o.isLong=i;var a={},A={};function r(U,N){var k,z,Ae;return N?(U>>>=0,(Ae=0<=U&&U<256)&&(z=A[U],z)?z:(k=g(U,0,!0),Ae&&(A[U]=k),k)):(U|=0,(Ae=-128<=U&&U<128)&&(z=a[U],z)?z:(k=g(U,U<0?-1:0,!1),Ae&&(a[U]=k),k))}o.fromInt=r;function s(U,N){if(isNaN(U))return N?R:_;if(N){if(U<0)return R;if(U>=y)return V}else{if(U<=-m)return x;if(U+1>=m)return q}return U<0?s(-U,N).neg():g(U%Q|0,U/Q|0,N)}o.fromNumber=s;function g(U,N,k){return new o(U,N,k)}o.fromBits=g;var c=Math.pow;function I(U,N,k){if(U.length===0)throw Error("empty string");if(typeof N=="number"?(k=N,N=!1):N=!!N,U==="NaN"||U==="Infinity"||U==="+Infinity"||U==="-Infinity")return N?R:_;if(k=k||10,k<2||360)throw Error("interior hyphen");if(z===0)return I(U.substring(1),N,k).neg();for(var Ae=s(c(k,8)),ie=_,we=0;we>>0:this.low},G.toNumber=function(){return this.unsigned?(this.high>>>0)*Q+(this.low>>>0):this.high*Q+(this.low>>>0)},G.toString=function(N){if(N=N||10,N<2||36>>0,ke=fe.toString(N);if(we=Te,we.isZero())return ke+se;for(;ke.length<6;)ke="0"+ke;se=""+ke+se}},G.getHighBits=function(){return this.high},G.getHighBitsUnsigned=function(){return this.high>>>0},G.getLowBits=function(){return this.low},G.getLowBitsUnsigned=function(){return this.low>>>0},G.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var N=this.high!=0?this.high:this.low,k=31;k>0&&(N&1<>21;return N?this.unsigned?!1:N===-1&&!(this.low===0&&this.high===-2097152):!0},G.isZero=function(){return this.high===0&&this.low===0},G.eqz=G.isZero,G.isNegative=function(){return!this.unsigned&&this.high<0},G.isPositive=function(){return this.unsigned||this.high>=0},G.isOdd=function(){return(this.low&1)===1},G.isEven=function(){return(this.low&1)===0},G.equals=function(N){return i(N)||(N=d(N)),this.unsigned!==N.unsigned&&this.high>>>31===1&&N.high>>>31===1?!1:this.high===N.high&&this.low===N.low},G.eq=G.equals,G.notEquals=function(N){return!this.eq(N)},G.neq=G.notEquals,G.ne=G.notEquals,G.lessThan=function(N){return this.comp(N)<0},G.lt=G.lessThan,G.lessThanOrEqual=function(N){return this.comp(N)<=0},G.lte=G.lessThanOrEqual,G.le=G.lessThanOrEqual,G.greaterThan=function(N){return this.comp(N)>0},G.gt=G.greaterThan,G.greaterThanOrEqual=function(N){return this.comp(N)>=0},G.gte=G.greaterThanOrEqual,G.ge=G.greaterThanOrEqual,G.compare=function(N){if(i(N)||(N=d(N)),this.eq(N))return 0;var k=this.isNegative(),z=N.isNegative();return k&&!z?-1:!k&&z?1:this.unsigned?N.high>>>0>this.high>>>0||N.high===this.high&&N.low>>>0>this.low>>>0?-1:1:this.sub(N).isNegative()?-1:1},G.comp=G.compare,G.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(K)},G.neg=G.negate,G.add=function(N){i(N)||(N=d(N));var k=this.high>>>16,z=this.high&65535,Ae=this.low>>>16,ie=this.low&65535,we=N.high>>>16,se=N.high&65535,Te=N.low>>>16,fe=N.low&65535,ke=0,Re=0,We=0,ve=0;return ve+=ie+fe,We+=ve>>>16,ve&=65535,We+=Ae+Te,Re+=We>>>16,We&=65535,Re+=z+se,ke+=Re>>>16,Re&=65535,ke+=k+we,ke&=65535,g(We<<16|ve,ke<<16|Re,this.unsigned)},G.subtract=function(N){return i(N)||(N=d(N)),this.add(N.neg())},G.sub=G.subtract,G.multiply=function(N){if(this.isZero())return this;if(i(N)||(N=d(N)),t){var k=t.mul(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(N.isZero())return this.unsigned?R:_;if(this.eq(x))return N.isOdd()?x:_;if(N.eq(x))return this.isOdd()?x:_;if(this.isNegative())return N.isNegative()?this.neg().mul(N.neg()):this.neg().mul(N).neg();if(N.isNegative())return this.mul(N.neg()).neg();if(this.lt(T)&&N.lt(T))return s(this.toNumber()*N.toNumber(),this.unsigned);var z=this.high>>>16,Ae=this.high&65535,ie=this.low>>>16,we=this.low&65535,se=N.high>>>16,Te=N.high&65535,fe=N.low>>>16,ke=N.low&65535,Re=0,We=0,ve=0,aA=0;return aA+=we*ke,ve+=aA>>>16,aA&=65535,ve+=ie*ke,We+=ve>>>16,ve&=65535,ve+=we*fe,We+=ve>>>16,ve&=65535,We+=Ae*ke,Re+=We>>>16,We&=65535,We+=ie*fe,Re+=We>>>16,We&=65535,We+=we*Te,Re+=We>>>16,We&=65535,Re+=z*ke+Ae*fe+ie*Te+we*se,Re&=65535,g(ve<<16|aA,Re<<16|We,this.unsigned)},G.mul=G.multiply,G.divide=function(N){if(i(N)||(N=d(N)),N.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&N.low===-1&&N.high===-1)return this;var k=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?R:_;var z,Ae,ie;if(this.unsigned){if(N.unsigned||(N=N.toUnsigned()),N.gt(this))return R;if(N.gt(this.shru(1)))return L;ie=R}else{if(this.eq(x)){if(N.eq(K)||N.eq(F))return x;if(N.eq(x))return K;var we=this.shr(1);return z=we.div(N).shl(1),z.eq(_)?N.isNegative()?K:F:(Ae=this.sub(N.mul(z)),ie=z.add(Ae.div(N)),ie)}else if(N.eq(x))return this.unsigned?R:_;if(this.isNegative())return N.isNegative()?this.neg().div(N.neg()):this.neg().div(N).neg();if(N.isNegative())return this.div(N.neg()).neg();ie=_}for(Ae=this;Ae.gte(N);){z=Math.max(1,Math.floor(Ae.toNumber()/N.toNumber()));for(var se=Math.ceil(Math.log(z)/Math.LN2),Te=se<=48?1:c(2,se-48),fe=s(z),ke=fe.mul(N);ke.isNegative()||ke.gt(Ae);)z-=Te,fe=s(z,this.unsigned),ke=fe.mul(N);fe.isZero()&&(fe=K),ie=ie.add(fe),Ae=Ae.sub(ke)}return ie},G.div=G.divide,G.modulo=function(N){if(i(N)||(N=d(N)),t){var k=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}return this.sub(this.div(N).mul(N))},G.mod=G.modulo,G.rem=G.modulo,G.not=function(){return g(~this.low,~this.high,this.unsigned)},G.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},G.clz=G.countLeadingZeros,G.countTrailingZeros=function(){return this.low?e(this.low):e(this.high)+32},G.ctz=G.countTrailingZeros,G.and=function(N){return i(N)||(N=d(N)),g(this.low&N.low,this.high&N.high,this.unsigned)},G.or=function(N){return i(N)||(N=d(N)),g(this.low|N.low,this.high|N.high,this.unsigned)},G.xor=function(N){return i(N)||(N=d(N)),g(this.low^N.low,this.high^N.high,this.unsigned)},G.shiftLeft=function(N){return i(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low<>>32-N,this.unsigned):g(0,this.low<>>N|this.high<<32-N,this.high>>N,this.unsigned):g(this.high>>N-32,this.high>=0?0:-1,this.unsigned)},G.shr=G.shiftRight,G.shiftRightUnsigned=function(N){return i(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low>>>N|this.high<<32-N,this.high>>>N,this.unsigned):N===32?g(this.high,0,this.unsigned):g(this.high>>>N-32,0,this.unsigned)},G.shru=G.shiftRightUnsigned,G.shr_u=G.shiftRightUnsigned,G.rotateLeft=function(N){var k;return i(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.low<>>k,this.high<>>k,this.unsigned)):(N-=32,k=32-N,g(this.high<>>k,this.low<>>k,this.unsigned))},G.rotl=G.rotateLeft,G.rotateRight=function(N){var k;return i(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.high<>>N,this.low<>>N,this.unsigned)):(N-=32,k=32-N,g(this.low<>>N,this.high<>>N,this.unsigned))},G.rotr=G.rotateRight,G.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},G.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},G.toBytes=function(N){return N?this.toBytesLE():this.toBytesBE()},G.toBytesLE=function(){var N=this.high,k=this.low;return[k&255,k>>>8&255,k>>>16&255,k>>>24,N&255,N>>>8&255,N>>>16&255,N>>>24]},G.toBytesBE=function(){var N=this.high,k=this.low;return[N>>>24,N>>>16&255,N>>>8&255,N&255,k>>>24,k>>>16&255,k>>>8&255,k&255]},o.fromBytes=function(N,k,z){return z?o.fromBytesLE(N,k):o.fromBytesBE(N,k)},o.fromBytesLE=function(N,k){return new o(N[0]|N[1]<<8|N[2]<<16|N[3]<<24,N[4]|N[5]<<8|N[6]<<16|N[7]<<24,k)},o.fromBytesBE=function(N,k){return new o(N[4]<<24|N[5]<<16|N[6]<<8|N[7],N[0]<<24|N[1]<<16|N[2]<<8|N[3],k)},typeof BigInt=="function"&&(o.fromBigInt=function(N,k){var z=Number(BigInt.asIntN(32,N)),Ae=Number(BigInt.asIntN(32,N>>BigInt(32)));return g(z,Ae,k)},o.fromValue=function(N,k){return typeof N=="bigint"?o.fromBigInt(N,k):d(N,k)},G.toBigInt=function(){var N=BigInt(this.low>>>0),k=BigInt(this.unsigned?this.high>>>0:this.high);return k<{"use strict";var BA=iR;BA.asPromise=dV();BA.base64=uV();BA.EventEmitter=fV();BA.float=OV();BA.utf8=MV();BA.pool=TV();BA.LongBits=RV();function vV(n){return n==="__proto__"||n==="prototype"||n==="constructor"}BA.isUnsafeProperty=vV;BA.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);BA.global=BA.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||iR;BA.emptyArray=Object.freeze?Object.freeze([]):[];BA.emptyObject=Object.freeze?Object.freeze({}):{};BA.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};BA.isString=function(t){return typeof t=="string"||t instanceof String};BA.isObject=function(t){return t&&typeof t=="object"};BA.isset=BA.isSet=function(t,o){var i=t[o];return i!=null&&Object.hasOwnProperty.call(t,o)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1};BA.Buffer=(function(){try{var n=BA.global.Buffer;return n.prototype.utf8Write?n:null}catch{return null}})();BA._Buffer_from=null;BA._Buffer_allocUnsafe=null;BA.newBuffer=function(t){return typeof t=="number"?BA.Buffer?BA._Buffer_allocUnsafe(t):new BA.Array(t):BA.Buffer?BA._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};BA.Array=typeof Uint8Array<"u"?Uint8Array:Array;BA.Long=BA.global.dcodeIO&&BA.global.dcodeIO.Long||BA.global.Long||(function(){try{var n=kV();return n&&n.isLong?n:null}catch{return null}})();BA.key2Re=/^true|false|0|1$/;BA.key32Re=/^-?(?:0|[1-9][0-9]*)$/;BA.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;BA.longToHash=function(t){return t?BA.LongBits.from(t).toHash():BA.LongBits.zeroHash};BA.longFromHash=function(t,o){var i=BA.LongBits.fromHash(t);return BA.Long?BA.Long.fromBits(i.lo,i.hi,o):i.toNumber(!!o)};function PV(n){var t=typeof arguments[arguments.length-1]=="boolean",o=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var i=1;i-1;--a)if(o[e[a]]===1&&this[e[a]]!==void 0&&this[e[a]]!==null)return e[a]}};BA.oneOfSetter=function(t){return function(o){for(var i=0;i{"use strict";HV.exports=ft;var Ho=bc(),oR,Tm=Ho.LongBits,FV=Ho.base64,LV=Ho.utf8;function su(n,t,o){this.fn=n,this.len=t,this.next=void 0,this.val=o}function sR(){}function VTe(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function ft(){this.len=0,this.head=new su(sR,0,0),this.tail=this.head,this.states=null}var UV=function(){return Ho.Buffer?function(){return(ft.create=function(){return new oR})()}:function(){return new ft}};ft.create=UV();ft.alloc=function(t){return new Ho.Array(t)};Ho.Array!==Array&&(ft.alloc=Ho.pool(ft.alloc,Ho.Array.prototype.subarray));ft.prototype._push=function(t,o,i){return this.tail=this.tail.next=new su(t,o,i),this.len+=o,this};function gR(n,t,o){t[o]=n&255}function WTe(n,t,o){for(;n>127;)t[o++]=n&127|128,n>>>=7;t[o]=n}function cR(n,t){this.len=n,this.next=void 0,this.val=t}cR.prototype=Object.create(su.prototype);cR.prototype.fn=WTe;ft.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new cR((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};ft.prototype.int32=function(t){return(t|=0)<0?this._push(IR,10,Tm.fromNumber(t)):this.uint32(t)};ft.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function IR(n,t,o){for(var i=n.lo,e=n.hi;e;)t[o++]=i&127|128,i=(i>>>7|e<<25)>>>0,e>>>=7;for(;i>127;)t[o++]=i&127|128,i=i>>>7;t[o++]=i}ft.prototype.uint64=function(t){var o=Tm.from(t);return this._push(IR,o.length(),o)};ft.prototype.int64=ft.prototype.uint64;ft.prototype.sint64=function(t){var o=Tm.from(t).zzEncode();return this._push(IR,o.length(),o)};ft.prototype.bool=function(t){return this._push(gR,1,t?1:0)};function nR(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}ft.prototype.fixed32=function(t){return this._push(nR,4,t>>>0)};ft.prototype.sfixed32=ft.prototype.fixed32;ft.prototype.fixed64=function(t){var o=Tm.from(t);return this._push(nR,4,o.lo)._push(nR,4,o.hi)};ft.prototype.sfixed64=ft.prototype.fixed64;ft.prototype.float=function(t){return this._push(Ho.float.writeFloatLE,4,t)};ft.prototype.double=function(t){return this._push(Ho.float.writeDoubleLE,8,t)};var ZTe=Ho.Array.prototype.set?function(t,o,i){o.set(t,i)}:function(t,o,i){for(var e=0;e>>0;if(!o)return this._push(gR,1,0);if(Ho.isString(t)){var i=ft.alloc(o=FV.length(t));FV.decode(t,i,0),t=i}return this.uint32(o)._push(ZTe,o,t)};ft.prototype.string=function(t){var o=LV.length(t);return o?this.uint32(o)._push(LV.write,o,t):this._push(gR,1,0)};ft.prototype.fork=function(){return this.states=new VTe(this),this.head=this.tail=new su(sR,0,0),this.len=0,this};ft.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new su(sR,0,0),this.len=0),this};ft.prototype.ldelim=function(){var t=this.head,o=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=o,this.len+=i),this};ft.prototype.finish=function(){for(var t=this.head.next,o=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,o,i),i+=t.len,t=t.next;return o};ft._configure=function(n){oR=n,ft.create=UV(),oR._configure()}});var YV=$((rcA,xV)=>{"use strict";xV.exports=Cs;var KV=lR();(Cs.prototype=Object.create(KV.prototype)).constructor=Cs;var Mc=bc();function Cs(){KV.call(this)}Cs._configure=function(){Cs.alloc=Mc._Buffer_allocUnsafe,Cs.writeBytesBuffer=Mc.Buffer&&Mc.Buffer.prototype instanceof Uint8Array&&Mc.Buffer.prototype.set.name==="set"?function(t,o,i){o.set(t,i)}:function(t,o,i){if(t.copy)t.copy(o,i,0,t.length);else for(var e=0;e>>0;return this.uint32(o),o&&this._push(Cs.writeBytesBuffer,o,t),this};function XTe(n,t,o){n.length<40?Mc.utf8.write(n,t,o):t.utf8Write?t.utf8Write(n,o):t.write(n,o)}Cs.prototype.string=function(t){var o=Mc.Buffer.byteLength(t);return this.uint32(o),o&&this._push(XTe,o,t),this};Cs._configure()});var hR=$((acA,VV)=>{"use strict";VV.exports=gr;var Ko=bc(),dR,qV=Ko.LongBits,$Te=Ko.utf8;function On(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function gr(n){this.buf=n,this.pos=0,this.len=n.length}var jV=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new gr(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new gr(t);throw Error("illegal buffer")},zV=function(){return Ko.Buffer?function(o){return(gr.create=function(e){return Ko.Buffer.isBuffer(e)?new dR(e):jV(e)})(o)}:jV};gr.create=zV();gr.prototype._slice=Ko.Array.prototype.subarray||Ko.Array.prototype.slice;gr.prototype.uint32=(function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,On(this,10);return t}})();gr.prototype.int32=function(){return this.uint32()|0};gr.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function pR(){var n=new qV(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw On(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw On(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}gr.prototype.bool=function(){return this.uint32()!==0};function Nm(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}gr.prototype.fixed32=function(){if(this.pos+4>this.len)throw On(this,4);return Nm(this.buf,this.pos+=4)};gr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw On(this,4);return Nm(this.buf,this.pos+=4)|0};function JV(){if(this.pos+8>this.len)throw On(this,8);return new qV(Nm(this.buf,this.pos+=4),Nm(this.buf,this.pos+=4))}gr.prototype.float=function(){if(this.pos+4>this.len)throw On(this,4);var t=Ko.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};gr.prototype.double=function(){if(this.pos+8>this.len)throw On(this,4);var t=Ko.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};gr.prototype.bytes=function(){var t=this.uint32(),o=this.pos,i=this.pos+t;if(i>this.len)throw On(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(o,i);if(o===i){var e=Ko.Buffer;return e?e.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,o,i)};gr.prototype.string=function(){var t=this.bytes();return $Te.read(t,0,t.length)};gr.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw On(this,t);this.pos+=t}else do if(this.pos>=this.len)throw On(this);while(this.buf[this.pos++]&128);return this};gr.recursionLimit=Ko.recursionLimit;gr.prototype.skipType=function(n,t){if(t===void 0&&(t=0),t>gr.recursionLimit)throw Error("maximum nesting depth exceeded");switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n,t+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this};gr._configure=function(n){dR=n,gr.create=zV(),dR._configure();var t=Ko.Long?"toLong":"toNumber";Ko.merge(gr.prototype,{int64:function(){return pR.call(this)[t](!1)},uint64:function(){return pR.call(this)[t](!0)},sint64:function(){return pR.call(this).zzDecode()[t](!1)},fixed64:function(){return JV.call(this)[t](!0)},sfixed64:function(){return JV.call(this)[t](!1)}})}});var $V=$((icA,XV)=>{"use strict";XV.exports=dl;var ZV=hR();(dl.prototype=Object.create(ZV.prototype)).constructor=dl;var WV=bc();function dl(n){ZV.call(this,n)}dl._configure=function(){WV.Buffer&&(dl.prototype._slice=WV.Buffer.prototype.slice)};dl.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};dl._configure()});var AW=$((ocA,eW)=>{"use strict";eW.exports=gu;var ER=bc();(gu.prototype=Object.create(ER.EventEmitter.prototype)).constructor=gu;function gu(n,t,o){if(typeof n!="function")throw TypeError("rpcImpl must be a function");ER.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!o}gu.prototype.rpcCall=function n(t,o,i,e,a){if(!e)throw TypeError("request must be specified");var A=this;if(!a)return ER.asPromise(n,A,t,o,i,e);if(!A.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return A.rpcImpl(t,o[A.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(s,g){if(s)return A.emit("error",s,t),a(s);if(g===null){A.end(!0);return}if(!(g instanceof i))try{g=i[A.responseDelimited?"decodeDelimited":"decode"](g)}catch(c){return A.emit("error",c,t),a(c)}return A.emit("data",g,t),a(null,g)})}catch(r){A.emit("error",r,t),setTimeout(function(){a(r)},0);return}};gu.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var rW=$(tW=>{"use strict";var eNe=tW;eNe.Service=AW()});var iW=$((scA,aW)=>{"use strict";aW.exports=Object.create(null)});var sW=$(nW=>{"use strict";var Hi=nW;Hi.build="minimal";Hi.Writer=lR();Hi.BufferWriter=YV();Hi.Reader=hR();Hi.BufferReader=$V();Hi.util=bc();Hi.rpc=rW();Hi.roots=iW();Hi.configure=oW;function oW(){Hi.util._configure(),Hi.Writer._configure(Hi.BufferWriter),Hi.Reader._configure(Hi.BufferReader)}oW()});var Rm=$((ccA,gW)=>{"use strict";gW.exports=sW()});var n5=$(ot=>{"use strict";var Pu=Symbol.for("react.element"),dve=Symbol.for("react.portal"),hve=Symbol.for("react.fragment"),Eve=Symbol.for("react.strict_mode"),Cve=Symbol.for("react.profiler"),uve=Symbol.for("react.provider"),Bve=Symbol.for("react.context"),fve=Symbol.for("react.forward_ref"),Qve=Symbol.for("react.suspense"),yve=Symbol.for("react.memo"),mve=Symbol.for("react.lazy"),W6=Symbol.iterator;function Sve(n){return n===null||typeof n!="object"?null:(n=W6&&n[W6]||n["@@iterator"],typeof n=="function"?n:null)}var $6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e5=Object.assign,A5={};function Jd(n,t,o){this.props=n,this.context=t,this.refs=A5,this.updater=o||$6}Jd.prototype.isReactComponent={};Jd.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};Jd.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function t5(){}t5.prototype=Jd.prototype;function bP(n,t,o){this.props=n,this.context=t,this.refs=A5,this.updater=o||$6}var MP=bP.prototype=new t5;MP.constructor=bP;e5(MP,Jd.prototype);MP.isPureReactComponent=!0;var Z6=Array.isArray,r5=Object.prototype.hasOwnProperty,_P={current:null},a5={key:!0,ref:!0,__self:!0,__source:!0};function i5(n,t,o){var i,e={},a=null,A=null;if(t!=null)for(i in t.ref!==void 0&&(A=t.ref),t.key!==void 0&&(a=""+t.key),t)r5.call(t,i)&&!a5.hasOwnProperty(i)&&(e[i]=t[i]);var r=arguments.length-2;if(r===1)e.children=o;else if(1{"use strict";process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",t=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),r=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),f=Symbol.iterator,Q="@@iterator";function y(H){if(H===null||typeof H!="object")return null;var te=f&&H[f]||H[Q];return typeof te=="function"?te:null}var m={current:null},T={transition:null},_={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},K={},L=null;function F(H){L=H}K.setExtraStackFrame=function(H){L=H},K.getCurrentStack=null,K.getStackAddendum=function(){var H="";L&&(H+=L);var te=K.getCurrentStack;return te&&(H+=te()||""),H};var q=!1,V=!1,x=!1,G=!1,J=!1,U={ReactCurrentDispatcher:m,ReactCurrentBatchConfig:T,ReactCurrentOwner:R};U.ReactDebugCurrentFrame=K,U.ReactCurrentActQueue=_;function N(H){{for(var te=arguments.length,de=new Array(te>1?te-1:0),me=1;me1?te-1:0),me=1;me1){for(var Vt=Array(Gt),Wt=0;Wt1){for(var ir=Array(Wt),_r=0;_r is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Provider},set:function(CA){te.Provider=CA}},_currentValue:{get:function(){return te._currentValue},set:function(CA){te._currentValue=CA}},_currentValue2:{get:function(){return te._currentValue2},set:function(CA){te._currentValue2=CA}},_threadCount:{get:function(){return te._threadCount},set:function(CA){te._threadCount=CA}},Consumer:{get:function(){return de||(de=!0,k("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Consumer}},displayName:{get:function(){return te.displayName},set:function(CA){ze||(N("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",CA),ze=!0)}}}),te.Consumer=TA}return te._currentRenderer=null,te._currentRenderer2=null,te}var he=-1,ye=0,Je=1,IA=2;function yA(H){if(H._status===he){var te=H._result,de=te();if(de.then(function(TA){if(H._status===ye||H._status===he){var CA=H;CA._status=Je,CA._result=TA}},function(TA){if(H._status===ye||H._status===he){var CA=H;CA._status=IA,CA._result=TA}}),H._status===he){var me=H;me._status=ye,me._result=de}}if(H._status===Je){var ze=H._result;return ze===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s Your code should look like: const MyComponent = lazy(() => import('./MyComponent')) @@ -37,25 +37,25 @@ Your code should look like: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app -See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),H}function et(H){var te=tA();if(H._context!==void 0){var de=H._context;de.Consumer===H?k("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):de.Provider===H&&k("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return te.useContext(H)}function Zr(H){var te=tA();return te.useState(H)}function ar(H,te,de){var me=tA();return me.useReducer(H,te,de)}function yo(H){var te=tA();return te.useRef(H)}function DM(H,te){var de=tA();return de.useEffect(H,te)}function OM(H,te){var de=tA();return de.useInsertionEffect(H,te)}function mo(H,te){var de=tA();return de.useLayoutEffect(H,te)}function yp(H,te){var de=tA();return de.useCallback(H,te)}function bM(H,te){var de=tA();return de.useMemo(H,te)}function MM(H,te,de){var me=tA();return me.useImperativeHandle(H,te,de)}function DIe(H,te){{var de=tA();return de.useDebugValue(H,te)}}function OIe(){var H=tA();return H.useTransition()}function bIe(H){var te=tA();return te.useDeferredValue(H)}function MIe(){var H=tA();return H.useId()}function _Ie(H,te,de){var me=tA();return me.useSyncExternalStore(H,te,de)}var RE=0,uK,BK,fK,QK,yK,mK,SK;function wK(){}wK.__reactDisabledLog=!0;function TIe(){{if(RE===0){uK=console.log,BK=console.info,fK=console.warn,QK=console.error,yK=console.group,mK=console.groupCollapsed,SK=console.groupEnd;var H={configurable:!0,enumerable:!0,value:wK,writable:!0};Object.defineProperties(console,{info:H,log:H,warn:H,error:H,group:H,groupCollapsed:H,groupEnd:H})}RE++}}function NIe(){{if(RE--,RE===0){var H={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},H,{value:uK}),info:se({},H,{value:BK}),warn:se({},H,{value:fK}),error:se({},H,{value:QK}),group:se({},H,{value:yK}),groupCollapsed:se({},H,{value:mK}),groupEnd:se({},H,{value:SK})})}RE<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var _M=U.ReactCurrentDispatcher,TM;function oQ(H,te,de){{if(TM===void 0)try{throw Error()}catch(ze){var me=ze.stack.trim().match(/\n( *(at )?)/);TM=me&&me[1]||""}return` +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),H}function et(H){var te=tA();if(H._context!==void 0){var de=H._context;de.Consumer===H?k("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):de.Provider===H&&k("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return te.useContext(H)}function Zr(H){var te=tA();return te.useState(H)}function ar(H,te,de){var me=tA();return me.useReducer(H,te,de)}function yo(H){var te=tA();return te.useRef(H)}function DM(H,te){var de=tA();return de.useEffect(H,te)}function OM(H,te){var de=tA();return de.useInsertionEffect(H,te)}function mo(H,te){var de=tA();return de.useLayoutEffect(H,te)}function yp(H,te){var de=tA();return de.useCallback(H,te)}function bM(H,te){var de=tA();return de.useMemo(H,te)}function MM(H,te,de){var me=tA();return me.useImperativeHandle(H,te,de)}function DIe(H,te){{var de=tA();return de.useDebugValue(H,te)}}function OIe(){var H=tA();return H.useTransition()}function bIe(H){var te=tA();return te.useDeferredValue(H)}function MIe(){var H=tA();return H.useId()}function _Ie(H,te,de){var me=tA();return me.useSyncExternalStore(H,te,de)}var kE=0,uK,BK,fK,QK,yK,mK,SK;function wK(){}wK.__reactDisabledLog=!0;function TIe(){{if(kE===0){uK=console.log,BK=console.info,fK=console.warn,QK=console.error,yK=console.group,mK=console.groupCollapsed,SK=console.groupEnd;var H={configurable:!0,enumerable:!0,value:wK,writable:!0};Object.defineProperties(console,{info:H,log:H,warn:H,error:H,group:H,groupCollapsed:H,groupEnd:H})}kE++}}function NIe(){{if(kE--,kE===0){var H={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},H,{value:uK}),info:se({},H,{value:BK}),warn:se({},H,{value:fK}),error:se({},H,{value:QK}),group:se({},H,{value:yK}),groupCollapsed:se({},H,{value:mK}),groupEnd:se({},H,{value:SK})})}kE<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var _M=U.ReactCurrentDispatcher,TM;function oQ(H,te,de){{if(TM===void 0)try{throw Error()}catch(ze){var me=ze.stack.trim().match(/\n( *(at )?)/);TM=me&&me[1]||""}return` `+TM+H}}var NM=!1,nQ;{var RIe=typeof WeakMap=="function"?WeakMap:Map;nQ=new RIe}function DK(H,te){if(!H||NM)return"";{var de=nQ.get(H);if(de!==void 0)return de}var me;NM=!0;var ze=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var TA;TA=_M.current,_M.current=null,TIe();try{if(te){var CA=function(){throw Error()};if(Object.defineProperty(CA.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(CA,[])}catch(Ca){me=Ca}Reflect.construct(H,[],CA)}else{try{CA.call()}catch(Ca){me=Ca}H.call(CA.prototype)}}else{try{throw Error()}catch(Ca){me=Ca}H()}}catch(Ca){if(Ca&&me&&typeof Ca.stack=="string"){for(var xA=Ca.stack.split(` `),pt=me.stack.split(` -`),Pt=xA.length-1,Vt=pt.length-1;Pt>=1&&Vt>=0&&xA[Pt]!==pt[Vt];)Vt--;for(;Pt>=1&&Vt>=0;Pt--,Vt--)if(xA[Pt]!==pt[Vt]){if(Pt!==1||Vt!==1)do if(Pt--,Vt--,Vt<0||xA[Pt]!==pt[Vt]){var Wt=` -`+xA[Pt].replace(" at new "," at ");return H.displayName&&Wt.includes("")&&(Wt=Wt.replace("",H.displayName)),typeof H=="function"&&nQ.set(H,Wt),Wt}while(Pt>=1&&Vt>=0);break}}}finally{NM=!1,_M.current=TA,NIe(),Error.prepareStackTrace=ze}var ir=H?H.displayName||H.name:"",_r=ir?oQ(ir):"";return typeof H=="function"&&nQ.set(H,_r),_r}function kIe(H,te,de){return DK(H,!1)}function vIe(H){var te=H.prototype;return!!(te&&te.isReactComponent)}function sQ(H,te,de){if(H==null)return"";if(typeof H=="function")return DK(H,vIe(H));if(typeof H=="string")return oQ(H);switch(H){case g:return oQ("Suspense");case c:return oQ("SuspenseList")}if(typeof H=="object")switch(H.$$typeof){case s:return kIe(H.render);case I:return sQ(H.type,te,de);case d:{var me=H,ze=me._payload,TA=me._init;try{return sQ(TA(ze),te,de)}catch{}}}return""}var OK={},bK=U.ReactDebugCurrentFrame;function gQ(H){if(H){var te=H._owner,de=sQ(H.type,H._source,te?te.type:null);bK.setExtraStackFrame(de)}else bK.setExtraStackFrame(null)}function PIe(H,te,de,me,ze){{var TA=Function.call.bind(Ne);for(var CA in H)if(TA(H,CA)){var xA=void 0;try{if(typeof H[CA]!="function"){var pt=Error((me||"React class")+": "+de+" type `"+CA+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof H[CA]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw pt.name="Invariant Violation",pt}xA=H[CA](te,CA,me,de,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pt){xA=Pt}xA&&!(xA instanceof Error)&&(gQ(ze),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",me||"React class",de,CA,typeof xA),gQ(null)),xA instanceof Error&&!(xA.message in OK)&&(OK[xA.message]=!0,gQ(ze),k("Failed %s type: %s",de,xA.message),gQ(null))}}}function mp(H){if(H){var te=H._owner,de=sQ(H.type,H._source,te?te.type:null);F(de)}else F(null)}var RM;RM=!1;function MK(){if(R.current){var H=ue(R.current.type);if(H)return` +`),Gt=xA.length-1,Vt=pt.length-1;Gt>=1&&Vt>=0&&xA[Gt]!==pt[Vt];)Vt--;for(;Gt>=1&&Vt>=0;Gt--,Vt--)if(xA[Gt]!==pt[Vt]){if(Gt!==1||Vt!==1)do if(Gt--,Vt--,Vt<0||xA[Gt]!==pt[Vt]){var Wt=` +`+xA[Gt].replace(" at new "," at ");return H.displayName&&Wt.includes("")&&(Wt=Wt.replace("",H.displayName)),typeof H=="function"&&nQ.set(H,Wt),Wt}while(Gt>=1&&Vt>=0);break}}}finally{NM=!1,_M.current=TA,NIe(),Error.prepareStackTrace=ze}var ir=H?H.displayName||H.name:"",_r=ir?oQ(ir):"";return typeof H=="function"&&nQ.set(H,_r),_r}function kIe(H,te,de){return DK(H,!1)}function vIe(H){var te=H.prototype;return!!(te&&te.isReactComponent)}function sQ(H,te,de){if(H==null)return"";if(typeof H=="function")return DK(H,vIe(H));if(typeof H=="string")return oQ(H);switch(H){case g:return oQ("Suspense");case c:return oQ("SuspenseList")}if(typeof H=="object")switch(H.$$typeof){case s:return kIe(H.render);case I:return sQ(H.type,te,de);case d:{var me=H,ze=me._payload,TA=me._init;try{return sQ(TA(ze),te,de)}catch{}}}return""}var OK={},bK=U.ReactDebugCurrentFrame;function gQ(H){if(H){var te=H._owner,de=sQ(H.type,H._source,te?te.type:null);bK.setExtraStackFrame(de)}else bK.setExtraStackFrame(null)}function PIe(H,te,de,me,ze){{var TA=Function.call.bind(Ne);for(var CA in H)if(TA(H,CA)){var xA=void 0;try{if(typeof H[CA]!="function"){var pt=Error((me||"React class")+": "+de+" type `"+CA+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof H[CA]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw pt.name="Invariant Violation",pt}xA=H[CA](te,CA,me,de,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Gt){xA=Gt}xA&&!(xA instanceof Error)&&(gQ(ze),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",me||"React class",de,CA,typeof xA),gQ(null)),xA instanceof Error&&!(xA.message in OK)&&(OK[xA.message]=!0,gQ(ze),k("Failed %s type: %s",de,xA.message),gQ(null))}}}function mp(H){if(H){var te=H._owner,de=sQ(H.type,H._source,te?te.type:null);F(de)}else F(null)}var RM;RM=!1;function MK(){if(R.current){var H=ue(R.current.type);if(H)return` Check the render method of \``+H+"`."}return""}function GIe(H){if(H!==void 0){var te=H.fileName.replace(/^.*[\\\/]/,""),de=H.lineNumber;return` Check your code at `+te+":"+de+"."}return""}function FIe(H){return H!=null?GIe(H.__source):""}var _K={};function LIe(H){var te=MK();if(!te){var de=typeof H=="string"?H:H.displayName||H.name;de&&(te=` -Check the top-level render call using <`+de+">.")}return te}function TK(H,te){if(!(!H._store||H._store.validated||H.key!=null)){H._store.validated=!0;var de=LIe(te);if(!_K[de]){_K[de]=!0;var me="";H&&H._owner&&H._owner!==R.current&&(me=" It was passed a child from "+ue(H._owner.type)+"."),mp(H),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',de,me),mp(null)}}}function NK(H,te){if(typeof H=="object"){if(je(H))for(var de=0;de",ze=" Did you accidentally export a JSX literal instead of a component?"):CA=typeof H,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",CA,ze)}var xA=Qe.apply(this,arguments);if(xA==null)return xA;if(me)for(var pt=2;pt10&&N("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),me._updatedFibers.clear()}}}var PK=!1,cQ=null;function YIe(H){if(cQ===null)try{var te=("require"+Math.random()).slice(0,7),de=TS&&TS[te];cQ=de.call(TS,"timers").setImmediate}catch{cQ=function(ze){PK===!1&&(PK=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var TA=new MessageChannel;TA.port1.onmessage=ze,TA.port2.postMessage(void 0)}}return cQ(H)}var Sp=0,GK=!1;function FK(H){{var te=Sp;Sp++,_.current===null&&(_.current=[]);var de=_.isBatchingLegacy,me;try{if(_.isBatchingLegacy=!0,me=H(),!de&&_.didScheduleLegacyUpdate){var ze=_.current;ze!==null&&(_.didScheduleLegacyUpdate=!1,PM(ze))}}catch(ir){throw IQ(te),ir}finally{_.isBatchingLegacy=de}if(me!==null&&typeof me=="object"&&typeof me.then=="function"){var TA=me,CA=!1,xA={then:function(ir,_r){CA=!0,TA.then(function(Ca){IQ(te),Sp===0?kM(Ca,ir,_r):ir(Ca)},function(Ca){IQ(te),_r(Ca)})}};return!GK&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){CA||(GK=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),xA}else{var pt=me;if(IQ(te),Sp===0){var Pt=_.current;Pt!==null&&(PM(Pt),_.current=null);var Vt={then:function(ir,_r){_.current===null?(_.current=[],kM(pt,ir,_r)):ir(pt)}};return Vt}else{var Wt={then:function(ir,_r){ir(pt)}};return Wt}}}}function IQ(H){H!==Sp-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Sp=H}function kM(H,te,de){{var me=_.current;if(me!==null)try{PM(me),YIe(function(){me.length===0?(_.current=null,te(H)):kM(H,te,de)})}catch(ze){de(ze)}else te(H)}}var vM=!1;function PM(H){if(!vM){vM=!0;var te=0;try{for(;te{"use strict";process.env.NODE_ENV==="production"?NP.exports=n5():NP.exports=s5()});var Nl=$((XBA,E9)=>{"use strict";var Lw=$e("crypto"),R2e=$e("assert");function qo(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}function k2e(n,t,o){qo(n),qo(t),qo(o);let i=Lw.createCipheriv("aes-256-cbc",n,o);return Buffer.concat([i.update(t),i.final()])}function v2e(n,t,o){qo(n),qo(t),qo(o);let i=Lw.createDecipheriv("aes-256-cbc",n,o);return Buffer.concat([i.update(t),i.final()])}function ah(n,t){qo(n),qo(t);let o=Lw.createHmac("sha256",n);return o.update(t),Buffer.from(o.digest())}function P2e(n){qo(n);let t=Lw.createHash("sha512");return t.update(n),t.digest()}function G2e(n,t,o,i){if(qo(n),qo(t),qo(o),t.byteLength!=32)throw new Error("Got salt of incorrect length");i=i||3,R2e(i>=1&&i<=3);let e=ah(t,n),a=new Uint8Array(o.byteLength+1+32);a.set(o,32),a[a.length-1]=1;let A=[ah(e,Buffer.from(a.slice(32)))];return i>1&&(a.set(A[A.length-1]),a[a.length-1]=2,A.push(ah(e,Buffer.from(a)))),i>2&&(a.set(A[A.length-1]),a[a.length-1]=3,A.push(ah(e,Buffer.from(a)))),A}function F2e(n,t,o,i){let e=ah(t,n).slice(0,i);if(o.length!==i||e.length!==i)throw new Error("Bad MAC length");if(!o.equals(e))throw new Error("Bad MAC")}E9.exports={deriveSecrets:G2e,decrypt:v2e,encrypt:k2e,hash:P2e,calculateMAC:ah,verifyMAC:F2e}});var _9=$(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});var $BA=new Uint8Array(16),S9=new Uint8Array(32);S9[0]=9;function dA(n){var t,o=new Float64Array(16);if(n)for(t=0;t>24&255,n[t+1]=o>>16&255,n[t+2]=o>>8&255,n[t+3]=o&255,n[t+4]=i>>24&255,n[t+5]=i>>16&255,n[t+6]=i>>8&255,n[t+7]=i&255}function x2e(n,t,o,i,e){var a,A=0;for(a=0;a>>8)-1}function w9(n,t,o,i){return x2e(n,t,o,i,32)}function Hc(n,t){var o;for(o=0;o<16;o++)n[o]=t[o]|0}function oF(n){var t,o,i=1;for(t=0;t<16;t++)o=n[t]+i+65535,i=Math.floor(o/65536),n[t]=o-i*65536;n[0]+=i-1+37*(i-1)}function ih(n,t,o){for(var i,e=~(o-1),a=0;a<16;a++)i=e&(n[a]^t[a]),n[a]^=i,t[a]^=i}function nh(n,t){var o,i,e,a=dA(),A=dA();for(o=0;o<16;o++)A[o]=t[o];for(oF(A),oF(A),oF(A),i=0;i<2;i++){for(a[0]=A[0]-65517,o=1;o<15;o++)a[o]=A[o]-65535-(a[o-1]>>16&1),a[o-1]&=65535;a[15]=A[15]-32767-(a[14]>>16&1),e=a[15]>>16&1,a[14]&=65535,ih(A,a,1-e)}for(o=0;o<16;o++)n[2*o]=A[o]&255,n[2*o+1]=A[o]>>8}function f9(n,t){var o=new Uint8Array(32),i=new Uint8Array(32);return nh(o,n),nh(i,t),w9(o,0,i,0)}function D9(n){var t=new Uint8Array(32);return nh(t,n),t[0]&1}function IF(n,t){var o;for(o=0;o<16;o++)n[o]=t[2*o]+(t[2*o+1]<<8);n[15]&=32767}function Rn(n,t,o){for(var i=0;i<16;i++)n[i]=t[i]+o[i]}function vn(n,t,o){for(var i=0;i<16;i++)n[i]=t[i]-o[i]}function It(n,t,o){var i,e,a=0,A=0,r=0,s=0,g=0,c=0,I=0,d=0,B=0,f=0,Q=0,y=0,m=0,T=0,_=0,R=0,K=0,L=0,F=0,q=0,V=0,x=0,G=0,J=0,U=0,N=0,k=0,z=0,Ae=0,ie=0,we=0,se=o[0],Te=o[1],fe=o[2],ke=o[3],Re=o[4],We=o[5],ve=o[6],aA=o[7],Be=o[8],Ie=o[9],Xe=o[10],je=o[11],Oe=o[12],EA=o[13],hA=o[14],iA=o[15];i=t[0],a+=i*se,A+=i*Te,r+=i*fe,s+=i*ke,g+=i*Re,c+=i*We,I+=i*ve,d+=i*aA,B+=i*Be,f+=i*Ie,Q+=i*Xe,y+=i*je,m+=i*Oe,T+=i*EA,_+=i*hA,R+=i*iA,i=t[1],A+=i*se,r+=i*Te,s+=i*fe,g+=i*ke,c+=i*Re,I+=i*We,d+=i*ve,B+=i*aA,f+=i*Be,Q+=i*Ie,y+=i*Xe,m+=i*je,T+=i*Oe,_+=i*EA,R+=i*hA,K+=i*iA,i=t[2],r+=i*se,s+=i*Te,g+=i*fe,c+=i*ke,I+=i*Re,d+=i*We,B+=i*ve,f+=i*aA,Q+=i*Be,y+=i*Ie,m+=i*Xe,T+=i*je,_+=i*Oe,R+=i*EA,K+=i*hA,L+=i*iA,i=t[3],s+=i*se,g+=i*Te,c+=i*fe,I+=i*ke,d+=i*Re,B+=i*We,f+=i*ve,Q+=i*aA,y+=i*Be,m+=i*Ie,T+=i*Xe,_+=i*je,R+=i*Oe,K+=i*EA,L+=i*hA,F+=i*iA,i=t[4],g+=i*se,c+=i*Te,I+=i*fe,d+=i*ke,B+=i*Re,f+=i*We,Q+=i*ve,y+=i*aA,m+=i*Be,T+=i*Ie,_+=i*Xe,R+=i*je,K+=i*Oe,L+=i*EA,F+=i*hA,q+=i*iA,i=t[5],c+=i*se,I+=i*Te,d+=i*fe,B+=i*ke,f+=i*Re,Q+=i*We,y+=i*ve,m+=i*aA,T+=i*Be,_+=i*Ie,R+=i*Xe,K+=i*je,L+=i*Oe,F+=i*EA,q+=i*hA,V+=i*iA,i=t[6],I+=i*se,d+=i*Te,B+=i*fe,f+=i*ke,Q+=i*Re,y+=i*We,m+=i*ve,T+=i*aA,_+=i*Be,R+=i*Ie,K+=i*Xe,L+=i*je,F+=i*Oe,q+=i*EA,V+=i*hA,x+=i*iA,i=t[7],d+=i*se,B+=i*Te,f+=i*fe,Q+=i*ke,y+=i*Re,m+=i*We,T+=i*ve,_+=i*aA,R+=i*Be,K+=i*Ie,L+=i*Xe,F+=i*je,q+=i*Oe,V+=i*EA,x+=i*hA,G+=i*iA,i=t[8],B+=i*se,f+=i*Te,Q+=i*fe,y+=i*ke,m+=i*Re,T+=i*We,_+=i*ve,R+=i*aA,K+=i*Be,L+=i*Ie,F+=i*Xe,q+=i*je,V+=i*Oe,x+=i*EA,G+=i*hA,J+=i*iA,i=t[9],f+=i*se,Q+=i*Te,y+=i*fe,m+=i*ke,T+=i*Re,_+=i*We,R+=i*ve,K+=i*aA,L+=i*Be,F+=i*Ie,q+=i*Xe,V+=i*je,x+=i*Oe,G+=i*EA,J+=i*hA,U+=i*iA,i=t[10],Q+=i*se,y+=i*Te,m+=i*fe,T+=i*ke,_+=i*Re,R+=i*We,K+=i*ve,L+=i*aA,F+=i*Be,q+=i*Ie,V+=i*Xe,x+=i*je,G+=i*Oe,J+=i*EA,U+=i*hA,N+=i*iA,i=t[11],y+=i*se,m+=i*Te,T+=i*fe,_+=i*ke,R+=i*Re,K+=i*We,L+=i*ve,F+=i*aA,q+=i*Be,V+=i*Ie,x+=i*Xe,G+=i*je,J+=i*Oe,U+=i*EA,N+=i*hA,k+=i*iA,i=t[12],m+=i*se,T+=i*Te,_+=i*fe,R+=i*ke,K+=i*Re,L+=i*We,F+=i*ve,q+=i*aA,V+=i*Be,x+=i*Ie,G+=i*Xe,J+=i*je,U+=i*Oe,N+=i*EA,k+=i*hA,z+=i*iA,i=t[13],T+=i*se,_+=i*Te,R+=i*fe,K+=i*ke,L+=i*Re,F+=i*We,q+=i*ve,V+=i*aA,x+=i*Be,G+=i*Ie,J+=i*Xe,U+=i*je,N+=i*Oe,k+=i*EA,z+=i*hA,Ae+=i*iA,i=t[14],_+=i*se,R+=i*Te,K+=i*fe,L+=i*ke,F+=i*Re,q+=i*We,V+=i*ve,x+=i*aA,G+=i*Be,J+=i*Ie,U+=i*Xe,N+=i*je,k+=i*Oe,z+=i*EA,Ae+=i*hA,ie+=i*iA,i=t[15],R+=i*se,K+=i*Te,L+=i*fe,F+=i*ke,q+=i*Re,V+=i*We,x+=i*ve,G+=i*aA,J+=i*Be,U+=i*Ie,N+=i*Xe,k+=i*je,z+=i*Oe,Ae+=i*EA,ie+=i*hA,we+=i*iA,a+=38*K,A+=38*L,r+=38*F,s+=38*q,g+=38*V,c+=38*x,I+=38*G,d+=38*J,B+=38*U,f+=38*N,Q+=38*k,y+=38*z,m+=38*Ae,T+=38*ie,_+=38*we,e=1,i=a+e+65535,e=Math.floor(i/65536),a=i-e*65536,i=A+e+65535,e=Math.floor(i/65536),A=i-e*65536,i=r+e+65535,e=Math.floor(i/65536),r=i-e*65536,i=s+e+65535,e=Math.floor(i/65536),s=i-e*65536,i=g+e+65535,e=Math.floor(i/65536),g=i-e*65536,i=c+e+65535,e=Math.floor(i/65536),c=i-e*65536,i=I+e+65535,e=Math.floor(i/65536),I=i-e*65536,i=d+e+65535,e=Math.floor(i/65536),d=i-e*65536,i=B+e+65535,e=Math.floor(i/65536),B=i-e*65536,i=f+e+65535,e=Math.floor(i/65536),f=i-e*65536,i=Q+e+65535,e=Math.floor(i/65536),Q=i-e*65536,i=y+e+65535,e=Math.floor(i/65536),y=i-e*65536,i=m+e+65535,e=Math.floor(i/65536),m=i-e*65536,i=T+e+65535,e=Math.floor(i/65536),T=i-e*65536,i=_+e+65535,e=Math.floor(i/65536),_=i-e*65536,i=R+e+65535,e=Math.floor(i/65536),R=i-e*65536,a+=e-1+37*(e-1),e=1,i=a+e+65535,e=Math.floor(i/65536),a=i-e*65536,i=A+e+65535,e=Math.floor(i/65536),A=i-e*65536,i=r+e+65535,e=Math.floor(i/65536),r=i-e*65536,i=s+e+65535,e=Math.floor(i/65536),s=i-e*65536,i=g+e+65535,e=Math.floor(i/65536),g=i-e*65536,i=c+e+65535,e=Math.floor(i/65536),c=i-e*65536,i=I+e+65535,e=Math.floor(i/65536),I=i-e*65536,i=d+e+65535,e=Math.floor(i/65536),d=i-e*65536,i=B+e+65535,e=Math.floor(i/65536),B=i-e*65536,i=f+e+65535,e=Math.floor(i/65536),f=i-e*65536,i=Q+e+65535,e=Math.floor(i/65536),Q=i-e*65536,i=y+e+65535,e=Math.floor(i/65536),y=i-e*65536,i=m+e+65535,e=Math.floor(i/65536),m=i-e*65536,i=T+e+65535,e=Math.floor(i/65536),T=i-e*65536,i=_+e+65535,e=Math.floor(i/65536),_=i-e*65536,i=R+e+65535,e=Math.floor(i/65536),R=i-e*65536,a+=e-1+37*(e-1),n[0]=a,n[1]=A,n[2]=r,n[3]=s,n[4]=g,n[5]=c,n[6]=I,n[7]=d,n[8]=B,n[9]=f,n[10]=Q,n[11]=y,n[12]=m,n[13]=T,n[14]=_,n[15]=R}function kn(n,t){It(n,t,t)}function lF(n,t){var o=dA(),i;for(i=0;i<16;i++)o[i]=t[i];for(i=253;i>=0;i--)kn(o,o),i!==2&&i!==4&&It(o,o,t);for(i=0;i<16;i++)n[i]=o[i]}function Y2e(n,t){var o=dA(),i;for(i=0;i<16;i++)o[i]=t[i];for(i=250;i>=0;i--)kn(o,o),i!==1&&It(o,o,t);for(i=0;i<16;i++)n[i]=o[i]}function O9(n,t,o){var i=new Uint8Array(32),e=new Float64Array(80),a,A,r=dA(),s=dA(),g=dA(),c=dA(),I=dA(),d=dA();for(A=0;A<31;A++)i[A]=t[A];for(i[31]=t[31]&127|64,i[0]&=248,IF(e,o),A=0;A<16;A++)s[A]=e[A],c[A]=r[A]=g[A]=0;for(r[0]=c[0]=1,A=254;A>=0;--A)a=i[A>>>3]>>>(A&7)&1,ih(r,s,a),ih(g,c,a),Rn(I,r,g),vn(r,r,g),Rn(g,s,c),vn(s,s,c),kn(c,I),kn(d,r),It(r,g,r),It(g,s,I),Rn(I,r,g),vn(r,r,g),kn(s,r),vn(g,c,d),It(r,g,L2e),Rn(r,r,c),It(g,g,r),It(r,c,d),It(c,s,e),kn(s,I),ih(r,s,a),ih(g,c,a);for(A=0;A<16;A++)e[A+16]=r[A],e[A+32]=g[A],e[A+48]=s[A],e[A+64]=c[A];var B=e.subarray(32),f=e.subarray(16);return lF(B,B),It(f,f,B),nh(n,f),0}function j2e(n,t){return O9(n,t,S9)}var Q9=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y9(n,t,o,i){for(var e=new Int32Array(16),a=new Int32Array(16),A,r,s,g,c,I,d,B,f,Q,y,m,T,_,R,K,L,F,q,V,x,G,J,U,N,k,z=n[0],Ae=n[1],ie=n[2],we=n[3],se=n[4],Te=n[5],fe=n[6],ke=n[7],Re=t[0],We=t[1],ve=t[2],aA=t[3],Be=t[4],Ie=t[5],Xe=t[6],je=t[7],Oe=0;i>=128;){for(q=0;q<16;q++)V=8*q+Oe,e[q]=o[V+0]<<24|o[V+1]<<16|o[V+2]<<8|o[V+3],a[q]=o[V+4]<<24|o[V+5]<<16|o[V+6]<<8|o[V+7];for(q=0;q<80;q++)if(A=z,r=Ae,s=ie,g=we,c=se,I=Te,d=fe,B=ke,f=Re,Q=We,y=ve,m=aA,T=Be,_=Ie,R=Xe,K=je,x=ke,G=je,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=(se>>>14|Be<<18)^(se>>>18|Be<<14)^(Be>>>9|se<<23),G=(Be>>>14|se<<18)^(Be>>>18|se<<14)^(se>>>9|Be<<23),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=se&Te^~se&fe,G=Be&Ie^~Be&Xe,J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=Q9[q*2],G=Q9[q*2+1],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=e[q%16],G=a[q%16],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,L=N&65535|k<<16,F=J&65535|U<<16,x=L,G=F,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=(z>>>28|Re<<4)^(Re>>>2|z<<30)^(Re>>>7|z<<25),G=(Re>>>28|z<<4)^(z>>>2|Re<<30)^(z>>>7|Re<<25),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=z&Ae^z&ie^Ae&ie,G=Re&We^Re&ve^We&ve,J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,B=N&65535|k<<16,K=J&65535|U<<16,x=g,G=m,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=L,G=F,J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,g=N&65535|k<<16,m=J&65535|U<<16,Ae=A,ie=r,we=s,se=g,Te=c,fe=I,ke=d,z=B,We=f,ve=Q,aA=y,Be=m,Ie=T,Xe=_,je=R,Re=K,q%16===15)for(V=0;V<16;V++)x=e[V],G=a[V],J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=e[(V+9)%16],G=a[(V+9)%16],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,L=e[(V+1)%16],F=a[(V+1)%16],x=(L>>>1|F<<31)^(L>>>8|F<<24)^L>>>7,G=(F>>>1|L<<31)^(F>>>8|L<<24)^(F>>>7|L<<25),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,L=e[(V+14)%16],F=a[(V+14)%16],x=(L>>>19|F<<13)^(F>>>29|L<<3)^L>>>6,G=(F>>>19|L<<13)^(L>>>29|F<<3)^(F>>>6|L<<26),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,e[V]=N&65535|k<<16,a[V]=J&65535|U<<16;x=z,G=Re,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[0],G=t[0],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[0]=z=N&65535|k<<16,t[0]=Re=J&65535|U<<16,x=Ae,G=We,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[1],G=t[1],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[1]=Ae=N&65535|k<<16,t[1]=We=J&65535|U<<16,x=ie,G=ve,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[2],G=t[2],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[2]=ie=N&65535|k<<16,t[2]=ve=J&65535|U<<16,x=we,G=aA,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[3],G=t[3],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[3]=we=N&65535|k<<16,t[3]=aA=J&65535|U<<16,x=se,G=Be,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[4],G=t[4],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[4]=se=N&65535|k<<16,t[4]=Be=J&65535|U<<16,x=Te,G=Ie,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[5],G=t[5],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[5]=Te=N&65535|k<<16,t[5]=Ie=J&65535|U<<16,x=fe,G=Xe,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[6],G=t[6],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[6]=fe=N&65535|k<<16,t[6]=Xe=J&65535|U<<16,x=ke,G=je,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[7],G=t[7],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[7]=ke=N&65535|k<<16,t[7]=je=J&65535|U<<16,Oe+=128,i-=128}return i}function hB(n,t,o){var i=new Int32Array(8),e=new Int32Array(8),a=new Uint8Array(256),A,r=o;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,e[0]=4089235720,e[1]=2227873595,e[2]=4271175723,e[3]=1595750129,e[4]=2917565137,e[5]=725511199,e[6]=4215389547,e[7]=327033209,y9(i,e,t,o),o%=128,A=0;A=0;--e)i=o[e/8|0]>>(e&7)&1,m9(n,t,i),gF(t,n),gF(n,n),m9(n,t,i)}function Hw(n,t){var o=[dA(),dA(),dA(),dA()];Hc(o[0],C9),Hc(o[1],u9),Hc(o[2],oh),It(o[3],C9,u9),b9(n,o,t)}var nF=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function pF(n,t){var o,i,e,a;for(i=63;i>=32;--i){for(o=0,e=i-32,a=i-12;e>8,t[e]-=o*256;t[e]+=o,t[i]=0}for(o=0,e=0;e<32;e++)t[e]+=o-(t[31]>>4)*nF[e],o=t[e]>>8,t[e]&=255;for(e=0;e<32;e++)t[e]-=o*nF[e];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,n[i]=t[i]&255}function EB(n){var t=new Float64Array(64),o;for(o=0;o<64;o++)t[o]=n[o];for(o=0;o<64;o++)n[o]=0;pF(n,t)}function J2e(n,t,o,i){var e=new Uint8Array(64),a=new Uint8Array(64),A,r,s=new Float64Array(64),g=[dA(),dA(),dA(),dA()];for(A=0;A>7&&vn(n[0],sF,n[0]),It(n[3],n[0],n[1]),0)}function V2e(n,t,o,i){var e,a,A=new Uint8Array(32),r=new Uint8Array(64),s=[dA(),dA(),dA(),dA()],g=[dA(),dA(),dA(),dA()];if(a=-1,o<64||z2e(g,i))return-1;for(e=0;e=0}kg.verify=AUe;function tUe(n){if(Kc(n),n.length!==32)throw new Error("wrong seed length");for(var t=new Uint8Array(32),o=new Uint8Array(32),i=0;i<32;i++)t[i]=n[i];return j2e(o,t),t[0]&=248,t[31]&=127,t[31]|=64,o[31]&=127,{public:o,private:t}}kg.generateKeyPair=tUe;kg.default={}});var xc=$(gh=>{"use strict";var CB=_9(),sh=$e("crypto"),dF=Buffer.from([48,42,48,5,6,3,43,101,110,3,33,0]),hF=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]),rUe=Buffer.from([5]),EF=function(n){return Buffer.concat([rUe,n])};function T9(n){if(n===void 0)throw new Error("Undefined private key");if(!(n instanceof Buffer))throw new Error(`Invalid private key type: ${n.constructor.name}`);if(n.byteLength!=32)throw new Error(`Incorrect private key length: ${n.byteLength}`)}function N9(n){if(!(n instanceof Buffer))throw new Error(`Invalid public key type: ${n.constructor.name}`);if(n===void 0||(n.byteLength!=33||n[0]!=5)&&n.byteLength!=32)throw new Error("Invalid public key");return n.byteLength==33?n.slice(1):(console.error("WARNING: Expected pubkey of length 33, please report the ST and client that generated the pubkey"),n)}function aUe(n){let t=new Uint8Array(n);return t[0]|=6,t[31]|=128,t[31]&=-65,t}gh.getPublicFromPrivateKey=function(n){let t=aUe(n),o=CB.generateKeyPair(t);return EF(Buffer.from(o.public))};gh.generateKeyPair=function(){try{let{publicKey:n,privateKey:t}=sh.generateKeyPairSync("x25519",{publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}}),o=n.slice(dF.length,dF.length+32),i=t.slice(hF.length,hF.length+32);return{pubKey:EF(o),privKey:i}}catch{let t=CB.generateKeyPair(sh.randomBytes(32));return{privKey:Buffer.from(t.private),pubKey:EF(Buffer.from(t.public))}}};gh.calculateAgreement=function(n,t){if(n=N9(n),T9(t),!n||n.byteLength!=32)throw new Error("Invalid public key");if(typeof sh.diffieHellman=="function"){let o=sh.createPrivateKey({key:Buffer.concat([hF,t]),format:"der",type:"pkcs8"}),i=sh.createPublicKey({key:Buffer.concat([dF,n]),format:"der",type:"spki"});return sh.diffieHellman({privateKey:o,publicKey:i})}else{let o=CB.sharedKey(t,n);return Buffer.from(o)}};gh.calculateSignature=function(n,t){if(T9(n),!t)throw new Error("Invalid message");return Buffer.from(CB.sign(n,t))};gh.verifySignature=function(n,t,o,i){if(n=N9(n),!n||n.byteLength!=32)throw new Error("Invalid public key");if(!t)throw new Error("Invalid message");if(!o||o.byteLength!=64)throw new Error("Invalid signature");return i?!0:CB.verify(n,t,o)}});var k9=$(uB=>{var Kw=xc(),iUe=$e("crypto");function R9(n){return typeof n=="number"&&n%1===0&&n>=0}uB.generateIdentityKeyPair=Kw.generateKeyPair;uB.generateRegistrationId=function(){var n=Uint16Array.from(iUe.randomBytes(2))[0];return n&16383};uB.generateSignedPreKey=function(n,t){if(!(n.privKey instanceof Buffer)||n.privKey.byteLength!=32||!(n.pubKey instanceof Buffer)||n.pubKey.byteLength!=33)throw new TypeError("Invalid argument for identityKeyPair");if(!R9(t))throw new TypeError("Invalid argument for signedKeyId: "+t);let o=Kw.generateKeyPair(),i=Kw.calculateSignature(n.privKey,o.pubKey);return{keyId:t,keyPair:o,signature:i}};uB.generatePreKey=function(n){if(!R9(n))throw new TypeError("Invalid argument for keyId: "+n);let t=Kw.generateKeyPair();return{keyId:n,keyPair:t}}});var uF=$((rfA,v9)=>{var CF=class n{static from(t){if(typeof t!="string"||!t.match(/.*\.\d+/))throw new Error("Invalid address encoding");let o=t.split(".");return new this(o[0],parseInt(o[1]))}constructor(t,o){if(typeof t!="string")throw new TypeError("id required for addr");if(t.indexOf(".")!==-1)throw new TypeError("encoded addr detected");if(this.id=t,typeof o!="number")throw new TypeError("number required for deviceId");this.deviceId=o}toString(){return`${this.id}.${this.deviceId}`}is(t){return t instanceof n?t.id===this.id&&t.deviceId===this.deviceId:!1}};v9.exports=CF});var BF=$((afA,P9)=>{var oUe={OURS:1,THEIRS:2};P9.exports=oUe});var fF=$((ifA,G9)=>{var nUe={SENDING:1,RECEIVING:2};G9.exports=nUe});var Jw=$((ofA,L9)=>{var sUe=BF(),gUe=40,F9="v1";function Yw(n){if(!Buffer.isBuffer(n))throw new TypeError("Buffer required")}var jw=class{constructor(){this._chains={}}toString(){return``}inspect(){return this.toString()}addChain(t,o){Yw(t);let i=t.toString("base64");if(this._chains.hasOwnProperty(i))throw new Error("Overwrite attempt");this._chains[i]=o}getChain(t){return Yw(t),this._chains[t.toString("base64")]}deleteChain(t){Yw(t);let o=t.toString("base64");if(!this._chains.hasOwnProperty(o))throw new ReferenceError("Not Found");delete this._chains[o]}*chains(){for(let[t,o]of Object.entries(this._chains))yield[Buffer.from(t,"base64"),o]}serialize(){let t={registrationId:this.registrationId,currentRatchet:{ephemeralKeyPair:{pubKey:this.currentRatchet.ephemeralKeyPair.pubKey.toString("base64"),privKey:this.currentRatchet.ephemeralKeyPair.privKey.toString("base64")},lastRemoteEphemeralKey:this.currentRatchet.lastRemoteEphemeralKey.toString("base64"),previousCounter:this.currentRatchet.previousCounter,rootKey:this.currentRatchet.rootKey.toString("base64")},indexInfo:{baseKey:this.indexInfo.baseKey.toString("base64"),baseKeyType:this.indexInfo.baseKeyType,closed:this.indexInfo.closed,used:this.indexInfo.used,created:this.indexInfo.created,remoteIdentityKey:this.indexInfo.remoteIdentityKey.toString("base64")},_chains:this._serialize_chains(this._chains)};return this.pendingPreKey&&(t.pendingPreKey=Object.assign({},this.pendingPreKey),t.pendingPreKey.baseKey=this.pendingPreKey.baseKey.toString("base64")),t}static deserialize(t){let o=new this;return o.registrationId=t.registrationId,o.currentRatchet={ephemeralKeyPair:{pubKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.pubKey,"base64"),privKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.privKey,"base64")},lastRemoteEphemeralKey:Buffer.from(t.currentRatchet.lastRemoteEphemeralKey,"base64"),previousCounter:t.currentRatchet.previousCounter,rootKey:Buffer.from(t.currentRatchet.rootKey,"base64")},o.indexInfo={baseKey:Buffer.from(t.indexInfo.baseKey,"base64"),baseKeyType:t.indexInfo.baseKeyType,closed:t.indexInfo.closed,used:t.indexInfo.used,created:t.indexInfo.created,remoteIdentityKey:Buffer.from(t.indexInfo.remoteIdentityKey,"base64")},o._chains=this._deserialize_chains(t._chains),t.pendingPreKey&&(o.pendingPreKey=Object.assign({},t.pendingPreKey),o.pendingPreKey.baseKey=Buffer.from(t.pendingPreKey.baseKey,"base64")),o}_serialize_chains(t){let o={};for(let i of Object.keys(t)){let e=t[i],a={};for(let[A,r]of Object.entries(e.messageKeys))a[A]=r.toString("base64");o[i]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&e.chainKey.key.toString("base64")},chainType:e.chainType,messageKeys:a}}return o}static _deserialize_chains(t){let o={};for(let i of Object.keys(t)){let e=t[i],a={};for(let[A,r]of Object.entries(e.messageKeys))a[A]=Buffer.from(r,"base64");o[i]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&Buffer.from(e.chainKey.key,"base64")},chainType:e.chainType,messageKeys:a}}return o}},xw=[{version:"v1",migrate:function(t){let o=t._sessions;if(t.registrationId)for(let i in o)o[i].registrationId||(o[i].registrationId=t.registrationId);else for(let i in o)o[i].indexInfo.closed===-1&&console.error("V1 session storage migration error: registrationId",t.registrationId,"for open session version",t.version)}}],QF=class{static createEntry(){return new jw}static migrate(t){let o=t.version===void 0;for(let i=0;i{let i=t.indexInfo.used||0,e=o.indexInfo.used||0;return i===e?0:igUe;){let t,o;for(let[i,e]of Object.entries(this.sessions))e.indexInfo.closed!==-1&&(!o||e.indexInfo.closed{Os.SignalError=class extends Error{};Os.UntrustedIdentityKeyError=class extends Os.SignalError{constructor(t,o){super(),this.name="UntrustedIdentityKeyError",this.addr=t,this.identityKey=o}};Os.SessionError=class extends Os.SignalError{constructor(t){super(t),this.name="SessionError"}};Os.MessageCounterError=class extends Os.SessionError{constructor(t){super(t),this.name="MessageCounterError"}};Os.PreKeyError=class extends Os.SessionError{constructor(t){super(t),this.name="PreKeyError"}}});var yF=$((pfA,H9)=>{"use strict";var zw=new Map,U9=1e4;async function cUe(n,t){let o=0;for(;;){let i=Math.min(n.length,U9);for(let e=o;e=U9?(n.splice(0,i),o=0):o=i;else break}t()}H9.exports=function(n,t){t.name||(Object.defineProperty(t,"name",{writable:!0}),typeof n=="string"?t.name=n:console.warn("Unhandled bucket type (for naming):",typeof n,n));let o;zw.has(n)||(zw.set(n,[]),o=!0);let i=zw.get(n),e=new Promise((a,A)=>i.push({awaitable:t,resolve:a,reject:A}));return o&&cUe(i,()=>zw.delete(n)),e}});var SF=$((dfA,j9)=>{"use strict";var K9=BF(),IUe=fF(),x9=Jw(),Y9=Nl(),Yc=xc(),Vw=qw(),lUe=yF(),mF=class{constructor(t,o){this.addr=o,this.storage=t}async initOutgoing(t){let o=this.addr.toString();return await lUe(o,async()=>{if(!await this.storage.isTrustedIdentity(this.addr.id,t.identityKey))throw new Vw.UntrustedIdentityKeyError(this.addr.id,t.identityKey);Yc.verifySignature(t.identityKey,t.signedPreKey.publicKey,t.signedPreKey.signature,!0);let i=Yc.generateKeyPair(),e=t.preKey&&t.preKey.publicKey,a=await this.initSession(!0,i,void 0,t.identityKey,e,t.signedPreKey.publicKey,t.registrationId);a.pendingPreKey={signedKeyId:t.signedPreKey.keyId,baseKey:i.pubKey},t.preKey&&(a.pendingPreKey.preKeyId=t.preKey.keyId);let A=await this.storage.loadSession(o);if(!A)A=new x9;else{let r=A.getOpenSession();r&&A.closeSession(r)}A.setSession(a),await this.storage.storeSession(o,A)})}async initIncoming(t,o){let i=this.addr.toString();if(!await this.storage.isTrustedIdentity(i,o.identityKey))throw new Vw.UntrustedIdentityKeyError(this.addr.id,o.identityKey);if(t.getSession(o.baseKey))return;let e=await this.storage.loadPreKey(o.preKeyId);if(o.preKeyId&&!e)throw new Vw.PreKeyError("Invalid PreKey ID");let a=await this.storage.loadSignedPreKey(o.signedPreKeyId);if(!a)throw new Vw.PreKeyError("Missing SignedPreKey");let A=t.getOpenSession();return A&&(console.warn("Closing open session in favor of incoming prekey bundle"),t.closeSession(A)),t.setSession(await this.initSession(!1,e,a,o.identityKey,o.baseKey,void 0,o.registrationId)),o.preKeyId}async initSession(t,o,i,e,a,A,r){if(t){if(i)throw new Error("Invalid call to initSession");i=o}else{if(A)throw new Error("Invalid call to initSession");A=a}let s;!o||!a?s=new Uint8Array(128):s=new Uint8Array(160);for(var g=0;g<32;g++)s[g]=255;let c=await this.storage.getOurIdentity(),I=Yc.calculateAgreement(A,c.privKey),d=Yc.calculateAgreement(e,i.privKey),B=Yc.calculateAgreement(A,i.privKey);if(t?(s.set(new Uint8Array(I),32),s.set(new Uint8Array(d),64)):(s.set(new Uint8Array(I),64),s.set(new Uint8Array(d),32)),s.set(new Uint8Array(B),96),o&&a){let y=Yc.calculateAgreement(a,o.privKey);s.set(new Uint8Array(y),128)}let f=Y9.deriveSecrets(Buffer.from(s),Buffer.alloc(32),Buffer.from("WhisperText")),Q=x9.createEntry();return Q.registrationId=r,Q.currentRatchet={rootKey:f[0],ephemeralKeyPair:t?Yc.generateKeyPair():i,lastRemoteEphemeralKey:A,previousCounter:0},Q.indexInfo={created:Date.now(),used:Date.now(),remoteIdentityKey:e,baseKey:t?o.pubKey:a,baseKeyType:t?K9.OURS:K9.THEIRS,closed:-1},t&&this.calculateSendingRatchet(Q,A),Q}calculateSendingRatchet(t,o){let i=t.currentRatchet,e=Yc.calculateAgreement(o,i.ephemeralKeyPair.privKey),a=Y9.deriveSecrets(e,i.rootKey,Buffer.from("WhisperRatchet"));t.addChain(i.ephemeralKeyPair.pubKey,{messageKeys:{},chainKey:{counter:-1,key:a[1]},chainType:IUe.SENDING}),i.rootKey=a[0]}};j9.exports=mF});var q9=$((hfA,J9)=>{"use strict";var jc=Rm(),zo=jc.Reader,wF=jc.Writer,nA=jc.util,Pn=jc.roots.default||(jc.roots.default={});Pn.textsecure=(function(){var n={};return n.WhisperMessage=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:A.ephemeralKey=i.bytes();break;case 2:A.counter=i.uint32();break;case 3:A.previousCounter=i.uint32();break;case 4:A.ciphertext=i.bytes();break;default:i.skipType(r&7);break}}return A},t.decodeDelimited=function(i){return i instanceof zo||(i=new zo(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&!(i.ephemeralKey&&typeof i.ephemeralKey.length=="number"||nA.isString(i.ephemeralKey))?"ephemeralKey: buffer expected":i.counter!=null&&i.hasOwnProperty("counter")&&!nA.isInteger(i.counter)?"counter: integer expected":i.previousCounter!=null&&i.hasOwnProperty("previousCounter")&&!nA.isInteger(i.previousCounter)?"previousCounter: integer expected":i.ciphertext!=null&&i.hasOwnProperty("ciphertext")&&!(i.ciphertext&&typeof i.ciphertext.length=="number"||nA.isString(i.ciphertext))?"ciphertext: buffer expected":null},t.fromObject=function(i){if(i instanceof Pn.textsecure.WhisperMessage)return i;var e=new Pn.textsecure.WhisperMessage;return i.ephemeralKey!=null&&(typeof i.ephemeralKey=="string"?nA.base64.decode(i.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(i.ephemeralKey)),0):i.ephemeralKey.length&&(e.ephemeralKey=i.ephemeralKey)),i.counter!=null&&(e.counter=i.counter>>>0),i.previousCounter!=null&&(e.previousCounter=i.previousCounter>>>0),i.ciphertext!=null&&(typeof i.ciphertext=="string"?nA.base64.decode(i.ciphertext,e.ciphertext=nA.newBuffer(nA.base64.length(i.ciphertext)),0):i.ciphertext.length&&(e.ciphertext=i.ciphertext)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(e.bytes===String?a.ephemeralKey="":(a.ephemeralKey=[],e.bytes!==Array&&(a.ephemeralKey=nA.newBuffer(a.ephemeralKey))),a.counter=0,a.previousCounter=0,e.bytes===String?a.ciphertext="":(a.ciphertext=[],e.bytes!==Array&&(a.ciphertext=nA.newBuffer(a.ciphertext)))),i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&(a.ephemeralKey=e.bytes===String?nA.base64.encode(i.ephemeralKey,0,i.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(i.ephemeralKey):i.ephemeralKey),i.counter!=null&&i.hasOwnProperty("counter")&&(a.counter=i.counter),i.previousCounter!=null&&i.hasOwnProperty("previousCounter")&&(a.previousCounter=i.previousCounter),i.ciphertext!=null&&i.hasOwnProperty("ciphertext")&&(a.ciphertext=e.bytes===String?nA.base64.encode(i.ciphertext,0,i.ciphertext.length):e.bytes===Array?Array.prototype.slice.call(i.ciphertext):i.ciphertext),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,jc.util.toJSONOptions)},t})(),n.PreKeyWhisperMessage=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 5:A.registrationId=i.uint32();break;case 1:A.preKeyId=i.uint32();break;case 6:A.signedPreKeyId=i.uint32();break;case 2:A.baseKey=i.bytes();break;case 3:A.identityKey=i.bytes();break;case 4:A.message=i.bytes();break;default:i.skipType(r&7);break}}return A},t.decodeDelimited=function(i){return i instanceof zo||(i=new zo(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":i.registrationId!=null&&i.hasOwnProperty("registrationId")&&!nA.isInteger(i.registrationId)?"registrationId: integer expected":i.preKeyId!=null&&i.hasOwnProperty("preKeyId")&&!nA.isInteger(i.preKeyId)?"preKeyId: integer expected":i.signedPreKeyId!=null&&i.hasOwnProperty("signedPreKeyId")&&!nA.isInteger(i.signedPreKeyId)?"signedPreKeyId: integer expected":i.baseKey!=null&&i.hasOwnProperty("baseKey")&&!(i.baseKey&&typeof i.baseKey.length=="number"||nA.isString(i.baseKey))?"baseKey: buffer expected":i.identityKey!=null&&i.hasOwnProperty("identityKey")&&!(i.identityKey&&typeof i.identityKey.length=="number"||nA.isString(i.identityKey))?"identityKey: buffer expected":i.message!=null&&i.hasOwnProperty("message")&&!(i.message&&typeof i.message.length=="number"||nA.isString(i.message))?"message: buffer expected":null},t.fromObject=function(i){if(i instanceof Pn.textsecure.PreKeyWhisperMessage)return i;var e=new Pn.textsecure.PreKeyWhisperMessage;return i.registrationId!=null&&(e.registrationId=i.registrationId>>>0),i.preKeyId!=null&&(e.preKeyId=i.preKeyId>>>0),i.signedPreKeyId!=null&&(e.signedPreKeyId=i.signedPreKeyId>>>0),i.baseKey!=null&&(typeof i.baseKey=="string"?nA.base64.decode(i.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(i.baseKey)),0):i.baseKey.length&&(e.baseKey=i.baseKey)),i.identityKey!=null&&(typeof i.identityKey=="string"?nA.base64.decode(i.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(i.identityKey)),0):i.identityKey.length&&(e.identityKey=i.identityKey)),i.message!=null&&(typeof i.message=="string"?nA.base64.decode(i.message,e.message=nA.newBuffer(nA.base64.length(i.message)),0):i.message.length&&(e.message=i.message)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.preKeyId=0,e.bytes===String?a.baseKey="":(a.baseKey=[],e.bytes!==Array&&(a.baseKey=nA.newBuffer(a.baseKey))),e.bytes===String?a.identityKey="":(a.identityKey=[],e.bytes!==Array&&(a.identityKey=nA.newBuffer(a.identityKey))),e.bytes===String?a.message="":(a.message=[],e.bytes!==Array&&(a.message=nA.newBuffer(a.message))),a.registrationId=0,a.signedPreKeyId=0),i.preKeyId!=null&&i.hasOwnProperty("preKeyId")&&(a.preKeyId=i.preKeyId),i.baseKey!=null&&i.hasOwnProperty("baseKey")&&(a.baseKey=e.bytes===String?nA.base64.encode(i.baseKey,0,i.baseKey.length):e.bytes===Array?Array.prototype.slice.call(i.baseKey):i.baseKey),i.identityKey!=null&&i.hasOwnProperty("identityKey")&&(a.identityKey=e.bytes===String?nA.base64.encode(i.identityKey,0,i.identityKey.length):e.bytes===Array?Array.prototype.slice.call(i.identityKey):i.identityKey),i.message!=null&&i.hasOwnProperty("message")&&(a.message=e.bytes===String?nA.base64.encode(i.message,0,i.message.length):e.bytes===Array?Array.prototype.slice.call(i.message):i.message),i.registrationId!=null&&i.hasOwnProperty("registrationId")&&(a.registrationId=i.registrationId),i.signedPreKeyId!=null&&i.hasOwnProperty("signedPreKeyId")&&(a.signedPreKeyId=i.signedPreKeyId),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,jc.util.toJSONOptions)},t})(),n.KeyExchangeMessage=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:A.id=i.uint32();break;case 2:A.baseKey=i.bytes();break;case 3:A.ephemeralKey=i.bytes();break;case 4:A.identityKey=i.bytes();break;case 5:A.baseKeySignature=i.bytes();break;default:i.skipType(r&7);break}}return A},t.decodeDelimited=function(i){return i instanceof zo||(i=new zo(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":i.id!=null&&i.hasOwnProperty("id")&&!nA.isInteger(i.id)?"id: integer expected":i.baseKey!=null&&i.hasOwnProperty("baseKey")&&!(i.baseKey&&typeof i.baseKey.length=="number"||nA.isString(i.baseKey))?"baseKey: buffer expected":i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&!(i.ephemeralKey&&typeof i.ephemeralKey.length=="number"||nA.isString(i.ephemeralKey))?"ephemeralKey: buffer expected":i.identityKey!=null&&i.hasOwnProperty("identityKey")&&!(i.identityKey&&typeof i.identityKey.length=="number"||nA.isString(i.identityKey))?"identityKey: buffer expected":i.baseKeySignature!=null&&i.hasOwnProperty("baseKeySignature")&&!(i.baseKeySignature&&typeof i.baseKeySignature.length=="number"||nA.isString(i.baseKeySignature))?"baseKeySignature: buffer expected":null},t.fromObject=function(i){if(i instanceof Pn.textsecure.KeyExchangeMessage)return i;var e=new Pn.textsecure.KeyExchangeMessage;return i.id!=null&&(e.id=i.id>>>0),i.baseKey!=null&&(typeof i.baseKey=="string"?nA.base64.decode(i.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(i.baseKey)),0):i.baseKey.length&&(e.baseKey=i.baseKey)),i.ephemeralKey!=null&&(typeof i.ephemeralKey=="string"?nA.base64.decode(i.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(i.ephemeralKey)),0):i.ephemeralKey.length&&(e.ephemeralKey=i.ephemeralKey)),i.identityKey!=null&&(typeof i.identityKey=="string"?nA.base64.decode(i.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(i.identityKey)),0):i.identityKey.length&&(e.identityKey=i.identityKey)),i.baseKeySignature!=null&&(typeof i.baseKeySignature=="string"?nA.base64.decode(i.baseKeySignature,e.baseKeySignature=nA.newBuffer(nA.base64.length(i.baseKeySignature)),0):i.baseKeySignature.length&&(e.baseKeySignature=i.baseKeySignature)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.id=0,e.bytes===String?a.baseKey="":(a.baseKey=[],e.bytes!==Array&&(a.baseKey=nA.newBuffer(a.baseKey))),e.bytes===String?a.ephemeralKey="":(a.ephemeralKey=[],e.bytes!==Array&&(a.ephemeralKey=nA.newBuffer(a.ephemeralKey))),e.bytes===String?a.identityKey="":(a.identityKey=[],e.bytes!==Array&&(a.identityKey=nA.newBuffer(a.identityKey))),e.bytes===String?a.baseKeySignature="":(a.baseKeySignature=[],e.bytes!==Array&&(a.baseKeySignature=nA.newBuffer(a.baseKeySignature)))),i.id!=null&&i.hasOwnProperty("id")&&(a.id=i.id),i.baseKey!=null&&i.hasOwnProperty("baseKey")&&(a.baseKey=e.bytes===String?nA.base64.encode(i.baseKey,0,i.baseKey.length):e.bytes===Array?Array.prototype.slice.call(i.baseKey):i.baseKey),i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&(a.ephemeralKey=e.bytes===String?nA.base64.encode(i.ephemeralKey,0,i.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(i.ephemeralKey):i.ephemeralKey),i.identityKey!=null&&i.hasOwnProperty("identityKey")&&(a.identityKey=e.bytes===String?nA.base64.encode(i.identityKey,0,i.identityKey.length):e.bytes===Array?Array.prototype.slice.call(i.identityKey):i.identityKey),i.baseKeySignature!=null&&i.hasOwnProperty("baseKeySignature")&&(a.baseKeySignature=e.bytes===String?nA.base64.encode(i.baseKeySignature,0,i.baseKeySignature.length):e.bytes===Array?Array.prototype.slice.call(i.baseKeySignature):i.baseKeySignature),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,jc.util.toJSONOptions)},t})(),n})();J9.exports=Pn});var DF=$((EfA,z9)=>{"use strict";var{textsecure:{WhisperMessage:pUe,PreKeyWhisperMessage:dUe}}=q9();z9.exports={WhisperMessage:pUe,PreKeyWhisperMessage:dUe}});var X9=$((CfA,Z9)=>{var Ww=fF(),hUe=uF(),EUe=SF(),V9=Jw(),vg=Nl(),W9=xc(),bs=qw(),ch=DF(),CUe=yF(),Jc=3;function Zw(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}var OF=class{constructor(t,o){if(!(o instanceof hUe))throw new TypeError("protocolAddress must be a ProtocolAddress");this.addr=o,this.storage=t}_encodeTupleByte(t,o){if(t>15||o>15)throw TypeError("Numbers must be 4 bits or less");return t<<4|o}_decodeTupleByte(t){return[t>>4,t&15]}toString(){return``}async getRecord(){let t=await this.storage.loadSession(this.addr.toString());if(t&&!(t instanceof V9))throw new TypeError("SessionRecord type expected from loadSession");return t}async storeRecord(t){t.removeOldSessions(),await this.storage.storeSession(this.addr.toString(),t)}async queueJob(t){return await CUe(this.addr.toString(),t)}async encrypt(t){Zw(t);let o=await this.storage.getOurIdentity();return await this.queueJob(async()=>{let i=await this.getRecord();if(!i)throw new bs.SessionError("No sessions");let e=i.getOpenSession();if(!e)throw new bs.SessionError("No open session");let a=e.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,a))throw new bs.UntrustedIdentityKeyError(this.addr.id,a);let A=e.getChain(e.currentRatchet.ephemeralKeyPair.pubKey);if(A.chainType===Ww.RECEIVING)throw new Error("Tried to encrypt on a receiving chain");this.fillMessageKeys(A,A.chainKey.counter+1);let r=vg.deriveSecrets(A.messageKeys[A.chainKey.counter],Buffer.alloc(32),Buffer.from("WhisperMessageKeys"));delete A.messageKeys[A.chainKey.counter];let s=ch.WhisperMessage.create();s.ephemeralKey=e.currentRatchet.ephemeralKeyPair.pubKey,s.counter=A.chainKey.counter,s.previousCounter=e.currentRatchet.previousCounter,s.ciphertext=vg.encrypt(r[0],t,r[2].slice(0,16));let g=ch.WhisperMessage.encode(s).finish(),c=Buffer.alloc(g.byteLength+66+1);c.set(o.pubKey),c.set(e.indexInfo.remoteIdentityKey,33),c[66]=this._encodeTupleByte(Jc,Jc),c.set(g,67);let I=vg.calculateMAC(r[1],c),d=Buffer.alloc(g.byteLength+9);d[0]=this._encodeTupleByte(Jc,Jc),d.set(g,1),d.set(I.slice(0,8),g.byteLength+1),await this.storeRecord(i);let B,f;if(e.pendingPreKey){B=3;let Q=ch.PreKeyWhisperMessage.create({identityKey:o.pubKey,registrationId:await this.storage.getOurRegistrationId(),baseKey:e.pendingPreKey.baseKey,signedPreKeyId:e.pendingPreKey.signedKeyId,message:d});e.pendingPreKey.preKeyId&&(Q.preKeyId=e.pendingPreKey.preKeyId),f=Buffer.concat([Buffer.from([this._encodeTupleByte(Jc,Jc)]),Buffer.from(ch.PreKeyWhisperMessage.encode(Q).finish())])}else B=1,f=d;return{type:B,body:f,registrationId:e.registrationId}})}async decryptWithSessions(t,o){if(!o.length)throw new bs.SessionError("No sessions available");let i=[];for(let e of o){let a;try{return a=await this.doDecryptWhisperMessage(t,e),e.indexInfo.used=Date.now(),{session:e,plaintext:a}}catch(A){i.push(A)}}console.error("Failed to decrypt message with any known session...");for(let e of i)console.error("Session error:"+e,e.stack);throw new bs.SessionError("No matching sessions found for message")}async decryptWhisperMessage(t){return Zw(t),await this.queueJob(async()=>{let o=await this.getRecord();if(!o)throw new bs.SessionError("No session record");let i=await this.decryptWithSessions(t,o.getSessions()),e=i.session.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,e))throw new bs.UntrustedIdentityKeyError(this.addr.id,e);return o.isClosed(i.session)&&console.warn("Decrypted message with closed session."),await this.storeRecord(o),i.plaintext})}async decryptPreKeyWhisperMessage(t){Zw(t);let o=this._decodeTupleByte(t[0]);if(o[1]>3||o[0]<3)throw new Error("Incompatible version number on PreKeyWhisperMessage");return await this.queueJob(async()=>{let i=await this.getRecord(),e=ch.PreKeyWhisperMessage.decode(t.slice(1));if(!i){if(e.registrationId==null)throw new Error("No registrationId");i=new V9}let A=await new EUe(this.storage,this.addr).initIncoming(i,e),r=i.getSession(e.baseKey),s=await this.doDecryptWhisperMessage(e.message,r);return await this.storeRecord(i),A&&await this.storage.removePreKey(A),s})}async doDecryptWhisperMessage(t,o){if(Zw(t),!o)throw new TypeError("session required");let i=this._decodeTupleByte(t[0]);if(i[1]>3||i[0]<3)throw new Error("Incompatible version number on WhisperMessage");let e=t.slice(1,-8),a=ch.WhisperMessage.decode(e);this.maybeStepRatchet(o,a.ephemeralKey,a.previousCounter);let A=o.getChain(a.ephemeralKey);if(A.chainType===Ww.SENDING)throw new Error("Tried to decrypt on a sending chain");if(this.fillMessageKeys(A,a.counter),!A.messageKeys.hasOwnProperty(a.counter))throw new bs.MessageCounterError("Key used already or never filled");let r=A.messageKeys[a.counter];delete A.messageKeys[a.counter];let s=vg.deriveSecrets(r,Buffer.alloc(32),Buffer.from("WhisperMessageKeys")),g=await this.storage.getOurIdentity(),c=Buffer.alloc(e.byteLength+66+1);c.set(o.indexInfo.remoteIdentityKey),c.set(g.pubKey,33),c[66]=this._encodeTupleByte(Jc,Jc),c.set(e,67),vg.verifyMAC(c,s[1],t.slice(-8),8);let I=vg.decrypt(s[0],a.ciphertext,s[2].slice(0,16));return delete o.pendingPreKey,I}fillMessageKeys(t,o){if(t.chainKey.counter>=o)return;if(o-t.chainKey.counter>2e3)throw new bs.SessionError("Over 2000 messages into the future!");if(t.chainKey.key===void 0)throw new bs.SessionError("Chain closed");let i=t.chainKey.key;return t.messageKeys[t.chainKey.counter+1]=vg.calculateMAC(i,Buffer.from([1])),t.chainKey.key=vg.calculateMAC(i,Buffer.from([2])),t.chainKey.counter+=1,this.fillMessageKeys(t,o)}maybeStepRatchet(t,o,i){if(t.getChain(o))return;let e=t.currentRatchet,a=t.getChain(e.lastRemoteEphemeralKey);a&&(this.fillMessageKeys(a,i),delete a.chainKey.key),this.calculateRatchet(t,o,!1);let A=t.getChain(e.ephemeralKeyPair.pubKey);A&&(e.previousCounter=A.chainKey.counter,t.deleteChain(e.ephemeralKeyPair.pubKey)),e.ephemeralKeyPair=W9.generateKeyPair(),this.calculateRatchet(t,o,!0),e.lastRemoteEphemeralKey=o}calculateRatchet(t,o,i){let e=t.currentRatchet,a=W9.calculateAgreement(o,e.ephemeralKeyPair.privKey),A=vg.deriveSecrets(a,e.rootKey,Buffer.from("WhisperRatchet"),2),r=i?e.ephemeralKeyPair.pubKey:o;t.addChain(r,{messageKeys:{},chainKey:{counter:-1,key:A[1]},chainType:i?Ww.SENDING:Ww.RECEIVING}),e.rootKey=A[0]}async hasOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();return t?t.haveOpenSession():!1})}async closeOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();if(t){let o=t.getOpenSession();o&&(t.closeSession(o),await this.storeRecord(t))}})}};Z9.exports=OF});var $9=$(Pg=>{"use strict";Pg.crypto=Nl();Pg.curve=xc();Pg.keyhelper=k9();Pg.ProtocolAddress=uF();Pg.SessionBuilder=SF();Pg.SessionCipher=X9();Pg.SessionRecord=Jw();Object.assign(Pg,qw())});var MF=$((yfA,aX)=>{"use strict";aX.exports=function(...n){try{return JSON.stringify(...n)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var _F=$((iX,oX)=>{"use strict";var SUe=MF();oX.exports=class extends Error{constructor(n){let t=n.filter(o=>o!=="").map(o=>typeof o=="string"?o:o instanceof Error?o.message:SUe(o));super(t.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,iX.assert)}}});var Rl=$((SfA,nX)=>{"use strict";var wUe=_F();nX.exports=function(n,...t){if(!n)throw t.length===1&&t[0]instanceof Error?t[0]:new wUe(t)}});var QB=$((wfA,gX)=>{"use strict";var TF=Rl(),sX={};gX.exports=function(n,t,o){if(t===!1||t===null||t===void 0)return n;o=o||{},typeof o=="string"&&(o={separator:o});let i=Array.isArray(t);TF(!i||!o.separator,"Separator option is not valid for array-based chain");let e=i?t:t.split(o.separator||"."),a=n;for(let A=0;A{"use strict";var cX={};di=IX.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};cX.typeMap=new Map([["[object Error]",di.error],["[object Map]",di.map],["[object Promise]",di.promise],["[object Set]",di.set],["[object WeakMap]",di.weakMap],["[object WeakSet]",di.weakSet]]);di.getInternalProto=function(n){if(Array.isArray(n))return di.array;if(Buffer&&n instanceof Buffer)return di.buffer;if(n instanceof Date)return di.date;if(n instanceof RegExp)return di.regex;if(n instanceof Error)return di.error;let t=Object.prototype.toString.call(n);return cX.typeMap.get(t)||di.generic}});var $w=$(lX=>{"use strict";lX.keys=function(n,t={}){return t.symbols!==!1?Reflect.ownKeys(n):Object.getOwnPropertyNames(n)}});var eD=$((OfA,pX)=>{"use strict";var DUe=QB(),po=NF(),OUe=$w(),Fg={needsProtoHack:new Set([po.set,po.map,po.weakSet,po.weakMap])};pX.exports=Fg.clone=function(n,t={},o=null){if(typeof n!="object"||n===null)return n;let i=Fg.clone,e=o;if(t.shallow){if(t.shallow!==!0)return Fg.cloneWithShallow(n,t);i=s=>s}else if(e){let s=e.get(n);if(s)return s}else e=new Map;let a=po.getInternalProto(n);if(a===po.buffer)return Buffer&&Buffer.from(n);if(a===po.date)return new Date(n.getTime());if(a===po.regex)return new RegExp(n);let A=Fg.base(n,a,t);if(A===n)return n;if(e&&e.set(n,A),a===po.set)for(let s of n)A.add(i(s,t,e));else if(a===po.map)for(let[s,g]of n)A.set(s,i(g,t,e));let r=OUe.keys(n,t);for(let s of r){if(s==="__proto__")continue;if(a===po.array&&s==="length"){A.length=n.length;continue}let g=Object.getOwnPropertyDescriptor(n,s);g?g.get||g.set?Object.defineProperty(A,s,g):g.enumerable?A[s]=i(n[s],t,e):Object.defineProperty(A,s,{enumerable:!1,writable:!0,configurable:!0,value:i(n[s],t,e)}):Object.defineProperty(A,s,{enumerable:!0,writable:!0,configurable:!0,value:i(n[s],t,e)})}return A};Fg.cloneWithShallow=function(n,t){let o=t.shallow;t=Object.assign({},t),t.shallow=!1;let i=new Map;for(let e of o){let a=DUe(n,e);(typeof a=="object"||typeof a=="function")&&i.set(a,a)}return Fg.clone(n,t,i)};Fg.base=function(n,t,o){if(o.prototype===!1)return Fg.needsProtoHack.has(t)?new t.constructor:t===po.array?[]:{};let i=Object.getPrototypeOf(n);if(i&&i.isImmutable)return n;if(t===po.array){let e=[];return i!==t&&Object.setPrototypeOf(e,i),e}if(Fg.needsProtoHack.has(t)){let e=new i.constructor;return i!==t&&Object.setPrototypeOf(e,i),e}return Object.create(i)}});var kF=$((bfA,EX)=>{"use strict";var RF=Rl(),dX=eD(),bUe=$w(),hX={};EX.exports=hX.merge=function(n,t,o){if(RF(n&&typeof n=="object","Invalid target value: must be an object"),RF(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return n;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(t)){RF(Array.isArray(n),"Cannot merge array onto an object"),o.mergeArrays||(n.length=0);for(let e=0;e{"use strict";var AD=Rl(),uX=eD(),BX=kF(),CX=QB(),tD={};fX.exports=function(n,t,o={}){if(AD(n&&typeof n=="object","Invalid defaults value: must be an object"),AD(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),AD(typeof o=="object","Invalid options: must be an object"),!t)return null;if(o.shallow)return tD.applyToDefaultsWithShallow(n,t,o);let i=uX(n);if(t===!0)return i;let e=o.nullOverride!==void 0?o.nullOverride:!1;return BX(i,t,{nullOverride:e,mergeArrays:!1})};tD.applyToDefaultsWithShallow=function(n,t,o){let i=o.shallow;AD(Array.isArray(i),"Invalid keys");let e=new Map,a=t===!0?null:new Set;for(let s of i){s=Array.isArray(s)?s:s.split(".");let g=CX(n,s);g&&typeof g=="object"?e.set(g,a&&CX(t,s)||g):a&&a.add(s)}let A=uX(n,{},e);if(!a)return A;for(let s of a)tD.reachCopy(A,t,s);let r=o.nullOverride!==void 0?o.nullOverride:!1;return BX(A,t,{nullOverride:r,mergeArrays:!1})};tD.reachCopy=function(n,t,o){for(let a of o){if(!(a in t))return;let A=t[a];if(typeof A!="object"||A===null)return;t=A}let i=t,e=n;for(let a=0;a{"use strict";var vF={};yX.exports=vF.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=vF.Bench.now()}elapsed(){return vF.Bench.now()-this.ts}static now(){let n=process.hrtime();return n[0]*1e3+n[1]/1e6}}});var PF=$((NfA,SX)=>{"use strict";SX.exports=function(){}});var DX=$((RfA,wX)=>{"use strict";var MUe=PF();wX.exports=function(){return new Promise(MUe)}});var GF=$((kfA,OX)=>{"use strict";var Ms=NF(),ai={mismatched:null};OX.exports=function(n,t,o){return o=Object.assign({prototype:!0},o),!!ai.isDeepEqual(n,t,o,[])};ai.isDeepEqual=function(n,t,o,i){if(n===t)return n!==0||1/n===1/t;let e=typeof n;if(e!==typeof t||n===null||t===null)return!1;if(e==="function"){if(!o.deepFunction||n.toString()!==t.toString())return!1}else if(e!=="object")return n!==n&&t!==t;let a=ai.getSharedType(n,t,!!o.prototype);switch(a){case Ms.buffer:return Buffer&&Buffer.prototype.equals.call(n,t);case Ms.promise:return n===t;case Ms.regex:return n.toString()===t.toString();case ai.mismatched:return!1}for(let A=i.length-1;A>=0;--A)if(i[A].isSame(n,t))return!0;i.push(new ai.SeenEntry(n,t));try{return!!ai.isDeepEqualObj(a,n,t,o,i)}finally{i.pop()}};ai.getSharedType=function(n,t,o){if(o)return Object.getPrototypeOf(n)!==Object.getPrototypeOf(t)?ai.mismatched:Ms.getInternalProto(n);let i=Ms.getInternalProto(n);return i!==Ms.getInternalProto(t)?ai.mismatched:i};ai.valueOf=function(n){let t=n.valueOf;if(t===void 0)return n;try{return t.call(n)}catch(o){return o}};ai.hasOwnEnumerableProperty=function(n,t){return Object.prototype.propertyIsEnumerable.call(n,t)};ai.isSetSimpleEqual=function(n,t){for(let o of Set.prototype.values.call(n))if(!Set.prototype.has.call(t,o))return!1;return!0};ai.isDeepEqualObj=function(n,t,o,i,e){let{isDeepEqual:a,valueOf:A,hasOwnEnumerableProperty:r}=ai,{keys:s,getOwnPropertySymbols:g}=Object;if(n===Ms.array)if(i.part){for(let f of t)for(let Q of o)if(a(f,Q,i,e))return!0}else{if(t.length!==o.length)return!1;for(let f=0;f{"use strict";bX.exports=function(n){return n.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var _X=$((GfA,MX)=>{"use strict";var rD=Rl(),_Ue=GF(),TUe=FF(),NUe=$w(),ho={};MX.exports=function(n,t,o={}){return typeof t!="object"&&(t=[t]),rD(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof n=="string"?ho.string(n,t,o):Array.isArray(n)?ho.array(n,t,o):(rD(typeof n=="object","Reference must be string or an object"),ho.object(n,t,o))};ho.array=function(n,t,o){if(Array.isArray(t)||(t=[t]),!n.length||o.only&&o.once&&n.length!==t.length)return!1;let i,e=new Map;for(let A of t)if(!o.deep||!A||typeof A!="object"){let r=e.get(A);r?++r.allowed:e.set(A,{allowed:1,hits:0})}else{i=i||ho.compare(o);let r=!1;for(let[s,g]of e.entries())if(i(s,A)){++g.allowed,r=!0;break}r||e.set(A,{allowed:1,hits:0})}let a=0;for(let A of n){let r;if(!o.deep||!A||typeof A!="object")r=e.get(A);else{i=i||ho.compare(o);for(let[s,g]of e.entries())if(i(s,A)){r=g;break}}if(r&&(++r.hits,++a,o.once&&r.hits>r.allowed))return!1}if(o.only&&a!==n.length)return!1;for(let A of e.values())if(A.hits!==A.allowed&&A.hitst.propertyIsEnumerable(s)),a=[...Object.keys(t),...e],A=ho.compare(o),r=new Set(a);for(let s of i){if(!r.has(s)){if(o.only)return!1;continue}if(!A(t[s],n[s]))return!1;r.delete(s)}return r.size?o.part?r.sizes!=="");let i=new Map,e=[];for(let s of t)if(rD(typeof s=="string","Cannot compare string reference to non-string value"),s){let g=i.get(s);g?++g.allowed:(i.set(s,{allowed:1,hits:0}),e.push(TUe(s)))}else if(o.once||o.only)return!1;if(!e.length)return!0;let a=new RegExp(`(${e.join("|")})`,"g"),A=n.replace(a,(s,g)=>(++i.get(g).hits,""));if(o.only&&A)return!1;let r=!1;for(let s of i.values())if(s.hits&&(r=!0),s.hits!==s.allowed&&(s.hits_Ue(e,a,i)};ho.shallow=function(n,t){return n===t}});var NX=$((FfA,TX)=>{"use strict";var RUe=Rl();TX.exports=function(n){return RUe(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(n),"Bad attribute value ("+n+")"),n.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var kX=$((LfA,RX)=>{"use strict";var zc={};RX.exports=function(n){if(!n)return"";let t="";for(let o=0;o=256?"&#"+n+";":`&#x${n.toString(16).padStart(2,"0")};`)};zc.isSafe=function(n){return zc.safeCharCodes.has(n)};zc.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);zc.safeCharCodes=(function(){let n=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&n.add(t);return n})()});var PX=$((UfA,vX)=>{"use strict";var aD={};vX.exports=function(n){return n?n.replace(/[<>&\u2028\u2029]/g,aD.escape):""};aD.escape=function(n){return aD.replacements.get(n)};aD.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var LX=$((HfA,FX)=>{"use strict";var GX={};FX.exports=GX.flatten=function(n,t){let o=t||[];for(let i of n)Array.isArray(i)?GX.flatten(i,o):o.push(i);return o}});var KX=$((KfA,HX)=>{"use strict";var UX={};HX.exports=function(n,t,o={}){if(!n||!t)return o.first?null:[];let i=[],e=Array.isArray(n)?new Set(n):n,a=new Set;for(let A of t)if(UX.has(e,A)&&!a.has(A)){if(o.first)return A;i.push(A),a.add(A)}return o.first?null:i};UX.has=function(n,t){return typeof n.has=="function"?n.has(t):n[t]!==void 0}});var YX=$((xfA,xX)=>{"use strict";xX.exports=function(n){return!!n&&typeof n.then=="function"}});var qX=$((YfA,JX)=>{"use strict";var jX={wrapped:Symbol("wrapped")};JX.exports=function(n){if(n[jX.wrapped])return n;let t=!1,o=function(...i){t||(t=!0,n(...i))};return o[jX.wrapped]=!0,o}});var VX=$((jfA,zX)=>{"use strict";var kUe=QB();zX.exports=function(n,t,o){return t.replace(/{([^{}]+)}/g,(i,e)=>{let a=kUe(n,e,o);return a??""})}});var ZX=$((JfA,WX)=>{"use strict";var vUe={maxTimer:2147483647};WX.exports=function(n,t,o){if(typeof n=="bigint"&&(n=Number(n)),n>=Number.MAX_SAFE_INTEGER&&(n=1/0),typeof n!="number"&&n!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(i=>{let e=o?o.setTimeout:setTimeout,a=()=>{let A=Math.min(n,vUe.maxTimer);n-=A,e(()=>n>0?a():i(t),A)};n!==1/0&&a()})}});var XX=$(pr=>{"use strict";pr.applyToDefaults=QX();pr.assert=Rl();pr.Bench=mX();pr.block=DX();pr.clone=eD();pr.contain=_X();pr.deepEqual=GF();pr.Error=_F();pr.escapeHeaderAttribute=NX();pr.escapeHtml=kX();pr.escapeJson=PX();pr.escapeRegex=FF();pr.flatten=LX();pr.ignore=PF();pr.intersect=KX();pr.isPromise=YX();pr.merge=kF();pr.once=qX();pr.reach=QB();pr.reachTemplate=VX();pr.stringify=MF();pr.wait=ZX()});var Kr=$(Pe=>{"use strict";var kl=XX(),ji={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};Pe.Boom=class extends Error{constructor(n,t={}){if(n instanceof Error)return Pe.boomify(kl.clone(n),t);let{statusCode:o=500,data:i=null,ctor:e=Pe.Boom}=t,a=new Error(n||void 0);Error.captureStackTrace(a,e),a.data=i;let A=ji.initialize(a,o);return Object.defineProperty(A,"typeof",{value:e}),t.decorate&&Object.assign(A,t.decorate),A}static[Symbol.hasInstance](n){return this===Pe.Boom?Pe.isBoom(n):this.prototype.isPrototypeOf(n)}};Pe.isBoom=function(n,t){return n instanceof Error&&!!n.isBoom&&(!t||n.output.statusCode===t)};Pe.boomify=function(n,t){return kl.assert(n instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(n.data=t.data),t.decorate&&Object.assign(n,t.decorate),n.isBoom?t.override===!1||!t.statusCode&&!t.message?n:ji.initialize(n,t.statusCode||n.output.statusCode,t.message):ji.initialize(n,t.statusCode||500,t.message)};Pe.badRequest=function(n,t){return new Pe.Boom(n,{statusCode:400,data:t,ctor:Pe.badRequest})};Pe.unauthorized=function(n,t,o){let i=new Pe.Boom(n,{statusCode:401,ctor:Pe.unauthorized});if(!t)return i;if(typeof t!="string")return i.output.headers["WWW-Authenticate"]=t.join(", "),i;let e=`${t}`;return(o||n)&&(i.output.payload.attributes={}),o&&(typeof o=="string"?(e+=" "+kl.escapeHeaderAttribute(o),i.output.payload.attributes=o):e+=" "+Object.keys(o).map(a=>{let A=o[a];return A==null&&(A=""),i.output.payload.attributes[a]=A,`${a}="${kl.escapeHeaderAttribute(A.toString())}"`}).join(", ")),n?(o&&(e+=","),e+=` error="${kl.escapeHeaderAttribute(n)}"`,i.output.payload.attributes.error=n):i.isMissing=!0,i.output.headers["WWW-Authenticate"]=e,i};Pe.paymentRequired=function(n,t){return new Pe.Boom(n,{statusCode:402,data:t,ctor:Pe.paymentRequired})};Pe.forbidden=function(n,t){return new Pe.Boom(n,{statusCode:403,data:t,ctor:Pe.forbidden})};Pe.notFound=function(n,t){return new Pe.Boom(n,{statusCode:404,data:t,ctor:Pe.notFound})};Pe.methodNotAllowed=function(n,t,o){let i=new Pe.Boom(n,{statusCode:405,data:t,ctor:Pe.methodNotAllowed});return typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i.output.headers.Allow=o.join(", ")),i};Pe.notAcceptable=function(n,t){return new Pe.Boom(n,{statusCode:406,data:t,ctor:Pe.notAcceptable})};Pe.proxyAuthRequired=function(n,t){return new Pe.Boom(n,{statusCode:407,data:t,ctor:Pe.proxyAuthRequired})};Pe.clientTimeout=function(n,t){return new Pe.Boom(n,{statusCode:408,data:t,ctor:Pe.clientTimeout})};Pe.conflict=function(n,t){return new Pe.Boom(n,{statusCode:409,data:t,ctor:Pe.conflict})};Pe.resourceGone=function(n,t){return new Pe.Boom(n,{statusCode:410,data:t,ctor:Pe.resourceGone})};Pe.lengthRequired=function(n,t){return new Pe.Boom(n,{statusCode:411,data:t,ctor:Pe.lengthRequired})};Pe.preconditionFailed=function(n,t){return new Pe.Boom(n,{statusCode:412,data:t,ctor:Pe.preconditionFailed})};Pe.entityTooLarge=function(n,t){return new Pe.Boom(n,{statusCode:413,data:t,ctor:Pe.entityTooLarge})};Pe.uriTooLong=function(n,t){return new Pe.Boom(n,{statusCode:414,data:t,ctor:Pe.uriTooLong})};Pe.unsupportedMediaType=function(n,t){return new Pe.Boom(n,{statusCode:415,data:t,ctor:Pe.unsupportedMediaType})};Pe.rangeNotSatisfiable=function(n,t){return new Pe.Boom(n,{statusCode:416,data:t,ctor:Pe.rangeNotSatisfiable})};Pe.expectationFailed=function(n,t){return new Pe.Boom(n,{statusCode:417,data:t,ctor:Pe.expectationFailed})};Pe.teapot=function(n,t){return new Pe.Boom(n,{statusCode:418,data:t,ctor:Pe.teapot})};Pe.badData=function(n,t){return new Pe.Boom(n,{statusCode:422,data:t,ctor:Pe.badData})};Pe.locked=function(n,t){return new Pe.Boom(n,{statusCode:423,data:t,ctor:Pe.locked})};Pe.failedDependency=function(n,t){return new Pe.Boom(n,{statusCode:424,data:t,ctor:Pe.failedDependency})};Pe.tooEarly=function(n,t){return new Pe.Boom(n,{statusCode:425,data:t,ctor:Pe.tooEarly})};Pe.preconditionRequired=function(n,t){return new Pe.Boom(n,{statusCode:428,data:t,ctor:Pe.preconditionRequired})};Pe.tooManyRequests=function(n,t){return new Pe.Boom(n,{statusCode:429,data:t,ctor:Pe.tooManyRequests})};Pe.illegal=function(n,t){return new Pe.Boom(n,{statusCode:451,data:t,ctor:Pe.illegal})};Pe.internal=function(n,t,o=500){return ji.serverError(n,t,o,Pe.internal)};Pe.notImplemented=function(n,t){return ji.serverError(n,t,501,Pe.notImplemented)};Pe.badGateway=function(n,t){return ji.serverError(n,t,502,Pe.badGateway)};Pe.serverUnavailable=function(n,t){return ji.serverError(n,t,503,Pe.serverUnavailable)};Pe.gatewayTimeout=function(n,t){return ji.serverError(n,t,504,Pe.gatewayTimeout)};Pe.badImplementation=function(n,t){let o=ji.serverError(n,t,500,Pe.badImplementation);return o.isDeveloperError=!0,o};ji.initialize=function(n,t,o){let i=parseInt(t,10);if(kl.assert(!isNaN(i)&&i>=400,"First argument must be a number (400+):",t),n.isBoom=!0,n.isServer=i>=500,n.hasOwnProperty("data")||(n.data=null),n.output={statusCode:i,payload:{},headers:{}},Object.defineProperty(n,"reformat",{value:ji.reformat,configurable:!0}),!o&&!n.message&&(n.reformat(),o=n.output.payload.error),o){let e=Object.getOwnPropertyDescriptor(n,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),"message");kl.assert(!e||e.configurable&&!e.get,"The error is not compatible with boom"),n.message=o+(n.message?": "+n.message:""),n.output.payload.message=n.message}return n.reformat(),n};ji.reformat=function(n=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=ji.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&n!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};ji.serverError=function(n,t,o,i){return t instanceof Error&&!t.isBoom?Pe.boomify(t,{statusCode:o,message:n}):new Pe.Boom(n,{statusCode:o,data:t,ctor:i})}});var A$,hHe,EHe,CHe,uHe,BHe,fHe,QHe,yHe,mHe,SHe,wHe,DHe,OHe,bHe,O,Ts=Ce(()=>{A$=n=>typeof n<"u"&&n!==null,hHe=n=>typeof n=="object",EHe=n=>Object.prototype.toString.call(n)==="[object Object]",CHe=n=>typeof n=="function",uHe=n=>typeof n=="boolean",BHe=n=>n instanceof Buffer,fHe=n=>{if(A$(n))switch(n.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},QHe=n=>n instanceof ArrayBuffer,yHe=n=>typeof n=="string"&&n.length>0,mHe=n=>typeof n=="number"&&Number.isFinite(n),SHe=n=>Number.isInteger(n),wHe=(n,t,o)=>n>=t&&n<=o,DHe=(n,t)=>t.includes(n),OHe=(n,t,o)=>new Error(`Expected ${t} for ${n} but received ${o} of type ${typeof o}`),bHe=(n,t)=>(t.message=n.message,t),O={defined:A$,object:hHe,plainObject:EHe,fn:CHe,bool:uHe,buffer:BHe,typedArray:fHe,arrayBuffer:QHe,string:yHe,number:mHe,integer:SHe,inRange:wHe,inArray:DHe,invalidParameterError:OHe,nativeError:bHe}});var a$=$((ryA,r$)=>{"use strict";var t$=()=>process.platform==="linux",fD=null,MHe=()=>{if(!fD)if(t$()&&process.report){let n=process.report.excludeNetwork;process.report.excludeNetwork=!0,fD=process.report.getReport(),process.report.excludeNetwork=n}else fD={};return fD};r$.exports={isLinux:t$,getReport:MHe}});var o$=$((ayA,i$)=>{"use strict";var Qh=$e("fs"),_He="/usr/bin/ldd",THe="/proc/self/exe",QD=2048,NHe=n=>{let t=Qh.openSync(n,"r"),o=Buffer.alloc(QD),i=Qh.readSync(t,o,0,QD,0);return Qh.close(t,()=>{}),o.subarray(0,i)},RHe=n=>new Promise((t,o)=>{Qh.open(n,"r",(i,e)=>{if(i)o(i);else{let a=Buffer.alloc(QD);Qh.read(e,a,0,QD,0,(A,r)=>{t(a.subarray(0,r)),Qh.close(e,()=>{})})}})});i$.exports={LDD_PATH:_He,SELF_PATH:THe,readFileSync:NHe,readFile:RHe}});var s$=$((iyA,n$)=>{"use strict";var kHe=n=>{if(n.length<64||n.readUInt32BE(0)!==2135247942||n.readUInt8(4)!==2||n.readUInt8(5)!==1)return null;let t=n.readUInt32LE(32),o=n.readUInt16LE(54),i=n.readUInt16LE(56);for(let e=0;e{"use strict";var c$=$e("child_process"),{isLinux:yh,getReport:I$}=a$(),{LDD_PATH:yD,SELF_PATH:l$,readFile:XF,readFileSync:$F}=o$(),{interpreterPath:p$}=s$(),Ns,Rs,ks,d$="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",AI="",h$=()=>AI||new Promise(n=>{c$.exec(d$,(t,o)=>{AI=t?" ":o,n(AI)})}),E$=()=>{if(!AI)try{AI=c$.execSync(d$,{encoding:"utf8"})}catch{AI=" "}return AI},xg="glibc",C$=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Ul="musl",vHe=n=>n.includes("libc.musl-")||n.includes("ld-musl-"),u$=()=>{let n=I$();return n.header&&n.header.glibcVersionRuntime?xg:Array.isArray(n.sharedObjects)&&n.sharedObjects.some(vHe)?Ul:null},B$=n=>{let[t,o]=n.split(/[\r\n]+/);return t&&t.includes(xg)?xg:o&&o.includes(Ul)?Ul:null},f$=n=>{if(n){if(n.includes("/ld-musl-"))return Ul;if(n.includes("/ld-linux-"))return xg}return null},Q$=n=>(n=n.toString(),n.includes("musl")?Ul:n.includes("GNU C Library")?xg:null),PHe=async()=>{if(Rs!==void 0)return Rs;Rs=null;try{let n=await XF(yD);Rs=Q$(n)}catch{}return Rs},GHe=()=>{if(Rs!==void 0)return Rs;Rs=null;try{let n=$F(yD);Rs=Q$(n)}catch{}return Rs},FHe=async()=>{if(Ns!==void 0)return Ns;Ns=null;try{let n=await XF(l$),t=p$(n);Ns=f$(t)}catch{}return Ns},LHe=()=>{if(Ns!==void 0)return Ns;Ns=null;try{let n=$F(l$),t=p$(n);Ns=f$(t)}catch{}return Ns},y$=async()=>{let n=null;if(yh()&&(n=await FHe(),!n&&(n=await PHe(),n||(n=u$()),!n))){let t=await h$();n=B$(t)}return n},m$=()=>{let n=null;if(yh()&&(n=LHe(),!n&&(n=GHe(),n||(n=u$()),!n))){let t=E$();n=B$(t)}return n},UHe=async()=>yh()&&await y$()!==xg,HHe=()=>yh()&&m$()!==xg,KHe=async()=>{if(ks!==void 0)return ks;ks=null;try{let t=(await XF(yD)).match(C$);t&&(ks=t[1])}catch{}return ks},xHe=()=>{if(ks!==void 0)return ks;ks=null;try{let t=$F(yD).match(C$);t&&(ks=t[1])}catch{}return ks},S$=()=>{let n=I$();return n.header&&n.header.glibcVersionRuntime?n.header.glibcVersionRuntime:null},g$=n=>n.trim().split(/\s+/)[1],w$=n=>{let[t,o,i]=n.split(/[\r\n]+/);return t&&t.includes(xg)?g$(t):o&&i&&o.includes(Ul)?g$(i):null},YHe=async()=>{let n=null;if(yh()&&(n=await KHe(),n||(n=S$()),!n)){let t=await h$();n=w$(t)}return n},jHe=()=>{let n=null;if(yh()&&(n=xHe(),n||(n=S$()),!n)){let t=E$();n=w$(t)}return n};D$.exports={GLIBC:xg,MUSL:Ul,family:y$,familySync:m$,isNonGlibcLinux:UHe,isNonGlibcLinuxSync:HHe,version:YHe,versionSync:jHe}});var mh=$((nyA,O$)=>{"use strict";var JHe="2.0.0",qHe=Number.MAX_SAFE_INTEGER||9007199254740991,zHe=16,VHe=250,WHe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];O$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:zHe,MAX_SAFE_BUILD_LENGTH:VHe,MAX_SAFE_INTEGER:qHe,RELEASE_TYPES:WHe,SEMVER_SPEC_VERSION:JHe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vB=$((syA,b$)=>{"use strict";var ZHe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};b$.exports=ZHe});var Sh=$((vs,M$)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:eL,MAX_SAFE_BUILD_LENGTH:XHe,MAX_LENGTH:$He}=mh(),eKe=vB();vs=M$.exports={};var AKe=vs.re=[],tKe=vs.safeRe=[],gA=vs.src=[],rKe=vs.safeSrc=[],cA=vs.t={},aKe=0,AL="[a-zA-Z0-9-]",iKe=[["\\s",1],["\\d",$He],[AL,XHe]],oKe=n=>{for(let[t,o]of iKe)n=n.split(`${t}*`).join(`${t}{0,${o}}`).split(`${t}+`).join(`${t}{1,${o}}`);return n},JA=(n,t,o)=>{let i=oKe(t),e=aKe++;eKe(n,e,t),cA[n]=e,gA[e]=t,rKe[e]=i,AKe[e]=new RegExp(t,o?"g":void 0),tKe[e]=new RegExp(i,o?"g":void 0)};JA("NUMERICIDENTIFIER","0|[1-9]\\d*");JA("NUMERICIDENTIFIERLOOSE","\\d+");JA("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${AL}*`);JA("MAINVERSION",`(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})`);JA("MAINVERSIONLOOSE",`(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASEIDENTIFIER",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIER]})`);JA("PRERELEASEIDENTIFIERLOOSE",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASE",`(?:-(${gA[cA.PRERELEASEIDENTIFIER]}(?:\\.${gA[cA.PRERELEASEIDENTIFIER]})*))`);JA("PRERELEASELOOSE",`(?:-?(${gA[cA.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${gA[cA.PRERELEASEIDENTIFIERLOOSE]})*))`);JA("BUILDIDENTIFIER",`${AL}+`);JA("BUILD",`(?:\\+(${gA[cA.BUILDIDENTIFIER]}(?:\\.${gA[cA.BUILDIDENTIFIER]})*))`);JA("FULLPLAIN",`v?${gA[cA.MAINVERSION]}${gA[cA.PRERELEASE]}?${gA[cA.BUILD]}?`);JA("FULL",`^${gA[cA.FULLPLAIN]}$`);JA("LOOSEPLAIN",`[v=\\s]*${gA[cA.MAINVERSIONLOOSE]}${gA[cA.PRERELEASELOOSE]}?${gA[cA.BUILD]}?`);JA("LOOSE",`^${gA[cA.LOOSEPLAIN]}$`);JA("GTLT","((?:<|>)?=?)");JA("XRANGEIDENTIFIERLOOSE",`${gA[cA.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);JA("XRANGEIDENTIFIER",`${gA[cA.NUMERICIDENTIFIER]}|x|X|\\*`);JA("XRANGEPLAIN",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:${gA[cA.PRERELEASE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGEPLAINLOOSE",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:${gA[cA.PRERELEASELOOSE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAIN]}$`);JA("XRANGELOOSE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COERCEPLAIN",`(^|[^\\d])(\\d{1,${eL}})(?:\\.(\\d{1,${eL}}))?(?:\\.(\\d{1,${eL}}))?`);JA("COERCE",`${gA[cA.COERCEPLAIN]}(?:$|[^\\d])`);JA("COERCEFULL",gA[cA.COERCEPLAIN]+`(?:${gA[cA.PRERELEASE]})?(?:${gA[cA.BUILD]})?(?:$|[^\\d])`);JA("COERCERTL",gA[cA.COERCE],!0);JA("COERCERTLFULL",gA[cA.COERCEFULL],!0);JA("LONETILDE","(?:~>?)");JA("TILDETRIM",`(\\s*)${gA[cA.LONETILDE]}\\s+`,!0);vs.tildeTrimReplace="$1~";JA("TILDE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAIN]}$`);JA("TILDELOOSE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("LONECARET","(?:\\^)");JA("CARETTRIM",`(\\s*)${gA[cA.LONECARET]}\\s+`,!0);vs.caretTrimReplace="$1^";JA("CARET",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAIN]}$`);JA("CARETLOOSE",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COMPARATORLOOSE",`^${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]})$|^$`);JA("COMPARATOR",`^${gA[cA.GTLT]}\\s*(${gA[cA.FULLPLAIN]})$|^$`);JA("COMPARATORTRIM",`(\\s*)${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]}|${gA[cA.XRANGEPLAIN]})`,!0);vs.comparatorTrimReplace="$1$2$3";JA("HYPHENRANGE",`^\\s*(${gA[cA.XRANGEPLAIN]})\\s+-\\s+(${gA[cA.XRANGEPLAIN]})\\s*$`);JA("HYPHENRANGELOOSE",`^\\s*(${gA[cA.XRANGEPLAINLOOSE]})\\s+-\\s+(${gA[cA.XRANGEPLAINLOOSE]})\\s*$`);JA("STAR","(<|>)?=?\\s*\\*");JA("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");JA("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var SD=$((gyA,_$)=>{"use strict";var nKe=Object.freeze({loose:!0}),sKe=Object.freeze({}),gKe=n=>n?typeof n!="object"?nKe:n:sKe;_$.exports=gKe});var tL=$((cyA,R$)=>{"use strict";var T$=/^[0-9]+$/,N$=(n,t)=>{if(typeof n=="number"&&typeof t=="number")return n===t?0:nN$(t,n);R$.exports={compareIdentifiers:N$,rcompareIdentifiers:cKe}});var ba=$((IyA,v$)=>{"use strict";var wD=vB(),{MAX_LENGTH:k$,MAX_SAFE_INTEGER:DD}=mh(),{safeRe:OD,t:bD}=Sh(),IKe=SD(),{compareIdentifiers:rL}=tL(),lKe=(n,t)=>{let o=t.split(".");if(o.length>n.length)return!1;for(let i=0;ik$)throw new TypeError(`version is longer than ${k$} characters`);wD("SemVer",t,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;let i=t.trim().match(o.loose?OD[bD.LOOSE]:OD[bD.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>DD||this.major<0)throw new TypeError("Invalid major version");if(this.minor>DD||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>DD||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let a=+e;if(a>=0&&at.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof n||(t=new n(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let o=0;do{let i=this.prerelease[o],e=t.prerelease[o];if(wD("prerelease compare",o,i,e),i===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(i===void 0)return-1;if(i===e)continue;return rL(i,e)}while(++o)}compareBuild(t){t instanceof n||(t=new n(t,this.options));let o=0;do{let i=this.build[o],e=t.build[o];if(wD("build compare",o,i,e),i===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(i===void 0)return-1;if(i===e)continue;return rL(i,e)}while(++o)}inc(t,o,i){if(t.startsWith("pre")){if(!o&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(o){let e=`-${o}`.match(this.options.loose?OD[bD.PRERELEASELOOSE]:OD[bD.PRERELEASE]);if(!e||e[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,i),this.inc("pre",o,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,i),this.inc("pre",o,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(o===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(o){let a=[o,e];if(i===!1&&(a=[o]),lKe(this.prerelease,o)){let A=this.prerelease[o.split(".").length];isNaN(A)&&(this.prerelease=a)}else this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};v$.exports=aL});var tI=$((lyA,G$)=>{"use strict";var P$=ba(),pKe=(n,t,o=!1)=>{if(n instanceof P$)return n;try{return new P$(n,t)}catch(i){if(!o)return null;throw i}};G$.exports=pKe});var L$=$((pyA,F$)=>{"use strict";var dKe=tI(),hKe=(n,t)=>{let o=dKe(n,t);return o?o.version:null};F$.exports=hKe});var H$=$((dyA,U$)=>{"use strict";var EKe=tI(),CKe=(n,t)=>{let o=EKe(n.trim().replace(/^[=v]+/,""),t);return o?o.version:null};U$.exports=CKe});var Y$=$((hyA,x$)=>{"use strict";var K$=ba(),uKe=(n,t,o,i,e)=>{typeof o=="string"&&(e=i,i=o,o=void 0);try{return new K$(n instanceof K$?n.version:n,o).inc(t,i,e).version}catch{return null}};x$.exports=uKe});var q$=$((EyA,J$)=>{"use strict";var j$=tI(),BKe=(n,t)=>{let o=j$(n,null,!0),i=j$(t,null,!0),e=o.compare(i);if(e===0)return null;let a=e>0,A=a?o:i,r=a?i:o,s=!!A.prerelease.length;if(!!r.prerelease.length&&!s){if(!r.patch&&!r.minor)return"major";if(r.compareMain(A)===0)return r.minor&&!r.patch?"minor":"patch"}let c=s?"pre":"";return o.major!==i.major?c+"major":o.minor!==i.minor?c+"minor":o.patch!==i.patch?c+"patch":"prerelease"};J$.exports=BKe});var V$=$((CyA,z$)=>{"use strict";var fKe=ba(),QKe=(n,t)=>new fKe(n,t).major;z$.exports=QKe});var Z$=$((uyA,W$)=>{"use strict";var yKe=ba(),mKe=(n,t)=>new yKe(n,t).minor;W$.exports=mKe});var $$=$((ByA,X$)=>{"use strict";var SKe=ba(),wKe=(n,t)=>new SKe(n,t).patch;X$.exports=wKe});var Aee=$((fyA,eee)=>{"use strict";var DKe=tI(),OKe=(n,t)=>{let o=DKe(n,t);return o&&o.prerelease.length?o.prerelease:null};eee.exports=OKe});var Wo=$((QyA,ree)=>{"use strict";var tee=ba(),bKe=(n,t,o)=>new tee(n,o).compare(new tee(t,o));ree.exports=bKe});var iee=$((yyA,aee)=>{"use strict";var MKe=Wo(),_Ke=(n,t,o)=>MKe(t,n,o);aee.exports=_Ke});var nee=$((myA,oee)=>{"use strict";var TKe=Wo(),NKe=(n,t)=>TKe(n,t,!0);oee.exports=NKe});var MD=$((SyA,gee)=>{"use strict";var see=ba(),RKe=(n,t,o)=>{let i=new see(n,o),e=new see(t,o);return i.compare(e)||i.compareBuild(e)};gee.exports=RKe});var Iee=$((wyA,cee)=>{"use strict";var kKe=MD(),vKe=(n,t)=>n.sort((o,i)=>kKe(o,i,t));cee.exports=vKe});var pee=$((DyA,lee)=>{"use strict";var PKe=MD(),GKe=(n,t)=>n.sort((o,i)=>PKe(i,o,t));lee.exports=GKe});var PB=$((OyA,dee)=>{"use strict";var FKe=Wo(),LKe=(n,t,o)=>FKe(n,t,o)>0;dee.exports=LKe});var _D=$((byA,hee)=>{"use strict";var UKe=Wo(),HKe=(n,t,o)=>UKe(n,t,o)<0;hee.exports=HKe});var iL=$((MyA,Eee)=>{"use strict";var KKe=Wo(),xKe=(n,t,o)=>KKe(n,t,o)===0;Eee.exports=xKe});var oL=$((_yA,Cee)=>{"use strict";var YKe=Wo(),jKe=(n,t,o)=>YKe(n,t,o)!==0;Cee.exports=jKe});var TD=$((TyA,uee)=>{"use strict";var JKe=Wo(),qKe=(n,t,o)=>JKe(n,t,o)>=0;uee.exports=qKe});var ND=$((NyA,Bee)=>{"use strict";var zKe=Wo(),VKe=(n,t,o)=>zKe(n,t,o)<=0;Bee.exports=VKe});var nL=$((RyA,fee)=>{"use strict";var WKe=iL(),ZKe=oL(),XKe=PB(),$Ke=TD(),exe=_D(),Axe=ND(),txe=(n,t,o,i)=>{switch(t){case"===":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n===o;case"!==":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n!==o;case"":case"=":case"==":return WKe(n,o,i);case"!=":return ZKe(n,o,i);case">":return XKe(n,o,i);case">=":return $Ke(n,o,i);case"<":return exe(n,o,i);case"<=":return Axe(n,o,i);default:throw new TypeError(`Invalid operator: ${t}`)}};fee.exports=txe});var yee=$((kyA,Qee)=>{"use strict";var rxe=ba(),axe=tI(),{safeRe:RD,t:kD}=Sh(),ixe=(n,t)=>{if(n instanceof rxe)return n;if(typeof n=="number"&&(n=String(n)),typeof n!="string")return null;t=t||{};let o=null;if(!t.rtl)o=n.match(t.includePrerelease?RD[kD.COERCEFULL]:RD[kD.COERCE]);else{let s=t.includePrerelease?RD[kD.COERCERTLFULL]:RD[kD.COERCERTL],g;for(;(g=s.exec(n))&&(!o||o.index+o[0].length!==n.length);)(!o||g.index+g[0].length!==o.index+o[0].length)&&(o=g),s.lastIndex=g.index+g[1].length+g[2].length;s.lastIndex=-1}if(o===null)return null;let i=o[2],e=o[3]||"0",a=o[4]||"0",A=t.includePrerelease&&o[5]?`-${o[5]}`:"",r=t.includePrerelease&&o[6]?`+${o[6]}`:"";return axe(`${i}.${e}.${a}${A}${r}`,t)};Qee.exports=ixe});var See=$((vyA,mee)=>{"use strict";var oxe=tI(),nxe=mh(),sxe=ba(),gxe=(n,t,o)=>{if(!nxe.RELEASE_TYPES.includes(t))return null;let i=cxe(n,o);return i&&Ixe(i,t)},cxe=(n,t)=>{let o=n instanceof sxe?n.version:n;return oxe(o,t)},Ixe=(n,t)=>{if(lxe(t))return n.version;switch(n.prerelease=[],t){case"major":n.minor=0,n.patch=0;break;case"minor":n.patch=0;break}return n.format()},lxe=n=>n.startsWith("pre");mee.exports=gxe});var Dee=$((PyA,wee)=>{"use strict";var sL=class{constructor(){this.max=1e3,this.map=new Map}get(t){let o=this.map.get(t);if(o!==void 0)return this.map.delete(t),this.map.set(t,o),o}delete(t){return this.map.delete(t)}set(t,o){if(!this.delete(t)&&o!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(t,o)}return this}};wee.exports=sL});var Zo=$((GyA,_ee)=>{"use strict";var pxe=/\s+/g,gL=class n{constructor(t,o){if(o=hxe(o),t instanceof n)return t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease?t:new n(t.raw,o);if(t instanceof cL)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=t.trim().replace(pxe," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(e=>!bee(e[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Sxe(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let o=this.set[t];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=o[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(mxe,"");let i=((this.options.includePrerelease&&Qxe)|(this.options.loose&&yxe))+":"+t,e=Oee.get(i);if(e)return e;let a=this.options.loose,A=a?hi[Ma.HYPHENRANGELOOSE]:hi[Ma.HYPHENRANGE];t=t.replace(A,vxe(this.options.includePrerelease)),qt("hyphen replace",t),t=t.replace(hi[Ma.COMPARATORTRIM],uxe),qt("comparator trim",t),t=t.replace(hi[Ma.TILDETRIM],Bxe),qt("tilde trim",t),t=t.replace(hi[Ma.CARETTRIM],fxe),qt("caret trim",t);let r=t.split(" ").map(I=>wxe(I,this.options)).join(" ").split(/\s+/).map(I=>kxe(I,this.options));a&&(r=r.filter(I=>(qt("loose invalid filter",I,this.options),!!I.match(hi[Ma.COMPARATORLOOSE])))),qt("range list",r);let s=new Map,g=r.map(I=>new cL(I,this.options));for(let I of g){if(bee(I))return[I];s.set(I.value,I)}s.size>1&&s.has("")&&s.delete("");let c=[...s.values()];return Oee.set(i,c),c}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Range is required");return this.set.some(i=>Mee(i,o)&&t.set.some(e=>Mee(e,o)&&i.every(a=>e.every(A=>a.intersects(A,o)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Exe(t,this.options)}catch{return!1}for(let o=0;on.value==="<0.0.0-0",Sxe=n=>n.value==="",Mee=(n,t)=>{let o=!0,i=n.slice(),e=i.pop();for(;o&&i.length;)o=i.every(a=>e.intersects(a,t)),e=i.pop();return o},wxe=(n,t)=>(n=n.replace(hi[Ma.BUILD],""),qt("comp",n,t),n=Mxe(n,t),qt("caret",n),n=Oxe(n,t),qt("tildes",n),n=Txe(n,t),qt("xrange",n),n=Rxe(n,t),qt("stars",n),n),Jr=n=>!n||n.toLowerCase()==="x"||n==="*",Dxe=(n,t,o)=>Jr(n)&&!Jr(t)||Jr(t)&&o&&!Jr(o),Oxe=(n,t)=>n.trim().split(/\s+/).map(o=>bxe(o,t)).join(" "),bxe=(n,t)=>{let o=t.loose?hi[Ma.TILDELOOSE]:hi[Ma.TILDE],i=t.includePrerelease?"-0":"";return n.replace(o,(e,a,A,r,s)=>{qt("tilde",n,e,a,A,r,s);let g;return Jr(a)?g="":Jr(A)?g=`>=${a}.0.0${i} <${+a+1}.0.0-0`:Jr(r)?g=`>=${a}.${A}.0${i} <${a}.${+A+1}.0-0`:s?(qt("replaceTilde pr",s),g=`>=${a}.${A}.${r}-${s} <${a}.${+A+1}.0-0`):g=`>=${a}.${A}.${r} <${a}.${+A+1}.0-0`,qt("tilde return",g),g})},Mxe=(n,t)=>n.trim().split(/\s+/).map(o=>_xe(o,t)).join(" "),_xe=(n,t)=>{qt("caret",n,t);let o=t.loose?hi[Ma.CARETLOOSE]:hi[Ma.CARET],i=t.includePrerelease?"-0":"";return n.replace(o,(e,a,A,r,s)=>{qt("caret",n,e,a,A,r,s);let g;return Jr(a)?g="":Jr(A)?g=`>=${a}.0.0${i} <${+a+1}.0.0-0`:Jr(r)?a==="0"?g=`>=${a}.${A}.0${i} <${a}.${+A+1}.0-0`:g=`>=${a}.${A}.0${i} <${+a+1}.0.0-0`:s?(qt("replaceCaret pr",s),a==="0"?A==="0"?g=`>=${a}.${A}.${r}-${s} <${a}.${A}.${+r+1}-0`:g=`>=${a}.${A}.${r}-${s} <${a}.${+A+1}.0-0`:g=`>=${a}.${A}.${r}-${s} <${+a+1}.0.0-0`):(qt("no pr"),a==="0"?A==="0"?g=`>=${a}.${A}.${r} <${a}.${A}.${+r+1}-0`:g=`>=${a}.${A}.${r} <${a}.${+A+1}.0-0`:g=`>=${a}.${A}.${r} <${+a+1}.0.0-0`),qt("caret return",g),g})},Txe=(n,t)=>(qt("replaceXRanges",n,t),n.split(/\s+/).map(o=>Nxe(o,t)).join(" ")),Nxe=(n,t)=>{n=n.trim();let o=t.loose?hi[Ma.XRANGELOOSE]:hi[Ma.XRANGE];return n.replace(o,(i,e,a,A,r,s)=>{if(qt("xRange",n,i,e,a,A,r,s),Dxe(a,A,r))return n;let g=Jr(a),c=g||Jr(A),I=c||Jr(r),d=I;return e==="="&&d&&(e=""),s=t.includePrerelease?"-0":"",g?e===">"||e==="<"?i="<0.0.0-0":i="*":e&&d?(c&&(A=0),r=0,e===">"?(e=">=",c?(a=+a+1,A=0,r=0):(A=+A+1,r=0)):e==="<="&&(e="<",c?a=+a+1:A=+A+1),e==="<"&&(s="-0"),i=`${e+a}.${A}.${r}${s}`):c?i=`>=${a}.0.0${s} <${+a+1}.0.0-0`:I&&(i=`>=${a}.${A}.0${s} <${a}.${+A+1}.0-0`),qt("xRange return",i),i})},Rxe=(n,t)=>(qt("replaceStars",n,t),n.trim().replace(hi[Ma.STAR],"")),kxe=(n,t)=>(qt("replaceGTE0",n,t),n.trim().replace(hi[t.includePrerelease?Ma.GTE0PRE:Ma.GTE0],"")),vxe=n=>(t,o,i,e,a,A,r,s,g,c,I,d)=>(Jr(i)?o="":Jr(e)?o=`>=${i}.0.0${n?"-0":""}`:Jr(a)?o=`>=${i}.${e}.0${n?"-0":""}`:A?o=`>=${o}`:o=`>=${o}${n?"-0":""}`,Jr(g)?s="":Jr(c)?s=`<${+g+1}.0.0-0`:Jr(I)?s=`<${g}.${+c+1}.0-0`:d?s=`<=${g}.${c}.${I}-${d}`:n?s=`<${g}.${c}.${+I+1}-0`:s=`<=${s}`,`${o} ${s}`.trim()),Pxe=(n,t,o)=>{for(let i=0;i0){let e=n[i].semver;if(e.major===t.major&&e.minor===t.minor&&e.patch===t.patch)return!0}return!1}return!0}});var GB=$((FyA,Pee)=>{"use strict";var FB=Symbol("SemVer ANY"),pL=class n{static get ANY(){return FB}constructor(t,o){if(o=Tee(o),t instanceof n){if(t.loose===!!o.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),lL("comparator",t,o),this.options=o,this.loose=!!o.loose,this.parse(t),this.semver===FB?this.value="":this.value=this.operator+this.semver.version,lL("comp",this)}parse(t){let o=this.options.loose?Nee[Ree.COMPARATORLOOSE]:Nee[Ree.COMPARATOR],i=t.match(o);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new kee(i[2],this.options.loose):this.semver=FB}toString(){return this.value}test(t){if(lL("Comparator.test",t,this.options.loose),this.semver===FB||t===FB)return!0;if(typeof t=="string")try{t=new kee(t,this.options)}catch{return!1}return IL(t,this.operator,this.semver,this.options)}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new vee(t.value,o).test(this.value):t.operator===""?t.value===""?!0:new vee(this.value,o).test(t.semver):(o=Tee(o),o.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||IL(this.semver,"<",t.semver,o)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||IL(this.semver,">",t.semver,o)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Pee.exports=pL;var Tee=SD(),{safeRe:Nee,t:Ree}=Sh(),IL=nL(),lL=vB(),kee=ba(),vee=Zo()});var LB=$((LyA,Gee)=>{"use strict";var Gxe=Zo(),Fxe=(n,t,o)=>{try{t=new Gxe(t,o)}catch{return!1}return t.test(n)};Gee.exports=Fxe});var Lee=$((UyA,Fee)=>{"use strict";var Lxe=Zo(),Uxe=(n,t)=>new Lxe(n,t).set.map(o=>o.map(i=>i.value).join(" ").trim().split(" "));Fee.exports=Uxe});var Hee=$((HyA,Uee)=>{"use strict";var Hxe=ba(),Kxe=Zo(),xxe=(n,t,o)=>{let i=null,e=null,a=null;try{a=new Kxe(t,o)}catch{return null}return n.forEach(A=>{a.test(A)&&(!i||e.compare(A)===-1)&&(i=A,e=new Hxe(i,o))}),i};Uee.exports=xxe});var xee=$((KyA,Kee)=>{"use strict";var Yxe=ba(),jxe=Zo(),Jxe=(n,t,o)=>{let i=null,e=null,a=null;try{a=new jxe(t,o)}catch{return null}return n.forEach(A=>{a.test(A)&&(!i||e.compare(A)===1)&&(i=A,e=new Yxe(i,o))}),i};Kee.exports=Jxe});var Jee=$((xyA,jee)=>{"use strict";var dL=ba(),qxe=Zo(),Yee=PB(),zxe=(n,t)=>{n=new qxe(n,t);let o=new dL("0.0.0");if(n.test(o)||(o=new dL("0.0.0-0"),n.test(o)))return o;o=null;for(let i=0;i{let r=new dL(A.semver.version);switch(A.operator){case">":r.prerelease.length===0?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":(!a||Yee(r,a))&&(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${A.operator}`)}}),a&&(!o||Yee(o,a))&&(o=a)}return o&&n.test(o)?o:null};jee.exports=zxe});var zee=$((YyA,qee)=>{"use strict";var Vxe=Zo(),Wxe=(n,t)=>{try{return new Vxe(n,t).range||"*"}catch{return null}};qee.exports=Wxe});var vD=$((jyA,Xee)=>{"use strict";var Zxe=ba(),Zee=GB(),{ANY:Xxe}=Zee,$xe=Zo(),eYe=LB(),Vee=PB(),Wee=_D(),AYe=ND(),tYe=TD(),rYe=(n,t,o,i)=>{n=new Zxe(n,i),t=new $xe(t,i);let e,a,A,r,s;switch(o){case">":e=Vee,a=AYe,A=Wee,r=">",s=">=";break;case"<":e=Wee,a=tYe,A=Vee,r="<",s="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(eYe(n,t,i))return!1;for(let g=0;g{B.semver===Xxe&&(B=new Zee(">=0.0.0")),I=I||B,d=d||B,e(B.semver,I.semver,i)?I=B:A(B.semver,d.semver,i)&&(d=B)}),I.operator===r||I.operator===s||(!d.operator||d.operator===r)&&a(n,d.semver))return!1;if(d.operator===s&&A(n,d.semver))return!1}return!0};Xee.exports=rYe});var eAe=$((JyA,$ee)=>{"use strict";var aYe=vD(),iYe=(n,t,o)=>aYe(n,t,">",o);$ee.exports=iYe});var tAe=$((qyA,AAe)=>{"use strict";var oYe=vD(),nYe=(n,t,o)=>oYe(n,t,"<",o);AAe.exports=nYe});var iAe=$((zyA,aAe)=>{"use strict";var rAe=Zo(),sYe=(n,t,o)=>(n=new rAe(n,o),t=new rAe(t,o),n.intersects(t,o));aAe.exports=sYe});var nAe=$((VyA,oAe)=>{"use strict";var gYe=LB(),cYe=Wo();oAe.exports=(n,t,o)=>{let i=[],e=null,a=null,A=n.sort((c,I)=>cYe(c,I,o));for(let c of A)gYe(c,t,o)?(a=c,e||(e=c)):(a&&i.push([e,a]),a=null,e=null);e&&i.push([e,null]);let r=[];for(let[c,I]of i)c===I?r.push(c):!I&&c===A[0]?r.push("*"):I?c===A[0]?r.push(`<=${I}`):r.push(`${c} - ${I}`):r.push(`>=${c}`);let s=r.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return s.length{"use strict";var sAe=Zo(),CL=GB(),{ANY:hL}=CL,EL=LB(),uL=Wo(),IYe=(n,t,o={})=>{if(n===t)return!0;n=new sAe(n,o),t=new sAe(t,o);let i=!1;e:for(let e of n.set){for(let a of t.set){let A=pYe(e,a,o);if(i=i||A!==null,A)continue e}if(i)return!1}return!0},lYe=[new CL(">=0.0.0-0")],gAe=[new CL(">=0.0.0")],pYe=(n,t,o)=>{if(n===t)return!0;if(n.length===1&&n[0].semver===hL){if(t.length===1&&t[0].semver===hL)return!0;o.includePrerelease?n=lYe:n=gAe}if(t.length===1&&t[0].semver===hL){if(o.includePrerelease)return!0;t=gAe}let i=new Set,e,a;for(let B of n)B.operator===">"||B.operator===">="?e=cAe(e,B,o):B.operator==="<"||B.operator==="<="?a=IAe(a,B,o):i.add(B.semver);if(i.size>1)return null;let A;if(e&&a){if(A=uL(e.semver,a.semver,o),A>0)return null;if(A===0&&(e.operator!==">="||a.operator!=="<="))return null}for(let B of i){if(e&&!EL(B,String(e),o)||a&&!EL(B,String(a),o))return null;for(let f of t)if(!EL(B,String(f),o))return!1;return!0}let r,s,g,c,I=a&&!o.includePrerelease&&a.semver.prerelease.length?a.semver:!1,d=e&&!o.includePrerelease&&e.semver.prerelease.length?e.semver:!1;I&&I.prerelease.length===1&&a.operator==="<"&&I.prerelease[0]===0&&(I=!1);for(let B of t){if(c=c||B.operator===">"||B.operator===">=",g=g||B.operator==="<"||B.operator==="<=",e){if(d&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===d.major&&B.semver.minor===d.minor&&B.semver.patch===d.patch&&(d=!1),B.operator===">"||B.operator===">="){if(r=cAe(e,B,o),r===B&&r!==e)return!1}else if(e.operator===">="&&!B.test(e.semver))return!1}if(a){if(I&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===I.major&&B.semver.minor===I.minor&&B.semver.patch===I.patch&&(I=!1),B.operator==="<"||B.operator==="<="){if(s=IAe(a,B,o),s===B&&s!==a)return!1}else if(a.operator==="<="&&!B.test(a.semver))return!1}if(!B.operator&&(a||e)&&A!==0)return!1}return!(e&&g&&!a&&A!==0||a&&c&&!e&&A!==0||d||I)},cAe=(n,t,o)=>{if(!n)return t;let i=uL(n.semver,t.semver,o);return i>0?n:i<0||t.operator===">"&&n.operator===">="?t:n},IAe=(n,t,o)=>{if(!n)return t;let i=uL(n.semver,t.semver,o);return i<0?n:i>0||t.operator==="<"&&n.operator==="<="?t:n};lAe.exports=IYe});var PD=$((ZyA,EAe)=>{"use strict";var BL=Sh(),dAe=mh(),dYe=ba(),hAe=tL(),hYe=tI(),EYe=L$(),CYe=H$(),uYe=Y$(),BYe=q$(),fYe=V$(),QYe=Z$(),yYe=$$(),mYe=Aee(),SYe=Wo(),wYe=iee(),DYe=nee(),OYe=MD(),bYe=Iee(),MYe=pee(),_Ye=PB(),TYe=_D(),NYe=iL(),RYe=oL(),kYe=TD(),vYe=ND(),PYe=nL(),GYe=yee(),FYe=See(),LYe=GB(),UYe=Zo(),HYe=LB(),KYe=Lee(),xYe=Hee(),YYe=xee(),jYe=Jee(),JYe=zee(),qYe=vD(),zYe=eAe(),VYe=tAe(),WYe=iAe(),ZYe=nAe(),XYe=pAe();EAe.exports={parse:hYe,valid:EYe,clean:CYe,inc:uYe,diff:BYe,major:fYe,minor:QYe,patch:yYe,prerelease:mYe,compare:SYe,rcompare:wYe,compareLoose:DYe,compareBuild:OYe,sort:bYe,rsort:MYe,gt:_Ye,lt:TYe,eq:NYe,neq:RYe,gte:kYe,lte:vYe,cmp:PYe,coerce:GYe,truncate:FYe,Comparator:LYe,Range:UYe,satisfies:HYe,toComparators:KYe,maxSatisfying:xYe,minSatisfying:YYe,minVersion:jYe,validRange:JYe,outside:qYe,gtr:zYe,ltr:VYe,intersects:WYe,simplifyRange:ZYe,subset:XYe,SemVer:dYe,re:BL.re,src:BL.src,tokens:BL.t,SEMVER_SPEC_VERSION:dAe.SEMVER_SPEC_VERSION,RELEASE_TYPES:dAe.RELEASE_TYPES,compareIdentifiers:hAe.compareIdentifiers,rcompareIdentifiers:hAe.rcompareIdentifiers}});var Yg,GD=Ce(()=>{Yg={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.3",author:"Lovell Fuller ",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert ","Jonathan Ong ","Chanon Sajjamanochai ","Juliano Julio ","Daniel Gasienica ","Julian Walker ","Amit Pitaru ","Brandon Aaron ","Andreas Lind ","Maurus Cuelenaere ","Linus Unneb\xE4ck ","Victor Mateevitsi ","Alaric Holloway ","Bernhard K. Weisshuhn ","Chris Riley ","David Carley ","John Tobin ","Kenton Gray ","Felix B\xFCnemann ","Samy Al Zahrani ","Chintan Thakkar ","F. Orlando Galashan ","Kleis Auke Wolthuizen ","Matt Hirsch ","Matthias Thoemmes ","Patrick Paskaris ","J\xE9r\xE9my Lal ","Rahul Nanwani ","Alice Monday ","Kristo Jorgenson ","YvesBos ","Guy Maliar ","Nicolas Coden ","Matt Parrish ","Marcel Bretschneider ","Matthew McEachen ","Jarda Kot\u011B\u0161ovec ","Kenric D'Souza ","Oleh Aleinyk ","Marcel Bretschneider ","Andrea Bianco ","Rik Heywood ","Thomas Parisot ","Nathan Graves ","Tom Lokhorst ","Espen Hovlandsdal ","Sylvain Dumont ","Alun Davies ","Aidan Hoolachan ","Axel Eirola ","Freezy ","Daiz ","Julian Aubourg ","Keith Belovay ","Michael B. Klein ","Jordan Prudhomme ","Ilya Ovdin ","Andargor ","Paul Neave ","Brendan Kennedy ","Brychan Bennett-Odlum ","Edward Silverton ","Roman Malieiev ","Tomas Szabo ","Robert O'Rourke ","Guillermo Alfonso Varela Chouci\xF1o ","Christian Flintrup ","Manan Jadhav ","Leon Radley ","alza54 ","Jacob Smith ","Michael Nutt ","Brad Parham ","Taneli Vatanen ","Joris Dugu\xE9 ","Chris Banks ","Ompal Singh ","Brodan ","Ankur Parihar ","Brahim Ait elhaj ","Mart Jansink ","Lachlan Newman ","Dennis Beatty ","Ingvar Stepanyan ","Don Denton ","Dmytro Tiapukhin ","Florian Lefebvre "],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as UB}from"node:child_process";import{createHash as e1e}from"node:crypto";var HB,QL,A1e,uAe,t1e,yL,r1e,BAe,a1e,wh,i1e,o1e,n1e,s1e,fAe,g1e,CAe,c1e,I1e,QAe,l1e,p1e,yAe,fL,d1e,FD,mL=Ce(()=>{HB=qe(PD(),1),QL=qe(mD(),1);GD();A1e=process.env.npm_package_config_libvips||Yg.config.libvips,uAe=HB.default.coerce(A1e).version,t1e=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],yL={encoding:"utf8",shell:!0},r1e=n=>{n instanceof Error?console.error(`sharp: Installation error: ${n.message}`):console.log(`sharp: ${n}`)},BAe=()=>QL.default.isNonGlibcLinuxSync()?QL.default.familySync():"",a1e=()=>`${process.platform}${BAe()}-${process.arch}`,wh=()=>{if(fAe())return"wasm32";let{npm_config_arch:n,npm_config_platform:t,npm_config_libc:o}=process.env,i=typeof o=="string"?o:BAe();return`${t||process.platform}${i}-${n||process.arch}`},i1e=()=>{try{return $e(`@img/sharp-libvips-dev-${wh()}/include`)}catch{try{return $e("@img/sharp-libvips-dev/include")}catch{}}return""},o1e=()=>{try{return $e("@img/sharp-libvips-dev/cplusplus")}catch{}return""},n1e=()=>{try{return $e(`@img/sharp-libvips-dev-${wh()}/lib`)}catch{try{return $e(`@img/sharp-libvips-${wh()}/lib`)}catch{}}return""},s1e=()=>{if(process.release?.name==="node"&&process.versions&&!HB.default.satisfies(process.versions.node,Yg.engines.node))return{found:process.versions.node,expected:Yg.engines.node}},fAe=()=>{let{CC:n}=process.env;return!!n?.endsWith("/emcc")},g1e=()=>process.platform==="darwin"&&process.arch==="x64"?(UB("sysctl sysctl.proc_translated",yL).stdout||"").trim()==="sysctl.proc_translated: 1":!1,CAe=n=>e1e("sha512").update(n).digest("hex"),c1e=()=>{try{let n=CAe(`imgsharp-libvips-${wh()}`),t=HB.default.coerce(Yg.optionalDependencies[`@img/sharp-libvips-${wh()}`],{includePrerelease:!0}).version;return CAe(`${n}npm:${t}`).slice(0,10)}catch{}return""},I1e=()=>UB(`node-gyp rebuild --directory=src ${fAe()?"--nodedir=emscripten":""}`,{...yL,stdio:"inherit"}).status,QAe=()=>process.platform!=="win32"?(UB("pkg-config --modversion vips-cpp",{...yL,env:{...process.env,PKG_CONFIG_PATH:yAe()}}).stdout||"").trim():"",l1e=()=>{try{let n=(UB("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(n)return`${n}/lib/pkgconfig`}catch{}},p1e=()=>{try{let n=(UB("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(n)return n}catch{}},yAe=()=>process.platform!=="win32"?[l1e(),p1e(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",fL=(n,t,o)=>(o&&o(`Detected ${t}, skipping search for globally-installed libvips`),n),d1e=n=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return fL(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",n);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return fL(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",n);if(g1e())return fL(!1,"Rosetta",n);let t=QAe();return!!t&&HB.default.gte(t,uAe)},FD={minimumLibvipsVersion:uAe,prebuiltPlatforms:t1e,buildPlatformArch:wh,buildSharpLibvipsIncludeDir:i1e,buildSharpLibvipsCPlusPlusDir:o1e,buildSharpLibvipsLibDir:n1e,isUnsupportedNodeRuntime:s1e,runtimePlatformArch:a1e,log:r1e,yarnLocator:c1e,spawnRebuild:I1e,globalLibvipsVersion:QAe,pkgConfigPath:yAe,useGlobalLibvips:d1e}});import{createRequire as h1e}from"node:module";var LD,qr,SAe,E1e,mAe,C1e,u1e,jg,Lt,rI,St,KB=Ce(()=>{LD=qe(mD(),1);mL();GD();qr=h1e(import.meta.url),{version:SAe}=Yg,{runtimePlatformArch:E1e,isUnsupportedNodeRuntime:mAe,prebuiltPlatforms:C1e,minimumLibvipsVersion:u1e}=FD,jg=E1e(),rI=[];try{Lt=qr(`../src/build/Release/sharp-${jg}-${SAe}.node`)}catch(n){rI.push(n)}if(!Lt)try{Lt=qr(`../src/build/Release/sharp-wasm32-${SAe}.node`)}catch(n){rI.push(n)}if(!Lt)try{switch(jg){case"darwin-arm64":Lt=qr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":Lt=qr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":Lt=qr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":Lt=qr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":Lt=qr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":Lt=qr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":Lt=qr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":Lt=qr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":Lt=qr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":Lt=qr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":Lt=qr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":Lt=qr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":Lt=qr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":Lt=qr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":Lt=qr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(Lt&&["linux-x64","linuxmusl-x64"].includes(jg)&&!Lt._isUsingX64V2()){let n=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");n.code="Unsupported CPU",rI.push(n),Lt=null}Lt&&process.versions.electron&&jg.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(n){rI.push(n)}if(!Lt)try{Lt=qr("@img/sharp-wasm32/sharp.node")}catch(n){rI.push(n)}if(!Lt){let[n,t,o]=["linux","darwin","win32"].map(a=>jg.startsWith(a)),i=[`Could not load the "sharp" module using the ${jg} runtime`];rI.forEach(a=>{a.code.endsWith("MODULE_NOT_FOUND")||i.push(`${a.code}: ${a.message}`)});let e=rI.map(a=>a.message).join(" ");if(i.push("Possible solutions:"),mAe()){let{found:a,expected:A}=mAe();i.push("- Please upgrade Node.js:",` Found ${a}`,` Requires ${A}`)}else if(C1e.includes(jg)){let[a,A]=jg.split("-"),r=a.endsWith("musl")?" --libc=musl":"";i.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${a.replace("musl","")}${r} --cpu=${A} sharp`)}else i.push(`- Manually install libvips >= ${u1e}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(n&&/(symbol not found|CXXABI_)/i.test(e))try{let{config:a}=qr(`@img/sharp-libvips-${jg}/package`),A=`${(0,LD.familySync)()} ${(0,LD.versionSync)()}`,r=`${a.musl?"musl":"glibc"} ${a.musl||a.glibc}`;i.push("- Update your OS:",` Found ${A}`,` Requires ${r}`)}catch{}throw n&&/\/snap\/core[0-9]{2}/.test(e)&&i.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(e)&&i.push("- Update Homebrew:"," brew update && brew upgrade vips"),rI.some(a=>a.code==="ERR_DLOPEN_DISABLED")&&i.push("- Run Node.js without using the --no-addons flag"),o&&/The specified procedure could not be found/.test(e)&&i.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),i.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(i.join(` -`))}St=Lt});import B1e from"node:util";import SL from"node:stream";function y1e(){let n=this.constructor.call(),{debuglog:t,queueListener:o,...i}=this.options;return n.options=structuredClone(i),n.options.debuglog=t,n.options.queueListener=o,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),n.options.input.buffer=this.options.input.buffer,n.emit("finish")}),n}var f1e,Q1e,Hl,Ps,wAe=Ce(()=>{Ts();KB();f1e=B1e.debuglog("sharp"),Q1e=n=>{Hl.queue.emit("change",n)},Hl=function(n,t){if(arguments.length===1&&!O.defined(n))throw new Error("Invalid input");return this instanceof Hl?(SL.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:o=>{this.emit("warning",o),f1e(o)},queueListener:Q1e},this.options.input=this._createInputDescriptor(n,t,{allowStream:!0}),this):new Hl(n,t)};Object.setPrototypeOf(Hl.prototype,SL.Duplex.prototype);Object.setPrototypeOf(Hl,SL.Duplex);Object.assign(Hl.prototype,{clone:y1e});Ps=Hl});function DAe(n){let t=S1e.filter(o=>O.defined(n[o])).map(o=>[o,n[o]]);return t.length?Object.fromEntries(t):void 0}function w1e(n,t,o){let i={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(O.string(n))i.file=n;else if(O.buffer(n)){if(n.length===0)throw Error("Input Buffer is empty");i.buffer=n}else if(O.arrayBuffer(n)){if(n.byteLength===0)throw Error("Input bit Array is empty");i.buffer=Buffer.from(n,0,n.byteLength)}else if(O.typedArray(n)){if(n.length===0)throw Error("Input Bit Array is empty");i.buffer=Buffer.from(n.buffer,n.byteOffset,n.byteLength)}else if(O.plainObject(n)&&!O.defined(t))t=n,DAe(t)&&(i.buffer=[]);else if(!O.defined(n)&&!O.defined(t)&&O.object(o)&&o.allowStream)i.buffer=[];else if(Array.isArray(n))if(n.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=n.map(e=>this._createInputDescriptor(e));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${n}' of type ${typeof n}${O.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(O.object(t)){if(O.defined(t.failOn))if(O.string(t.failOn)&&O.inArray(t.failOn,["none","truncated","error","warning"]))i.failOn=t.failOn;else throw O.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(O.defined(t.autoOrient))if(O.bool(t.autoOrient))i.autoOrient=t.autoOrient;else throw O.invalidParameterError("autoOrient","boolean",t.autoOrient);if(O.defined(t.density))if(O.number(t.density)&&O.inRange(t.density,1,1e5))i.density=t.density;else throw O.invalidParameterError("density","number between 1 and 100000",t.density);if(O.defined(t.ignoreIcc))if(O.bool(t.ignoreIcc))i.ignoreIcc=t.ignoreIcc;else throw O.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(O.defined(t.limitInputPixels))if(O.bool(t.limitInputPixels))i.limitInputPixels=t.limitInputPixels?16383**2:0;else if(O.integer(t.limitInputPixels)&&O.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))i.limitInputPixels=t.limitInputPixels;else throw O.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(O.defined(t.limitInputChannels))if(O.bool(t.limitInputChannels))i.limitInputChannels=t.limitInputChannels?5:0;else if(O.integer(t.limitInputChannels)&&O.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))i.limitInputChannels=t.limitInputChannels;else throw O.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(O.defined(t.unlimited))if(O.bool(t.unlimited))i.unlimited=t.unlimited;else throw O.invalidParameterError("unlimited","boolean",t.unlimited);if(O.defined(t.sequentialRead))if(O.bool(t.sequentialRead))i.sequentialRead=t.sequentialRead;else throw O.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(O.defined(t.raw)){if(O.object(t.raw)&&O.integer(t.raw.width)&&O.inRange(t.raw.width,1,1e8)&&O.integer(t.raw.height)&&O.inRange(t.raw.height,1,1e8)&&O.integer(t.raw.channels)&&O.inRange(t.raw.channels,1,4))switch(i.rawWidth=t.raw.width,i.rawHeight=t.raw.height,i.rawChannels=t.raw.channels,n.constructor){case Uint8Array:case Uint8ClampedArray:i.rawDepth="uchar";break;case Int8Array:i.rawDepth="char";break;case Uint16Array:i.rawDepth="ushort";break;case Int16Array:i.rawDepth="short";break;case Uint32Array:i.rawDepth="uint";break;case Int32Array:i.rawDepth="int";break;case Float32Array:i.rawDepth="float";break;case Float64Array:i.rawDepth="double";break;default:i.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(i.rawPremultiplied=!1,O.defined(t.raw.premultiplied))if(O.bool(t.raw.premultiplied))i.rawPremultiplied=t.raw.premultiplied;else throw O.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(i.rawPageHeight=0,O.defined(t.raw.pageHeight))if(O.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);i.rawPageHeight=t.raw.pageHeight}else throw O.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(O.defined(t.animated))if(O.bool(t.animated))i.pages=t.animated?-1:1;else throw O.invalidParameterError("animated","boolean",t.animated);if(O.defined(t.pages))if(O.integer(t.pages)&&O.inRange(t.pages,-1,1e5))i.pages=t.pages;else throw O.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(O.defined(t.page))if(O.integer(t.page)&&O.inRange(t.page,0,1e5))i.page=t.page;else throw O.invalidParameterError("page","integer between 0 and 100000",t.page);if(O.object(t.openSlide)&&O.defined(t.openSlide.level))if(O.integer(t.openSlide.level)&&O.inRange(t.openSlide.level,0,256))i.openSlideLevel=t.openSlide.level;else throw O.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(O.defined(t.level))if(O.integer(t.level)&&O.inRange(t.level,0,256))i.openSlideLevel=t.level;else throw O.invalidParameterError("level","integer between 0 and 256",t.level);if(O.object(t.tiff)&&O.defined(t.tiff.subifd))if(O.integer(t.tiff.subifd)&&O.inRange(t.tiff.subifd,-1,1e5))i.tiffSubifd=t.tiff.subifd;else throw O.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(O.defined(t.subifd))if(O.integer(t.subifd)&&O.inRange(t.subifd,-1,1e5))i.tiffSubifd=t.subifd;else throw O.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(O.object(t.svg)){if(O.defined(t.svg.stylesheet))if(O.string(t.svg.stylesheet))i.svgStylesheet=t.svg.stylesheet;else throw O.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(O.defined(t.svg.highBitdepth))if(O.bool(t.svg.highBitdepth))i.svgHighBitdepth=t.svg.highBitdepth;else throw O.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(O.object(t.pdf)&&O.defined(t.pdf.background)?i.pdfBackground=this._getBackgroundColourOption(t.pdf.background):O.defined(t.pdfBackground)&&(i.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),O.object(t.jp2)&&O.defined(t.jp2.oneshot))if(O.bool(t.jp2.oneshot))i.jp2Oneshot=t.jp2.oneshot;else throw O.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(O.defined(t.create))if(O.object(t.create)&&O.integer(t.create.width)&&O.inRange(t.create.width,1,1e8)&&O.integer(t.create.height)&&O.inRange(t.create.height,1,1e8)&&O.integer(t.create.channels)){if(i.createWidth=t.create.width,i.createHeight=t.create.height,i.createChannels=t.create.channels,i.createPageHeight=0,O.defined(t.create.pageHeight))if(O.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);i.createPageHeight=t.create.pageHeight}else throw O.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(O.defined(t.create.noise)){if(!O.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(i.createNoiseType=t.create.noise.type,!O.inRange(t.create.channels,1,4))throw O.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(i.createNoiseMean=128,O.defined(t.create.noise.mean))if(O.number(t.create.noise.mean)&&O.inRange(t.create.noise.mean,0,1e4))i.createNoiseMean=t.create.noise.mean;else throw O.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(i.createNoiseSigma=30,O.defined(t.create.noise.sigma))if(O.number(t.create.noise.sigma)&&O.inRange(t.create.noise.sigma,0,1e4))i.createNoiseSigma=t.create.noise.sigma;else throw O.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(O.defined(t.create.background)){if(!O.inRange(t.create.channels,3,4))throw O.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);i.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete i.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(O.defined(t.text))if(O.object(t.text)&&O.string(t.text.text)){if(i.textValue=t.text.text,O.defined(t.text.height)&&O.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(O.defined(t.text.font))if(O.string(t.text.font))i.textFont=t.text.font;else throw O.invalidParameterError("text.font","string",t.text.font);if(O.defined(t.text.fontfile))if(O.string(t.text.fontfile))i.textFontfile=t.text.fontfile;else throw O.invalidParameterError("text.fontfile","string",t.text.fontfile);if(O.defined(t.text.width))if(O.integer(t.text.width)&&O.inRange(t.text.width,1,1e6))i.textWidth=t.text.width;else throw O.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(O.defined(t.text.height))if(O.integer(t.text.height)&&O.inRange(t.text.height,1,1e6))i.textHeight=t.text.height;else throw O.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(O.defined(t.text.align))if(O.string(t.text.align)&&O.string(this.constructor.align[t.text.align]))i.textAlign=this.constructor.align[t.text.align];else throw O.invalidParameterError("text.align","valid alignment",t.text.align);if(O.defined(t.text.justify))if(O.bool(t.text.justify))i.textJustify=t.text.justify;else throw O.invalidParameterError("text.justify","boolean",t.text.justify);if(O.defined(t.text.dpi))if(O.integer(t.text.dpi)&&O.inRange(t.text.dpi,1,1e6))i.textDpi=t.text.dpi;else throw O.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(O.defined(t.text.rgba))if(O.bool(t.text.rgba))i.textRgba=t.text.rgba;else throw O.invalidParameterError("text.rgba","bool",t.text.rgba);if(O.defined(t.text.spacing))if(O.integer(t.text.spacing)&&O.inRange(t.text.spacing,-1e6,1e6))i.textSpacing=t.text.spacing;else throw O.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(O.defined(t.text.wrap))if(O.string(t.text.wrap)&&O.inArray(t.text.wrap,["word","char","word-char","none"]))i.textWrap=t.text.wrap;else throw O.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete i.buffer}else throw new Error("Expected a valid string to create an image with text.");if(O.defined(t.join))if(O.defined(this.options.join)){if(O.defined(t.join.animated))if(O.bool(t.join.animated))i.joinAnimated=t.join.animated;else throw O.invalidParameterError("join.animated","boolean",t.join.animated);if(O.defined(t.join.across))if(O.integer(t.join.across)&&O.inRange(t.join.across,1,1e6))i.joinAcross=t.join.across;else throw O.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(O.defined(t.join.shim))if(O.integer(t.join.shim)&&O.inRange(t.join.shim,0,1e6))i.joinShim=t.join.shim;else throw O.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(O.defined(t.join.background)&&(i.joinBackground=this._getBackgroundColourOption(t.join.background)),O.defined(t.join.halign))if(O.string(t.join.halign)&&O.string(this.constructor.align[t.join.halign]))i.joinHalign=this.constructor.align[t.join.halign];else throw O.invalidParameterError("join.halign","valid alignment",t.join.halign);if(O.defined(t.join.valign))if(O.string(t.join.valign)&&O.string(this.constructor.align[t.join.valign]))i.joinValign=this.constructor.align[t.join.valign];else throw O.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(O.defined(t))throw new Error(`Invalid input options ${t}`);return i}function D1e(n,t,o){Array.isArray(this.options.input.buffer)?O.buffer(n)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(n),o()):o(new Error("Non-Buffer data on Writable Stream")):o(new Error("Unexpected data on Writable Stream"))}function O1e(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function b1e(){return Array.isArray(this.options.input.buffer)}function M1e(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.metadata(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)})}):St.metadata(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)}),this):this._isStreamInput()?new Promise((o,i)=>{let e=()=>{this._flattenBufferIn(),St.metadata(this.options,(a,A)=>{a?i(O.nativeError(a,t)):o(A)})};this.writableFinished?e():this.once("finish",e)}):new Promise((o,i)=>{St.metadata(this.options,(e,a)=>{e?i(O.nativeError(e,t)):o(a)})})}function _1e(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.stats(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)})}):St.stats(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)}),this):this._isStreamInput()?new Promise((o,i)=>{this.on("finish",function(){this._flattenBufferIn(),St.stats(this.options,(e,a)=>{e?i(O.nativeError(e,t)):o(a)})})}):new Promise((o,i)=>{St.stats(this.options,(e,a)=>{e?i(O.nativeError(e,t)):o(a)})})}var m1e,S1e,OAe,bAe=Ce(()=>{Ts();KB();m1e={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},S1e=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];OAe=n=>{Object.assign(n.prototype,{_inputOptionsFromObject:DAe,_createInputDescriptor:w1e,_write:D1e,_flattenBufferIn:O1e,_isStreamInput:b1e,metadata:M1e,stats:_1e}),n.align=m1e}});function DL(n){return n.angle%360!==0||n.rotationAngle!==0}function UD(n){return n.width!==-1||n.height!==-1}function R1e(n,t,o){if(UD(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),O.defined(n))if(O.object(n)&&!O.defined(o))o=n;else if(O.integer(n)&&n>0)this.options.width=n;else throw O.invalidParameterError("width","positive integer",n);else this.options.width=-1;if(O.defined(t))if(O.integer(t)&&t>0)this.options.height=t;else throw O.invalidParameterError("height","positive integer",t);else this.options.height=-1;if(O.object(o)){if(O.defined(o.width))if(O.integer(o.width)&&o.width>0)this.options.width=o.width;else throw O.invalidParameterError("width","positive integer",o.width);if(O.defined(o.height))if(O.integer(o.height)&&o.height>0)this.options.height=o.height;else throw O.invalidParameterError("height","positive integer",o.height);if(O.defined(o.fit)){let i=N1e[o.fit];if(O.string(i))this.options.canvas=i;else throw O.invalidParameterError("fit","valid fit",o.fit)}if(O.defined(o.position)){let i=O.integer(o.position)?o.position:NAe[o.position]||TAe[o.position]||_Ae[o.position];if(O.integer(i)&&(O.inRange(i,0,8)||O.inRange(i,16,17)))this.options.position=i;else throw O.invalidParameterError("position","valid position/gravity/strategy",o.position)}if(this._setBackgroundColourOption("resizeBackground",o.background),O.defined(o.kernel))if(O.string(wL[o.kernel]))this.options.kernel=wL[o.kernel];else throw O.invalidParameterError("kernel","valid kernel name",o.kernel);O.defined(o.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",o.withoutEnlargement),O.defined(o.withoutReduction)&&this._setBooleanOption("withoutReduction",o.withoutReduction),O.defined(o.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",o.fastShrinkOnLoad)}return DL(this.options)&&UD(this.options)&&(this.options.rotateBefore=!0),this}function k1e(n){if(O.integer(n))if(O.inRange(n,1,1e4))this.options.extendTop=n,this.options.extendBottom=n,this.options.extendLeft=n,this.options.extendRight=n;else throw O.invalidParameterError("extend","integer between 1 and 10000",n);else if(O.object(n)){if(O.defined(n.top))if(O.integer(n.top)&&O.inRange(n.top,0,1e4))this.options.extendTop=n.top;else throw O.invalidParameterError("top","integer between 0 and 10000",n.top);if(O.defined(n.bottom))if(O.integer(n.bottom)&&O.inRange(n.bottom,0,1e4))this.options.extendBottom=n.bottom;else throw O.invalidParameterError("bottom","integer between 0 and 10000",n.bottom);if(O.defined(n.left))if(O.integer(n.left)&&O.inRange(n.left,0,1e4))this.options.extendLeft=n.left;else throw O.invalidParameterError("left","integer between 0 and 10000",n.left);if(O.defined(n.right))if(O.integer(n.right)&&O.inRange(n.right,0,1e4))this.options.extendRight=n.right;else throw O.invalidParameterError("right","integer between 0 and 10000",n.right);if(this._setBackgroundColourOption("extendBackground",n.background),O.defined(n.extendWith))if(O.string(MAe[n.extendWith]))this.options.extendWith=MAe[n.extendWith];else throw O.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",n.extendWith)}else throw O.invalidParameterError("extend","integer or object",n);return this}function v1e(n){let t=UD(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(o){let i=n[o];if(O.integer(i)&&O.inRange(i,0,1e8))this.options[o+(o==="left"||o==="top"?"Offset":"")+t]=i;else throw O.invalidParameterError(o,"integer between 0 and 100000000",i)},this),DL(this.options)&&!UD(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function P1e(n){if(this.options.trimThreshold=10,O.defined(n))if(O.object(n)){if(O.defined(n.background)&&this._setBackgroundColourOption("trimBackground",n.background),O.defined(n.threshold))if(O.number(n.threshold)&&n.threshold>=0)this.options.trimThreshold=n.threshold;else throw O.invalidParameterError("threshold","positive number",n.threshold);if(O.defined(n.lineArt)&&this._setBooleanOption("trimLineArt",n.lineArt),O.defined(n.margin))if(O.integer(n.margin)&&O.inRange(n.margin,0,1e7))this.options.trimMargin=n.margin;else throw O.invalidParameterError("margin","integer between 0 and 10000000",n.margin)}else throw O.invalidParameterError("trim","object",n);return DL(this.options)&&(this.options.rotateBefore=!0),this}var _Ae,TAe,MAe,NAe,wL,T1e,N1e,RAe,kAe=Ce(()=>{Ts();_Ae={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},TAe={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},MAe={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},NAe={entropy:16,attention:17},wL={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},T1e={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},N1e={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};RAe=n=>{Object.assign(n.prototype,{resize:R1e,extend:k1e,extract:v1e,trim:P1e}),n.gravity=_Ae,n.strategy=NAe,n.kernel=wL,n.fit=T1e,n.position=TAe}});function G1e(n){if(!Array.isArray(n))throw O.invalidParameterError("images to composite","array",n);return this.options.composite=n.map(t=>{if(!O.object(t))throw O.invalidParameterError("image to composite","object",t);let o=this._inputOptionsFromObject(t),i={input:this._createInputDescriptor(t.input,o,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(O.defined(t.blend))if(O.string(OL[t.blend]))i.blend=OL[t.blend];else throw O.invalidParameterError("blend","valid blend name",t.blend);if(O.defined(t.tile))if(O.bool(t.tile))i.tile=t.tile;else throw O.invalidParameterError("tile","boolean",t.tile);if(O.defined(t.left))if(O.integer(t.left))i.left=t.left;else throw O.invalidParameterError("left","integer",t.left);if(O.defined(t.top))if(O.integer(t.top))i.top=t.top;else throw O.invalidParameterError("top","integer",t.top);if(O.defined(t.top)!==O.defined(t.left))throw new Error("Expected both left and top to be set");if(i.hasOffset=O.integer(t.top)&&O.integer(t.left),O.defined(t.gravity))if(O.integer(t.gravity)&&O.inRange(t.gravity,0,8))i.gravity=t.gravity;else if(O.string(t.gravity)&&O.integer(this.constructor.gravity[t.gravity]))i.gravity=this.constructor.gravity[t.gravity];else throw O.invalidParameterError("gravity","valid gravity",t.gravity);if(O.defined(t.premultiplied))if(O.bool(t.premultiplied))i.premultiplied=t.premultiplied;else throw O.invalidParameterError("premultiplied","boolean",t.premultiplied);return i}),this}var OL,vAe,PAe=Ce(()=>{Ts();OL={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};vAe=n=>{n.prototype.composite=G1e,n.blend=OL}});function F1e(n,t){if(!O.defined(n))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),O.integer(n)&&!(n%90))this.options.angle=n;else if(O.number(n))this.options.rotationAngle=n,O.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw O.invalidParameterError("angle","numeric",n);return this}function L1e(){return this.options.input.autoOrient=!0,this}function U1e(n){return this.options.flip=O.bool(n)?n:!0,this}function H1e(n){return this.options.flop=O.bool(n)?n:!0,this}function K1e(n,t){let i=Array.isArray(n)&&(n.length===4&&n.every(O.number)||n.length===2&&n.every(e=>Array.isArray(e)&&e.length===2))?n.flat():[];if(i.length===4&&i.every(O.number))this.options.affineMatrix=i;else throw O.invalidParameterError("matrix","1x4 or 2x2 array",n);if(O.defined(t))if(O.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),O.defined(t.idx))if(O.number(t.idx))this.options.affineIdx=t.idx;else throw O.invalidParameterError("options.idx","number",t.idx);if(O.defined(t.idy))if(O.number(t.idy))this.options.affineIdy=t.idy;else throw O.invalidParameterError("options.idy","number",t.idy);if(O.defined(t.odx))if(O.number(t.odx))this.options.affineOdx=t.odx;else throw O.invalidParameterError("options.odx","number",t.odx);if(O.defined(t.ody))if(O.number(t.ody))this.options.affineOdy=t.ody;else throw O.invalidParameterError("options.ody","number",t.ody);if(O.defined(t.interpolator))if(O.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw O.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw O.invalidParameterError("options","object",t);return this}function x1e(n){if(O.plainObject(n)){if(O.number(n.sigma)&&O.inRange(n.sigma,1e-6,10))this.options.sharpenSigma=n.sigma;else throw O.invalidParameterError("options.sigma","number between 0.000001 and 10",n.sigma);if(O.defined(n.m1))if(O.number(n.m1)&&O.inRange(n.m1,0,1e6))this.options.sharpenM1=n.m1;else throw O.invalidParameterError("options.m1","number between 0 and 1000000",n.m1);if(O.defined(n.m2))if(O.number(n.m2)&&O.inRange(n.m2,0,1e6))this.options.sharpenM2=n.m2;else throw O.invalidParameterError("options.m2","number between 0 and 1000000",n.m2);if(O.defined(n.x1))if(O.number(n.x1)&&O.inRange(n.x1,0,1e6))this.options.sharpenX1=n.x1;else throw O.invalidParameterError("options.x1","number between 0 and 1000000",n.x1);if(O.defined(n.y2))if(O.number(n.y2)&&O.inRange(n.y2,0,1e6))this.options.sharpenY2=n.y2;else throw O.invalidParameterError("options.y2","number between 0 and 1000000",n.y2);if(O.defined(n.y3))if(O.number(n.y3)&&O.inRange(n.y3,0,1e6))this.options.sharpenY3=n.y3;else throw O.invalidParameterError("options.y3","number between 0 and 1000000",n.y3)}else this.options.sharpenSigma=-1;return this}function Y1e(n){if(!O.defined(n))this.options.medianSize=3;else if(O.integer(n)&&O.inRange(n,1,1e3))this.options.medianSize=n;else throw O.invalidParameterError("size","integer between 1 and 1000",n);return this}function j1e(n){let t;if(O.number(n))t=n;else if(O.plainObject(n)){if(!O.number(n.sigma))throw O.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=n.sigma,"precision"in n)if(O.string(GAe[n.precision]))this.options.precision=GAe[n.precision];else throw O.invalidParameterError("precision","one of: integer, float, approximate",n.precision);if("minAmplitude"in n)if(O.number(n.minAmplitude)&&O.inRange(n.minAmplitude,.001,1))this.options.minAmpl=n.minAmplitude;else throw O.invalidParameterError("minAmplitude","number between 0.001 and 1",n.minAmplitude)}if(!O.defined(n))this.options.blurSigma=-1;else if(O.bool(n))this.options.blurSigma=n?-1:0;else if(O.number(t)&&O.inRange(t,.3,1e3))this.options.blurSigma=t;else throw O.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function J1e(n){if(!O.defined(n))this.options.dilateWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.dilateWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function q1e(n){if(!O.defined(n))this.options.erodeWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.erodeWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function z1e(n){return this.options.flatten=O.bool(n)?n:!0,O.object(n)&&this._setBackgroundColourOption("flattenBackground",n.background),this}function V1e(){return this.options.unflatten=!0,this}function W1e(n,t){if(!O.defined(n))this.options.gamma=2.2;else if(O.number(n)&&O.inRange(n,1,3))this.options.gamma=n;else throw O.invalidParameterError("gamma","number between 1.0 and 3.0",n);if(!O.defined(t))this.options.gammaOut=this.options.gamma;else if(O.number(t)&&O.inRange(t,1,3))this.options.gammaOut=t;else throw O.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function Z1e(n){if(this.options.negate=O.bool(n)?n:!0,O.plainObject(n)&&"alpha"in n)if(O.bool(n.alpha))this.options.negateAlpha=n.alpha;else throw O.invalidParameterError("alpha","should be boolean value",n.alpha);return this}function X1e(n){if(O.plainObject(n)){if(O.defined(n.lower))if(O.number(n.lower)&&O.inRange(n.lower,0,99))this.options.normaliseLower=n.lower;else throw O.invalidParameterError("lower","number between 0 and 99",n.lower);if(O.defined(n.upper))if(O.number(n.upper)&&O.inRange(n.upper,1,100))this.options.normaliseUpper=n.upper;else throw O.invalidParameterError("upper","number between 1 and 100",n.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw O.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function $1e(n){return this.normalise(n)}function e3e(n){if(O.plainObject(n)){if(O.integer(n.width)&&O.inRange(n.width,1,65536))this.options.claheWidth=n.width;else throw O.invalidParameterError("width","integer between 1 and 65536",n.width);if(O.integer(n.height)&&O.inRange(n.height,1,65536))this.options.claheHeight=n.height;else throw O.invalidParameterError("height","integer between 1 and 65536",n.height);if(O.defined(n.maxSlope))if(O.integer(n.maxSlope)&&O.inRange(n.maxSlope,0,100))this.options.claheMaxSlope=n.maxSlope;else throw O.invalidParameterError("maxSlope","integer between 0 and 100",n.maxSlope)}else throw O.invalidParameterError("options","plain object",n);return this}function A3e(n){if(!O.object(n)||!Array.isArray(n.kernel)||!O.integer(n.width)||!O.integer(n.height)||!O.inRange(n.width,3,1001)||!O.inRange(n.height,3,1001)||n.height*n.width!==n.kernel.length||!n.kernel.every(O.number))throw new Error("Invalid convolution kernel");return O.integer(n.scale)||(n.scale=n.kernel.reduce((t,o)=>t+o,0)),n.scale<1&&(n.scale=1),O.integer(n.offset)||(n.offset=0),this.options.convKernel=n,this}function t3e(n,t){if(!O.defined(n))this.options.threshold=128;else if(O.bool(n))this.options.threshold=n?128:0;else if(O.integer(n)&&O.inRange(n,0,255))this.options.threshold=n;else throw O.invalidParameterError("threshold","integer between 0 and 255",n);return!O.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function r3e(n,t,o){if(this.options.boolean=this._createInputDescriptor(n,o),O.string(t)&&O.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw O.invalidParameterError("operator","one of: and, or, eor",t);return this}function a3e(n,t){if(!O.defined(n)&&O.number(t)?n=1:O.number(n)&&!O.defined(t)&&(t=0),!O.defined(n))this.options.linearA=[];else if(O.number(n))this.options.linearA=[n];else if(Array.isArray(n)&&n.length&&n.every(O.number))this.options.linearA=n;else throw O.invalidParameterError("a","number or array of numbers",n);if(!O.defined(t))this.options.linearB=[];else if(O.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(O.number))this.options.linearB=t;else throw O.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function i3e(n){if(!Array.isArray(n))throw O.invalidParameterError("inputMatrix","array",n);let t=n.length;if(t!==3&&t!==4)throw O.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!n.every(i=>Array.isArray(i)&&i.length===t))throw O.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,n);let o=n.flat();if(!o.every(O.number))throw O.invalidParameterError("inputMatrix","array of numbers",o);return this.options.recombMatrix=o,this}function o3e(n){if(!O.plainObject(n))throw O.invalidParameterError("options","plain object",n);if("brightness"in n)if(O.number(n.brightness)&&n.brightness>=0)this.options.brightness=n.brightness;else throw O.invalidParameterError("brightness","number above zero",n.brightness);if("saturation"in n)if(O.number(n.saturation)&&n.saturation>=0)this.options.saturation=n.saturation;else throw O.invalidParameterError("saturation","number above zero",n.saturation);if("hue"in n)if(O.integer(n.hue))this.options.hue=n.hue%360;else throw O.invalidParameterError("hue","number",n.hue);if("lightness"in n)if(O.number(n.lightness))this.options.lightness=n.lightness;else throw O.invalidParameterError("lightness","number",n.lightness);return this}var GAe,FAe,LAe=Ce(()=>{Ts();GAe={integer:"integer",float:"float",approximate:"approximate"};FAe=n=>{Object.assign(n.prototype,{autoOrient:L1e,rotate:F1e,flip:U1e,flop:H1e,affine:K1e,sharpen:x1e,erode:q1e,dilate:J1e,median:Y1e,blur:j1e,flatten:z1e,unflatten:V1e,gamma:W1e,negate:Z1e,normalise:X1e,normalize:$1e,clahe:e3e,convolve:A3e,threshold:t3e,boolean:r3e,linear:a3e,recomb:i3e,modulate:o3e})}});var jAe=$((ymA,YAe)=>{var NL=Object.defineProperty,n3e=Object.getOwnPropertyDescriptor,s3e=Object.getOwnPropertyNames,g3e=Object.prototype.hasOwnProperty,c3e=(n,t)=>{for(var o in t)NL(n,o,{get:t[o],enumerable:!0})},I3e=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of s3e(t))!g3e.call(n,e)&&e!==o&&NL(n,e,{get:()=>t[e],enumerable:!(i=n3e(t,e))||i.enumerable});return n},l3e=n=>I3e(NL({},"__esModule",{value:!0}),n),UAe={};c3e(UAe,{default:()=>D3e});YAe.exports=l3e(UAe);var bL={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let n in bL)Object.freeze(bL[n]);var Gs=Object.freeze(bL),HAe=Object.create(null);for(let n in Gs)Object.hasOwn(Gs,n)&&(HAe[Gs[n]]=n);var qi={to:{},get:{}};qi.get=function(n){let t=n.slice(0,3).toLowerCase(),o,i;switch(t){case"hsl":{o=qi.get.hsl(n),i="hsl";break}case"hwb":{o=qi.get.hwb(n),i="hwb";break}default:{o=qi.get.rgb(n),i="rgb";break}}return o?{model:i,value:o}:null};qi.get.rgb=function(n){if(!n)return null;let t=/^#([a-f\d]{3,4})$/i,o=/^#([a-f\d]{6})([a-f\d]{2})?$/i,i=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,e=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,a=/^(\w+)$/,A=[0,0,0,1],r,s,g;if(r=n.match(o)){for(g=r[2],r=r[1],s=0;s<3;s++){let c=s*2;A[s]=Number.parseInt(r.slice(c,c+2),16)}g&&(A[3]=Number.parseInt(g,16)/255)}else if(r=n.match(t)){for(r=r[1],g=r[3],s=0;s<3;s++)A[s]=Number.parseInt(r[s]+r[s],16);g&&(A[3]=Number.parseInt(g+g,16)/255)}else if(r=n.match(i)){for(s=0;s<3;s++)A[s]=Number.parseFloat(r[s+1]);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else if(r=n.match(e)){for(s=0;s<3;s++)A[s]=Math.round(Number.parseFloat(r[s+1])*2.55);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else return(r=n.toLowerCase().match(a))?r[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Gs,r[1])?(A=Gs[r[1]].slice(),A[3]=1,A):null:null;for(s=0;s<3;s++)A[s]=aI(A[s],0,255);return A[3]=aI(A[3],0,1),A};qi.get.hsl=function(n){if(!n)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let i=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,a=aI(Number.parseFloat(o[2]),0,100),A=aI(Number.parseFloat(o[3]),0,100),r=aI(Number.isNaN(i)?1:i,0,1);return[e,a,A,r]}return null};qi.get.hwb=function(n){if(!n)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let i=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,a=aI(Number.parseFloat(o[2]),0,100),A=aI(Number.parseFloat(o[3]),0,100),r=aI(Number.isNaN(i)?1:i,0,1);return[e,a,A,r]}return null};qi.to.hex=function(...n){return"#"+HD(n[0])+HD(n[1])+HD(n[2])+(n[3]<1?HD(Math.round(n[3]*255)):"")};qi.to.rgb=function(...n){return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};qi.to.rgb.percent=function(...n){let t=Math.round(n[0]/255*100),o=Math.round(n[1]/255*100),i=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+t+"%, "+o+"%, "+i+"%)":"rgba("+t+"%, "+o+"%, "+i+"%, "+n[3]+")"};qi.to.hsl=function(...n){return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};qi.to.hwb=function(...n){let t="";return n.length>=4&&n[3]!==1&&(t=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+t+")"};qi.to.keyword=function(...n){return HAe[n.slice(0,3)]};function aI(n,t,o){return Math.min(Math.max(t,n),o)}function HD(n){let t=Math.round(n).toString(16).toUpperCase();return t.length<2?"0"+t:t}var Dh=qi,KAe={};for(let n of Object.keys(Gs))KAe[Gs[n]]=n;var sA={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Kl=sA,Jg=(6/29)**3;function bh(n){let t=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,t),1)}function Mh(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(let n of Object.keys(sA)){if(!("channels"in sA[n]))throw new Error("missing channels property: "+n);if(!("labels"in sA[n]))throw new Error("missing channel labels property: "+n);if(sA[n].labels.length!==sA[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:t,labels:o}=sA[n];delete sA[n].channels,delete sA[n].labels,Object.defineProperty(sA[n],"channels",{value:t}),Object.defineProperty(sA[n],"labels",{value:o})}sA.rgb.hsl=function(n){let t=n[0]/255,o=n[1]/255,i=n[2]/255,e=Math.min(t,o,i),a=Math.max(t,o,i),A=a-e,r,s;switch(a){case e:{r=0;break}case t:{r=(o-i)/A;break}case o:{r=2+(i-t)/A;break}case i:{r=4+(t-o)/A;break}}r=Math.min(r*60,360),r<0&&(r+=360);let g=(e+a)/2;return a===e?s=0:g<=.5?s=A/(a+e):s=A/(2-a-e),[r,s*100,g*100]};sA.rgb.hsv=function(n){let t,o,i,e,a,A=n[0]/255,r=n[1]/255,s=n[2]/255,g=Math.max(A,r,s),c=g-Math.min(A,r,s),I=function(d){return(g-d)/6/c+1/2};if(c===0)e=0,a=0;else{switch(a=c/g,t=I(A),o=I(r),i=I(s),g){case A:{e=i-o;break}case r:{e=1/3+t-i;break}case s:{e=2/3+o-t;break}}e<0?e+=1:e>1&&(e-=1)}return[e*360,a*100,g*100]};sA.rgb.hwb=function(n){let t=n[0],o=n[1],i=n[2],e=sA.rgb.hsl(n)[0],a=1/255*Math.min(t,Math.min(o,i));return i=1-1/255*Math.max(t,Math.max(o,i)),[e,a*100,i*100]};sA.rgb.oklab=function(n){let t=Mh(n[0]/255),o=Mh(n[1]/255),i=Mh(n[2]/255),e=Math.cbrt(.4122214708*t+.5363325363*o+.0514459929*i),a=Math.cbrt(.2119034982*t+.6806995451*o+.1073969566*i),A=Math.cbrt(.0883024619*t+.2817188376*o+.6299787005*i),r=.2104542553*e+.793617785*a-.0040720468*A,s=1.9779984951*e-2.428592205*a+.4505937099*A,g=.0259040371*e+.7827717662*a-.808675766*A;return[r*100,s*100,g*100]};sA.rgb.cmyk=function(n){let t=n[0]/255,o=n[1]/255,i=n[2]/255,e=Math.min(1-t,1-o,1-i),a=(1-t-e)/(1-e)||0,A=(1-o-e)/(1-e)||0,r=(1-i-e)/(1-e)||0;return[a*100,A*100,r*100,e*100]};function p3e(n,t){return(n[0]-t[0])**2+(n[1]-t[1])**2+(n[2]-t[2])**2}sA.rgb.keyword=function(n){let t=KAe[n];if(t)return t;let o=Number.POSITIVE_INFINITY,i;for(let e of Object.keys(Gs)){let a=Gs[e],A=p3e(n,a);AJg?o**(1/3):7.787*o+16/116,i=i>Jg?i**(1/3):7.787*i+16/116,e=e>Jg?e**(1/3):7.787*e+16/116;let a=116*i-16,A=500*(o-i),r=200*(i-e);return[a,A,r]};sA.hsl.rgb=function(n){let t=n[0]/360,o=n[1]/100,i=n[2]/100,e,a;if(o===0)return a=i*255,[a,a,a];let A=i<.5?i*(1+o):i+o-i*o,r=2*i-A,s=[0,0,0];for(let g=0;g<3;g++)e=t+1/3*-(g-1),e<0&&e++,e>1&&e--,6*e<1?a=r+(A-r)*6*e:2*e<1?a=A:3*e<2?a=r+(A-r)*(2/3-e)*6:a=r,s[g]=a*255;return s};sA.hsl.hsv=function(n){let t=n[0],o=n[1]/100,i=n[2]/100,e=o,a=Math.max(i,.01);i*=2,o*=i<=1?i:2-i,e*=a<=1?a:2-a;let A=(i+o)/2,r=i===0?2*e/(a+e):2*o/(i+o);return[t,r*100,A*100]};sA.hsv.rgb=function(n){let t=n[0]/60,o=n[1]/100,i=n[2]/100,e=Math.floor(t)%6,a=t-Math.floor(t),A=255*i*(1-o),r=255*i*(1-o*a),s=255*i*(1-o*(1-a));switch(i*=255,e){case 0:return[i,s,A];case 1:return[r,i,A];case 2:return[A,i,s];case 3:return[A,r,i];case 4:return[s,A,i];case 5:return[i,A,r]}};sA.hsv.hsl=function(n){let t=n[0],o=n[1]/100,i=n[2]/100,e=Math.max(i,.01),a,A;A=(2-o)*i;let r=(2-o)*e;return a=o*e,a/=r<=1?r:2-r,a=a||0,A/=2,[t,a*100,A*100]};sA.hwb.rgb=function(n){let t=n[0]/360,o=n[1]/100,i=n[2]/100,e=o+i,a;e>1&&(o/=e,i/=e);let A=Math.floor(6*t),r=1-i;a=6*t-A,(A&1)!==0&&(a=1-a);let s=o+a*(r-o),g,c,I;switch(A){default:case 6:case 0:{g=r,c=s,I=o;break}case 1:{g=s,c=r,I=o;break}case 2:{g=o,c=r,I=s;break}case 3:{g=o,c=s,I=r;break}case 4:{g=s,c=o,I=r;break}case 5:{g=r,c=o,I=s;break}}return[g*255,c*255,I*255]};sA.cmyk.rgb=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=n[3]/100,a=1-Math.min(1,t*(1-e)+e),A=1-Math.min(1,o*(1-e)+e),r=1-Math.min(1,i*(1-e)+e);return[a*255,A*255,r*255]};sA.xyz.rgb=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e,a,A;return e=t*3.2404542+o*-1.5371385+i*-.4985314,a=t*-.969266+o*1.8760108+i*.041556,A=t*.0556434+o*-.2040259+i*1.0572252,e=bh(e),a=bh(a),A=bh(A),[e*255,a*255,A*255]};sA.xyz.lab=function(n){let t=n[0],o=n[1],i=n[2];t/=95.047,o/=100,i/=108.883,t=t>Jg?t**(1/3):7.787*t+16/116,o=o>Jg?o**(1/3):7.787*o+16/116,i=i>Jg?i**(1/3):7.787*i+16/116;let e=116*o-16,a=500*(t-o),A=200*(o-i);return[e,a,A]};sA.xyz.oklab=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=Math.cbrt(.8189330101*t+.3618667424*o-.1288597137*i),a=Math.cbrt(.0329845436*t+.9293118715*o+.0361456387*i),A=Math.cbrt(.0482003018*t+.2643662691*o+.633851707*i),r=.2104542553*e+.793617785*a-.0040720468*A,s=1.9779984951*e-2.428592205*a+.4505937099*A,g=.0259040371*e+.7827717662*a-.808675766*A;return[r*100,s*100,g*100]};sA.oklab.oklch=function(n){return sA.lab.lch(n)};sA.oklab.xyz=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=(.999999998*t+.396337792*o+.215803758*i)**3,a=(1.000000008*t-.105561342*o-.063854175*i)**3,A=(1.000000055*t-.089484182*o-1.291485538*i)**3,r=1.227013851*e-.55779998*a+.281256149*A,s=-.040580178*e+1.11225687*a-.071676679*A,g=-.076381285*e-.421481978*a+1.58616322*A;return[r*100,s*100,g*100]};sA.oklab.rgb=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=(t+.3963377774*o+.2158037573*i)**3,a=(t-.1055613458*o-.0638541728*i)**3,A=(t-.0894841775*o-1.291485548*i)**3,r=bh(4.0767416621*e-3.3077115913*a+.2309699292*A),s=bh(-1.2684380046*e+2.6097574011*a-.3413193965*A),g=bh(-.0041960863*e-.7034186147*a+1.707614701*A);return[r*255,s*255,g*255]};sA.oklch.oklab=function(n){return sA.lch.lab(n)};sA.lab.xyz=function(n){let t=n[0],o=n[1],i=n[2],e,a,A;a=(t+16)/116,e=o/500+a,A=a-i/200;let r=a**3,s=e**3,g=A**3;return a=r>Jg?r:(a-16/116)/7.787,e=s>Jg?s:(e-16/116)/7.787,A=g>Jg?g:(A-16/116)/7.787,e*=95.047,a*=100,A*=108.883,[e,a,A]};sA.lab.lch=function(n){let t=n[0],o=n[1],i=n[2],e;e=Math.atan2(i,o)*360/2/Math.PI,e<0&&(e+=360);let A=Math.sqrt(o*o+i*i);return[t,A,e]};sA.lch.lab=function(n){let t=n[0],o=n[1],e=n[2]/360*2*Math.PI,a=o*Math.cos(e),A=o*Math.sin(e);return[t,a,A]};sA.rgb.ansi16=function(n,t=null){let[o,i,e]=n,a=t===null?sA.rgb.hsv(n)[2]:t;if(a=Math.round(a/50),a===0)return 30;let A=30+(Math.round(e/255)<<2|Math.round(i/255)<<1|Math.round(o/255));return a===2&&(A+=60),A};sA.hsv.ansi16=function(n){return sA.rgb.ansi16(sA.hsv.rgb(n),n[2])};sA.rgb.ansi256=function(n){let t=n[0],o=n[1],i=n[2];return t>>4===o>>4&&o>>4===i>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(i/255*5)};sA.ansi16.rgb=function(n){n=n[0];let t=n%10;if(t===0||t===7)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let o=(Math.trunc(n>50)+1)*.5,i=(t&1)*o*255,e=(t>>1&1)*o*255,a=(t>>2&1)*o*255;return[i,e,a]};sA.ansi256.rgb=function(n){if(n=n[0],n>=232){let a=(n-232)*10+8;return[a,a,a]}n-=16;let t,o=Math.floor(n/36)/5*255,i=Math.floor((t=n%36)/6)/5*255,e=t%6/5*255;return[o,i,e]};sA.rgb.hex=function(n){let o=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(o.length)+o};sA.hex.rgb=function(n){let t=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let o=t[0];t[0].length===3&&(o=[...o].map(r=>r+r).join(""));let i=Number.parseInt(o,16),e=i>>16&255,a=i>>8&255,A=i&255;return[e,a,A]};sA.rgb.hcg=function(n){let t=n[0]/255,o=n[1]/255,i=n[2]/255,e=Math.max(Math.max(t,o),i),a=Math.min(Math.min(t,o),i),A=e-a,r,s=A<1?a/(1-A):0;return A<=0?r=0:e===t?r=(o-i)/A%6:e===o?r=2+(i-t)/A:r=4+(t-o)/A,r/=6,r%=1,[r*360,A*100,s*100]};sA.hsl.hcg=function(n){let t=n[1]/100,o=n[2]/100,i=o<.5?2*t*o:2*t*(1-o),e=0;return i<1&&(e=(o-.5*i)/(1-i)),[n[0],i*100,e*100]};sA.hsv.hcg=function(n){let t=n[1]/100,o=n[2]/100,i=t*o,e=0;return i<1&&(e=(o-i)/(1-i)),[n[0],i*100,e*100]};sA.hcg.rgb=function(n){let t=n[0]/360,o=n[1]/100,i=n[2]/100;if(o===0)return[i*255,i*255,i*255];let e=[0,0,0],a=t%1*6,A=a%1,r=1-A,s=0;switch(Math.floor(a)){case 0:{e[0]=1,e[1]=A,e[2]=0;break}case 1:{e[0]=r,e[1]=1,e[2]=0;break}case 2:{e[0]=0,e[1]=1,e[2]=A;break}case 3:{e[0]=0,e[1]=r,e[2]=1;break}case 4:{e[0]=A,e[1]=0,e[2]=1;break}default:e[0]=1,e[1]=0,e[2]=r}return s=(1-o)*i,[(o*e[0]+s)*255,(o*e[1]+s)*255,(o*e[2]+s)*255]};sA.hcg.hsv=function(n){let t=n[1]/100,o=n[2]/100,i=t+o*(1-t),e=0;return i>0&&(e=t/i),[n[0],e*100,i*100]};sA.hcg.hsl=function(n){let t=n[1]/100,i=n[2]/100*(1-t)+.5*t,e=0;return i>0&&i<.5?e=t/(2*i):i>=.5&&i<1&&(e=t/(2*(1-i))),[n[0],e*100,i*100]};sA.hcg.hwb=function(n){let t=n[1]/100,o=n[2]/100,i=t+o*(1-t);return[n[0],(i-t)*100,(1-i)*100]};sA.hwb.hcg=function(n){let t=n[1]/100,i=1-n[2]/100,e=i-t,a=0;return e<1&&(a=(i-e)/(1-e)),[n[0],e*100,a*100]};sA.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};sA.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};sA.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};sA.gray.hsl=function(n){return[0,0,n[0]]};sA.gray.hsv=sA.gray.hsl;sA.gray.hwb=function(n){return[0,100,n[0]]};sA.gray.cmyk=function(n){return[0,0,0,n[0]]};sA.gray.lab=function(n){return[n[0],0,0]};sA.gray.hex=function(n){let t=Math.round(n[0]/100*255)&255,i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(i.length)+i};sA.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};function d3e(){let n={},t=Object.keys(Kl);for(let{length:o}=t,i=0;i0;){let i=o.pop(),e=Object.keys(Kl[i]);for(let{length:a}=e,A=0;A1&&(o=i),n(o))};return"conversion"in n&&(t.conversion=n.conversion),t}function y3e(n){let t=function(...o){let i=o[0];if(i==null)return i;i.length>1&&(o=i);let e=n(o);if(typeof e=="object")for(let{length:a}=e,A=0;A0){this.model=t||"rgb",i=Eo[this.model].channels;let e=Array.prototype.slice.call(n,0,i);this.color=TL(e,i),this.valpha=typeof n[i]=="number"?n[i]:1}else if(typeof n=="number")this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;let e=Object.keys(n);"alpha"in n&&(e.splice(e.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);let a=e.sort().join("");if(!(a in ML))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=ML[a];let{labels:A}=Eo[this.model],r=[];for(o=0;o(n%360+360)%360),saturationl:wr("hsl",1,zr(100)),lightness:wr("hsl",2,zr(100)),saturationv:wr("hsv",1,zr(100)),value:wr("hsv",2,zr(100)),chroma:wr("hcg",1,zr(100)),gray:wr("hcg",2,zr(100)),white:wr("hwb",1,zr(100)),wblack:wr("hwb",2,zr(100)),cyan:wr("cmyk",0,zr(100)),magenta:wr("cmyk",1,zr(100)),yellow:wr("cmyk",2,zr(100)),black:wr("cmyk",3,zr(100)),x:wr("xyz",0,zr(95.047)),y:wr("xyz",1,zr(100)),z:wr("xyz",2,zr(108.833)),l:wr("lab",0,zr(100)),a:wr("lab",1),b:wr("lab",2),keyword(n){return n!==void 0?new la(n):Eo[this.model].keyword(this.color)},hex(n){return n!==void 0?new la(n):Dh.to.hex(...this.rgb().round().color)},hexa(n){if(n!==void 0)return new la(n);let t=this.rgb().round().color,o=Math.round(this.valpha*255).toString(16).toUpperCase();return o.length===1&&(o="0"+o),Dh.to.hex(...t)+o},rgbNumber(){let n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity(){let n=this.rgb().color,t=[];for(let[o,i]of n.entries()){let e=i/255;t[o]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(n){let t=this.luminosity(),o=n.luminosity();return t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)},level(n){let t=this.contrast(n);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let n=this.rgb().color;return(n[0]*2126+n[1]*7152+n[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let n=this.rgb();for(let t=0;t<3;t++)n.color[t]=255-n.color[t];return n},lighten(n){let t=this.hsl();return t.color[2]+=t.color[2]*n,t},darken(n){let t=this.hsl();return t.color[2]-=t.color[2]*n,t},saturate(n){let t=this.hsl();return t.color[1]+=t.color[1]*n,t},desaturate(n){let t=this.hsl();return t.color[1]-=t.color[1]*n,t},whiten(n){let t=this.hwb();return t.color[1]+=t.color[1]*n,t},blacken(n){let t=this.hwb();return t.color[2]+=t.color[2]*n,t},grayscale(){let n=this.rgb().color,t=n[0]*.3+n[1]*.59+n[2]*.11;return la.rgb(t,t,t)},fade(n){return this.alpha(this.valpha-this.valpha*n)},opaquer(n){return this.alpha(this.valpha+this.valpha*n)},rotate(n){let t=this.hsl(),o=t.color[0];return o=(o+n)%360,o=o<0?360+o:o,t.color[0]=o,t},mix(n,t){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);let o=n.rgb(),i=this.rgb(),e=t===void 0?.5:t,a=2*e-1,A=o.alpha()-i.alpha(),r=((a*A===-1?a:(a+A)/(1+a*A))+1)/2,s=1-r;return la.rgb(r*o.red()+s*i.red(),r*o.green()+s*i.green(),r*o.blue()+s*i.blue(),o.alpha()*e+i.alpha()*(1-e))}};for(let n of Object.keys(Eo)){if(xAe.includes(n))continue;let{channels:t}=Eo[n];la.prototype[n]=function(...o){return this.model===n?new la(this):o.length>0?new la(o,n):new la([...w3e(Eo[this.model][n].raw(this.color)),this.valpha],n)},la[n]=function(...o){let i=o[0];return typeof i=="number"&&(i=TL(o,t)),new la(i,n)}}function m3e(n,t){return Number(n.toFixed(t))}function S3e(n){return function(t){return m3e(t,n)}}function wr(n,t,o){n=Array.isArray(n)?n:[n];for(let i of n)(_L[i]||=[])[t]=o;return n=n[0],function(i){let e;return i!==void 0?(o&&(i=o(i)),e=this[n](),e.color[t]=i,e):(e=this[n]().color[t],o&&(e=o(e)),e)}}function zr(n){return function(t){return Math.max(0,Math.min(n,t))}}function w3e(n){return Array.isArray(n)?n:[n]}function TL(n,t){for(let o=0;o{JAe.exports=jAe().default});function O3e(n){return this._setBackgroundColourOption("tint",n),this}function b3e(n){return this.options.greyscale=O.bool(n)?n:!0,this}function M3e(n){return this.greyscale(n)}function _3e(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspacePipeline=n,this}function T3e(n){return this.pipelineColourspace(n)}function N3e(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspace=n,this}function R3e(n){return this.toColourspace(n)}function WAe(n){if(O.object(n)||O.string(n)&&n.length>=3&&n.length<=200){let t=(0,VAe.default)(n),o=t.red(),i=t.green(),e=t.blue(),a=Math.round(t.alpha()*255);for(let[A,r]of[["red",o],["green",i],["blue",e],["alpha",a]])if(!O.number(r))throw O.invalidParameterError(`background.${A}`,"number",r);return[o,i,e,a]}else throw O.invalidParameterError("background","object or string",n)}function k3e(n,t){O.defined(t)&&(this.options[n]=WAe(t))}var VAe,zAe,ZAe,XAe=Ce(()=>{VAe=qe(qAe(),1);Ts();zAe={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};ZAe=n=>{Object.assign(n.prototype,{tint:O3e,greyscale:b3e,grayscale:M3e,pipelineColourspace:_3e,pipelineColorspace:T3e,toColourspace:N3e,toColorspace:R3e,_getBackgroundColourOption:WAe,_setBackgroundColourOption:k3e}),n.colourspace=zAe,n.colorspace=zAe}});function P3e(){return this.options.removeAlpha=!0,this}function G3e(n){if(O.defined(n))if(O.number(n)&&O.inRange(n,0,1))this.options.ensureAlpha=n;else throw O.invalidParameterError("alpha","number between 0 and 1",n);else this.options.ensureAlpha=1;return this}function F3e(n){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(n)&&(n=t[n]),O.integer(n)&&O.inRange(n,0,4))this.options.extractChannel=n;else throw O.invalidParameterError("channel","integer or one of: red, green, blue, alpha",n);return this}function L3e(n,t){return Array.isArray(n)?n.forEach(function(o){this.options.joinChannelIn.push(this._createInputDescriptor(o,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(n,t)),this}function U3e(n){if(O.string(n)&&O.inArray(n,["and","or","eor"]))this.options.bandBoolOp=n;else throw O.invalidParameterError("boolOp","one of: and, or, eor",n);return this}var v3e,$Ae,ete=Ce(()=>{Ts();v3e={and:"and",or:"or",eor:"eor"};$Ae=n=>{Object.assign(n.prototype,{removeAlpha:P3e,ensureAlpha:G3e,extractChannel:F3e,joinChannel:L3e,bandbool:U3e}),n.bool=v3e}});import RL from"node:path";function K3e(n,t){let o;if(O.string(n)?O.string(this.options.input.file)&&RL.resolve(this.options.input.file)===RL.resolve(n)?o=new Error("Cannot use same file for input and output"):H3e.test(RL.extname(n))&&!this.constructor.format.jp2.output.file&&(o=tte()):o=new Error("Missing output file path"),o)if(O.fn(t))t(o);else return Promise.reject(o);else{this.options.fileOut=n;let i=Error();return this._pipeline(t,i)}return this}function x3e(n,t){O.object(n)?this._setBooleanOption("resolveWithObject",n.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let o=Error();return this._pipeline(O.fn(n)?n:t,o)}function Y3e(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let n=Error();return this._pipeline(null,n)}function j3e(n){if(O.number(n)&&n>0)this.options.withMetadataDensity=n;else throw O.invalidParameterError("density","positive number",n);return this.keepExif()}function J3e(){return this.options.keepMetadata|=1,this}function q3e(n){if(O.object(n))for(let[t,o]of Object.entries(n))if(O.object(o))for(let[i,e]of Object.entries(o))if(O.string(e))this.options.withExif[`exif-${t.toLowerCase()}-${i}`]=e;else throw O.invalidParameterError(`${t}.${i}`,"string",e);else throw O.invalidParameterError(t,"object",o);else throw O.invalidParameterError("exif","object",n);return this.options.withExifMerge=!1,this.keepExif()}function z3e(n){return this.withExif(n),this.options.withExifMerge=!0,this}function V3e(){return this.options.keepMetadata|=8,this}function W3e(n,t){if(O.string(n))this.options.withIccProfile=n;else throw O.invalidParameterError("icc","string",n);if(this.keepIccProfile(),O.object(t)&&O.defined(t.attach))if(O.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw O.invalidParameterError("attach","boolean",t.attach);return this}function Z3e(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function X3e(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function $3e(){return this.options.keepMetadata|=2,this}function eje(n){if(O.string(n)&&n.length>0)this.options.withXmp=n,this.options.keepMetadata|=2;else throw O.invalidParameterError("xmp","non-empty string",n);return this}function Aje(){return this.options.keepMetadata|=31,this}function tje(n){if(this.keepMetadata(),this.withIccProfile("srgb"),O.object(n)){if(O.defined(n.orientation))if(O.integer(n.orientation)&&O.inRange(n.orientation,1,8))this.options.withMetadataOrientation=n.orientation;else throw O.invalidParameterError("orientation","integer between 1 and 8",n.orientation);if(O.defined(n.density))if(O.number(n.density)&&n.density>0)this.options.withMetadataDensity=n.density;else throw O.invalidParameterError("density","positive number",n.density);O.defined(n.icc)&&this.withIccProfile(n.icc),O.defined(n.exif)&&this.withExifMerge(n.exif)}return this}function rje(n,t){let o=Ate.get((O.object(n)&&O.string(n.id)?n.id:n).toLowerCase());if(!o)throw O.invalidParameterError("format",`one of: ${[...Ate.keys()].join(", ")}`,n);return this[o](t)}function aje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jpegQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.progressive)&&this._setBooleanOption("jpegProgressive",n.progressive),O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);let t=O.bool(n.optimizeCoding)?n.optimizeCoding:n.optimiseCoding;if(O.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),O.defined(n.mozjpeg))if(O.bool(n.mozjpeg))n.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw O.invalidParameterError("mozjpeg","boolean",n.mozjpeg);let o=O.bool(n.trellisQuantization)?n.trellisQuantization:n.trellisQuantisation;O.defined(o)&&this._setBooleanOption("jpegTrellisQuantisation",o),O.defined(n.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",n.overshootDeringing);let i=O.bool(n.optimizeScans)?n.optimizeScans:n.optimiseScans;O.defined(i)&&(this._setBooleanOption("jpegOptimiseScans",i),i&&(this.options.jpegProgressive=!0));let e=O.number(n.quantizationTable)?n.quantizationTable:n.quantisationTable;if(O.defined(e))if(O.integer(e)&&O.inRange(e,0,8))this.options.jpegQuantisationTable=e;else throw O.invalidParameterError("quantisationTable","integer between 0 and 8",e)}return this._updateFormatOut("jpeg",n)}function ije(n){if(O.object(n)){if(O.defined(n.progressive)&&this._setBooleanOption("pngProgressive",n.progressive),O.defined(n.compressionLevel))if(O.integer(n.compressionLevel)&&O.inRange(n.compressionLevel,0,9))this.options.pngCompressionLevel=n.compressionLevel;else throw O.invalidParameterError("compressionLevel","integer between 0 and 9",n.compressionLevel);O.defined(n.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",n.adaptiveFiltering);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.pngBitdepth=rte(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.palette)?this._setBooleanOption("pngPalette",n.palette):[n.quality,n.effort,n.colours,n.colors,n.dither].some(O.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,0,100))this.options.pngQuality=n.quality;else throw O.invalidParameterError("quality","integer between 0 and 100",n.quality);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.pngEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.pngDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither)}}return this._updateFormatOut("png",n)}function oje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.webpQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.alphaQuality))if(O.integer(n.alphaQuality)&&O.inRange(n.alphaQuality,0,100))this.options.webpAlphaQuality=n.alphaQuality;else throw O.invalidParameterError("alphaQuality","integer between 0 and 100",n.alphaQuality);if(O.defined(n.lossless)&&this._setBooleanOption("webpLossless",n.lossless),O.defined(n.nearLossless)&&this._setBooleanOption("webpNearLossless",n.nearLossless),O.defined(n.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",n.smartSubsample),O.defined(n.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",n.smartDeblock),O.defined(n.preset))if(O.string(n.preset)&&O.inArray(n.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=n.preset;else throw O.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",n.preset);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,6))this.options.webpEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 6",n.effort);O.defined(n.minSize)&&this._setBooleanOption("webpMinSize",n.minSize),O.defined(n.mixed)&&this._setBooleanOption("webpMixed",n.mixed),O.defined(n.exact)&&this._setBooleanOption("webpExact",n.exact)}return kL(n,this.options),this._updateFormatOut("webp",n)}function nje(n){if(O.object(n)){O.defined(n.reuse)&&this._setBooleanOption("gifReuse",n.reuse),O.defined(n.progressive)&&this._setBooleanOption("gifProgressive",n.progressive);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.gifBitdepth=rte(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.gifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.gifDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither);if(O.defined(n.interFrameMaxError))if(O.number(n.interFrameMaxError)&&O.inRange(n.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=n.interFrameMaxError;else throw O.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",n.interFrameMaxError);if(O.defined(n.interPaletteMaxError))if(O.number(n.interPaletteMaxError)&&O.inRange(n.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=n.interPaletteMaxError;else throw O.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",n.interPaletteMaxError);if(O.defined(n.keepDuplicateFrames))if(O.bool(n.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",n.keepDuplicateFrames);else throw O.invalidParameterError("keepDuplicateFrames","boolean",n.keepDuplicateFrames)}return kL(n,this.options),this._updateFormatOut("gif",n)}function sje(n){if(!this.constructor.format.jp2.output.buffer)throw tte();if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jp2Quality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jp2Lossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.jp2TileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.jp2TileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling)}return this._updateFormatOut("jp2",n)}function kL(n,t){if(O.object(n)&&O.defined(n.loop))if(O.integer(n.loop)&&O.inRange(n.loop,0,65535))t.loop=n.loop;else throw O.invalidParameterError("loop","integer between 0 and 65535",n.loop);if(O.object(n)&&O.defined(n.delay))if(O.integer(n.delay)&&O.inRange(n.delay,0,65535))t.delay=[n.delay];else if(Array.isArray(n.delay)&&n.delay.every(O.integer)&&n.delay.every(o=>O.inRange(o,0,65535)))t.delay=n.delay;else throw O.invalidParameterError("delay","integer or an array of integers between 0 and 65535",n.delay)}function gje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.tiffQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[1,2,4]))this.options.tiffBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","1, 2 or 4",n.bitdepth);if(O.defined(n.tile)&&this._setBooleanOption("tiffTile",n.tile),O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.tiffTileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.tiffTileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.miniswhite)&&this._setBooleanOption("tiffMiniswhite",n.miniswhite),O.defined(n.pyramid)&&this._setBooleanOption("tiffPyramid",n.pyramid),O.defined(n.xres))if(O.number(n.xres)&&O.inRange(n.xres,.001,1e6))this.options.tiffXres=n.xres;else throw O.invalidParameterError("xres","number between 0.001 and 1000000",n.xres);if(O.defined(n.yres))if(O.number(n.yres)&&O.inRange(n.yres,.001,1e6))this.options.tiffYres=n.yres;else throw O.invalidParameterError("yres","number between 0.001 and 1000000",n.yres);if(O.defined(n.compression))if(O.string(n.compression)&&O.inArray(n.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=n.compression;else throw O.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",n.compression);if(O.defined(n.bigtiff)&&this._setBooleanOption("tiffBigtiff",n.bigtiff),O.defined(n.predictor))if(O.string(n.predictor)&&O.inArray(n.predictor,["none","horizontal","float"]))this.options.tiffPredictor=n.predictor;else throw O.invalidParameterError("predictor","one of: none, horizontal, float",n.predictor);if(O.defined(n.resolutionUnit))if(O.string(n.resolutionUnit)&&O.inArray(n.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=n.resolutionUnit;else throw O.invalidParameterError("resolutionUnit","one of: inch, cm",n.resolutionUnit)}return this._updateFormatOut("tiff",n)}function cje(n){return this.heif({...n,compression:"av1"})}function Ije(n){if(O.object(n)){if(O.string(n.compression)&&O.inArray(n.compression,["av1","hevc"]))this.options.heifCompression=n.compression;else throw O.invalidParameterError("compression","one of: av1, hevc",n.compression);if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.heifQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.heifLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,9))this.options.heifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 9",n.effort);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[8,10,12]))this.options.heifBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","8, 10 or 12",n.bitdepth);if(O.defined(n.tune))if(O.string(n.tune)&&O.inArray(n.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&n.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=n.tune;else throw O.invalidParameterError("tune","one of: auto, iq, psnr, ssim",n.tune)}else throw O.invalidParameterError("options","Object",n);return this._updateFormatOut("heif",n)}function lje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jxlDistance=n.quality>=30?.1+(100-n.quality)*.09:53/3e3*n.quality*n.quality-23/20*n.quality+25;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);else if(O.defined(n.distance))if(O.number(n.distance)&&O.inRange(n.distance,0,15))this.options.jxlDistance=n.distance;else throw O.invalidParameterError("distance","number between 0.0 and 15.0",n.distance);if(O.defined(n.decodingTier))if(O.integer(n.decodingTier)&&O.inRange(n.decodingTier,0,4))this.options.jxlDecodingTier=n.decodingTier;else throw O.invalidParameterError("decodingTier","integer between 0 and 4",n.decodingTier);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jxlLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,9))this.options.jxlEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 9",n.effort)}return kL(n,this.options),this._updateFormatOut("jxl",n)}function pje(n){if(O.object(n)&&O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=n.depth;else throw O.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",n.depth);return this._updateFormatOut("raw")}function dje(n){if(O.object(n)){if(O.defined(n.size))if(O.integer(n.size)&&O.inRange(n.size,1,8192))this.options.tileSize=n.size;else throw O.invalidParameterError("size","integer between 1 and 8192",n.size);if(O.defined(n.overlap))if(O.integer(n.overlap)&&O.inRange(n.overlap,0,8192)){if(n.overlap>this.options.tileSize)throw O.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,n.overlap);this.options.tileOverlap=n.overlap}else throw O.invalidParameterError("overlap","integer between 0 and 8192",n.overlap);if(O.defined(n.container))if(O.string(n.container)&&O.inArray(n.container,["fs","zip"]))this.options.tileContainer=n.container;else throw O.invalidParameterError("container","one of: fs, zip",n.container);if(O.defined(n.layout))if(O.string(n.layout)&&O.inArray(n.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=n.layout;else throw O.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",n.layout);if(O.defined(n.angle))if(O.integer(n.angle)&&!(n.angle%90))this.options.tileAngle=n.angle;else throw O.invalidParameterError("angle","positive/negative multiple of 90",n.angle);if(this._setBackgroundColourOption("tileBackground",n.background),O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["onepixel","onetile","one"]))this.options.tileDepth=n.depth;else throw O.invalidParameterError("depth","one of: onepixel, onetile, one",n.depth);if(O.defined(n.skipBlanks))if(O.integer(n.skipBlanks)&&O.inRange(n.skipBlanks,-1,65535))this.options.tileSkipBlanks=n.skipBlanks;else throw O.invalidParameterError("skipBlanks","integer between -1 and 255/65535",n.skipBlanks);else O.defined(n.layout)&&n.layout==="google"&&(this.options.tileSkipBlanks=5);let t=O.bool(n.center)?n.center:n.centre;if(O.defined(t)&&this._setBooleanOption("tileCentre",t),O.defined(n.id))if(O.string(n.id))this.options.tileId=n.id;else throw O.invalidParameterError("id","string",n.id);if(O.defined(n.basename))if(O.string(n.basename))this.options.tileBasename=n.basename;else throw O.invalidParameterError("basename","string",n.basename)}if(O.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw O.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function hje(n){if(!O.plainObject(n))throw O.invalidParameterError("options","object",n);if(O.integer(n.seconds)&&O.inRange(n.seconds,0,3600))this.options.timeoutSeconds=n.seconds;else throw O.invalidParameterError("seconds","integer between 0 and 3600",n.seconds);return this}function Eje(n,t){return O.object(t)&&t.force===!1||(this.options.formatOut=n),this}function Cje(n,t){if(O.bool(t))this.options[n]=t;else throw O.invalidParameterError(n,"boolean",t)}function uje(){if(!this.options.streamOut){this.options.streamOut=!0;let n=Error();this._pipeline(void 0,n)}}function Bje(n,t){return typeof n=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(o,i,e)=>{o?n(O.nativeError(o,t)):n(null,i,e)})}):St.pipeline(this.options,(o,i,e)=>{o?n(O.nativeError(o,t)):n(null,i,e)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(o,i,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(i)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):St.pipeline(this.options,(o,i,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(i)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((o,i)=>{this.once("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(e,a,A)=>{e?i(O.nativeError(e,t)):this.options.resolveWithObject?o({data:a,info:A}):o(a)})})}):new Promise((o,i)=>{St.pipeline(this.options,(e,a,A)=>{e?i(O.nativeError(e,t)):this.options.resolveWithObject?o({data:a,info:A}):o(a)})})}var Ate,H3e,tte,rte,ate,ite=Ce(()=>{Ts();KB();Ate=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),H3e=/\.(jp[2x]|j2[kc])$/i,tte=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),rte=n=>1<<31-Math.clz32(Math.ceil(Math.log2(n)));ate=n=>{Object.assign(n.prototype,{toFile:K3e,toBuffer:x3e,toUint8Array:Y3e,withDensity:j3e,keepExif:J3e,withExif:q3e,withExifMerge:z3e,keepIccProfile:V3e,withIccProfile:W3e,keepGainMap:Z3e,withGainMap:X3e,keepXmp:$3e,withXmp:eje,keepMetadata:Aje,withMetadata:tje,toFormat:rje,jpeg:aje,jp2:sje,png:ije,webp:oje,tiff:gje,avif:cje,heif:Ije,jxl:lje,gif:nje,raw:pje,tile:dje,timeout:hje,_updateFormatOut:Eje,_setBooleanOption:Cje,_read:uje,_pipeline:Bje})}});import fje from"node:events";import{createRequire as Qje}from"node:module";import{availableParallelism as yje}from"node:os";function nte(n){if(O.bool(n))return n?St.cache(50,20,100):St.cache(0,0,0);if(O.object(n)){for(let t of["memory","files","items"]){let o=n[t];if(O.defined(o)&&!(O.integer(o)&&o>=0))throw O.invalidParameterError(t,"a positive integer",o)}return St.cache(n.memory,n.files,n.items)}else return St.cache()}function Sje(n){return St.concurrency(O.integer(n)?n:null)}function Dje(){return St.counters()}function Oje(n){return St.simd(O.bool(n)?n:null)}function bje(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))St.block(n.operation,!0);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}function Mje(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))St.block(n.operation,!1);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}var xB,vL,ote,PL,iI,mje,_h,wje,ste,gte=Ce(()=>{xB=qe(mD(),1);Ts();mL();KB();GD();vL=Qje(import.meta.url),ote=FD.runtimePlatformArch(),PL=St.libvipsVersion(),iI=St.format();iI.heif.output.alias=["avif","heic"];iI.jpeg.output.alias=["jpe","jpg"];iI.tiff.output.alias=["tif"];iI.jp2.output.alias=["j2c","j2k","jp2","jpx"];mje={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},_h={vips:PL.semver};if(!PL.isGlobal)if(PL.isWasm)try{_h=vL("@img/sharp-wasm32/versions")}catch{}else try{_h=vL(`@img/sharp-${ote}/versions`)}catch{try{_h=vL(`@img/sharp-libvips-${ote}/versions`)}catch{}}_h.sharp=Yg.version;_h.heif&&iI.heif&&(iI.heif.input.fileSuffix=[".avif"],iI.heif.output.alias=["avif"]);nte(!0);!process.env.MALLOC_ARENA_MAX&&xB.default.familySync()===xB.default.GLIBC&&!St._isUsingJemalloc()?St.concurrency(1):xB.default.familySync()===xB.default.MUSL&&St.concurrency()===1024&&St.concurrency(yje());wje=new fje.EventEmitter;ste=n=>{n.cache=nte,n.concurrency=Sje,n.counters=Dje,n.simd=Oje,n.format=iI,n.interpolators=mje,n.versions=_h,n.queue=wje,n.block=bje,n.unblock=Mje}});var cte={};Fr(cte,{default:()=>_je});var _je,Ite=Ce(()=>{wAe();bAe();kAe();PAe();LAe();XAe();ete();ite();gte();OAe(Ps);RAe(Ps);vAe(Ps);FAe(Ps);ZAe(Ps);$Ae(Ps);ate(Ps);ste(Ps);_je=Ps});var Tje,kA,oI,YB=Ce(()=>{Tje="End-Of-Stream",kA=class extends Error{constructor(){super(Tje),this.name="EndOfStreamError"}},oI=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}}});var KD,lte=Ce(()=>{KD=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((t,o)=>{this.reject=o,this.resolve=t})}}});var nI,xD=Ce(()=>{YB();nI=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(t,o=!1){let i=await this.read(t,o);return this.peekQueue.push(t.subarray(0,i)),i}async read(t,o=!1){if(t.length===0)return 0;let i=this.readFromPeekBuffer(t);if(this.endOfStream||(i+=await this.readRemainderFromStream(t.subarray(i),o)),i===0&&!o)throw new kA;return i}readFromPeekBuffer(t){let o=t.length,i=0;for(;this.peekQueue.length>0&&o>0;){let e=this.peekQueue.pop();if(!e)throw new Error("peekData should be defined");let a=Math.min(e.length,o);t.set(e.subarray(0,a),i),i+=a,o-=a,a{YB();lte();xD();jB=class extends nI{constructor(t){if(super(),this.s=t,this.deferred=null,!t.read||!t.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>{this.endOfStream=!0,this.deferred&&this.deferred.resolve(0)}),this.s.once("error",o=>this.reject(o)),this.s.once("close",()=>this.abort())}async readFromStream(t,o){if(t.length===0)return 0;let i=this.s.read(t.length);if(i)return t.set(i),i.length;let e={buffer:t,mayBeLess:o,deferred:new KD};return this.deferred=e.deferred,this.s.once("readable",()=>{this.readDeferred(e)}),e.deferred.promise}readDeferred(t){let o=this.s.read(t.buffer.length);o?(t.buffer.set(o),t.deferred.resolve(o.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(t)})}reject(t){this.interrupted=!0,this.deferred&&(this.deferred.reject(t),this.deferred=null)}async abort(){this.reject(new oI)}async close(){return this.abort()}}});var YD,dte=Ce(()=>{xD();YD=class extends nI{constructor(t){super(),this.reader=t}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var JB,GL=Ce(()=>{dte();JB=class extends YD{async readFromStream(t,o){if(t.length===0)return 0;let i=await this.reader.read(new Uint8Array(t.length),{min:o?void 0:t.length});return i.done&&(this.endOfStream=i.done),i.value?(t.set(i.value),i.value.length):0}}});var Th,FL=Ce(()=>{YB();xD();Th=class extends nI{constructor(t){super(),this.reader=t,this.buffer=null}writeChunk(t,o){let i=Math.min(o.length,t.length);return t.set(o.subarray(0,i)),i{GL();FL()});var sI=Ce(()=>{YB();pte();GL();FL();hte()});var Kn,Nh=Ce(()=>{sI();Kn=class{constructor(t){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=t?.onClose,t?.abortSignal&&t.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(t,o=this.position){let i=new Uint8Array(t.len);if(await this.readBuffer(i,{position:o})o)return this.position+=o,o}return this.position+=t,t}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(t,o){if(!this.supportsRandomAccess()&&o&&o.position!==void 0&&o.position{Nh();sI();Nje=256e3,qB=class extends Kn{constructor(t,o){super(o),this.streamReader=t,this.fileInfo=o?.fileInfo??{}}async readBuffer(t,o){let i=this.normalizeOptions(t,o),e=i.position-this.position;if(e>0)return await this.ignore(e),this.readBuffer(t,o);if(e<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(i.length===0)return 0;let a=await this.streamReader.read(t.subarray(0,i.length),i.mayBeLess);if(this.position+=a,(!o||!o.mayBeLess)&&a0){let A=new Uint8Array(i.length+a);return e=await this.peekBuffer(A,{mayBeLess:i.mayBeLess}),t.set(A.subarray(a)),e-a}if(a<0)throw new Error("Cannot peek from a negative offset in a stream")}if(i.length>0){try{e=await this.streamReader.peek(t.subarray(0,i.length),i.mayBeLess)}catch(a){if(o?.mayBeLess&&a instanceof kA)return 0;throw a}if(!i.mayBeLess&&e{sI();Nh();jD=class extends Kn{constructor(t,o){super(o),this.uint8Array=t,this.fileInfo={...o?.fileInfo??{},size:t.length}}async readBuffer(t,o){o?.position&&(this.position=o.position);let i=await this.peekBuffer(t,o);return this.position+=i,i}async peekBuffer(t,o){let i=this.normalizeOptions(t,o),e=Math.min(this.uint8Array.length-i.position,i.length);if(!i.mayBeLess&&e{sI();Nh();JD=class extends Kn{constructor(t,o){super(o),this.blob=t,this.fileInfo={...o?.fileInfo??{},size:t.size,mimeType:t.type}}async readBuffer(t,o){o?.position&&(this.position=o.position);let i=await this.peekBuffer(t,o);return this.position+=i,i}async peekBuffer(t,o){let i=this.normalizeOptions(t,o),e=Math.min(this.blob.size-i.position,i.length);if(!i.mayBeLess&&e{if(await o.close(),e)return e()},new qB(o,i)}function qD(n,t){let o=LL(n),i=t??{},e=i.onClose;return i.onClose=async()=>{if(await o.close(),e)return e()},new qB(o,i)}function Co(n,t){return new jD(n,t)}function zD(n,t){return new JD(n,t)}var VD=Ce(()=>{sI();Ete();Cte();ute();sI();Nh()});import{open as kje}from"node:fs/promises";var Rh,UL=Ce(()=>{Nh();sI();Rh=class n extends Kn{static async fromFile(t){let o=await kje(t,"r"),i=await o.stat();return new n(o,{fileInfo:{path:t,size:i.size}})}constructor(t,o){super(o),this.fileHandle=t,this.fileInfo=o.fileInfo}async readBuffer(t,o){let i=this.normalizeOptions(t,o);if(this.position=i.position,i.length===0)return 0;let e=await this.fileHandle.read(t,0,i.length,i.position);if(this.position+=e.bytesRead,e.bytesRead{VD();UL();UL();VD();fte=Rh.fromFile});var Qte=$(KL=>{KL.read=function(n,t,o,i,e){var a,A,r=e*8-i-1,s=(1<>1,c=-7,I=o?e-1:0,d=o?-1:1,B=n[t+I];for(I+=d,a=B&(1<<-c)-1,B>>=-c,c+=r;c>0;a=a*256+n[t+I],I+=d,c-=8);for(A=a&(1<<-c)-1,a>>=-c,c+=i;c>0;A=A*256+n[t+I],I+=d,c-=8);if(a===0)a=1-g;else{if(a===s)return A?NaN:(B?-1:1)*(1/0);A=A+Math.pow(2,i),a=a-g}return(B?-1:1)*A*Math.pow(2,a-i)};KL.write=function(n,t,o,i,e,a){var A,r,s,g=a*8-e-1,c=(1<>1,d=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=i?0:a-1,f=i?1:-1,Q=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,A=c):(A=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-A))<1&&(A--,s*=2),A+I>=1?t+=d/s:t+=d*Math.pow(2,1-I),t*s>=2&&(A++,s/=2),A+I>=c?(r=0,A=c):A+I>=1?(r=(t*s-1)*Math.pow(2,e),A=A+I):(r=t*Math.pow(2,I-1)*Math.pow(2,e),A=0));e>=8;n[o+B]=r&255,B+=f,r/=256,e-=8);for(A=A<0;n[o+B]=A&255,B+=f,A/=256,g-=8);n[o+B-f]|=Q*128}});function Pje(){if(!(typeof globalThis.TextDecoder>"u"))return WD??(WD=new globalThis.TextDecoder("utf-8"))}function Gje(){if(!(typeof globalThis.TextEncoder>"u"))return ZD??(ZD=new globalThis.TextEncoder)}function br(n,t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=Pje();return o?o.decode(n):Lje(n)}case"utf-16le":return Uje(n);case"us-ascii":case"ascii":return Hje(n);case"latin1":case"iso-8859-1":return Kje(n);case"windows-1252":return xje(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function mte(n="",t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=Gje();return o?o.encode(n):Yje(n)}case"utf-16le":return jje(n);case"us-ascii":case"ascii":return Jje(n);case"latin1":case"iso-8859-1":return qje(n);case"windows-1252":return zje(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function YL(n,t){t.length!==0&&(n.push(String.fromCharCode.apply(null,t)),t.length=0)}function vr(n,t,o){t.push(o),t.length>=kh&&YL(n,t)}function Fje(n,t,o){if(o<=65535){vr(n,t,o);return}o-=65536,vr(n,t,55296+(o>>10)),vr(n,t,56320+(o&1023))}function Lje(n){let t=[],o=[],i=0;for(n.length>=3&&n[0]===239&&n[1]===187&&n[2]===191&&(i=3);i244){vr(t,o,_a),i++;continue}if(e<=223){if(i+1>=n.length){vr(t,o,_a),i++;continue}let c=n[i+1];if((c&192)!==128){vr(t,o,_a),i++;continue}let I=(e&31)<<6|c&63;vr(t,o,I),i+=2;continue}if(e<=239){if(i+2>=n.length){vr(t,o,_a),i++;continue}let c=n[i+1],I=n[i+2];if(!((c&192)===128&&(I&192)===128&&!(e===224&&c<160)&&!(e===237&&c>=160))){vr(t,o,_a),i++;continue}let B=(e&15)<<12|(c&63)<<6|I&63;vr(t,o,B),i+=3;continue}if(i+3>=n.length){vr(t,o,_a),i++;continue}let a=n[i+1],A=n[i+2],r=n[i+3];if(!((a&192)===128&&(A&192)===128&&(r&192)===128&&!(e===240&&a<144)&&!(e===244&&a>143))){vr(t,o,_a),i++;continue}let g=(e&7)<<18|(a&63)<<12|(A&63)<<6|r&63;Fje(t,o,g),i+=4}return YL(t,o),t.join("")}function Uje(n){let t=[],o=[],i=n.length,e=0;for(;e+1=55296&&a<=56319){if(e+1=56320&&A<=57343?(vr(t,o,a),vr(t,o,A),e+=2):vr(t,o,_a)}else vr(t,o,_a);continue}if(a>=56320&&a<=57343){vr(t,o,_a);continue}vr(t,o,a)}return e=128&&e<=159?yte[e]:void 0;o+=a??String.fromCharCode(e),o.length>=kh&&(t.push(o),o="")}return o&&t.push(o),t.join("")}function Yje(n){let t=[];for(let o=0;o=55296&&i<=56319)if(o+1=56320&&e<=57343?(i=65536+(i-55296<<10)+(e-56320),o++):i=_a}else i=_a;else i>=56320&&i<=57343&&(i=_a);i<128?t.push(i):i<2048?t.push(192|i>>6,128|i&63):i<65536?t.push(224|i>>12,128|i>>6&63,128|i&63):t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63)}return new Uint8Array(t)}function jje(n){let t=[];for(let i=0;i=55296&&e<=56319){if(i+1=56320&&a<=57343?(t.push(e,a),i++):t.push(_a)}else t.push(_a);continue}if(e>=56320&&e<=57343){t.push(_a);continue}t.push(e)}let o=new Uint8Array(t.length*2);for(let i=0;i>>8}return o}function Jje(n){let t=new Uint8Array(n.length);for(let o=0;o=0&&e<=127||e>=160&&e<=255){t[o]=e;continue}t[o]=63}return t}var yte,xL,WD,ZD,kh,_a,Fs=Ce(()=>{yte={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},xL={};for(let[n,t]of Object.entries(yte))xL[t]=Number.parseInt(n,10);kh=32*1024,_a=65533});var VA={};Fr(VA,{AnsiStringType:()=>JL,Float16_BE:()=>Zje,Float16_LE:()=>Xje,Float32_BE:()=>zL,Float32_LE:()=>$je,Float64_BE:()=>$D,Float64_LE:()=>eJe,Float80_BE:()=>AJe,Float80_LE:()=>tJe,INT16_BE:()=>$o,INT16_LE:()=>Vje,INT24_BE:()=>XD,INT24_LE:()=>Wje,INT32_BE:()=>Ei,INT32_LE:()=>dr,INT64_BE:()=>qL,INT64_LE:()=>WB,INT8:()=>Us,IgnoreType:()=>jL,StringType:()=>Ve,UINT16_BE:()=>LA,UINT16_LE:()=>SA,UINT24_BE:()=>Pr,UINT24_LE:()=>VB,UINT32_BE:()=>xe,UINT32_LE:()=>Le,UINT64_BE:()=>Hs,UINT64_LE:()=>Gr,UINT8:()=>QA,Uint8ArrayType:()=>Ot});function zA(n){return new DataView(n.buffer,n.byteOffset)}var Ls,QA,SA,LA,VB,Pr,Le,xe,Us,$o,Vje,Wje,XD,Ei,dr,Gr,WB,Hs,qL,Zje,Xje,zL,$je,$D,eJe,AJe,tJe,jL,Ot,Ve,JL,DA=Ce(()=>{Ls=qe(Qte(),1);Fs();QA={len:1,get(n,t){return zA(n).getUint8(t)},put(n,t,o){return zA(n).setUint8(t,o),t+1}},SA={len:2,get(n,t){return zA(n).getUint16(t,!0)},put(n,t,o){return zA(n).setUint16(t,o,!0),t+2}},LA={len:2,get(n,t){return zA(n).getUint16(t)},put(n,t,o){return zA(n).setUint16(t,o),t+2}},VB={len:3,get(n,t){let o=zA(n);return o.getUint8(t)+(o.getUint16(t+1,!0)<<8)},put(n,t,o){let i=zA(n);return i.setUint8(t,o&255),i.setUint16(t+1,o>>8,!0),t+3}},Pr={len:3,get(n,t){let o=zA(n);return(o.getUint16(t)<<8)+o.getUint8(t+2)},put(n,t,o){let i=zA(n);return i.setUint16(t,o>>8),i.setUint8(t+2,o&255),t+3}},Le={len:4,get(n,t){return zA(n).getUint32(t,!0)},put(n,t,o){return zA(n).setUint32(t,o,!0),t+4}},xe={len:4,get(n,t){return zA(n).getUint32(t)},put(n,t,o){return zA(n).setUint32(t,o),t+4}},Us={len:1,get(n,t){return zA(n).getInt8(t)},put(n,t,o){return zA(n).setInt8(t,o),t+1}},$o={len:2,get(n,t){return zA(n).getInt16(t)},put(n,t,o){return zA(n).setInt16(t,o),t+2}},Vje={len:2,get(n,t){return zA(n).getInt16(t,!0)},put(n,t,o){return zA(n).setInt16(t,o,!0),t+2}},Wje={len:3,get(n,t){let o=VB.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let i=zA(n);return i.setUint8(t,o&255),i.setUint16(t+1,o>>8,!0),t+3}},XD={len:3,get(n,t){let o=Pr.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let i=zA(n);return i.setUint16(t,o>>8),i.setUint8(t+2,o&255),t+3}},Ei={len:4,get(n,t){return zA(n).getInt32(t)},put(n,t,o){return zA(n).setInt32(t,o),t+4}},dr={len:4,get(n,t){return zA(n).getInt32(t,!0)},put(n,t,o){return zA(n).setInt32(t,o,!0),t+4}},Gr={len:8,get(n,t){return zA(n).getBigUint64(t,!0)},put(n,t,o){return zA(n).setBigUint64(t,o,!0),t+8}},WB={len:8,get(n,t){return zA(n).getBigInt64(t,!0)},put(n,t,o){return zA(n).setBigInt64(t,o,!0),t+8}},Hs={len:8,get(n,t){return zA(n).getBigUint64(t)},put(n,t,o){return zA(n).setBigUint64(t,o),t+8}},qL={len:8,get(n,t){return zA(n).getBigInt64(t)},put(n,t,o){return zA(n).setBigInt64(t,o),t+8}},Zje={len:2,get(n,t){return Ls.read(n,t,!1,10,this.len)},put(n,t,o){return Ls.write(n,o,t,!1,10,this.len),t+this.len}},Xje={len:2,get(n,t){return Ls.read(n,t,!0,10,this.len)},put(n,t,o){return Ls.write(n,o,t,!0,10,this.len),t+this.len}},zL={len:4,get(n,t){return zA(n).getFloat32(t)},put(n,t,o){return zA(n).setFloat32(t,o),t+4}},$je={len:4,get(n,t){return zA(n).getFloat32(t,!0)},put(n,t,o){return zA(n).setFloat32(t,o,!0),t+4}},$D={len:8,get(n,t){return zA(n).getFloat64(t)},put(n,t,o){return zA(n).setFloat64(t,o),t+8}},eJe={len:8,get(n,t){return zA(n).getFloat64(t,!0)},put(n,t,o){return zA(n).setFloat64(t,o,!0),t+8}},AJe={len:10,get(n,t){return Ls.read(n,t,!1,63,this.len)},put(n,t,o){return Ls.write(n,o,t,!1,63,this.len),t+this.len}},tJe={len:10,get(n,t){return Ls.read(n,t,!0,63,this.len)},put(n,t,o){return Ls.write(n,o,t,!0,63,this.len),t+this.len}},jL=class{constructor(t){this.len=t}get(t,o){}},Ot=class{constructor(t){this.len=t}get(t,o){return t.subarray(o,o+this.len)}},Ve=class{constructor(t,o){this.len=t,this.encoding=o}get(t,o=0){let i=t.subarray(o,o+this.len);return br(i,this.encoding)}},JL=class extends Ve{constructor(t){super(t,"windows-1252")}}});var xl,VL,Ste,wte,Dte,Ote=Ce(()=>{DA();xl={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},VL={get(n){return{signature:Le.get(n,0),compressedSize:Le.get(n,8),uncompressedSize:Le.get(n,12)}},len:16},Ste={get(n){let t=SA.get(n,6);return{signature:Le.get(n,0),minVersion:SA.get(n,4),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,8),compressedSize:Le.get(n,18),uncompressedSize:Le.get(n,22),filenameLength:SA.get(n,26),extraFieldLength:SA.get(n,28),filename:null}},len:30},wte={get(n){return{signature:Le.get(n,0),nrOfThisDisk:SA.get(n,4),nrOfThisDiskWithTheStart:SA.get(n,6),nrOfEntriesOnThisDisk:SA.get(n,8),nrOfEntriesOfSize:SA.get(n,10),sizeOfCd:Le.get(n,12),offsetOfStartOfCd:Le.get(n,16),zipFileCommentLength:SA.get(n,20)}},len:22},Dte={get(n){let t=SA.get(n,8);return{signature:Le.get(n,0),minVersion:SA.get(n,6),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,10),compressedSize:Le.get(n,20),uncompressedSize:Le.get(n,24),filenameLength:SA.get(n,28),extraFieldLength:SA.get(n,30),fileCommentLength:SA.get(n,32),relativeOffsetOfLocalHeader:Le.get(n,42),filename:null}},len:46}});function Mte(n){let t=new Uint8Array(Le.len);return Le.put(t,0,n),t}function aJe(n,t){let o=n.length,i=t.length;if(i>o)return-1;for(let e=0;e<=o-i;e++){let a=!0;for(let A=0;Ae+a.length,0),o=new Uint8Array(t),i=0;for(let e of n)o.set(e,i),i+=e.length;return o}var bte,Ks,WL,rJe,eO,Yl,_te=Ce(()=>{DA();bte=qe(ct(),1);Ote();Ks=(0,bte.default)("tokenizer:inflate"),WL=256*1024,rJe=Mte(xl.DataDescriptor),eO=Mte(xl.EndOfCentralDirectory),Yl=class n{constructor(t){this.tokenizer=t,this.syncBuffer=new Uint8Array(WL)}async isZip(){return await this.peekSignature()===xl.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(Le)}async findEndOfCentralDirectoryLocator(){let t=this.tokenizer,o=Math.min(16*1024,t.fileInfo.size),i=this.syncBuffer.subarray(0,o);await this.tokenizer.readBuffer(i,{position:t.fileInfo.size-o});for(let e=i.length-4;e>=0;e--)if(i[e]===eO[0]&&i[e+1]===eO[1]&&i[e+2]===eO[2]&&i[e+3]===eO[3])return t.fileInfo.size-o+e;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Ks("Cannot reading central-directory without random-read support");return}Ks("Reading central-directory...");let t=this.tokenizer.position,o=await this.findEndOfCentralDirectoryLocator();if(o>0){Ks("Central-directory 32-bit signature found");let i=await this.tokenizer.readToken(wte,o),e=[];this.tokenizer.setPosition(i.offsetOfStartOfCd);for(let a=0;a=0?g:s;if(a.handler){let I=new Uint8Array(c);await this.tokenizer.readBuffer(I),r.push(I)}else await this.tokenizer.ignore(c)}Ks(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),a.handler&&await this.inflate(e,iJe(r),a.handler)}else a.handler?(Ks(`Reading compressed-file-data: ${e.compressedSize} bytes`),A=new Uint8Array(e.compressedSize),await this.tokenizer.readBuffer(A),await this.inflate(e,A,a.handler)):(Ks(`Ignoring compressed-file-data: ${e.compressedSize} bytes`),await this.tokenizer.ignore(e.compressedSize));if(Ks(`Reading data-descriptor at pos=${this.tokenizer.position}`),e.dataDescriptor&&(await this.tokenizer.readToken(VL)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-VL.len}`)}while(!i)}async iterateOverCentralDirectory(t,o){for(let i of t){let e=o(i);if(e.handler){this.tokenizer.setPosition(i.relativeOffsetOfLocalHeader);let a=await this.readLocalFileHeader();if(a){await this.tokenizer.ignore(a.extraFieldLength);let A=new Uint8Array(i.compressedSize);await this.tokenizer.readBuffer(A),await this.inflate(a,A,e.handler)}}if(e.stop)break}}async inflate(t,o,i){if(t.compressedMethod===0)return i(o);if(t.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);Ks(`Decompress filename=${t.filename}, compressed-size=${o.length}`);let e=await n.decompressDeflateRaw(o);return i(e)}static async decompressDeflateRaw(t){let o=new ReadableStream({start(a){a.enqueue(t),a.close()}}),i=new DecompressionStream("deflate-raw"),e=o.pipeThrough(i);try{let A=await new Response(e).arrayBuffer();return new Uint8Array(A)}catch(a){let A=a instanceof Error?`Failed to deflate ZIP entry: ${a.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(A)}}async readLocalFileHeader(){let t=await this.tokenizer.peekToken(Le);if(t===xl.LocalFileHeader){let o=await this.tokenizer.readToken(Ste);return o.filename=await this.tokenizer.readToken(new Ve(o.filenameLength,"utf-8")),o}if(t===xl.CentralFileHeader)return!1;throw t===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var ZB,Tte=Ce(()=>{ZB=class{constructor(t){this.tokenizer=t}inflate(){let t=this.tokenizer;return new ReadableStream({async pull(o){let i=new Uint8Array(1024),e=await t.readBuffer(i,{mayBeLess:!0});if(e===0){o.close();return}o.enqueue(i.subarray(0,e))}}).pipeThrough(new DecompressionStream("gzip"))}}});var Nte=Ce(()=>{_te();Tte()});function sJe(n,t,o){return n?n.constructor===t?!0:oJe.call(n)===o:!1}function gJe(n){return sJe(n,Uint8Array,nJe)}function cJe(n){if(!gJe(n))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof n}\``)}function AO(n){cJe(n);let t="";for(let o=0;o{oJe=Object.prototype.toString,nJe="[object Uint8Array]";rwA={utf8:new globalThis.TextDecoder("utf8")},awA=new globalThis.TextEncoder,IJe=Array.from({length:256},(n,t)=>t.toString(16).padStart(2,"0"))});function Rte(n,t){if(t==="utf-16le"){let o=[];for(let i=0;i>8&255)}return o}if(t==="utf-16be"){let o=[];for(let i=0;i>8&255,e&255)}return o}return[...n].map(o=>o.charCodeAt(0))}function kte(n,t=0){let o=Number.parseInt(new Ve(6).get(n,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(o))return!1;let i=256;for(let e=t;e{DA();vte={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4}});var Gte,Fte,Lte=Ce(()=>{Gte=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],Fte=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function wJe(n){let t=n?.streamReader;if(t?.constructor?.name!=="WebStreamByobReader")return n;let{reader:o}=t,i=async()=>{await o.cancel(),o.releaseLock()};return t.close=i,t.abort=async()=>{t.interrupted=!0,await i()},n}function e2(n,t,o){if(!Number.isFinite(n)||n<0||n>t)throw new qg(`${o} has invalid size ${n} (maximum ${t} bytes)`);return n}async function gI(n,t,{maximumLength:o=en,reason:i="skip"}={}){let e=e2(t,o,i);await n.ignore(e)}async function XL(n,t,o,{maximumLength:i=t.length,reason:e="read"}={}){let a=o?.length??t.length,A=e2(a,i,e);return n.readBuffer(t,{...o,length:A})}async function DJe(n,{maximumLength:t=Ys}={}){let e=new ReadableStream({start(g){g.enqueue(n),g.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),a=[],A=0;try{for(;;){let{done:g,value:c}=await e.read();if(g)break;if(A+=c.length,A>t)throw await e.cancel(),new Error(`ZIP entry decompressed data exceeds ${t} bytes`);a.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(A),s=0;for(let g of a)r.set(g,s),s+=g.length;return r}function bJe(n,t){if(n.length=0?0:r===e?Math.min(OJe,r-1):0,c=s>=0?s:r-g;if(c===0)break;if(A+=c,A>o)throw new Error(`ZIP entry compressed data exceeds ${o} bytes`);if(t){let I=new Uint8Array(c);await n.tokenizer.readBuffer(I),a.push(I)}else await n.tokenizer.ignore(c);if(s>=0)break}if(Ci(n.tokenizer)||(n.knownSizeDescriptorScannedBytes+=A),!!t)return _Je(a,A)}function NJe(n,t){return Ci(n.tokenizer)?Math.max(0,en-(n.tokenizer.position-t)):Math.max(0,Ys-n.knownSizeDescriptorScannedBytes)}async function RJe(n,t,{shouldBuffer:o,maximumDescriptorLength:i=Ys}={}){if(t.dataDescriptor&&t.compressedSize===0)return TJe(n,{shouldBuffer:o,maximumLength:i});if(!o){await gI(n.tokenizer,t.compressedSize,{maximumLength:Ci(n.tokenizer)?Ys:n.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let e=LJe(n.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>e)throw new Error(`ZIP entry compressed data exceeds ${e} bytes`);let a=new Uint8Array(t.compressedSize);return await n.tokenizer.readBuffer(a),a}function kJe(n,t){let o=n.getReader(),i=0,e=!1,a=!1,A=async r=>{e||a||(a=!0,await o.cancel(r))};return new ReadableStream({async pull(r){if(i>=t){r.close(),await A();return}let{done:s,value:g}=await o.read();if(s||!g){e=!0,r.close();return}let c=t-i;if(g.length>c){r.enqueue(g.subarray(0,c)),i+=c,r.close(),await A();return}r.enqueue(g),i+=g.length},async cancel(r){await A(r)}})}async function tf(n,t){return new $L(t).fromBuffer(n)}function Vte(n){switch(n=n.toLowerCase(),n){case"application/epub+zip":return{ext:"epub",mime:n};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:n};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:n};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:n};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:n};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:n};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:n};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:n};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:n};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:n};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:n};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:n};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:n};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:n};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:n};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:n};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function xs(n,t,o){o={offset:0,...o};for(let[i,e]of t.entries())if(o.mask){if(e!==(o.mask[i]&n[i+o.offset]))return!1}else if(e!==n[i+o.offset])return!1;return!0}function vJe(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):ef}function PJe(n,t,o){return o===void 0?n.read(t):(o.throwIfAborted(),new Promise((i,e)=>{let a=()=>{o.removeEventListener("abort",A)},A=()=>{let r=o.reason;a(),(async()=>{try{await n.cancel(r)}catch{}})(),e(r)};o.addEventListener("abort",A,{once:!0}),(async()=>{try{let r=await n.read(t);a(),i(r)}catch(r){a(),e(r)}})()}))}function GJe(n){return Number.isFinite(n)?Math.max(0,Math.min(lJe,Math.trunc(n))):0}function FJe(n){return Number.isFinite(n)?Math.max(0,n):Number.MAX_SAFE_INTEGER}function Ci(n){let t=n.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function Af(n,t,o){return Ci(n)&&n.position-t>o}function LJe(n){let t=n.fileInfo.size,o=Number.isFinite(t)?Math.max(0,t-n.position):Number.MAX_SAFE_INTEGER;return Math.min(o,pJe)}function UJe(n){if(n instanceof kA||n instanceof qg)return!0;if(!(n instanceof Error))return!1;if(yJe.has(n.message)||SJe.has(n.code))return!0;for(let t of mJe)if(n.message.startsWith(t))return!0;return!1}function Wte(n,t=Ys){let o=[n.compressedSize,n.uncompressedSize];for(let i of o)if(!Number.isFinite(i)||i<0||i>t)return!1;return!0}function HJe(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function KJe(n,t){t.startsWith("word/")&&(n.hasWordDirectory=!0),t.startsWith("ppt/")&&(n.hasPresentationDirectory=!0),t.startsWith("xl/")&&(n.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(n.hasThreeDimensionalModelEntry=!0)}function Zte(n){if(!(!n.hasContentTypesEntry||n.hasUnparseableContentTypes||n.isParsingContentTypes||n.hasParsedContentTypesEntry)){if(n.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(n.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(n.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(n.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function xJe(n){let t=n.indexOf('.main+xml"');if(t===-1){let e="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return n.includes(`ContentType="${e}"`)?e:void 0}let o=n.slice(0,t),i=o.lastIndexOf('"');return o.slice(i+1)}var ef,lJe,Ys,Ute,pJe,en,rO,Hte,dJe,hJe,Kte,ZL,xte,Yte,EJe,CJe,uJe,BJe,fJe,jte,Jte,qte,QJe,zte,yJe,mJe,SJe,qg,Xte,tO,OJe,$L,YJe,jJe,$te=Ce(()=>{DA();VD();Nte();$B();Pte();Lte();ef=4100,lJe=ef-2,Ys=1024*1024,Ute=1024,pJe=2**31-1,en=16*1024*1024,rO=Ys,Hte=Ys,dJe=en,hJe=1,Kte=100,ZL=en,xte=64,Yte=rO,EJe=256,CJe=512,uJe=en,BJe=512,fJe=512,jte=256,Jte=rO,qte=rO,QJe=rO,zte=en,yJe=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),mJe=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],SJe=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),qg=class extends Error{};Xte=134695760,tO=16,OJe=tO-1;Yl.prototype.inflate=async function(n,t,o){if(n.compressedMethod===0)return o(t);if(n.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${n.compressedMethod}`);let i=await DJe(t,{maximumLength:Ys});return o(i)};Yl.prototype.unzip=async function(n){let t=!1,o=0,i=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Af(this.tokenizer,i,en))throw new qg(`ZIP stream probing exceeds ${en} bytes`);let e=await this.readLocalFileHeader();if(!e)break;if(o++,o>Ute)throw new Error(`ZIP entry count exceeds ${Ute}`);let a=n(e);t=!!a.stop,await this.tokenizer.ignore(e.extraFieldLength);let A=await RJe(this,e,{shouldBuffer:!!a.handler,maximumDescriptorLength:Math.min(Ys,NJe(this,i))});if(a.handler&&await this.inflate(e,A,a.handler),e.dataDescriptor){let r=new Uint8Array(tO);if(await this.tokenizer.readBuffer(r),Le.get(r,0)!==Xte)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-r.length}`)}if(Af(this.tokenizer,i,en))throw new qg(`ZIP stream probing exceeds ${en} bytes`)}while(!t)};$L=class n{constructor(t){let o=GJe(t?.mpegOffsetTolerance);this.options={...t,mpegOffsetTolerance:o},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(t){return wJe(qD(t,this.getTokenizerOptions()))}async parseTokenizer(t,o=0){this.detectionReentryCount=o;let i=t.position;for(let e of this.detectors){let a;try{a=await e.detect(t)}catch(A){if(A instanceof kA||A instanceof qg)return;throw A}if(a)return a;if(i!==t.position)return}}async fromTokenizer(t){try{return await this.parseTokenizer(t)}finally{await t.close()}}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``);let o=t instanceof Uint8Array?t:new Uint8Array(t);if(o?.length>1)return this.fromTokenizer(Co(o,this.getTokenizerOptions()))}async fromBlob(t){this.options.signal?.throwIfAborted();let o=zD(t,this.getTokenizerOptions());return this.fromTokenizer(o)}async fromStream(t){this.options.signal?.throwIfAborted();let o=this.createTokenizerFromWebStream(t);return this.fromTokenizer(o)}async toDetectionStream(t,o){let i=vJe(o?.sampleSize??ef),e,a,A=t.getReader({mode:"byob"});try{let{value:g,done:c}=await PJe(A,new Uint8Array(i),this.options.signal);if(a=g,!c&&g)try{e=await this.fromBuffer(g.subarray(0,i))}catch(I){if(!(I instanceof kA))throw I;e=void 0}a=g}finally{A.releaseLock()}let r=new TransformStream({async start(g){g.enqueue(a)},transform(g,c){c.enqueue(g)}}),s=t.pipeThrough(r);return s.fileType=e,s}async detectGzip(t){if(this.gzipProbeDepth>=hJe)return{ext:"gz",mime:"application/gzip"};let o=new ZB(t),i=kJe(o.inflate(),dJe),e=Ci(t),a,A,r,s;if(e){let g=new AbortController;a=setTimeout(()=>{g.abort(new DOMException(`Operation timed out after ${Kte} ms`,"TimeoutError"))},Kte),A=this.options.signal===void 0?g.signal:AbortSignal.any([this.options.signal,g.signal]),r=new n({...this.options,signal:A}),r.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{s=await(r??this).fromStream(i)}catch(g){if(g?.name==="AbortError"&&A?.reason?.name!=="TimeoutError")throw g}finally{clearTimeout(a),e||this.gzipProbeDepth--}return s?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(t,o){return xs(this.buffer,t,o)}checkString(t,o){return this.check(Rte(t,o?.encoding),o)}detectConfident=async t=>{if(this.buffer=new Uint8Array(ef),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t,Ci(t)&&(await t.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(t);if(await t.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=jte?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(t));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(t);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await gI(t,6,{maximumLength:6,reason:"ID3 header prefix"});let o=await t.readToken(vte),i=Ci(t);if(!Number.isFinite(o)||o<0||i&&(o>ZL||t.position+o>ZL))return;if(t.position+o>t.fileInfo.size)return i?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await gI(t,o,{maximumLength:i?ZL:t.fileInfo.size,reason:"ID3 payload"})}catch(e){if(e instanceof kA)return;throw e}return this.detectionReentryCount>=jte?void 0:(this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let o,i=HJe();try{await new Yl(t).unzip(e=>{KJe(i,e.filename);let a=e.filename==="[Content_Types].xml",A=Zte(i);if(!a&&A)return o=A,{stop:!0};switch(e.filename){case"META-INF/mozilla.rsa":return o={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return o={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return Wte(e,Hte)?{async handler(r){let s=new TextDecoder("utf-8").decode(r).trim();o=Vte(s)},stop:!0}:{};case"[Content_Types].xml":return i.hasContentTypesEntry=!0,Wte(e,Hte)?(i.isParsingContentTypes=!0,{async handler(r){let s=new TextDecoder("utf-8").decode(r),g=xJe(s);g&&(o=Vte(g)),i.hasParsedContentTypesEntry=!0,i.isParsingContentTypes=!1},stop:!0}):(i.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(o={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(e){if(!UJe(e))throw e;i.isParsingContentTypes&&(i.isParsingContentTypes=!1,i.hasUnparseableContentTypes=!0)}return o??Zte(i)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let o=new Uint8Array(8);return await t.readBuffer(o),xs(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:xs(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:xs(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:xs(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:xs(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:xs(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let o=await this.readTiffHeader(!1);if(o)return o}if(this.check([77,77])){let o=await this.readTiffHeader(!0);if(o)return o}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function o(){let s=await t.peekNumber(QA),g=128,c=0;for(;(s&g)===0&&g!==0;)++c,g>>=1;let I=new Uint8Array(c+1);return await XL(t,I,void 0,{maximumLength:I.length,reason:"EBML field"}),I}async function i(){let s=await o(),g=await o();g[0]^=128>>g.length-1;let c=Math.min(6,g.length),I=new DataView(s.buffer),d=new DataView(g.buffer,g.length-c,c);return{id:XB(I),len:XB(d)}}async function e(s){let g=0;for(;s>0;){if(g++,g>EJe||Af(t,A,en))return;let c=t.position,I=await i();if(I.id===17026){if(I.len>xte)return;let d=e2(I.len,xte,"EBML DocType");return(await t.readToken(new Ve(d))).replaceAll(/\00.*$/g,"")}if(Ci(t)&&(!Number.isFinite(I.len)||I.len<0||I.len>Yte)||(await gI(t,I.len,{maximumLength:Ci(t)?Yte:t.fileInfo.size,reason:"EBML payload"}),--s,t.position<=c))return}}let a=await i(),A=t.position;switch(await e(a.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let o=xe.get(this.buffer,4),i=LA.get(this.buffer,6);if(o>0&&o<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(i>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("=1e3&&o<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!"))return await t.ignore(8),await t.readToken(new Ve(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[` +Check the top-level render call using <`+de+">.")}return te}function TK(H,te){if(!(!H._store||H._store.validated||H.key!=null)){H._store.validated=!0;var de=LIe(te);if(!_K[de]){_K[de]=!0;var me="";H&&H._owner&&H._owner!==R.current&&(me=" It was passed a child from "+ue(H._owner.type)+"."),mp(H),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',de,me),mp(null)}}}function NK(H,te){if(typeof H=="object"){if(je(H))for(var de=0;de",ze=" Did you accidentally export a JSX literal instead of a component?"):CA=typeof H,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",CA,ze)}var xA=Qe.apply(this,arguments);if(xA==null)return xA;if(me)for(var pt=2;pt10&&N("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),me._updatedFibers.clear()}}}var PK=!1,cQ=null;function YIe(H){if(cQ===null)try{var te=("require"+Math.random()).slice(0,7),de=TS&&TS[te];cQ=de.call(TS,"timers").setImmediate}catch{cQ=function(ze){PK===!1&&(PK=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var TA=new MessageChannel;TA.port1.onmessage=ze,TA.port2.postMessage(void 0)}}return cQ(H)}var Sp=0,GK=!1;function FK(H){{var te=Sp;Sp++,_.current===null&&(_.current=[]);var de=_.isBatchingLegacy,me;try{if(_.isBatchingLegacy=!0,me=H(),!de&&_.didScheduleLegacyUpdate){var ze=_.current;ze!==null&&(_.didScheduleLegacyUpdate=!1,PM(ze))}}catch(ir){throw IQ(te),ir}finally{_.isBatchingLegacy=de}if(me!==null&&typeof me=="object"&&typeof me.then=="function"){var TA=me,CA=!1,xA={then:function(ir,_r){CA=!0,TA.then(function(Ca){IQ(te),Sp===0?kM(Ca,ir,_r):ir(Ca)},function(Ca){IQ(te),_r(Ca)})}};return!GK&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){CA||(GK=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),xA}else{var pt=me;if(IQ(te),Sp===0){var Gt=_.current;Gt!==null&&(PM(Gt),_.current=null);var Vt={then:function(ir,_r){_.current===null?(_.current=[],kM(pt,ir,_r)):ir(pt)}};return Vt}else{var Wt={then:function(ir,_r){ir(pt)}};return Wt}}}}function IQ(H){H!==Sp-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Sp=H}function kM(H,te,de){{var me=_.current;if(me!==null)try{PM(me),YIe(function(){me.length===0?(_.current=null,te(H)):kM(H,te,de)})}catch(ze){de(ze)}else te(H)}}var vM=!1;function PM(H){if(!vM){vM=!0;var te=0;try{for(;te{"use strict";process.env.NODE_ENV==="production"?NP.exports=n5():NP.exports=s5()});var Nl=$((XBA,E9)=>{"use strict";var Lw=$e("crypto"),R2e=$e("assert");function qo(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}function k2e(n,t,o){qo(n),qo(t),qo(o);let i=Lw.createCipheriv("aes-256-cbc",n,o);return Buffer.concat([i.update(t),i.final()])}function v2e(n,t,o){qo(n),qo(t),qo(o);let i=Lw.createDecipheriv("aes-256-cbc",n,o);return Buffer.concat([i.update(t),i.final()])}function ih(n,t){qo(n),qo(t);let o=Lw.createHmac("sha256",n);return o.update(t),Buffer.from(o.digest())}function P2e(n){qo(n);let t=Lw.createHash("sha512");return t.update(n),t.digest()}function G2e(n,t,o,i){if(qo(n),qo(t),qo(o),t.byteLength!=32)throw new Error("Got salt of incorrect length");i=i||3,R2e(i>=1&&i<=3);let e=ih(t,n),a=new Uint8Array(o.byteLength+1+32);a.set(o,32),a[a.length-1]=1;let A=[ih(e,Buffer.from(a.slice(32)))];return i>1&&(a.set(A[A.length-1]),a[a.length-1]=2,A.push(ih(e,Buffer.from(a)))),i>2&&(a.set(A[A.length-1]),a[a.length-1]=3,A.push(ih(e,Buffer.from(a)))),A}function F2e(n,t,o,i){let e=ih(t,n).slice(0,i);if(o.length!==i||e.length!==i)throw new Error("Bad MAC length");if(!o.equals(e))throw new Error("Bad MAC")}E9.exports={deriveSecrets:G2e,decrypt:v2e,encrypt:k2e,hash:P2e,calculateMAC:ih,verifyMAC:F2e}});var _9=$(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});var $BA=new Uint8Array(16),S9=new Uint8Array(32);S9[0]=9;function dA(n){var t,o=new Float64Array(16);if(n)for(t=0;t>24&255,n[t+1]=o>>16&255,n[t+2]=o>>8&255,n[t+3]=o&255,n[t+4]=i>>24&255,n[t+5]=i>>16&255,n[t+6]=i>>8&255,n[t+7]=i&255}function x2e(n,t,o,i,e){var a,A=0;for(a=0;a>>8)-1}function w9(n,t,o,i){return x2e(n,t,o,i,32)}function Hc(n,t){var o;for(o=0;o<16;o++)n[o]=t[o]|0}function oF(n){var t,o,i=1;for(t=0;t<16;t++)o=n[t]+i+65535,i=Math.floor(o/65536),n[t]=o-i*65536;n[0]+=i-1+37*(i-1)}function oh(n,t,o){for(var i,e=~(o-1),a=0;a<16;a++)i=e&(n[a]^t[a]),n[a]^=i,t[a]^=i}function sh(n,t){var o,i,e,a=dA(),A=dA();for(o=0;o<16;o++)A[o]=t[o];for(oF(A),oF(A),oF(A),i=0;i<2;i++){for(a[0]=A[0]-65517,o=1;o<15;o++)a[o]=A[o]-65535-(a[o-1]>>16&1),a[o-1]&=65535;a[15]=A[15]-32767-(a[14]>>16&1),e=a[15]>>16&1,a[14]&=65535,oh(A,a,1-e)}for(o=0;o<16;o++)n[2*o]=A[o]&255,n[2*o+1]=A[o]>>8}function f9(n,t){var o=new Uint8Array(32),i=new Uint8Array(32);return sh(o,n),sh(i,t),w9(o,0,i,0)}function D9(n){var t=new Uint8Array(32);return sh(t,n),t[0]&1}function IF(n,t){var o;for(o=0;o<16;o++)n[o]=t[2*o]+(t[2*o+1]<<8);n[15]&=32767}function Rn(n,t,o){for(var i=0;i<16;i++)n[i]=t[i]+o[i]}function vn(n,t,o){for(var i=0;i<16;i++)n[i]=t[i]-o[i]}function It(n,t,o){var i,e,a=0,A=0,r=0,s=0,g=0,c=0,I=0,d=0,B=0,f=0,Q=0,y=0,m=0,T=0,_=0,R=0,K=0,L=0,F=0,q=0,V=0,x=0,G=0,J=0,U=0,N=0,k=0,z=0,Ae=0,ie=0,we=0,se=o[0],Te=o[1],fe=o[2],ke=o[3],Re=o[4],We=o[5],ve=o[6],aA=o[7],Be=o[8],Ie=o[9],Xe=o[10],je=o[11],Oe=o[12],EA=o[13],hA=o[14],iA=o[15];i=t[0],a+=i*se,A+=i*Te,r+=i*fe,s+=i*ke,g+=i*Re,c+=i*We,I+=i*ve,d+=i*aA,B+=i*Be,f+=i*Ie,Q+=i*Xe,y+=i*je,m+=i*Oe,T+=i*EA,_+=i*hA,R+=i*iA,i=t[1],A+=i*se,r+=i*Te,s+=i*fe,g+=i*ke,c+=i*Re,I+=i*We,d+=i*ve,B+=i*aA,f+=i*Be,Q+=i*Ie,y+=i*Xe,m+=i*je,T+=i*Oe,_+=i*EA,R+=i*hA,K+=i*iA,i=t[2],r+=i*se,s+=i*Te,g+=i*fe,c+=i*ke,I+=i*Re,d+=i*We,B+=i*ve,f+=i*aA,Q+=i*Be,y+=i*Ie,m+=i*Xe,T+=i*je,_+=i*Oe,R+=i*EA,K+=i*hA,L+=i*iA,i=t[3],s+=i*se,g+=i*Te,c+=i*fe,I+=i*ke,d+=i*Re,B+=i*We,f+=i*ve,Q+=i*aA,y+=i*Be,m+=i*Ie,T+=i*Xe,_+=i*je,R+=i*Oe,K+=i*EA,L+=i*hA,F+=i*iA,i=t[4],g+=i*se,c+=i*Te,I+=i*fe,d+=i*ke,B+=i*Re,f+=i*We,Q+=i*ve,y+=i*aA,m+=i*Be,T+=i*Ie,_+=i*Xe,R+=i*je,K+=i*Oe,L+=i*EA,F+=i*hA,q+=i*iA,i=t[5],c+=i*se,I+=i*Te,d+=i*fe,B+=i*ke,f+=i*Re,Q+=i*We,y+=i*ve,m+=i*aA,T+=i*Be,_+=i*Ie,R+=i*Xe,K+=i*je,L+=i*Oe,F+=i*EA,q+=i*hA,V+=i*iA,i=t[6],I+=i*se,d+=i*Te,B+=i*fe,f+=i*ke,Q+=i*Re,y+=i*We,m+=i*ve,T+=i*aA,_+=i*Be,R+=i*Ie,K+=i*Xe,L+=i*je,F+=i*Oe,q+=i*EA,V+=i*hA,x+=i*iA,i=t[7],d+=i*se,B+=i*Te,f+=i*fe,Q+=i*ke,y+=i*Re,m+=i*We,T+=i*ve,_+=i*aA,R+=i*Be,K+=i*Ie,L+=i*Xe,F+=i*je,q+=i*Oe,V+=i*EA,x+=i*hA,G+=i*iA,i=t[8],B+=i*se,f+=i*Te,Q+=i*fe,y+=i*ke,m+=i*Re,T+=i*We,_+=i*ve,R+=i*aA,K+=i*Be,L+=i*Ie,F+=i*Xe,q+=i*je,V+=i*Oe,x+=i*EA,G+=i*hA,J+=i*iA,i=t[9],f+=i*se,Q+=i*Te,y+=i*fe,m+=i*ke,T+=i*Re,_+=i*We,R+=i*ve,K+=i*aA,L+=i*Be,F+=i*Ie,q+=i*Xe,V+=i*je,x+=i*Oe,G+=i*EA,J+=i*hA,U+=i*iA,i=t[10],Q+=i*se,y+=i*Te,m+=i*fe,T+=i*ke,_+=i*Re,R+=i*We,K+=i*ve,L+=i*aA,F+=i*Be,q+=i*Ie,V+=i*Xe,x+=i*je,G+=i*Oe,J+=i*EA,U+=i*hA,N+=i*iA,i=t[11],y+=i*se,m+=i*Te,T+=i*fe,_+=i*ke,R+=i*Re,K+=i*We,L+=i*ve,F+=i*aA,q+=i*Be,V+=i*Ie,x+=i*Xe,G+=i*je,J+=i*Oe,U+=i*EA,N+=i*hA,k+=i*iA,i=t[12],m+=i*se,T+=i*Te,_+=i*fe,R+=i*ke,K+=i*Re,L+=i*We,F+=i*ve,q+=i*aA,V+=i*Be,x+=i*Ie,G+=i*Xe,J+=i*je,U+=i*Oe,N+=i*EA,k+=i*hA,z+=i*iA,i=t[13],T+=i*se,_+=i*Te,R+=i*fe,K+=i*ke,L+=i*Re,F+=i*We,q+=i*ve,V+=i*aA,x+=i*Be,G+=i*Ie,J+=i*Xe,U+=i*je,N+=i*Oe,k+=i*EA,z+=i*hA,Ae+=i*iA,i=t[14],_+=i*se,R+=i*Te,K+=i*fe,L+=i*ke,F+=i*Re,q+=i*We,V+=i*ve,x+=i*aA,G+=i*Be,J+=i*Ie,U+=i*Xe,N+=i*je,k+=i*Oe,z+=i*EA,Ae+=i*hA,ie+=i*iA,i=t[15],R+=i*se,K+=i*Te,L+=i*fe,F+=i*ke,q+=i*Re,V+=i*We,x+=i*ve,G+=i*aA,J+=i*Be,U+=i*Ie,N+=i*Xe,k+=i*je,z+=i*Oe,Ae+=i*EA,ie+=i*hA,we+=i*iA,a+=38*K,A+=38*L,r+=38*F,s+=38*q,g+=38*V,c+=38*x,I+=38*G,d+=38*J,B+=38*U,f+=38*N,Q+=38*k,y+=38*z,m+=38*Ae,T+=38*ie,_+=38*we,e=1,i=a+e+65535,e=Math.floor(i/65536),a=i-e*65536,i=A+e+65535,e=Math.floor(i/65536),A=i-e*65536,i=r+e+65535,e=Math.floor(i/65536),r=i-e*65536,i=s+e+65535,e=Math.floor(i/65536),s=i-e*65536,i=g+e+65535,e=Math.floor(i/65536),g=i-e*65536,i=c+e+65535,e=Math.floor(i/65536),c=i-e*65536,i=I+e+65535,e=Math.floor(i/65536),I=i-e*65536,i=d+e+65535,e=Math.floor(i/65536),d=i-e*65536,i=B+e+65535,e=Math.floor(i/65536),B=i-e*65536,i=f+e+65535,e=Math.floor(i/65536),f=i-e*65536,i=Q+e+65535,e=Math.floor(i/65536),Q=i-e*65536,i=y+e+65535,e=Math.floor(i/65536),y=i-e*65536,i=m+e+65535,e=Math.floor(i/65536),m=i-e*65536,i=T+e+65535,e=Math.floor(i/65536),T=i-e*65536,i=_+e+65535,e=Math.floor(i/65536),_=i-e*65536,i=R+e+65535,e=Math.floor(i/65536),R=i-e*65536,a+=e-1+37*(e-1),e=1,i=a+e+65535,e=Math.floor(i/65536),a=i-e*65536,i=A+e+65535,e=Math.floor(i/65536),A=i-e*65536,i=r+e+65535,e=Math.floor(i/65536),r=i-e*65536,i=s+e+65535,e=Math.floor(i/65536),s=i-e*65536,i=g+e+65535,e=Math.floor(i/65536),g=i-e*65536,i=c+e+65535,e=Math.floor(i/65536),c=i-e*65536,i=I+e+65535,e=Math.floor(i/65536),I=i-e*65536,i=d+e+65535,e=Math.floor(i/65536),d=i-e*65536,i=B+e+65535,e=Math.floor(i/65536),B=i-e*65536,i=f+e+65535,e=Math.floor(i/65536),f=i-e*65536,i=Q+e+65535,e=Math.floor(i/65536),Q=i-e*65536,i=y+e+65535,e=Math.floor(i/65536),y=i-e*65536,i=m+e+65535,e=Math.floor(i/65536),m=i-e*65536,i=T+e+65535,e=Math.floor(i/65536),T=i-e*65536,i=_+e+65535,e=Math.floor(i/65536),_=i-e*65536,i=R+e+65535,e=Math.floor(i/65536),R=i-e*65536,a+=e-1+37*(e-1),n[0]=a,n[1]=A,n[2]=r,n[3]=s,n[4]=g,n[5]=c,n[6]=I,n[7]=d,n[8]=B,n[9]=f,n[10]=Q,n[11]=y,n[12]=m,n[13]=T,n[14]=_,n[15]=R}function kn(n,t){It(n,t,t)}function lF(n,t){var o=dA(),i;for(i=0;i<16;i++)o[i]=t[i];for(i=253;i>=0;i--)kn(o,o),i!==2&&i!==4&&It(o,o,t);for(i=0;i<16;i++)n[i]=o[i]}function Y2e(n,t){var o=dA(),i;for(i=0;i<16;i++)o[i]=t[i];for(i=250;i>=0;i--)kn(o,o),i!==1&&It(o,o,t);for(i=0;i<16;i++)n[i]=o[i]}function O9(n,t,o){var i=new Uint8Array(32),e=new Float64Array(80),a,A,r=dA(),s=dA(),g=dA(),c=dA(),I=dA(),d=dA();for(A=0;A<31;A++)i[A]=t[A];for(i[31]=t[31]&127|64,i[0]&=248,IF(e,o),A=0;A<16;A++)s[A]=e[A],c[A]=r[A]=g[A]=0;for(r[0]=c[0]=1,A=254;A>=0;--A)a=i[A>>>3]>>>(A&7)&1,oh(r,s,a),oh(g,c,a),Rn(I,r,g),vn(r,r,g),Rn(g,s,c),vn(s,s,c),kn(c,I),kn(d,r),It(r,g,r),It(g,s,I),Rn(I,r,g),vn(r,r,g),kn(s,r),vn(g,c,d),It(r,g,L2e),Rn(r,r,c),It(g,g,r),It(r,c,d),It(c,s,e),kn(s,I),oh(r,s,a),oh(g,c,a);for(A=0;A<16;A++)e[A+16]=r[A],e[A+32]=g[A],e[A+48]=s[A],e[A+64]=c[A];var B=e.subarray(32),f=e.subarray(16);return lF(B,B),It(f,f,B),sh(n,f),0}function j2e(n,t){return O9(n,t,S9)}var Q9=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y9(n,t,o,i){for(var e=new Int32Array(16),a=new Int32Array(16),A,r,s,g,c,I,d,B,f,Q,y,m,T,_,R,K,L,F,q,V,x,G,J,U,N,k,z=n[0],Ae=n[1],ie=n[2],we=n[3],se=n[4],Te=n[5],fe=n[6],ke=n[7],Re=t[0],We=t[1],ve=t[2],aA=t[3],Be=t[4],Ie=t[5],Xe=t[6],je=t[7],Oe=0;i>=128;){for(q=0;q<16;q++)V=8*q+Oe,e[q]=o[V+0]<<24|o[V+1]<<16|o[V+2]<<8|o[V+3],a[q]=o[V+4]<<24|o[V+5]<<16|o[V+6]<<8|o[V+7];for(q=0;q<80;q++)if(A=z,r=Ae,s=ie,g=we,c=se,I=Te,d=fe,B=ke,f=Re,Q=We,y=ve,m=aA,T=Be,_=Ie,R=Xe,K=je,x=ke,G=je,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=(se>>>14|Be<<18)^(se>>>18|Be<<14)^(Be>>>9|se<<23),G=(Be>>>14|se<<18)^(Be>>>18|se<<14)^(se>>>9|Be<<23),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=se&Te^~se&fe,G=Be&Ie^~Be&Xe,J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=Q9[q*2],G=Q9[q*2+1],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=e[q%16],G=a[q%16],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,L=N&65535|k<<16,F=J&65535|U<<16,x=L,G=F,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=(z>>>28|Re<<4)^(Re>>>2|z<<30)^(Re>>>7|z<<25),G=(Re>>>28|z<<4)^(z>>>2|Re<<30)^(z>>>7|Re<<25),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,x=z&Ae^z&ie^Ae&ie,G=Re&We^Re&ve^We&ve,J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,B=N&65535|k<<16,K=J&65535|U<<16,x=g,G=m,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=L,G=F,J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,g=N&65535|k<<16,m=J&65535|U<<16,Ae=A,ie=r,we=s,se=g,Te=c,fe=I,ke=d,z=B,We=f,ve=Q,aA=y,Be=m,Ie=T,Xe=_,je=R,Re=K,q%16===15)for(V=0;V<16;V++)x=e[V],G=a[V],J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=e[(V+9)%16],G=a[(V+9)%16],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,L=e[(V+1)%16],F=a[(V+1)%16],x=(L>>>1|F<<31)^(L>>>8|F<<24)^L>>>7,G=(F>>>1|L<<31)^(F>>>8|L<<24)^(F>>>7|L<<25),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,L=e[(V+14)%16],F=a[(V+14)%16],x=(L>>>19|F<<13)^(F>>>29|L<<3)^L>>>6,G=(F>>>19|L<<13)^(L>>>29|F<<3)^(F>>>6|L<<26),J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,e[V]=N&65535|k<<16,a[V]=J&65535|U<<16;x=z,G=Re,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[0],G=t[0],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[0]=z=N&65535|k<<16,t[0]=Re=J&65535|U<<16,x=Ae,G=We,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[1],G=t[1],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[1]=Ae=N&65535|k<<16,t[1]=We=J&65535|U<<16,x=ie,G=ve,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[2],G=t[2],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[2]=ie=N&65535|k<<16,t[2]=ve=J&65535|U<<16,x=we,G=aA,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[3],G=t[3],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[3]=we=N&65535|k<<16,t[3]=aA=J&65535|U<<16,x=se,G=Be,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[4],G=t[4],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[4]=se=N&65535|k<<16,t[4]=Be=J&65535|U<<16,x=Te,G=Ie,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[5],G=t[5],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[5]=Te=N&65535|k<<16,t[5]=Ie=J&65535|U<<16,x=fe,G=Xe,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[6],G=t[6],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[6]=fe=N&65535|k<<16,t[6]=Xe=J&65535|U<<16,x=ke,G=je,J=G&65535,U=G>>>16,N=x&65535,k=x>>>16,x=n[7],G=t[7],J+=G&65535,U+=G>>>16,N+=x&65535,k+=x>>>16,U+=J>>>16,N+=U>>>16,k+=N>>>16,n[7]=ke=N&65535|k<<16,t[7]=je=J&65535|U<<16,Oe+=128,i-=128}return i}function hB(n,t,o){var i=new Int32Array(8),e=new Int32Array(8),a=new Uint8Array(256),A,r=o;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,e[0]=4089235720,e[1]=2227873595,e[2]=4271175723,e[3]=1595750129,e[4]=2917565137,e[5]=725511199,e[6]=4215389547,e[7]=327033209,y9(i,e,t,o),o%=128,A=0;A=0;--e)i=o[e/8|0]>>(e&7)&1,m9(n,t,i),gF(t,n),gF(n,n),m9(n,t,i)}function Hw(n,t){var o=[dA(),dA(),dA(),dA()];Hc(o[0],C9),Hc(o[1],u9),Hc(o[2],nh),It(o[3],C9,u9),b9(n,o,t)}var nF=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function pF(n,t){var o,i,e,a;for(i=63;i>=32;--i){for(o=0,e=i-32,a=i-12;e>8,t[e]-=o*256;t[e]+=o,t[i]=0}for(o=0,e=0;e<32;e++)t[e]+=o-(t[31]>>4)*nF[e],o=t[e]>>8,t[e]&=255;for(e=0;e<32;e++)t[e]-=o*nF[e];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,n[i]=t[i]&255}function EB(n){var t=new Float64Array(64),o;for(o=0;o<64;o++)t[o]=n[o];for(o=0;o<64;o++)n[o]=0;pF(n,t)}function J2e(n,t,o,i){var e=new Uint8Array(64),a=new Uint8Array(64),A,r,s=new Float64Array(64),g=[dA(),dA(),dA(),dA()];for(A=0;A>7&&vn(n[0],sF,n[0]),It(n[3],n[0],n[1]),0)}function V2e(n,t,o,i){var e,a,A=new Uint8Array(32),r=new Uint8Array(64),s=[dA(),dA(),dA(),dA()],g=[dA(),dA(),dA(),dA()];if(a=-1,o<64||z2e(g,i))return-1;for(e=0;e=0}kg.verify=AUe;function tUe(n){if(Kc(n),n.length!==32)throw new Error("wrong seed length");for(var t=new Uint8Array(32),o=new Uint8Array(32),i=0;i<32;i++)t[i]=n[i];return j2e(o,t),t[0]&=248,t[31]&=127,t[31]|=64,o[31]&=127,{public:o,private:t}}kg.generateKeyPair=tUe;kg.default={}});var xc=$(ch=>{"use strict";var CB=_9(),gh=$e("crypto"),dF=Buffer.from([48,42,48,5,6,3,43,101,110,3,33,0]),hF=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]),rUe=Buffer.from([5]),EF=function(n){return Buffer.concat([rUe,n])};function T9(n){if(n===void 0)throw new Error("Undefined private key");if(!(n instanceof Buffer))throw new Error(`Invalid private key type: ${n.constructor.name}`);if(n.byteLength!=32)throw new Error(`Incorrect private key length: ${n.byteLength}`)}function N9(n){if(!(n instanceof Buffer))throw new Error(`Invalid public key type: ${n.constructor.name}`);if(n===void 0||(n.byteLength!=33||n[0]!=5)&&n.byteLength!=32)throw new Error("Invalid public key");return n.byteLength==33?n.slice(1):(console.error("WARNING: Expected pubkey of length 33, please report the ST and client that generated the pubkey"),n)}function aUe(n){let t=new Uint8Array(n);return t[0]|=6,t[31]|=128,t[31]&=-65,t}ch.getPublicFromPrivateKey=function(n){let t=aUe(n),o=CB.generateKeyPair(t);return EF(Buffer.from(o.public))};ch.generateKeyPair=function(){try{let{publicKey:n,privateKey:t}=gh.generateKeyPairSync("x25519",{publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}}),o=n.slice(dF.length,dF.length+32),i=t.slice(hF.length,hF.length+32);return{pubKey:EF(o),privKey:i}}catch{let t=CB.generateKeyPair(gh.randomBytes(32));return{privKey:Buffer.from(t.private),pubKey:EF(Buffer.from(t.public))}}};ch.calculateAgreement=function(n,t){if(n=N9(n),T9(t),!n||n.byteLength!=32)throw new Error("Invalid public key");if(typeof gh.diffieHellman=="function"){let o=gh.createPrivateKey({key:Buffer.concat([hF,t]),format:"der",type:"pkcs8"}),i=gh.createPublicKey({key:Buffer.concat([dF,n]),format:"der",type:"spki"});return gh.diffieHellman({privateKey:o,publicKey:i})}else{let o=CB.sharedKey(t,n);return Buffer.from(o)}};ch.calculateSignature=function(n,t){if(T9(n),!t)throw new Error("Invalid message");return Buffer.from(CB.sign(n,t))};ch.verifySignature=function(n,t,o,i){if(n=N9(n),!n||n.byteLength!=32)throw new Error("Invalid public key");if(!t)throw new Error("Invalid message");if(!o||o.byteLength!=64)throw new Error("Invalid signature");return i?!0:CB.verify(n,t,o)}});var k9=$(uB=>{var Kw=xc(),iUe=$e("crypto");function R9(n){return typeof n=="number"&&n%1===0&&n>=0}uB.generateIdentityKeyPair=Kw.generateKeyPair;uB.generateRegistrationId=function(){var n=Uint16Array.from(iUe.randomBytes(2))[0];return n&16383};uB.generateSignedPreKey=function(n,t){if(!(n.privKey instanceof Buffer)||n.privKey.byteLength!=32||!(n.pubKey instanceof Buffer)||n.pubKey.byteLength!=33)throw new TypeError("Invalid argument for identityKeyPair");if(!R9(t))throw new TypeError("Invalid argument for signedKeyId: "+t);let o=Kw.generateKeyPair(),i=Kw.calculateSignature(n.privKey,o.pubKey);return{keyId:t,keyPair:o,signature:i}};uB.generatePreKey=function(n){if(!R9(n))throw new TypeError("Invalid argument for keyId: "+n);let t=Kw.generateKeyPair();return{keyId:n,keyPair:t}}});var uF=$((rfA,v9)=>{var CF=class n{static from(t){if(typeof t!="string"||!t.match(/.*\.\d+/))throw new Error("Invalid address encoding");let o=t.split(".");return new this(o[0],parseInt(o[1]))}constructor(t,o){if(typeof t!="string")throw new TypeError("id required for addr");if(t.indexOf(".")!==-1)throw new TypeError("encoded addr detected");if(this.id=t,typeof o!="number")throw new TypeError("number required for deviceId");this.deviceId=o}toString(){return`${this.id}.${this.deviceId}`}is(t){return t instanceof n?t.id===this.id&&t.deviceId===this.deviceId:!1}};v9.exports=CF});var BF=$((afA,P9)=>{var oUe={OURS:1,THEIRS:2};P9.exports=oUe});var fF=$((ifA,G9)=>{var nUe={SENDING:1,RECEIVING:2};G9.exports=nUe});var Jw=$((ofA,L9)=>{var sUe=BF(),gUe=40,F9="v1";function Yw(n){if(!Buffer.isBuffer(n))throw new TypeError("Buffer required")}var jw=class{constructor(){this._chains={}}toString(){return``}inspect(){return this.toString()}addChain(t,o){Yw(t);let i=t.toString("base64");if(this._chains.hasOwnProperty(i))throw new Error("Overwrite attempt");this._chains[i]=o}getChain(t){return Yw(t),this._chains[t.toString("base64")]}deleteChain(t){Yw(t);let o=t.toString("base64");if(!this._chains.hasOwnProperty(o))throw new ReferenceError("Not Found");delete this._chains[o]}*chains(){for(let[t,o]of Object.entries(this._chains))yield[Buffer.from(t,"base64"),o]}serialize(){let t={registrationId:this.registrationId,currentRatchet:{ephemeralKeyPair:{pubKey:this.currentRatchet.ephemeralKeyPair.pubKey.toString("base64"),privKey:this.currentRatchet.ephemeralKeyPair.privKey.toString("base64")},lastRemoteEphemeralKey:this.currentRatchet.lastRemoteEphemeralKey.toString("base64"),previousCounter:this.currentRatchet.previousCounter,rootKey:this.currentRatchet.rootKey.toString("base64")},indexInfo:{baseKey:this.indexInfo.baseKey.toString("base64"),baseKeyType:this.indexInfo.baseKeyType,closed:this.indexInfo.closed,used:this.indexInfo.used,created:this.indexInfo.created,remoteIdentityKey:this.indexInfo.remoteIdentityKey.toString("base64")},_chains:this._serialize_chains(this._chains)};return this.pendingPreKey&&(t.pendingPreKey=Object.assign({},this.pendingPreKey),t.pendingPreKey.baseKey=this.pendingPreKey.baseKey.toString("base64")),t}static deserialize(t){let o=new this;return o.registrationId=t.registrationId,o.currentRatchet={ephemeralKeyPair:{pubKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.pubKey,"base64"),privKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.privKey,"base64")},lastRemoteEphemeralKey:Buffer.from(t.currentRatchet.lastRemoteEphemeralKey,"base64"),previousCounter:t.currentRatchet.previousCounter,rootKey:Buffer.from(t.currentRatchet.rootKey,"base64")},o.indexInfo={baseKey:Buffer.from(t.indexInfo.baseKey,"base64"),baseKeyType:t.indexInfo.baseKeyType,closed:t.indexInfo.closed,used:t.indexInfo.used,created:t.indexInfo.created,remoteIdentityKey:Buffer.from(t.indexInfo.remoteIdentityKey,"base64")},o._chains=this._deserialize_chains(t._chains),t.pendingPreKey&&(o.pendingPreKey=Object.assign({},t.pendingPreKey),o.pendingPreKey.baseKey=Buffer.from(t.pendingPreKey.baseKey,"base64")),o}_serialize_chains(t){let o={};for(let i of Object.keys(t)){let e=t[i],a={};for(let[A,r]of Object.entries(e.messageKeys))a[A]=r.toString("base64");o[i]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&e.chainKey.key.toString("base64")},chainType:e.chainType,messageKeys:a}}return o}static _deserialize_chains(t){let o={};for(let i of Object.keys(t)){let e=t[i],a={};for(let[A,r]of Object.entries(e.messageKeys))a[A]=Buffer.from(r,"base64");o[i]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&Buffer.from(e.chainKey.key,"base64")},chainType:e.chainType,messageKeys:a}}return o}},xw=[{version:"v1",migrate:function(t){let o=t._sessions;if(t.registrationId)for(let i in o)o[i].registrationId||(o[i].registrationId=t.registrationId);else for(let i in o)o[i].indexInfo.closed===-1&&console.error("V1 session storage migration error: registrationId",t.registrationId,"for open session version",t.version)}}],QF=class{static createEntry(){return new jw}static migrate(t){let o=t.version===void 0;for(let i=0;i{let i=t.indexInfo.used||0,e=o.indexInfo.used||0;return i===e?0:igUe;){let t,o;for(let[i,e]of Object.entries(this.sessions))e.indexInfo.closed!==-1&&(!o||e.indexInfo.closed{Os.SignalError=class extends Error{};Os.UntrustedIdentityKeyError=class extends Os.SignalError{constructor(t,o){super(),this.name="UntrustedIdentityKeyError",this.addr=t,this.identityKey=o}};Os.SessionError=class extends Os.SignalError{constructor(t){super(t),this.name="SessionError"}};Os.MessageCounterError=class extends Os.SessionError{constructor(t){super(t),this.name="MessageCounterError"}};Os.PreKeyError=class extends Os.SessionError{constructor(t){super(t),this.name="PreKeyError"}}});var yF=$((pfA,H9)=>{"use strict";var zw=new Map,U9=1e4;async function cUe(n,t){let o=0;for(;;){let i=Math.min(n.length,U9);for(let e=o;e=U9?(n.splice(0,i),o=0):o=i;else break}t()}H9.exports=function(n,t){t.name||(Object.defineProperty(t,"name",{writable:!0}),typeof n=="string"?t.name=n:console.warn("Unhandled bucket type (for naming):",typeof n,n));let o;zw.has(n)||(zw.set(n,[]),o=!0);let i=zw.get(n),e=new Promise((a,A)=>i.push({awaitable:t,resolve:a,reject:A}));return o&&cUe(i,()=>zw.delete(n)),e}});var SF=$((dfA,j9)=>{"use strict";var K9=BF(),IUe=fF(),x9=Jw(),Y9=Nl(),Yc=xc(),Vw=qw(),lUe=yF(),mF=class{constructor(t,o){this.addr=o,this.storage=t}async initOutgoing(t){let o=this.addr.toString();return await lUe(o,async()=>{if(!await this.storage.isTrustedIdentity(this.addr.id,t.identityKey))throw new Vw.UntrustedIdentityKeyError(this.addr.id,t.identityKey);Yc.verifySignature(t.identityKey,t.signedPreKey.publicKey,t.signedPreKey.signature,!0);let i=Yc.generateKeyPair(),e=t.preKey&&t.preKey.publicKey,a=await this.initSession(!0,i,void 0,t.identityKey,e,t.signedPreKey.publicKey,t.registrationId);a.pendingPreKey={signedKeyId:t.signedPreKey.keyId,baseKey:i.pubKey},t.preKey&&(a.pendingPreKey.preKeyId=t.preKey.keyId);let A=await this.storage.loadSession(o);if(!A)A=new x9;else{let r=A.getOpenSession();r&&A.closeSession(r)}A.setSession(a),await this.storage.storeSession(o,A)})}async initIncoming(t,o){let i=this.addr.toString();if(!await this.storage.isTrustedIdentity(i,o.identityKey))throw new Vw.UntrustedIdentityKeyError(this.addr.id,o.identityKey);if(t.getSession(o.baseKey))return;let e=await this.storage.loadPreKey(o.preKeyId);if(o.preKeyId&&!e)throw new Vw.PreKeyError("Invalid PreKey ID");let a=await this.storage.loadSignedPreKey(o.signedPreKeyId);if(!a)throw new Vw.PreKeyError("Missing SignedPreKey");let A=t.getOpenSession();return A&&(console.warn("Closing open session in favor of incoming prekey bundle"),t.closeSession(A)),t.setSession(await this.initSession(!1,e,a,o.identityKey,o.baseKey,void 0,o.registrationId)),o.preKeyId}async initSession(t,o,i,e,a,A,r){if(t){if(i)throw new Error("Invalid call to initSession");i=o}else{if(A)throw new Error("Invalid call to initSession");A=a}let s;!o||!a?s=new Uint8Array(128):s=new Uint8Array(160);for(var g=0;g<32;g++)s[g]=255;let c=await this.storage.getOurIdentity(),I=Yc.calculateAgreement(A,c.privKey),d=Yc.calculateAgreement(e,i.privKey),B=Yc.calculateAgreement(A,i.privKey);if(t?(s.set(new Uint8Array(I),32),s.set(new Uint8Array(d),64)):(s.set(new Uint8Array(I),64),s.set(new Uint8Array(d),32)),s.set(new Uint8Array(B),96),o&&a){let y=Yc.calculateAgreement(a,o.privKey);s.set(new Uint8Array(y),128)}let f=Y9.deriveSecrets(Buffer.from(s),Buffer.alloc(32),Buffer.from("WhisperText")),Q=x9.createEntry();return Q.registrationId=r,Q.currentRatchet={rootKey:f[0],ephemeralKeyPair:t?Yc.generateKeyPair():i,lastRemoteEphemeralKey:A,previousCounter:0},Q.indexInfo={created:Date.now(),used:Date.now(),remoteIdentityKey:e,baseKey:t?o.pubKey:a,baseKeyType:t?K9.OURS:K9.THEIRS,closed:-1},t&&this.calculateSendingRatchet(Q,A),Q}calculateSendingRatchet(t,o){let i=t.currentRatchet,e=Yc.calculateAgreement(o,i.ephemeralKeyPair.privKey),a=Y9.deriveSecrets(e,i.rootKey,Buffer.from("WhisperRatchet"));t.addChain(i.ephemeralKeyPair.pubKey,{messageKeys:{},chainKey:{counter:-1,key:a[1]},chainType:IUe.SENDING}),i.rootKey=a[0]}};j9.exports=mF});var q9=$((hfA,J9)=>{"use strict";var jc=Rm(),zo=jc.Reader,wF=jc.Writer,nA=jc.util,Pn=jc.roots.default||(jc.roots.default={});Pn.textsecure=(function(){var n={};return n.WhisperMessage=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:A.ephemeralKey=i.bytes();break;case 2:A.counter=i.uint32();break;case 3:A.previousCounter=i.uint32();break;case 4:A.ciphertext=i.bytes();break;default:i.skipType(r&7);break}}return A},t.decodeDelimited=function(i){return i instanceof zo||(i=new zo(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&!(i.ephemeralKey&&typeof i.ephemeralKey.length=="number"||nA.isString(i.ephemeralKey))?"ephemeralKey: buffer expected":i.counter!=null&&i.hasOwnProperty("counter")&&!nA.isInteger(i.counter)?"counter: integer expected":i.previousCounter!=null&&i.hasOwnProperty("previousCounter")&&!nA.isInteger(i.previousCounter)?"previousCounter: integer expected":i.ciphertext!=null&&i.hasOwnProperty("ciphertext")&&!(i.ciphertext&&typeof i.ciphertext.length=="number"||nA.isString(i.ciphertext))?"ciphertext: buffer expected":null},t.fromObject=function(i){if(i instanceof Pn.textsecure.WhisperMessage)return i;var e=new Pn.textsecure.WhisperMessage;return i.ephemeralKey!=null&&(typeof i.ephemeralKey=="string"?nA.base64.decode(i.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(i.ephemeralKey)),0):i.ephemeralKey.length&&(e.ephemeralKey=i.ephemeralKey)),i.counter!=null&&(e.counter=i.counter>>>0),i.previousCounter!=null&&(e.previousCounter=i.previousCounter>>>0),i.ciphertext!=null&&(typeof i.ciphertext=="string"?nA.base64.decode(i.ciphertext,e.ciphertext=nA.newBuffer(nA.base64.length(i.ciphertext)),0):i.ciphertext.length&&(e.ciphertext=i.ciphertext)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(e.bytes===String?a.ephemeralKey="":(a.ephemeralKey=[],e.bytes!==Array&&(a.ephemeralKey=nA.newBuffer(a.ephemeralKey))),a.counter=0,a.previousCounter=0,e.bytes===String?a.ciphertext="":(a.ciphertext=[],e.bytes!==Array&&(a.ciphertext=nA.newBuffer(a.ciphertext)))),i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&(a.ephemeralKey=e.bytes===String?nA.base64.encode(i.ephemeralKey,0,i.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(i.ephemeralKey):i.ephemeralKey),i.counter!=null&&i.hasOwnProperty("counter")&&(a.counter=i.counter),i.previousCounter!=null&&i.hasOwnProperty("previousCounter")&&(a.previousCounter=i.previousCounter),i.ciphertext!=null&&i.hasOwnProperty("ciphertext")&&(a.ciphertext=e.bytes===String?nA.base64.encode(i.ciphertext,0,i.ciphertext.length):e.bytes===Array?Array.prototype.slice.call(i.ciphertext):i.ciphertext),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,jc.util.toJSONOptions)},t})(),n.PreKeyWhisperMessage=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 5:A.registrationId=i.uint32();break;case 1:A.preKeyId=i.uint32();break;case 6:A.signedPreKeyId=i.uint32();break;case 2:A.baseKey=i.bytes();break;case 3:A.identityKey=i.bytes();break;case 4:A.message=i.bytes();break;default:i.skipType(r&7);break}}return A},t.decodeDelimited=function(i){return i instanceof zo||(i=new zo(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":i.registrationId!=null&&i.hasOwnProperty("registrationId")&&!nA.isInteger(i.registrationId)?"registrationId: integer expected":i.preKeyId!=null&&i.hasOwnProperty("preKeyId")&&!nA.isInteger(i.preKeyId)?"preKeyId: integer expected":i.signedPreKeyId!=null&&i.hasOwnProperty("signedPreKeyId")&&!nA.isInteger(i.signedPreKeyId)?"signedPreKeyId: integer expected":i.baseKey!=null&&i.hasOwnProperty("baseKey")&&!(i.baseKey&&typeof i.baseKey.length=="number"||nA.isString(i.baseKey))?"baseKey: buffer expected":i.identityKey!=null&&i.hasOwnProperty("identityKey")&&!(i.identityKey&&typeof i.identityKey.length=="number"||nA.isString(i.identityKey))?"identityKey: buffer expected":i.message!=null&&i.hasOwnProperty("message")&&!(i.message&&typeof i.message.length=="number"||nA.isString(i.message))?"message: buffer expected":null},t.fromObject=function(i){if(i instanceof Pn.textsecure.PreKeyWhisperMessage)return i;var e=new Pn.textsecure.PreKeyWhisperMessage;return i.registrationId!=null&&(e.registrationId=i.registrationId>>>0),i.preKeyId!=null&&(e.preKeyId=i.preKeyId>>>0),i.signedPreKeyId!=null&&(e.signedPreKeyId=i.signedPreKeyId>>>0),i.baseKey!=null&&(typeof i.baseKey=="string"?nA.base64.decode(i.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(i.baseKey)),0):i.baseKey.length&&(e.baseKey=i.baseKey)),i.identityKey!=null&&(typeof i.identityKey=="string"?nA.base64.decode(i.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(i.identityKey)),0):i.identityKey.length&&(e.identityKey=i.identityKey)),i.message!=null&&(typeof i.message=="string"?nA.base64.decode(i.message,e.message=nA.newBuffer(nA.base64.length(i.message)),0):i.message.length&&(e.message=i.message)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.preKeyId=0,e.bytes===String?a.baseKey="":(a.baseKey=[],e.bytes!==Array&&(a.baseKey=nA.newBuffer(a.baseKey))),e.bytes===String?a.identityKey="":(a.identityKey=[],e.bytes!==Array&&(a.identityKey=nA.newBuffer(a.identityKey))),e.bytes===String?a.message="":(a.message=[],e.bytes!==Array&&(a.message=nA.newBuffer(a.message))),a.registrationId=0,a.signedPreKeyId=0),i.preKeyId!=null&&i.hasOwnProperty("preKeyId")&&(a.preKeyId=i.preKeyId),i.baseKey!=null&&i.hasOwnProperty("baseKey")&&(a.baseKey=e.bytes===String?nA.base64.encode(i.baseKey,0,i.baseKey.length):e.bytes===Array?Array.prototype.slice.call(i.baseKey):i.baseKey),i.identityKey!=null&&i.hasOwnProperty("identityKey")&&(a.identityKey=e.bytes===String?nA.base64.encode(i.identityKey,0,i.identityKey.length):e.bytes===Array?Array.prototype.slice.call(i.identityKey):i.identityKey),i.message!=null&&i.hasOwnProperty("message")&&(a.message=e.bytes===String?nA.base64.encode(i.message,0,i.message.length):e.bytes===Array?Array.prototype.slice.call(i.message):i.message),i.registrationId!=null&&i.hasOwnProperty("registrationId")&&(a.registrationId=i.registrationId),i.signedPreKeyId!=null&&i.hasOwnProperty("signedPreKeyId")&&(a.signedPreKeyId=i.signedPreKeyId),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,jc.util.toJSONOptions)},t})(),n.KeyExchangeMessage=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:A.id=i.uint32();break;case 2:A.baseKey=i.bytes();break;case 3:A.ephemeralKey=i.bytes();break;case 4:A.identityKey=i.bytes();break;case 5:A.baseKeySignature=i.bytes();break;default:i.skipType(r&7);break}}return A},t.decodeDelimited=function(i){return i instanceof zo||(i=new zo(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":i.id!=null&&i.hasOwnProperty("id")&&!nA.isInteger(i.id)?"id: integer expected":i.baseKey!=null&&i.hasOwnProperty("baseKey")&&!(i.baseKey&&typeof i.baseKey.length=="number"||nA.isString(i.baseKey))?"baseKey: buffer expected":i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&!(i.ephemeralKey&&typeof i.ephemeralKey.length=="number"||nA.isString(i.ephemeralKey))?"ephemeralKey: buffer expected":i.identityKey!=null&&i.hasOwnProperty("identityKey")&&!(i.identityKey&&typeof i.identityKey.length=="number"||nA.isString(i.identityKey))?"identityKey: buffer expected":i.baseKeySignature!=null&&i.hasOwnProperty("baseKeySignature")&&!(i.baseKeySignature&&typeof i.baseKeySignature.length=="number"||nA.isString(i.baseKeySignature))?"baseKeySignature: buffer expected":null},t.fromObject=function(i){if(i instanceof Pn.textsecure.KeyExchangeMessage)return i;var e=new Pn.textsecure.KeyExchangeMessage;return i.id!=null&&(e.id=i.id>>>0),i.baseKey!=null&&(typeof i.baseKey=="string"?nA.base64.decode(i.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(i.baseKey)),0):i.baseKey.length&&(e.baseKey=i.baseKey)),i.ephemeralKey!=null&&(typeof i.ephemeralKey=="string"?nA.base64.decode(i.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(i.ephemeralKey)),0):i.ephemeralKey.length&&(e.ephemeralKey=i.ephemeralKey)),i.identityKey!=null&&(typeof i.identityKey=="string"?nA.base64.decode(i.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(i.identityKey)),0):i.identityKey.length&&(e.identityKey=i.identityKey)),i.baseKeySignature!=null&&(typeof i.baseKeySignature=="string"?nA.base64.decode(i.baseKeySignature,e.baseKeySignature=nA.newBuffer(nA.base64.length(i.baseKeySignature)),0):i.baseKeySignature.length&&(e.baseKeySignature=i.baseKeySignature)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.id=0,e.bytes===String?a.baseKey="":(a.baseKey=[],e.bytes!==Array&&(a.baseKey=nA.newBuffer(a.baseKey))),e.bytes===String?a.ephemeralKey="":(a.ephemeralKey=[],e.bytes!==Array&&(a.ephemeralKey=nA.newBuffer(a.ephemeralKey))),e.bytes===String?a.identityKey="":(a.identityKey=[],e.bytes!==Array&&(a.identityKey=nA.newBuffer(a.identityKey))),e.bytes===String?a.baseKeySignature="":(a.baseKeySignature=[],e.bytes!==Array&&(a.baseKeySignature=nA.newBuffer(a.baseKeySignature)))),i.id!=null&&i.hasOwnProperty("id")&&(a.id=i.id),i.baseKey!=null&&i.hasOwnProperty("baseKey")&&(a.baseKey=e.bytes===String?nA.base64.encode(i.baseKey,0,i.baseKey.length):e.bytes===Array?Array.prototype.slice.call(i.baseKey):i.baseKey),i.ephemeralKey!=null&&i.hasOwnProperty("ephemeralKey")&&(a.ephemeralKey=e.bytes===String?nA.base64.encode(i.ephemeralKey,0,i.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(i.ephemeralKey):i.ephemeralKey),i.identityKey!=null&&i.hasOwnProperty("identityKey")&&(a.identityKey=e.bytes===String?nA.base64.encode(i.identityKey,0,i.identityKey.length):e.bytes===Array?Array.prototype.slice.call(i.identityKey):i.identityKey),i.baseKeySignature!=null&&i.hasOwnProperty("baseKeySignature")&&(a.baseKeySignature=e.bytes===String?nA.base64.encode(i.baseKeySignature,0,i.baseKeySignature.length):e.bytes===Array?Array.prototype.slice.call(i.baseKeySignature):i.baseKeySignature),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,jc.util.toJSONOptions)},t})(),n})();J9.exports=Pn});var DF=$((EfA,z9)=>{"use strict";var{textsecure:{WhisperMessage:pUe,PreKeyWhisperMessage:dUe}}=q9();z9.exports={WhisperMessage:pUe,PreKeyWhisperMessage:dUe}});var X9=$((CfA,Z9)=>{var Ww=fF(),hUe=uF(),EUe=SF(),V9=Jw(),vg=Nl(),W9=xc(),bs=qw(),Ih=DF(),CUe=yF(),Jc=3;function Zw(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}var OF=class{constructor(t,o){if(!(o instanceof hUe))throw new TypeError("protocolAddress must be a ProtocolAddress");this.addr=o,this.storage=t}_encodeTupleByte(t,o){if(t>15||o>15)throw TypeError("Numbers must be 4 bits or less");return t<<4|o}_decodeTupleByte(t){return[t>>4,t&15]}toString(){return``}async getRecord(){let t=await this.storage.loadSession(this.addr.toString());if(t&&!(t instanceof V9))throw new TypeError("SessionRecord type expected from loadSession");return t}async storeRecord(t){t.removeOldSessions(),await this.storage.storeSession(this.addr.toString(),t)}async queueJob(t){return await CUe(this.addr.toString(),t)}async encrypt(t){Zw(t);let o=await this.storage.getOurIdentity();return await this.queueJob(async()=>{let i=await this.getRecord();if(!i)throw new bs.SessionError("No sessions");let e=i.getOpenSession();if(!e)throw new bs.SessionError("No open session");let a=e.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,a))throw new bs.UntrustedIdentityKeyError(this.addr.id,a);let A=e.getChain(e.currentRatchet.ephemeralKeyPair.pubKey);if(A.chainType===Ww.RECEIVING)throw new Error("Tried to encrypt on a receiving chain");this.fillMessageKeys(A,A.chainKey.counter+1);let r=vg.deriveSecrets(A.messageKeys[A.chainKey.counter],Buffer.alloc(32),Buffer.from("WhisperMessageKeys"));delete A.messageKeys[A.chainKey.counter];let s=Ih.WhisperMessage.create();s.ephemeralKey=e.currentRatchet.ephemeralKeyPair.pubKey,s.counter=A.chainKey.counter,s.previousCounter=e.currentRatchet.previousCounter,s.ciphertext=vg.encrypt(r[0],t,r[2].slice(0,16));let g=Ih.WhisperMessage.encode(s).finish(),c=Buffer.alloc(g.byteLength+66+1);c.set(o.pubKey),c.set(e.indexInfo.remoteIdentityKey,33),c[66]=this._encodeTupleByte(Jc,Jc),c.set(g,67);let I=vg.calculateMAC(r[1],c),d=Buffer.alloc(g.byteLength+9);d[0]=this._encodeTupleByte(Jc,Jc),d.set(g,1),d.set(I.slice(0,8),g.byteLength+1),await this.storeRecord(i);let B,f;if(e.pendingPreKey){B=3;let Q=Ih.PreKeyWhisperMessage.create({identityKey:o.pubKey,registrationId:await this.storage.getOurRegistrationId(),baseKey:e.pendingPreKey.baseKey,signedPreKeyId:e.pendingPreKey.signedKeyId,message:d});e.pendingPreKey.preKeyId&&(Q.preKeyId=e.pendingPreKey.preKeyId),f=Buffer.concat([Buffer.from([this._encodeTupleByte(Jc,Jc)]),Buffer.from(Ih.PreKeyWhisperMessage.encode(Q).finish())])}else B=1,f=d;return{type:B,body:f,registrationId:e.registrationId}})}async decryptWithSessions(t,o){if(!o.length)throw new bs.SessionError("No sessions available");let i=[];for(let e of o){let a;try{return a=await this.doDecryptWhisperMessage(t,e),e.indexInfo.used=Date.now(),{session:e,plaintext:a}}catch(A){i.push(A)}}console.error("Failed to decrypt message with any known session...");for(let e of i)console.error("Session error:"+e,e.stack);throw new bs.SessionError("No matching sessions found for message")}async decryptWhisperMessage(t){return Zw(t),await this.queueJob(async()=>{let o=await this.getRecord();if(!o)throw new bs.SessionError("No session record");let i=await this.decryptWithSessions(t,o.getSessions()),e=i.session.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,e))throw new bs.UntrustedIdentityKeyError(this.addr.id,e);return o.isClosed(i.session)&&console.warn("Decrypted message with closed session."),await this.storeRecord(o),i.plaintext})}async decryptPreKeyWhisperMessage(t){Zw(t);let o=this._decodeTupleByte(t[0]);if(o[1]>3||o[0]<3)throw new Error("Incompatible version number on PreKeyWhisperMessage");return await this.queueJob(async()=>{let i=await this.getRecord(),e=Ih.PreKeyWhisperMessage.decode(t.slice(1));if(!i){if(e.registrationId==null)throw new Error("No registrationId");i=new V9}let A=await new EUe(this.storage,this.addr).initIncoming(i,e),r=i.getSession(e.baseKey),s=await this.doDecryptWhisperMessage(e.message,r);return await this.storeRecord(i),A&&await this.storage.removePreKey(A),s})}async doDecryptWhisperMessage(t,o){if(Zw(t),!o)throw new TypeError("session required");let i=this._decodeTupleByte(t[0]);if(i[1]>3||i[0]<3)throw new Error("Incompatible version number on WhisperMessage");let e=t.slice(1,-8),a=Ih.WhisperMessage.decode(e);this.maybeStepRatchet(o,a.ephemeralKey,a.previousCounter);let A=o.getChain(a.ephemeralKey);if(A.chainType===Ww.SENDING)throw new Error("Tried to decrypt on a sending chain");if(this.fillMessageKeys(A,a.counter),!A.messageKeys.hasOwnProperty(a.counter))throw new bs.MessageCounterError("Key used already or never filled");let r=A.messageKeys[a.counter];delete A.messageKeys[a.counter];let s=vg.deriveSecrets(r,Buffer.alloc(32),Buffer.from("WhisperMessageKeys")),g=await this.storage.getOurIdentity(),c=Buffer.alloc(e.byteLength+66+1);c.set(o.indexInfo.remoteIdentityKey),c.set(g.pubKey,33),c[66]=this._encodeTupleByte(Jc,Jc),c.set(e,67),vg.verifyMAC(c,s[1],t.slice(-8),8);let I=vg.decrypt(s[0],a.ciphertext,s[2].slice(0,16));return delete o.pendingPreKey,I}fillMessageKeys(t,o){if(t.chainKey.counter>=o)return;if(o-t.chainKey.counter>2e3)throw new bs.SessionError("Over 2000 messages into the future!");if(t.chainKey.key===void 0)throw new bs.SessionError("Chain closed");let i=t.chainKey.key;return t.messageKeys[t.chainKey.counter+1]=vg.calculateMAC(i,Buffer.from([1])),t.chainKey.key=vg.calculateMAC(i,Buffer.from([2])),t.chainKey.counter+=1,this.fillMessageKeys(t,o)}maybeStepRatchet(t,o,i){if(t.getChain(o))return;let e=t.currentRatchet,a=t.getChain(e.lastRemoteEphemeralKey);a&&(this.fillMessageKeys(a,i),delete a.chainKey.key),this.calculateRatchet(t,o,!1);let A=t.getChain(e.ephemeralKeyPair.pubKey);A&&(e.previousCounter=A.chainKey.counter,t.deleteChain(e.ephemeralKeyPair.pubKey)),e.ephemeralKeyPair=W9.generateKeyPair(),this.calculateRatchet(t,o,!0),e.lastRemoteEphemeralKey=o}calculateRatchet(t,o,i){let e=t.currentRatchet,a=W9.calculateAgreement(o,e.ephemeralKeyPair.privKey),A=vg.deriveSecrets(a,e.rootKey,Buffer.from("WhisperRatchet"),2),r=i?e.ephemeralKeyPair.pubKey:o;t.addChain(r,{messageKeys:{},chainKey:{counter:-1,key:A[1]},chainType:i?Ww.SENDING:Ww.RECEIVING}),e.rootKey=A[0]}async hasOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();return t?t.haveOpenSession():!1})}async closeOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();if(t){let o=t.getOpenSession();o&&(t.closeSession(o),await this.storeRecord(t))}})}};Z9.exports=OF});var $9=$(Pg=>{"use strict";Pg.crypto=Nl();Pg.curve=xc();Pg.keyhelper=k9();Pg.ProtocolAddress=uF();Pg.SessionBuilder=SF();Pg.SessionCipher=X9();Pg.SessionRecord=Jw();Object.assign(Pg,qw())});var MF=$((yfA,aX)=>{"use strict";aX.exports=function(...n){try{return JSON.stringify(...n)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var _F=$((iX,oX)=>{"use strict";var SUe=MF();oX.exports=class extends Error{constructor(n){let t=n.filter(o=>o!=="").map(o=>typeof o=="string"?o:o instanceof Error?o.message:SUe(o));super(t.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,iX.assert)}}});var Rl=$((SfA,nX)=>{"use strict";var wUe=_F();nX.exports=function(n,...t){if(!n)throw t.length===1&&t[0]instanceof Error?t[0]:new wUe(t)}});var QB=$((wfA,gX)=>{"use strict";var TF=Rl(),sX={};gX.exports=function(n,t,o){if(t===!1||t===null||t===void 0)return n;o=o||{},typeof o=="string"&&(o={separator:o});let i=Array.isArray(t);TF(!i||!o.separator,"Separator option is not valid for array-based chain");let e=i?t:t.split(o.separator||"."),a=n;for(let A=0;A{"use strict";var cX={};di=IX.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};cX.typeMap=new Map([["[object Error]",di.error],["[object Map]",di.map],["[object Promise]",di.promise],["[object Set]",di.set],["[object WeakMap]",di.weakMap],["[object WeakSet]",di.weakSet]]);di.getInternalProto=function(n){if(Array.isArray(n))return di.array;if(Buffer&&n instanceof Buffer)return di.buffer;if(n instanceof Date)return di.date;if(n instanceof RegExp)return di.regex;if(n instanceof Error)return di.error;let t=Object.prototype.toString.call(n);return cX.typeMap.get(t)||di.generic}});var $w=$(lX=>{"use strict";lX.keys=function(n,t={}){return t.symbols!==!1?Reflect.ownKeys(n):Object.getOwnPropertyNames(n)}});var eD=$((OfA,pX)=>{"use strict";var DUe=QB(),po=NF(),OUe=$w(),Fg={needsProtoHack:new Set([po.set,po.map,po.weakSet,po.weakMap])};pX.exports=Fg.clone=function(n,t={},o=null){if(typeof n!="object"||n===null)return n;let i=Fg.clone,e=o;if(t.shallow){if(t.shallow!==!0)return Fg.cloneWithShallow(n,t);i=s=>s}else if(e){let s=e.get(n);if(s)return s}else e=new Map;let a=po.getInternalProto(n);if(a===po.buffer)return Buffer&&Buffer.from(n);if(a===po.date)return new Date(n.getTime());if(a===po.regex)return new RegExp(n);let A=Fg.base(n,a,t);if(A===n)return n;if(e&&e.set(n,A),a===po.set)for(let s of n)A.add(i(s,t,e));else if(a===po.map)for(let[s,g]of n)A.set(s,i(g,t,e));let r=OUe.keys(n,t);for(let s of r){if(s==="__proto__")continue;if(a===po.array&&s==="length"){A.length=n.length;continue}let g=Object.getOwnPropertyDescriptor(n,s);g?g.get||g.set?Object.defineProperty(A,s,g):g.enumerable?A[s]=i(n[s],t,e):Object.defineProperty(A,s,{enumerable:!1,writable:!0,configurable:!0,value:i(n[s],t,e)}):Object.defineProperty(A,s,{enumerable:!0,writable:!0,configurable:!0,value:i(n[s],t,e)})}return A};Fg.cloneWithShallow=function(n,t){let o=t.shallow;t=Object.assign({},t),t.shallow=!1;let i=new Map;for(let e of o){let a=DUe(n,e);(typeof a=="object"||typeof a=="function")&&i.set(a,a)}return Fg.clone(n,t,i)};Fg.base=function(n,t,o){if(o.prototype===!1)return Fg.needsProtoHack.has(t)?new t.constructor:t===po.array?[]:{};let i=Object.getPrototypeOf(n);if(i&&i.isImmutable)return n;if(t===po.array){let e=[];return i!==t&&Object.setPrototypeOf(e,i),e}if(Fg.needsProtoHack.has(t)){let e=new i.constructor;return i!==t&&Object.setPrototypeOf(e,i),e}return Object.create(i)}});var kF=$((bfA,EX)=>{"use strict";var RF=Rl(),dX=eD(),bUe=$w(),hX={};EX.exports=hX.merge=function(n,t,o){if(RF(n&&typeof n=="object","Invalid target value: must be an object"),RF(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return n;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(t)){RF(Array.isArray(n),"Cannot merge array onto an object"),o.mergeArrays||(n.length=0);for(let e=0;e{"use strict";var AD=Rl(),uX=eD(),BX=kF(),CX=QB(),tD={};fX.exports=function(n,t,o={}){if(AD(n&&typeof n=="object","Invalid defaults value: must be an object"),AD(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),AD(typeof o=="object","Invalid options: must be an object"),!t)return null;if(o.shallow)return tD.applyToDefaultsWithShallow(n,t,o);let i=uX(n);if(t===!0)return i;let e=o.nullOverride!==void 0?o.nullOverride:!1;return BX(i,t,{nullOverride:e,mergeArrays:!1})};tD.applyToDefaultsWithShallow=function(n,t,o){let i=o.shallow;AD(Array.isArray(i),"Invalid keys");let e=new Map,a=t===!0?null:new Set;for(let s of i){s=Array.isArray(s)?s:s.split(".");let g=CX(n,s);g&&typeof g=="object"?e.set(g,a&&CX(t,s)||g):a&&a.add(s)}let A=uX(n,{},e);if(!a)return A;for(let s of a)tD.reachCopy(A,t,s);let r=o.nullOverride!==void 0?o.nullOverride:!1;return BX(A,t,{nullOverride:r,mergeArrays:!1})};tD.reachCopy=function(n,t,o){for(let a of o){if(!(a in t))return;let A=t[a];if(typeof A!="object"||A===null)return;t=A}let i=t,e=n;for(let a=0;a{"use strict";var vF={};yX.exports=vF.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=vF.Bench.now()}elapsed(){return vF.Bench.now()-this.ts}static now(){let n=process.hrtime();return n[0]*1e3+n[1]/1e6}}});var PF=$((NfA,SX)=>{"use strict";SX.exports=function(){}});var DX=$((RfA,wX)=>{"use strict";var MUe=PF();wX.exports=function(){return new Promise(MUe)}});var GF=$((kfA,OX)=>{"use strict";var Ms=NF(),ai={mismatched:null};OX.exports=function(n,t,o){return o=Object.assign({prototype:!0},o),!!ai.isDeepEqual(n,t,o,[])};ai.isDeepEqual=function(n,t,o,i){if(n===t)return n!==0||1/n===1/t;let e=typeof n;if(e!==typeof t||n===null||t===null)return!1;if(e==="function"){if(!o.deepFunction||n.toString()!==t.toString())return!1}else if(e!=="object")return n!==n&&t!==t;let a=ai.getSharedType(n,t,!!o.prototype);switch(a){case Ms.buffer:return Buffer&&Buffer.prototype.equals.call(n,t);case Ms.promise:return n===t;case Ms.regex:return n.toString()===t.toString();case ai.mismatched:return!1}for(let A=i.length-1;A>=0;--A)if(i[A].isSame(n,t))return!0;i.push(new ai.SeenEntry(n,t));try{return!!ai.isDeepEqualObj(a,n,t,o,i)}finally{i.pop()}};ai.getSharedType=function(n,t,o){if(o)return Object.getPrototypeOf(n)!==Object.getPrototypeOf(t)?ai.mismatched:Ms.getInternalProto(n);let i=Ms.getInternalProto(n);return i!==Ms.getInternalProto(t)?ai.mismatched:i};ai.valueOf=function(n){let t=n.valueOf;if(t===void 0)return n;try{return t.call(n)}catch(o){return o}};ai.hasOwnEnumerableProperty=function(n,t){return Object.prototype.propertyIsEnumerable.call(n,t)};ai.isSetSimpleEqual=function(n,t){for(let o of Set.prototype.values.call(n))if(!Set.prototype.has.call(t,o))return!1;return!0};ai.isDeepEqualObj=function(n,t,o,i,e){let{isDeepEqual:a,valueOf:A,hasOwnEnumerableProperty:r}=ai,{keys:s,getOwnPropertySymbols:g}=Object;if(n===Ms.array)if(i.part){for(let f of t)for(let Q of o)if(a(f,Q,i,e))return!0}else{if(t.length!==o.length)return!1;for(let f=0;f{"use strict";bX.exports=function(n){return n.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var _X=$((GfA,MX)=>{"use strict";var rD=Rl(),_Ue=GF(),TUe=FF(),NUe=$w(),ho={};MX.exports=function(n,t,o={}){return typeof t!="object"&&(t=[t]),rD(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof n=="string"?ho.string(n,t,o):Array.isArray(n)?ho.array(n,t,o):(rD(typeof n=="object","Reference must be string or an object"),ho.object(n,t,o))};ho.array=function(n,t,o){if(Array.isArray(t)||(t=[t]),!n.length||o.only&&o.once&&n.length!==t.length)return!1;let i,e=new Map;for(let A of t)if(!o.deep||!A||typeof A!="object"){let r=e.get(A);r?++r.allowed:e.set(A,{allowed:1,hits:0})}else{i=i||ho.compare(o);let r=!1;for(let[s,g]of e.entries())if(i(s,A)){++g.allowed,r=!0;break}r||e.set(A,{allowed:1,hits:0})}let a=0;for(let A of n){let r;if(!o.deep||!A||typeof A!="object")r=e.get(A);else{i=i||ho.compare(o);for(let[s,g]of e.entries())if(i(s,A)){r=g;break}}if(r&&(++r.hits,++a,o.once&&r.hits>r.allowed))return!1}if(o.only&&a!==n.length)return!1;for(let A of e.values())if(A.hits!==A.allowed&&A.hitst.propertyIsEnumerable(s)),a=[...Object.keys(t),...e],A=ho.compare(o),r=new Set(a);for(let s of i){if(!r.has(s)){if(o.only)return!1;continue}if(!A(t[s],n[s]))return!1;r.delete(s)}return r.size?o.part?r.sizes!=="");let i=new Map,e=[];for(let s of t)if(rD(typeof s=="string","Cannot compare string reference to non-string value"),s){let g=i.get(s);g?++g.allowed:(i.set(s,{allowed:1,hits:0}),e.push(TUe(s)))}else if(o.once||o.only)return!1;if(!e.length)return!0;let a=new RegExp(`(${e.join("|")})`,"g"),A=n.replace(a,(s,g)=>(++i.get(g).hits,""));if(o.only&&A)return!1;let r=!1;for(let s of i.values())if(s.hits&&(r=!0),s.hits!==s.allowed&&(s.hits_Ue(e,a,i)};ho.shallow=function(n,t){return n===t}});var NX=$((FfA,TX)=>{"use strict";var RUe=Rl();TX.exports=function(n){return RUe(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(n),"Bad attribute value ("+n+")"),n.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var kX=$((LfA,RX)=>{"use strict";var zc={};RX.exports=function(n){if(!n)return"";let t="";for(let o=0;o=256?"&#"+n+";":`&#x${n.toString(16).padStart(2,"0")};`)};zc.isSafe=function(n){return zc.safeCharCodes.has(n)};zc.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);zc.safeCharCodes=(function(){let n=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&n.add(t);return n})()});var PX=$((UfA,vX)=>{"use strict";var aD={};vX.exports=function(n){return n?n.replace(/[<>&\u2028\u2029]/g,aD.escape):""};aD.escape=function(n){return aD.replacements.get(n)};aD.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var LX=$((HfA,FX)=>{"use strict";var GX={};FX.exports=GX.flatten=function(n,t){let o=t||[];for(let i of n)Array.isArray(i)?GX.flatten(i,o):o.push(i);return o}});var KX=$((KfA,HX)=>{"use strict";var UX={};HX.exports=function(n,t,o={}){if(!n||!t)return o.first?null:[];let i=[],e=Array.isArray(n)?new Set(n):n,a=new Set;for(let A of t)if(UX.has(e,A)&&!a.has(A)){if(o.first)return A;i.push(A),a.add(A)}return o.first?null:i};UX.has=function(n,t){return typeof n.has=="function"?n.has(t):n[t]!==void 0}});var YX=$((xfA,xX)=>{"use strict";xX.exports=function(n){return!!n&&typeof n.then=="function"}});var qX=$((YfA,JX)=>{"use strict";var jX={wrapped:Symbol("wrapped")};JX.exports=function(n){if(n[jX.wrapped])return n;let t=!1,o=function(...i){t||(t=!0,n(...i))};return o[jX.wrapped]=!0,o}});var VX=$((jfA,zX)=>{"use strict";var kUe=QB();zX.exports=function(n,t,o){return t.replace(/{([^{}]+)}/g,(i,e)=>{let a=kUe(n,e,o);return a??""})}});var ZX=$((JfA,WX)=>{"use strict";var vUe={maxTimer:2147483647};WX.exports=function(n,t,o){if(typeof n=="bigint"&&(n=Number(n)),n>=Number.MAX_SAFE_INTEGER&&(n=1/0),typeof n!="number"&&n!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(i=>{let e=o?o.setTimeout:setTimeout,a=()=>{let A=Math.min(n,vUe.maxTimer);n-=A,e(()=>n>0?a():i(t),A)};n!==1/0&&a()})}});var XX=$(pr=>{"use strict";pr.applyToDefaults=QX();pr.assert=Rl();pr.Bench=mX();pr.block=DX();pr.clone=eD();pr.contain=_X();pr.deepEqual=GF();pr.Error=_F();pr.escapeHeaderAttribute=NX();pr.escapeHtml=kX();pr.escapeJson=PX();pr.escapeRegex=FF();pr.flatten=LX();pr.ignore=PF();pr.intersect=KX();pr.isPromise=YX();pr.merge=kF();pr.once=qX();pr.reach=QB();pr.reachTemplate=VX();pr.stringify=MF();pr.wait=ZX()});var Kr=$(Pe=>{"use strict";var kl=XX(),ji={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};Pe.Boom=class extends Error{constructor(n,t={}){if(n instanceof Error)return Pe.boomify(kl.clone(n),t);let{statusCode:o=500,data:i=null,ctor:e=Pe.Boom}=t,a=new Error(n||void 0);Error.captureStackTrace(a,e),a.data=i;let A=ji.initialize(a,o);return Object.defineProperty(A,"typeof",{value:e}),t.decorate&&Object.assign(A,t.decorate),A}static[Symbol.hasInstance](n){return this===Pe.Boom?Pe.isBoom(n):this.prototype.isPrototypeOf(n)}};Pe.isBoom=function(n,t){return n instanceof Error&&!!n.isBoom&&(!t||n.output.statusCode===t)};Pe.boomify=function(n,t){return kl.assert(n instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(n.data=t.data),t.decorate&&Object.assign(n,t.decorate),n.isBoom?t.override===!1||!t.statusCode&&!t.message?n:ji.initialize(n,t.statusCode||n.output.statusCode,t.message):ji.initialize(n,t.statusCode||500,t.message)};Pe.badRequest=function(n,t){return new Pe.Boom(n,{statusCode:400,data:t,ctor:Pe.badRequest})};Pe.unauthorized=function(n,t,o){let i=new Pe.Boom(n,{statusCode:401,ctor:Pe.unauthorized});if(!t)return i;if(typeof t!="string")return i.output.headers["WWW-Authenticate"]=t.join(", "),i;let e=`${t}`;return(o||n)&&(i.output.payload.attributes={}),o&&(typeof o=="string"?(e+=" "+kl.escapeHeaderAttribute(o),i.output.payload.attributes=o):e+=" "+Object.keys(o).map(a=>{let A=o[a];return A==null&&(A=""),i.output.payload.attributes[a]=A,`${a}="${kl.escapeHeaderAttribute(A.toString())}"`}).join(", ")),n?(o&&(e+=","),e+=` error="${kl.escapeHeaderAttribute(n)}"`,i.output.payload.attributes.error=n):i.isMissing=!0,i.output.headers["WWW-Authenticate"]=e,i};Pe.paymentRequired=function(n,t){return new Pe.Boom(n,{statusCode:402,data:t,ctor:Pe.paymentRequired})};Pe.forbidden=function(n,t){return new Pe.Boom(n,{statusCode:403,data:t,ctor:Pe.forbidden})};Pe.notFound=function(n,t){return new Pe.Boom(n,{statusCode:404,data:t,ctor:Pe.notFound})};Pe.methodNotAllowed=function(n,t,o){let i=new Pe.Boom(n,{statusCode:405,data:t,ctor:Pe.methodNotAllowed});return typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i.output.headers.Allow=o.join(", ")),i};Pe.notAcceptable=function(n,t){return new Pe.Boom(n,{statusCode:406,data:t,ctor:Pe.notAcceptable})};Pe.proxyAuthRequired=function(n,t){return new Pe.Boom(n,{statusCode:407,data:t,ctor:Pe.proxyAuthRequired})};Pe.clientTimeout=function(n,t){return new Pe.Boom(n,{statusCode:408,data:t,ctor:Pe.clientTimeout})};Pe.conflict=function(n,t){return new Pe.Boom(n,{statusCode:409,data:t,ctor:Pe.conflict})};Pe.resourceGone=function(n,t){return new Pe.Boom(n,{statusCode:410,data:t,ctor:Pe.resourceGone})};Pe.lengthRequired=function(n,t){return new Pe.Boom(n,{statusCode:411,data:t,ctor:Pe.lengthRequired})};Pe.preconditionFailed=function(n,t){return new Pe.Boom(n,{statusCode:412,data:t,ctor:Pe.preconditionFailed})};Pe.entityTooLarge=function(n,t){return new Pe.Boom(n,{statusCode:413,data:t,ctor:Pe.entityTooLarge})};Pe.uriTooLong=function(n,t){return new Pe.Boom(n,{statusCode:414,data:t,ctor:Pe.uriTooLong})};Pe.unsupportedMediaType=function(n,t){return new Pe.Boom(n,{statusCode:415,data:t,ctor:Pe.unsupportedMediaType})};Pe.rangeNotSatisfiable=function(n,t){return new Pe.Boom(n,{statusCode:416,data:t,ctor:Pe.rangeNotSatisfiable})};Pe.expectationFailed=function(n,t){return new Pe.Boom(n,{statusCode:417,data:t,ctor:Pe.expectationFailed})};Pe.teapot=function(n,t){return new Pe.Boom(n,{statusCode:418,data:t,ctor:Pe.teapot})};Pe.badData=function(n,t){return new Pe.Boom(n,{statusCode:422,data:t,ctor:Pe.badData})};Pe.locked=function(n,t){return new Pe.Boom(n,{statusCode:423,data:t,ctor:Pe.locked})};Pe.failedDependency=function(n,t){return new Pe.Boom(n,{statusCode:424,data:t,ctor:Pe.failedDependency})};Pe.tooEarly=function(n,t){return new Pe.Boom(n,{statusCode:425,data:t,ctor:Pe.tooEarly})};Pe.preconditionRequired=function(n,t){return new Pe.Boom(n,{statusCode:428,data:t,ctor:Pe.preconditionRequired})};Pe.tooManyRequests=function(n,t){return new Pe.Boom(n,{statusCode:429,data:t,ctor:Pe.tooManyRequests})};Pe.illegal=function(n,t){return new Pe.Boom(n,{statusCode:451,data:t,ctor:Pe.illegal})};Pe.internal=function(n,t,o=500){return ji.serverError(n,t,o,Pe.internal)};Pe.notImplemented=function(n,t){return ji.serverError(n,t,501,Pe.notImplemented)};Pe.badGateway=function(n,t){return ji.serverError(n,t,502,Pe.badGateway)};Pe.serverUnavailable=function(n,t){return ji.serverError(n,t,503,Pe.serverUnavailable)};Pe.gatewayTimeout=function(n,t){return ji.serverError(n,t,504,Pe.gatewayTimeout)};Pe.badImplementation=function(n,t){let o=ji.serverError(n,t,500,Pe.badImplementation);return o.isDeveloperError=!0,o};ji.initialize=function(n,t,o){let i=parseInt(t,10);if(kl.assert(!isNaN(i)&&i>=400,"First argument must be a number (400+):",t),n.isBoom=!0,n.isServer=i>=500,n.hasOwnProperty("data")||(n.data=null),n.output={statusCode:i,payload:{},headers:{}},Object.defineProperty(n,"reformat",{value:ji.reformat,configurable:!0}),!o&&!n.message&&(n.reformat(),o=n.output.payload.error),o){let e=Object.getOwnPropertyDescriptor(n,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),"message");kl.assert(!e||e.configurable&&!e.get,"The error is not compatible with boom"),n.message=o+(n.message?": "+n.message:""),n.output.payload.message=n.message}return n.reformat(),n};ji.reformat=function(n=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=ji.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&n!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};ji.serverError=function(n,t,o,i){return t instanceof Error&&!t.isBoom?Pe.boomify(t,{statusCode:o,message:n}):new Pe.Boom(n,{statusCode:o,data:t,ctor:i})}});var A$,hHe,EHe,CHe,uHe,BHe,fHe,QHe,yHe,mHe,SHe,wHe,DHe,OHe,bHe,O,Ts=Ce(()=>{A$=n=>typeof n<"u"&&n!==null,hHe=n=>typeof n=="object",EHe=n=>Object.prototype.toString.call(n)==="[object Object]",CHe=n=>typeof n=="function",uHe=n=>typeof n=="boolean",BHe=n=>n instanceof Buffer,fHe=n=>{if(A$(n))switch(n.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},QHe=n=>n instanceof ArrayBuffer,yHe=n=>typeof n=="string"&&n.length>0,mHe=n=>typeof n=="number"&&Number.isFinite(n),SHe=n=>Number.isInteger(n),wHe=(n,t,o)=>n>=t&&n<=o,DHe=(n,t)=>t.includes(n),OHe=(n,t,o)=>new Error(`Expected ${t} for ${n} but received ${o} of type ${typeof o}`),bHe=(n,t)=>(t.message=n.message,t),O={defined:A$,object:hHe,plainObject:EHe,fn:CHe,bool:uHe,buffer:BHe,typedArray:fHe,arrayBuffer:QHe,string:yHe,number:mHe,integer:SHe,inRange:wHe,inArray:DHe,invalidParameterError:OHe,nativeError:bHe}});var a$=$((ryA,r$)=>{"use strict";var t$=()=>process.platform==="linux",fD=null,MHe=()=>{if(!fD)if(t$()&&process.report){let n=process.report.excludeNetwork;process.report.excludeNetwork=!0,fD=process.report.getReport(),process.report.excludeNetwork=n}else fD={};return fD};r$.exports={isLinux:t$,getReport:MHe}});var o$=$((ayA,i$)=>{"use strict";var yh=$e("fs"),_He="/usr/bin/ldd",THe="/proc/self/exe",QD=2048,NHe=n=>{let t=yh.openSync(n,"r"),o=Buffer.alloc(QD),i=yh.readSync(t,o,0,QD,0);return yh.close(t,()=>{}),o.subarray(0,i)},RHe=n=>new Promise((t,o)=>{yh.open(n,"r",(i,e)=>{if(i)o(i);else{let a=Buffer.alloc(QD);yh.read(e,a,0,QD,0,(A,r)=>{t(a.subarray(0,r)),yh.close(e,()=>{})})}})});i$.exports={LDD_PATH:_He,SELF_PATH:THe,readFileSync:NHe,readFile:RHe}});var s$=$((iyA,n$)=>{"use strict";var kHe=n=>{if(n.length<64||n.readUInt32BE(0)!==2135247942||n.readUInt8(4)!==2||n.readUInt8(5)!==1)return null;let t=n.readUInt32LE(32),o=n.readUInt16LE(54),i=n.readUInt16LE(56);for(let e=0;e{"use strict";var c$=$e("child_process"),{isLinux:mh,getReport:I$}=a$(),{LDD_PATH:yD,SELF_PATH:l$,readFile:XF,readFileSync:$F}=o$(),{interpreterPath:p$}=s$(),Ns,Rs,ks,d$="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",AI="",h$=()=>AI||new Promise(n=>{c$.exec(d$,(t,o)=>{AI=t?" ":o,n(AI)})}),E$=()=>{if(!AI)try{AI=c$.execSync(d$,{encoding:"utf8"})}catch{AI=" "}return AI},xg="glibc",C$=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Ul="musl",vHe=n=>n.includes("libc.musl-")||n.includes("ld-musl-"),u$=()=>{let n=I$();return n.header&&n.header.glibcVersionRuntime?xg:Array.isArray(n.sharedObjects)&&n.sharedObjects.some(vHe)?Ul:null},B$=n=>{let[t,o]=n.split(/[\r\n]+/);return t&&t.includes(xg)?xg:o&&o.includes(Ul)?Ul:null},f$=n=>{if(n){if(n.includes("/ld-musl-"))return Ul;if(n.includes("/ld-linux-"))return xg}return null},Q$=n=>(n=n.toString(),n.includes("musl")?Ul:n.includes("GNU C Library")?xg:null),PHe=async()=>{if(Rs!==void 0)return Rs;Rs=null;try{let n=await XF(yD);Rs=Q$(n)}catch{}return Rs},GHe=()=>{if(Rs!==void 0)return Rs;Rs=null;try{let n=$F(yD);Rs=Q$(n)}catch{}return Rs},FHe=async()=>{if(Ns!==void 0)return Ns;Ns=null;try{let n=await XF(l$),t=p$(n);Ns=f$(t)}catch{}return Ns},LHe=()=>{if(Ns!==void 0)return Ns;Ns=null;try{let n=$F(l$),t=p$(n);Ns=f$(t)}catch{}return Ns},y$=async()=>{let n=null;if(mh()&&(n=await FHe(),!n&&(n=await PHe(),n||(n=u$()),!n))){let t=await h$();n=B$(t)}return n},m$=()=>{let n=null;if(mh()&&(n=LHe(),!n&&(n=GHe(),n||(n=u$()),!n))){let t=E$();n=B$(t)}return n},UHe=async()=>mh()&&await y$()!==xg,HHe=()=>mh()&&m$()!==xg,KHe=async()=>{if(ks!==void 0)return ks;ks=null;try{let t=(await XF(yD)).match(C$);t&&(ks=t[1])}catch{}return ks},xHe=()=>{if(ks!==void 0)return ks;ks=null;try{let t=$F(yD).match(C$);t&&(ks=t[1])}catch{}return ks},S$=()=>{let n=I$();return n.header&&n.header.glibcVersionRuntime?n.header.glibcVersionRuntime:null},g$=n=>n.trim().split(/\s+/)[1],w$=n=>{let[t,o,i]=n.split(/[\r\n]+/);return t&&t.includes(xg)?g$(t):o&&i&&o.includes(Ul)?g$(i):null},YHe=async()=>{let n=null;if(mh()&&(n=await KHe(),n||(n=S$()),!n)){let t=await h$();n=w$(t)}return n},jHe=()=>{let n=null;if(mh()&&(n=xHe(),n||(n=S$()),!n)){let t=E$();n=w$(t)}return n};D$.exports={GLIBC:xg,MUSL:Ul,family:y$,familySync:m$,isNonGlibcLinux:UHe,isNonGlibcLinuxSync:HHe,version:YHe,versionSync:jHe}});var Sh=$((nyA,O$)=>{"use strict";var JHe="2.0.0",qHe=Number.MAX_SAFE_INTEGER||9007199254740991,zHe=16,VHe=250,WHe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];O$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:zHe,MAX_SAFE_BUILD_LENGTH:VHe,MAX_SAFE_INTEGER:qHe,RELEASE_TYPES:WHe,SEMVER_SPEC_VERSION:JHe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vB=$((syA,b$)=>{"use strict";var ZHe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};b$.exports=ZHe});var wh=$((vs,M$)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:eL,MAX_SAFE_BUILD_LENGTH:XHe,MAX_LENGTH:$He}=Sh(),eKe=vB();vs=M$.exports={};var AKe=vs.re=[],tKe=vs.safeRe=[],gA=vs.src=[],rKe=vs.safeSrc=[],cA=vs.t={},aKe=0,AL="[a-zA-Z0-9-]",iKe=[["\\s",1],["\\d",$He],[AL,XHe]],oKe=n=>{for(let[t,o]of iKe)n=n.split(`${t}*`).join(`${t}{0,${o}}`).split(`${t}+`).join(`${t}{1,${o}}`);return n},JA=(n,t,o)=>{let i=oKe(t),e=aKe++;eKe(n,e,t),cA[n]=e,gA[e]=t,rKe[e]=i,AKe[e]=new RegExp(t,o?"g":void 0),tKe[e]=new RegExp(i,o?"g":void 0)};JA("NUMERICIDENTIFIER","0|[1-9]\\d*");JA("NUMERICIDENTIFIERLOOSE","\\d+");JA("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${AL}*`);JA("MAINVERSION",`(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})`);JA("MAINVERSIONLOOSE",`(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASEIDENTIFIER",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIER]})`);JA("PRERELEASEIDENTIFIERLOOSE",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASE",`(?:-(${gA[cA.PRERELEASEIDENTIFIER]}(?:\\.${gA[cA.PRERELEASEIDENTIFIER]})*))`);JA("PRERELEASELOOSE",`(?:-?(${gA[cA.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${gA[cA.PRERELEASEIDENTIFIERLOOSE]})*))`);JA("BUILDIDENTIFIER",`${AL}+`);JA("BUILD",`(?:\\+(${gA[cA.BUILDIDENTIFIER]}(?:\\.${gA[cA.BUILDIDENTIFIER]})*))`);JA("FULLPLAIN",`v?${gA[cA.MAINVERSION]}${gA[cA.PRERELEASE]}?${gA[cA.BUILD]}?`);JA("FULL",`^${gA[cA.FULLPLAIN]}$`);JA("LOOSEPLAIN",`[v=\\s]*${gA[cA.MAINVERSIONLOOSE]}${gA[cA.PRERELEASELOOSE]}?${gA[cA.BUILD]}?`);JA("LOOSE",`^${gA[cA.LOOSEPLAIN]}$`);JA("GTLT","((?:<|>)?=?)");JA("XRANGEIDENTIFIERLOOSE",`${gA[cA.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);JA("XRANGEIDENTIFIER",`${gA[cA.NUMERICIDENTIFIER]}|x|X|\\*`);JA("XRANGEPLAIN",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:${gA[cA.PRERELEASE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGEPLAINLOOSE",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:${gA[cA.PRERELEASELOOSE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAIN]}$`);JA("XRANGELOOSE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COERCEPLAIN",`(^|[^\\d])(\\d{1,${eL}})(?:\\.(\\d{1,${eL}}))?(?:\\.(\\d{1,${eL}}))?`);JA("COERCE",`${gA[cA.COERCEPLAIN]}(?:$|[^\\d])`);JA("COERCEFULL",gA[cA.COERCEPLAIN]+`(?:${gA[cA.PRERELEASE]})?(?:${gA[cA.BUILD]})?(?:$|[^\\d])`);JA("COERCERTL",gA[cA.COERCE],!0);JA("COERCERTLFULL",gA[cA.COERCEFULL],!0);JA("LONETILDE","(?:~>?)");JA("TILDETRIM",`(\\s*)${gA[cA.LONETILDE]}\\s+`,!0);vs.tildeTrimReplace="$1~";JA("TILDE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAIN]}$`);JA("TILDELOOSE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("LONECARET","(?:\\^)");JA("CARETTRIM",`(\\s*)${gA[cA.LONECARET]}\\s+`,!0);vs.caretTrimReplace="$1^";JA("CARET",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAIN]}$`);JA("CARETLOOSE",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COMPARATORLOOSE",`^${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]})$|^$`);JA("COMPARATOR",`^${gA[cA.GTLT]}\\s*(${gA[cA.FULLPLAIN]})$|^$`);JA("COMPARATORTRIM",`(\\s*)${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]}|${gA[cA.XRANGEPLAIN]})`,!0);vs.comparatorTrimReplace="$1$2$3";JA("HYPHENRANGE",`^\\s*(${gA[cA.XRANGEPLAIN]})\\s+-\\s+(${gA[cA.XRANGEPLAIN]})\\s*$`);JA("HYPHENRANGELOOSE",`^\\s*(${gA[cA.XRANGEPLAINLOOSE]})\\s+-\\s+(${gA[cA.XRANGEPLAINLOOSE]})\\s*$`);JA("STAR","(<|>)?=?\\s*\\*");JA("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");JA("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var SD=$((gyA,_$)=>{"use strict";var nKe=Object.freeze({loose:!0}),sKe=Object.freeze({}),gKe=n=>n?typeof n!="object"?nKe:n:sKe;_$.exports=gKe});var tL=$((cyA,R$)=>{"use strict";var T$=/^[0-9]+$/,N$=(n,t)=>{if(typeof n=="number"&&typeof t=="number")return n===t?0:nN$(t,n);R$.exports={compareIdentifiers:N$,rcompareIdentifiers:cKe}});var ba=$((IyA,v$)=>{"use strict";var wD=vB(),{MAX_LENGTH:k$,MAX_SAFE_INTEGER:DD}=Sh(),{safeRe:OD,t:bD}=wh(),IKe=SD(),{compareIdentifiers:rL}=tL(),lKe=(n,t)=>{let o=t.split(".");if(o.length>n.length)return!1;for(let i=0;ik$)throw new TypeError(`version is longer than ${k$} characters`);wD("SemVer",t,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;let i=t.trim().match(o.loose?OD[bD.LOOSE]:OD[bD.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>DD||this.major<0)throw new TypeError("Invalid major version");if(this.minor>DD||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>DD||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let a=+e;if(a>=0&&at.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof n||(t=new n(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let o=0;do{let i=this.prerelease[o],e=t.prerelease[o];if(wD("prerelease compare",o,i,e),i===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(i===void 0)return-1;if(i===e)continue;return rL(i,e)}while(++o)}compareBuild(t){t instanceof n||(t=new n(t,this.options));let o=0;do{let i=this.build[o],e=t.build[o];if(wD("build compare",o,i,e),i===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(i===void 0)return-1;if(i===e)continue;return rL(i,e)}while(++o)}inc(t,o,i){if(t.startsWith("pre")){if(!o&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(o){let e=`-${o}`.match(this.options.loose?OD[bD.PRERELEASELOOSE]:OD[bD.PRERELEASE]);if(!e||e[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,i),this.inc("pre",o,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,i),this.inc("pre",o,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(o===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(o){let a=[o,e];if(i===!1&&(a=[o]),lKe(this.prerelease,o)){let A=this.prerelease[o.split(".").length];isNaN(A)&&(this.prerelease=a)}else this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};v$.exports=aL});var tI=$((lyA,G$)=>{"use strict";var P$=ba(),pKe=(n,t,o=!1)=>{if(n instanceof P$)return n;try{return new P$(n,t)}catch(i){if(!o)return null;throw i}};G$.exports=pKe});var L$=$((pyA,F$)=>{"use strict";var dKe=tI(),hKe=(n,t)=>{let o=dKe(n,t);return o?o.version:null};F$.exports=hKe});var H$=$((dyA,U$)=>{"use strict";var EKe=tI(),CKe=(n,t)=>{let o=EKe(n.trim().replace(/^[=v]+/,""),t);return o?o.version:null};U$.exports=CKe});var Y$=$((hyA,x$)=>{"use strict";var K$=ba(),uKe=(n,t,o,i,e)=>{typeof o=="string"&&(e=i,i=o,o=void 0);try{return new K$(n instanceof K$?n.version:n,o).inc(t,i,e).version}catch{return null}};x$.exports=uKe});var q$=$((EyA,J$)=>{"use strict";var j$=tI(),BKe=(n,t)=>{let o=j$(n,null,!0),i=j$(t,null,!0),e=o.compare(i);if(e===0)return null;let a=e>0,A=a?o:i,r=a?i:o,s=!!A.prerelease.length;if(!!r.prerelease.length&&!s){if(!r.patch&&!r.minor)return"major";if(r.compareMain(A)===0)return r.minor&&!r.patch?"minor":"patch"}let c=s?"pre":"";return o.major!==i.major?c+"major":o.minor!==i.minor?c+"minor":o.patch!==i.patch?c+"patch":"prerelease"};J$.exports=BKe});var V$=$((CyA,z$)=>{"use strict";var fKe=ba(),QKe=(n,t)=>new fKe(n,t).major;z$.exports=QKe});var Z$=$((uyA,W$)=>{"use strict";var yKe=ba(),mKe=(n,t)=>new yKe(n,t).minor;W$.exports=mKe});var $$=$((ByA,X$)=>{"use strict";var SKe=ba(),wKe=(n,t)=>new SKe(n,t).patch;X$.exports=wKe});var Aee=$((fyA,eee)=>{"use strict";var DKe=tI(),OKe=(n,t)=>{let o=DKe(n,t);return o&&o.prerelease.length?o.prerelease:null};eee.exports=OKe});var Wo=$((QyA,ree)=>{"use strict";var tee=ba(),bKe=(n,t,o)=>new tee(n,o).compare(new tee(t,o));ree.exports=bKe});var iee=$((yyA,aee)=>{"use strict";var MKe=Wo(),_Ke=(n,t,o)=>MKe(t,n,o);aee.exports=_Ke});var nee=$((myA,oee)=>{"use strict";var TKe=Wo(),NKe=(n,t)=>TKe(n,t,!0);oee.exports=NKe});var MD=$((SyA,gee)=>{"use strict";var see=ba(),RKe=(n,t,o)=>{let i=new see(n,o),e=new see(t,o);return i.compare(e)||i.compareBuild(e)};gee.exports=RKe});var Iee=$((wyA,cee)=>{"use strict";var kKe=MD(),vKe=(n,t)=>n.sort((o,i)=>kKe(o,i,t));cee.exports=vKe});var pee=$((DyA,lee)=>{"use strict";var PKe=MD(),GKe=(n,t)=>n.sort((o,i)=>PKe(i,o,t));lee.exports=GKe});var PB=$((OyA,dee)=>{"use strict";var FKe=Wo(),LKe=(n,t,o)=>FKe(n,t,o)>0;dee.exports=LKe});var _D=$((byA,hee)=>{"use strict";var UKe=Wo(),HKe=(n,t,o)=>UKe(n,t,o)<0;hee.exports=HKe});var iL=$((MyA,Eee)=>{"use strict";var KKe=Wo(),xKe=(n,t,o)=>KKe(n,t,o)===0;Eee.exports=xKe});var oL=$((_yA,Cee)=>{"use strict";var YKe=Wo(),jKe=(n,t,o)=>YKe(n,t,o)!==0;Cee.exports=jKe});var TD=$((TyA,uee)=>{"use strict";var JKe=Wo(),qKe=(n,t,o)=>JKe(n,t,o)>=0;uee.exports=qKe});var ND=$((NyA,Bee)=>{"use strict";var zKe=Wo(),VKe=(n,t,o)=>zKe(n,t,o)<=0;Bee.exports=VKe});var nL=$((RyA,fee)=>{"use strict";var WKe=iL(),ZKe=oL(),XKe=PB(),$Ke=TD(),exe=_D(),Axe=ND(),txe=(n,t,o,i)=>{switch(t){case"===":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n===o;case"!==":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n!==o;case"":case"=":case"==":return WKe(n,o,i);case"!=":return ZKe(n,o,i);case">":return XKe(n,o,i);case">=":return $Ke(n,o,i);case"<":return exe(n,o,i);case"<=":return Axe(n,o,i);default:throw new TypeError(`Invalid operator: ${t}`)}};fee.exports=txe});var yee=$((kyA,Qee)=>{"use strict";var rxe=ba(),axe=tI(),{safeRe:RD,t:kD}=wh(),ixe=(n,t)=>{if(n instanceof rxe)return n;if(typeof n=="number"&&(n=String(n)),typeof n!="string")return null;t=t||{};let o=null;if(!t.rtl)o=n.match(t.includePrerelease?RD[kD.COERCEFULL]:RD[kD.COERCE]);else{let s=t.includePrerelease?RD[kD.COERCERTLFULL]:RD[kD.COERCERTL],g;for(;(g=s.exec(n))&&(!o||o.index+o[0].length!==n.length);)(!o||g.index+g[0].length!==o.index+o[0].length)&&(o=g),s.lastIndex=g.index+g[1].length+g[2].length;s.lastIndex=-1}if(o===null)return null;let i=o[2],e=o[3]||"0",a=o[4]||"0",A=t.includePrerelease&&o[5]?`-${o[5]}`:"",r=t.includePrerelease&&o[6]?`+${o[6]}`:"";return axe(`${i}.${e}.${a}${A}${r}`,t)};Qee.exports=ixe});var See=$((vyA,mee)=>{"use strict";var oxe=tI(),nxe=Sh(),sxe=ba(),gxe=(n,t,o)=>{if(!nxe.RELEASE_TYPES.includes(t))return null;let i=cxe(n,o);return i&&Ixe(i,t)},cxe=(n,t)=>{let o=n instanceof sxe?n.version:n;return oxe(o,t)},Ixe=(n,t)=>{if(lxe(t))return n.version;switch(n.prerelease=[],t){case"major":n.minor=0,n.patch=0;break;case"minor":n.patch=0;break}return n.format()},lxe=n=>n.startsWith("pre");mee.exports=gxe});var Dee=$((PyA,wee)=>{"use strict";var sL=class{constructor(){this.max=1e3,this.map=new Map}get(t){let o=this.map.get(t);if(o!==void 0)return this.map.delete(t),this.map.set(t,o),o}delete(t){return this.map.delete(t)}set(t,o){if(!this.delete(t)&&o!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(t,o)}return this}};wee.exports=sL});var Zo=$((GyA,_ee)=>{"use strict";var pxe=/\s+/g,gL=class n{constructor(t,o){if(o=hxe(o),t instanceof n)return t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease?t:new n(t.raw,o);if(t instanceof cL)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=t.trim().replace(pxe," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(e=>!bee(e[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Sxe(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let o=this.set[t];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=o[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(mxe,"");let i=((this.options.includePrerelease&&Qxe)|(this.options.loose&&yxe))+":"+t,e=Oee.get(i);if(e)return e;let a=this.options.loose,A=a?hi[Ma.HYPHENRANGELOOSE]:hi[Ma.HYPHENRANGE];t=t.replace(A,vxe(this.options.includePrerelease)),qt("hyphen replace",t),t=t.replace(hi[Ma.COMPARATORTRIM],uxe),qt("comparator trim",t),t=t.replace(hi[Ma.TILDETRIM],Bxe),qt("tilde trim",t),t=t.replace(hi[Ma.CARETTRIM],fxe),qt("caret trim",t);let r=t.split(" ").map(I=>wxe(I,this.options)).join(" ").split(/\s+/).map(I=>kxe(I,this.options));a&&(r=r.filter(I=>(qt("loose invalid filter",I,this.options),!!I.match(hi[Ma.COMPARATORLOOSE])))),qt("range list",r);let s=new Map,g=r.map(I=>new cL(I,this.options));for(let I of g){if(bee(I))return[I];s.set(I.value,I)}s.size>1&&s.has("")&&s.delete("");let c=[...s.values()];return Oee.set(i,c),c}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Range is required");return this.set.some(i=>Mee(i,o)&&t.set.some(e=>Mee(e,o)&&i.every(a=>e.every(A=>a.intersects(A,o)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Exe(t,this.options)}catch{return!1}for(let o=0;on.value==="<0.0.0-0",Sxe=n=>n.value==="",Mee=(n,t)=>{let o=!0,i=n.slice(),e=i.pop();for(;o&&i.length;)o=i.every(a=>e.intersects(a,t)),e=i.pop();return o},wxe=(n,t)=>(n=n.replace(hi[Ma.BUILD],""),qt("comp",n,t),n=Mxe(n,t),qt("caret",n),n=Oxe(n,t),qt("tildes",n),n=Txe(n,t),qt("xrange",n),n=Rxe(n,t),qt("stars",n),n),Jr=n=>!n||n.toLowerCase()==="x"||n==="*",Dxe=(n,t,o)=>Jr(n)&&!Jr(t)||Jr(t)&&o&&!Jr(o),Oxe=(n,t)=>n.trim().split(/\s+/).map(o=>bxe(o,t)).join(" "),bxe=(n,t)=>{let o=t.loose?hi[Ma.TILDELOOSE]:hi[Ma.TILDE],i=t.includePrerelease?"-0":"";return n.replace(o,(e,a,A,r,s)=>{qt("tilde",n,e,a,A,r,s);let g;return Jr(a)?g="":Jr(A)?g=`>=${a}.0.0${i} <${+a+1}.0.0-0`:Jr(r)?g=`>=${a}.${A}.0${i} <${a}.${+A+1}.0-0`:s?(qt("replaceTilde pr",s),g=`>=${a}.${A}.${r}-${s} <${a}.${+A+1}.0-0`):g=`>=${a}.${A}.${r} <${a}.${+A+1}.0-0`,qt("tilde return",g),g})},Mxe=(n,t)=>n.trim().split(/\s+/).map(o=>_xe(o,t)).join(" "),_xe=(n,t)=>{qt("caret",n,t);let o=t.loose?hi[Ma.CARETLOOSE]:hi[Ma.CARET],i=t.includePrerelease?"-0":"";return n.replace(o,(e,a,A,r,s)=>{qt("caret",n,e,a,A,r,s);let g;return Jr(a)?g="":Jr(A)?g=`>=${a}.0.0${i} <${+a+1}.0.0-0`:Jr(r)?a==="0"?g=`>=${a}.${A}.0${i} <${a}.${+A+1}.0-0`:g=`>=${a}.${A}.0${i} <${+a+1}.0.0-0`:s?(qt("replaceCaret pr",s),a==="0"?A==="0"?g=`>=${a}.${A}.${r}-${s} <${a}.${A}.${+r+1}-0`:g=`>=${a}.${A}.${r}-${s} <${a}.${+A+1}.0-0`:g=`>=${a}.${A}.${r}-${s} <${+a+1}.0.0-0`):(qt("no pr"),a==="0"?A==="0"?g=`>=${a}.${A}.${r} <${a}.${A}.${+r+1}-0`:g=`>=${a}.${A}.${r} <${a}.${+A+1}.0-0`:g=`>=${a}.${A}.${r} <${+a+1}.0.0-0`),qt("caret return",g),g})},Txe=(n,t)=>(qt("replaceXRanges",n,t),n.split(/\s+/).map(o=>Nxe(o,t)).join(" ")),Nxe=(n,t)=>{n=n.trim();let o=t.loose?hi[Ma.XRANGELOOSE]:hi[Ma.XRANGE];return n.replace(o,(i,e,a,A,r,s)=>{if(qt("xRange",n,i,e,a,A,r,s),Dxe(a,A,r))return n;let g=Jr(a),c=g||Jr(A),I=c||Jr(r),d=I;return e==="="&&d&&(e=""),s=t.includePrerelease?"-0":"",g?e===">"||e==="<"?i="<0.0.0-0":i="*":e&&d?(c&&(A=0),r=0,e===">"?(e=">=",c?(a=+a+1,A=0,r=0):(A=+A+1,r=0)):e==="<="&&(e="<",c?a=+a+1:A=+A+1),e==="<"&&(s="-0"),i=`${e+a}.${A}.${r}${s}`):c?i=`>=${a}.0.0${s} <${+a+1}.0.0-0`:I&&(i=`>=${a}.${A}.0${s} <${a}.${+A+1}.0-0`),qt("xRange return",i),i})},Rxe=(n,t)=>(qt("replaceStars",n,t),n.trim().replace(hi[Ma.STAR],"")),kxe=(n,t)=>(qt("replaceGTE0",n,t),n.trim().replace(hi[t.includePrerelease?Ma.GTE0PRE:Ma.GTE0],"")),vxe=n=>(t,o,i,e,a,A,r,s,g,c,I,d)=>(Jr(i)?o="":Jr(e)?o=`>=${i}.0.0${n?"-0":""}`:Jr(a)?o=`>=${i}.${e}.0${n?"-0":""}`:A?o=`>=${o}`:o=`>=${o}${n?"-0":""}`,Jr(g)?s="":Jr(c)?s=`<${+g+1}.0.0-0`:Jr(I)?s=`<${g}.${+c+1}.0-0`:d?s=`<=${g}.${c}.${I}-${d}`:n?s=`<${g}.${c}.${+I+1}-0`:s=`<=${s}`,`${o} ${s}`.trim()),Pxe=(n,t,o)=>{for(let i=0;i0){let e=n[i].semver;if(e.major===t.major&&e.minor===t.minor&&e.patch===t.patch)return!0}return!1}return!0}});var GB=$((FyA,Pee)=>{"use strict";var FB=Symbol("SemVer ANY"),pL=class n{static get ANY(){return FB}constructor(t,o){if(o=Tee(o),t instanceof n){if(t.loose===!!o.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),lL("comparator",t,o),this.options=o,this.loose=!!o.loose,this.parse(t),this.semver===FB?this.value="":this.value=this.operator+this.semver.version,lL("comp",this)}parse(t){let o=this.options.loose?Nee[Ree.COMPARATORLOOSE]:Nee[Ree.COMPARATOR],i=t.match(o);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new kee(i[2],this.options.loose):this.semver=FB}toString(){return this.value}test(t){if(lL("Comparator.test",t,this.options.loose),this.semver===FB||t===FB)return!0;if(typeof t=="string")try{t=new kee(t,this.options)}catch{return!1}return IL(t,this.operator,this.semver,this.options)}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new vee(t.value,o).test(this.value):t.operator===""?t.value===""?!0:new vee(this.value,o).test(t.semver):(o=Tee(o),o.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||IL(this.semver,"<",t.semver,o)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||IL(this.semver,">",t.semver,o)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Pee.exports=pL;var Tee=SD(),{safeRe:Nee,t:Ree}=wh(),IL=nL(),lL=vB(),kee=ba(),vee=Zo()});var LB=$((LyA,Gee)=>{"use strict";var Gxe=Zo(),Fxe=(n,t,o)=>{try{t=new Gxe(t,o)}catch{return!1}return t.test(n)};Gee.exports=Fxe});var Lee=$((UyA,Fee)=>{"use strict";var Lxe=Zo(),Uxe=(n,t)=>new Lxe(n,t).set.map(o=>o.map(i=>i.value).join(" ").trim().split(" "));Fee.exports=Uxe});var Hee=$((HyA,Uee)=>{"use strict";var Hxe=ba(),Kxe=Zo(),xxe=(n,t,o)=>{let i=null,e=null,a=null;try{a=new Kxe(t,o)}catch{return null}return n.forEach(A=>{a.test(A)&&(!i||e.compare(A)===-1)&&(i=A,e=new Hxe(i,o))}),i};Uee.exports=xxe});var xee=$((KyA,Kee)=>{"use strict";var Yxe=ba(),jxe=Zo(),Jxe=(n,t,o)=>{let i=null,e=null,a=null;try{a=new jxe(t,o)}catch{return null}return n.forEach(A=>{a.test(A)&&(!i||e.compare(A)===1)&&(i=A,e=new Yxe(i,o))}),i};Kee.exports=Jxe});var Jee=$((xyA,jee)=>{"use strict";var dL=ba(),qxe=Zo(),Yee=PB(),zxe=(n,t)=>{n=new qxe(n,t);let o=new dL("0.0.0");if(n.test(o)||(o=new dL("0.0.0-0"),n.test(o)))return o;o=null;for(let i=0;i{let r=new dL(A.semver.version);switch(A.operator){case">":r.prerelease.length===0?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":(!a||Yee(r,a))&&(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${A.operator}`)}}),a&&(!o||Yee(o,a))&&(o=a)}return o&&n.test(o)?o:null};jee.exports=zxe});var zee=$((YyA,qee)=>{"use strict";var Vxe=Zo(),Wxe=(n,t)=>{try{return new Vxe(n,t).range||"*"}catch{return null}};qee.exports=Wxe});var vD=$((jyA,Xee)=>{"use strict";var Zxe=ba(),Zee=GB(),{ANY:Xxe}=Zee,$xe=Zo(),eYe=LB(),Vee=PB(),Wee=_D(),AYe=ND(),tYe=TD(),rYe=(n,t,o,i)=>{n=new Zxe(n,i),t=new $xe(t,i);let e,a,A,r,s;switch(o){case">":e=Vee,a=AYe,A=Wee,r=">",s=">=";break;case"<":e=Wee,a=tYe,A=Vee,r="<",s="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(eYe(n,t,i))return!1;for(let g=0;g{B.semver===Xxe&&(B=new Zee(">=0.0.0")),I=I||B,d=d||B,e(B.semver,I.semver,i)?I=B:A(B.semver,d.semver,i)&&(d=B)}),I.operator===r||I.operator===s||(!d.operator||d.operator===r)&&a(n,d.semver))return!1;if(d.operator===s&&A(n,d.semver))return!1}return!0};Xee.exports=rYe});var eAe=$((JyA,$ee)=>{"use strict";var aYe=vD(),iYe=(n,t,o)=>aYe(n,t,">",o);$ee.exports=iYe});var tAe=$((qyA,AAe)=>{"use strict";var oYe=vD(),nYe=(n,t,o)=>oYe(n,t,"<",o);AAe.exports=nYe});var iAe=$((zyA,aAe)=>{"use strict";var rAe=Zo(),sYe=(n,t,o)=>(n=new rAe(n,o),t=new rAe(t,o),n.intersects(t,o));aAe.exports=sYe});var nAe=$((VyA,oAe)=>{"use strict";var gYe=LB(),cYe=Wo();oAe.exports=(n,t,o)=>{let i=[],e=null,a=null,A=n.sort((c,I)=>cYe(c,I,o));for(let c of A)gYe(c,t,o)?(a=c,e||(e=c)):(a&&i.push([e,a]),a=null,e=null);e&&i.push([e,null]);let r=[];for(let[c,I]of i)c===I?r.push(c):!I&&c===A[0]?r.push("*"):I?c===A[0]?r.push(`<=${I}`):r.push(`${c} - ${I}`):r.push(`>=${c}`);let s=r.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return s.length{"use strict";var sAe=Zo(),CL=GB(),{ANY:hL}=CL,EL=LB(),uL=Wo(),IYe=(n,t,o={})=>{if(n===t)return!0;n=new sAe(n,o),t=new sAe(t,o);let i=!1;e:for(let e of n.set){for(let a of t.set){let A=pYe(e,a,o);if(i=i||A!==null,A)continue e}if(i)return!1}return!0},lYe=[new CL(">=0.0.0-0")],gAe=[new CL(">=0.0.0")],pYe=(n,t,o)=>{if(n===t)return!0;if(n.length===1&&n[0].semver===hL){if(t.length===1&&t[0].semver===hL)return!0;o.includePrerelease?n=lYe:n=gAe}if(t.length===1&&t[0].semver===hL){if(o.includePrerelease)return!0;t=gAe}let i=new Set,e,a;for(let B of n)B.operator===">"||B.operator===">="?e=cAe(e,B,o):B.operator==="<"||B.operator==="<="?a=IAe(a,B,o):i.add(B.semver);if(i.size>1)return null;let A;if(e&&a){if(A=uL(e.semver,a.semver,o),A>0)return null;if(A===0&&(e.operator!==">="||a.operator!=="<="))return null}for(let B of i){if(e&&!EL(B,String(e),o)||a&&!EL(B,String(a),o))return null;for(let f of t)if(!EL(B,String(f),o))return!1;return!0}let r,s,g,c,I=a&&!o.includePrerelease&&a.semver.prerelease.length?a.semver:!1,d=e&&!o.includePrerelease&&e.semver.prerelease.length?e.semver:!1;I&&I.prerelease.length===1&&a.operator==="<"&&I.prerelease[0]===0&&(I=!1);for(let B of t){if(c=c||B.operator===">"||B.operator===">=",g=g||B.operator==="<"||B.operator==="<=",e){if(d&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===d.major&&B.semver.minor===d.minor&&B.semver.patch===d.patch&&(d=!1),B.operator===">"||B.operator===">="){if(r=cAe(e,B,o),r===B&&r!==e)return!1}else if(e.operator===">="&&!B.test(e.semver))return!1}if(a){if(I&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===I.major&&B.semver.minor===I.minor&&B.semver.patch===I.patch&&(I=!1),B.operator==="<"||B.operator==="<="){if(s=IAe(a,B,o),s===B&&s!==a)return!1}else if(a.operator==="<="&&!B.test(a.semver))return!1}if(!B.operator&&(a||e)&&A!==0)return!1}return!(e&&g&&!a&&A!==0||a&&c&&!e&&A!==0||d||I)},cAe=(n,t,o)=>{if(!n)return t;let i=uL(n.semver,t.semver,o);return i>0?n:i<0||t.operator===">"&&n.operator===">="?t:n},IAe=(n,t,o)=>{if(!n)return t;let i=uL(n.semver,t.semver,o);return i<0?n:i>0||t.operator==="<"&&n.operator==="<="?t:n};lAe.exports=IYe});var PD=$((ZyA,EAe)=>{"use strict";var BL=wh(),dAe=Sh(),dYe=ba(),hAe=tL(),hYe=tI(),EYe=L$(),CYe=H$(),uYe=Y$(),BYe=q$(),fYe=V$(),QYe=Z$(),yYe=$$(),mYe=Aee(),SYe=Wo(),wYe=iee(),DYe=nee(),OYe=MD(),bYe=Iee(),MYe=pee(),_Ye=PB(),TYe=_D(),NYe=iL(),RYe=oL(),kYe=TD(),vYe=ND(),PYe=nL(),GYe=yee(),FYe=See(),LYe=GB(),UYe=Zo(),HYe=LB(),KYe=Lee(),xYe=Hee(),YYe=xee(),jYe=Jee(),JYe=zee(),qYe=vD(),zYe=eAe(),VYe=tAe(),WYe=iAe(),ZYe=nAe(),XYe=pAe();EAe.exports={parse:hYe,valid:EYe,clean:CYe,inc:uYe,diff:BYe,major:fYe,minor:QYe,patch:yYe,prerelease:mYe,compare:SYe,rcompare:wYe,compareLoose:DYe,compareBuild:OYe,sort:bYe,rsort:MYe,gt:_Ye,lt:TYe,eq:NYe,neq:RYe,gte:kYe,lte:vYe,cmp:PYe,coerce:GYe,truncate:FYe,Comparator:LYe,Range:UYe,satisfies:HYe,toComparators:KYe,maxSatisfying:xYe,minSatisfying:YYe,minVersion:jYe,validRange:JYe,outside:qYe,gtr:zYe,ltr:VYe,intersects:WYe,simplifyRange:ZYe,subset:XYe,SemVer:dYe,re:BL.re,src:BL.src,tokens:BL.t,SEMVER_SPEC_VERSION:dAe.SEMVER_SPEC_VERSION,RELEASE_TYPES:dAe.RELEASE_TYPES,compareIdentifiers:hAe.compareIdentifiers,rcompareIdentifiers:hAe.rcompareIdentifiers}});var Yg,GD=Ce(()=>{Yg={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.3",author:"Lovell Fuller ",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert ","Jonathan Ong ","Chanon Sajjamanochai ","Juliano Julio ","Daniel Gasienica ","Julian Walker ","Amit Pitaru ","Brandon Aaron ","Andreas Lind ","Maurus Cuelenaere ","Linus Unneb\xE4ck ","Victor Mateevitsi ","Alaric Holloway ","Bernhard K. Weisshuhn ","Chris Riley ","David Carley ","John Tobin ","Kenton Gray ","Felix B\xFCnemann ","Samy Al Zahrani ","Chintan Thakkar ","F. Orlando Galashan ","Kleis Auke Wolthuizen ","Matt Hirsch ","Matthias Thoemmes ","Patrick Paskaris ","J\xE9r\xE9my Lal ","Rahul Nanwani ","Alice Monday ","Kristo Jorgenson ","YvesBos ","Guy Maliar ","Nicolas Coden ","Matt Parrish ","Marcel Bretschneider ","Matthew McEachen ","Jarda Kot\u011B\u0161ovec ","Kenric D'Souza ","Oleh Aleinyk ","Marcel Bretschneider ","Andrea Bianco ","Rik Heywood ","Thomas Parisot ","Nathan Graves ","Tom Lokhorst ","Espen Hovlandsdal ","Sylvain Dumont ","Alun Davies ","Aidan Hoolachan ","Axel Eirola ","Freezy ","Daiz ","Julian Aubourg ","Keith Belovay ","Michael B. Klein ","Jordan Prudhomme ","Ilya Ovdin ","Andargor ","Paul Neave ","Brendan Kennedy ","Brychan Bennett-Odlum ","Edward Silverton ","Roman Malieiev ","Tomas Szabo ","Robert O'Rourke ","Guillermo Alfonso Varela Chouci\xF1o ","Christian Flintrup ","Manan Jadhav ","Leon Radley ","alza54 ","Jacob Smith ","Michael Nutt ","Brad Parham ","Taneli Vatanen ","Joris Dugu\xE9 ","Chris Banks ","Ompal Singh ","Brodan ","Ankur Parihar ","Brahim Ait elhaj ","Mart Jansink ","Lachlan Newman ","Dennis Beatty ","Ingvar Stepanyan ","Don Denton ","Dmytro Tiapukhin ","Florian Lefebvre "],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as UB}from"node:child_process";import{createHash as e1e}from"node:crypto";var HB,QL,A1e,uAe,t1e,yL,r1e,BAe,a1e,Dh,i1e,o1e,n1e,s1e,fAe,g1e,CAe,c1e,I1e,QAe,l1e,p1e,yAe,fL,d1e,FD,mL=Ce(()=>{HB=qe(PD(),1),QL=qe(mD(),1);GD();A1e=process.env.npm_package_config_libvips||Yg.config.libvips,uAe=HB.default.coerce(A1e).version,t1e=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],yL={encoding:"utf8",shell:!0},r1e=n=>{n instanceof Error?console.error(`sharp: Installation error: ${n.message}`):console.log(`sharp: ${n}`)},BAe=()=>QL.default.isNonGlibcLinuxSync()?QL.default.familySync():"",a1e=()=>`${process.platform}${BAe()}-${process.arch}`,Dh=()=>{if(fAe())return"wasm32";let{npm_config_arch:n,npm_config_platform:t,npm_config_libc:o}=process.env,i=typeof o=="string"?o:BAe();return`${t||process.platform}${i}-${n||process.arch}`},i1e=()=>{try{return $e(`@img/sharp-libvips-dev-${Dh()}/include`)}catch{try{return $e("@img/sharp-libvips-dev/include")}catch{}}return""},o1e=()=>{try{return $e("@img/sharp-libvips-dev/cplusplus")}catch{}return""},n1e=()=>{try{return $e(`@img/sharp-libvips-dev-${Dh()}/lib`)}catch{try{return $e(`@img/sharp-libvips-${Dh()}/lib`)}catch{}}return""},s1e=()=>{if(process.release?.name==="node"&&process.versions&&!HB.default.satisfies(process.versions.node,Yg.engines.node))return{found:process.versions.node,expected:Yg.engines.node}},fAe=()=>{let{CC:n}=process.env;return!!n?.endsWith("/emcc")},g1e=()=>process.platform==="darwin"&&process.arch==="x64"?(UB("sysctl sysctl.proc_translated",yL).stdout||"").trim()==="sysctl.proc_translated: 1":!1,CAe=n=>e1e("sha512").update(n).digest("hex"),c1e=()=>{try{let n=CAe(`imgsharp-libvips-${Dh()}`),t=HB.default.coerce(Yg.optionalDependencies[`@img/sharp-libvips-${Dh()}`],{includePrerelease:!0}).version;return CAe(`${n}npm:${t}`).slice(0,10)}catch{}return""},I1e=()=>UB(`node-gyp rebuild --directory=src ${fAe()?"--nodedir=emscripten":""}`,{...yL,stdio:"inherit"}).status,QAe=()=>process.platform!=="win32"?(UB("pkg-config --modversion vips-cpp",{...yL,env:{...process.env,PKG_CONFIG_PATH:yAe()}}).stdout||"").trim():"",l1e=()=>{try{let n=(UB("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(n)return`${n}/lib/pkgconfig`}catch{}},p1e=()=>{try{let n=(UB("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(n)return n}catch{}},yAe=()=>process.platform!=="win32"?[l1e(),p1e(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",fL=(n,t,o)=>(o&&o(`Detected ${t}, skipping search for globally-installed libvips`),n),d1e=n=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return fL(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",n);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return fL(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",n);if(g1e())return fL(!1,"Rosetta",n);let t=QAe();return!!t&&HB.default.gte(t,uAe)},FD={minimumLibvipsVersion:uAe,prebuiltPlatforms:t1e,buildPlatformArch:Dh,buildSharpLibvipsIncludeDir:i1e,buildSharpLibvipsCPlusPlusDir:o1e,buildSharpLibvipsLibDir:n1e,isUnsupportedNodeRuntime:s1e,runtimePlatformArch:a1e,log:r1e,yarnLocator:c1e,spawnRebuild:I1e,globalLibvipsVersion:QAe,pkgConfigPath:yAe,useGlobalLibvips:d1e}});import{createRequire as h1e}from"node:module";var LD,qr,SAe,E1e,mAe,C1e,u1e,jg,Ut,rI,St,KB=Ce(()=>{LD=qe(mD(),1);mL();GD();qr=h1e(import.meta.url),{version:SAe}=Yg,{runtimePlatformArch:E1e,isUnsupportedNodeRuntime:mAe,prebuiltPlatforms:C1e,minimumLibvipsVersion:u1e}=FD,jg=E1e(),rI=[];try{Ut=qr(`../src/build/Release/sharp-${jg}-${SAe}.node`)}catch(n){rI.push(n)}if(!Ut)try{Ut=qr(`../src/build/Release/sharp-wasm32-${SAe}.node`)}catch(n){rI.push(n)}if(!Ut)try{switch(jg){case"darwin-arm64":Ut=qr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":Ut=qr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":Ut=qr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":Ut=qr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":Ut=qr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":Ut=qr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":Ut=qr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":Ut=qr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":Ut=qr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":Ut=qr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":Ut=qr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":Ut=qr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":Ut=qr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":Ut=qr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":Ut=qr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(Ut&&["linux-x64","linuxmusl-x64"].includes(jg)&&!Ut._isUsingX64V2()){let n=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");n.code="Unsupported CPU",rI.push(n),Ut=null}Ut&&process.versions.electron&&jg.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(n){rI.push(n)}if(!Ut)try{Ut=qr("@img/sharp-wasm32/sharp.node")}catch(n){rI.push(n)}if(!Ut){let[n,t,o]=["linux","darwin","win32"].map(a=>jg.startsWith(a)),i=[`Could not load the "sharp" module using the ${jg} runtime`];rI.forEach(a=>{a.code.endsWith("MODULE_NOT_FOUND")||i.push(`${a.code}: ${a.message}`)});let e=rI.map(a=>a.message).join(" ");if(i.push("Possible solutions:"),mAe()){let{found:a,expected:A}=mAe();i.push("- Please upgrade Node.js:",` Found ${a}`,` Requires ${A}`)}else if(C1e.includes(jg)){let[a,A]=jg.split("-"),r=a.endsWith("musl")?" --libc=musl":"";i.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${a.replace("musl","")}${r} --cpu=${A} sharp`)}else i.push(`- Manually install libvips >= ${u1e}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(n&&/(symbol not found|CXXABI_)/i.test(e))try{let{config:a}=qr(`@img/sharp-libvips-${jg}/package`),A=`${(0,LD.familySync)()} ${(0,LD.versionSync)()}`,r=`${a.musl?"musl":"glibc"} ${a.musl||a.glibc}`;i.push("- Update your OS:",` Found ${A}`,` Requires ${r}`)}catch{}throw n&&/\/snap\/core[0-9]{2}/.test(e)&&i.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(e)&&i.push("- Update Homebrew:"," brew update && brew upgrade vips"),rI.some(a=>a.code==="ERR_DLOPEN_DISABLED")&&i.push("- Run Node.js without using the --no-addons flag"),o&&/The specified procedure could not be found/.test(e)&&i.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),i.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(i.join(` +`))}St=Ut});import B1e from"node:util";import SL from"node:stream";function y1e(){let n=this.constructor.call(),{debuglog:t,queueListener:o,...i}=this.options;return n.options=structuredClone(i),n.options.debuglog=t,n.options.queueListener=o,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),n.options.input.buffer=this.options.input.buffer,n.emit("finish")}),n}var f1e,Q1e,Hl,Ps,wAe=Ce(()=>{Ts();KB();f1e=B1e.debuglog("sharp"),Q1e=n=>{Hl.queue.emit("change",n)},Hl=function(n,t){if(arguments.length===1&&!O.defined(n))throw new Error("Invalid input");return this instanceof Hl?(SL.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:o=>{this.emit("warning",o),f1e(o)},queueListener:Q1e},this.options.input=this._createInputDescriptor(n,t,{allowStream:!0}),this):new Hl(n,t)};Object.setPrototypeOf(Hl.prototype,SL.Duplex.prototype);Object.setPrototypeOf(Hl,SL.Duplex);Object.assign(Hl.prototype,{clone:y1e});Ps=Hl});function DAe(n){let t=S1e.filter(o=>O.defined(n[o])).map(o=>[o,n[o]]);return t.length?Object.fromEntries(t):void 0}function w1e(n,t,o){let i={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(O.string(n))i.file=n;else if(O.buffer(n)){if(n.length===0)throw Error("Input Buffer is empty");i.buffer=n}else if(O.arrayBuffer(n)){if(n.byteLength===0)throw Error("Input bit Array is empty");i.buffer=Buffer.from(n,0,n.byteLength)}else if(O.typedArray(n)){if(n.length===0)throw Error("Input Bit Array is empty");i.buffer=Buffer.from(n.buffer,n.byteOffset,n.byteLength)}else if(O.plainObject(n)&&!O.defined(t))t=n,DAe(t)&&(i.buffer=[]);else if(!O.defined(n)&&!O.defined(t)&&O.object(o)&&o.allowStream)i.buffer=[];else if(Array.isArray(n))if(n.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=n.map(e=>this._createInputDescriptor(e));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${n}' of type ${typeof n}${O.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(O.object(t)){if(O.defined(t.failOn))if(O.string(t.failOn)&&O.inArray(t.failOn,["none","truncated","error","warning"]))i.failOn=t.failOn;else throw O.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(O.defined(t.autoOrient))if(O.bool(t.autoOrient))i.autoOrient=t.autoOrient;else throw O.invalidParameterError("autoOrient","boolean",t.autoOrient);if(O.defined(t.density))if(O.number(t.density)&&O.inRange(t.density,1,1e5))i.density=t.density;else throw O.invalidParameterError("density","number between 1 and 100000",t.density);if(O.defined(t.ignoreIcc))if(O.bool(t.ignoreIcc))i.ignoreIcc=t.ignoreIcc;else throw O.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(O.defined(t.limitInputPixels))if(O.bool(t.limitInputPixels))i.limitInputPixels=t.limitInputPixels?16383**2:0;else if(O.integer(t.limitInputPixels)&&O.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))i.limitInputPixels=t.limitInputPixels;else throw O.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(O.defined(t.limitInputChannels))if(O.bool(t.limitInputChannels))i.limitInputChannels=t.limitInputChannels?5:0;else if(O.integer(t.limitInputChannels)&&O.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))i.limitInputChannels=t.limitInputChannels;else throw O.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(O.defined(t.unlimited))if(O.bool(t.unlimited))i.unlimited=t.unlimited;else throw O.invalidParameterError("unlimited","boolean",t.unlimited);if(O.defined(t.sequentialRead))if(O.bool(t.sequentialRead))i.sequentialRead=t.sequentialRead;else throw O.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(O.defined(t.raw)){if(O.object(t.raw)&&O.integer(t.raw.width)&&O.inRange(t.raw.width,1,1e8)&&O.integer(t.raw.height)&&O.inRange(t.raw.height,1,1e8)&&O.integer(t.raw.channels)&&O.inRange(t.raw.channels,1,4))switch(i.rawWidth=t.raw.width,i.rawHeight=t.raw.height,i.rawChannels=t.raw.channels,n.constructor){case Uint8Array:case Uint8ClampedArray:i.rawDepth="uchar";break;case Int8Array:i.rawDepth="char";break;case Uint16Array:i.rawDepth="ushort";break;case Int16Array:i.rawDepth="short";break;case Uint32Array:i.rawDepth="uint";break;case Int32Array:i.rawDepth="int";break;case Float32Array:i.rawDepth="float";break;case Float64Array:i.rawDepth="double";break;default:i.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(i.rawPremultiplied=!1,O.defined(t.raw.premultiplied))if(O.bool(t.raw.premultiplied))i.rawPremultiplied=t.raw.premultiplied;else throw O.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(i.rawPageHeight=0,O.defined(t.raw.pageHeight))if(O.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);i.rawPageHeight=t.raw.pageHeight}else throw O.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(O.defined(t.animated))if(O.bool(t.animated))i.pages=t.animated?-1:1;else throw O.invalidParameterError("animated","boolean",t.animated);if(O.defined(t.pages))if(O.integer(t.pages)&&O.inRange(t.pages,-1,1e5))i.pages=t.pages;else throw O.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(O.defined(t.page))if(O.integer(t.page)&&O.inRange(t.page,0,1e5))i.page=t.page;else throw O.invalidParameterError("page","integer between 0 and 100000",t.page);if(O.object(t.openSlide)&&O.defined(t.openSlide.level))if(O.integer(t.openSlide.level)&&O.inRange(t.openSlide.level,0,256))i.openSlideLevel=t.openSlide.level;else throw O.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(O.defined(t.level))if(O.integer(t.level)&&O.inRange(t.level,0,256))i.openSlideLevel=t.level;else throw O.invalidParameterError("level","integer between 0 and 256",t.level);if(O.object(t.tiff)&&O.defined(t.tiff.subifd))if(O.integer(t.tiff.subifd)&&O.inRange(t.tiff.subifd,-1,1e5))i.tiffSubifd=t.tiff.subifd;else throw O.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(O.defined(t.subifd))if(O.integer(t.subifd)&&O.inRange(t.subifd,-1,1e5))i.tiffSubifd=t.subifd;else throw O.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(O.object(t.svg)){if(O.defined(t.svg.stylesheet))if(O.string(t.svg.stylesheet))i.svgStylesheet=t.svg.stylesheet;else throw O.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(O.defined(t.svg.highBitdepth))if(O.bool(t.svg.highBitdepth))i.svgHighBitdepth=t.svg.highBitdepth;else throw O.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(O.object(t.pdf)&&O.defined(t.pdf.background)?i.pdfBackground=this._getBackgroundColourOption(t.pdf.background):O.defined(t.pdfBackground)&&(i.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),O.object(t.jp2)&&O.defined(t.jp2.oneshot))if(O.bool(t.jp2.oneshot))i.jp2Oneshot=t.jp2.oneshot;else throw O.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(O.defined(t.create))if(O.object(t.create)&&O.integer(t.create.width)&&O.inRange(t.create.width,1,1e8)&&O.integer(t.create.height)&&O.inRange(t.create.height,1,1e8)&&O.integer(t.create.channels)){if(i.createWidth=t.create.width,i.createHeight=t.create.height,i.createChannels=t.create.channels,i.createPageHeight=0,O.defined(t.create.pageHeight))if(O.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);i.createPageHeight=t.create.pageHeight}else throw O.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(O.defined(t.create.noise)){if(!O.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(i.createNoiseType=t.create.noise.type,!O.inRange(t.create.channels,1,4))throw O.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(i.createNoiseMean=128,O.defined(t.create.noise.mean))if(O.number(t.create.noise.mean)&&O.inRange(t.create.noise.mean,0,1e4))i.createNoiseMean=t.create.noise.mean;else throw O.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(i.createNoiseSigma=30,O.defined(t.create.noise.sigma))if(O.number(t.create.noise.sigma)&&O.inRange(t.create.noise.sigma,0,1e4))i.createNoiseSigma=t.create.noise.sigma;else throw O.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(O.defined(t.create.background)){if(!O.inRange(t.create.channels,3,4))throw O.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);i.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete i.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(O.defined(t.text))if(O.object(t.text)&&O.string(t.text.text)){if(i.textValue=t.text.text,O.defined(t.text.height)&&O.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(O.defined(t.text.font))if(O.string(t.text.font))i.textFont=t.text.font;else throw O.invalidParameterError("text.font","string",t.text.font);if(O.defined(t.text.fontfile))if(O.string(t.text.fontfile))i.textFontfile=t.text.fontfile;else throw O.invalidParameterError("text.fontfile","string",t.text.fontfile);if(O.defined(t.text.width))if(O.integer(t.text.width)&&O.inRange(t.text.width,1,1e6))i.textWidth=t.text.width;else throw O.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(O.defined(t.text.height))if(O.integer(t.text.height)&&O.inRange(t.text.height,1,1e6))i.textHeight=t.text.height;else throw O.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(O.defined(t.text.align))if(O.string(t.text.align)&&O.string(this.constructor.align[t.text.align]))i.textAlign=this.constructor.align[t.text.align];else throw O.invalidParameterError("text.align","valid alignment",t.text.align);if(O.defined(t.text.justify))if(O.bool(t.text.justify))i.textJustify=t.text.justify;else throw O.invalidParameterError("text.justify","boolean",t.text.justify);if(O.defined(t.text.dpi))if(O.integer(t.text.dpi)&&O.inRange(t.text.dpi,1,1e6))i.textDpi=t.text.dpi;else throw O.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(O.defined(t.text.rgba))if(O.bool(t.text.rgba))i.textRgba=t.text.rgba;else throw O.invalidParameterError("text.rgba","bool",t.text.rgba);if(O.defined(t.text.spacing))if(O.integer(t.text.spacing)&&O.inRange(t.text.spacing,-1e6,1e6))i.textSpacing=t.text.spacing;else throw O.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(O.defined(t.text.wrap))if(O.string(t.text.wrap)&&O.inArray(t.text.wrap,["word","char","word-char","none"]))i.textWrap=t.text.wrap;else throw O.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete i.buffer}else throw new Error("Expected a valid string to create an image with text.");if(O.defined(t.join))if(O.defined(this.options.join)){if(O.defined(t.join.animated))if(O.bool(t.join.animated))i.joinAnimated=t.join.animated;else throw O.invalidParameterError("join.animated","boolean",t.join.animated);if(O.defined(t.join.across))if(O.integer(t.join.across)&&O.inRange(t.join.across,1,1e6))i.joinAcross=t.join.across;else throw O.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(O.defined(t.join.shim))if(O.integer(t.join.shim)&&O.inRange(t.join.shim,0,1e6))i.joinShim=t.join.shim;else throw O.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(O.defined(t.join.background)&&(i.joinBackground=this._getBackgroundColourOption(t.join.background)),O.defined(t.join.halign))if(O.string(t.join.halign)&&O.string(this.constructor.align[t.join.halign]))i.joinHalign=this.constructor.align[t.join.halign];else throw O.invalidParameterError("join.halign","valid alignment",t.join.halign);if(O.defined(t.join.valign))if(O.string(t.join.valign)&&O.string(this.constructor.align[t.join.valign]))i.joinValign=this.constructor.align[t.join.valign];else throw O.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(O.defined(t))throw new Error(`Invalid input options ${t}`);return i}function D1e(n,t,o){Array.isArray(this.options.input.buffer)?O.buffer(n)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(n),o()):o(new Error("Non-Buffer data on Writable Stream")):o(new Error("Unexpected data on Writable Stream"))}function O1e(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function b1e(){return Array.isArray(this.options.input.buffer)}function M1e(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.metadata(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)})}):St.metadata(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)}),this):this._isStreamInput()?new Promise((o,i)=>{let e=()=>{this._flattenBufferIn(),St.metadata(this.options,(a,A)=>{a?i(O.nativeError(a,t)):o(A)})};this.writableFinished?e():this.once("finish",e)}):new Promise((o,i)=>{St.metadata(this.options,(e,a)=>{e?i(O.nativeError(e,t)):o(a)})})}function _1e(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.stats(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)})}):St.stats(this.options,(o,i)=>{o?n(O.nativeError(o,t)):n(null,i)}),this):this._isStreamInput()?new Promise((o,i)=>{this.on("finish",function(){this._flattenBufferIn(),St.stats(this.options,(e,a)=>{e?i(O.nativeError(e,t)):o(a)})})}):new Promise((o,i)=>{St.stats(this.options,(e,a)=>{e?i(O.nativeError(e,t)):o(a)})})}var m1e,S1e,OAe,bAe=Ce(()=>{Ts();KB();m1e={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},S1e=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];OAe=n=>{Object.assign(n.prototype,{_inputOptionsFromObject:DAe,_createInputDescriptor:w1e,_write:D1e,_flattenBufferIn:O1e,_isStreamInput:b1e,metadata:M1e,stats:_1e}),n.align=m1e}});function DL(n){return n.angle%360!==0||n.rotationAngle!==0}function UD(n){return n.width!==-1||n.height!==-1}function R1e(n,t,o){if(UD(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),O.defined(n))if(O.object(n)&&!O.defined(o))o=n;else if(O.integer(n)&&n>0)this.options.width=n;else throw O.invalidParameterError("width","positive integer",n);else this.options.width=-1;if(O.defined(t))if(O.integer(t)&&t>0)this.options.height=t;else throw O.invalidParameterError("height","positive integer",t);else this.options.height=-1;if(O.object(o)){if(O.defined(o.width))if(O.integer(o.width)&&o.width>0)this.options.width=o.width;else throw O.invalidParameterError("width","positive integer",o.width);if(O.defined(o.height))if(O.integer(o.height)&&o.height>0)this.options.height=o.height;else throw O.invalidParameterError("height","positive integer",o.height);if(O.defined(o.fit)){let i=N1e[o.fit];if(O.string(i))this.options.canvas=i;else throw O.invalidParameterError("fit","valid fit",o.fit)}if(O.defined(o.position)){let i=O.integer(o.position)?o.position:NAe[o.position]||TAe[o.position]||_Ae[o.position];if(O.integer(i)&&(O.inRange(i,0,8)||O.inRange(i,16,17)))this.options.position=i;else throw O.invalidParameterError("position","valid position/gravity/strategy",o.position)}if(this._setBackgroundColourOption("resizeBackground",o.background),O.defined(o.kernel))if(O.string(wL[o.kernel]))this.options.kernel=wL[o.kernel];else throw O.invalidParameterError("kernel","valid kernel name",o.kernel);O.defined(o.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",o.withoutEnlargement),O.defined(o.withoutReduction)&&this._setBooleanOption("withoutReduction",o.withoutReduction),O.defined(o.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",o.fastShrinkOnLoad)}return DL(this.options)&&UD(this.options)&&(this.options.rotateBefore=!0),this}function k1e(n){if(O.integer(n))if(O.inRange(n,1,1e4))this.options.extendTop=n,this.options.extendBottom=n,this.options.extendLeft=n,this.options.extendRight=n;else throw O.invalidParameterError("extend","integer between 1 and 10000",n);else if(O.object(n)){if(O.defined(n.top))if(O.integer(n.top)&&O.inRange(n.top,0,1e4))this.options.extendTop=n.top;else throw O.invalidParameterError("top","integer between 0 and 10000",n.top);if(O.defined(n.bottom))if(O.integer(n.bottom)&&O.inRange(n.bottom,0,1e4))this.options.extendBottom=n.bottom;else throw O.invalidParameterError("bottom","integer between 0 and 10000",n.bottom);if(O.defined(n.left))if(O.integer(n.left)&&O.inRange(n.left,0,1e4))this.options.extendLeft=n.left;else throw O.invalidParameterError("left","integer between 0 and 10000",n.left);if(O.defined(n.right))if(O.integer(n.right)&&O.inRange(n.right,0,1e4))this.options.extendRight=n.right;else throw O.invalidParameterError("right","integer between 0 and 10000",n.right);if(this._setBackgroundColourOption("extendBackground",n.background),O.defined(n.extendWith))if(O.string(MAe[n.extendWith]))this.options.extendWith=MAe[n.extendWith];else throw O.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",n.extendWith)}else throw O.invalidParameterError("extend","integer or object",n);return this}function v1e(n){let t=UD(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(o){let i=n[o];if(O.integer(i)&&O.inRange(i,0,1e8))this.options[o+(o==="left"||o==="top"?"Offset":"")+t]=i;else throw O.invalidParameterError(o,"integer between 0 and 100000000",i)},this),DL(this.options)&&!UD(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function P1e(n){if(this.options.trimThreshold=10,O.defined(n))if(O.object(n)){if(O.defined(n.background)&&this._setBackgroundColourOption("trimBackground",n.background),O.defined(n.threshold))if(O.number(n.threshold)&&n.threshold>=0)this.options.trimThreshold=n.threshold;else throw O.invalidParameterError("threshold","positive number",n.threshold);if(O.defined(n.lineArt)&&this._setBooleanOption("trimLineArt",n.lineArt),O.defined(n.margin))if(O.integer(n.margin)&&O.inRange(n.margin,0,1e7))this.options.trimMargin=n.margin;else throw O.invalidParameterError("margin","integer between 0 and 10000000",n.margin)}else throw O.invalidParameterError("trim","object",n);return DL(this.options)&&(this.options.rotateBefore=!0),this}var _Ae,TAe,MAe,NAe,wL,T1e,N1e,RAe,kAe=Ce(()=>{Ts();_Ae={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},TAe={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},MAe={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},NAe={entropy:16,attention:17},wL={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},T1e={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},N1e={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};RAe=n=>{Object.assign(n.prototype,{resize:R1e,extend:k1e,extract:v1e,trim:P1e}),n.gravity=_Ae,n.strategy=NAe,n.kernel=wL,n.fit=T1e,n.position=TAe}});function G1e(n){if(!Array.isArray(n))throw O.invalidParameterError("images to composite","array",n);return this.options.composite=n.map(t=>{if(!O.object(t))throw O.invalidParameterError("image to composite","object",t);let o=this._inputOptionsFromObject(t),i={input:this._createInputDescriptor(t.input,o,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(O.defined(t.blend))if(O.string(OL[t.blend]))i.blend=OL[t.blend];else throw O.invalidParameterError("blend","valid blend name",t.blend);if(O.defined(t.tile))if(O.bool(t.tile))i.tile=t.tile;else throw O.invalidParameterError("tile","boolean",t.tile);if(O.defined(t.left))if(O.integer(t.left))i.left=t.left;else throw O.invalidParameterError("left","integer",t.left);if(O.defined(t.top))if(O.integer(t.top))i.top=t.top;else throw O.invalidParameterError("top","integer",t.top);if(O.defined(t.top)!==O.defined(t.left))throw new Error("Expected both left and top to be set");if(i.hasOffset=O.integer(t.top)&&O.integer(t.left),O.defined(t.gravity))if(O.integer(t.gravity)&&O.inRange(t.gravity,0,8))i.gravity=t.gravity;else if(O.string(t.gravity)&&O.integer(this.constructor.gravity[t.gravity]))i.gravity=this.constructor.gravity[t.gravity];else throw O.invalidParameterError("gravity","valid gravity",t.gravity);if(O.defined(t.premultiplied))if(O.bool(t.premultiplied))i.premultiplied=t.premultiplied;else throw O.invalidParameterError("premultiplied","boolean",t.premultiplied);return i}),this}var OL,vAe,PAe=Ce(()=>{Ts();OL={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};vAe=n=>{n.prototype.composite=G1e,n.blend=OL}});function F1e(n,t){if(!O.defined(n))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),O.integer(n)&&!(n%90))this.options.angle=n;else if(O.number(n))this.options.rotationAngle=n,O.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw O.invalidParameterError("angle","numeric",n);return this}function L1e(){return this.options.input.autoOrient=!0,this}function U1e(n){return this.options.flip=O.bool(n)?n:!0,this}function H1e(n){return this.options.flop=O.bool(n)?n:!0,this}function K1e(n,t){let i=Array.isArray(n)&&(n.length===4&&n.every(O.number)||n.length===2&&n.every(e=>Array.isArray(e)&&e.length===2))?n.flat():[];if(i.length===4&&i.every(O.number))this.options.affineMatrix=i;else throw O.invalidParameterError("matrix","1x4 or 2x2 array",n);if(O.defined(t))if(O.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),O.defined(t.idx))if(O.number(t.idx))this.options.affineIdx=t.idx;else throw O.invalidParameterError("options.idx","number",t.idx);if(O.defined(t.idy))if(O.number(t.idy))this.options.affineIdy=t.idy;else throw O.invalidParameterError("options.idy","number",t.idy);if(O.defined(t.odx))if(O.number(t.odx))this.options.affineOdx=t.odx;else throw O.invalidParameterError("options.odx","number",t.odx);if(O.defined(t.ody))if(O.number(t.ody))this.options.affineOdy=t.ody;else throw O.invalidParameterError("options.ody","number",t.ody);if(O.defined(t.interpolator))if(O.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw O.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw O.invalidParameterError("options","object",t);return this}function x1e(n){if(O.plainObject(n)){if(O.number(n.sigma)&&O.inRange(n.sigma,1e-6,10))this.options.sharpenSigma=n.sigma;else throw O.invalidParameterError("options.sigma","number between 0.000001 and 10",n.sigma);if(O.defined(n.m1))if(O.number(n.m1)&&O.inRange(n.m1,0,1e6))this.options.sharpenM1=n.m1;else throw O.invalidParameterError("options.m1","number between 0 and 1000000",n.m1);if(O.defined(n.m2))if(O.number(n.m2)&&O.inRange(n.m2,0,1e6))this.options.sharpenM2=n.m2;else throw O.invalidParameterError("options.m2","number between 0 and 1000000",n.m2);if(O.defined(n.x1))if(O.number(n.x1)&&O.inRange(n.x1,0,1e6))this.options.sharpenX1=n.x1;else throw O.invalidParameterError("options.x1","number between 0 and 1000000",n.x1);if(O.defined(n.y2))if(O.number(n.y2)&&O.inRange(n.y2,0,1e6))this.options.sharpenY2=n.y2;else throw O.invalidParameterError("options.y2","number between 0 and 1000000",n.y2);if(O.defined(n.y3))if(O.number(n.y3)&&O.inRange(n.y3,0,1e6))this.options.sharpenY3=n.y3;else throw O.invalidParameterError("options.y3","number between 0 and 1000000",n.y3)}else this.options.sharpenSigma=-1;return this}function Y1e(n){if(!O.defined(n))this.options.medianSize=3;else if(O.integer(n)&&O.inRange(n,1,1e3))this.options.medianSize=n;else throw O.invalidParameterError("size","integer between 1 and 1000",n);return this}function j1e(n){let t;if(O.number(n))t=n;else if(O.plainObject(n)){if(!O.number(n.sigma))throw O.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=n.sigma,"precision"in n)if(O.string(GAe[n.precision]))this.options.precision=GAe[n.precision];else throw O.invalidParameterError("precision","one of: integer, float, approximate",n.precision);if("minAmplitude"in n)if(O.number(n.minAmplitude)&&O.inRange(n.minAmplitude,.001,1))this.options.minAmpl=n.minAmplitude;else throw O.invalidParameterError("minAmplitude","number between 0.001 and 1",n.minAmplitude)}if(!O.defined(n))this.options.blurSigma=-1;else if(O.bool(n))this.options.blurSigma=n?-1:0;else if(O.number(t)&&O.inRange(t,.3,1e3))this.options.blurSigma=t;else throw O.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function J1e(n){if(!O.defined(n))this.options.dilateWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.dilateWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function q1e(n){if(!O.defined(n))this.options.erodeWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.erodeWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function z1e(n){return this.options.flatten=O.bool(n)?n:!0,O.object(n)&&this._setBackgroundColourOption("flattenBackground",n.background),this}function V1e(){return this.options.unflatten=!0,this}function W1e(n,t){if(!O.defined(n))this.options.gamma=2.2;else if(O.number(n)&&O.inRange(n,1,3))this.options.gamma=n;else throw O.invalidParameterError("gamma","number between 1.0 and 3.0",n);if(!O.defined(t))this.options.gammaOut=this.options.gamma;else if(O.number(t)&&O.inRange(t,1,3))this.options.gammaOut=t;else throw O.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function Z1e(n){if(this.options.negate=O.bool(n)?n:!0,O.plainObject(n)&&"alpha"in n)if(O.bool(n.alpha))this.options.negateAlpha=n.alpha;else throw O.invalidParameterError("alpha","should be boolean value",n.alpha);return this}function X1e(n){if(O.plainObject(n)){if(O.defined(n.lower))if(O.number(n.lower)&&O.inRange(n.lower,0,99))this.options.normaliseLower=n.lower;else throw O.invalidParameterError("lower","number between 0 and 99",n.lower);if(O.defined(n.upper))if(O.number(n.upper)&&O.inRange(n.upper,1,100))this.options.normaliseUpper=n.upper;else throw O.invalidParameterError("upper","number between 1 and 100",n.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw O.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function $1e(n){return this.normalise(n)}function e3e(n){if(O.plainObject(n)){if(O.integer(n.width)&&O.inRange(n.width,1,65536))this.options.claheWidth=n.width;else throw O.invalidParameterError("width","integer between 1 and 65536",n.width);if(O.integer(n.height)&&O.inRange(n.height,1,65536))this.options.claheHeight=n.height;else throw O.invalidParameterError("height","integer between 1 and 65536",n.height);if(O.defined(n.maxSlope))if(O.integer(n.maxSlope)&&O.inRange(n.maxSlope,0,100))this.options.claheMaxSlope=n.maxSlope;else throw O.invalidParameterError("maxSlope","integer between 0 and 100",n.maxSlope)}else throw O.invalidParameterError("options","plain object",n);return this}function A3e(n){if(!O.object(n)||!Array.isArray(n.kernel)||!O.integer(n.width)||!O.integer(n.height)||!O.inRange(n.width,3,1001)||!O.inRange(n.height,3,1001)||n.height*n.width!==n.kernel.length||!n.kernel.every(O.number))throw new Error("Invalid convolution kernel");return O.integer(n.scale)||(n.scale=n.kernel.reduce((t,o)=>t+o,0)),n.scale<1&&(n.scale=1),O.integer(n.offset)||(n.offset=0),this.options.convKernel=n,this}function t3e(n,t){if(!O.defined(n))this.options.threshold=128;else if(O.bool(n))this.options.threshold=n?128:0;else if(O.integer(n)&&O.inRange(n,0,255))this.options.threshold=n;else throw O.invalidParameterError("threshold","integer between 0 and 255",n);return!O.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function r3e(n,t,o){if(this.options.boolean=this._createInputDescriptor(n,o),O.string(t)&&O.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw O.invalidParameterError("operator","one of: and, or, eor",t);return this}function a3e(n,t){if(!O.defined(n)&&O.number(t)?n=1:O.number(n)&&!O.defined(t)&&(t=0),!O.defined(n))this.options.linearA=[];else if(O.number(n))this.options.linearA=[n];else if(Array.isArray(n)&&n.length&&n.every(O.number))this.options.linearA=n;else throw O.invalidParameterError("a","number or array of numbers",n);if(!O.defined(t))this.options.linearB=[];else if(O.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(O.number))this.options.linearB=t;else throw O.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function i3e(n){if(!Array.isArray(n))throw O.invalidParameterError("inputMatrix","array",n);let t=n.length;if(t!==3&&t!==4)throw O.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!n.every(i=>Array.isArray(i)&&i.length===t))throw O.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,n);let o=n.flat();if(!o.every(O.number))throw O.invalidParameterError("inputMatrix","array of numbers",o);return this.options.recombMatrix=o,this}function o3e(n){if(!O.plainObject(n))throw O.invalidParameterError("options","plain object",n);if("brightness"in n)if(O.number(n.brightness)&&n.brightness>=0)this.options.brightness=n.brightness;else throw O.invalidParameterError("brightness","number above zero",n.brightness);if("saturation"in n)if(O.number(n.saturation)&&n.saturation>=0)this.options.saturation=n.saturation;else throw O.invalidParameterError("saturation","number above zero",n.saturation);if("hue"in n)if(O.integer(n.hue))this.options.hue=n.hue%360;else throw O.invalidParameterError("hue","number",n.hue);if("lightness"in n)if(O.number(n.lightness))this.options.lightness=n.lightness;else throw O.invalidParameterError("lightness","number",n.lightness);return this}var GAe,FAe,LAe=Ce(()=>{Ts();GAe={integer:"integer",float:"float",approximate:"approximate"};FAe=n=>{Object.assign(n.prototype,{autoOrient:L1e,rotate:F1e,flip:U1e,flop:H1e,affine:K1e,sharpen:x1e,erode:q1e,dilate:J1e,median:Y1e,blur:j1e,flatten:z1e,unflatten:V1e,gamma:W1e,negate:Z1e,normalise:X1e,normalize:$1e,clahe:e3e,convolve:A3e,threshold:t3e,boolean:r3e,linear:a3e,recomb:i3e,modulate:o3e})}});var jAe=$((ymA,YAe)=>{var NL=Object.defineProperty,n3e=Object.getOwnPropertyDescriptor,s3e=Object.getOwnPropertyNames,g3e=Object.prototype.hasOwnProperty,c3e=(n,t)=>{for(var o in t)NL(n,o,{get:t[o],enumerable:!0})},I3e=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of s3e(t))!g3e.call(n,e)&&e!==o&&NL(n,e,{get:()=>t[e],enumerable:!(i=n3e(t,e))||i.enumerable});return n},l3e=n=>I3e(NL({},"__esModule",{value:!0}),n),UAe={};c3e(UAe,{default:()=>D3e});YAe.exports=l3e(UAe);var bL={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let n in bL)Object.freeze(bL[n]);var Gs=Object.freeze(bL),HAe=Object.create(null);for(let n in Gs)Object.hasOwn(Gs,n)&&(HAe[Gs[n]]=n);var qi={to:{},get:{}};qi.get=function(n){let t=n.slice(0,3).toLowerCase(),o,i;switch(t){case"hsl":{o=qi.get.hsl(n),i="hsl";break}case"hwb":{o=qi.get.hwb(n),i="hwb";break}default:{o=qi.get.rgb(n),i="rgb";break}}return o?{model:i,value:o}:null};qi.get.rgb=function(n){if(!n)return null;let t=/^#([a-f\d]{3,4})$/i,o=/^#([a-f\d]{6})([a-f\d]{2})?$/i,i=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,e=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,a=/^(\w+)$/,A=[0,0,0,1],r,s,g;if(r=n.match(o)){for(g=r[2],r=r[1],s=0;s<3;s++){let c=s*2;A[s]=Number.parseInt(r.slice(c,c+2),16)}g&&(A[3]=Number.parseInt(g,16)/255)}else if(r=n.match(t)){for(r=r[1],g=r[3],s=0;s<3;s++)A[s]=Number.parseInt(r[s]+r[s],16);g&&(A[3]=Number.parseInt(g+g,16)/255)}else if(r=n.match(i)){for(s=0;s<3;s++)A[s]=Number.parseFloat(r[s+1]);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else if(r=n.match(e)){for(s=0;s<3;s++)A[s]=Math.round(Number.parseFloat(r[s+1])*2.55);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else return(r=n.toLowerCase().match(a))?r[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Gs,r[1])?(A=Gs[r[1]].slice(),A[3]=1,A):null:null;for(s=0;s<3;s++)A[s]=aI(A[s],0,255);return A[3]=aI(A[3],0,1),A};qi.get.hsl=function(n){if(!n)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let i=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,a=aI(Number.parseFloat(o[2]),0,100),A=aI(Number.parseFloat(o[3]),0,100),r=aI(Number.isNaN(i)?1:i,0,1);return[e,a,A,r]}return null};qi.get.hwb=function(n){if(!n)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let i=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,a=aI(Number.parseFloat(o[2]),0,100),A=aI(Number.parseFloat(o[3]),0,100),r=aI(Number.isNaN(i)?1:i,0,1);return[e,a,A,r]}return null};qi.to.hex=function(...n){return"#"+HD(n[0])+HD(n[1])+HD(n[2])+(n[3]<1?HD(Math.round(n[3]*255)):"")};qi.to.rgb=function(...n){return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};qi.to.rgb.percent=function(...n){let t=Math.round(n[0]/255*100),o=Math.round(n[1]/255*100),i=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+t+"%, "+o+"%, "+i+"%)":"rgba("+t+"%, "+o+"%, "+i+"%, "+n[3]+")"};qi.to.hsl=function(...n){return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};qi.to.hwb=function(...n){let t="";return n.length>=4&&n[3]!==1&&(t=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+t+")"};qi.to.keyword=function(...n){return HAe[n.slice(0,3)]};function aI(n,t,o){return Math.min(Math.max(t,n),o)}function HD(n){let t=Math.round(n).toString(16).toUpperCase();return t.length<2?"0"+t:t}var Oh=qi,KAe={};for(let n of Object.keys(Gs))KAe[Gs[n]]=n;var sA={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Kl=sA,Jg=(6/29)**3;function Mh(n){let t=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,t),1)}function _h(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(let n of Object.keys(sA)){if(!("channels"in sA[n]))throw new Error("missing channels property: "+n);if(!("labels"in sA[n]))throw new Error("missing channel labels property: "+n);if(sA[n].labels.length!==sA[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:t,labels:o}=sA[n];delete sA[n].channels,delete sA[n].labels,Object.defineProperty(sA[n],"channels",{value:t}),Object.defineProperty(sA[n],"labels",{value:o})}sA.rgb.hsl=function(n){let t=n[0]/255,o=n[1]/255,i=n[2]/255,e=Math.min(t,o,i),a=Math.max(t,o,i),A=a-e,r,s;switch(a){case e:{r=0;break}case t:{r=(o-i)/A;break}case o:{r=2+(i-t)/A;break}case i:{r=4+(t-o)/A;break}}r=Math.min(r*60,360),r<0&&(r+=360);let g=(e+a)/2;return a===e?s=0:g<=.5?s=A/(a+e):s=A/(2-a-e),[r,s*100,g*100]};sA.rgb.hsv=function(n){let t,o,i,e,a,A=n[0]/255,r=n[1]/255,s=n[2]/255,g=Math.max(A,r,s),c=g-Math.min(A,r,s),I=function(d){return(g-d)/6/c+1/2};if(c===0)e=0,a=0;else{switch(a=c/g,t=I(A),o=I(r),i=I(s),g){case A:{e=i-o;break}case r:{e=1/3+t-i;break}case s:{e=2/3+o-t;break}}e<0?e+=1:e>1&&(e-=1)}return[e*360,a*100,g*100]};sA.rgb.hwb=function(n){let t=n[0],o=n[1],i=n[2],e=sA.rgb.hsl(n)[0],a=1/255*Math.min(t,Math.min(o,i));return i=1-1/255*Math.max(t,Math.max(o,i)),[e,a*100,i*100]};sA.rgb.oklab=function(n){let t=_h(n[0]/255),o=_h(n[1]/255),i=_h(n[2]/255),e=Math.cbrt(.4122214708*t+.5363325363*o+.0514459929*i),a=Math.cbrt(.2119034982*t+.6806995451*o+.1073969566*i),A=Math.cbrt(.0883024619*t+.2817188376*o+.6299787005*i),r=.2104542553*e+.793617785*a-.0040720468*A,s=1.9779984951*e-2.428592205*a+.4505937099*A,g=.0259040371*e+.7827717662*a-.808675766*A;return[r*100,s*100,g*100]};sA.rgb.cmyk=function(n){let t=n[0]/255,o=n[1]/255,i=n[2]/255,e=Math.min(1-t,1-o,1-i),a=(1-t-e)/(1-e)||0,A=(1-o-e)/(1-e)||0,r=(1-i-e)/(1-e)||0;return[a*100,A*100,r*100,e*100]};function p3e(n,t){return(n[0]-t[0])**2+(n[1]-t[1])**2+(n[2]-t[2])**2}sA.rgb.keyword=function(n){let t=KAe[n];if(t)return t;let o=Number.POSITIVE_INFINITY,i;for(let e of Object.keys(Gs)){let a=Gs[e],A=p3e(n,a);AJg?o**(1/3):7.787*o+16/116,i=i>Jg?i**(1/3):7.787*i+16/116,e=e>Jg?e**(1/3):7.787*e+16/116;let a=116*i-16,A=500*(o-i),r=200*(i-e);return[a,A,r]};sA.hsl.rgb=function(n){let t=n[0]/360,o=n[1]/100,i=n[2]/100,e,a;if(o===0)return a=i*255,[a,a,a];let A=i<.5?i*(1+o):i+o-i*o,r=2*i-A,s=[0,0,0];for(let g=0;g<3;g++)e=t+1/3*-(g-1),e<0&&e++,e>1&&e--,6*e<1?a=r+(A-r)*6*e:2*e<1?a=A:3*e<2?a=r+(A-r)*(2/3-e)*6:a=r,s[g]=a*255;return s};sA.hsl.hsv=function(n){let t=n[0],o=n[1]/100,i=n[2]/100,e=o,a=Math.max(i,.01);i*=2,o*=i<=1?i:2-i,e*=a<=1?a:2-a;let A=(i+o)/2,r=i===0?2*e/(a+e):2*o/(i+o);return[t,r*100,A*100]};sA.hsv.rgb=function(n){let t=n[0]/60,o=n[1]/100,i=n[2]/100,e=Math.floor(t)%6,a=t-Math.floor(t),A=255*i*(1-o),r=255*i*(1-o*a),s=255*i*(1-o*(1-a));switch(i*=255,e){case 0:return[i,s,A];case 1:return[r,i,A];case 2:return[A,i,s];case 3:return[A,r,i];case 4:return[s,A,i];case 5:return[i,A,r]}};sA.hsv.hsl=function(n){let t=n[0],o=n[1]/100,i=n[2]/100,e=Math.max(i,.01),a,A;A=(2-o)*i;let r=(2-o)*e;return a=o*e,a/=r<=1?r:2-r,a=a||0,A/=2,[t,a*100,A*100]};sA.hwb.rgb=function(n){let t=n[0]/360,o=n[1]/100,i=n[2]/100,e=o+i,a;e>1&&(o/=e,i/=e);let A=Math.floor(6*t),r=1-i;a=6*t-A,(A&1)!==0&&(a=1-a);let s=o+a*(r-o),g,c,I;switch(A){default:case 6:case 0:{g=r,c=s,I=o;break}case 1:{g=s,c=r,I=o;break}case 2:{g=o,c=r,I=s;break}case 3:{g=o,c=s,I=r;break}case 4:{g=s,c=o,I=r;break}case 5:{g=r,c=o,I=s;break}}return[g*255,c*255,I*255]};sA.cmyk.rgb=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=n[3]/100,a=1-Math.min(1,t*(1-e)+e),A=1-Math.min(1,o*(1-e)+e),r=1-Math.min(1,i*(1-e)+e);return[a*255,A*255,r*255]};sA.xyz.rgb=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e,a,A;return e=t*3.2404542+o*-1.5371385+i*-.4985314,a=t*-.969266+o*1.8760108+i*.041556,A=t*.0556434+o*-.2040259+i*1.0572252,e=Mh(e),a=Mh(a),A=Mh(A),[e*255,a*255,A*255]};sA.xyz.lab=function(n){let t=n[0],o=n[1],i=n[2];t/=95.047,o/=100,i/=108.883,t=t>Jg?t**(1/3):7.787*t+16/116,o=o>Jg?o**(1/3):7.787*o+16/116,i=i>Jg?i**(1/3):7.787*i+16/116;let e=116*o-16,a=500*(t-o),A=200*(o-i);return[e,a,A]};sA.xyz.oklab=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=Math.cbrt(.8189330101*t+.3618667424*o-.1288597137*i),a=Math.cbrt(.0329845436*t+.9293118715*o+.0361456387*i),A=Math.cbrt(.0482003018*t+.2643662691*o+.633851707*i),r=.2104542553*e+.793617785*a-.0040720468*A,s=1.9779984951*e-2.428592205*a+.4505937099*A,g=.0259040371*e+.7827717662*a-.808675766*A;return[r*100,s*100,g*100]};sA.oklab.oklch=function(n){return sA.lab.lch(n)};sA.oklab.xyz=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=(.999999998*t+.396337792*o+.215803758*i)**3,a=(1.000000008*t-.105561342*o-.063854175*i)**3,A=(1.000000055*t-.089484182*o-1.291485538*i)**3,r=1.227013851*e-.55779998*a+.281256149*A,s=-.040580178*e+1.11225687*a-.071676679*A,g=-.076381285*e-.421481978*a+1.58616322*A;return[r*100,s*100,g*100]};sA.oklab.rgb=function(n){let t=n[0]/100,o=n[1]/100,i=n[2]/100,e=(t+.3963377774*o+.2158037573*i)**3,a=(t-.1055613458*o-.0638541728*i)**3,A=(t-.0894841775*o-1.291485548*i)**3,r=Mh(4.0767416621*e-3.3077115913*a+.2309699292*A),s=Mh(-1.2684380046*e+2.6097574011*a-.3413193965*A),g=Mh(-.0041960863*e-.7034186147*a+1.707614701*A);return[r*255,s*255,g*255]};sA.oklch.oklab=function(n){return sA.lch.lab(n)};sA.lab.xyz=function(n){let t=n[0],o=n[1],i=n[2],e,a,A;a=(t+16)/116,e=o/500+a,A=a-i/200;let r=a**3,s=e**3,g=A**3;return a=r>Jg?r:(a-16/116)/7.787,e=s>Jg?s:(e-16/116)/7.787,A=g>Jg?g:(A-16/116)/7.787,e*=95.047,a*=100,A*=108.883,[e,a,A]};sA.lab.lch=function(n){let t=n[0],o=n[1],i=n[2],e;e=Math.atan2(i,o)*360/2/Math.PI,e<0&&(e+=360);let A=Math.sqrt(o*o+i*i);return[t,A,e]};sA.lch.lab=function(n){let t=n[0],o=n[1],e=n[2]/360*2*Math.PI,a=o*Math.cos(e),A=o*Math.sin(e);return[t,a,A]};sA.rgb.ansi16=function(n,t=null){let[o,i,e]=n,a=t===null?sA.rgb.hsv(n)[2]:t;if(a=Math.round(a/50),a===0)return 30;let A=30+(Math.round(e/255)<<2|Math.round(i/255)<<1|Math.round(o/255));return a===2&&(A+=60),A};sA.hsv.ansi16=function(n){return sA.rgb.ansi16(sA.hsv.rgb(n),n[2])};sA.rgb.ansi256=function(n){let t=n[0],o=n[1],i=n[2];return t>>4===o>>4&&o>>4===i>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(i/255*5)};sA.ansi16.rgb=function(n){n=n[0];let t=n%10;if(t===0||t===7)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let o=(Math.trunc(n>50)+1)*.5,i=(t&1)*o*255,e=(t>>1&1)*o*255,a=(t>>2&1)*o*255;return[i,e,a]};sA.ansi256.rgb=function(n){if(n=n[0],n>=232){let a=(n-232)*10+8;return[a,a,a]}n-=16;let t,o=Math.floor(n/36)/5*255,i=Math.floor((t=n%36)/6)/5*255,e=t%6/5*255;return[o,i,e]};sA.rgb.hex=function(n){let o=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(o.length)+o};sA.hex.rgb=function(n){let t=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let o=t[0];t[0].length===3&&(o=[...o].map(r=>r+r).join(""));let i=Number.parseInt(o,16),e=i>>16&255,a=i>>8&255,A=i&255;return[e,a,A]};sA.rgb.hcg=function(n){let t=n[0]/255,o=n[1]/255,i=n[2]/255,e=Math.max(Math.max(t,o),i),a=Math.min(Math.min(t,o),i),A=e-a,r,s=A<1?a/(1-A):0;return A<=0?r=0:e===t?r=(o-i)/A%6:e===o?r=2+(i-t)/A:r=4+(t-o)/A,r/=6,r%=1,[r*360,A*100,s*100]};sA.hsl.hcg=function(n){let t=n[1]/100,o=n[2]/100,i=o<.5?2*t*o:2*t*(1-o),e=0;return i<1&&(e=(o-.5*i)/(1-i)),[n[0],i*100,e*100]};sA.hsv.hcg=function(n){let t=n[1]/100,o=n[2]/100,i=t*o,e=0;return i<1&&(e=(o-i)/(1-i)),[n[0],i*100,e*100]};sA.hcg.rgb=function(n){let t=n[0]/360,o=n[1]/100,i=n[2]/100;if(o===0)return[i*255,i*255,i*255];let e=[0,0,0],a=t%1*6,A=a%1,r=1-A,s=0;switch(Math.floor(a)){case 0:{e[0]=1,e[1]=A,e[2]=0;break}case 1:{e[0]=r,e[1]=1,e[2]=0;break}case 2:{e[0]=0,e[1]=1,e[2]=A;break}case 3:{e[0]=0,e[1]=r,e[2]=1;break}case 4:{e[0]=A,e[1]=0,e[2]=1;break}default:e[0]=1,e[1]=0,e[2]=r}return s=(1-o)*i,[(o*e[0]+s)*255,(o*e[1]+s)*255,(o*e[2]+s)*255]};sA.hcg.hsv=function(n){let t=n[1]/100,o=n[2]/100,i=t+o*(1-t),e=0;return i>0&&(e=t/i),[n[0],e*100,i*100]};sA.hcg.hsl=function(n){let t=n[1]/100,i=n[2]/100*(1-t)+.5*t,e=0;return i>0&&i<.5?e=t/(2*i):i>=.5&&i<1&&(e=t/(2*(1-i))),[n[0],e*100,i*100]};sA.hcg.hwb=function(n){let t=n[1]/100,o=n[2]/100,i=t+o*(1-t);return[n[0],(i-t)*100,(1-i)*100]};sA.hwb.hcg=function(n){let t=n[1]/100,i=1-n[2]/100,e=i-t,a=0;return e<1&&(a=(i-e)/(1-e)),[n[0],e*100,a*100]};sA.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};sA.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};sA.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};sA.gray.hsl=function(n){return[0,0,n[0]]};sA.gray.hsv=sA.gray.hsl;sA.gray.hwb=function(n){return[0,100,n[0]]};sA.gray.cmyk=function(n){return[0,0,0,n[0]]};sA.gray.lab=function(n){return[n[0],0,0]};sA.gray.hex=function(n){let t=Math.round(n[0]/100*255)&255,i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(i.length)+i};sA.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};function d3e(){let n={},t=Object.keys(Kl);for(let{length:o}=t,i=0;i0;){let i=o.pop(),e=Object.keys(Kl[i]);for(let{length:a}=e,A=0;A1&&(o=i),n(o))};return"conversion"in n&&(t.conversion=n.conversion),t}function y3e(n){let t=function(...o){let i=o[0];if(i==null)return i;i.length>1&&(o=i);let e=n(o);if(typeof e=="object")for(let{length:a}=e,A=0;A0){this.model=t||"rgb",i=Eo[this.model].channels;let e=Array.prototype.slice.call(n,0,i);this.color=TL(e,i),this.valpha=typeof n[i]=="number"?n[i]:1}else if(typeof n=="number")this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;let e=Object.keys(n);"alpha"in n&&(e.splice(e.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);let a=e.sort().join("");if(!(a in ML))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=ML[a];let{labels:A}=Eo[this.model],r=[];for(o=0;o(n%360+360)%360),saturationl:wr("hsl",1,zr(100)),lightness:wr("hsl",2,zr(100)),saturationv:wr("hsv",1,zr(100)),value:wr("hsv",2,zr(100)),chroma:wr("hcg",1,zr(100)),gray:wr("hcg",2,zr(100)),white:wr("hwb",1,zr(100)),wblack:wr("hwb",2,zr(100)),cyan:wr("cmyk",0,zr(100)),magenta:wr("cmyk",1,zr(100)),yellow:wr("cmyk",2,zr(100)),black:wr("cmyk",3,zr(100)),x:wr("xyz",0,zr(95.047)),y:wr("xyz",1,zr(100)),z:wr("xyz",2,zr(108.833)),l:wr("lab",0,zr(100)),a:wr("lab",1),b:wr("lab",2),keyword(n){return n!==void 0?new la(n):Eo[this.model].keyword(this.color)},hex(n){return n!==void 0?new la(n):Oh.to.hex(...this.rgb().round().color)},hexa(n){if(n!==void 0)return new la(n);let t=this.rgb().round().color,o=Math.round(this.valpha*255).toString(16).toUpperCase();return o.length===1&&(o="0"+o),Oh.to.hex(...t)+o},rgbNumber(){let n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity(){let n=this.rgb().color,t=[];for(let[o,i]of n.entries()){let e=i/255;t[o]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(n){let t=this.luminosity(),o=n.luminosity();return t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)},level(n){let t=this.contrast(n);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let n=this.rgb().color;return(n[0]*2126+n[1]*7152+n[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let n=this.rgb();for(let t=0;t<3;t++)n.color[t]=255-n.color[t];return n},lighten(n){let t=this.hsl();return t.color[2]+=t.color[2]*n,t},darken(n){let t=this.hsl();return t.color[2]-=t.color[2]*n,t},saturate(n){let t=this.hsl();return t.color[1]+=t.color[1]*n,t},desaturate(n){let t=this.hsl();return t.color[1]-=t.color[1]*n,t},whiten(n){let t=this.hwb();return t.color[1]+=t.color[1]*n,t},blacken(n){let t=this.hwb();return t.color[2]+=t.color[2]*n,t},grayscale(){let n=this.rgb().color,t=n[0]*.3+n[1]*.59+n[2]*.11;return la.rgb(t,t,t)},fade(n){return this.alpha(this.valpha-this.valpha*n)},opaquer(n){return this.alpha(this.valpha+this.valpha*n)},rotate(n){let t=this.hsl(),o=t.color[0];return o=(o+n)%360,o=o<0?360+o:o,t.color[0]=o,t},mix(n,t){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);let o=n.rgb(),i=this.rgb(),e=t===void 0?.5:t,a=2*e-1,A=o.alpha()-i.alpha(),r=((a*A===-1?a:(a+A)/(1+a*A))+1)/2,s=1-r;return la.rgb(r*o.red()+s*i.red(),r*o.green()+s*i.green(),r*o.blue()+s*i.blue(),o.alpha()*e+i.alpha()*(1-e))}};for(let n of Object.keys(Eo)){if(xAe.includes(n))continue;let{channels:t}=Eo[n];la.prototype[n]=function(...o){return this.model===n?new la(this):o.length>0?new la(o,n):new la([...w3e(Eo[this.model][n].raw(this.color)),this.valpha],n)},la[n]=function(...o){let i=o[0];return typeof i=="number"&&(i=TL(o,t)),new la(i,n)}}function m3e(n,t){return Number(n.toFixed(t))}function S3e(n){return function(t){return m3e(t,n)}}function wr(n,t,o){n=Array.isArray(n)?n:[n];for(let i of n)(_L[i]||=[])[t]=o;return n=n[0],function(i){let e;return i!==void 0?(o&&(i=o(i)),e=this[n](),e.color[t]=i,e):(e=this[n]().color[t],o&&(e=o(e)),e)}}function zr(n){return function(t){return Math.max(0,Math.min(n,t))}}function w3e(n){return Array.isArray(n)?n:[n]}function TL(n,t){for(let o=0;o{JAe.exports=jAe().default});function O3e(n){return this._setBackgroundColourOption("tint",n),this}function b3e(n){return this.options.greyscale=O.bool(n)?n:!0,this}function M3e(n){return this.greyscale(n)}function _3e(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspacePipeline=n,this}function T3e(n){return this.pipelineColourspace(n)}function N3e(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspace=n,this}function R3e(n){return this.toColourspace(n)}function WAe(n){if(O.object(n)||O.string(n)&&n.length>=3&&n.length<=200){let t=(0,VAe.default)(n),o=t.red(),i=t.green(),e=t.blue(),a=Math.round(t.alpha()*255);for(let[A,r]of[["red",o],["green",i],["blue",e],["alpha",a]])if(!O.number(r))throw O.invalidParameterError(`background.${A}`,"number",r);return[o,i,e,a]}else throw O.invalidParameterError("background","object or string",n)}function k3e(n,t){O.defined(t)&&(this.options[n]=WAe(t))}var VAe,zAe,ZAe,XAe=Ce(()=>{VAe=qe(qAe(),1);Ts();zAe={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};ZAe=n=>{Object.assign(n.prototype,{tint:O3e,greyscale:b3e,grayscale:M3e,pipelineColourspace:_3e,pipelineColorspace:T3e,toColourspace:N3e,toColorspace:R3e,_getBackgroundColourOption:WAe,_setBackgroundColourOption:k3e}),n.colourspace=zAe,n.colorspace=zAe}});function P3e(){return this.options.removeAlpha=!0,this}function G3e(n){if(O.defined(n))if(O.number(n)&&O.inRange(n,0,1))this.options.ensureAlpha=n;else throw O.invalidParameterError("alpha","number between 0 and 1",n);else this.options.ensureAlpha=1;return this}function F3e(n){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(n)&&(n=t[n]),O.integer(n)&&O.inRange(n,0,4))this.options.extractChannel=n;else throw O.invalidParameterError("channel","integer or one of: red, green, blue, alpha",n);return this}function L3e(n,t){return Array.isArray(n)?n.forEach(function(o){this.options.joinChannelIn.push(this._createInputDescriptor(o,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(n,t)),this}function U3e(n){if(O.string(n)&&O.inArray(n,["and","or","eor"]))this.options.bandBoolOp=n;else throw O.invalidParameterError("boolOp","one of: and, or, eor",n);return this}var v3e,$Ae,ete=Ce(()=>{Ts();v3e={and:"and",or:"or",eor:"eor"};$Ae=n=>{Object.assign(n.prototype,{removeAlpha:P3e,ensureAlpha:G3e,extractChannel:F3e,joinChannel:L3e,bandbool:U3e}),n.bool=v3e}});import RL from"node:path";function K3e(n,t){let o;if(O.string(n)?O.string(this.options.input.file)&&RL.resolve(this.options.input.file)===RL.resolve(n)?o=new Error("Cannot use same file for input and output"):H3e.test(RL.extname(n))&&!this.constructor.format.jp2.output.file&&(o=tte()):o=new Error("Missing output file path"),o)if(O.fn(t))t(o);else return Promise.reject(o);else{this.options.fileOut=n;let i=Error();return this._pipeline(t,i)}return this}function x3e(n,t){O.object(n)?this._setBooleanOption("resolveWithObject",n.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let o=Error();return this._pipeline(O.fn(n)?n:t,o)}function Y3e(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let n=Error();return this._pipeline(null,n)}function j3e(n){if(O.number(n)&&n>0)this.options.withMetadataDensity=n;else throw O.invalidParameterError("density","positive number",n);return this.keepExif()}function J3e(){return this.options.keepMetadata|=1,this}function q3e(n){if(O.object(n))for(let[t,o]of Object.entries(n))if(O.object(o))for(let[i,e]of Object.entries(o))if(O.string(e))this.options.withExif[`exif-${t.toLowerCase()}-${i}`]=e;else throw O.invalidParameterError(`${t}.${i}`,"string",e);else throw O.invalidParameterError(t,"object",o);else throw O.invalidParameterError("exif","object",n);return this.options.withExifMerge=!1,this.keepExif()}function z3e(n){return this.withExif(n),this.options.withExifMerge=!0,this}function V3e(){return this.options.keepMetadata|=8,this}function W3e(n,t){if(O.string(n))this.options.withIccProfile=n;else throw O.invalidParameterError("icc","string",n);if(this.keepIccProfile(),O.object(t)&&O.defined(t.attach))if(O.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw O.invalidParameterError("attach","boolean",t.attach);return this}function Z3e(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function X3e(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function $3e(){return this.options.keepMetadata|=2,this}function eje(n){if(O.string(n)&&n.length>0)this.options.withXmp=n,this.options.keepMetadata|=2;else throw O.invalidParameterError("xmp","non-empty string",n);return this}function Aje(){return this.options.keepMetadata|=31,this}function tje(n){if(this.keepMetadata(),this.withIccProfile("srgb"),O.object(n)){if(O.defined(n.orientation))if(O.integer(n.orientation)&&O.inRange(n.orientation,1,8))this.options.withMetadataOrientation=n.orientation;else throw O.invalidParameterError("orientation","integer between 1 and 8",n.orientation);if(O.defined(n.density))if(O.number(n.density)&&n.density>0)this.options.withMetadataDensity=n.density;else throw O.invalidParameterError("density","positive number",n.density);O.defined(n.icc)&&this.withIccProfile(n.icc),O.defined(n.exif)&&this.withExifMerge(n.exif)}return this}function rje(n,t){let o=Ate.get((O.object(n)&&O.string(n.id)?n.id:n).toLowerCase());if(!o)throw O.invalidParameterError("format",`one of: ${[...Ate.keys()].join(", ")}`,n);return this[o](t)}function aje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jpegQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.progressive)&&this._setBooleanOption("jpegProgressive",n.progressive),O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);let t=O.bool(n.optimizeCoding)?n.optimizeCoding:n.optimiseCoding;if(O.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),O.defined(n.mozjpeg))if(O.bool(n.mozjpeg))n.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw O.invalidParameterError("mozjpeg","boolean",n.mozjpeg);let o=O.bool(n.trellisQuantization)?n.trellisQuantization:n.trellisQuantisation;O.defined(o)&&this._setBooleanOption("jpegTrellisQuantisation",o),O.defined(n.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",n.overshootDeringing);let i=O.bool(n.optimizeScans)?n.optimizeScans:n.optimiseScans;O.defined(i)&&(this._setBooleanOption("jpegOptimiseScans",i),i&&(this.options.jpegProgressive=!0));let e=O.number(n.quantizationTable)?n.quantizationTable:n.quantisationTable;if(O.defined(e))if(O.integer(e)&&O.inRange(e,0,8))this.options.jpegQuantisationTable=e;else throw O.invalidParameterError("quantisationTable","integer between 0 and 8",e)}return this._updateFormatOut("jpeg",n)}function ije(n){if(O.object(n)){if(O.defined(n.progressive)&&this._setBooleanOption("pngProgressive",n.progressive),O.defined(n.compressionLevel))if(O.integer(n.compressionLevel)&&O.inRange(n.compressionLevel,0,9))this.options.pngCompressionLevel=n.compressionLevel;else throw O.invalidParameterError("compressionLevel","integer between 0 and 9",n.compressionLevel);O.defined(n.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",n.adaptiveFiltering);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.pngBitdepth=rte(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.palette)?this._setBooleanOption("pngPalette",n.palette):[n.quality,n.effort,n.colours,n.colors,n.dither].some(O.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,0,100))this.options.pngQuality=n.quality;else throw O.invalidParameterError("quality","integer between 0 and 100",n.quality);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.pngEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.pngDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither)}}return this._updateFormatOut("png",n)}function oje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.webpQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.alphaQuality))if(O.integer(n.alphaQuality)&&O.inRange(n.alphaQuality,0,100))this.options.webpAlphaQuality=n.alphaQuality;else throw O.invalidParameterError("alphaQuality","integer between 0 and 100",n.alphaQuality);if(O.defined(n.lossless)&&this._setBooleanOption("webpLossless",n.lossless),O.defined(n.nearLossless)&&this._setBooleanOption("webpNearLossless",n.nearLossless),O.defined(n.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",n.smartSubsample),O.defined(n.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",n.smartDeblock),O.defined(n.preset))if(O.string(n.preset)&&O.inArray(n.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=n.preset;else throw O.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",n.preset);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,6))this.options.webpEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 6",n.effort);O.defined(n.minSize)&&this._setBooleanOption("webpMinSize",n.minSize),O.defined(n.mixed)&&this._setBooleanOption("webpMixed",n.mixed),O.defined(n.exact)&&this._setBooleanOption("webpExact",n.exact)}return kL(n,this.options),this._updateFormatOut("webp",n)}function nje(n){if(O.object(n)){O.defined(n.reuse)&&this._setBooleanOption("gifReuse",n.reuse),O.defined(n.progressive)&&this._setBooleanOption("gifProgressive",n.progressive);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.gifBitdepth=rte(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.gifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.gifDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither);if(O.defined(n.interFrameMaxError))if(O.number(n.interFrameMaxError)&&O.inRange(n.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=n.interFrameMaxError;else throw O.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",n.interFrameMaxError);if(O.defined(n.interPaletteMaxError))if(O.number(n.interPaletteMaxError)&&O.inRange(n.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=n.interPaletteMaxError;else throw O.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",n.interPaletteMaxError);if(O.defined(n.keepDuplicateFrames))if(O.bool(n.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",n.keepDuplicateFrames);else throw O.invalidParameterError("keepDuplicateFrames","boolean",n.keepDuplicateFrames)}return kL(n,this.options),this._updateFormatOut("gif",n)}function sje(n){if(!this.constructor.format.jp2.output.buffer)throw tte();if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jp2Quality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jp2Lossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.jp2TileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.jp2TileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling)}return this._updateFormatOut("jp2",n)}function kL(n,t){if(O.object(n)&&O.defined(n.loop))if(O.integer(n.loop)&&O.inRange(n.loop,0,65535))t.loop=n.loop;else throw O.invalidParameterError("loop","integer between 0 and 65535",n.loop);if(O.object(n)&&O.defined(n.delay))if(O.integer(n.delay)&&O.inRange(n.delay,0,65535))t.delay=[n.delay];else if(Array.isArray(n.delay)&&n.delay.every(O.integer)&&n.delay.every(o=>O.inRange(o,0,65535)))t.delay=n.delay;else throw O.invalidParameterError("delay","integer or an array of integers between 0 and 65535",n.delay)}function gje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.tiffQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[1,2,4]))this.options.tiffBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","1, 2 or 4",n.bitdepth);if(O.defined(n.tile)&&this._setBooleanOption("tiffTile",n.tile),O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.tiffTileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.tiffTileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.miniswhite)&&this._setBooleanOption("tiffMiniswhite",n.miniswhite),O.defined(n.pyramid)&&this._setBooleanOption("tiffPyramid",n.pyramid),O.defined(n.xres))if(O.number(n.xres)&&O.inRange(n.xres,.001,1e6))this.options.tiffXres=n.xres;else throw O.invalidParameterError("xres","number between 0.001 and 1000000",n.xres);if(O.defined(n.yres))if(O.number(n.yres)&&O.inRange(n.yres,.001,1e6))this.options.tiffYres=n.yres;else throw O.invalidParameterError("yres","number between 0.001 and 1000000",n.yres);if(O.defined(n.compression))if(O.string(n.compression)&&O.inArray(n.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=n.compression;else throw O.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",n.compression);if(O.defined(n.bigtiff)&&this._setBooleanOption("tiffBigtiff",n.bigtiff),O.defined(n.predictor))if(O.string(n.predictor)&&O.inArray(n.predictor,["none","horizontal","float"]))this.options.tiffPredictor=n.predictor;else throw O.invalidParameterError("predictor","one of: none, horizontal, float",n.predictor);if(O.defined(n.resolutionUnit))if(O.string(n.resolutionUnit)&&O.inArray(n.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=n.resolutionUnit;else throw O.invalidParameterError("resolutionUnit","one of: inch, cm",n.resolutionUnit)}return this._updateFormatOut("tiff",n)}function cje(n){return this.heif({...n,compression:"av1"})}function Ije(n){if(O.object(n)){if(O.string(n.compression)&&O.inArray(n.compression,["av1","hevc"]))this.options.heifCompression=n.compression;else throw O.invalidParameterError("compression","one of: av1, hevc",n.compression);if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.heifQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.heifLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,9))this.options.heifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 9",n.effort);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[8,10,12]))this.options.heifBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","8, 10 or 12",n.bitdepth);if(O.defined(n.tune))if(O.string(n.tune)&&O.inArray(n.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&n.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=n.tune;else throw O.invalidParameterError("tune","one of: auto, iq, psnr, ssim",n.tune)}else throw O.invalidParameterError("options","Object",n);return this._updateFormatOut("heif",n)}function lje(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jxlDistance=n.quality>=30?.1+(100-n.quality)*.09:53/3e3*n.quality*n.quality-23/20*n.quality+25;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);else if(O.defined(n.distance))if(O.number(n.distance)&&O.inRange(n.distance,0,15))this.options.jxlDistance=n.distance;else throw O.invalidParameterError("distance","number between 0.0 and 15.0",n.distance);if(O.defined(n.decodingTier))if(O.integer(n.decodingTier)&&O.inRange(n.decodingTier,0,4))this.options.jxlDecodingTier=n.decodingTier;else throw O.invalidParameterError("decodingTier","integer between 0 and 4",n.decodingTier);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jxlLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,9))this.options.jxlEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 9",n.effort)}return kL(n,this.options),this._updateFormatOut("jxl",n)}function pje(n){if(O.object(n)&&O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=n.depth;else throw O.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",n.depth);return this._updateFormatOut("raw")}function dje(n){if(O.object(n)){if(O.defined(n.size))if(O.integer(n.size)&&O.inRange(n.size,1,8192))this.options.tileSize=n.size;else throw O.invalidParameterError("size","integer between 1 and 8192",n.size);if(O.defined(n.overlap))if(O.integer(n.overlap)&&O.inRange(n.overlap,0,8192)){if(n.overlap>this.options.tileSize)throw O.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,n.overlap);this.options.tileOverlap=n.overlap}else throw O.invalidParameterError("overlap","integer between 0 and 8192",n.overlap);if(O.defined(n.container))if(O.string(n.container)&&O.inArray(n.container,["fs","zip"]))this.options.tileContainer=n.container;else throw O.invalidParameterError("container","one of: fs, zip",n.container);if(O.defined(n.layout))if(O.string(n.layout)&&O.inArray(n.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=n.layout;else throw O.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",n.layout);if(O.defined(n.angle))if(O.integer(n.angle)&&!(n.angle%90))this.options.tileAngle=n.angle;else throw O.invalidParameterError("angle","positive/negative multiple of 90",n.angle);if(this._setBackgroundColourOption("tileBackground",n.background),O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["onepixel","onetile","one"]))this.options.tileDepth=n.depth;else throw O.invalidParameterError("depth","one of: onepixel, onetile, one",n.depth);if(O.defined(n.skipBlanks))if(O.integer(n.skipBlanks)&&O.inRange(n.skipBlanks,-1,65535))this.options.tileSkipBlanks=n.skipBlanks;else throw O.invalidParameterError("skipBlanks","integer between -1 and 255/65535",n.skipBlanks);else O.defined(n.layout)&&n.layout==="google"&&(this.options.tileSkipBlanks=5);let t=O.bool(n.center)?n.center:n.centre;if(O.defined(t)&&this._setBooleanOption("tileCentre",t),O.defined(n.id))if(O.string(n.id))this.options.tileId=n.id;else throw O.invalidParameterError("id","string",n.id);if(O.defined(n.basename))if(O.string(n.basename))this.options.tileBasename=n.basename;else throw O.invalidParameterError("basename","string",n.basename)}if(O.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw O.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function hje(n){if(!O.plainObject(n))throw O.invalidParameterError("options","object",n);if(O.integer(n.seconds)&&O.inRange(n.seconds,0,3600))this.options.timeoutSeconds=n.seconds;else throw O.invalidParameterError("seconds","integer between 0 and 3600",n.seconds);return this}function Eje(n,t){return O.object(t)&&t.force===!1||(this.options.formatOut=n),this}function Cje(n,t){if(O.bool(t))this.options[n]=t;else throw O.invalidParameterError(n,"boolean",t)}function uje(){if(!this.options.streamOut){this.options.streamOut=!0;let n=Error();this._pipeline(void 0,n)}}function Bje(n,t){return typeof n=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(o,i,e)=>{o?n(O.nativeError(o,t)):n(null,i,e)})}):St.pipeline(this.options,(o,i,e)=>{o?n(O.nativeError(o,t)):n(null,i,e)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(o,i,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(i)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):St.pipeline(this.options,(o,i,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(i)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((o,i)=>{this.once("finish",()=>{this._flattenBufferIn(),St.pipeline(this.options,(e,a,A)=>{e?i(O.nativeError(e,t)):this.options.resolveWithObject?o({data:a,info:A}):o(a)})})}):new Promise((o,i)=>{St.pipeline(this.options,(e,a,A)=>{e?i(O.nativeError(e,t)):this.options.resolveWithObject?o({data:a,info:A}):o(a)})})}var Ate,H3e,tte,rte,ate,ite=Ce(()=>{Ts();KB();Ate=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),H3e=/\.(jp[2x]|j2[kc])$/i,tte=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),rte=n=>1<<31-Math.clz32(Math.ceil(Math.log2(n)));ate=n=>{Object.assign(n.prototype,{toFile:K3e,toBuffer:x3e,toUint8Array:Y3e,withDensity:j3e,keepExif:J3e,withExif:q3e,withExifMerge:z3e,keepIccProfile:V3e,withIccProfile:W3e,keepGainMap:Z3e,withGainMap:X3e,keepXmp:$3e,withXmp:eje,keepMetadata:Aje,withMetadata:tje,toFormat:rje,jpeg:aje,jp2:sje,png:ije,webp:oje,tiff:gje,avif:cje,heif:Ije,jxl:lje,gif:nje,raw:pje,tile:dje,timeout:hje,_updateFormatOut:Eje,_setBooleanOption:Cje,_read:uje,_pipeline:Bje})}});import fje from"node:events";import{createRequire as Qje}from"node:module";import{availableParallelism as yje}from"node:os";function nte(n){if(O.bool(n))return n?St.cache(50,20,100):St.cache(0,0,0);if(O.object(n)){for(let t of["memory","files","items"]){let o=n[t];if(O.defined(o)&&!(O.integer(o)&&o>=0))throw O.invalidParameterError(t,"a positive integer",o)}return St.cache(n.memory,n.files,n.items)}else return St.cache()}function Sje(n){return St.concurrency(O.integer(n)?n:null)}function Dje(){return St.counters()}function Oje(n){return St.simd(O.bool(n)?n:null)}function bje(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))St.block(n.operation,!0);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}function Mje(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))St.block(n.operation,!1);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}var xB,vL,ote,PL,iI,mje,Th,wje,ste,gte=Ce(()=>{xB=qe(mD(),1);Ts();mL();KB();GD();vL=Qje(import.meta.url),ote=FD.runtimePlatformArch(),PL=St.libvipsVersion(),iI=St.format();iI.heif.output.alias=["avif","heic"];iI.jpeg.output.alias=["jpe","jpg"];iI.tiff.output.alias=["tif"];iI.jp2.output.alias=["j2c","j2k","jp2","jpx"];mje={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},Th={vips:PL.semver};if(!PL.isGlobal)if(PL.isWasm)try{Th=vL("@img/sharp-wasm32/versions")}catch{}else try{Th=vL(`@img/sharp-${ote}/versions`)}catch{try{Th=vL(`@img/sharp-libvips-${ote}/versions`)}catch{}}Th.sharp=Yg.version;Th.heif&&iI.heif&&(iI.heif.input.fileSuffix=[".avif"],iI.heif.output.alias=["avif"]);nte(!0);!process.env.MALLOC_ARENA_MAX&&xB.default.familySync()===xB.default.GLIBC&&!St._isUsingJemalloc()?St.concurrency(1):xB.default.familySync()===xB.default.MUSL&&St.concurrency()===1024&&St.concurrency(yje());wje=new fje.EventEmitter;ste=n=>{n.cache=nte,n.concurrency=Sje,n.counters=Dje,n.simd=Oje,n.format=iI,n.interpolators=mje,n.versions=Th,n.queue=wje,n.block=bje,n.unblock=Mje}});var cte={};Fr(cte,{default:()=>_je});var _je,Ite=Ce(()=>{wAe();bAe();kAe();PAe();LAe();XAe();ete();ite();gte();OAe(Ps);RAe(Ps);vAe(Ps);FAe(Ps);ZAe(Ps);$Ae(Ps);ate(Ps);ste(Ps);_je=Ps});var Tje,kA,oI,YB=Ce(()=>{Tje="End-Of-Stream",kA=class extends Error{constructor(){super(Tje),this.name="EndOfStreamError"}},oI=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}}});var KD,lte=Ce(()=>{KD=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((t,o)=>{this.reject=o,this.resolve=t})}}});var nI,xD=Ce(()=>{YB();nI=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(t,o=!1){let i=await this.read(t,o);return this.peekQueue.push(t.subarray(0,i)),i}async read(t,o=!1){if(t.length===0)return 0;let i=this.readFromPeekBuffer(t);if(this.endOfStream||(i+=await this.readRemainderFromStream(t.subarray(i),o)),i===0&&!o)throw new kA;return i}readFromPeekBuffer(t){let o=t.length,i=0;for(;this.peekQueue.length>0&&o>0;){let e=this.peekQueue.pop();if(!e)throw new Error("peekData should be defined");let a=Math.min(e.length,o);t.set(e.subarray(0,a),i),i+=a,o-=a,a{YB();lte();xD();jB=class extends nI{constructor(t){if(super(),this.s=t,this.deferred=null,!t.read||!t.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>{this.endOfStream=!0,this.deferred&&this.deferred.resolve(0)}),this.s.once("error",o=>this.reject(o)),this.s.once("close",()=>this.abort())}async readFromStream(t,o){if(t.length===0)return 0;let i=this.s.read(t.length);if(i)return t.set(i),i.length;let e={buffer:t,mayBeLess:o,deferred:new KD};return this.deferred=e.deferred,this.s.once("readable",()=>{this.readDeferred(e)}),e.deferred.promise}readDeferred(t){let o=this.s.read(t.buffer.length);o?(t.buffer.set(o),t.deferred.resolve(o.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(t)})}reject(t){this.interrupted=!0,this.deferred&&(this.deferred.reject(t),this.deferred=null)}async abort(){this.reject(new oI)}async close(){return this.abort()}}});var YD,dte=Ce(()=>{xD();YD=class extends nI{constructor(t){super(),this.reader=t}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var JB,GL=Ce(()=>{dte();JB=class extends YD{async readFromStream(t,o){if(t.length===0)return 0;let i=await this.reader.read(new Uint8Array(t.length),{min:o?void 0:t.length});return i.done&&(this.endOfStream=i.done),i.value?(t.set(i.value),i.value.length):0}}});var Nh,FL=Ce(()=>{YB();xD();Nh=class extends nI{constructor(t){super(),this.reader=t,this.buffer=null}writeChunk(t,o){let i=Math.min(o.length,t.length);return t.set(o.subarray(0,i)),i{GL();FL()});var sI=Ce(()=>{YB();pte();GL();FL();hte()});var Kn,Rh=Ce(()=>{sI();Kn=class{constructor(t){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=t?.onClose,t?.abortSignal&&t.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(t,o=this.position){let i=new Uint8Array(t.len);if(await this.readBuffer(i,{position:o})o)return this.position+=o,o}return this.position+=t,t}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(t,o){if(!this.supportsRandomAccess()&&o&&o.position!==void 0&&o.position{Rh();sI();Nje=256e3,qB=class extends Kn{constructor(t,o){super(o),this.streamReader=t,this.fileInfo=o?.fileInfo??{}}async readBuffer(t,o){let i=this.normalizeOptions(t,o),e=i.position-this.position;if(e>0)return await this.ignore(e),this.readBuffer(t,o);if(e<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(i.length===0)return 0;let a=await this.streamReader.read(t.subarray(0,i.length),i.mayBeLess);if(this.position+=a,(!o||!o.mayBeLess)&&a0){let A=new Uint8Array(i.length+a);return e=await this.peekBuffer(A,{mayBeLess:i.mayBeLess}),t.set(A.subarray(a)),e-a}if(a<0)throw new Error("Cannot peek from a negative offset in a stream")}if(i.length>0){try{e=await this.streamReader.peek(t.subarray(0,i.length),i.mayBeLess)}catch(a){if(o?.mayBeLess&&a instanceof kA)return 0;throw a}if(!i.mayBeLess&&e{sI();Rh();jD=class extends Kn{constructor(t,o){super(o),this.uint8Array=t,this.fileInfo={...o?.fileInfo??{},size:t.length}}async readBuffer(t,o){o?.position&&(this.position=o.position);let i=await this.peekBuffer(t,o);return this.position+=i,i}async peekBuffer(t,o){let i=this.normalizeOptions(t,o),e=Math.min(this.uint8Array.length-i.position,i.length);if(!i.mayBeLess&&e{sI();Rh();JD=class extends Kn{constructor(t,o){super(o),this.blob=t,this.fileInfo={...o?.fileInfo??{},size:t.size,mimeType:t.type}}async readBuffer(t,o){o?.position&&(this.position=o.position);let i=await this.peekBuffer(t,o);return this.position+=i,i}async peekBuffer(t,o){let i=this.normalizeOptions(t,o),e=Math.min(this.blob.size-i.position,i.length);if(!i.mayBeLess&&e{if(await o.close(),e)return e()},new qB(o,i)}function qD(n,t){let o=LL(n),i=t??{},e=i.onClose;return i.onClose=async()=>{if(await o.close(),e)return e()},new qB(o,i)}function Co(n,t){return new jD(n,t)}function zD(n,t){return new JD(n,t)}var VD=Ce(()=>{sI();Ete();Cte();ute();sI();Rh()});import{open as kje}from"node:fs/promises";var kh,UL=Ce(()=>{Rh();sI();kh=class n extends Kn{static async fromFile(t){let o=await kje(t,"r"),i=await o.stat();return new n(o,{fileInfo:{path:t,size:i.size}})}constructor(t,o){super(o),this.fileHandle=t,this.fileInfo=o.fileInfo}async readBuffer(t,o){let i=this.normalizeOptions(t,o);if(this.position=i.position,i.length===0)return 0;let e=await this.fileHandle.read(t,0,i.length,i.position);if(this.position+=e.bytesRead,e.bytesRead{VD();UL();UL();VD();fte=kh.fromFile});var Qte=$(KL=>{KL.read=function(n,t,o,i,e){var a,A,r=e*8-i-1,s=(1<>1,c=-7,I=o?e-1:0,d=o?-1:1,B=n[t+I];for(I+=d,a=B&(1<<-c)-1,B>>=-c,c+=r;c>0;a=a*256+n[t+I],I+=d,c-=8);for(A=a&(1<<-c)-1,a>>=-c,c+=i;c>0;A=A*256+n[t+I],I+=d,c-=8);if(a===0)a=1-g;else{if(a===s)return A?NaN:(B?-1:1)*(1/0);A=A+Math.pow(2,i),a=a-g}return(B?-1:1)*A*Math.pow(2,a-i)};KL.write=function(n,t,o,i,e,a){var A,r,s,g=a*8-e-1,c=(1<>1,d=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=i?0:a-1,f=i?1:-1,Q=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,A=c):(A=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-A))<1&&(A--,s*=2),A+I>=1?t+=d/s:t+=d*Math.pow(2,1-I),t*s>=2&&(A++,s/=2),A+I>=c?(r=0,A=c):A+I>=1?(r=(t*s-1)*Math.pow(2,e),A=A+I):(r=t*Math.pow(2,I-1)*Math.pow(2,e),A=0));e>=8;n[o+B]=r&255,B+=f,r/=256,e-=8);for(A=A<0;n[o+B]=A&255,B+=f,A/=256,g-=8);n[o+B-f]|=Q*128}});function Pje(){if(!(typeof globalThis.TextDecoder>"u"))return WD??(WD=new globalThis.TextDecoder("utf-8"))}function Gje(){if(!(typeof globalThis.TextEncoder>"u"))return ZD??(ZD=new globalThis.TextEncoder)}function br(n,t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=Pje();return o?o.decode(n):Lje(n)}case"utf-16le":return Uje(n);case"us-ascii":case"ascii":return Hje(n);case"latin1":case"iso-8859-1":return Kje(n);case"windows-1252":return xje(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function mte(n="",t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=Gje();return o?o.encode(n):Yje(n)}case"utf-16le":return jje(n);case"us-ascii":case"ascii":return Jje(n);case"latin1":case"iso-8859-1":return qje(n);case"windows-1252":return zje(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function YL(n,t){t.length!==0&&(n.push(String.fromCharCode.apply(null,t)),t.length=0)}function vr(n,t,o){t.push(o),t.length>=vh&&YL(n,t)}function Fje(n,t,o){if(o<=65535){vr(n,t,o);return}o-=65536,vr(n,t,55296+(o>>10)),vr(n,t,56320+(o&1023))}function Lje(n){let t=[],o=[],i=0;for(n.length>=3&&n[0]===239&&n[1]===187&&n[2]===191&&(i=3);i244){vr(t,o,_a),i++;continue}if(e<=223){if(i+1>=n.length){vr(t,o,_a),i++;continue}let c=n[i+1];if((c&192)!==128){vr(t,o,_a),i++;continue}let I=(e&31)<<6|c&63;vr(t,o,I),i+=2;continue}if(e<=239){if(i+2>=n.length){vr(t,o,_a),i++;continue}let c=n[i+1],I=n[i+2];if(!((c&192)===128&&(I&192)===128&&!(e===224&&c<160)&&!(e===237&&c>=160))){vr(t,o,_a),i++;continue}let B=(e&15)<<12|(c&63)<<6|I&63;vr(t,o,B),i+=3;continue}if(i+3>=n.length){vr(t,o,_a),i++;continue}let a=n[i+1],A=n[i+2],r=n[i+3];if(!((a&192)===128&&(A&192)===128&&(r&192)===128&&!(e===240&&a<144)&&!(e===244&&a>143))){vr(t,o,_a),i++;continue}let g=(e&7)<<18|(a&63)<<12|(A&63)<<6|r&63;Fje(t,o,g),i+=4}return YL(t,o),t.join("")}function Uje(n){let t=[],o=[],i=n.length,e=0;for(;e+1=55296&&a<=56319){if(e+1=56320&&A<=57343?(vr(t,o,a),vr(t,o,A),e+=2):vr(t,o,_a)}else vr(t,o,_a);continue}if(a>=56320&&a<=57343){vr(t,o,_a);continue}vr(t,o,a)}return e=128&&e<=159?yte[e]:void 0;o+=a??String.fromCharCode(e),o.length>=vh&&(t.push(o),o="")}return o&&t.push(o),t.join("")}function Yje(n){let t=[];for(let o=0;o=55296&&i<=56319)if(o+1=56320&&e<=57343?(i=65536+(i-55296<<10)+(e-56320),o++):i=_a}else i=_a;else i>=56320&&i<=57343&&(i=_a);i<128?t.push(i):i<2048?t.push(192|i>>6,128|i&63):i<65536?t.push(224|i>>12,128|i>>6&63,128|i&63):t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63)}return new Uint8Array(t)}function jje(n){let t=[];for(let i=0;i=55296&&e<=56319){if(i+1=56320&&a<=57343?(t.push(e,a),i++):t.push(_a)}else t.push(_a);continue}if(e>=56320&&e<=57343){t.push(_a);continue}t.push(e)}let o=new Uint8Array(t.length*2);for(let i=0;i>>8}return o}function Jje(n){let t=new Uint8Array(n.length);for(let o=0;o=0&&e<=127||e>=160&&e<=255){t[o]=e;continue}t[o]=63}return t}var yte,xL,WD,ZD,vh,_a,Fs=Ce(()=>{yte={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},xL={};for(let[n,t]of Object.entries(yte))xL[t]=Number.parseInt(n,10);vh=32*1024,_a=65533});var VA={};Fr(VA,{AnsiStringType:()=>JL,Float16_BE:()=>Zje,Float16_LE:()=>Xje,Float32_BE:()=>zL,Float32_LE:()=>$je,Float64_BE:()=>$D,Float64_LE:()=>eJe,Float80_BE:()=>AJe,Float80_LE:()=>tJe,INT16_BE:()=>$o,INT16_LE:()=>Vje,INT24_BE:()=>XD,INT24_LE:()=>Wje,INT32_BE:()=>Ei,INT32_LE:()=>dr,INT64_BE:()=>qL,INT64_LE:()=>WB,INT8:()=>Us,IgnoreType:()=>jL,StringType:()=>Ve,UINT16_BE:()=>LA,UINT16_LE:()=>SA,UINT24_BE:()=>Pr,UINT24_LE:()=>VB,UINT32_BE:()=>xe,UINT32_LE:()=>Le,UINT64_BE:()=>Hs,UINT64_LE:()=>Gr,UINT8:()=>QA,Uint8ArrayType:()=>Ot});function zA(n){return new DataView(n.buffer,n.byteOffset)}var Ls,QA,SA,LA,VB,Pr,Le,xe,Us,$o,Vje,Wje,XD,Ei,dr,Gr,WB,Hs,qL,Zje,Xje,zL,$je,$D,eJe,AJe,tJe,jL,Ot,Ve,JL,DA=Ce(()=>{Ls=qe(Qte(),1);Fs();QA={len:1,get(n,t){return zA(n).getUint8(t)},put(n,t,o){return zA(n).setUint8(t,o),t+1}},SA={len:2,get(n,t){return zA(n).getUint16(t,!0)},put(n,t,o){return zA(n).setUint16(t,o,!0),t+2}},LA={len:2,get(n,t){return zA(n).getUint16(t)},put(n,t,o){return zA(n).setUint16(t,o),t+2}},VB={len:3,get(n,t){let o=zA(n);return o.getUint8(t)+(o.getUint16(t+1,!0)<<8)},put(n,t,o){let i=zA(n);return i.setUint8(t,o&255),i.setUint16(t+1,o>>8,!0),t+3}},Pr={len:3,get(n,t){let o=zA(n);return(o.getUint16(t)<<8)+o.getUint8(t+2)},put(n,t,o){let i=zA(n);return i.setUint16(t,o>>8),i.setUint8(t+2,o&255),t+3}},Le={len:4,get(n,t){return zA(n).getUint32(t,!0)},put(n,t,o){return zA(n).setUint32(t,o,!0),t+4}},xe={len:4,get(n,t){return zA(n).getUint32(t)},put(n,t,o){return zA(n).setUint32(t,o),t+4}},Us={len:1,get(n,t){return zA(n).getInt8(t)},put(n,t,o){return zA(n).setInt8(t,o),t+1}},$o={len:2,get(n,t){return zA(n).getInt16(t)},put(n,t,o){return zA(n).setInt16(t,o),t+2}},Vje={len:2,get(n,t){return zA(n).getInt16(t,!0)},put(n,t,o){return zA(n).setInt16(t,o,!0),t+2}},Wje={len:3,get(n,t){let o=VB.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let i=zA(n);return i.setUint8(t,o&255),i.setUint16(t+1,o>>8,!0),t+3}},XD={len:3,get(n,t){let o=Pr.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let i=zA(n);return i.setUint16(t,o>>8),i.setUint8(t+2,o&255),t+3}},Ei={len:4,get(n,t){return zA(n).getInt32(t)},put(n,t,o){return zA(n).setInt32(t,o),t+4}},dr={len:4,get(n,t){return zA(n).getInt32(t,!0)},put(n,t,o){return zA(n).setInt32(t,o,!0),t+4}},Gr={len:8,get(n,t){return zA(n).getBigUint64(t,!0)},put(n,t,o){return zA(n).setBigUint64(t,o,!0),t+8}},WB={len:8,get(n,t){return zA(n).getBigInt64(t,!0)},put(n,t,o){return zA(n).setBigInt64(t,o,!0),t+8}},Hs={len:8,get(n,t){return zA(n).getBigUint64(t)},put(n,t,o){return zA(n).setBigUint64(t,o),t+8}},qL={len:8,get(n,t){return zA(n).getBigInt64(t)},put(n,t,o){return zA(n).setBigInt64(t,o),t+8}},Zje={len:2,get(n,t){return Ls.read(n,t,!1,10,this.len)},put(n,t,o){return Ls.write(n,o,t,!1,10,this.len),t+this.len}},Xje={len:2,get(n,t){return Ls.read(n,t,!0,10,this.len)},put(n,t,o){return Ls.write(n,o,t,!0,10,this.len),t+this.len}},zL={len:4,get(n,t){return zA(n).getFloat32(t)},put(n,t,o){return zA(n).setFloat32(t,o),t+4}},$je={len:4,get(n,t){return zA(n).getFloat32(t,!0)},put(n,t,o){return zA(n).setFloat32(t,o,!0),t+4}},$D={len:8,get(n,t){return zA(n).getFloat64(t)},put(n,t,o){return zA(n).setFloat64(t,o),t+8}},eJe={len:8,get(n,t){return zA(n).getFloat64(t,!0)},put(n,t,o){return zA(n).setFloat64(t,o,!0),t+8}},AJe={len:10,get(n,t){return Ls.read(n,t,!1,63,this.len)},put(n,t,o){return Ls.write(n,o,t,!1,63,this.len),t+this.len}},tJe={len:10,get(n,t){return Ls.read(n,t,!0,63,this.len)},put(n,t,o){return Ls.write(n,o,t,!0,63,this.len),t+this.len}},jL=class{constructor(t){this.len=t}get(t,o){}},Ot=class{constructor(t){this.len=t}get(t,o){return t.subarray(o,o+this.len)}},Ve=class{constructor(t,o){this.len=t,this.encoding=o}get(t,o=0){let i=t.subarray(o,o+this.len);return br(i,this.encoding)}},JL=class extends Ve{constructor(t){super(t,"windows-1252")}}});var xl,VL,Ste,wte,Dte,Ote=Ce(()=>{DA();xl={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},VL={get(n){return{signature:Le.get(n,0),compressedSize:Le.get(n,8),uncompressedSize:Le.get(n,12)}},len:16},Ste={get(n){let t=SA.get(n,6);return{signature:Le.get(n,0),minVersion:SA.get(n,4),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,8),compressedSize:Le.get(n,18),uncompressedSize:Le.get(n,22),filenameLength:SA.get(n,26),extraFieldLength:SA.get(n,28),filename:null}},len:30},wte={get(n){return{signature:Le.get(n,0),nrOfThisDisk:SA.get(n,4),nrOfThisDiskWithTheStart:SA.get(n,6),nrOfEntriesOnThisDisk:SA.get(n,8),nrOfEntriesOfSize:SA.get(n,10),sizeOfCd:Le.get(n,12),offsetOfStartOfCd:Le.get(n,16),zipFileCommentLength:SA.get(n,20)}},len:22},Dte={get(n){let t=SA.get(n,8);return{signature:Le.get(n,0),minVersion:SA.get(n,6),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,10),compressedSize:Le.get(n,20),uncompressedSize:Le.get(n,24),filenameLength:SA.get(n,28),extraFieldLength:SA.get(n,30),fileCommentLength:SA.get(n,32),relativeOffsetOfLocalHeader:Le.get(n,42),filename:null}},len:46}});function Mte(n){let t=new Uint8Array(Le.len);return Le.put(t,0,n),t}function aJe(n,t){let o=n.length,i=t.length;if(i>o)return-1;for(let e=0;e<=o-i;e++){let a=!0;for(let A=0;Ae+a.length,0),o=new Uint8Array(t),i=0;for(let e of n)o.set(e,i),i+=e.length;return o}var bte,Ks,WL,rJe,eO,Yl,_te=Ce(()=>{DA();bte=qe(ct(),1);Ote();Ks=(0,bte.default)("tokenizer:inflate"),WL=256*1024,rJe=Mte(xl.DataDescriptor),eO=Mte(xl.EndOfCentralDirectory),Yl=class n{constructor(t){this.tokenizer=t,this.syncBuffer=new Uint8Array(WL)}async isZip(){return await this.peekSignature()===xl.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(Le)}async findEndOfCentralDirectoryLocator(){let t=this.tokenizer,o=Math.min(16*1024,t.fileInfo.size),i=this.syncBuffer.subarray(0,o);await this.tokenizer.readBuffer(i,{position:t.fileInfo.size-o});for(let e=i.length-4;e>=0;e--)if(i[e]===eO[0]&&i[e+1]===eO[1]&&i[e+2]===eO[2]&&i[e+3]===eO[3])return t.fileInfo.size-o+e;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Ks("Cannot reading central-directory without random-read support");return}Ks("Reading central-directory...");let t=this.tokenizer.position,o=await this.findEndOfCentralDirectoryLocator();if(o>0){Ks("Central-directory 32-bit signature found");let i=await this.tokenizer.readToken(wte,o),e=[];this.tokenizer.setPosition(i.offsetOfStartOfCd);for(let a=0;a=0?g:s;if(a.handler){let I=new Uint8Array(c);await this.tokenizer.readBuffer(I),r.push(I)}else await this.tokenizer.ignore(c)}Ks(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),a.handler&&await this.inflate(e,iJe(r),a.handler)}else a.handler?(Ks(`Reading compressed-file-data: ${e.compressedSize} bytes`),A=new Uint8Array(e.compressedSize),await this.tokenizer.readBuffer(A),await this.inflate(e,A,a.handler)):(Ks(`Ignoring compressed-file-data: ${e.compressedSize} bytes`),await this.tokenizer.ignore(e.compressedSize));if(Ks(`Reading data-descriptor at pos=${this.tokenizer.position}`),e.dataDescriptor&&(await this.tokenizer.readToken(VL)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-VL.len}`)}while(!i)}async iterateOverCentralDirectory(t,o){for(let i of t){let e=o(i);if(e.handler){this.tokenizer.setPosition(i.relativeOffsetOfLocalHeader);let a=await this.readLocalFileHeader();if(a){await this.tokenizer.ignore(a.extraFieldLength);let A=new Uint8Array(i.compressedSize);await this.tokenizer.readBuffer(A),await this.inflate(a,A,e.handler)}}if(e.stop)break}}async inflate(t,o,i){if(t.compressedMethod===0)return i(o);if(t.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);Ks(`Decompress filename=${t.filename}, compressed-size=${o.length}`);let e=await n.decompressDeflateRaw(o);return i(e)}static async decompressDeflateRaw(t){let o=new ReadableStream({start(a){a.enqueue(t),a.close()}}),i=new DecompressionStream("deflate-raw"),e=o.pipeThrough(i);try{let A=await new Response(e).arrayBuffer();return new Uint8Array(A)}catch(a){let A=a instanceof Error?`Failed to deflate ZIP entry: ${a.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(A)}}async readLocalFileHeader(){let t=await this.tokenizer.peekToken(Le);if(t===xl.LocalFileHeader){let o=await this.tokenizer.readToken(Ste);return o.filename=await this.tokenizer.readToken(new Ve(o.filenameLength,"utf-8")),o}if(t===xl.CentralFileHeader)return!1;throw t===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var ZB,Tte=Ce(()=>{ZB=class{constructor(t){this.tokenizer=t}inflate(){let t=this.tokenizer;return new ReadableStream({async pull(o){let i=new Uint8Array(1024),e=await t.readBuffer(i,{mayBeLess:!0});if(e===0){o.close();return}o.enqueue(i.subarray(0,e))}}).pipeThrough(new DecompressionStream("gzip"))}}});var Nte=Ce(()=>{_te();Tte()});function sJe(n,t,o){return n?n.constructor===t?!0:oJe.call(n)===o:!1}function gJe(n){return sJe(n,Uint8Array,nJe)}function cJe(n){if(!gJe(n))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof n}\``)}function AO(n){cJe(n);let t="";for(let o=0;o{oJe=Object.prototype.toString,nJe="[object Uint8Array]";rwA={utf8:new globalThis.TextDecoder("utf8")},awA=new globalThis.TextEncoder,IJe=Array.from({length:256},(n,t)=>t.toString(16).padStart(2,"0"))});function Rte(n,t){if(t==="utf-16le"){let o=[];for(let i=0;i>8&255)}return o}if(t==="utf-16be"){let o=[];for(let i=0;i>8&255,e&255)}return o}return[...n].map(o=>o.charCodeAt(0))}function kte(n,t=0){let o=Number.parseInt(new Ve(6).get(n,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(o))return!1;let i=256;for(let e=t;e{DA();vte={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4}});var Gte,Fte,Lte=Ce(()=>{Gte=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],Fte=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function wJe(n){let t=n?.streamReader;if(t?.constructor?.name!=="WebStreamByobReader")return n;let{reader:o}=t,i=async()=>{await o.cancel(),o.releaseLock()};return t.close=i,t.abort=async()=>{t.interrupted=!0,await i()},n}function e2(n,t,o){if(!Number.isFinite(n)||n<0||n>t)throw new qg(`${o} has invalid size ${n} (maximum ${t} bytes)`);return n}async function gI(n,t,{maximumLength:o=en,reason:i="skip"}={}){let e=e2(t,o,i);await n.ignore(e)}async function XL(n,t,o,{maximumLength:i=t.length,reason:e="read"}={}){let a=o?.length??t.length,A=e2(a,i,e);return n.readBuffer(t,{...o,length:A})}async function DJe(n,{maximumLength:t=Ys}={}){let e=new ReadableStream({start(g){g.enqueue(n),g.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),a=[],A=0;try{for(;;){let{done:g,value:c}=await e.read();if(g)break;if(A+=c.length,A>t)throw await e.cancel(),new Error(`ZIP entry decompressed data exceeds ${t} bytes`);a.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(A),s=0;for(let g of a)r.set(g,s),s+=g.length;return r}function bJe(n,t){if(n.length=0?0:r===e?Math.min(OJe,r-1):0,c=s>=0?s:r-g;if(c===0)break;if(A+=c,A>o)throw new Error(`ZIP entry compressed data exceeds ${o} bytes`);if(t){let I=new Uint8Array(c);await n.tokenizer.readBuffer(I),a.push(I)}else await n.tokenizer.ignore(c);if(s>=0)break}if(Ci(n.tokenizer)||(n.knownSizeDescriptorScannedBytes+=A),!!t)return _Je(a,A)}function NJe(n,t){return Ci(n.tokenizer)?Math.max(0,en-(n.tokenizer.position-t)):Math.max(0,Ys-n.knownSizeDescriptorScannedBytes)}async function RJe(n,t,{shouldBuffer:o,maximumDescriptorLength:i=Ys}={}){if(t.dataDescriptor&&t.compressedSize===0)return TJe(n,{shouldBuffer:o,maximumLength:i});if(!o){await gI(n.tokenizer,t.compressedSize,{maximumLength:Ci(n.tokenizer)?Ys:n.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let e=LJe(n.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>e)throw new Error(`ZIP entry compressed data exceeds ${e} bytes`);let a=new Uint8Array(t.compressedSize);return await n.tokenizer.readBuffer(a),a}function kJe(n,t){let o=n.getReader(),i=0,e=!1,a=!1,A=async r=>{e||a||(a=!0,await o.cancel(r))};return new ReadableStream({async pull(r){if(i>=t){r.close(),await A();return}let{done:s,value:g}=await o.read();if(s||!g){e=!0,r.close();return}let c=t-i;if(g.length>c){r.enqueue(g.subarray(0,c)),i+=c,r.close(),await A();return}r.enqueue(g),i+=g.length},async cancel(r){await A(r)}})}async function tf(n,t){return new $L(t).fromBuffer(n)}function Vte(n){switch(n=n.toLowerCase(),n){case"application/epub+zip":return{ext:"epub",mime:n};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:n};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:n};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:n};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:n};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:n};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:n};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:n};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:n};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:n};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:n};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:n};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:n};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:n};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:n};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:n};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function xs(n,t,o){o={offset:0,...o};for(let[i,e]of t.entries())if(o.mask){if(e!==(o.mask[i]&n[i+o.offset]))return!1}else if(e!==n[i+o.offset])return!1;return!0}function vJe(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):ef}function PJe(n,t,o){return o===void 0?n.read(t):(o.throwIfAborted(),new Promise((i,e)=>{let a=()=>{o.removeEventListener("abort",A)},A=()=>{let r=o.reason;a(),(async()=>{try{await n.cancel(r)}catch{}})(),e(r)};o.addEventListener("abort",A,{once:!0}),(async()=>{try{let r=await n.read(t);a(),i(r)}catch(r){a(),e(r)}})()}))}function GJe(n){return Number.isFinite(n)?Math.max(0,Math.min(lJe,Math.trunc(n))):0}function FJe(n){return Number.isFinite(n)?Math.max(0,n):Number.MAX_SAFE_INTEGER}function Ci(n){let t=n.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function Af(n,t,o){return Ci(n)&&n.position-t>o}function LJe(n){let t=n.fileInfo.size,o=Number.isFinite(t)?Math.max(0,t-n.position):Number.MAX_SAFE_INTEGER;return Math.min(o,pJe)}function UJe(n){if(n instanceof kA||n instanceof qg)return!0;if(!(n instanceof Error))return!1;if(yJe.has(n.message)||SJe.has(n.code))return!0;for(let t of mJe)if(n.message.startsWith(t))return!0;return!1}function Wte(n,t=Ys){let o=[n.compressedSize,n.uncompressedSize];for(let i of o)if(!Number.isFinite(i)||i<0||i>t)return!1;return!0}function HJe(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function KJe(n,t){t.startsWith("word/")&&(n.hasWordDirectory=!0),t.startsWith("ppt/")&&(n.hasPresentationDirectory=!0),t.startsWith("xl/")&&(n.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(n.hasThreeDimensionalModelEntry=!0)}function Zte(n){if(!(!n.hasContentTypesEntry||n.hasUnparseableContentTypes||n.isParsingContentTypes||n.hasParsedContentTypesEntry)){if(n.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(n.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(n.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(n.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function xJe(n){let t=n.indexOf('.main+xml"');if(t===-1){let e="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return n.includes(`ContentType="${e}"`)?e:void 0}let o=n.slice(0,t),i=o.lastIndexOf('"');return o.slice(i+1)}var ef,lJe,Ys,Ute,pJe,en,rO,Hte,dJe,hJe,Kte,ZL,xte,Yte,EJe,CJe,uJe,BJe,fJe,jte,Jte,qte,QJe,zte,yJe,mJe,SJe,qg,Xte,tO,OJe,$L,YJe,jJe,$te=Ce(()=>{DA();VD();Nte();$B();Pte();Lte();ef=4100,lJe=ef-2,Ys=1024*1024,Ute=1024,pJe=2**31-1,en=16*1024*1024,rO=Ys,Hte=Ys,dJe=en,hJe=1,Kte=100,ZL=en,xte=64,Yte=rO,EJe=256,CJe=512,uJe=en,BJe=512,fJe=512,jte=256,Jte=rO,qte=rO,QJe=rO,zte=en,yJe=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),mJe=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],SJe=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),qg=class extends Error{};Xte=134695760,tO=16,OJe=tO-1;Yl.prototype.inflate=async function(n,t,o){if(n.compressedMethod===0)return o(t);if(n.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${n.compressedMethod}`);let i=await DJe(t,{maximumLength:Ys});return o(i)};Yl.prototype.unzip=async function(n){let t=!1,o=0,i=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Af(this.tokenizer,i,en))throw new qg(`ZIP stream probing exceeds ${en} bytes`);let e=await this.readLocalFileHeader();if(!e)break;if(o++,o>Ute)throw new Error(`ZIP entry count exceeds ${Ute}`);let a=n(e);t=!!a.stop,await this.tokenizer.ignore(e.extraFieldLength);let A=await RJe(this,e,{shouldBuffer:!!a.handler,maximumDescriptorLength:Math.min(Ys,NJe(this,i))});if(a.handler&&await this.inflate(e,A,a.handler),e.dataDescriptor){let r=new Uint8Array(tO);if(await this.tokenizer.readBuffer(r),Le.get(r,0)!==Xte)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-r.length}`)}if(Af(this.tokenizer,i,en))throw new qg(`ZIP stream probing exceeds ${en} bytes`)}while(!t)};$L=class n{constructor(t){let o=GJe(t?.mpegOffsetTolerance);this.options={...t,mpegOffsetTolerance:o},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(t){return wJe(qD(t,this.getTokenizerOptions()))}async parseTokenizer(t,o=0){this.detectionReentryCount=o;let i=t.position;for(let e of this.detectors){let a;try{a=await e.detect(t)}catch(A){if(A instanceof kA||A instanceof qg)return;throw A}if(a)return a;if(i!==t.position)return}}async fromTokenizer(t){try{return await this.parseTokenizer(t)}finally{await t.close()}}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``);let o=t instanceof Uint8Array?t:new Uint8Array(t);if(o?.length>1)return this.fromTokenizer(Co(o,this.getTokenizerOptions()))}async fromBlob(t){this.options.signal?.throwIfAborted();let o=zD(t,this.getTokenizerOptions());return this.fromTokenizer(o)}async fromStream(t){this.options.signal?.throwIfAborted();let o=this.createTokenizerFromWebStream(t);return this.fromTokenizer(o)}async toDetectionStream(t,o){let i=vJe(o?.sampleSize??ef),e,a,A=t.getReader({mode:"byob"});try{let{value:g,done:c}=await PJe(A,new Uint8Array(i),this.options.signal);if(a=g,!c&&g)try{e=await this.fromBuffer(g.subarray(0,i))}catch(I){if(!(I instanceof kA))throw I;e=void 0}a=g}finally{A.releaseLock()}let r=new TransformStream({async start(g){g.enqueue(a)},transform(g,c){c.enqueue(g)}}),s=t.pipeThrough(r);return s.fileType=e,s}async detectGzip(t){if(this.gzipProbeDepth>=hJe)return{ext:"gz",mime:"application/gzip"};let o=new ZB(t),i=kJe(o.inflate(),dJe),e=Ci(t),a,A,r,s;if(e){let g=new AbortController;a=setTimeout(()=>{g.abort(new DOMException(`Operation timed out after ${Kte} ms`,"TimeoutError"))},Kte),A=this.options.signal===void 0?g.signal:AbortSignal.any([this.options.signal,g.signal]),r=new n({...this.options,signal:A}),r.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{s=await(r??this).fromStream(i)}catch(g){if(g?.name==="AbortError"&&A?.reason?.name!=="TimeoutError")throw g}finally{clearTimeout(a),e||this.gzipProbeDepth--}return s?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(t,o){return xs(this.buffer,t,o)}checkString(t,o){return this.check(Rte(t,o?.encoding),o)}detectConfident=async t=>{if(this.buffer=new Uint8Array(ef),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t,Ci(t)&&(await t.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(t);if(await t.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=jte?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(t));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(t);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await gI(t,6,{maximumLength:6,reason:"ID3 header prefix"});let o=await t.readToken(vte),i=Ci(t);if(!Number.isFinite(o)||o<0||i&&(o>ZL||t.position+o>ZL))return;if(t.position+o>t.fileInfo.size)return i?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await gI(t,o,{maximumLength:i?ZL:t.fileInfo.size,reason:"ID3 payload"})}catch(e){if(e instanceof kA)return;throw e}return this.detectionReentryCount>=jte?void 0:(this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let o,i=HJe();try{await new Yl(t).unzip(e=>{KJe(i,e.filename);let a=e.filename==="[Content_Types].xml",A=Zte(i);if(!a&&A)return o=A,{stop:!0};switch(e.filename){case"META-INF/mozilla.rsa":return o={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return o={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return Wte(e,Hte)?{async handler(r){let s=new TextDecoder("utf-8").decode(r).trim();o=Vte(s)},stop:!0}:{};case"[Content_Types].xml":return i.hasContentTypesEntry=!0,Wte(e,Hte)?(i.isParsingContentTypes=!0,{async handler(r){let s=new TextDecoder("utf-8").decode(r),g=xJe(s);g&&(o=Vte(g)),i.hasParsedContentTypesEntry=!0,i.isParsingContentTypes=!1},stop:!0}):(i.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(o={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(e){if(!UJe(e))throw e;i.isParsingContentTypes&&(i.isParsingContentTypes=!1,i.hasUnparseableContentTypes=!0)}return o??Zte(i)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let o=new Uint8Array(8);return await t.readBuffer(o),xs(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:xs(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:xs(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:xs(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:xs(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:xs(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let o=await this.readTiffHeader(!1);if(o)return o}if(this.check([77,77])){let o=await this.readTiffHeader(!0);if(o)return o}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function o(){let s=await t.peekNumber(QA),g=128,c=0;for(;(s&g)===0&&g!==0;)++c,g>>=1;let I=new Uint8Array(c+1);return await XL(t,I,void 0,{maximumLength:I.length,reason:"EBML field"}),I}async function i(){let s=await o(),g=await o();g[0]^=128>>g.length-1;let c=Math.min(6,g.length),I=new DataView(s.buffer),d=new DataView(g.buffer,g.length-c,c);return{id:XB(I),len:XB(d)}}async function e(s){let g=0;for(;s>0;){if(g++,g>EJe||Af(t,A,en))return;let c=t.position,I=await i();if(I.id===17026){if(I.len>xte)return;let d=e2(I.len,xte,"EBML DocType");return(await t.readToken(new Ve(d))).replaceAll(/\00.*$/g,"")}if(Ci(t)&&(!Number.isFinite(I.len)||I.len<0||I.len>Yte)||(await gI(t,I.len,{maximumLength:Ci(t)?Yte:t.fileInfo.size,reason:"EBML payload"}),--s,t.position<=c))return}}let a=await i(),A=t.position;switch(await e(a.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let o=xe.get(this.buffer,4),i=LA.get(this.buffer,6);if(o>0&&o<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(i>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("=1e3&&o<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!"))return await t.ignore(8),await t.readToken(new Ve(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[` `,"\r"," "," ","\0"].some(o=>this.checkString(o,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let o={ext:"png",mime:"image/png"},i={ext:"apng",mime:"image/apng"};await t.ignore(8);async function e(){return{length:await t.readToken(Ei),type:await t.readToken(new Ve(4,"latin1"))}}let a=Ci(t),A=t.position,r=0,s=!1;do{if(r++,r>CJe||Af(t,A,uJe))break;let g=t.position,c=await e();if(c.length<0)return;if(c.type==="IHDR"){if(c.length!==13)return;s=!0}switch(c.type){case"IDAT":return o;case"acTL":return i;default:if(!s&&c.type!=="CgBI")return;if(a&&c.length>Jte)return s&&MJe(c.type)?o:void 0;try{await gI(t,c.length+4,{maximumLength:a?Jte+4:t.fileInfo.size,reason:"PNG chunk payload"})}catch(I){if(!a&&(I instanceof qg||I instanceof kA))return o;throw I}}if(t.position<=g)break}while(t.position+8BJe||Af(t,a,en)));){let r=t.position,s=await i(),g=s.size-24;if(!Number.isFinite(g)||g<0){o=!0;break}if(xs(s.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let c=new Uint8Array(16);if(g-=await XL(t,c,void 0,{maximumLength:c.length,reason:"ASF stream type GUID"}),xs(c,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(xs(c,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(e&&g>qte){o=!0;break}if(await gI(t,g,{maximumLength:e?qte:t.fileInfo.size,reason:"ASF header payload"}),t.position<=r){o=!0;break}}}catch(i){if(i instanceof kA||i instanceof qg)Ci(t)&&(o=!0);else throw i}return o?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await t.ignore(20),await t.readToken(new Ve(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("=16){let o=new DataView(this.buffer.buffer).getUint32(12,!0);if(o>12&&this.buffer.length>=o+16)try{let i=new TextDecoder().decode(this.buffer.subarray(16,o+16));if(JSON.parse(i).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await t.peekBuffer(this.buffer,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&kte(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let o="utf-16le";return this.checkString("{this.buffer=new Uint8Array(ef);let o=FJe(t.fileInfo.size);if(await t.peekBuffer(this.buffer,{length:Math.min(8,o),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,o),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let i=0;i<=this.options.mpegOffsetTolerance;++i){let e=this.scanMpeg(i);if(e)return e}};async readTiffTag(t){let o=await this.tokenizer.readToken(t?LA:SA);switch(await this.tokenizer.ignore(10),o){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let o=await this.tokenizer.readToken(t?LA:SA);if(!(o>fJe)&&!(Ci(this.tokenizer)&&2+o*12>zte))for(let i=0;i=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(e>=8){let r=(t?LA:SA).get(this.buffer,8),s=(t?LA:SA).get(this.buffer,10);if(r===28&&s===254||r===31&&s===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(Ci(this.tokenizer)&&e>QJe)return o;let a=Ci(this.tokenizer)?zte:this.tokenizer.fileInfo.size;try{await gI(this.tokenizer,e,{maximumLength:a,reason:"TIFF IFD offset"})}catch(r){if(r instanceof kA)return;throw r}let A;try{A=await this.readTiffIFD(t)}catch(r){if(r instanceof kA)return;throw r}return A??o}if(i===43)return o}scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]}))return this.check([8],{offset:t+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},YJe=new Set(Gte),jJe=new Set(Fte)});var A2=Ce(()=>{Xo();$te()});var ore=$(aO=>{"use strict";Object.defineProperty(aO,"__esModule",{value:!0});aO.format=VJe;aO.parse=WJe;var JJe=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,Are=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,qJe=/[\\"]/g,zJe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,tre=(()=>{let n=function(){};return n.prototype=Object.create(null),n})();function VJe(n){let{type:t,parameters:o}=n;if(!t||!zJe.test(t))throw new TypeError(`Invalid type: ${t}`);let i=t;if(o)for(let e of Object.keys(o)){if(!Are.test(e))throw new TypeError(`Invalid parameter name: ${e}`);i+=`; ${e}=${Aqe(o[e])}`}return i}function WJe(n,t){let o=t?.comma===!0?$Je:65536,i=n.length,e=r2(n,t?.start??0,i),a=e;e=t2(n,e,i,o);let A=a2(n,a,e),r=n.slice(a,A).toLowerCase();return t?.parameters===!1?{type:r,index:e,parameters:new tre}:eqe(n,r,e,i,o)}var rre=32,are=9,ire=59,ZJe=61,ere=34,XJe=92,$Je=44;function eqe(n,t,o,i,e){let a=new tre;e:for(;ot;){let i=n.charCodeAt(o-1);if(i!==rre&&i!==are)break;o--}return o}function Aqe(n){if(Are.test(n))return n;if(JJe.test(n))return`"${n.replace(qJe,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${n}`)}});function nre(n){if(!tqe.test(n))throw new TypeError(`Invalid media type: ${n}`);let t=n.indexOf("/"),o=n.slice(0,t).toLowerCase(),i=n.slice(t+1).toLowerCase(),e,a=i.lastIndexOf("+");return a!==-1&&(e=i.slice(a+1),i=i.slice(0,a)),{type:o,subtype:i,suffix:e}}var tqe,sre=Ce(()=>{tqe=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/});var gre,pa,i2,o2=Ce(()=>{gre={10:"shot",20:"scene",30:"track",40:"part",50:"album",60:"edition",70:"collection"},pa={video:1,audio:2,complex:3,logo:4,subtitle:17,button:18,control:32},i2={[pa.video]:"video",[pa.audio]:"audio",[pa.complex]:"complex",[pa.logo]:"logo",[pa.subtitle]:"subtitle",[pa.button]:"button",[pa.control]:"control"}});var vh,cI,II,n2,An,jl,Qt,er=Ce(()=>{vh=n=>class extends Error{constructor(o){super(o),this.name=n}},cI=class extends vh("CouldNotDetermineFileTypeError"){},II=class extends vh("UnsupportedFileTypeError"){},n2=class extends vh("UnexpectedFileContentError"){constructor(t,o){super(o),this.fileType=t}toString(){return`${this.name} (FileType: ${this.fileType}): ${this.message}`}},An=class extends vh("FieldDecodingError"){},jl=class extends vh("InternalParserError"){},Qt=n=>class extends n2{constructor(t){super(n,t)}}});function GA(n,t,o){return(n[t]&1<>a;let r=8-a,s=i-r;return s<0?A>>=8-a-i:s>0&&(A<<=s,A|=ZA(n,t,o+r,s)),A}function Ta(n,t,o){return ZA(n,t,o,1)===1}function Ire(n){let t=[];for(let o=0,i=n.length;oo.trim().toLowerCase());if(t.length>=1){let o=Number.parseFloat(t[0]);return t.length===2&&t[1]==="db"?{dB:o,ratio:aqe(o)}:{dB:rqe(o),ratio:o}}}function s2(n){if(n.length===0)throw new Error("decodeUintBE: empty Uint8Array");let t=new DataView(n.buffer,n.byteOffset,n.byteLength);return XB(t)}var Ar=Ce(()=>{DA();er();$B()});var Ph,Gh,Fh,g2,rf,c2,Lh,oO,I2,lI=Ce(()=>{DA();Ar();Ph={0:"Other",1:"32x32 pixels 'file icon' (PNG only)",2:"Other file icon",3:"Cover (front)",4:"Cover (back)",5:"Leaflet page",6:"Media (e.g. label side of CD)",7:"Lead artist/lead performer/soloist",8:"Artist/performer",9:"Conductor",10:"Band/Orchestra",11:"Composer",12:"Lyricist/text writer",13:"Recording Location",14:"During recording",15:"During performance",16:"Movie/video screen capture",17:"A bright coloured fish",18:"Illustration",19:"Band/artist logotype",20:"Publisher/Studio logotype"},Gh={other:0,lyrics:1,text:2,movement_part:3,events:4,chord:5,trivia_pop:6},Fh={notSynchronized:0,mpegFrameNumber:1,milliseconds:2},g2={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4},rf={len:10,get:(n,t)=>({fileIdentifier:new Ve(3,"ascii").get(n,t),version:{major:Us.get(n,t+3),revision:Us.get(n,t+4)},flags:{unsynchronisation:GA(n,t+5,7),isExtendedHeader:GA(n,t+5,6),expIndicator:GA(n,t+5,5),footer:GA(n,t+5,4)},size:g2.get(n,t+6)})},c2={len:10,get:(n,t)=>({size:xe.get(n,t),extendedFlags:LA.get(n,t+4),sizeOfPadding:xe.get(n,t+6),crcDataPresent:GA(n,t+4,31)})},Lh={len:1,get:(n,t)=>{switch(n[t]){case 0:return{encoding:"latin1"};case 1:return{encoding:"utf-16le",bom:!0};case 2:return{encoding:"utf-16be",bom:!1};case 3:return{encoding:"utf8",bom:!1};default:return{encoding:"utf8",bom:!1}}}},oO={len:4,get:(n,t)=>({encoding:Lh.get(n,t),language:new Ve(3,"latin1").get(n,t+1)})},I2={len:6,get:(n,t)=>{let o=oO.get(n,t);return{encoding:o.encoding,language:o.language,timeStampFormat:QA.get(n,t+4),contentType:QA.get(n,t+5)}}}});var Jl=Ce(()=>{o2();lI()});function pre(n){return nO[n]&&!nO[n].multiple}function dre(n){return!nO[n].multiple||nO[n].unique||!1}var AA,nO,hre=Ce(()=>{AA={multiple:!1},nO={year:AA,track:AA,disk:AA,title:AA,artist:AA,artists:{multiple:!0,unique:!0},albumartist:AA,albumartists:{multiple:!0,unique:!0},album:AA,date:AA,originaldate:AA,originalyear:AA,releasedate:AA,comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!1,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:AA,subtitle:{multiple:!0},discsubtitle:AA,totaltracks:AA,totaldiscs:AA,compilation:AA,rating:{multiple:!0},bpm:AA,mood:AA,media:AA,catalognumber:{multiple:!0,unique:!0},tvShow:AA,tvShowSort:AA,tvSeason:AA,tvEpisode:AA,tvEpisodeId:AA,tvNetwork:AA,podcast:AA,podcasturl:AA,releasestatus:AA,releasetype:{multiple:!0},releasecountry:AA,script:AA,language:AA,copyright:AA,license:AA,encodedby:AA,encodersettings:AA,gapless:AA,barcode:AA,isrc:{multiple:!0},asin:AA,musicbrainz_recordingid:AA,musicbrainz_trackid:AA,musicbrainz_albumid:AA,musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:AA,musicbrainz_workid:AA,musicbrainz_trmid:AA,musicbrainz_discid:AA,acoustid_id:AA,acoustid_fingerprint:AA,musicip_puid:AA,musicip_fingerprint:AA,website:AA,"performer:instrument":{multiple:!0,unique:!0},averageLevel:AA,peakLevel:AA,notes:{multiple:!0,unique:!1},key:AA,originalalbum:AA,originalartist:AA,discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:AA,discogs_label_id:AA,discogs_master_release_id:AA,discogs_votes:AA,discogs_rating:AA,replaygain_track_peak:AA,replaygain_track_gain:AA,replaygain_album_peak:AA,replaygain_album_gain:AA,replaygain_track_minmax:AA,replaygain_album_minmax:AA,replaygain_undo:AA,description:{multiple:!0},longDescription:AA,category:{multiple:!0},hdVideo:AA,keywords:{multiple:!0},movement:AA,movementIndex:AA,movementTotal:AA,podcastId:AA,showMovement:AA,stik:AA,playCounter:AA}});var hr,zg=Ce(()=>{hr=class{static toIntOrNull(t){let o=Number.parseInt(t,10);return Number.isNaN(o)?null:o}static normalizeTrack(t){let o=t.toString().split("/");return{no:Number.parseInt(o[0],10)||null,of:Number.parseInt(o[1],10)||null}}constructor(t,o){this.tagTypes=t,this.tagMap=o}mapGenericTag(t,o){t={id:t.id,value:t.value},this.postMap(t,o);let i=this.getCommonName(t.id);return i?{id:i,value:t.value}:null}getCommonName(t){return this.tagMap[t]}postMap(t,o){}};hr.maxRatingScore=1});var iqe,sO,Ere=Ce(()=>{zg();iqe={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"},sO=class extends hr{constructor(){super(["ID3v1"],iqe)}}});var rn,Uh=Ce(()=>{zg();rn=class extends hr{constructor(t,o){let i={};for(let e of Object.keys(o))i[e.toUpperCase()]=o[e];super(t,i)}getCommonName(t){return this.tagMap[t.toUpperCase()]}}});var oqe,gO,Cre=Ce(()=>{DA();zg();Uh();Ar();oqe={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer",USLT:"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode","TXXX:ISRC":"isrc",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"releasedate",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl",GRP1:"grouping",PCNT:"playCounter"},gO=class n extends rn{static toRating(t){return{source:t.email,rating:t.rating>0?(t.rating-1)/254*hr.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],oqe)}postMap(t,o){switch(t.id){case"UFID":{let i=t.value;i.owner_identifier==="http://musicbrainz.org"&&(t.id+=`:${i.owner_identifier}`,t.value=da(i.identifier,"latin1"))}break;case"PRIV":{let i=t.value;switch(i.owner_identifier){case"AverageLevel":case"PeakValue":t.id+=`:${i.owner_identifier}`,t.value=i.data.length===4?Le.get(i.data,0):null,t.value===null&&o.addWarning("Failed to parse PRIV:PeakValue");break;default:o.addWarning(`Unknown PRIV owner-identifier: ${i.data}`)}}break;case"POPM":t.value=n.toRating(t.value);break;default:break}}}});var nqe,cO,ure=Ce(()=>{zg();nqe={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"},cO=class n extends hr{static toRating(t){return{rating:Number.parseFloat(t+1)/5}}constructor(){super(["asf"],nqe)}postMap(t){switch(t.id){case"WM/SharedUserRating":{let o=t.id.split(":");t.value=n.toRating(t.value),t.id=o[0];break}}}}});var sqe,IO,Bre=Ce(()=>{Uh();sqe={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"originalalbum",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm",GP1:"grouping"},IO=class extends rn{constructor(){super(["ID3v2.2"],sqe)}}});var gqe,lO,fre=Ce(()=>{Uh();gqe={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Releasedate:"releasedate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"},lO=class extends rn{constructor(){super(["APEv2"],gqe)}}});var cqe,Iqe,af,Qre=Ce(()=>{Uh();cqe={"\xA9nam":"title","\xA9ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","\xA9alb":"album","\xA9day":"date","\xA9cmt":"comment","\xA9com":"comment",trkn:"track",disk:"disk","\xA9gen":"genre",covr:"picture","\xA9wrt":"composer","\xA9lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","\xA9grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","\xA9cpy":"copyright","----:com.apple.iTunes:LICENSE":"license","\xA9too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear","----:com.apple.iTunes:RELEASEDATE":"releasedate",desc:"description",ldes:"longDescription","\xA9mvn":"movement","\xA9mvi":"movementIndex","\xA9mvc":"movementTotal","\xA9wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik",rate:"rating"},Iqe="iTunes",af=class extends rn{constructor(){super([Iqe],cqe)}postMap(t,o){switch(t.id){case"rate":t.value={source:void 0,rating:Number.parseFloat(t.value)/100};break}}}});var lqe,pO,yre=Ce(()=>{zg();lqe={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",RELEASEDATE:"releasedate",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",KEY:"key",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"},pO=class n extends hr{static toRating(t,o,i){return{source:t?t.toLowerCase():void 0,rating:Number.parseFloat(o)/i*hr.maxRatingScore}}constructor(){super(["vorbis"],lqe)}postMap(t){if(t.id==="RATING")t.value=n.toRating(void 0,t.value,100);else if(t.id.indexOf("RATING:")===0){let o=t.id.split(":");t.value=n.toRating(o[1],t.value,1),t.id=o[0]}}}});var pqe,dO,mre=Ce(()=>{zg();pqe={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",IPRT:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"},dO=class extends hr{constructor(){super(["exif"],pqe)}}});var dqe,hO,Sre=Ce(()=>{Uh();dqe={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:DATE_RELEASED":"releasedate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"},hO=class extends rn{constructor(){super(["matroska"],dqe)}}});var hqe,EO,wre=Ce(()=>{zg();hqe={NAME:"title",AUTH:"artist","(c) ":"copyright",ANNO:"comment"},EO=class extends hr{constructor(){super(["AIFF"],hqe)}}});var CO,Dre=Ce(()=>{Ere();Cre();ure();Bre();fre();Qre();yre();mre();Sre();wre();er();CO=class{constructor(){this.tagMappers={},[new sO,new IO,new gO,new af,new af,new pO,new lO,new cO,new dO,new hO,new EO].forEach(t=>{this.registerTagMapper(t)})}mapTag(t,o,i){if(this.tagMappers[t])return this.tagMappers[t].mapGenericTag(o,i);throw new jl(`No generic tag mapper defined for tag-format: ${t}`)}registerTagMapper(t){for(let o of t.tagTypes)this.tagMappers[o]=t}}});function Ore(n){return l2.test(n)?Cqe(n):Eqe(n)}function Eqe(n){return{contentType:Gh.lyrics,timeStampFormat:Fh.notSynchronized,text:n.trim(),syncText:[]}}function Cqe(n){let t=n.split(` -`),o=[];for(let i of t){let e=i.match(l2);if(e){let a=Number.parseInt(e[1],10),A=Number.parseInt(e[2],10),r=e[3].length===3?Number.parseInt(e[3],10):Number.parseInt(e[3],10)*10,s=(a*60+A)*1e3+r,g=i.replace(l2,"").trim();o.push({timestamp:s,text:g})}}return{contentType:Gh.lyrics,timeStampFormat:Fh.milliseconds,text:o.map(i=>i.text).join(` -`),syncText:o}}var l2,bre=Ce(()=>{Jl();l2=/\[(\d{2}):(\d{2})\.(\d{2,3})]/});function Bqe(n){return n.length>2?`${n.slice(0,n.length-1).join(", ")} & ${n[n.length-1]}`:n.join(" & ")}var Mre,ql,uqe,uO,_re=Ce(()=>{Jl();Mre=qe(ct(),1);hre();Dre();zg();Ar();A2();bre();ql=(0,Mre.default)("music-metadata:collector"),uqe=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","AIFF","ID3v1"],uO=class{constructor(t){this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null},movementIndex:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new CO,this.opts=t;let o=1;for(let i of uqe)this.originPriority[i]=o++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(t){ql(`streamInfo: type=${t.type?i2[t.type]:"?"}, codec=${t.codecName}`),this.format.trackInfo.push(t)}setFormat(t,o){ql(`format: ${t} = ${o}`),this.format[t]=o,this.opts?.observer&&this.opts.observer({metadata:this,tag:{type:"format",id:t,value:o}})}setAudioOnly(){this.setFormat("hasAudio",!0),this.setFormat("hasVideo",!1)}async addTag(t,o,i){ql(`tag ${t}.${o} = ${i}`),this.native[t]||(this.format.tagTypes.push(t),this.native[t]=[]),this.native[t].push({id:o,value:i}),await this.toCommon(t,o,i)}addWarning(t){this.quality.warnings.push({message:t})}async postMap(t,o){switch(o.id){case"artist":return this.handleSingularArtistTag(t,o,"artist","artists");case"albumartist":return this.handleSingularArtistTag(t,o,"albumartist","albumartists");case"artists":return this.handlePluralArtistTag(t,o,"artist","artists");case"albumartists":return this.handlePluralArtistTag(t,o,"albumartist","albumartists");case"picture":return this.postFixPicture(o.value).then(i=>{i!==null&&(o.value=i,this.setGenericTag(t,o))});case"totaltracks":this.common.track.of=hr.toIntOrNull(o.value);return;case"totaldiscs":this.common.disk.of=hr.toIntOrNull(o.value);return;case"movementTotal":this.common.movementIndex.of=hr.toIntOrNull(o.value);return;case"track":case"disk":case"movementIndex":{let i=this.common[o.id].of;this.common[o.id]=hr.normalizeTrack(o.value),this.common[o.id].of=i??this.common[o.id].of;return}case"bpm":case"year":case"originalyear":o.value=Number.parseInt(o.value,10);break;case"date":{let i=Number.parseInt(o.value.substr(0,4),10);Number.isNaN(i)||(this.common.year=i);break}case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":o.value=typeof o.value=="string"?Number.parseInt(o.value,10):o.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":o.value=lre(o.value);break;case"replaygain_track_minmax":o.value=o.value.split(",").map(i=>Number.parseInt(i,10));break;case"replaygain_undo":{let i=o.value.split(",").map(e=>Number.parseInt(e,10));o.value={leftChannel:i[0],rightChannel:i[1]};break}case"gapless":case"compilation":case"podcast":case"showMovement":o.value=o.value==="1"||o.value===1;break;case"isrc":{let i=this.common[o.id];if(i&&i.indexOf(o.value)!==-1)return;break}case"comment":typeof o.value=="string"&&(o.value={text:o.value}),o.value.descriptor==="iTunPGAP"&&this.setGenericTag(t,{id:"gapless",value:o.value.text==="1"});break;case"lyrics":typeof o.value=="string"&&(o.value=Ore(o.value));break;default:}o.value!==null&&this.setGenericTag(t,o)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}handleSingularArtistTag(t,o,i,e){if(this.commonOrigin[i]===this.originPriority[t])return this.postMap("artificial",{id:e,value:o.value});this.common[e]||this.setGenericTag("artificial",{id:e,value:o.value}),this.setGenericTag(t,o)}handlePluralArtistTag(t,o,i,e){if((!this.common[i]||this.commonOrigin[i]===this.originPriority.artificial)&&(!this.common[e]||this.common[e].indexOf(o.value)===-1)){let a=(this.common[e]||[]).concat([o.value]),A=Bqe(a);this.setGenericTag("artificial",{id:i,value:A})}this.setGenericTag(t,o)}async postFixPicture(t){if(t.data&&t.data.length>0){if(!t.format){let o=await tf(Uint8Array.from(t.data));if(o)t.format=o.mime;else return null}switch(t.format=t.format.toLocaleLowerCase(),t.format){case"image/jpg":t.format="image/jpeg"}return t}return this.addWarning("Empty picture tag found"),null}async toCommon(t,o,i){let e={id:o,value:i},a=this.tagMapper.mapTag(t,e,this);a&&await this.postMap(t,a)}setGenericTag(t,o){ql(`common.${o.id} = ${o.value}`);let i=this.commonOrigin[o.id]||1e3,e=this.originPriority[t];if(pre(o.id))if(e<=i)this.common[o.id]=o.value,this.commonOrigin[o.id]=e;else return ql(`Ignore native tag (singleton): ${t}.${o.id} = ${o.value}`);else if(e===i)!dre(o.id)||this.common[o.id].indexOf(o.value)===-1?this.common[o.id].push(o.value):ql(`Ignore duplicate value: ${t}.${o.id} = ${o.value}`);else if(e{kt=class{constructor(t,o,i){this.metadata=t,this.tokenizer=o,this.options=i}}});var fqe,rt,ui=Ce(()=>{Fs();Ar();er();fqe=/^[\x21-\x7e©][\x20-\x7e\x00()]{3}/,rt={len:4,get:(n,t)=>{let o=br(n.subarray(t,t+rt.len),"latin1");if(!o.match(fqe))throw new An(`FourCC contains invalid characters: ${Ire(o)} "${o}"`);return o},put:(n,t,o)=>{let i=mte(o,"latin1");if(i.length!==4)throw new jl("Invalid length");return n.set(i,t),t+4}}});function Nre(n){return{containsHeader:BO(n,31),containsFooter:BO(n,30),isHeader:BO(n,29),readOnly:BO(n,0),dataType:(n&6)>>1}}function BO(n,t){return(n&1<{DA();ui();of={text_utf8:0,binary:1,external_info:2,reserved:3},p2={len:52,get:(n,t)=>({ID:rt.get(n,t),version:Le.get(n,t+4)/1e3,descriptorBytes:Le.get(n,t+8),headerBytes:Le.get(n,t+12),seekTableBytes:Le.get(n,t+16),headerDataBytes:Le.get(n,t+20),apeFrameDataBytes:Le.get(n,t+24),apeFrameDataBytesHigh:Le.get(n,t+28),terminatingDataBytes:Le.get(n,t+32),fileMD5:new Ot(16).get(n,t+36)})},Tre={len:24,get:(n,t)=>({compressionLevel:SA.get(n,t),formatFlags:SA.get(n,t+2),blocksPerFrame:Le.get(n,t+4),finalFrameBlocks:Le.get(n,t+8),totalFrames:Le.get(n,t+12),bitsPerSample:SA.get(n,t+16),channel:SA.get(n,t+18),sampleRate:Le.get(n,t+20)})},Vi={len:32,get:(n,t)=>({ID:new Ve(8,"ascii").get(n,t),version:Le.get(n,t+8),size:Le.get(n,t+12),fields:Le.get(n,t+16),flags:Nre(Le.get(n,t+20))})},fO={len:8,get:(n,t)=>({size:Le.get(n,t),flags:Nre(Le.get(n,t+4))})}});var Gre={};Fr(Gre,{APEv2Parser:()=>dI,ApeContentError:()=>Hh,tryParseApeHeader:()=>zl});function zl(n,t,o){return new dI(n,t,o).tryParseApeHeader()}var Pre,pI,kre,vre,Hh,dI,Vl=Ce(()=>{Pre=qe(ct(),1);Xo();DA();Ar();zi();Rre();er();Fs();pI=(0,Pre.default)("music-metadata:parser:APEv2"),kre="APEv2",vre="APETAGEX",Hh=class extends Qt("APEv2"){};dI=class n extends kt{constructor(){super(...arguments),this.ape={}}static calculateDuration(t){let o=t.totalFrames>1?t.blocksPerFrame*(t.totalFrames-1):0;return o+=t.finalFrameBlocks,o/t.sampleRate}static async findApeFooterOffset(t,o){let i=new Uint8Array(Vi.len),e=t.position;if(o<=Vi.len){pI(`Offset is too small to read APE footer: offset=${o}`);return}if(o>Vi.len){await t.readBuffer(i,{position:o-Vi.len}),t.setPosition(e);let a=Vi.get(i,0);if(a.ID==="APETAGEX")return a.flags.isHeader?pI(`APE Header found at offset=${o-Vi.len}`):(pI(`APE Footer found at offset=${o-Vi.len}`),o-=a.size),{footer:a,offset:o}}}static parseTagFooter(t,o,i){let e=Vi.get(o,o.length-Vi.len);if(e.ID!==vre)throw new Hh("Unexpected APEv2 Footer ID preamble value");return Co(o),new n(t,Co(o),i).parseTags(e)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position0?this.parseDescriptorExpansion(o):this.parseHeader());return this.metadata.setAudioOnly(),await this.tokenizer.ignore(i.forwardBytes),this.tryParseApeHeader()}async parseTags(t){let o=new Uint8Array(256),i=t.size-Vi.len;pI(`Parse APE tags at offset=${this.tokenizer.position}, size=${i}`);for(let e=0;ethis.metadata.addTag(kre,r,c)));break}case of.binary:if(this.options.skipCovers)await this.tokenizer.ignore(a.size);else{let s=new Uint8Array(a.size);await this.tokenizer.readBuffer(s),A=js(s);let g=br(s.subarray(0,A),"utf-8"),c=s.subarray(A+1);await this.metadata.addTag(kre,r,{description:g,data:c})}break;case of.external_info:pI(`Ignore external info ${r}`),await this.tokenizer.ignore(a.size);break;case of.reserved:pI(`Ignore external info ${r}`),this.metadata.addWarning(`APEv2 header declares a reserved datatype for "${r}"`),await this.tokenizer.ignore(a.size);break}}}async parseDescriptorExpansion(t){return await this.tokenizer.ignore(t),this.parseHeader()}async parseHeader(){let t=await this.tokenizer.readToken(Tre);if(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("container","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),this.metadata.setFormat("numberOfChannels",t.channel),this.metadata.setFormat("duration",n.calculateDuration(t)),!this.ape.descriptor)throw new Hh("Missing APE descriptor");return{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}}});async function Lre(n){if(n.fileInfo.size>=128){let t=new Uint8Array(3),o=n.position;return await n.readBuffer(t,{position:n.fileInfo.size-128}),n.setPosition(o),br(t,"latin1")==="TAG"}return!1}var Fre,QO,Kh,yO,hI,mO,nf=Ce(()=>{Fre=qe(ct(),1);DA();Ar();zi();Vl();Fs();QO=(0,Fre.default)("music-metadata:parser:ID3v1"),Kh=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"],yO={len:128,get:(n,t)=>{let o=new hI(3).get(n,t);return o==="TAG"?{header:o,title:new hI(30).get(n,t+3),artist:new hI(30).get(n,t+33),album:new hI(30).get(n,t+63),year:new hI(4).get(n,t+93),comment:new hI(28).get(n,t+97),zeroByte:QA.get(n,t+127),track:QA.get(n,t+126),genre:QA.get(n,t+127)}:null}},hI=class{constructor(t){this.len=t,this.stringType=new Ve(t,"latin1")}get(t,o){let i=this.stringType.get(t,o);return i=iO(i),i=i.trim(),i.length>0?i:void 0}},mO=class n extends kt{constructor(t,o,i){super(t,o,i),this.apeHeader=i.apeHeader}static getGenre(t){if(tt){QO("Already consumed the last 128 bytes");return}let o=await this.tokenizer.readToken(yO,t);if(o){QO("ID3v1 header found at: pos=%s",this.tokenizer.fileInfo.size-yO.len);let i=["title","artist","album","comment","track","year"];for(let a of i)o[a]&&o[a]!==""&&await this.addTag(a,o[a]);let e=n.getGenre(o.genre);e&&await this.addTag("genre",e)}else QO("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-yO.len)}async addTag(t,o){await this.metadata.addTag("ID3v1",t,o)}}});var d2,Ure=Ce(()=>{DA();d2={len:16,get:(n,t)=>{let o=xe.get(n,t+8),i=xe.get(n,t+12);return{startTime:xe.get(n,t),endTime:xe.get(n,t+4),startOffset:o===4294967295?void 0:o,endOffset:i===4294967295?void 0:i}}}});function sf(n){switch(n){case 2:return 6;case 3:case 4:return 10;default:throw Hre(n)}}function Qqe(n,t){return t===3?{status:{tag_alter_preservation:GA(n,0,7),file_alter_preservation:GA(n,0,6),read_only:GA(n,0,5)},format:{compression:GA(n,1,7),encryption:GA(n,1,6),grouping_identity:GA(n,1,5),unsynchronisation:!1,data_length_indicator:!1}}:{status:{tag_alter_preservation:GA(n,0,6),file_alter_preservation:GA(n,0,5),read_only:GA(n,0,4)},format:{grouping_identity:GA(n,1,6),compression:GA(n,1,3),encryption:GA(n,1,2),unsynchronisation:GA(n,1,1),data_length_indicator:GA(n,1,0)}}}function gf(n,t,o){switch(t){case 2:return yqe(n,t,o);case 3:case 4:return mqe(n,t,o);default:throw Hre(t)}}function yqe(n,t,o){let i={id:br(n.subarray(0,3),"ascii"),length:Pr.get(n,3)};return i.id.match(/^[A-Z0-9]{3}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${i.id}`),i}function mqe(n,t,o){let i={id:br(n.subarray(0,4),"ascii"),length:(t===4?g2:xe).get(n,4),flags:Qqe(n.subarray(8,10),t)};return i.id.match(/^[A-Z0-9]{4}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${i.id}`),i}function Hre(n){throw new EI(`Unexpected majorVer: ${n}`)}var h2=Ce(()=>{DA();Ar();lI();Fs();E2()});function Sqe(n){let t=[],o,i="";for(let e of n)if(typeof o=="string")if(e==="("&&o==="")i+="(",o=void 0;else if(e===")"){i!==""&&(t.push(i),i="");let a=Kre(o);a&&t.push(a),o=void 0}else o+=e;else e==="("?o="":i+=e;return i&&(t.length===0&&i.match(/^\d*$/)&&(i=Kre(i)),i&&t.push(i)),t}function Kre(n){if(n==="RX")return"Remix";if(n==="CR")return"Cover";if(n.match(/^\d*$/))return Kh[Number.parseInt(n,10)]}function wqe(n){throw new EI(`Unexpected majorVer: ${n}`)}var xre,SO,an,C2,wO,EI,E2=Ce(()=>{xre=qe(ct(),1);DA();Ar();lI();nf();er();Ar();Ure();h2();SO=(0,xre.default)("music-metadata:id3v2:frame-parser"),an="latin1",C2={encoding:an,bom:!1};wO=class n{constructor(t,o){this.major=t,this.warningCollector=o}readData(t,o,i){if(t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} header has empty tag type=${o}`);return}let{encoding:e,bom:a}=Lh.get(t,0),A=t.length,r=0,s=[],g=n.getNullTerminatorLength(e),c;switch(SO(`Parsing tag type=${o}, encoding=${e}, bom=${a}`),o!=="TXXX"&&o[0]==="T"?"T*":o){case"T*":case"GRP1":case"GP1":case"IPLS":case"MVIN":case"MVNM":case"PCS":case"PCST":{let I;try{I=n.trimNullPadding(da(t.subarray(1),e))}catch(d){if(d instanceof Error){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} header has invalid string value: ${d.message}`);break}throw d}switch(o){case"TMCL":case"TIPL":case"IPLS":s=n.functionList(this.splitValue(o,I));break;case"TRK":case"TRCK":case"TPOS":case"TIT1":case"TIT2":case"TIT3":s=I;break;case"TCOM":case"TEXT":case"TOLY":case"TOPE":case"TPE1":case"TSRC":s=this.splitValue(o,I);break;case"TCO":case"TCON":s=this.splitValue(o,I).map(d=>Sqe(d)).reduce((d,B)=>d.concat(B),[]);break;case"PCS":case"PCST":s=this.major>=4?this.splitValue(o,I):[I],s=Array.isArray(s)&&s[0]===""?1:0;break;default:s=this.major>=4?this.splitValue(o,I):[I]}break}case"TXXX":{let I=n.readIdentifierAndData(t.subarray(1),e);s={description:I.id,text:this.splitValue(o,da(I.data,e).replace(/\x00+$/,""))};break}case"PIC":case"APIC":if(i){let I={};switch(t=t.subarray(1),this.major){case 2:I.format=da(t.subarray(0,3),"latin1"),t=t.subarray(3);break;case 3:case 4:c=js(t,an),I.format=da(t.subarray(0,c),an),t=t.subarray(c+1);break;default:throw wqe(this.major)}I.format=n.fixPictureMimeType(I.format),I.type=Ph[t[0]],t=t.subarray(1),c=js(t,e),I.description=da(t.subarray(0,c),e),t=t.subarray(c+g),I.data=t,s=I}break;case"CNT":case"PCNT":s=s2(t);break;case"SYLT":{let I=I2.get(t,0);t=t.subarray(I2.len);let d={descriptor:"",language:I.language,contentType:I.contentType,timeStampFormat:I.timeStampFormat,syncText:[]},B=!1;for(;t.length>0;){let f=n.readNullTerminatedString(t,I.encoding);if(t=t.subarray(f.len),B){let Q=xe.get(t,0);t=t.subarray(xe.len),d.syncText.push({text:f.text,timestamp:Q})}else d.descriptor=f.text,B=!0}s=d;break}case"ULT":case"USLT":case"COM":case"COMM":{let I=oO.get(t,r);r+=oO.len;let d=n.readNullTerminatedString(t.subarray(r),I.encoding);r+=d.len;let B=n.readNullTerminatedString(t.subarray(r),I.encoding);s={language:I.language,descriptor:d.text,text:B.text};break}case"UFID":{let I=n.readIdentifierAndData(t,an);s={owner_identifier:I.id,identifier:I.data};break}case"PRIV":{let I=n.readIdentifierAndData(t,an);s={owner_identifier:I.id,data:I.data};break}case"POPM":{t=t.subarray(r);let I=n.readNullTerminatedString(t,C2),d=I.text;if(t=t.subarray(I.len),t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} POPM frame missing rating byte`),s={email:d,rating:0,counter:void 0};break}let B=QA.get(t,0),f=t.subarray(QA.len);s={email:d,rating:B,counter:f.length>0?s2(f):void 0};break}case"GEOB":{let I=Lh.get(t,0);t=t.subarray(1);let d=n.readNullTerminatedString(t,C2),B=d.text;t=t.subarray(d.len);let f=n.readNullTerminatedString(t,I),Q=f.text;t=t.subarray(f.len);let y=n.readNullTerminatedString(t,I),m=y.text;t=t.subarray(y.len),s={type:B,filename:Q,description:m,data:t};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":s=n.readNullTerminatedString(t,C2).text;break;case"WXXX":{let I=Lh.get(t,0);t=t.subarray(1);let d=n.readNullTerminatedString(t,I),B=d.text;t=t.subarray(d.len),s={description:B,url:n.trimNullPadding(da(t,an))};break}case"WFD":case"WFED":{let I=Lh.get(t,0);t=t.subarray(1),s=n.readNullTerminatedString(t,I).text;break}case"MCDI":{s=t.subarray(0,A);break}case"CHAP":{SO("Reading CHAP"),c=js(t,an);let I={label:da(t.subarray(0,c),an),info:d2.get(t,c+1),frames:new Map};for(r+=c+1+d2.len;r=a.length)return{text:da(t,o.encoding),len:e};let r=t.subarray(0,i+A);return{text:da(r,o.encoding),len:i+A+n.getNullTerminatorLength(o.encoding)}}static fixPictureMimeType(t){switch(t=t.toLocaleLowerCase(),t){case"jpg":return"image/jpeg";case"png":return"image/png"}return t}static functionList(t){let o={};for(let i=0;i+11?this.warningCollector.addWarning(`ID3v2.${this.major} ${t} uses non standard null-separator.`):i=o.split(/\//g)):i=o.split(/\x00/g),n.trimArray(i)}static trimArray(t){return t.map(o=>n.trimNullPadding(o).trim())}static trimNullPadding(t){let o=t.length;for(;o>0&&t.charCodeAt(o-1)===0;)o--;return o===t.length?t:t.slice(0,o)}static readIdentifierAndData(t,o){let i=n.readNullTerminatedString(t,{encoding:o,bom:!1});return{id:i.text,data:t.subarray(i.len)}}static getNullTerminatorLength(t){return t.startsWith("utf-16")?2:1}},EI=class extends Qt("id3v2"){}});function Dqe(n){throw new EI(`Unexpected majorVer: ${n}`)}var on,xh=Ce(()=>{DA();E2();lI();h2();on=class n{constructor(){this.tokenizer=void 0,this.id3Header=void 0,this.metadata=void 0,this.headerType=void 0,this.options=void 0}static removeUnsyncBytes(t){let o=0,i=0;for(;o0?this.parseExtendedHeaderData(o,t.size):this.parseId3Data(this.id3Header.size-t.size)}async parseExtendedHeaderData(t,o){return await this.tokenizer.ignore(t),this.parseId3Data(this.id3Header.size-o)}async parseId3Data(t){let o=await this.tokenizer.readToken(new Ot(t));for(let i of this.parseMetadata(o))switch(i.id){case"TXXX":i.value&&await this.handleTag(i,i.value.text,()=>i.value.description);break;default:await(Array.isArray(i.value)?Promise.all(i.value.map(e=>this.addTag(i.id,e))):this.addTag(i.id,i.value))}}async handleTag(t,o,i,e=a=>a){await Promise.all(o.map(a=>this.addTag(n.makeDescriptionTagName(t.id,i(a)),e(a))))}async addTag(t,o){await this.metadata.addTag(this.headerType,t,o)}parseMetadata(t){let o=0,i=[];for(;o!==t.length;){let e=sf(this.id3Header.version.major);if(o+e>t.length){this.metadata.addWarning("Illegal ID3v2 tag length");break}let a=t.subarray(o,o+e);o+=e;let A=gf(a,this.id3Header.version.major,this.metadata),r=t.subarray(o,o+A.length);o+=A.length;let s=n.readFrameData(r,A,this.id3Header.version.major,!this.options.skipCovers,this.metadata);s&&i.push({id:A.id,value:s})}return i}static mapId3v2Chapters(t){if(!t)return;let o=t.filter(g=>g.id==="CHAP");if(!o?.length)return;let e=t.filter(g=>g.id==="CTOC")?.find(g=>g.value.flags?.topLevel),a=new Map;for(let g of o)a.set(g.value.label,g.value);let A=e?.value.childElementIds,r=[],s=A??[...a.keys()];for(let g of s){let c=a.get(g);if(!c)continue;let I=c.frames,d=I.get("TIT2");d&&r.push({id:g,title:d,url:I.get("WXXX"),start:c.info.startTime/1e3,end:c.info.endTime/1e3,image:I.get("APIC")})}return A||r.sort((g,c)=>g.start-c.start),r.length?r:void 0}}});var Yre,u2,Js,cf=Ce(()=>{Xo();Yre=qe(ct(),1);lI();xh();nf();zi();u2=(0,Yre.default)("music-metadata:parser:ID3"),Js=class extends kt{constructor(){super(...arguments),this.id3parser=new on}static async startsWithID3v2Header(t){return(await t.peekToken(rf)).fileIdentifier==="ID3"}async parse(){try{await this.parseID3v2()}catch(t){if(t instanceof kA)u2("End-of-stream");else throw t}}finalize(){}async parseID3v2(){await this.tryReadId3v2Headers(),u2("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this.postId3v2Parse(),this.options.skipPostHeaders&&this.metadata.hasAny()?this.finalize():(await new mO(this.metadata,this.tokenizer,this.options).parse(),this.finalize())}async tryReadId3v2Headers(){if((await this.tokenizer.peekToken(rf)).fileIdentifier==="ID3")return u2("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}});var B2,jre=Ce(()=>{Ar();B2={len:2,get:(n,t)=>{let o=ZA(n,t,0,3),i=ZA(n,t,6,1),e=ZA(n,t,7,9)/10;if(o>0)return{type:ZA(n,t,0,3),origin:ZA(n,t,3,3),adjustment:i?-e:e}}}});var Jre,qre=Ce(()=>{DA();Ar();jre();Jre={len:27,get:(n,t)=>{let o=xe.get(n,t+2);return{revision:ZA(n,t,0,4),vbr_method:ZA(n,t,4,4),lowpass_filter:100*QA.get(n,t+1),track_peak:o===0?null:o/2**23,track_gain:B2.get(n,6),album_gain:B2.get(n,8),music_length:xe.get(n,t+20),music_crc:QA.get(n,t+24),header_crc:LA.get(n,t+24)}}}});async function zre(n){let t=await n.readToken(Oqe),o={numFrames:null,streamSize:null,vbrScale:null};if(t.frames&&(o.numFrames=await n.readToken(xe)),t.bytes&&(o.streamSize=await n.readToken(xe)),t.toc&&(o.toc=new Uint8Array(100),await n.readBuffer(o.toc)),t.vbrScale&&(o.vbrScale=await n.readToken(xe)),await n.peekToken(new Ve(4,"ascii"))==="LAME"){await n.ignore(4),o.lame={version:await n.readToken(new Ve(5,"ascii"))};let e=o.lame.version.match(/\d+.\d+/g);if(e!==null){let A=e[0].split(".").map(r=>Number.parseInt(r,10));A[0]>=3&&A[1]>=90&&(o.lame.extended=await n.readToken(Jre))}}return o}var f2,DO,Oqe,Vre=Ce(()=>{DA();Ar();qre();f2=new Ve(4,"ascii"),DO=new Ve(6,"ascii"),Oqe={len:4,get:(n,t)=>({frames:Ta(n,t,31),bytes:Ta(n,t,30),toc:Ta(n,t,29),vbrScale:Ta(n,t,28)})}});var eae={};Fr(eae,{MpegContentError:()=>Wl,MpegParser:()=>Q2});function Mqe(n){return`V${Math.floor((100-n)/10)}`}var $re,uo,Wl,Wre,Zre,bqe,Bo,Xre,Q2,Aae=Ce(()=>{DA();Xo();$re=qe(ct(),1);Ar();cf();Vre();er();uo=(0,$re.default)("music-metadata:parser:mpeg"),Wl=class extends Qt("MPEG"){},Wre=1024,Zre={AudioObjectTypes:["AAC Main","AAC LC","AAC SSR","AAC LTP"],SamplingFrequencies:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,null,null,null]},bqe=[void 0,["front-center"],["front-left","front-right"],["front-center","front-left","front-right"],["front-center","front-left","front-right","back-center"],["front-center","front-left","front-right","back-left","back-right"],["front-center","front-left","front-right","back-left","back-right","LFE-channel"],["front-center","front-left","front-right","side-left","side-right","back-left","back-right","LFE-channel"]],Bo=class n{constructor(t,o){this.bitrateIndex=null,this.sampRateFreqIndex=null,this.padding=null,this.privateBit=null,this.channelModeIndex=null,this.modeExtension=null,this.isOriginalMedia=null,this.version=null,this.bitrate=null,this.samplingRate=null,this.frameLength=0,this.versionIndex=ZA(t,o+1,3,2),this.layer=n.LayerDescription[ZA(t,o+1,5,2)],this.versionIndex>1&&this.layer===0?this.parseAdtsHeader(t,o):this.parseMpegHeader(t,o),this.isProtectedByCRC=!Ta(t,o+1,7)}calcDuration(t){return this.samplingRate==null?null:t*this.calcSamplesPerFrame()/this.samplingRate}calcSamplesPerFrame(){return n.samplesInFrameTable[this.version===1?0:1][this.layer]}calculateSideInfoLength(){if(this.layer!==3)return 2;if(this.channelModeIndex===3){if(this.version===1)return 17;if(this.version===2||this.version===2.5)return 9}else{if(this.version===1)return 32;if(this.version===2||this.version===2.5)return 17}return null}calcSlotSize(){return[null,4,1,1][this.layer]}parseMpegHeader(t,o){this.container="MPEG",this.bitrateIndex=ZA(t,o+2,0,4),this.sampRateFreqIndex=ZA(t,o+2,4,2),this.padding=Ta(t,o+2,6),this.privateBit=Ta(t,o+2,7),this.channelModeIndex=ZA(t,o+3,0,2),this.modeExtension=ZA(t,o+3,2,2),this.isCopyrighted=Ta(t,o+3,4),this.isOriginalMedia=Ta(t,o+3,5),this.emphasis=ZA(t,o+3,7,2),this.version=n.VersionID[this.versionIndex],this.channelMode=n.ChannelMode[this.channelModeIndex],this.codec=`MPEG ${this.version} Layer ${this.layer}`;let i=this.calcBitrate();if(!i)throw new Wl("Cannot determine bit-rate");if(this.bitrate=i*1e3,this.samplingRate=this.calcSamplingRate(),this.samplingRate==null)throw new Wl("Cannot determine sampling-rate")}parseAdtsHeader(t,o){uo("layer=0 => ADTS"),this.version=this.versionIndex===2?4:2,this.container=`ADTS/MPEG-${this.version}`;let i=ZA(t,o+2,0,2);this.codec="AAC",this.codecProfile=Zre.AudioObjectTypes[i],uo(`MPEG-4 audio-codec=${this.codec}`);let e=ZA(t,o+2,2,4);this.samplingRate=Zre.SamplingFrequencies[e],uo(`sampling-rate=${this.samplingRate}`);let a=ZA(t,o+2,7,3);this.mp4ChannelConfig=bqe[a],uo(`channel-config=${this.mp4ChannelConfig?this.mp4ChannelConfig.join("+"):"?"}`),this.frameLength=ZA(t,o+3,6,2)<<11}calcBitrate(){if(this.bitrateIndex===0||this.bitrateIndex===15)return null;if(this.version&&this.bitrateIndex){let t=10*Math.floor(this.version)+this.layer;return n.bitrate_index[this.bitrateIndex][t]}return null}calcSamplingRate(){return this.sampRateFreqIndex===3||this.version===null||this.sampRateFreqIndex==null?null:n.sampling_rate_freq_index[this.version][this.sampRateFreqIndex]}};Bo.SyncByte1=255;Bo.SyncByte2=224;Bo.VersionID=[2.5,null,2,1];Bo.LayerDescription=[0,3,2,1];Bo.ChannelMode=["stereo","joint_stereo","dual_channel","mono"];Bo.bitrate_index={1:{11:32,12:32,13:32,21:32,22:8,23:8},2:{11:64,12:48,13:40,21:48,22:16,23:16},3:{11:96,12:56,13:48,21:56,22:24,23:24},4:{11:128,12:64,13:56,21:64,22:32,23:32},5:{11:160,12:80,13:64,21:80,22:40,23:40},6:{11:192,12:96,13:80,21:96,22:48,23:48},7:{11:224,12:112,13:96,21:112,22:56,23:56},8:{11:256,12:128,13:112,21:128,22:64,23:64},9:{11:288,12:160,13:128,21:144,22:80,23:80},10:{11:320,12:192,13:160,21:160,22:96,23:96},11:{11:352,12:224,13:192,21:176,22:112,23:112},12:{11:384,12:256,13:224,21:192,22:128,23:128},13:{11:416,12:320,13:256,21:224,22:144,23:144},14:{11:448,12:384,13:320,21:256,22:160,23:160}};Bo.sampling_rate_freq_index={1:{0:44100,1:48e3,2:32e3},2:{0:22050,1:24e3,2:16e3},2.5:{0:11025,1:12e3,2:8e3}};Bo.samplesInFrameTable=[[0,384,1152,1152],[0,384,1152,576]];Xre={len:4,get:(n,t)=>new Bo(n,t)};Q2=class extends Js{constructor(){super(...arguments),this.frameCount=0,this.syncFrameCount=-1,this.totalDataLength=0,this.bitrates=[],this.offset=0,this.frame_size=0,this.calculateEofDuration=!1,this.samplesPerFrame=null,this.buf_frame_header=new Uint8Array(4),this.mpegOffset=null,this.syncPeek={buf:new Uint8Array(Wre),len:0}}async postId3v2Parse(){this.metadata.setFormat("lossless",!1),this.metadata.setAudioOnly();try{let t=!1;for(;!t;)await this.sync(),t=await this.parseCommonMpegHeader()}catch(t){if(t instanceof kA){if(uo("End-of-stream"),this.calculateEofDuration&&this.samplesPerFrame!==null){let o=this.frameCount*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.format.sampleRate){let i=o/this.metadata.format.sampleRate;uo(`Calculate duration at EOF: ${i} sec.`,i),this.metadata.setFormat("duration",i)}}}else throw t}}finalize(){let t=this.metadata.format,o=!!this.metadata.native.ID3v1;if(this.mpegOffset!==null){if(t.duration&&this.tokenizer.fileInfo.size){let i=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);t.codecProfile&&t.codecProfile[0]==="V"&&this.metadata.setFormat("bitrate",i*8/t.duration)}if(this.tokenizer.fileInfo.size&&t.codecProfile==="CBR"){let i=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);if(this.frame_size!==null&&this.samplesPerFrame!==null){let e=Math.round(i/this.frame_size)*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",e),t.sampleRate&&!t.duration){let a=e/t.sampleRate;uo("Calculate CBR duration based on file size: %s",a),this.metadata.setFormat("duration",a)}}}}}async sync(){let t=!1;for(;;){let o=0;if(this.syncPeek.len=await this.tokenizer.peekBuffer(this.syncPeek.buf,{length:Wre,mayBeLess:!0}),this.syncPeek.len<=163)throw new kA;for(;;){if(t&&(this.syncPeek.buf[o]&224)===224){this.buf_frame_header[0]=Bo.SyncByte1,this.buf_frame_header[1]=this.syncPeek.buf[o],await this.tokenizer.ignore(o),uo(`Sync at offset=${this.tokenizer.position-1}, frameCount=${this.frameCount}`),this.syncFrameCount===this.frameCount&&(uo(`Re-synced MPEG stream, frameCount=${this.frameCount}`),this.frameCount=0,this.frame_size=0),this.syncFrameCount=this.frameCount;return}if(t=!1,o=this.syncPeek.buf.indexOf(Bo.SyncByte1,o),o===-1){if(this.syncPeek.len=2&&t.layer===0?this.parseAdts(t):this.parseAudioFrameHeader(t)}async parseAudioFrameHeader(t){this.metadata.setFormat("numberOfChannels",t.channelMode==="mono"?1:2),this.metadata.setFormat("bitrate",t.bitrate),this.frameCount<20*1e4&&uo("offset=%s MP%s bitrate=%s sample-rate=%s",this.tokenizer.position-4,t.layer,t.bitrate,t.samplingRate);let o=t.calcSlotSize();if(o===null)throw new Wl("invalid slot_size");let i=t.calcSamplesPerFrame();uo(`samples_per_frame=${i}`);let e=i/8;if(t.bitrate!==null&&t.samplingRate!=null){let a=e*t.bitrate/t.samplingRate+(t.padding?o:0);this.frame_size=Math.floor(a)}if(this.audioFrameHeader=t,t.bitrate!==null&&this.bitrates.push(t.bitrate),this.frameCount===1)return this.offset=Xre.len,await this.skipSideInformation(),!1;if(this.frameCount===4){if(this.areAllSame(this.bitrates)){if(this.samplesPerFrame=i,this.metadata.setFormat("codecProfile","CBR"),this.tokenizer.fileInfo.size)return!0}else if(this.metadata.format.duration)return!0;if(!this.options.duration)return!0}return this.options.duration&&this.frameCount===4&&(this.samplesPerFrame=i,this.calculateEofDuration=!0),this.offset=4,t.isProtectedByCRC?(await this.parseCrc(),!1):(await this.skipSideInformation(),!1)}async parseAdts(t){let o=new Uint8Array(3);if(await this.tokenizer.readBuffer(o),t.frameLength+=ZA(o,0,0,11),this.totalDataLength+=t.frameLength,this.samplesPerFrame=1024,t.samplingRate!==null){let i=t.samplingRate/this.samplesPerFrame,a=8*(this.frameCount===0?0:this.totalDataLength/this.frameCount)*i+.5;this.metadata.setFormat("bitrate",a),uo(`frame-count=${this.frameCount}, size=${t.frameLength} bytes, bit-rate=${a}`)}if(await this.tokenizer.ignore(t.frameLength>7?t.frameLength-7:1),this.frameCount===3)if(this.metadata.setFormat("codecProfile",t.codecProfile),t.mp4ChannelConfig&&this.metadata.setFormat("numberOfChannels",t.mp4ChannelConfig.length),this.options.duration)this.calculateEofDuration=!0;else return!0;return!1}async parseCrc(){return await this.tokenizer.ignore($o.len),this.offset+=$o.len,this.skipSideInformation()}async skipSideInformation(){if(this.audioFrameHeader){let t=this.audioFrameHeader.calculateSideInfoLength();if(t!==null){await this.tokenizer.readToken(new Ot(t)),this.offset+=t,await this.readXtraInfoHeader();return}}}async readXtraInfoHeader(){let t=await this.tokenizer.readToken(f2);switch(this.offset+=f2.len,t){case"Info":return this.metadata.setFormat("codecProfile","CBR"),this.readXingInfoHeader();case"Xing":{let i=await this.readXingInfoHeader();if(i.vbrScale!==null){let e=Mqe(i.vbrScale);this.metadata.setFormat("codecProfile",e)}return null}case"Xtra":break;case"LAME":{let i=await this.tokenizer.readToken(DO);if(this.frame_size!==null&&this.frame_size>=this.offset+DO.len)return this.offset+=DO.len,this.metadata.setFormat("tool",`LAME ${i}`),await this.skipFrameData(this.frame_size-this.offset),null;this.metadata.addWarning("Corrupt LAME header");break}}let o=this.frame_size-this.offset;return o<0?this.metadata.addWarning(`Frame ${this.frameCount}corrupt: negative frameDataLeft`):await this.skipFrameData(o),null}async readXingInfoHeader(){let t=this.tokenizer.position,o=await zre(this.tokenizer);if(this.offset+=this.tokenizer.position-t,o.lame&&(this.metadata.setFormat("tool",`LAME ${tn(o.lame.version)}`),o.lame.extended&&(this.metadata.setFormat("trackPeakLevel",o.lame.extended.track_peak),o.lame.extended.track_gain&&this.metadata.setFormat("trackGain",o.lame.extended.track_gain.adjustment),o.lame.extended.album_gain&&this.metadata.setFormat("albumGain",o.lame.extended.album_gain.adjustment),this.metadata.setFormat("duration",o.lame.extended.music_length/1e3))),o.streamSize&&this.audioFrameHeader&&o.numFrames!==null){let e=this.audioFrameHeader.calcDuration(o.numFrames);return this.metadata.setFormat("duration",e),uo("Get duration from Xing header: %s",this.metadata.format.duration),o}let i=this.frame_size-this.offset;return await this.skipFrameData(i),o}async skipFrameData(t){if(t<0)throw new Wl("frame-data-left cannot be negative");await this.tokenizer.ignore(t)}areAllSame(t){let o=t[0];return t.every(i=>i===o)}}});var tae,rae=Ce(()=>{tae={parserType:"mpeg",extensions:[".mp2",".mp3",".m2a",".aac","aacp"],mimeTypes:["audio/mpeg","audio/mp3","audio/aacs","audio/aacp"],async load(){return(await Promise.resolve().then(()=>(Aae(),eae))).MpegParser}}});var aae,iae=Ce(()=>{aae={parserType:"apev2",extensions:[".ape"],mimeTypes:["audio/ape","audio/monkeys-audio"],async load(){return(await Promise.resolve().then(()=>(Vl(),Gre))).APEv2Parser}}});function y2(n){let t=n.trim();if(t.length!==36||t[8]!=="-"||t[13]!=="-"||t[18]!=="-"||t[23]!=="-")throw new Error(`Invalid GUID format: ${n}`);let o,i=new Uint8Array(16);o=parseInt(t.slice(0,8),16),i[0]=o&255,i[1]=o>>>8&255,i[2]=o>>>16&255,i[3]=o>>>24&255,o=parseInt(t.slice(9,13),16),i[4]=o&255,i[5]=o>>>8&255,o=parseInt(t.slice(14,18),16),i[6]=o&255,i[7]=o>>>8&255,o=parseInt(t.slice(19,23),16),i[8]=o>>>8&255,i[9]=o&255,o=parseInt(t.slice(24,32),16),i[10]=o>>>24&255,i[11]=o>>>16&255,i[12]=o>>>8&255,i[13]=o&255,o=parseInt(t.slice(32,36),16),i[14]=o>>>8&255,i[15]=o&255;for(let e=0;e<16;e++)if(!Number.isFinite(i[e]))throw new Error(`Invalid GUID format: ${n}`);if(!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t))throw new Error(`Invalid GUID format: ${n}`);return i}var OO,oae=Ce(()=>{OO=class n{constructor(t){if(t.length!==16)throw new Error("GUID must be exactly 16 bytes");this.bytes=t}static fromString(t){return new n(y2(t))}toString(){let t=this.bytes,o=s=>s.toString(16).padStart(2,"0"),i=o(t[3])+o(t[2])+o(t[1])+o(t[0]),e=o(t[5])+o(t[4]),a=o(t[7])+o(t[6]),A=o(t[8])+o(t[9]),r=o(t[10])+o(t[11])+o(t[12])+o(t[13])+o(t[14])+o(t[15]);return`${i}-${e}-${a}-${A}-${r}`.toUpperCase()}equals(t,o=0){if(o<0||t.length-o<16)return!1;let i=this.bytes;for(let e=0;e<16;e++)if(t[o+e]!==i[e])return!1;return!0}}});var Ye,tr,m2=Ce(()=>{oae();Ye=class n{static fromBin(t,o=0){return new n(n.decode(t,o))}static decode(t,o=0){return new OO(t.subarray(o,o+16)).toString()}static decodeMediaType(t){switch(t.str){case n.AudioMedia.str:return"audio";case n.VideoMedia.str:return"video";case n.CommandMedia.str:return"command";case n.Degradable_JPEG_Media.str:return"degradable-jpeg";case n.FileTransferMedia.str:return"file-transfer";case n.BinaryMedia.str:return"binary"}}static encode(t){return y2(t)}constructor(t){this.str=t}equals(t){return this.str===t.str}toBin(){return n.encode(this.str)}};Ye.HeaderObject=new Ye("75B22630-668E-11CF-A6D9-00AA0062CE6C");Ye.DataObject=new Ye("75B22636-668E-11CF-A6D9-00AA0062CE6C");Ye.SimpleIndexObject=new Ye("33000890-E5B1-11CF-89F4-00A0C90349CB");Ye.IndexObject=new Ye("D6E229D3-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexObject=new Ye("FEB103F8-12AD-4C64-840F-2A1D2F7AD48C");Ye.TimecodeIndexObject=new Ye("3CB73FD0-0C4A-4803-953D-EDF7B6228F0C");Ye.FilePropertiesObject=new Ye("8CABDCA1-A947-11CF-8EE4-00C00C205365");Ye.StreamPropertiesObject=new Ye("B7DC0791-A9B7-11CF-8EE6-00C00C205365");Ye.HeaderExtensionObject=new Ye("5FBF03B5-A92E-11CF-8EE3-00C00C205365");Ye.CodecListObject=new Ye("86D15240-311D-11D0-A3A4-00A0C90348F6");Ye.ScriptCommandObject=new Ye("1EFB1A30-0B62-11D0-A39B-00A0C90348F6");Ye.MarkerObject=new Ye("F487CD01-A951-11CF-8EE6-00C00C205365");Ye.BitrateMutualExclusionObject=new Ye("D6E229DC-35DA-11D1-9034-00A0C90349BE");Ye.ErrorCorrectionObject=new Ye("75B22635-668E-11CF-A6D9-00AA0062CE6C");Ye.ContentDescriptionObject=new Ye("75B22633-668E-11CF-A6D9-00AA0062CE6C");Ye.ExtendedContentDescriptionObject=new Ye("D2D0A440-E307-11D2-97F0-00A0C95EA850");Ye.ContentBrandingObject=new Ye("2211B3FA-BD23-11D2-B4B7-00A0C955FC6E");Ye.StreamBitratePropertiesObject=new Ye("7BF875CE-468D-11D1-8D82-006097C9A2B2");Ye.ContentEncryptionObject=new Ye("2211B3FB-BD23-11D2-B4B7-00A0C955FC6E");Ye.ExtendedContentEncryptionObject=new Ye("298AE614-2622-4C17-B935-DAE07EE9289C");Ye.DigitalSignatureObject=new Ye("2211B3FC-BD23-11D2-B4B7-00A0C955FC6E");Ye.PaddingObject=new Ye("1806D474-CADF-4509-A4BA-9AABCB96AAE8");Ye.ExtendedStreamPropertiesObject=new Ye("14E6A5CB-C672-4332-8399-A96952065B5A");Ye.AdvancedMutualExclusionObject=new Ye("A08649CF-4775-4670-8A16-6E35357566CD");Ye.GroupMutualExclusionObject=new Ye("D1465A40-5A79-4338-B71B-E36B8FD6C249");Ye.StreamPrioritizationObject=new Ye("D4FED15B-88D3-454F-81F0-ED5C45999E24");Ye.BandwidthSharingObject=new Ye("A69609E6-517B-11D2-B6AF-00C04FD908E9");Ye.LanguageListObject=new Ye("7C4346A9-EFE0-4BFC-B229-393EDE415C85");Ye.MetadataObject=new Ye("C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA");Ye.MetadataLibraryObject=new Ye("44231C94-9498-49D1-A141-1D134E457054");Ye.IndexParametersObject=new Ye("D6E229DF-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexParametersObject=new Ye("6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7");Ye.TimecodeIndexParametersObject=new Ye("F55E496D-9797-4B5D-8C8B-604DFE9BFB24");Ye.CompatibilityObject=new Ye("26F18B5D-4584-47EC-9F5F-0E651F0452C9");Ye.AdvancedContentEncryptionObject=new Ye("43058533-6981-49E6-9B74-AD12CB86D58C");Ye.AudioMedia=new Ye("F8699E40-5B4D-11CF-A8FD-00805F5C442B");Ye.VideoMedia=new Ye("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B");Ye.CommandMedia=new Ye("59DACFC0-59E6-11D0-A3AC-00A0C90348F6");Ye.JFIF_Media=new Ye("B61BE100-5B4E-11CF-A8FD-00805F5C442B");Ye.Degradable_JPEG_Media=new Ye("35907DE0-E415-11CF-A917-00805F5C442B");Ye.FileTransferMedia=new Ye("91BD222C-F21C-497A-8B6D-5AA86BFC0185");Ye.BinaryMedia=new Ye("3AFB65E2-47EF-40F2-AC2C-70A90D71D343");Ye.ASF_Index_Placeholder_Object=new Ye("D9AADE20-7C17-4F9C-BC28-8555DD98E2A2");tr=Ye});function sae(n){return _qe[n]}function If(n){return tn(da(n,"utf-16le"))}function nae(n){return new Uint8Array(n)}function Tqe(n,t=0){return gae(n,t)===1}function Nqe(n,t=0){return Le.get(n,t)}function Rqe(n,t=0){return Gr.get(n,t)}function gae(n,t=0){return SA.get(n,t)}var _qe,cae=Ce(()=>{DA();Ar();_qe=[If,nae,Tqe,Nqe,Rqe,gae,nae]});async function Iae(n){let t=await n.readNumber(SA);return(await n.readToken(new Ve(t*2,"utf-16le"))).replace("\0","")}async function pae(n){let t=await n.readToken(kqe),o=[];for(let i=0;i{DA();Ar();m2();cae();lI();er();Yh=class extends Qt("ASF"){},lae={len:30,get:(n,t)=>({objectId:tr.fromBin(n,t),objectSize:Number(Gr.get(n,t+16)),numberOfHeaderObjects:Le.get(n,t+24)})},CI={len:24,get:(n,t)=>({objectId:tr.fromBin(n,t),objectSize:Number(Gr.get(n,t+16))})},Vg=class{constructor(t){this.len=Number(t.objectSize)-CI.len}postProcessTag(t,o,i,e){if(o==="WM/Picture")t.push({id:o,value:S2.fromBuffer(e)});else{let a=sae(i);if(!a)throw new Yh(`unexpected value headerType: ${i}`);t.push({id:o,value:a(e)})}}},lf=class extends Vg{get(t,o){return null}},jh=class extends Vg{get(t,o){return{fileId:tr.fromBin(t,o),fileSize:Gr.get(t,o+16),creationDate:Gr.get(t,o+24),dataPacketsCount:Gr.get(t,o+32),playDuration:Gr.get(t,o+40),sendDuration:Gr.get(t,o+48),preroll:Gr.get(t,o+56),flags:{broadcast:GA(t,o+64,24),seekable:GA(t,o+64,25)},minimumDataPacketSize:Le.get(t,o+68),maximumDataPacketSize:Le.get(t,o+72),maximumBitrate:Le.get(t,o+76)}}};jh.guid=tr.FilePropertiesObject;Jh=class extends Vg{get(t,o){return{streamType:tr.decodeMediaType(tr.fromBin(t,o)),errorCorrectionType:tr.fromBin(t,o+8)}}};Jh.guid=tr.StreamPropertiesObject;qh=class{constructor(){this.len=22}get(t,o){let i=new DataView(t.buffer,o);return{reserved1:tr.fromBin(t,o),reserved2:i.getUint16(16,!0),extensionDataSize:i.getUint16(18,!0)}}};qh.guid=tr.HeaderExtensionObject;kqe={len:20,get:(n,t)=>({entryCount:new DataView(n.buffer,t).getUint16(16,!0)})};Zl=class n extends Vg{get(t,o){let i=[],e=new DataView(t.buffer,o),a=10;for(let A=0;A0){let s=n.contentDescTags[A],g=a+r;i.push({id:s,value:If(t.subarray(o+a,o+g))}),a=g}}return i}};Zl.guid=tr.ContentDescriptionObject;Zl.contentDescTags=["Title","Author","Copyright","Description","Rating"];zh=class extends Vg{get(t,o){let i=[],e=new DataView(t.buffer,o),a=e.getUint16(0,!0),A=2;for(let r=0;rO2});var dae,D2,Fqe,O2,Eae=Ce(()=>{dae=qe(ct(),1);Jl();m2();w2();zi();w2();D2=(0,dae.default)("music-metadata:parser:ASF"),Fqe="asf",O2=class extends kt{async parse(){let t=await this.tokenizer.readToken(lae);if(!t.objectId.equals(tr.HeaderObject))throw new Yh(`expected asf header; but was not found; got: ${t.objectId.str}`);await this.parseObjectHeader(t.numberOfHeaderObjects)}async parseObjectHeader(t){let o;do{let i=await this.tokenizer.readToken(CI);switch(D2("header GUID=%s",i.objectId.str),i.objectId.str){case jh.guid.str:{let e=await this.tokenizer.readToken(new jh(i));this.metadata.setFormat("duration",Number(e.playDuration/BigInt(1e3))/1e4-Number(e.preroll)/1e3),this.metadata.setFormat("bitrate",e.maximumBitrate);break}case Jh.guid.str:{let e=await this.tokenizer.readToken(new Jh(i));this.metadata.setFormat("container",`ASF/${e.streamType}`);break}case qh.guid.str:{let e=await this.tokenizer.readToken(new qh);await this.parseExtensionObject(e.extensionDataSize);break}case Zl.guid.str:o=await this.tokenizer.readToken(new Zl(i)),await this.addTags(o);break;case zh.guid.str:o=await this.tokenizer.readToken(new zh(i)),await this.addTags(o);break;case tr.CodecListObject.str:{let e=await pae(this.tokenizer);e.forEach(A=>{this.metadata.addStreamInfo({type:A.type.videoCodec?pa.video:pa.audio,codecName:A.codecName})});let a=e.filter(A=>A.type.audioCodec).map(A=>A.codecName).join("/");this.metadata.setFormat("codec",a);break}case tr.StreamBitratePropertiesObject.str:await this.tokenizer.ignore(i.objectSize-CI.len);break;case tr.PaddingObject.str:D2("Padding: %s bytes",i.objectSize-CI.len),await this.tokenizer.ignore(i.objectSize-CI.len);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${i.objectId.str}`),D2("Ignore ASF-Object-GUID: %s",i.objectId.str),await this.tokenizer.readToken(new lf(i))}}while(--t)}async addTags(t){await Promise.all(t.map(({id:o,value:i})=>this.metadata.addTag(Fqe,o,i)))}async parseExtensionObject(t){do{let o=await this.tokenizer.readToken(CI),i=o.objectSize-CI.len;if(i<0)throw new Yh(`Invalid ASF header object size: ${o.objectSize}`);switch(o.objectId.str){case Vh.guid.str:await this.tokenizer.readToken(new Vh(o));break;case Xl.guid.str:{let e=await this.tokenizer.readToken(new Xl(o));await this.addTags(e);break}case Wh.guid.str:{let e=await this.tokenizer.readToken(new Wh(o));await this.addTags(e);break}case tr.PaddingObject.str:await this.tokenizer.ignore(i);break;case tr.CompatibilityObject.str:await this.tokenizer.ignore(i);break;case tr.ASF_Index_Placeholder_Object.str:await this.tokenizer.ignore(i);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${o.objectId.str}`),await this.tokenizer.readToken(new lf(o));break}t-=o.objectSize}while(t>0)}}});var Cae,uae=Ce(()=>{Cae={parserType:"asf",extensions:[".asf",".wma",".wmv"],mimeTypes:["audio/ms-wma","video/ms-wmv","audio/ms-asf","video/ms-asf","application/vnd.ms-asf"],async load(){return(await Promise.resolve().then(()=>(Eae(),hae))).AsfParser}}});var $l,Bae=Ce(()=>{DA();ui();$l={len:12,get:(n,t)=>({chunkID:rt.get(n,t),chunkSize:qL.get(n,t+4)})}});var Qae={};Fr(Qae,{DsdiffContentParseError:()=>Zh,DsdiffParser:()=>b2});var fae,Bi,Zh,b2,yae=Ce(()=>{DA();fae=qe(ct(),1);Xo();ui();zi();xh();Bae();er();Bi=(0,fae.default)("music-metadata:parser:aiff"),Zh=class extends Qt("DSDIFF"){},b2=class extends kt{async parse(){let t=await this.tokenizer.readToken($l);if(t.chunkID!=="FRM8")throw new Zh("Unexpected chunk-ID");this.metadata.setAudioOnly();let o=(await this.tokenizer.readToken(rt)).trim();switch(o){case"DSD":return this.metadata.setFormat("container",`DSDIFF/${o}`),this.metadata.setFormat("lossless",!0),this.readFmt8Chunks(t.chunkSize-BigInt(rt.len));default:throw new Zh(`Unsupported DSDIFF type: ${o}`)}}async readFmt8Chunks(t){for(;t>=$l.len;){let o=await this.tokenizer.readToken($l);Bi(`Chunk id=${o.chunkID}`),await this.readData(o),t-=BigInt($l.len)+o.chunkSize}}async readData(t){Bi(`Reading data of chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);let o=this.tokenizer.position;switch(t.chunkID.trim()){case"FVER":{let e=await this.tokenizer.readToken(Le);Bi(`DSDIFF version=${e}`);break}case"PROP":{if(await this.tokenizer.readToken(rt)!=="SND ")throw new Zh("Unexpected PROP-chunk ID");await this.handleSoundPropertyChunks(t.chunkSize-BigInt(rt.len));break}case"ID3":{let e=await this.tokenizer.readToken(new Ot(Number(t.chunkSize))),a=Co(e);await new on().parse(this.metadata,a,this.options);break}case"DSD":this.metadata.format.numberOfChannels&&this.metadata.setFormat("numberOfSamples",Number(t.chunkSize*BigInt(8)/BigInt(this.metadata.format.numberOfChannels))),this.metadata.format.numberOfSamples&&this.metadata.format.sampleRate&&this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate);break;default:Bi(`Ignore chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);break}let i=t.chunkSize-BigInt(this.tokenizer.position-o);i>0&&(Bi(`After Parsing chunk, remaining ${i} bytes`),await this.tokenizer.ignore(Number(i)))}async handleSoundPropertyChunks(t){for(Bi(`Parsing sound-property-chunks, remainingSize=${t}`);t>0;){let o=await this.tokenizer.readToken($l);Bi(`Sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`);let i=this.tokenizer.position;switch(o.chunkID.trim()){case"FS":{let a=await this.tokenizer.readToken(xe);this.metadata.setFormat("sampleRate",a);break}case"CHNL":{let a=await this.tokenizer.readToken(LA);this.metadata.setFormat("numberOfChannels",a),await this.handleChannelChunks(o.chunkSize-BigInt(LA.len));break}case"CMPR":{let a=(await this.tokenizer.readToken(rt)).trim(),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(new Ve(A,"ascii"));a==="DSD"&&(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("bitsPerSample",1)),this.metadata.setFormat("codec",`${a} (${r})`);break}case"ABSS":{let a=await this.tokenizer.readToken(LA),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(QA),s=await this.tokenizer.readToken(xe);Bi(`ABSS ${a}:${A}:${r}.${s}`);break}case"LSCO":{let a=await this.tokenizer.readToken(LA);Bi(`LSCO lsConfig=${a}`);break}default:Bi(`Unknown sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`),await this.tokenizer.ignore(Number(o.chunkSize))}let e=o.chunkSize-BigInt(this.tokenizer.position-i);e>0&&(Bi(`After Parsing sound-property-chunk ${o.chunkSize}, remaining ${e} bytes`),await this.tokenizer.ignore(Number(e))),t-=BigInt($l.len)+o.chunkSize,Bi(`Parsing sound-property-chunks, remainingSize=${t}`)}if(this.metadata.format.lossless&&this.metadata.format.sampleRate&&this.metadata.format.numberOfChannels&&this.metadata.format.bitsPerSample){let o=this.metadata.format.sampleRate*this.metadata.format.numberOfChannels*this.metadata.format.bitsPerSample;this.metadata.setFormat("bitrate",o)}}async handleChannelChunks(t){Bi(`Parsing channel-chunks, remainingSize=${t}`);let o=[];for(;t>=rt.len;){let i=await this.tokenizer.readToken(rt);Bi(`Channel[ID=${i}]`),o.push(i),t-=BigInt(rt.len)}return Bi(`Channels: ${o.join(", ")}`),o}}});var mae,Sae=Ce(()=>{mae={parserType:"dsdiff",extensions:[".dff"],mimeTypes:["audio/dsf","audio/dsd"],async load(){return(await Promise.resolve().then(()=>(yae(),Qae))).DsdiffParser}}});var wae,uI,bO,M2=Ce(()=>{DA();ui();er();wae={NONE:"not compressed PCM Apple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float Apple Computer",alaw:"ALaw 2:1 8-bit ITU-T G.711 A-law",ulaw:"\xB5Law 2:1 8-bit ITU-T G.711 \xB5-law Apple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 \xB5-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32 IEEE 32-bit float "},uI=class extends Qt("AIFF"){},bO=class{constructor(t,o){this.isAifc=o;let i=o?22:18;if(t.chunkSize>Math.abs(i):e<22){let A=QA.get(t,o+22);if(A>0){let r=(A+1)%2;if(23+A+r===this.len)a.compressionName=new Ve(A,"latin1").get(t,o+23);else throw new uI("Illegal pstring length")}else a.compressionName=void 0}}else a.compressionName="PCM";return a}}});var MO,Dae=Ce(()=>{DA();ui();MO={len:8,get:(n,t)=>({chunkID:rt.get(n,t),chunkSize:Number(BigInt(xe.get(n,t+4)))})}});var bae={};Fr(bae,{AIFFParser:()=>T2});var Oae,_2,T2,Mae=Ce(()=>{DA();Oae=qe(ct(),1);Xo();xh();ui();zi();M2();M2();Dae();_2=(0,Oae.default)("music-metadata:parser:aiff"),T2=class extends kt{constructor(){super(...arguments),this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(MO)).chunkID!=="FORM")throw new uI("Invalid Chunk-ID, expected 'FORM'");let o=await this.tokenizer.readToken(rt);switch(o){case"AIFF":this.metadata.setFormat("container",o),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new uI(`Unsupported AIFF type: ${o}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{for(;!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=MO.len;){_2(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let i=await this.tokenizer.readToken(MO),e=2*Math.round(i.chunkSize/2),a=await this.readData(i);await this.tokenizer.ignore(e-a)}}catch(i){if(i instanceof kA)_2("End-of-stream");else throw i}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new uI("Failed to parse AIFF.COMM chunk when compression type is unknown");let o=await this.tokenizer.readToken(new bO(t,this.isCompressed));return this.metadata.setFormat("bitsPerSample",o.sampleSize),this.metadata.setFormat("sampleRate",o.sampleRate),this.metadata.setFormat("numberOfChannels",o.numChannels),this.metadata.setFormat("numberOfSamples",o.numSampleFrames),this.metadata.setFormat("duration",o.numSampleFrames/o.sampleRate),(o.compressionName||o.compressionType)&&this.metadata.setFormat("codec",o.compressionName??wae[o.compressionType]),t.chunkSize}case"ID3 ":{let o=await this.tokenizer.readToken(new Ot(t.chunkSize)),i=Co(o);return await new on().parse(this.metadata,i,this.options),t.chunkSize}case"SSND":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration),0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return _2(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let i=(await this.tokenizer.readToken(new Ve(t.chunkSize,"ascii"))).split("\0").map(e=>e.trim()).filter(e=>e?.length);return await Promise.all(i.map(e=>this.metadata.addTag("AIFF",t.chunkID,e))),t.chunkSize}}});var _ae,Tae=Ce(()=>{_ae={parserType:"aiff",extensions:[".aif","aiff","aifc"],mimeTypes:["audio/aiff","audio/aif","audio/aifc","application/aiff"],async load(){return(await Promise.resolve().then(()=>(Mae(),bae))).AIFFParser}}});var pf,Nae,Rae,kae=Ce(()=>{DA();ui();pf={len:12,get:(n,t)=>({id:rt.get(n,t),size:Gr.get(n,t+4)})},Nae={len:16,get:(n,t)=>({fileSize:WB.get(n,t),metadataPointer:WB.get(n,t+8)})},Rae={len:40,get:(n,t)=>({formatVersion:dr.get(n,t),formatID:dr.get(n,t+4),channelType:dr.get(n,t+8),channelNum:dr.get(n,t+12),samplingFrequency:dr.get(n,t+16),bitsPerSample:dr.get(n,t+20),sampleCount:WB.get(n,t+24),blockSizePerChannel:dr.get(n,t+32)})}});var Pae={};Fr(Pae,{DsdContentParseError:()=>_O,DsfParser:()=>R2});var vae,N2,_O,R2,Gae=Ce(()=>{vae=qe(ct(),1);cf();kae();xh();er();N2=(0,vae.default)("music-metadata:parser:DSF"),_O=class extends Qt("DSD"){},R2=class extends Js{async postId3v2Parse(){let t=this.tokenizer.position,o=await this.tokenizer.readToken(pf);if(o.id!=="DSD ")throw new _O("Invalid chunk signature");this.metadata.setFormat("container","DSF"),this.metadata.setFormat("lossless",!0),this.metadata.setAudioOnly();let i=await this.tokenizer.readToken(Nae);if(i.metadataPointer===BigInt(0))N2("No ID3v2 tag present");else return N2(`expect ID3v2 at offset=${i.metadataPointer}`),await this.parseChunks(i.fileSize-o.size),await this.tokenizer.ignore(Number(i.metadataPointer)-this.tokenizer.position-t),new on().parse(this.metadata,this.tokenizer,this.options)}async parseChunks(t){for(;t>=pf.len;){let o=await this.tokenizer.readToken(pf);switch(N2(`Parsing chunk name=${o.id} size=${o.size}`),o.id){case"fmt ":{let i=await this.tokenizer.readToken(Rae);this.metadata.setFormat("numberOfChannels",i.channelNum),this.metadata.setFormat("sampleRate",i.samplingFrequency),this.metadata.setFormat("bitsPerSample",i.bitsPerSample),this.metadata.setFormat("numberOfSamples",i.sampleCount),this.metadata.setFormat("duration",Number(i.sampleCount)/i.samplingFrequency);let e=i.bitsPerSample*i.samplingFrequency*i.channelNum;this.metadata.setFormat("bitrate",e);return}default:this.tokenizer.ignore(Number(o.size)-pf.len);break}t-=o.size}}}});var Fae,Lae=Ce(()=>{Fae={parserType:"dsf",extensions:[".dsf"],mimeTypes:["audio/dsf"],async load(){return(await Promise.resolve().then(()=>(Gae(),Pae))).DsfParser}}});var BI,df,Uae,TO=Ce(()=>{DA();lI();BI=class n{static fromBase64(t){return n.fromBuffer(Uint8Array.from(atob(t),o=>o.charCodeAt(0)))}static fromBuffer(t){return new n(t.length).get(t,0)}constructor(t){this.len=t}get(t,o){let i=Ph[xe.get(t,o)];o+=4;let e=xe.get(t,o);o+=4;let a=new Ve(e,"utf-8").get(t,o);o+=e;let A=xe.get(t,o);o+=4;let r=new Ve(A,"utf-8").get(t,o);o+=A;let s=xe.get(t,o);o+=4;let g=xe.get(t,o);o+=4;let c=xe.get(t,o);o+=4;let I=xe.get(t,o);o+=4;let d=xe.get(t,o);o+=4;let B=t.slice(o,o+d);return{type:i,format:a,description:r,width:s,height:g,colour_depth:c,indexed_color:I,data:B}}},df={len:7,get:(n,t)=>({packetType:QA.get(n,t),vorbis:new Ve(6,"ascii").get(n,t+1)})},Uae={len:23,get:(n,t)=>({version:Le.get(n,t+0),channelMode:QA.get(n,t+4),sampleRate:Le.get(n,t+5),bitrateMax:Le.get(n,t+9),bitrateNominal:Le.get(n,t+13),bitrateMin:Le.get(n,t+17)})}});var Xh,k2=Ce(()=>{DA();Fs();Xh=class{constructor(t,o){this.data=t,this.offset=o}readInt32(){let t=Le.get(this.data,this.offset);return this.offset+=4,t}readStringUtf8(){let t=this.readInt32(),o=br(this.data.subarray(this.offset,this.offset+t),"utf-8");return this.offset+=t,o}parseUserComment(){let t=this.offset,o=this.readStringUtf8(),i=o.indexOf("=");return{key:o.substring(0,i).toUpperCase(),value:o.substring(i+1),len:this.offset-t}}}});var Hae,$h,hf,qs,Ef=Ce(()=>{DA();Hae=qe(ct(),1);k2();TO();er();$h=(0,Hae.default)("music-metadata:parser:ogg:vorbis1"),hf=class extends Qt("Vorbis"){},qs=class n{constructor(t,o){this.pageSegments=[],this.durationOnLastPage=!0,this.metadata=t,this.options=o}async parsePage(t,o){if(this.lastPageHeader=t,t.headerType.firstPage)this.parseFirstPage(t,o);else{if(t.headerType.continued){if(this.pageSegments.length===0)throw new hf("Cannot continue on previous page");this.pageSegments.push(o)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){let i=n.mergeUint8Arrays(this.pageSegments);await this.parseFullPage(i)}this.pageSegments=t.headerType.lastPage?[]:[o]}}}static mergeUint8Arrays(t){let o=t.reduce((e,a)=>e+a.length,0),i=new Uint8Array(o);return t.forEach((e,a,A)=>{let r=A.slice(0,a).reduce((s,g)=>s+g.length,0);i.set(e,r)}),i}async flush(){await this.parseFullPage(n.mergeUint8Arrays(this.pageSegments))}async parseUserComment(t,o){let e=new Xh(t,o).parseUserComment();return await this.addTag(e.key,e.value),e.len}async addTag(t,o){if(t==="METADATA_BLOCK_PICTURE"&&typeof o=="string"){if(this.options.skipCovers){$h("Ignore picture");return}o=BI.fromBase64(o),$h(`Push picture: id=${t}, format=${o.format}`)}else $h(`Push tag: id=${t}, value=${o}`);await this.metadata.addTag("vorbis",t,o)}calculateDuration(t){this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",this.lastPageHeader.absoluteGranulePosition),this.metadata.setFormat("duration",this.lastPageHeader.absoluteGranulePosition/this.metadata.format.sampleRate))}parseFirstPage(t,o){this.metadata.setFormat("codec","Vorbis I"),this.metadata.setFormat("hasAudio",!0),$h("Parse first page");let i=df.get(o,0);if(i.vorbis!=="vorbis")throw new hf("Metadata does not look like Vorbis");if(i.packetType===1){let e=Uae.get(o,df.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),$h("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}else throw new hf("First Ogg page should be type 1: the identification header")}async parseFullPage(t){let o=df.get(t,0);switch($h("Parse full page: type=%s, byteLength=%s",o.packetType,t.byteLength),o.packetType){case 3:return this.parseUserCommentList(t,df.len);case 1:case 5:break}}async parseUserCommentList(t,o){let i=Le.get(t,o);o+=4,o+=i;let e=Le.get(t,o);for(o+=4;e-- >0;)o+=await this.parseUserComment(t,o)}}});var fi,Cf,uf,v2=Ce(()=>{Ar();DA();fi={STREAMINFO:0,PADDING:1,APPLICATION:2,SEEKTABLE:3,VORBIS_COMMENT:4,CUESHEET:5,PICTURE:6},Cf={len:4,get:(n,t)=>({lastBlock:GA(n,t,7),type:ZA(n,t,1,7),length:Pr.get(n,t+1)})},uf={len:34,get:(n,t)=>({minimumBlockSize:LA.get(n,t),maximumBlockSize:LA.get(n,t+2)/1e3,minimumFrameSize:Pr.get(n,t+4),maximumFrameSize:Pr.get(n,t+7),sampleRate:Pr.get(n,t+10)>>4,channels:ZA(n,t+12,4,3)+1,bitsPerSample:ZA(n,t+12,7,5)+1,totalSamples:ZA(n,t+13,4,36),fileMD5:new Ot(16).get(n,t+18)})}});var Yae={};Fr(Yae,{FlacParser:()=>Bf});var xae,Hqe,NO,Bf,P2=Ce(()=>{xae=qe(ct(),1);DA();TO();cf();ui();Ef();k2();er();v2();Hqe=(0,xae.default)("music-metadata:parser:FLAC"),NO=class extends Qt("FLAC"){},Bf=class extends Js{constructor(){super(...arguments),this.vorbisParser=new qs(this.metadata,this.options)}async postId3v2Parse(){if((await this.tokenizer.readToken(rt)).toString()!=="fLaC")throw new NO("Invalid FLAC preamble");let o;do o=await this.tokenizer.readToken(Cf),await this.parseDataBlock(o);while(!o.lastBlock);if(this.tokenizer.fileInfo.size&&this.metadata.format.duration){let i=this.tokenizer.fileInfo.size-this.tokenizer.position;this.metadata.setFormat("bitrate",8*i/this.metadata.format.duration)}}async parseDataBlock(t){switch(Hqe(`blockHeader type=${t.type}, length=${t.length}`),t.type){case fi.STREAMINFO:return this.readBlockStreamInfo(t.length);case fi.PADDING:break;case fi.APPLICATION:break;case fi.SEEKTABLE:break;case fi.VORBIS_COMMENT:return this.readComment(t.length);case fi.CUESHEET:break;case fi.PICTURE:await this.parsePicture(t.length);return;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}async readBlockStreamInfo(t){if(t!==uf.len)throw new NO("Unexpected block-stream-info length");let o=await this.tokenizer.readToken(uf);this.metadata.setFormat("container","FLAC"),this.processsStreamInfo(o)}processsStreamInfo(t){this.metadata.setFormat("codec","FLAC"),this.metadata.setFormat("hasAudio",!0),this.metadata.setFormat("lossless",!0),this.metadata.setFormat("numberOfChannels",t.channels),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),t.totalSamples>0&&this.metadata.setFormat("duration",t.totalSamples/t.sampleRate)}async readComment(t){let o=await this.tokenizer.readToken(new Ot(t));return this.parseComment(o)}async parseComment(t){let o=new Xh(t,0),i=o.readStringUtf8();i.length>0&&this.metadata.setFormat("tool",i);let e=o.readInt32(),a=new Array(e);for(let A=0;A(A.key==="ENCODER"&&this.metadata.setFormat("tool",A.value),this.addTag(A.key,A.value))))}async parsePicture(t){return this.options.skipCovers?this.tokenizer.ignore(t):this.addPictureTag(await this.tokenizer.readToken(new BI(t)))}addPictureTag(t){return this.addTag("METADATA_BLOCK_PICTURE",t)}addTag(t,o){return this.vorbisParser.addTag(t,o)}}});var jae,Jae=Ce(()=>{jae={parserType:"flac",extensions:[".flac"],mimeTypes:["audio/flac"],async load(){return(await Promise.resolve().then(()=>(P2(),Yae))).FlacParser}}});var Me,G2=Ce(()=>{Me={string:0,uint:1,uid:2,bool:3,binary:4,float:5}});var qae,zae=Ce(()=>{G2();qae={name:"dtd",container:{440786851:{name:"ebml",container:{17030:{name:"ebmlVersion",value:Me.uint},17143:{name:"ebmlReadVersion",value:Me.uint},17138:{name:"ebmlMaxIDWidth",value:Me.uint},17139:{name:"ebmlMaxSizeWidth",value:Me.uint},17026:{name:"docType",value:Me.string},17031:{name:"docTypeVersion",value:Me.uint},17029:{name:"docTypeReadVersion",value:Me.uint}}},408125543:{name:"segment",container:{290298740:{name:"seekHead",container:{19899:{name:"seek",multiple:!0,container:{21419:{name:"id",value:Me.binary},21420:{name:"position",value:Me.uint}}}}},357149030:{name:"info",container:{29604:{name:"uid",value:Me.uid},29572:{name:"filename",value:Me.string},3979555:{name:"prevUID",value:Me.uid},3965867:{name:"prevFilename",value:Me.string},4110627:{name:"nextUID",value:Me.uid},4096955:{name:"nextFilename",value:Me.string},2807729:{name:"timecodeScale",value:Me.uint},17545:{name:"duration",value:Me.float},17505:{name:"dateUTC",value:Me.uint},31657:{name:"title",value:Me.string},19840:{name:"muxingApp",value:Me.string},22337:{name:"writingApp",value:Me.string}}},524531317:{name:"cluster",multiple:!0,container:{231:{name:"timecode",value:Me.uid},22743:{name:"silentTracks ",multiple:!0},167:{name:"position",value:Me.uid},171:{name:"prevSize",value:Me.uid},160:{name:"blockGroup"},163:{name:"simpleBlock"}}},374648427:{name:"tracks",container:{174:{name:"entries",multiple:!0,container:{215:{name:"trackNumber",value:Me.uint},29637:{name:"uid",value:Me.uid},131:{name:"trackType",value:Me.uint},185:{name:"flagEnabled",value:Me.bool},136:{name:"flagDefault",value:Me.bool},21930:{name:"flagForced",value:Me.bool},156:{name:"flagLacing",value:Me.bool},28135:{name:"minCache",value:Me.uint},28136:{name:"maxCache",value:Me.uint},2352003:{name:"defaultDuration",value:Me.uint},2306383:{name:"timecodeScale",value:Me.float},21358:{name:"name",value:Me.string},2274716:{name:"language",value:Me.string},134:{name:"codecID",value:Me.string},25506:{name:"codecPrivate",value:Me.binary},2459272:{name:"codecName",value:Me.string},3839639:{name:"codecSettings",value:Me.string},3883072:{name:"codecInfoUrl",value:Me.string},2536e3:{name:"codecDownloadUrl",value:Me.string},170:{name:"codecDecodeAll",value:Me.bool},28587:{name:"trackOverlay",value:Me.uint},224:{name:"video",container:{154:{name:"flagInterlaced",value:Me.bool},21432:{name:"stereoMode",value:Me.uint},176:{name:"pixelWidth",value:Me.uint},186:{name:"pixelHeight",value:Me.uint},21680:{name:"displayWidth",value:Me.uint},21690:{name:"displayHeight",value:Me.uint},21683:{name:"aspectRatioType",value:Me.uint},3061028:{name:"colourSpace",value:Me.uint},3126563:{name:"gammaValue",value:Me.float}}},225:{name:"audio",container:{181:{name:"samplingFrequency",value:Me.float},30901:{name:"outputSamplingFrequency",value:Me.float},159:{name:"channels",value:Me.uint},148:{name:"channels",value:Me.uint},32123:{name:"channelPositions",value:Me.binary},25188:{name:"bitDepth",value:Me.uint}}},28032:{name:"contentEncodings",container:{25152:{name:"contentEncoding",container:{20529:{name:"order",value:Me.uint},20530:{name:"scope",value:Me.bool},20531:{name:"type",value:Me.uint},20532:{name:"contentEncoding",container:{16980:{name:"contentCompAlgo",value:Me.uint},16981:{name:"contentCompSettings",value:Me.binary}}},20533:{name:"contentEncoding",container:{18401:{name:"contentEncAlgo",value:Me.uint},18402:{name:"contentEncKeyID",value:Me.binary},18403:{name:"contentSignature ",value:Me.binary},18404:{name:"ContentSigKeyID ",value:Me.binary},18405:{name:"contentSigAlgo ",value:Me.uint},18406:{name:"contentSigHashAlgo ",value:Me.uint}}},25188:{name:"bitDepth",value:Me.uint}}}}}}}}},475249515:{name:"cues",container:{187:{name:"cuePoint",container:{179:{name:"cueTime",value:Me.uid},183:{name:"positions",container:{247:{name:"track",value:Me.uint},241:{name:"clusterPosition",value:Me.uint},21368:{name:"blockNumber",value:Me.uint},234:{name:"codecState",value:Me.uint},219:{name:"reference",container:{150:{name:"time",value:Me.uint},151:{name:"cluster",value:Me.uint},21343:{name:"number",value:Me.uint},235:{name:"codecState",value:Me.uint}}},240:{name:"relativePosition",value:Me.uint}}}}}}},423732329:{name:"attachments",container:{24999:{name:"attachedFiles",multiple:!0,container:{18046:{name:"description",value:Me.string},18030:{name:"name",value:Me.string},18016:{name:"mimeType",value:Me.string},18012:{name:"data",value:Me.binary},18094:{name:"uid",value:Me.uid}}}}},272869232:{name:"chapters",container:{17849:{name:"editionEntry",container:{182:{name:"chapterAtom",container:{29636:{name:"uid",value:Me.uid},145:{name:"timeStart",value:Me.uint},146:{name:"timeEnd",value:Me.uid},152:{name:"hidden",value:Me.bool},17816:{name:"enabled",value:Me.uid},143:{name:"track",container:{137:{name:"trackNumber",value:Me.uid},128:{name:"display",container:{133:{name:"string",value:Me.string},17276:{name:"language ",value:Me.string},17278:{name:"country ",value:Me.string}}}}}}}}}}},307544935:{name:"tags",container:{29555:{name:"tag",multiple:!0,container:{25536:{name:"target",container:{25541:{name:"tagTrackUID",value:Me.uid},25540:{name:"tagChapterUID",value:Me.uint},25542:{name:"tagAttachmentUID",value:Me.uid},25546:{name:"targetType",value:Me.string},26826:{name:"targetTypeValue",value:Me.uint},25545:{name:"tagEditionUID",value:Me.uid}}},26568:{name:"simpleTags",multiple:!0,container:{17827:{name:"name",value:Me.string},17543:{name:"string",value:Me.string},17541:{name:"binary",value:Me.binary},17530:{name:"language",value:Me.string},17531:{name:"languageIETF",value:Me.string},17540:{name:"default",value:Me.bool}}}}}}}}}}}});function F2(n,t){return Number(Kqe(n,t))}function Kqe(n,t){let o=new Uint8Array(8),i=n.subarray(0,t);try{return o.set(i,8-t),Hs.get(o,0)}catch{return BigInt(-1)}}function Wae(n){return n.container&&Object.keys(n.container).map(t=>{let o=n.container[t];return o.id=Number.parseInt(t,10),o}).forEach(t=>{t.parent=n,Wae(t)}),n}function ep(n){let t="";return n.parent&&n.parent.name!=="dtd"&&(t+=`${ep(n.parent)}/`),t+n.name}var Vae,eE,RO,zs,kO,Zae=Ce(()=>{DA();Vae=qe(ct(),1);Xo();G2();DA();er();eE=(0,Vae.default)("music-metadata:parser:ebml"),RO=class extends Qt("EBML"){},zs={ReadNext:0,IgnoreElement:2,SkipSiblings:3,TerminateParsing:4,SkipElement:5},kO=class{constructor(t){this.parserMap=new Map,this.ebmlMaxIDLength=4,this.ebmlMaxSizeLength=8,this.tokenizer=t,this.parserMap.set(Me.uint,o=>this.readUint(o)),this.parserMap.set(Me.string,o=>this.readString(o)),this.parserMap.set(Me.binary,o=>this.readBuffer(o)),this.parserMap.set(Me.uid,async o=>this.readBuffer(o)),this.parserMap.set(Me.bool,o=>this.readFlag(o)),this.parserMap.set(Me.float,o=>this.readFloat(o))}async iterate(t,o,i){return this.parseContainer(Wae(t),o,i)}async parseContainer(t,o,i){let e={};for(;this.tokenizer.position=0?this.tokenizer.position+a.len:-1,i);r.multiple?(e[r.name]||(e[r.name]=[]),e[r.name].push(g)):e[r.name]=g,await i.elementValue(r,g,A)}else{let g=this.parserMap.get(r.value);if(typeof g=="function"){let c=await g(a);e[r.name]=c,await i.elementValue(r,c,A)}}break;case zs.SkipElement:eE(`Go to next element: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`);break;case zs.IgnoreElement:eE(`Ignore element: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(a.len);break;case zs.SkipSiblings:eE(`Ignore remaining container, at: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(o-this.tokenizer.position);break;case zs.TerminateParsing:return eE(`Terminate parsing at element: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`),e}else switch(a.id){case 236:await this.tokenizer.ignore(a.len);break;default:eE(`parseEbml: parent=${ep(t)}, unknown child: id=${a.id.toString(16)} at position=${A}`),await this.tokenizer.ignore(a.len)}}return e}async readVintData(t){let o=await this.tokenizer.peekNumber(QA),i=128,e=1;for(;(o&i)===0;){if(e>t)throw new RO("VINT value exceeding maximum size");++e,i>>=1}let a=new Uint8Array(e);return await this.tokenizer.readBuffer(a),a}async readElement(){let t=await this.readVintData(this.ebmlMaxIDLength),o=await this.readVintData(this.ebmlMaxSizeLength);return o[0]^=128>>o.length-1,{id:F2(t,t.length),len:F2(o,o.length)}}async readFloat(t){switch(t.len){case 0:return 0;case 4:return this.tokenizer.readNumber(zL);case 8:return this.tokenizer.readNumber($D);case 10:return this.tokenizer.readNumber($D);default:throw new RO(`Invalid IEEE-754 float length: ${t.len}`)}}async readFlag(t){return await this.readUint(t)===1}async readUint(t){let o=await this.readBuffer(t);return F2(o,t.len)}async readString(t){return(await this.tokenizer.readToken(new Ve(t.len,"utf-8"))).replace(/\x00.*$/g,"")}async readBuffer(t){let o=new Uint8Array(t.len);return await this.tokenizer.readBuffer(o),o}}});var $ae={};Fr($ae,{MatroskaParser:()=>L2});var Xae,vO,L2,eie=Ce(()=>{Xae=qe(ct(),1);zi();zae();o2();Zae();vO=(0,Xae.default)("music-metadata:parser:matroska"),L2=class extends kt{constructor(){super(...arguments),this.seekHeadOffset=0,this.flagUseIndexToSkipClusters=this.options.mkvUseIndex??!1}async parse(){let t=this.tokenizer.fileInfo.size??Number.MAX_SAFE_INTEGER,o=new kO(this.tokenizer);vO("Initializing DTD end MatroskaIterator"),await o.iterate(qae,t,{startNext:i=>{switch(i.id){case 475249515:return vO(`Skip element: name=${i.name}, id=0x${i.id.toString(16)}`),zs.IgnoreElement;case 524531317:if(this.flagUseIndexToSkipClusters&&this.seekHead){let e=this.seekHead.seek.find(a=>a.position+this.seekHeadOffset>this.tokenizer.position);if(e){let a=e.position+this.seekHeadOffset-this.tokenizer.position;return vO(`Use index to go to next position, ignoring ${a} bytes`),this.tokenizer.ignore(a),zs.SkipElement}}return zs.IgnoreElement;default:return zs.ReadNext}},elementValue:async(i,e,a)=>{switch(vO(`Received: name=${i.name}, value=${e}`),i.id){case 17026:this.metadata.setFormat("container",`EBML/${e}`);break;case 290298740:this.seekHead=e,this.seekHeadOffset=a;break;case 357149030:{let A=e,r=A.timecodeScale?A.timecodeScale:1e6;if(typeof A.duration=="number"){let s=A.duration*r/1e9;await this.addTag("segment:title",A.title),this.metadata.setFormat("duration",Number(s))}}break;case 374648427:{let A=e;if(A?.entries){A.entries.forEach(s=>{let g={codecName:s.codecID.replace("A_","").replace("V_",""),codecSettings:s.codecSettings,flagDefault:s.flagDefault,flagLacing:s.flagLacing,flagEnabled:s.flagEnabled,language:s.language,name:s.name,type:s.trackType,audio:s.audio,video:s.video};this.metadata.addStreamInfo(g)});let r=A.entries.filter(s=>s.trackType===pa.audio).reduce((s,g)=>!s||g.flagDefault&&!s.flagDefault||g.trackNumber{let s=r.target,g=s?.targetTypeValue?gre[s.targetTypeValue]:s?.targetType?s.targetType:"track";await Promise.all(r.simpleTags.map(async c=>{let I=c.string?c.string:c.binary;await this.addTag(`${g}:${c.name}`,I)}))}))}break;case 423732329:{let A=e;await Promise.all(A.attachedFiles.filter(r=>r.mimeType.startsWith("image/")).map(r=>this.addTag("picture",{data:r.data,format:r.mimeType,description:r.description,name:r.name})))}break}}})}async addTag(t,o){await this.metadata.addTag("matroska",t,o)}}});var Aie,tie=Ce(()=>{Aie={parserType:"matroska",extensions:[".mka",".mkv",".mk3d",".mks","webm"],mimeTypes:["audio/matroska","video/matroska","audio/webm","video/webm"],async load(){return(await Promise.resolve().then(()=>(eie(),$ae))).MatroskaParser}}});function nie(n,t,o,i,e){if(H2(`remainingLen=${i}, numberOfEntries=${e} * token-len=${t.len}`),i===0)return[];if(i!==e*t.len)throw new Wg("mismatch number-of-entries with remaining atom-length");let a=[];for(let A=0;A{DA();aie=qe(ct(),1);ui();er();Ar();er();H2=(0,aie.default)("music-metadata:parser:MP4:atom"),Wg=class extends Qt("MP4"){},Ap={len:8,get:(n,t)=>{let o=xe.get(n,t);if(o<0)throw new Wg("Invalid atom header length");return{length:BigInt(o),name:new Ve(4,"latin1").get(n,t+4)}},put:(n,t,o)=>(xe.put(n,t,Number(o.length)),rt.put(n,t+4,o.name))},iie=Hs,K2={len:4,get:(n,t)=>({type:new Ve(4,"ascii").get(n,t)})},PO=class{constructor(t,o,i){if(to&&H2(`Warning: atom ${i} expected to be ${o}, but was actually ${t} bytes long.`),this.len=t}},AE={len:4,get:(n,t)=>{let o=xe.get(n,t)-2082844800;return new Date(o*1e3)}},tE={len:8,get:(n,t)=>{let o=Number(Hs.get(n,t))-2082844800;return new Date(o*1e3)}},GO=class extends PO{constructor(t){super(t,24,"mdhd")}get(t,o){let i=QA.get(t,o+0),e=Pr.get(t,o+1);switch(i){case 0:return{version:i,flags:e,creationTime:AE.get(t,o+4),modificationTime:AE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),language:LA.get(t,o+20),quality:LA.get(t,o+22)};case 1:return{version:i,flags:e,creationTime:tE.get(t,o+4),modificationTime:tE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(Hs.get(t,o+24)),language:LA.get(t,o+32),quality:LA.get(t,o+34)};default:throw new An("Invalid mdhd version header")}}},FO=class extends PO{constructor(t){super(t,100,"mvhd")}get(t,o){let i=QA.get(t,o),e=Pr.get(t,o+1);return i===1?{version:i,flags:e,creationTime:tE.get(t,o+4),modificationTime:tE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(Hs.get(t,o+24)),preferredRate:xe.get(t,o+32),preferredVolume:LA.get(t,o+36),previewTime:xe.get(t,o+84),previewDuration:xe.get(t,o+88),posterTime:xe.get(t,o+92),selectionTime:xe.get(t,o+96),selectionDuration:xe.get(t,o+100),currentTime:xe.get(t,o+104),nextTrackID:xe.get(t,o+108)}:{version:i,flags:e,creationTime:AE.get(t,o+4),modificationTime:AE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),preferredRate:xe.get(t,o+20),preferredVolume:LA.get(t,o+24),previewTime:xe.get(t,o+72),previewDuration:xe.get(t,o+76),posterTime:xe.get(t,o+80),selectionTime:xe.get(t,o+84),selectionDuration:xe.get(t,o+88),currentTime:xe.get(t,o+92),nextTrackID:xe.get(t,o+96)}}},LO=class{constructor(t){this.len=t}get(t,o){return{type:{set:QA.get(t,o+0),type:Pr.get(t,o+1)},locale:Pr.get(t,o+4),value:new Ot(this.len-8).get(t,o+8)}}},UO=class{constructor(t){this.len=t}get(t,o){return{version:QA.get(t,o),flags:Pr.get(t,o+1),name:new Ve(this.len-4,"utf-8").get(t,o+4)}}},HO=class{constructor(t){this.len=t}get(t,o){let i=QA.get(t,o),e=Pr.get(t,o+1);switch(i){case 0:return{version:i,flags:e,creationTime:AE.get(t,o+4),modificationTime:AE.get(t,o+8),trackId:xe.get(t,o+12),duration:xe.get(t,o+20),layer:LA.get(t,o+32),alternateGroup:LA.get(t,o+34),volume:LA.get(t,o+36)};case 1:return{version:i,flags:e,creationTime:tE.get(t,o+4),modificationTime:tE.get(t,o+12),trackId:xe.get(t,o+20),duration:Number(Hs.get(t,o+28)),layer:LA.get(t,o+44),alternateGroup:LA.get(t,o+46),volume:LA.get(t,o+48)};default:throw new An("Invalid tkhd version header")}}},rie={len:8,get:(n,t)=>({version:QA.get(n,t),flags:Pr.get(n,t+1),numberOfEntries:xe.get(n,t+4)})},U2=class{constructor(t){this.len=t}get(t,o){let i=this.len-12;return{dataFormat:rt.get(t,o),dataReferenceIndex:LA.get(t,o+10),description:i>0?new Ot(i).get(t,o+12):void 0}}},ff=class{constructor(t){this.len=t}get(t,o){let i=rie.get(t,o);o+=rie.len;let e=[];for(let a=0;a=this.len){H2("TrackRunBox size mismatch");break}let r={};e.flags.sampleDurationPresent&&(r.sampleDuration=xe.get(t,a),a+=4),e.flags.sampleSizePresent&&(r.sampleSize=xe.get(t,a),a+=4),e.flags.sampleFlagsPresent&&(r.sampleFlags=xe.get(t,a),a+=4),e.flags.sampleCompositionTimeOffsetsPresent&&(r.sampleCompositionTimeOffset=xe.get(t,a),a+=4),e.samples.push(r)}return e}},zO=class{constructor(t){this.len=t}get(t,o){let i=o+1,e=new Ve(4,"utf-8");return{version:Us.get(t,o),flags:Pr.get(t,o+1),componentType:e.get(t,o+4),handlerType:e.get(t,o+8),componentName:new Ve(this.len-28,"utf-8").get(t,o+28)}}},VO=class{constructor(t){this.len=t}get(t,o){let i=0,e=[];for(;i{cie=qe(ct(),1);mf();mf();gie=(0,cie.default)("music-metadata:parser:MP4:Atom"),WO=class n{static async readAtom(t,o,i,e){let a=t.position;gie(`Reading next token on offset=${a}...`);let A=await t.readToken(Ap),r=A.length===1n;r&&(A.length=await t.readToken(iie));let s=new n(A,r,i),g=s.getPayloadLength(e);return gie(`parse atom name=${s.atomPath}, extended=${s.extended}, offset=${a}, len=${s.header.length}`),await s.readData(t,o,g),s}constructor(t,o,i){this.header=t,this.extended=o,this.parent=i,this.children=[],this.atomPath=(this.parent?`${this.parent.atomPath}.`:"")+this.header.name}getHeaderLength(){return this.extended?16:8}getPayloadLength(t){return(this.header.length===0n?t:Number(this.header.length))-this.getHeaderLength()}async readAtoms(t,o,i){for(;i>0;){let e=await n.readAtom(t,o,this,i);this.children.push(e),i-=e.header.length===0n?i:Number(e.header.length)}}async readData(t,o,i){switch(this.header.name){case"moov":case"udta":case"mdia":case"minf":case"stbl":case"":case"ilst":case"tref":case"moof":return this.readAtoms(t,o,this.getPayloadLength(i));case"meta":{let a=(await t.peekToken(Ap)).name==="hdlr"?0:4;return await t.ignore(a),this.readAtoms(t,o,this.getPayloadLength(i)-a)}default:return o(this,i)}}}});var hie={};Fr(hie,{MP4Parser:()=>Y2});function pie(n,t,o){return o.indexOf(n)===t}var die,Wi,jqe,lie,Y2,Eie=Ce(()=>{die=qe(ct(),1);DA();zi();nf();Iie();mf();mf();Jl();$B();Fs();Wi=(0,die.default)("music-metadata:parser:MP4"),jqe="iTunes",lie={raw:{lossy:!1,format:"raw"},MAC3:{lossy:!0,format:"MACE 3:1"},MAC6:{lossy:!0,format:"MACE 6:1"},ima4:{lossy:!0,format:"IMA 4:1"},ulaw:{lossy:!0,format:"uLaw 2:1"},alaw:{lossy:!0,format:"uLaw 2:1"},Qclp:{lossy:!0,format:"QUALCOMM PureVoice"},".mp3":{lossy:!0,format:"MPEG-1 layer 3"},alac:{lossy:!1,format:"ALAC"},"ac-3":{lossy:!0,format:"AC-3"},mp4a:{lossy:!0,format:"MPEG-4/AAC"},mp4s:{lossy:!0,format:"MP4S"},c608:{lossy:!0,format:"CEA-608"},c708:{lossy:!0,format:"CEA-708"}};Y2=class n extends kt{constructor(){super(...arguments),this.tracks=new Map,this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.atomParsers={mvhd:async t=>{let o=await this.tokenizer.readToken(new FO(t));this.metadata.setFormat("creationTime",o.creationTime),this.metadata.setFormat("modificationTime",o.modificationTime)},chap:async t=>{let o=this.getTrackDescription(),i=[];for(;t>=xe.len;)i.push(await this.tokenizer.readNumber(xe)),t-=xe.len;o.chapterList=i},mdat:async t=>{if(this.options.includeChapters){let o=[...this.tracks.values()].filter(i=>i.chapterList);if(o.length===1){let i=o[0].chapterList,e=[...this.tracks.values()].filter(a=>i.indexOf(a.header.trackId)!==-1);if(e.length===1)return this.parseChapterTrack(e[0],o[0],t)}}await this.tokenizer.ignore(t)},ftyp:async t=>{let o=[];for(;t>0;){let e=await this.tokenizer.readToken(K2);t-=K2.len;let a=e.type.replace(/\W/g,"");a.length>0&&o.push(a)}Wi(`ftyp: ${o.join("/")}`);let i=o.filter(pie).join("/");this.metadata.setFormat("container",i)},stsd:async t=>{let o=await this.tokenizer.readToken(new ff(t)),i=this.getTrackDescription();i.soundSampleDescription=o.table.map(e=>this.parseSoundSampleDescription(e))},stsz:async t=>{let o=await this.tokenizer.readToken(new yf(t)),i=this.getTrackDescription();i.sampleSize=o.sampleSize,i.sampleSizeTable=o.entries},date:async t=>{let o=await this.tokenizer.readToken(new Ve(t,"utf-8"));await this.addTag("date",o)}}}static read_BE_Integer(t,o){let i=(o?"INT":"UINT")+t.length*8+(t.length>1?"_BE":""),e=VA[i];if(!e)throw new Wg(`Token for integer type not found: "${i}"`);return Number(e.get(t,0))}async parse(){this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.tracks.clear();let t=this.tokenizer.fileInfo.size||0;for(;!this.tokenizer.fileInfo.size||t>0;){try{if((await this.tokenizer.peekToken(Ap)).name==="\0\0\0\0"){let A=`Error at offset=${this.tokenizer.position}: box.id=0`;Wi(A),this.addWarning(A);break}}catch(a){if(a instanceof Error){let A=`Error at offset=${this.tokenizer.position}: ${a.message}`;Wi(A),this.addWarning(A)}else throw a;break}let e=await WO.readAtom(this.tokenizer,(a,A)=>this.handleAtom(a,A),null,t);t-=e.header.length===BigInt(0)?t:Number(e.header.length)}let o=[];this.tracks.forEach(e=>{let a=[];e.soundSampleDescription.forEach(A=>{let r={},s=lie[A.dataFormat];if(s?(a.push(s.format),r.codecName=s.format):r.codecName=`<${A.dataFormat}>`,A.description){let{description:g}=A;g.sampleRate>0&&(r.type=pa.audio,r.audio={samplingFrequency:g.sampleRate,bitDepth:g.sampleSize,channels:g.numAudioChannels})}this.metadata.addStreamInfo(r)}),a.length>=1&&o.push(a.join("/"))}),o.length>0&&this.metadata.setFormat("codec",o.filter(pie).join("+"));let i=[...this.tracks.values()].filter(e=>e.soundSampleDescription.length>=1&&e.soundSampleDescription[0].description&&e.soundSampleDescription[0].description.numAudioChannels>0);for(let e of i){if(e.media.header&&e.media.header.timeScale>0)if(e.sampleRate=e.media.header.timeScale,e.media.header.duration>0&&(Wi("Using duration defined on audio track"),e.samples=e.media.header.duration,e.duration=e.samples/e.sampleRate),e.fragments.length>0){Wi("Calculate duration defined in track fragments");let r=0;e.sizeInBytes=0;for(let s of e.fragments)for(let g of s.trackRun.samples){let c=g.sampleDuration??s.header.defaultSampleDuration??0,I=g.sampleSize??s.header.defaultSampleSize??0;if(c===0)throw new Error("Missing sampleDuration and no defaultSampleDuration in track fragment header");if(I===0)throw new Error("Missing sampleSize and no defaultSampleSize in track fragment header");r+=c,e.sizeInBytes+=I}e.samples||(e.samples=r),e.duration||(e.duration=r/e.sampleRate)}else e.sampleSizeTable.length>0&&(e.sizeInBytes=e.sampleSizeTable.reduce((r,s)=>r+s,0));let a=e.soundSampleDescription[0];if(a.description&&e.media.header&&(this.metadata.setFormat("sampleRate",a.description.sampleRate),this.metadata.setFormat("bitsPerSample",a.description.sampleSize),this.metadata.setFormat("numberOfChannels",a.description.numAudioChannels),e.media.header.timeScale===0&&e.timeToSampleTable.length>0)){let r=e.timeToSampleTable.map(s=>s.count*s.duration).reduce((s,g)=>s+g);e.duration=r/a.description.sampleRate}let A=lie[a.dataFormat];A&&this.metadata.setFormat("lossless",!A.lossy)}if(i.length>=1){let e=i[0];e.duration&&(this.metadata.setFormat("duration",e.duration),e.sizeInBytes&&this.metadata.setFormat("bitrate",8*e.sizeInBytes/e.duration))}this.metadata.setFormat("hasAudio",this.hasAudioTrack),this.metadata.setFormat("hasVideo",this.hasVideoTrack)}async handleAtom(t,o){if(t.parent)switch(t.parent.header.name){case"ilst":case"":return this.parseMetadataItemData(t);case"moov":switch(t.header.name){case"trak":return this.parseTrackBox(t);case"udta":return this.parseTrackBox(t)}break;case"moof":switch(t.header.name){case"traf":return this.parseTrackFragmentBox(t)}}if(this.atomParsers[t.header.name])return this.atomParsers[t.header.name](o);Wi(`No parser for atom path=${t.atomPath}, payload-len=${o}, ignoring atom`),await this.tokenizer.ignore(o)}getTrackDescription(){let t=[...this.tracks.values()];return t[t.length-1]}async addTag(t,o){await this.metadata.addTag(jqe,t,o)}addWarning(t){Wi(`Warning: ${t}`),this.metadata.addWarning(t)}parseMetadataItemData(t){let o=t.header.name;return t.readAtoms(this.tokenizer,async(i,e)=>{let a=i.getPayloadLength(e);switch(i.header.name){case"data":return this.parseValueAtom(o,i);case"name":case"mean":case"rate":{let A=await this.tokenizer.readToken(new UO(a));o+=`:${A.name}`;break}default:{let A=await this.tokenizer.readToken(new Ot(a));this.addWarning(`Unsupported meta-item: ${o}[${i.header.name}] => value=${AO(A)} ascii=${br(A,"ascii")}`)}}},t.getPayloadLength(0))}async parseValueAtom(t,o){let i=await this.tokenizer.readToken(new LO(Number(o.header.length)-Ap.len));if(i.type.set!==0)throw new Wg(`Unsupported type-set != 0: ${i.type.set}`);switch(i.type.type){case 0:switch(t){case"trkn":case"disk":{let e=QA.get(i.value,3),a=QA.get(i.value,5);await this.addTag(t,`${e}/${a}`);break}case"gnre":{let e=QA.get(i.value,1),a=Kh[e-1];await this.addTag(t,a);break}case"rate":{let e=br(i.value,"ascii");await this.addTag(t,e);break}default:Wi(`unknown proprietary value type for: ${o.atomPath}`)}break;case 1:case 18:await this.addTag(t,br(i.value));break;case 13:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/jpeg",data:Uint8Array.from(i.value)});break;case 14:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/png",data:Uint8Array.from(i.value)});break;case 21:await this.addTag(t,n.read_BE_Integer(i.value,!0));break;case 22:await this.addTag(t,n.read_BE_Integer(i.value,!1));break;case 65:await this.addTag(t,QA.get(i.value,0));break;case 66:await this.addTag(t,LA.get(i.value,0));break;case 67:await this.addTag(t,xe.get(i.value,0));break;default:this.addWarning(`atom key=${t}, has unknown well-known-type (data-type): ${i.type.type}`)}}async parseTrackBox(t){let o={media:{},fragments:[]};await t.readAtoms(this.tokenizer,async(i,e)=>{let a=i.getPayloadLength(e);switch(i.header.name){case"chap":{let A=await this.tokenizer.readToken(new VO(e));o.chapterList=A;break}case"tkhd":o.header=await this.tokenizer.readToken(new HO(a));break;case"hdlr":o.handler=await this.tokenizer.readToken(new zO(a)),o.isAudio=()=>o.handler.handlerType==="audi"||o.handler.handlerType==="soun",o.isVideo=()=>o.handler.handlerType==="vide",o.isAudio()?this.hasAudioTrack=!0:o.isVideo()&&(this.hasVideoTrack=!0);break;case"mdhd":{let A=await this.tokenizer.readToken(new GO(a));o.media.header=A;break}case"stco":{let A=await this.tokenizer.readToken(new YO(a));o.chunkOffsetTable=A.entries;break}case"stsc":{let A=await this.tokenizer.readToken(new xO(a));o.sampleToChunkTable=A.entries;break}case"stsd":{let A=await this.tokenizer.readToken(new ff(a));o.soundSampleDescription=A.table.map(r=>this.parseSoundSampleDescription(r));break}case"stts":{let A=await this.tokenizer.readToken(new KO(a));o.timeToSampleTable=A.entries;break}case"stsz":{let A=await this.tokenizer.readToken(new yf(a));o.sampleSize=A.sampleSize,o.sampleSizeTable=A.entries;break}case"dinf":case"vmhd":case"smhd":Wi(`Ignoring: ${i.header.name}`),await this.tokenizer.ignore(a);break;default:Wi(`Unexpected track box: ${i.header.name}`),await this.tokenizer.ignore(a)}},t.getPayloadLength(0)),this.tracks.set(o.header.trackId,o)}parseTrackFragmentBox(t){let o;return t.readAtoms(this.tokenizer,async(i,e)=>{let a=i.getPayloadLength(e);switch(i.header.name){case"tfhd":{let A=new JO(i.getPayloadLength(e));o=await this.tokenizer.readToken(A);break}case"tfdt":await this.tokenizer.ignore(a);break;case"trun":{let A=new qO(a),r=await this.tokenizer.readToken(A);o&&this.tracks.get(o.trackId)?.fragments.push({header:o,trackRun:r});break}default:Wi(`Unexpected box: ${i.header.name}`),await this.tokenizer.ignore(a)}},t.getPayloadLength(0))}parseSoundSampleDescription(t){let o={dataFormat:t.dataFormat,dataReferenceIndex:t.dataReferenceIndex},i=0;if(t.description){let e=x2.get(t.description,i);i+=x2.len,e.version===0||e.version===1?o.description=oie.get(t.description,i):Wi(`Warning: sound-sample-description ${e} not implemented`)}return o}async parseChapterTrack(t,o,i){if(!t.sampleSize&&t.chunkOffsetTable.length!==t.sampleSizeTable.length)throw new Error("Expected equal chunk-offset-table & sample-size-table length.");let e=[];for(let a=0;a0;++a){let A=t.timeToSampleTable.slice(0,a).reduce((d,B)=>d+B.duration,0),s=t.chunkOffsetTable[a]-this.tokenizer.position,g=t.sampleSize>0?t.sampleSize:t.sampleSizeTable[a];if(i-=s+g,i<0)throw new Wg("Chapter chunk exceeding token length");await this.tokenizer.ignore(s);let c=await this.tokenizer.readToken(new jO(g));Wi(`Chapter ${a+1}: ${c}`);let I={title:c,timeScale:t.media.header?t.media.header.timeScale:0,start:A,sampleOffset:this.findSampleOffset(o,this.tokenizer.position)};Wi(`Chapter title=${I.title}, offset=${I.sampleOffset}/${o.header.duration}`),e.push(I)}this.metadata.setFormat("chapters",e),await this.tokenizer.ignore(i)}findSampleOffset(t,o){let i=0;for(;i=o[i].firstChunk&&t{Cie={parserType:"mp4",extensions:[".mp4",".m4a",".m4b",".m4pa","m4v","m4r","3gp",".mov",".movie",".qt"],mimeTypes:["audio/mp4","audio/m4a","video/m4v","video/mp4","video/quicktime"],async load(){return(await Promise.resolve().then(()=>(Eie(),hie))).MP4Parser}}});var yie,Bie,Jqe,fie,Qie,ZO,mie=Ce(()=>{DA();yie=qe(ct(),1);Ar();Bie=(0,yie.default)("music-metadata:parser:musepack:sv8"),Jqe=new Ve(2,"latin1"),fie={len:5,get:(n,t)=>({crc:Le.get(n,t),streamVersion:QA.get(n,t+4)})},Qie={len:2,get:(n,t)=>({sampleFrequency:[44100,48e3,37800,32e3][ZA(n,t,0,3)],maxUsedBands:ZA(n,t,3,5),channelCount:ZA(n,t+1,0,4)+1,msUsed:Ta(n,t+1,4),audioBlockFrames:ZA(n,t+1,5,3)})},ZO=class{get tokenizer(){return this._tokenizer}set tokenizer(t){this._tokenizer=t}constructor(t){this._tokenizer=t}async readPacketHeader(){let t=await this.tokenizer.readToken(Jqe),o=await this.readVariableSizeField();return{key:t,payloadLength:o.value-2-o.len}}async readStreamHeader(t){let o={};Bie(`Reading SH at offset=${this.tokenizer.position}`);let i=await this.tokenizer.readToken(fie);t-=fie.len,Object.assign(o,i),Bie(`SH.streamVersion = ${i.streamVersion}`);let e=await this.readVariableSizeField();t-=e.len,o.sampleCount=e.value;let a=await this.readVariableSizeField();t-=a.len,o.beginningOfSilence=a.value;let A=await this.tokenizer.readToken(Qie);return t-=Qie.len,Object.assign(o,A),await this.tokenizer.ignore(t),o}async readVariableSizeField(t=1,o=0){let i=await this.tokenizer.readNumber(QA);return(i&128)===0?{len:t,value:o+i}:(i&=127,i+=o,this.readVariableSizeField(t+1,i<<7))}}});var Zg,XO=Ce(()=>{er();Zg=class extends Qt("Musepack"){}});var Sie,zqe,$O,wie=Ce(()=>{Sie=qe(ct(),1);zi();Vl();ui();mie();XO();zqe=(0,Sie.default)("music-metadata:parser:musepack"),$O=class extends kt{constructor(){super(...arguments),this.audioLength=0}async parse(){if(await this.tokenizer.readToken(rt)!=="MPCK")throw new Zg("Invalid Magic number");return this.metadata.setFormat("container","Musepack, SV8"),this.parsePacket()}async parsePacket(){let t=new ZO(this.tokenizer);do{let o=await t.readPacketHeader();switch(zqe(`packet-header key=${o.key}, payloadLength=${o.payloadLength}`),o.key){case"SH":{let i=await t.readStreamHeader(o.payloadLength);this.metadata.setFormat("numberOfSamples",i.sampleCount),this.metadata.setFormat("sampleRate",i.sampleFrequency),this.metadata.setFormat("duration",i.sampleCount/i.sampleFrequency),this.metadata.setFormat("numberOfChannels",i.channelCount);break}case"AP":this.audioLength+=o.payloadLength,await this.tokenizer.ignore(o.payloadLength);break;case"RG":case"EI":case"SO":case"ST":case"CT":await this.tokenizer.ignore(o.payloadLength);break;case"SE":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioLength*8/this.metadata.format.duration),zl(this.metadata,this.tokenizer,this.options);default:throw new Zg(`Unexpected header: ${o.key}`)}}while(!0)}}});var eb,Die=Ce(()=>{DA();eb=class{constructor(t){this.pos=0,this.dword=null,this.tokenizer=t}async read(t){for(;this.dword===null;)this.dword=await this.tokenizer.readToken(Le);let o=this.dword;return this.pos+=t,this.pos<32?(o>>>=32-this.pos,o&(1<>>32-this.pos),o&(1<0){let e=32-this.pos;this.dword=null,t-=e,this.pos=0}let o=t%32,i=(t-o)/32;return await this.tokenizer.ignore(i*4),this.read(o)}}});var Oie,bie=Ce(()=>{DA();Ar();Fs();Oie={len:24,get:(n,t)=>{let o={signature:br(n.subarray(t,t+3),"latin1"),streamMinorVersion:ZA(n,t+3,0,4),streamMajorVersion:ZA(n,t+3,4,4),frameCount:Le.get(n,t+4),maxLevel:SA.get(n,t+8),sampleFrequency:[44100,48e3,37800,32e3][ZA(n,t+10,0,2)],link:ZA(n,t+10,2,2),profile:ZA(n,t+10,4,4),maxBand:ZA(n,t+11,0,6),intensityStereo:Ta(n,t+11,6),midSideStereo:Ta(n,t+11,7),titlePeak:SA.get(n,t+12),titleGain:SA.get(n,t+14),albumPeak:SA.get(n,t+16),albumGain:SA.get(n,t+18),lastFrameLength:Le.get(n,t+20)>>>20&2047,trueGapless:Ta(n,t+23,0)};return o.lastFrameLength=o.trueGapless?Le.get(n,20)>>>20&2047:0,o}}});var _ie,Mie,Ab,Tie=Ce(()=>{_ie=qe(ct(),1);zi();Vl();Die();bie();XO();Mie=(0,_ie.default)("music-metadata:parser:musepack"),Ab=class extends kt{constructor(){super(...arguments),this.bitreader=null,this.audioLength=0,this.duration=null}async parse(){let t=await this.tokenizer.readToken(Oie);if(t.signature!=="MP+")throw new Zg("Unexpected magic number");Mie(`stream-version=${t.streamMajorVersion}.${t.streamMinorVersion}`),this.metadata.setFormat("container","Musepack, SV7"),this.metadata.setFormat("sampleRate",t.sampleFrequency);let o=1152*(t.frameCount-1)+t.lastFrameLength;this.metadata.setFormat("numberOfSamples",o),this.duration=o/t.sampleFrequency,this.metadata.setFormat("duration",this.duration),this.bitreader=new eb(this.tokenizer),this.metadata.setFormat("numberOfChannels",t.midSideStereo||t.intensityStereo?2:1);let i=await this.bitreader.read(8);return this.metadata.setFormat("codec",(i/100).toFixed(2)),await this.skipAudioData(t.frameCount),Mie(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`),zl(this.metadata,this.tokenizer,this.options)}async skipAudioData(t){for(;t-- >0;){let i=await this.bitreader.read(20);this.audioLength+=20+i,await this.bitreader.ignore(i)}let o=await this.bitreader.read(11);this.audioLength+=o,this.duration!==null&&this.metadata.setFormat("bitrate",this.audioLength/this.duration)}}});var kie={};Fr(kie,{MusepackParser:()=>j2});var Rie,Nie,j2,vie=Ce(()=>{Rie=qe(ct(),1);DA();cf();wie();Tie();XO();Nie=(0,Rie.default)("music-metadata:parser:musepack"),j2=class extends Js{async postId3v2Parse(){let t=await this.tokenizer.peekToken(new Ve(3,"latin1")),o;switch(t){case"MP+":{Nie("Stream-version 7"),o=new Ab(this.metadata,this.tokenizer,this.options);break}case"MPC":{Nie("Stream-version 8"),o=new $O(this.metadata,this.tokenizer,this.options);break}default:throw new Zg("Invalid signature prefix")}return this.metadata.setAudioOnly(),o.parse()}}});var Pie,Gie=Ce(()=>{Pie={parserType:"musepack",extensions:[".mpc"],mimeTypes:["audio/musepack"],async load(){return(await Promise.resolve().then(()=>(vie(),kie))).MusepackParser}}});var Sf,tb,J2=Ce(()=>{DA();er();Sf=class extends Qt("Opus"){},tb=class{constructor(t){if(t<19)throw new Sf("ID-header-page 0 should be at least 19 bytes long");this.len=t}get(t,o){return{magicSignature:new Ve(8,"ascii").get(t,o+0),version:QA.get(t,o+8),channelCount:QA.get(t,o+9),preSkip:SA.get(t,o+10),inputSampleRate:Le.get(t,o+12),outputGain:SA.get(t,o+16),channelMapping:QA.get(t,o+18)}}}});var rb,Fie=Ce(()=>{DA();Ef();J2();J2();rb=class extends qs{constructor(t,o,i){super(t,o),this.idHeader=null,this.lastPos=-1,this.tokenizer=i,this.durationOnLastPage=!0}parseFirstPage(t,o){if(this.metadata.setFormat("codec","Opus"),this.idHeader=new tb(o.length).get(o,0),this.idHeader.magicSignature!=="OpusHead")throw new Sf("Illegal ogg/Opus magic-signature");this.metadata.setFormat("sampleRate",this.idHeader.inputSampleRate),this.metadata.setFormat("numberOfChannels",this.idHeader.channelCount),this.metadata.setAudioOnly()}async parseFullPage(t){switch(new Ve(8,"ascii").get(t,0)){case"OpusTags":await this.parseUserCommentList(t,8),this.lastPos=this.tokenizer.position-t.length;break;default:break}}calculateDuration(t){if(this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0){let o=this.lastPageHeader.absoluteGranulePosition-this.idHeader.preSkip;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.setFormat("duration",o/48e3),this.lastPos!==-1&&this.tokenizer.fileInfo.size&&this.metadata.format.duration){let i=this.tokenizer.fileInfo.size-this.lastPos;this.metadata.setFormat("bitrate",8*i/this.metadata.format.duration)}}}}});var Lie,Uie=Ce(()=>{DA();Ar();Lie={len:80,get:(n,t)=>({speex:new Ve(8,"ascii").get(n,t+0),version:iO(new Ve(20,"ascii").get(n,t+8)),version_id:dr.get(n,t+28),header_size:dr.get(n,t+32),rate:dr.get(n,t+36),mode:dr.get(n,t+40),mode_bitstream_version:dr.get(n,t+44),nb_channels:dr.get(n,t+48),bitrate:dr.get(n,t+52),frame_size:dr.get(n,t+56),vbr:dr.get(n,t+60),frames_per_packet:dr.get(n,t+64),extra_headers:dr.get(n,t+68),reserved1:dr.get(n,t+72),reserved2:dr.get(n,t+76)})}});var Hie,Xqe,ab,Kie=Ce(()=>{Hie=qe(ct(),1);Ef();Uie();Xqe=(0,Hie.default)("music-metadata:parser:ogg:speex"),ab=class extends qs{constructor(t,o,i){super(t,o)}parseFirstPage(t,o){Xqe("First Ogg/Speex page");let i=Lie.get(o,0);this.metadata.setFormat("codec",`Speex ${i.version}`),this.metadata.setFormat("numberOfChannels",i.nb_channels),this.metadata.setFormat("sampleRate",i.rate),i.bitrate!==-1&&this.metadata.setFormat("bitrate",i.bitrate),this.metadata.setAudioOnly()}}});var xie,Yie=Ce(()=>{DA();xie={len:42,get:(n,t)=>({id:new Ve(7,"ascii").get(n,t),vmaj:QA.get(n,t+7),vmin:QA.get(n,t+8),vrev:QA.get(n,t+9),vmbw:LA.get(n,t+10),vmbh:LA.get(n,t+17),nombr:Pr.get(n,t+37),nqual:QA.get(n,t+40)})}});var Jie,jie,ib,qie=Ce(()=>{Jie=qe(ct(),1);Yie();jie=(0,Jie.default)("music-metadata:parser:ogg:theora"),ib=class{constructor(t,o,i){this.durationOnLastPage=!1,this.metadata=t}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){jie("duration calculation not implemented")}async parseFirstPage(t,o){jie("First Ogg/Theora page"),this.metadata.setFormat("codec","Theora");let i=xie.get(o,0);this.metadata.setFormat("bitrate",i.nombr),this.metadata.setFormat("hasVideo",!0)}flush(){return Promise.resolve()}}});var zie,ob,Vie=Ce(()=>{DA();Ar();DA();zie={len:27,get:(n,t)=>({capturePattern:new Ve(4,"latin1").get(n,t),version:QA.get(n,t+4),headerType:{continued:GA(n,t+5,0),firstPage:GA(n,t+5,1),lastPage:GA(n,t+5,2)},absoluteGranulePosition:Number(Gr.get(n,t+6)),streamSerialNumber:Le.get(n,t+14),pageSequenceNo:Le.get(n,t+18),pageChecksum:Le.get(n,t+22),page_segments:QA.get(n,t+26)})},ob=class n{static sum(t,o,i){let e=new DataView(t.buffer,0),a=0;for(let A=o;A{Wie=qe(ct(),1);v2();P2();ui();TO();q2=(0,Wie.default)("music-metadata:parser:ogg:theora"),nb=class{constructor(t,o,i){this.durationOnLastPage=!1,this.metadata=t,this.options=o,this.tokenizer=i,this.flacParser=new Bf(this.metadata,this.tokenizer,o)}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){q2("duration calculation not implemented")}async parseFirstPage(t,o){if(q2("First Ogg/FLAC page"),(await rt.get(o,9)).toString()!=="fLaC")throw new Error("Invalid FLAC preamble");let e=await Cf.get(o,13);await this.parseDataBlock(e,o.subarray(13+Cf.len))}async parseDataBlock(t,o){switch(q2(`blockHeader type=${t.type}, length=${t.length}`),t.type){case fi.STREAMINFO:{let i=uf.get(o,0);return this.flacParser.processsStreamInfo(i)}case fi.PADDING:break;case fi.APPLICATION:break;case fi.SEEKTABLE:break;case fi.VORBIS_COMMENT:return this.flacParser.parseComment(o);case fi.PICTURE:if(!this.options.skipCovers){let i=new BI(o.length).get(o,0);return this.flacParser.addPictureTag(i)}break;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}flush(){return Promise.resolve()}}});var $ie={};Fr($ie,{OggContentError:()=>rE,OggParser:()=>V2});var Xie,rE,Vs,z2,V2,eoe=Ce(()=>{DA();Xo();Xie=qe(ct(),1);zi();Ef();Fie();Kie();qie();er();Vie();Zie();rE=class extends Qt("Ogg"){},Vs=(0,Xie.default)("music-metadata:parser:ogg"),z2=class{constructor(t,o,i){this.pageNumber=0,this.closed=!1,this.metadata=t,this.streamSerial=o,this.options=i}async parsePage(t,o){this.pageNumber=o.pageSequenceNo,Vs("serial=%s page#=%s, Ogg.id=%s",o.streamSerialNumber,o.pageSequenceNo,o.capturePattern);let i=await t.readToken(new ob(o));Vs("totalPageSize=%s",i.totalPageSize);let e=await t.readToken(new Ot(i.totalPageSize));if(Vs("firstPage=%s, lastPage=%s, continued=%s",o.headerType.firstPage,o.headerType.lastPage,o.headerType.continued),o.headerType.firstPage){this.metadata.setFormat("container","Ogg");let a=e.subarray(0,7),A=Array.from(a).filter(r=>r>=32&&r<=126).map(r=>String.fromCharCode(r)).join("");switch(A){case"vorbis":Vs(`Set Ogg stream serial ${o.streamSerialNumber}, codec=Vorbis`),this.pageConsumer=new qs(this.metadata,this.options);break;case"OpusHea":Vs("Set page consumer to Ogg/Opus"),this.pageConsumer=new rb(this.metadata,this.options,t);break;case"Speex ":Vs("Set page consumer to Ogg/Speex"),this.pageConsumer=new ab(this.metadata,this.options,t);break;case"fishead":case"theora":Vs("Set page consumer to Ogg/Theora"),this.pageConsumer=new ib(this.metadata,this.options,t);break;case"FLAC":Vs("Set page consumer to Vorbis"),this.pageConsumer=new nb(this.metadata,this.options,t);break;default:throw new rE(`Ogg codec not recognized (id=${A}`)}}if(o.headerType.lastPage&&(this.closed=!0),this.pageConsumer)await this.pageConsumer.parsePage(o,e);else throw new Error("pageConsumer should be initialized")}},V2=class extends kt{constructor(){super(...arguments),this.streams=new Map}async parse(){this.streams=new Map;let t=!1,o;try{do{if(o=await this.tokenizer.readToken(zie),o.capturePattern!=="OggS")throw new rE("Invalid Ogg capture pattern");let i=this.streams.get(o.streamSerialNumber);if(i||(i=new z2(this.metadata,o.streamSerialNumber,this.options),this.streams.set(o.streamSerialNumber,i)),await i.parsePage(this.tokenizer,o),i.pageNumber>12&&!(this.options.duration&&[...this.streams.values()].find(e=>e.pageConsumer?.durationOnLastPage))){Vs("Stop processing Ogg stream");break}}while(![...this.streams.values()].every(i=>i.closed))}catch(i){if(i instanceof kA)Vs("Reached end-of-stream"),t=!0;else if(i instanceof rE)this.metadata.addWarning(`Corrupt Ogg content at ${this.tokenizer.position}`);else throw i}for(let i of this.streams.values())i.closed||(this.metadata.addWarning(`End-of-stream reached before reaching last page in Ogg stream serial=${i.streamSerial}`),await i.pageConsumer?.flush()),i.pageConsumer?.calculateDuration(t)}}});var Aoe,toe=Ce(()=>{Aoe={parserType:"ogg",extensions:[".ogg",".ogv",".oga",".ogm",".ogx",".opus",".spx"],mimeTypes:["audio/ogg","audio/opus","audio/speex","video/ogg"],async load(){return(await Promise.resolve().then(()=>(eoe(),$ie))).OggParser}}});function Ws(n,t){return sb(n,t,1)===1}function sb(n,t,o){return n>>>t&4294967295>>>32-o}var $qe,wf,gb,roe=Ce(()=>{DA();ui();$qe=[6e3,8e3,9600,11025,12e3,16e3,22050,24e3,32e3,44100,48e3,64e3,88200,96e3,192e3,-1],wf={len:32,get:(n,t)=>{let o=Le.get(n,t+24),i={BlockID:rt.get(n,t),blockSize:Le.get(n,t+4),version:SA.get(n,t+8),totalSamples:Le.get(n,t+12),blockIndex:Le.get(n,t+16),blockSamples:Le.get(n,t+20),flags:{bitsPerSample:(1+sb(o,0,2))*8,isMono:Ws(o,2),isHybrid:Ws(o,3),isJointStereo:Ws(o,4),crossChannel:Ws(o,5),hybridNoiseShaping:Ws(o,6),floatingPoint:Ws(o,7),samplingRate:$qe[sb(o,23,4)],isDSD:Ws(o,31)},crc:new Ot(4).get(n,t+28)};return i.flags.isDSD&&(i.totalSamples*=8),i}},gb={len:1,get:(n,t)=>({functionId:sb(n[t],0,6),isOptional:Ws(n[t],5),isOddSize:Ws(n[t],6),largeBlock:Ws(n[t],7)})}});var ioe={};Fr(ioe,{WavPackContentError:()=>aE,WavPackParser:()=>W2});var aoe,tp,aE,W2,ooe=Ce(()=>{DA();Vl();ui();zi();roe();aoe=qe(ct(),1);$B();er();tp=(0,aoe.default)("music-metadata:parser:WavPack"),aE=class extends Qt("WavPack"){},W2=class extends kt{constructor(){super(...arguments),this.audioDataSize=0}async parse(){return this.metadata.setAudioOnly(),this.audioDataSize=0,await this.parseWavPackBlocks(),zl(this.metadata,this.tokenizer,this.options)}async parseWavPackBlocks(){do{if(await this.tokenizer.peekToken(rt)!=="wvpk")break;let o=await this.tokenizer.readToken(wf);if(o.BlockID!=="wvpk")throw new aE("Invalid WavPack Block-ID");tp(`WavPack header blockIndex=${o.blockIndex}, len=${wf.len}`),o.blockIndex===0&&!this.metadata.format.container&&(this.metadata.setFormat("container","WavPack"),this.metadata.setFormat("lossless",!o.flags.isHybrid),this.metadata.setFormat("bitsPerSample",o.flags.bitsPerSample),o.flags.isDSD||(this.metadata.setFormat("sampleRate",o.flags.samplingRate),this.metadata.setFormat("duration",o.totalSamples/o.flags.samplingRate)),this.metadata.setFormat("numberOfChannels",o.flags.isMono?1:2),this.metadata.setFormat("numberOfSamples",o.totalSamples),this.metadata.setFormat("codec",o.flags.isDSD?"DSD":"PCM"));let i=o.blockSize-(wf.len-8);await(o.blockIndex===0?this.parseMetadataSubBlock(o,i):this.tokenizer.ignore(i)),o.blockSamples>0&&(this.audioDataSize+=o.blockSize)}while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=wf.len);this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioDataSize*8/this.metadata.format.duration)}async parseMetadataSubBlock(t,o){let i=o;for(;i>gb.len;){let e=await this.tokenizer.readToken(gb),a=await this.tokenizer.readNumber(e.largeBlock?VB:QA),A=new Uint8Array(a*2-(e.isOddSize?1:0));switch(await this.tokenizer.readBuffer(A),tp(`Metadata Sub-Blocks functionId=0x${e.functionId.toString(16)}, id.largeBlock=${e.largeBlock},data-size=${A.length}`),e.functionId){case 0:break;case 14:{tp("ID_DSD_BLOCK");let r=1<{noe={parserType:"wavpack",extensions:[".wv",".wvp"],mimeTypes:["audio/wavpack"],async load(){return(await Promise.resolve().then(()=>(ooe(),ioe))).WavPackParser}}});var iE,cb,goe=Ce(()=>{DA();iE={len:8,get:(n,t)=>({chunkID:new Ve(4,"latin1").get(n,t),chunkSize:Le.get(n,t+4)})},cb=class{constructor(t){this.tagHeader=t,this.len=t.chunkSize,this.len+=this.len&1}get(t,o){return new Ve(this.tagHeader.chunkSize,"ascii").get(t,o)}}});var rp,ha,coe,Ib,lb,Z2=Ce(()=>{DA();er();rp=class extends Qt("Wave"){},ha={PCM:1,ADPCM:2,IEEE_FLOAT:3,ALAW:6,MULAW:7,DVI_ADPCM:17,GSM610:49,MPEG_ADTS_AAC:5632,MPEG_LOAS:5634,RAW_AAC1:255,DOLBY_AC3_SPDIF:146,DVM:8192,RAW_SPORT:576,ESST_AC3:577,DRM:9,DTS2:8193,MPEG:80,MPEGLAYER3:85},coe={[ha.PCM]:"PCM",[ha.ADPCM]:"ADPCM",[ha.IEEE_FLOAT]:"IEEE_FLOAT",[ha.ALAW]:"ALAW",[ha.MULAW]:"MULAW",[ha.DVI_ADPCM]:"DVI_ADPCM",[ha.GSM610]:"GSM610",[ha.MPEG_ADTS_AAC]:"MPEG_ADTS_AAC",[ha.MPEG_LOAS]:"MPEG_LOAS",[ha.RAW_AAC1]:"RAW_AAC1",[ha.DOLBY_AC3_SPDIF]:"DOLBY_AC3_SPDIF",[ha.DVM]:"DVM",[ha.RAW_SPORT]:"RAW_SPORT",[ha.ESST_AC3]:"ESST_AC3",[ha.DRM]:"DRM",[ha.DTS2]:"DTS2",[ha.MPEG]:"MPEG",[ha.MPEGLAYER3]:"MPEGLAYER3"},Ib=class{constructor(t){if(t.chunkSize<16)throw new rp("Invalid chunk size");this.len=t.chunkSize}get(t,o){return{wFormatTag:SA.get(t,o),nChannels:SA.get(t,o+2),nSamplesPerSec:Le.get(t,o+4),nAvgBytesPerSec:Le.get(t,o+8),nBlockAlign:SA.get(t,o+12),wBitsPerSample:SA.get(t,o+14)}}},lb=class{constructor(t){if(t.chunkSize<4)throw new rp("Invalid fact chunk size.");this.len=t.chunkSize}get(t,o){return{dwSampleLength:Le.get(t,o)}}}});var X2,Ioe=Ce(()=>{DA();Ar();X2={len:420,get:(n,t)=>({description:tn(new Ve(256,"ascii").get(n,t)).trim(),originator:tn(new Ve(32,"ascii").get(n,t+256)).trim(),originatorReference:tn(new Ve(32,"ascii").get(n,t+288)).trim(),originationDate:tn(new Ve(10,"ascii").get(n,t+320)).trim(),originationTime:tn(new Ve(8,"ascii").get(n,t+330)).trim(),timeReferenceLow:Le.get(n,t+338),timeReferenceHigh:Le.get(n,t+342),version:SA.get(n,t+346),umid:new Ot(64).get(n,t+348),loudnessValue:SA.get(n,t+412),maxTruePeakLevel:SA.get(n,t+414),maxMomentaryLoudness:SA.get(n,t+416),maxShortTermLoudness:SA.get(n,t+418)})}});var poe={};Fr(poe,{WaveParser:()=>$2});var loe,fI,$2,doe=Ce(()=>{Xo();DA();loe=qe(ct(),1);goe();Z2();xh();Ar();ui();zi();Ioe();Z2();fI=(0,loe.default)("music-metadata:parser:RIFF"),$2=class extends kt{constructor(){super(...arguments),this.blockAlign=0,this.avgBytesPerSec=0}async parse(){let t=await this.tokenizer.readToken(iE);if(fI(`pos=${this.tokenizer.position}, parse: chunkID=${t.chunkID}`),t.chunkID==="RIFF")return this.metadata.setAudioOnly(),this.parseRiffChunk(t.chunkSize).catch(o=>{if(!(o instanceof kA))throw o})}async parseRiffChunk(t){let o=await this.tokenizer.readToken(rt);switch(this.metadata.setFormat("container",o),o){case"WAVE":return this.readWaveChunk(t-rt.len);default:throw new rp(`Unsupported RIFF format: RIFF/${o}`)}}async readWaveChunk(t){for(;t>=iE.len;){let o=await this.tokenizer.readToken(iE);switch(t-=iE.len+o.chunkSize,o.chunkSize>t&&this.metadata.addWarning("Data chunk size exceeds file size"),this.header=o,fI(`pos=${this.tokenizer.position}, readChunk: chunkID=RIFF/WAVE/${o.chunkID}`),o.chunkID){case"LIST":await this.parseListTag(o);break;case"fact":this.metadata.setFormat("lossless",!1),this.fact=await this.tokenizer.readToken(new lb(o));break;case"fmt ":{let i=await this.tokenizer.readToken(new Ib(o)),e=coe[i.wFormatTag];e||(fI(`WAVE/non-PCM format=${i.wFormatTag}`),e=`non-PCM (${i.wFormatTag})`),this.metadata.setFormat("codec",e),this.metadata.setFormat("bitsPerSample",i.wBitsPerSample),this.metadata.setFormat("sampleRate",i.nSamplesPerSec),this.metadata.setFormat("numberOfChannels",i.nChannels),this.blockAlign=i.nBlockAlign,this.avgBytesPerSec=i.nAvgBytesPerSec;break}case"id3 ":case"ID3 ":{let i=await this.tokenizer.readToken(new Ot(o.chunkSize)),e=Co(i);await new on().parse(this.metadata,e,this.options);break}case"data":{this.metadata.format.lossless!==!1&&this.metadata.setFormat("lossless",!0);let i=o.chunkSize;if(this.tokenizer.fileInfo.size){let a=this.tokenizer.fileInfo.size-this.tokenizer.position;a0?this.metadata.setFormat("bitrate",this.avgBytesPerSec*8):this.metadata.format.duration&&this.metadata.setFormat("bitrate",i*8/this.metadata.format.duration),await this.tokenizer.ignore(o.chunkSize);break}case"bext":{let i=await this.tokenizer.readToken(X2);Object.keys(i).forEach(a=>{this.metadata.addTag("exif",`bext.${a}`,i[a])});let e=o.chunkSize-X2.len;await this.tokenizer.ignore(e);break}case"\0\0\0\0":fI(`Ignore padding chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize);break;default:fI(`Ignore chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize)}this.header.chunkSize%2===1&&(fI("Read odd padding byte"),await this.tokenizer.ignore(1))}}async parseListTag(t){let o=await this.tokenizer.readToken(new Ve(4,"latin1"));switch(fI("pos=%s, parseListTag: chunkID=RIFF/WAVE/LIST/%s",this.tokenizer.position,o),o){case"INFO":return this.parseRiffInfoTags(t.chunkSize-4);default:return this.metadata.addWarning(`Ignore chunk: RIFF/WAVE/LIST/${o}`),fI(`Ignoring chunkID=RIFF/WAVE/LIST/${o}`),this.tokenizer.ignore(t.chunkSize-4).then()}}async parseRiffInfoTags(t){for(;t>=8;){let o=await this.tokenizer.readToken(iE),i=new cb(o),e=await this.tokenizer.readToken(i);this.addTag(o.chunkID,tn(e)),t-=8+i.len}if(t!==0)throw new rp(`Illegal remaining size: ${t}`)}addTag(t,o){this.metadata.addTag("exif",t,o)}}});var hoe,Eoe=Ce(()=>{hoe={parserType:"riff",extensions:[".wav","wave",".bwf"],mimeTypes:["audio/vnd.wave","audio/wav","audio/wave"],async load(){return(await Promise.resolve().then(()=>(doe(),poe))).WaveParser}}});function t4e(n){let t=Coe.default.parse(n),o=nre(t.type);return{type:o.type,subtype:o.subtype,suffix:o.suffix,parameters:t.parameters}}function r4e(n){let t=n.lastIndexOf(".");return t===-1?"":n.substring(t)}var Coe,uoe,ap,ip,eU=Ce(()=>{A2();Coe=qe(ore(),1);sre();uoe=qe(ct(),1);_re();Jl();rae();er();iae();uae();Sae();Tae();Lae();Jae();tie();uie();Gie();toe();soe();Eoe();pb();ap=(0,uoe.default)("music-metadata:parser:factory");ip=class{constructor(){this.parsers=[],[jae,tae,aae,Cie,Aie,hoe,Aoe,Cae,_ae,noe,Pie,Fae,mae].forEach(t=>{this.registerParser(t)})}registerParser(t){this.parsers.push(t)}async parse(t,o,i){if(t.supportsRandomAccess()?(ap("tokenizer supports random-access, scanning for appending headers"),await AU(t,i)):ap("tokenizer does not support random-access, cannot scan for appending headers"),!o){let r=new Uint8Array(4100);if(t.fileInfo.mimeType&&(o=this.findLoaderForContentType(t.fileInfo.mimeType)),!o&&t.fileInfo.path&&(o=this.findLoaderForExtension(t.fileInfo.path)),!o){ap("Guess parser on content..."),await t.peekBuffer(r,{mayBeLess:!0});let s=await tf(r,{mpegOffsetTolerance:10});if(!s||!s.mime)throw new cI("Failed to determine audio format");if(ap(`Guessed file type is mime=${s.mime}, extension=${s.ext}`),o=this.findLoaderForContentType(s.mime),!o)throw new II(`Guessed MIME-type not supported: ${s.mime}`)}}ap(`Loading ${o.parserType} parser...`);let e=new uO(i),a=await o.load(),A=new a(e,t,i??{});return ap(`Parser ${o.parserType} loaded`),await A.parse(),e.format.trackInfo&&(e.format.hasAudio===void 0&&e.setFormat("hasAudio",!!e.format.trackInfo.find(r=>r.type===pa.audio)),e.format.hasVideo===void 0&&e.setFormat("hasVideo",!!e.format.trackInfo.find(r=>r.type===pa.video))),e.toCommonMetadata()}findLoaderForExtension(t){if(!t)return;let o=r4e(t).toLocaleLowerCase()||t;return this.parsers.find(i=>i.extensions.indexOf(o)!==-1)}findLoaderForContentType(t){let o;if(!t)return;try{o=t4e(t)}catch{ap(`Invalid HTTP Content-Type header value: ${t}`);return}let i=o.subtype.indexOf("x-")===0?o.subtype.substring(2):o.subtype;return this.parsers.find(e=>e.mimeTypes.find(a=>a.indexOf(`${o.type}/${i}`)!==-1))}getSupportedMimeTypes(){let t=new Set;return this.parsers.forEach(o=>{o.mimeTypes.forEach(i=>{t.add(i),t.add(i.replace("/","/x-"))})}),Array.from(t)}}});async function Boe(n){let t=n.fileInfo.size;if(t>=143){let o=new Uint8Array(15),i=n.position;await n.readBuffer(o,{position:t-143}),n.setPosition(i);let e=br(o,"latin1");if(e.substring(6)===a4e)return Number.parseInt(e.substring(0,6),10)+15}return 0}var a4e,foe=Ce(()=>{Fs();a4e="LYRICS200"});async function i4e(n,t={}){let o=zD(n);try{return await oE(o,t)}finally{await o.close()}}async function o4e(n,t,o={}){let i=qD(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await oE(i,o)}finally{await i.close()}}async function n4e(n,t,o={}){let i=Co(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});return oE(i,o)}function oE(n,t){return new ip().parse(n,void 0,t)}function s4e(n){let t={};for(let{id:o,value:i}of n)(t[o]||(t[o]=[])).push(i);return t}function g4e(n){return n===void 0?0:1+Math.round(n*4)}function c4e(n){return n?n.reduce((t,o)=>o.name&&o.name.toLowerCase()in["front","cover","cover (front)"]?o:t):null}async function AU(n,t={}){let o=n.fileInfo.size;if(await Lre(n)){o-=128;let i=await Boe(n);o-=i}t.apeHeader=await dI.findApeFooterOffset(n,o)}function I4e(){return new ip().getSupportedMimeTypes()}var pb=Ce(()=>{Xo();eU();Vl();nf();foe();Jl();er();er()});var moe={};Fr(moe,{CouldNotDetermineFileTypeError:()=>cI,FieldDecodingError:()=>An,InternalParserError:()=>jl,LyricsContentType:()=>Gh,TimestampFormat:()=>Fh,UnsupportedFileTypeError:()=>II,getSupportedMimeTypes:()=>I4e,makeParseError:()=>vh,makeUnexpectedFileContentError:()=>Qt,orderTags:()=>s4e,parseBlob:()=>i4e,parseBuffer:()=>n4e,parseFile:()=>p4e,parseFromTokenizer:()=>oE,parseStream:()=>l4e,parseWebStream:()=>o4e,ratingToStars:()=>g4e,scanAppendingHeaders:()=>AU,selectCover:()=>c4e});async function l4e(n,t,o={}){let i=await HL(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await oE(i,o)}finally{await i.close()}}async function p4e(n,t={}){Qoe(`parseFile: ${n}`);let o=await fte(n),i=new ip;try{let e=i.findLoaderForExtension(n);e||Qoe("Parser could not be determined by file extension");try{return await i.parse(o,e,t)}catch(a){throw(a instanceof cI||a instanceof II)&&(a.message+=`: ${n}`),a}}finally{await o.close()}}var yoe,Qoe,Soe=Ce(()=>{Xo();yoe=qe(ct(),1);pb();eU();pb();Qoe=(0,yoe.default)("music-metadata:parser")});var Fne=$((a0A,vU)=>{"use strict";var y8e=Object.prototype.hasOwnProperty,Qi="~";function Ff(){}Object.create&&(Ff.prototype=Object.create(null),new Ff().__proto__||(Qi=!1));function m8e(n,t,o){this.fn=n,this.context=t,this.once=o||!1}function Gne(n,t,o,i,e){if(typeof o!="function")throw new TypeError("The listener must be a function");var a=new m8e(o,i||n,e),A=Qi?Qi+t:t;return n._events[A]?n._events[A].fn?n._events[A]=[n._events[A],a]:n._events[A].push(a):(n._events[A]=a,n._eventsCount++),n}function Ob(n,t){--n._eventsCount===0?n._events=new Ff:delete n._events[t]}function ii(){this._events=new Ff,this._eventsCount=0}ii.prototype.eventNames=function(){var t=[],o,i;if(this._eventsCount===0)return t;for(i in o=this._events)y8e.call(o,i)&&t.push(Qi?i.slice(1):i);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};ii.prototype.listeners=function(t){var o=Qi?Qi+t:t,i=this._events[o];if(!i)return[];if(i.fn)return[i.fn];for(var e=0,a=i.length,A=new Array(a);e{"use strict";var Kf=n=>n&&typeof n.message=="string",VU=n=>{if(!n)return;let t=n.cause;if(typeof t=="function"){let o=n.cause();return Kf(o)?o:void 0}else return Kf(t)?t:void 0},lse=(n,t)=>{if(!Kf(n))return"";let o=n.stack||"";if(t.has(n))return o+` +`,{offset:2,encoding:o})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async t=>{this.buffer=new Uint8Array(ef);let o=FJe(t.fileInfo.size);if(await t.peekBuffer(this.buffer,{length:Math.min(8,o),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,o),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let i=0;i<=this.options.mpegOffsetTolerance;++i){let e=this.scanMpeg(i);if(e)return e}};async readTiffTag(t){let o=await this.tokenizer.readToken(t?LA:SA);switch(await this.tokenizer.ignore(10),o){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let o=await this.tokenizer.readToken(t?LA:SA);if(!(o>fJe)&&!(Ci(this.tokenizer)&&2+o*12>zte))for(let i=0;i=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(e>=8){let r=(t?LA:SA).get(this.buffer,8),s=(t?LA:SA).get(this.buffer,10);if(r===28&&s===254||r===31&&s===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(Ci(this.tokenizer)&&e>QJe)return o;let a=Ci(this.tokenizer)?zte:this.tokenizer.fileInfo.size;try{await gI(this.tokenizer,e,{maximumLength:a,reason:"TIFF IFD offset"})}catch(r){if(r instanceof kA)return;throw r}let A;try{A=await this.readTiffIFD(t)}catch(r){if(r instanceof kA)return;throw r}return A??o}if(i===43)return o}scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]}))return this.check([8],{offset:t+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},YJe=new Set(Gte),jJe=new Set(Fte)});var A2=Ce(()=>{Xo();$te()});var ore=$(aO=>{"use strict";Object.defineProperty(aO,"__esModule",{value:!0});aO.format=VJe;aO.parse=WJe;var JJe=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,Are=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,qJe=/[\\"]/g,zJe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,tre=(()=>{let n=function(){};return n.prototype=Object.create(null),n})();function VJe(n){let{type:t,parameters:o}=n;if(!t||!zJe.test(t))throw new TypeError(`Invalid type: ${t}`);let i=t;if(o)for(let e of Object.keys(o)){if(!Are.test(e))throw new TypeError(`Invalid parameter name: ${e}`);i+=`; ${e}=${Aqe(o[e])}`}return i}function WJe(n,t){let o=t?.comma===!0?$Je:65536,i=n.length,e=r2(n,t?.start??0,i),a=e;e=t2(n,e,i,o);let A=a2(n,a,e),r=n.slice(a,A).toLowerCase();return t?.parameters===!1?{type:r,index:e,parameters:new tre}:eqe(n,r,e,i,o)}var rre=32,are=9,ire=59,ZJe=61,ere=34,XJe=92,$Je=44;function eqe(n,t,o,i,e){let a=new tre;e:for(;ot;){let i=n.charCodeAt(o-1);if(i!==rre&&i!==are)break;o--}return o}function Aqe(n){if(Are.test(n))return n;if(JJe.test(n))return`"${n.replace(qJe,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${n}`)}});function nre(n){if(!tqe.test(n))throw new TypeError(`Invalid media type: ${n}`);let t=n.indexOf("/"),o=n.slice(0,t).toLowerCase(),i=n.slice(t+1).toLowerCase(),e,a=i.lastIndexOf("+");return a!==-1&&(e=i.slice(a+1),i=i.slice(0,a)),{type:o,subtype:i,suffix:e}}var tqe,sre=Ce(()=>{tqe=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/});var gre,pa,i2,o2=Ce(()=>{gre={10:"shot",20:"scene",30:"track",40:"part",50:"album",60:"edition",70:"collection"},pa={video:1,audio:2,complex:3,logo:4,subtitle:17,button:18,control:32},i2={[pa.video]:"video",[pa.audio]:"audio",[pa.complex]:"complex",[pa.logo]:"logo",[pa.subtitle]:"subtitle",[pa.button]:"button",[pa.control]:"control"}});var Ph,cI,II,n2,An,jl,Qt,er=Ce(()=>{Ph=n=>class extends Error{constructor(o){super(o),this.name=n}},cI=class extends Ph("CouldNotDetermineFileTypeError"){},II=class extends Ph("UnsupportedFileTypeError"){},n2=class extends Ph("UnexpectedFileContentError"){constructor(t,o){super(o),this.fileType=t}toString(){return`${this.name} (FileType: ${this.fileType}): ${this.message}`}},An=class extends Ph("FieldDecodingError"){},jl=class extends Ph("InternalParserError"){},Qt=n=>class extends n2{constructor(t){super(n,t)}}});function GA(n,t,o){return(n[t]&1<>a;let r=8-a,s=i-r;return s<0?A>>=8-a-i:s>0&&(A<<=s,A|=ZA(n,t,o+r,s)),A}function Ta(n,t,o){return ZA(n,t,o,1)===1}function Ire(n){let t=[];for(let o=0,i=n.length;oo.trim().toLowerCase());if(t.length>=1){let o=Number.parseFloat(t[0]);return t.length===2&&t[1]==="db"?{dB:o,ratio:aqe(o)}:{dB:rqe(o),ratio:o}}}function s2(n){if(n.length===0)throw new Error("decodeUintBE: empty Uint8Array");let t=new DataView(n.buffer,n.byteOffset,n.byteLength);return XB(t)}var Ar=Ce(()=>{DA();er();$B()});var Gh,Fh,Lh,g2,rf,c2,Uh,oO,I2,lI=Ce(()=>{DA();Ar();Gh={0:"Other",1:"32x32 pixels 'file icon' (PNG only)",2:"Other file icon",3:"Cover (front)",4:"Cover (back)",5:"Leaflet page",6:"Media (e.g. label side of CD)",7:"Lead artist/lead performer/soloist",8:"Artist/performer",9:"Conductor",10:"Band/Orchestra",11:"Composer",12:"Lyricist/text writer",13:"Recording Location",14:"During recording",15:"During performance",16:"Movie/video screen capture",17:"A bright coloured fish",18:"Illustration",19:"Band/artist logotype",20:"Publisher/Studio logotype"},Fh={other:0,lyrics:1,text:2,movement_part:3,events:4,chord:5,trivia_pop:6},Lh={notSynchronized:0,mpegFrameNumber:1,milliseconds:2},g2={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4},rf={len:10,get:(n,t)=>({fileIdentifier:new Ve(3,"ascii").get(n,t),version:{major:Us.get(n,t+3),revision:Us.get(n,t+4)},flags:{unsynchronisation:GA(n,t+5,7),isExtendedHeader:GA(n,t+5,6),expIndicator:GA(n,t+5,5),footer:GA(n,t+5,4)},size:g2.get(n,t+6)})},c2={len:10,get:(n,t)=>({size:xe.get(n,t),extendedFlags:LA.get(n,t+4),sizeOfPadding:xe.get(n,t+6),crcDataPresent:GA(n,t+4,31)})},Uh={len:1,get:(n,t)=>{switch(n[t]){case 0:return{encoding:"latin1"};case 1:return{encoding:"utf-16le",bom:!0};case 2:return{encoding:"utf-16be",bom:!1};case 3:return{encoding:"utf8",bom:!1};default:return{encoding:"utf8",bom:!1}}}},oO={len:4,get:(n,t)=>({encoding:Uh.get(n,t),language:new Ve(3,"latin1").get(n,t+1)})},I2={len:6,get:(n,t)=>{let o=oO.get(n,t);return{encoding:o.encoding,language:o.language,timeStampFormat:QA.get(n,t+4),contentType:QA.get(n,t+5)}}}});var Jl=Ce(()=>{o2();lI()});function pre(n){return nO[n]&&!nO[n].multiple}function dre(n){return!nO[n].multiple||nO[n].unique||!1}var AA,nO,hre=Ce(()=>{AA={multiple:!1},nO={year:AA,track:AA,disk:AA,title:AA,artist:AA,artists:{multiple:!0,unique:!0},albumartist:AA,albumartists:{multiple:!0,unique:!0},album:AA,date:AA,originaldate:AA,originalyear:AA,releasedate:AA,comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!1,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:AA,subtitle:{multiple:!0},discsubtitle:AA,totaltracks:AA,totaldiscs:AA,compilation:AA,rating:{multiple:!0},bpm:AA,mood:AA,media:AA,catalognumber:{multiple:!0,unique:!0},tvShow:AA,tvShowSort:AA,tvSeason:AA,tvEpisode:AA,tvEpisodeId:AA,tvNetwork:AA,podcast:AA,podcasturl:AA,releasestatus:AA,releasetype:{multiple:!0},releasecountry:AA,script:AA,language:AA,copyright:AA,license:AA,encodedby:AA,encodersettings:AA,gapless:AA,barcode:AA,isrc:{multiple:!0},asin:AA,musicbrainz_recordingid:AA,musicbrainz_trackid:AA,musicbrainz_albumid:AA,musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:AA,musicbrainz_workid:AA,musicbrainz_trmid:AA,musicbrainz_discid:AA,acoustid_id:AA,acoustid_fingerprint:AA,musicip_puid:AA,musicip_fingerprint:AA,website:AA,"performer:instrument":{multiple:!0,unique:!0},averageLevel:AA,peakLevel:AA,notes:{multiple:!0,unique:!1},key:AA,originalalbum:AA,originalartist:AA,discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:AA,discogs_label_id:AA,discogs_master_release_id:AA,discogs_votes:AA,discogs_rating:AA,replaygain_track_peak:AA,replaygain_track_gain:AA,replaygain_album_peak:AA,replaygain_album_gain:AA,replaygain_track_minmax:AA,replaygain_album_minmax:AA,replaygain_undo:AA,description:{multiple:!0},longDescription:AA,category:{multiple:!0},hdVideo:AA,keywords:{multiple:!0},movement:AA,movementIndex:AA,movementTotal:AA,podcastId:AA,showMovement:AA,stik:AA,playCounter:AA}});var hr,zg=Ce(()=>{hr=class{static toIntOrNull(t){let o=Number.parseInt(t,10);return Number.isNaN(o)?null:o}static normalizeTrack(t){let o=t.toString().split("/");return{no:Number.parseInt(o[0],10)||null,of:Number.parseInt(o[1],10)||null}}constructor(t,o){this.tagTypes=t,this.tagMap=o}mapGenericTag(t,o){t={id:t.id,value:t.value},this.postMap(t,o);let i=this.getCommonName(t.id);return i?{id:i,value:t.value}:null}getCommonName(t){return this.tagMap[t]}postMap(t,o){}};hr.maxRatingScore=1});var iqe,sO,Ere=Ce(()=>{zg();iqe={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"},sO=class extends hr{constructor(){super(["ID3v1"],iqe)}}});var rn,Hh=Ce(()=>{zg();rn=class extends hr{constructor(t,o){let i={};for(let e of Object.keys(o))i[e.toUpperCase()]=o[e];super(t,i)}getCommonName(t){return this.tagMap[t.toUpperCase()]}}});var oqe,gO,Cre=Ce(()=>{DA();zg();Hh();Ar();oqe={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer",USLT:"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode","TXXX:ISRC":"isrc",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"releasedate",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl",GRP1:"grouping",PCNT:"playCounter"},gO=class n extends rn{static toRating(t){return{source:t.email,rating:t.rating>0?(t.rating-1)/254*hr.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],oqe)}postMap(t,o){switch(t.id){case"UFID":{let i=t.value;i.owner_identifier==="http://musicbrainz.org"&&(t.id+=`:${i.owner_identifier}`,t.value=da(i.identifier,"latin1"))}break;case"PRIV":{let i=t.value;switch(i.owner_identifier){case"AverageLevel":case"PeakValue":t.id+=`:${i.owner_identifier}`,t.value=i.data.length===4?Le.get(i.data,0):null,t.value===null&&o.addWarning("Failed to parse PRIV:PeakValue");break;default:o.addWarning(`Unknown PRIV owner-identifier: ${i.data}`)}}break;case"POPM":t.value=n.toRating(t.value);break;default:break}}}});var nqe,cO,ure=Ce(()=>{zg();nqe={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"},cO=class n extends hr{static toRating(t){return{rating:Number.parseFloat(t+1)/5}}constructor(){super(["asf"],nqe)}postMap(t){switch(t.id){case"WM/SharedUserRating":{let o=t.id.split(":");t.value=n.toRating(t.value),t.id=o[0];break}}}}});var sqe,IO,Bre=Ce(()=>{Hh();sqe={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"originalalbum",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm",GP1:"grouping"},IO=class extends rn{constructor(){super(["ID3v2.2"],sqe)}}});var gqe,lO,fre=Ce(()=>{Hh();gqe={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Releasedate:"releasedate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"},lO=class extends rn{constructor(){super(["APEv2"],gqe)}}});var cqe,Iqe,af,Qre=Ce(()=>{Hh();cqe={"\xA9nam":"title","\xA9ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","\xA9alb":"album","\xA9day":"date","\xA9cmt":"comment","\xA9com":"comment",trkn:"track",disk:"disk","\xA9gen":"genre",covr:"picture","\xA9wrt":"composer","\xA9lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","\xA9grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","\xA9cpy":"copyright","----:com.apple.iTunes:LICENSE":"license","\xA9too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear","----:com.apple.iTunes:RELEASEDATE":"releasedate",desc:"description",ldes:"longDescription","\xA9mvn":"movement","\xA9mvi":"movementIndex","\xA9mvc":"movementTotal","\xA9wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik",rate:"rating"},Iqe="iTunes",af=class extends rn{constructor(){super([Iqe],cqe)}postMap(t,o){switch(t.id){case"rate":t.value={source:void 0,rating:Number.parseFloat(t.value)/100};break}}}});var lqe,pO,yre=Ce(()=>{zg();lqe={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",RELEASEDATE:"releasedate",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",KEY:"key",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"},pO=class n extends hr{static toRating(t,o,i){return{source:t?t.toLowerCase():void 0,rating:Number.parseFloat(o)/i*hr.maxRatingScore}}constructor(){super(["vorbis"],lqe)}postMap(t){if(t.id==="RATING")t.value=n.toRating(void 0,t.value,100);else if(t.id.indexOf("RATING:")===0){let o=t.id.split(":");t.value=n.toRating(o[1],t.value,1),t.id=o[0]}}}});var pqe,dO,mre=Ce(()=>{zg();pqe={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",IPRT:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"},dO=class extends hr{constructor(){super(["exif"],pqe)}}});var dqe,hO,Sre=Ce(()=>{Hh();dqe={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:DATE_RELEASED":"releasedate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"},hO=class extends rn{constructor(){super(["matroska"],dqe)}}});var hqe,EO,wre=Ce(()=>{zg();hqe={NAME:"title",AUTH:"artist","(c) ":"copyright",ANNO:"comment"},EO=class extends hr{constructor(){super(["AIFF"],hqe)}}});var CO,Dre=Ce(()=>{Ere();Cre();ure();Bre();fre();Qre();yre();mre();Sre();wre();er();CO=class{constructor(){this.tagMappers={},[new sO,new IO,new gO,new af,new af,new pO,new lO,new cO,new dO,new hO,new EO].forEach(t=>{this.registerTagMapper(t)})}mapTag(t,o,i){if(this.tagMappers[t])return this.tagMappers[t].mapGenericTag(o,i);throw new jl(`No generic tag mapper defined for tag-format: ${t}`)}registerTagMapper(t){for(let o of t.tagTypes)this.tagMappers[o]=t}}});function Ore(n){return l2.test(n)?Cqe(n):Eqe(n)}function Eqe(n){return{contentType:Fh.lyrics,timeStampFormat:Lh.notSynchronized,text:n.trim(),syncText:[]}}function Cqe(n){let t=n.split(` +`),o=[];for(let i of t){let e=i.match(l2);if(e){let a=Number.parseInt(e[1],10),A=Number.parseInt(e[2],10),r=e[3].length===3?Number.parseInt(e[3],10):Number.parseInt(e[3],10)*10,s=(a*60+A)*1e3+r,g=i.replace(l2,"").trim();o.push({timestamp:s,text:g})}}return{contentType:Fh.lyrics,timeStampFormat:Lh.milliseconds,text:o.map(i=>i.text).join(` +`),syncText:o}}var l2,bre=Ce(()=>{Jl();l2=/\[(\d{2}):(\d{2})\.(\d{2,3})]/});function Bqe(n){return n.length>2?`${n.slice(0,n.length-1).join(", ")} & ${n[n.length-1]}`:n.join(" & ")}var Mre,ql,uqe,uO,_re=Ce(()=>{Jl();Mre=qe(ct(),1);hre();Dre();zg();Ar();A2();bre();ql=(0,Mre.default)("music-metadata:collector"),uqe=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","AIFF","ID3v1"],uO=class{constructor(t){this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null},movementIndex:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new CO,this.opts=t;let o=1;for(let i of uqe)this.originPriority[i]=o++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(t){ql(`streamInfo: type=${t.type?i2[t.type]:"?"}, codec=${t.codecName}`),this.format.trackInfo.push(t)}setFormat(t,o){ql(`format: ${t} = ${o}`),this.format[t]=o,this.opts?.observer&&this.opts.observer({metadata:this,tag:{type:"format",id:t,value:o}})}setAudioOnly(){this.setFormat("hasAudio",!0),this.setFormat("hasVideo",!1)}async addTag(t,o,i){ql(`tag ${t}.${o} = ${i}`),this.native[t]||(this.format.tagTypes.push(t),this.native[t]=[]),this.native[t].push({id:o,value:i}),await this.toCommon(t,o,i)}addWarning(t){this.quality.warnings.push({message:t})}async postMap(t,o){switch(o.id){case"artist":return this.handleSingularArtistTag(t,o,"artist","artists");case"albumartist":return this.handleSingularArtistTag(t,o,"albumartist","albumartists");case"artists":return this.handlePluralArtistTag(t,o,"artist","artists");case"albumartists":return this.handlePluralArtistTag(t,o,"albumartist","albumartists");case"picture":return this.postFixPicture(o.value).then(i=>{i!==null&&(o.value=i,this.setGenericTag(t,o))});case"totaltracks":this.common.track.of=hr.toIntOrNull(o.value);return;case"totaldiscs":this.common.disk.of=hr.toIntOrNull(o.value);return;case"movementTotal":this.common.movementIndex.of=hr.toIntOrNull(o.value);return;case"track":case"disk":case"movementIndex":{let i=this.common[o.id].of;this.common[o.id]=hr.normalizeTrack(o.value),this.common[o.id].of=i??this.common[o.id].of;return}case"bpm":case"year":case"originalyear":o.value=Number.parseInt(o.value,10);break;case"date":{let i=Number.parseInt(o.value.substr(0,4),10);Number.isNaN(i)||(this.common.year=i);break}case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":o.value=typeof o.value=="string"?Number.parseInt(o.value,10):o.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":o.value=lre(o.value);break;case"replaygain_track_minmax":o.value=o.value.split(",").map(i=>Number.parseInt(i,10));break;case"replaygain_undo":{let i=o.value.split(",").map(e=>Number.parseInt(e,10));o.value={leftChannel:i[0],rightChannel:i[1]};break}case"gapless":case"compilation":case"podcast":case"showMovement":o.value=o.value==="1"||o.value===1;break;case"isrc":{let i=this.common[o.id];if(i&&i.indexOf(o.value)!==-1)return;break}case"comment":typeof o.value=="string"&&(o.value={text:o.value}),o.value.descriptor==="iTunPGAP"&&this.setGenericTag(t,{id:"gapless",value:o.value.text==="1"});break;case"lyrics":typeof o.value=="string"&&(o.value=Ore(o.value));break;default:}o.value!==null&&this.setGenericTag(t,o)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}handleSingularArtistTag(t,o,i,e){if(this.commonOrigin[i]===this.originPriority[t])return this.postMap("artificial",{id:e,value:o.value});this.common[e]||this.setGenericTag("artificial",{id:e,value:o.value}),this.setGenericTag(t,o)}handlePluralArtistTag(t,o,i,e){if((!this.common[i]||this.commonOrigin[i]===this.originPriority.artificial)&&(!this.common[e]||this.common[e].indexOf(o.value)===-1)){let a=(this.common[e]||[]).concat([o.value]),A=Bqe(a);this.setGenericTag("artificial",{id:i,value:A})}this.setGenericTag(t,o)}async postFixPicture(t){if(t.data&&t.data.length>0){if(!t.format){let o=await tf(Uint8Array.from(t.data));if(o)t.format=o.mime;else return null}switch(t.format=t.format.toLocaleLowerCase(),t.format){case"image/jpg":t.format="image/jpeg"}return t}return this.addWarning("Empty picture tag found"),null}async toCommon(t,o,i){let e={id:o,value:i},a=this.tagMapper.mapTag(t,e,this);a&&await this.postMap(t,a)}setGenericTag(t,o){ql(`common.${o.id} = ${o.value}`);let i=this.commonOrigin[o.id]||1e3,e=this.originPriority[t];if(pre(o.id))if(e<=i)this.common[o.id]=o.value,this.commonOrigin[o.id]=e;else return ql(`Ignore native tag (singleton): ${t}.${o.id} = ${o.value}`);else if(e===i)!dre(o.id)||this.common[o.id].indexOf(o.value)===-1?this.common[o.id].push(o.value):ql(`Ignore duplicate value: ${t}.${o.id} = ${o.value}`);else if(e{vt=class{constructor(t,o,i){this.metadata=t,this.tokenizer=o,this.options=i}}});var fqe,rt,ui=Ce(()=>{Fs();Ar();er();fqe=/^[\x21-\x7e©][\x20-\x7e\x00()]{3}/,rt={len:4,get:(n,t)=>{let o=br(n.subarray(t,t+rt.len),"latin1");if(!o.match(fqe))throw new An(`FourCC contains invalid characters: ${Ire(o)} "${o}"`);return o},put:(n,t,o)=>{let i=mte(o,"latin1");if(i.length!==4)throw new jl("Invalid length");return n.set(i,t),t+4}}});function Nre(n){return{containsHeader:BO(n,31),containsFooter:BO(n,30),isHeader:BO(n,29),readOnly:BO(n,0),dataType:(n&6)>>1}}function BO(n,t){return(n&1<{DA();ui();of={text_utf8:0,binary:1,external_info:2,reserved:3},p2={len:52,get:(n,t)=>({ID:rt.get(n,t),version:Le.get(n,t+4)/1e3,descriptorBytes:Le.get(n,t+8),headerBytes:Le.get(n,t+12),seekTableBytes:Le.get(n,t+16),headerDataBytes:Le.get(n,t+20),apeFrameDataBytes:Le.get(n,t+24),apeFrameDataBytesHigh:Le.get(n,t+28),terminatingDataBytes:Le.get(n,t+32),fileMD5:new Ot(16).get(n,t+36)})},Tre={len:24,get:(n,t)=>({compressionLevel:SA.get(n,t),formatFlags:SA.get(n,t+2),blocksPerFrame:Le.get(n,t+4),finalFrameBlocks:Le.get(n,t+8),totalFrames:Le.get(n,t+12),bitsPerSample:SA.get(n,t+16),channel:SA.get(n,t+18),sampleRate:Le.get(n,t+20)})},Vi={len:32,get:(n,t)=>({ID:new Ve(8,"ascii").get(n,t),version:Le.get(n,t+8),size:Le.get(n,t+12),fields:Le.get(n,t+16),flags:Nre(Le.get(n,t+20))})},fO={len:8,get:(n,t)=>({size:Le.get(n,t),flags:Nre(Le.get(n,t+4))})}});var Gre={};Fr(Gre,{APEv2Parser:()=>dI,ApeContentError:()=>Kh,tryParseApeHeader:()=>zl});function zl(n,t,o){return new dI(n,t,o).tryParseApeHeader()}var Pre,pI,kre,vre,Kh,dI,Vl=Ce(()=>{Pre=qe(ct(),1);Xo();DA();Ar();zi();Rre();er();Fs();pI=(0,Pre.default)("music-metadata:parser:APEv2"),kre="APEv2",vre="APETAGEX",Kh=class extends Qt("APEv2"){};dI=class n extends vt{constructor(){super(...arguments),this.ape={}}static calculateDuration(t){let o=t.totalFrames>1?t.blocksPerFrame*(t.totalFrames-1):0;return o+=t.finalFrameBlocks,o/t.sampleRate}static async findApeFooterOffset(t,o){let i=new Uint8Array(Vi.len),e=t.position;if(o<=Vi.len){pI(`Offset is too small to read APE footer: offset=${o}`);return}if(o>Vi.len){await t.readBuffer(i,{position:o-Vi.len}),t.setPosition(e);let a=Vi.get(i,0);if(a.ID==="APETAGEX")return a.flags.isHeader?pI(`APE Header found at offset=${o-Vi.len}`):(pI(`APE Footer found at offset=${o-Vi.len}`),o-=a.size),{footer:a,offset:o}}}static parseTagFooter(t,o,i){let e=Vi.get(o,o.length-Vi.len);if(e.ID!==vre)throw new Kh("Unexpected APEv2 Footer ID preamble value");return Co(o),new n(t,Co(o),i).parseTags(e)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position0?this.parseDescriptorExpansion(o):this.parseHeader());return this.metadata.setAudioOnly(),await this.tokenizer.ignore(i.forwardBytes),this.tryParseApeHeader()}async parseTags(t){let o=new Uint8Array(256),i=t.size-Vi.len;pI(`Parse APE tags at offset=${this.tokenizer.position}, size=${i}`);for(let e=0;ethis.metadata.addTag(kre,r,c)));break}case of.binary:if(this.options.skipCovers)await this.tokenizer.ignore(a.size);else{let s=new Uint8Array(a.size);await this.tokenizer.readBuffer(s),A=js(s);let g=br(s.subarray(0,A),"utf-8"),c=s.subarray(A+1);await this.metadata.addTag(kre,r,{description:g,data:c})}break;case of.external_info:pI(`Ignore external info ${r}`),await this.tokenizer.ignore(a.size);break;case of.reserved:pI(`Ignore external info ${r}`),this.metadata.addWarning(`APEv2 header declares a reserved datatype for "${r}"`),await this.tokenizer.ignore(a.size);break}}}async parseDescriptorExpansion(t){return await this.tokenizer.ignore(t),this.parseHeader()}async parseHeader(){let t=await this.tokenizer.readToken(Tre);if(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("container","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),this.metadata.setFormat("numberOfChannels",t.channel),this.metadata.setFormat("duration",n.calculateDuration(t)),!this.ape.descriptor)throw new Kh("Missing APE descriptor");return{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}}});async function Lre(n){if(n.fileInfo.size>=128){let t=new Uint8Array(3),o=n.position;return await n.readBuffer(t,{position:n.fileInfo.size-128}),n.setPosition(o),br(t,"latin1")==="TAG"}return!1}var Fre,QO,xh,yO,hI,mO,nf=Ce(()=>{Fre=qe(ct(),1);DA();Ar();zi();Vl();Fs();QO=(0,Fre.default)("music-metadata:parser:ID3v1"),xh=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"],yO={len:128,get:(n,t)=>{let o=new hI(3).get(n,t);return o==="TAG"?{header:o,title:new hI(30).get(n,t+3),artist:new hI(30).get(n,t+33),album:new hI(30).get(n,t+63),year:new hI(4).get(n,t+93),comment:new hI(28).get(n,t+97),zeroByte:QA.get(n,t+127),track:QA.get(n,t+126),genre:QA.get(n,t+127)}:null}},hI=class{constructor(t){this.len=t,this.stringType=new Ve(t,"latin1")}get(t,o){let i=this.stringType.get(t,o);return i=iO(i),i=i.trim(),i.length>0?i:void 0}},mO=class n extends vt{constructor(t,o,i){super(t,o,i),this.apeHeader=i.apeHeader}static getGenre(t){if(tt){QO("Already consumed the last 128 bytes");return}let o=await this.tokenizer.readToken(yO,t);if(o){QO("ID3v1 header found at: pos=%s",this.tokenizer.fileInfo.size-yO.len);let i=["title","artist","album","comment","track","year"];for(let a of i)o[a]&&o[a]!==""&&await this.addTag(a,o[a]);let e=n.getGenre(o.genre);e&&await this.addTag("genre",e)}else QO("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-yO.len)}async addTag(t,o){await this.metadata.addTag("ID3v1",t,o)}}});var d2,Ure=Ce(()=>{DA();d2={len:16,get:(n,t)=>{let o=xe.get(n,t+8),i=xe.get(n,t+12);return{startTime:xe.get(n,t),endTime:xe.get(n,t+4),startOffset:o===4294967295?void 0:o,endOffset:i===4294967295?void 0:i}}}});function sf(n){switch(n){case 2:return 6;case 3:case 4:return 10;default:throw Hre(n)}}function Qqe(n,t){return t===3?{status:{tag_alter_preservation:GA(n,0,7),file_alter_preservation:GA(n,0,6),read_only:GA(n,0,5)},format:{compression:GA(n,1,7),encryption:GA(n,1,6),grouping_identity:GA(n,1,5),unsynchronisation:!1,data_length_indicator:!1}}:{status:{tag_alter_preservation:GA(n,0,6),file_alter_preservation:GA(n,0,5),read_only:GA(n,0,4)},format:{grouping_identity:GA(n,1,6),compression:GA(n,1,3),encryption:GA(n,1,2),unsynchronisation:GA(n,1,1),data_length_indicator:GA(n,1,0)}}}function gf(n,t,o){switch(t){case 2:return yqe(n,t,o);case 3:case 4:return mqe(n,t,o);default:throw Hre(t)}}function yqe(n,t,o){let i={id:br(n.subarray(0,3),"ascii"),length:Pr.get(n,3)};return i.id.match(/^[A-Z0-9]{3}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${i.id}`),i}function mqe(n,t,o){let i={id:br(n.subarray(0,4),"ascii"),length:(t===4?g2:xe).get(n,4),flags:Qqe(n.subarray(8,10),t)};return i.id.match(/^[A-Z0-9]{4}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${i.id}`),i}function Hre(n){throw new EI(`Unexpected majorVer: ${n}`)}var h2=Ce(()=>{DA();Ar();lI();Fs();E2()});function Sqe(n){let t=[],o,i="";for(let e of n)if(typeof o=="string")if(e==="("&&o==="")i+="(",o=void 0;else if(e===")"){i!==""&&(t.push(i),i="");let a=Kre(o);a&&t.push(a),o=void 0}else o+=e;else e==="("?o="":i+=e;return i&&(t.length===0&&i.match(/^\d*$/)&&(i=Kre(i)),i&&t.push(i)),t}function Kre(n){if(n==="RX")return"Remix";if(n==="CR")return"Cover";if(n.match(/^\d*$/))return xh[Number.parseInt(n,10)]}function wqe(n){throw new EI(`Unexpected majorVer: ${n}`)}var xre,SO,an,C2,wO,EI,E2=Ce(()=>{xre=qe(ct(),1);DA();Ar();lI();nf();er();Ar();Ure();h2();SO=(0,xre.default)("music-metadata:id3v2:frame-parser"),an="latin1",C2={encoding:an,bom:!1};wO=class n{constructor(t,o){this.major=t,this.warningCollector=o}readData(t,o,i){if(t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} header has empty tag type=${o}`);return}let{encoding:e,bom:a}=Uh.get(t,0),A=t.length,r=0,s=[],g=n.getNullTerminatorLength(e),c;switch(SO(`Parsing tag type=${o}, encoding=${e}, bom=${a}`),o!=="TXXX"&&o[0]==="T"?"T*":o){case"T*":case"GRP1":case"GP1":case"IPLS":case"MVIN":case"MVNM":case"PCS":case"PCST":{let I;try{I=n.trimNullPadding(da(t.subarray(1),e))}catch(d){if(d instanceof Error){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} header has invalid string value: ${d.message}`);break}throw d}switch(o){case"TMCL":case"TIPL":case"IPLS":s=n.functionList(this.splitValue(o,I));break;case"TRK":case"TRCK":case"TPOS":case"TIT1":case"TIT2":case"TIT3":s=I;break;case"TCOM":case"TEXT":case"TOLY":case"TOPE":case"TPE1":case"TSRC":s=this.splitValue(o,I);break;case"TCO":case"TCON":s=this.splitValue(o,I).map(d=>Sqe(d)).reduce((d,B)=>d.concat(B),[]);break;case"PCS":case"PCST":s=this.major>=4?this.splitValue(o,I):[I],s=Array.isArray(s)&&s[0]===""?1:0;break;default:s=this.major>=4?this.splitValue(o,I):[I]}break}case"TXXX":{let I=n.readIdentifierAndData(t.subarray(1),e);s={description:I.id,text:this.splitValue(o,da(I.data,e).replace(/\x00+$/,""))};break}case"PIC":case"APIC":if(i){let I={};switch(t=t.subarray(1),this.major){case 2:I.format=da(t.subarray(0,3),"latin1"),t=t.subarray(3);break;case 3:case 4:c=js(t,an),I.format=da(t.subarray(0,c),an),t=t.subarray(c+1);break;default:throw wqe(this.major)}I.format=n.fixPictureMimeType(I.format),I.type=Gh[t[0]],t=t.subarray(1),c=js(t,e),I.description=da(t.subarray(0,c),e),t=t.subarray(c+g),I.data=t,s=I}break;case"CNT":case"PCNT":s=s2(t);break;case"SYLT":{let I=I2.get(t,0);t=t.subarray(I2.len);let d={descriptor:"",language:I.language,contentType:I.contentType,timeStampFormat:I.timeStampFormat,syncText:[]},B=!1;for(;t.length>0;){let f=n.readNullTerminatedString(t,I.encoding);if(t=t.subarray(f.len),B){let Q=xe.get(t,0);t=t.subarray(xe.len),d.syncText.push({text:f.text,timestamp:Q})}else d.descriptor=f.text,B=!0}s=d;break}case"ULT":case"USLT":case"COM":case"COMM":{let I=oO.get(t,r);r+=oO.len;let d=n.readNullTerminatedString(t.subarray(r),I.encoding);r+=d.len;let B=n.readNullTerminatedString(t.subarray(r),I.encoding);s={language:I.language,descriptor:d.text,text:B.text};break}case"UFID":{let I=n.readIdentifierAndData(t,an);s={owner_identifier:I.id,identifier:I.data};break}case"PRIV":{let I=n.readIdentifierAndData(t,an);s={owner_identifier:I.id,data:I.data};break}case"POPM":{t=t.subarray(r);let I=n.readNullTerminatedString(t,C2),d=I.text;if(t=t.subarray(I.len),t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} POPM frame missing rating byte`),s={email:d,rating:0,counter:void 0};break}let B=QA.get(t,0),f=t.subarray(QA.len);s={email:d,rating:B,counter:f.length>0?s2(f):void 0};break}case"GEOB":{let I=Uh.get(t,0);t=t.subarray(1);let d=n.readNullTerminatedString(t,C2),B=d.text;t=t.subarray(d.len);let f=n.readNullTerminatedString(t,I),Q=f.text;t=t.subarray(f.len);let y=n.readNullTerminatedString(t,I),m=y.text;t=t.subarray(y.len),s={type:B,filename:Q,description:m,data:t};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":s=n.readNullTerminatedString(t,C2).text;break;case"WXXX":{let I=Uh.get(t,0);t=t.subarray(1);let d=n.readNullTerminatedString(t,I),B=d.text;t=t.subarray(d.len),s={description:B,url:n.trimNullPadding(da(t,an))};break}case"WFD":case"WFED":{let I=Uh.get(t,0);t=t.subarray(1),s=n.readNullTerminatedString(t,I).text;break}case"MCDI":{s=t.subarray(0,A);break}case"CHAP":{SO("Reading CHAP"),c=js(t,an);let I={label:da(t.subarray(0,c),an),info:d2.get(t,c+1),frames:new Map};for(r+=c+1+d2.len;r=a.length)return{text:da(t,o.encoding),len:e};let r=t.subarray(0,i+A);return{text:da(r,o.encoding),len:i+A+n.getNullTerminatorLength(o.encoding)}}static fixPictureMimeType(t){switch(t=t.toLocaleLowerCase(),t){case"jpg":return"image/jpeg";case"png":return"image/png"}return t}static functionList(t){let o={};for(let i=0;i+11?this.warningCollector.addWarning(`ID3v2.${this.major} ${t} uses non standard null-separator.`):i=o.split(/\//g)):i=o.split(/\x00/g),n.trimArray(i)}static trimArray(t){return t.map(o=>n.trimNullPadding(o).trim())}static trimNullPadding(t){let o=t.length;for(;o>0&&t.charCodeAt(o-1)===0;)o--;return o===t.length?t:t.slice(0,o)}static readIdentifierAndData(t,o){let i=n.readNullTerminatedString(t,{encoding:o,bom:!1});return{id:i.text,data:t.subarray(i.len)}}static getNullTerminatorLength(t){return t.startsWith("utf-16")?2:1}},EI=class extends Qt("id3v2"){}});function Dqe(n){throw new EI(`Unexpected majorVer: ${n}`)}var on,Yh=Ce(()=>{DA();E2();lI();h2();on=class n{constructor(){this.tokenizer=void 0,this.id3Header=void 0,this.metadata=void 0,this.headerType=void 0,this.options=void 0}static removeUnsyncBytes(t){let o=0,i=0;for(;o0?this.parseExtendedHeaderData(o,t.size):this.parseId3Data(this.id3Header.size-t.size)}async parseExtendedHeaderData(t,o){return await this.tokenizer.ignore(t),this.parseId3Data(this.id3Header.size-o)}async parseId3Data(t){let o=await this.tokenizer.readToken(new Ot(t));for(let i of this.parseMetadata(o))switch(i.id){case"TXXX":i.value&&await this.handleTag(i,i.value.text,()=>i.value.description);break;default:await(Array.isArray(i.value)?Promise.all(i.value.map(e=>this.addTag(i.id,e))):this.addTag(i.id,i.value))}}async handleTag(t,o,i,e=a=>a){await Promise.all(o.map(a=>this.addTag(n.makeDescriptionTagName(t.id,i(a)),e(a))))}async addTag(t,o){await this.metadata.addTag(this.headerType,t,o)}parseMetadata(t){let o=0,i=[];for(;o!==t.length;){let e=sf(this.id3Header.version.major);if(o+e>t.length){this.metadata.addWarning("Illegal ID3v2 tag length");break}let a=t.subarray(o,o+e);o+=e;let A=gf(a,this.id3Header.version.major,this.metadata),r=t.subarray(o,o+A.length);o+=A.length;let s=n.readFrameData(r,A,this.id3Header.version.major,!this.options.skipCovers,this.metadata);s&&i.push({id:A.id,value:s})}return i}static mapId3v2Chapters(t){if(!t)return;let o=t.filter(g=>g.id==="CHAP");if(!o?.length)return;let e=t.filter(g=>g.id==="CTOC")?.find(g=>g.value.flags?.topLevel),a=new Map;for(let g of o)a.set(g.value.label,g.value);let A=e?.value.childElementIds,r=[],s=A??[...a.keys()];for(let g of s){let c=a.get(g);if(!c)continue;let I=c.frames,d=I.get("TIT2");d&&r.push({id:g,title:d,url:I.get("WXXX"),start:c.info.startTime/1e3,end:c.info.endTime/1e3,image:I.get("APIC")})}return A||r.sort((g,c)=>g.start-c.start),r.length?r:void 0}}});var Yre,u2,Js,cf=Ce(()=>{Xo();Yre=qe(ct(),1);lI();Yh();nf();zi();u2=(0,Yre.default)("music-metadata:parser:ID3"),Js=class extends vt{constructor(){super(...arguments),this.id3parser=new on}static async startsWithID3v2Header(t){return(await t.peekToken(rf)).fileIdentifier==="ID3"}async parse(){try{await this.parseID3v2()}catch(t){if(t instanceof kA)u2("End-of-stream");else throw t}}finalize(){}async parseID3v2(){await this.tryReadId3v2Headers(),u2("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this.postId3v2Parse(),this.options.skipPostHeaders&&this.metadata.hasAny()?this.finalize():(await new mO(this.metadata,this.tokenizer,this.options).parse(),this.finalize())}async tryReadId3v2Headers(){if((await this.tokenizer.peekToken(rf)).fileIdentifier==="ID3")return u2("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}});var B2,jre=Ce(()=>{Ar();B2={len:2,get:(n,t)=>{let o=ZA(n,t,0,3),i=ZA(n,t,6,1),e=ZA(n,t,7,9)/10;if(o>0)return{type:ZA(n,t,0,3),origin:ZA(n,t,3,3),adjustment:i?-e:e}}}});var Jre,qre=Ce(()=>{DA();Ar();jre();Jre={len:27,get:(n,t)=>{let o=xe.get(n,t+2);return{revision:ZA(n,t,0,4),vbr_method:ZA(n,t,4,4),lowpass_filter:100*QA.get(n,t+1),track_peak:o===0?null:o/2**23,track_gain:B2.get(n,6),album_gain:B2.get(n,8),music_length:xe.get(n,t+20),music_crc:QA.get(n,t+24),header_crc:LA.get(n,t+24)}}}});async function zre(n){let t=await n.readToken(Oqe),o={numFrames:null,streamSize:null,vbrScale:null};if(t.frames&&(o.numFrames=await n.readToken(xe)),t.bytes&&(o.streamSize=await n.readToken(xe)),t.toc&&(o.toc=new Uint8Array(100),await n.readBuffer(o.toc)),t.vbrScale&&(o.vbrScale=await n.readToken(xe)),await n.peekToken(new Ve(4,"ascii"))==="LAME"){await n.ignore(4),o.lame={version:await n.readToken(new Ve(5,"ascii"))};let e=o.lame.version.match(/\d+.\d+/g);if(e!==null){let A=e[0].split(".").map(r=>Number.parseInt(r,10));A[0]>=3&&A[1]>=90&&(o.lame.extended=await n.readToken(Jre))}}return o}var f2,DO,Oqe,Vre=Ce(()=>{DA();Ar();qre();f2=new Ve(4,"ascii"),DO=new Ve(6,"ascii"),Oqe={len:4,get:(n,t)=>({frames:Ta(n,t,31),bytes:Ta(n,t,30),toc:Ta(n,t,29),vbrScale:Ta(n,t,28)})}});var eae={};Fr(eae,{MpegContentError:()=>Wl,MpegParser:()=>Q2});function Mqe(n){return`V${Math.floor((100-n)/10)}`}var $re,uo,Wl,Wre,Zre,bqe,Bo,Xre,Q2,Aae=Ce(()=>{DA();Xo();$re=qe(ct(),1);Ar();cf();Vre();er();uo=(0,$re.default)("music-metadata:parser:mpeg"),Wl=class extends Qt("MPEG"){},Wre=1024,Zre={AudioObjectTypes:["AAC Main","AAC LC","AAC SSR","AAC LTP"],SamplingFrequencies:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,null,null,null]},bqe=[void 0,["front-center"],["front-left","front-right"],["front-center","front-left","front-right"],["front-center","front-left","front-right","back-center"],["front-center","front-left","front-right","back-left","back-right"],["front-center","front-left","front-right","back-left","back-right","LFE-channel"],["front-center","front-left","front-right","side-left","side-right","back-left","back-right","LFE-channel"]],Bo=class n{constructor(t,o){this.bitrateIndex=null,this.sampRateFreqIndex=null,this.padding=null,this.privateBit=null,this.channelModeIndex=null,this.modeExtension=null,this.isOriginalMedia=null,this.version=null,this.bitrate=null,this.samplingRate=null,this.frameLength=0,this.versionIndex=ZA(t,o+1,3,2),this.layer=n.LayerDescription[ZA(t,o+1,5,2)],this.versionIndex>1&&this.layer===0?this.parseAdtsHeader(t,o):this.parseMpegHeader(t,o),this.isProtectedByCRC=!Ta(t,o+1,7)}calcDuration(t){return this.samplingRate==null?null:t*this.calcSamplesPerFrame()/this.samplingRate}calcSamplesPerFrame(){return n.samplesInFrameTable[this.version===1?0:1][this.layer]}calculateSideInfoLength(){if(this.layer!==3)return 2;if(this.channelModeIndex===3){if(this.version===1)return 17;if(this.version===2||this.version===2.5)return 9}else{if(this.version===1)return 32;if(this.version===2||this.version===2.5)return 17}return null}calcSlotSize(){return[null,4,1,1][this.layer]}parseMpegHeader(t,o){this.container="MPEG",this.bitrateIndex=ZA(t,o+2,0,4),this.sampRateFreqIndex=ZA(t,o+2,4,2),this.padding=Ta(t,o+2,6),this.privateBit=Ta(t,o+2,7),this.channelModeIndex=ZA(t,o+3,0,2),this.modeExtension=ZA(t,o+3,2,2),this.isCopyrighted=Ta(t,o+3,4),this.isOriginalMedia=Ta(t,o+3,5),this.emphasis=ZA(t,o+3,7,2),this.version=n.VersionID[this.versionIndex],this.channelMode=n.ChannelMode[this.channelModeIndex],this.codec=`MPEG ${this.version} Layer ${this.layer}`;let i=this.calcBitrate();if(!i)throw new Wl("Cannot determine bit-rate");if(this.bitrate=i*1e3,this.samplingRate=this.calcSamplingRate(),this.samplingRate==null)throw new Wl("Cannot determine sampling-rate")}parseAdtsHeader(t,o){uo("layer=0 => ADTS"),this.version=this.versionIndex===2?4:2,this.container=`ADTS/MPEG-${this.version}`;let i=ZA(t,o+2,0,2);this.codec="AAC",this.codecProfile=Zre.AudioObjectTypes[i],uo(`MPEG-4 audio-codec=${this.codec}`);let e=ZA(t,o+2,2,4);this.samplingRate=Zre.SamplingFrequencies[e],uo(`sampling-rate=${this.samplingRate}`);let a=ZA(t,o+2,7,3);this.mp4ChannelConfig=bqe[a],uo(`channel-config=${this.mp4ChannelConfig?this.mp4ChannelConfig.join("+"):"?"}`),this.frameLength=ZA(t,o+3,6,2)<<11}calcBitrate(){if(this.bitrateIndex===0||this.bitrateIndex===15)return null;if(this.version&&this.bitrateIndex){let t=10*Math.floor(this.version)+this.layer;return n.bitrate_index[this.bitrateIndex][t]}return null}calcSamplingRate(){return this.sampRateFreqIndex===3||this.version===null||this.sampRateFreqIndex==null?null:n.sampling_rate_freq_index[this.version][this.sampRateFreqIndex]}};Bo.SyncByte1=255;Bo.SyncByte2=224;Bo.VersionID=[2.5,null,2,1];Bo.LayerDescription=[0,3,2,1];Bo.ChannelMode=["stereo","joint_stereo","dual_channel","mono"];Bo.bitrate_index={1:{11:32,12:32,13:32,21:32,22:8,23:8},2:{11:64,12:48,13:40,21:48,22:16,23:16},3:{11:96,12:56,13:48,21:56,22:24,23:24},4:{11:128,12:64,13:56,21:64,22:32,23:32},5:{11:160,12:80,13:64,21:80,22:40,23:40},6:{11:192,12:96,13:80,21:96,22:48,23:48},7:{11:224,12:112,13:96,21:112,22:56,23:56},8:{11:256,12:128,13:112,21:128,22:64,23:64},9:{11:288,12:160,13:128,21:144,22:80,23:80},10:{11:320,12:192,13:160,21:160,22:96,23:96},11:{11:352,12:224,13:192,21:176,22:112,23:112},12:{11:384,12:256,13:224,21:192,22:128,23:128},13:{11:416,12:320,13:256,21:224,22:144,23:144},14:{11:448,12:384,13:320,21:256,22:160,23:160}};Bo.sampling_rate_freq_index={1:{0:44100,1:48e3,2:32e3},2:{0:22050,1:24e3,2:16e3},2.5:{0:11025,1:12e3,2:8e3}};Bo.samplesInFrameTable=[[0,384,1152,1152],[0,384,1152,576]];Xre={len:4,get:(n,t)=>new Bo(n,t)};Q2=class extends Js{constructor(){super(...arguments),this.frameCount=0,this.syncFrameCount=-1,this.totalDataLength=0,this.bitrates=[],this.offset=0,this.frame_size=0,this.calculateEofDuration=!1,this.samplesPerFrame=null,this.buf_frame_header=new Uint8Array(4),this.mpegOffset=null,this.syncPeek={buf:new Uint8Array(Wre),len:0}}async postId3v2Parse(){this.metadata.setFormat("lossless",!1),this.metadata.setAudioOnly();try{let t=!1;for(;!t;)await this.sync(),t=await this.parseCommonMpegHeader()}catch(t){if(t instanceof kA){if(uo("End-of-stream"),this.calculateEofDuration&&this.samplesPerFrame!==null){let o=this.frameCount*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.format.sampleRate){let i=o/this.metadata.format.sampleRate;uo(`Calculate duration at EOF: ${i} sec.`,i),this.metadata.setFormat("duration",i)}}}else throw t}}finalize(){let t=this.metadata.format,o=!!this.metadata.native.ID3v1;if(this.mpegOffset!==null){if(t.duration&&this.tokenizer.fileInfo.size){let i=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);t.codecProfile&&t.codecProfile[0]==="V"&&this.metadata.setFormat("bitrate",i*8/t.duration)}if(this.tokenizer.fileInfo.size&&t.codecProfile==="CBR"){let i=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);if(this.frame_size!==null&&this.samplesPerFrame!==null){let e=Math.round(i/this.frame_size)*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",e),t.sampleRate&&!t.duration){let a=e/t.sampleRate;uo("Calculate CBR duration based on file size: %s",a),this.metadata.setFormat("duration",a)}}}}}async sync(){let t=!1;for(;;){let o=0;if(this.syncPeek.len=await this.tokenizer.peekBuffer(this.syncPeek.buf,{length:Wre,mayBeLess:!0}),this.syncPeek.len<=163)throw new kA;for(;;){if(t&&(this.syncPeek.buf[o]&224)===224){this.buf_frame_header[0]=Bo.SyncByte1,this.buf_frame_header[1]=this.syncPeek.buf[o],await this.tokenizer.ignore(o),uo(`Sync at offset=${this.tokenizer.position-1}, frameCount=${this.frameCount}`),this.syncFrameCount===this.frameCount&&(uo(`Re-synced MPEG stream, frameCount=${this.frameCount}`),this.frameCount=0,this.frame_size=0),this.syncFrameCount=this.frameCount;return}if(t=!1,o=this.syncPeek.buf.indexOf(Bo.SyncByte1,o),o===-1){if(this.syncPeek.len=2&&t.layer===0?this.parseAdts(t):this.parseAudioFrameHeader(t)}async parseAudioFrameHeader(t){this.metadata.setFormat("numberOfChannels",t.channelMode==="mono"?1:2),this.metadata.setFormat("bitrate",t.bitrate),this.frameCount<20*1e4&&uo("offset=%s MP%s bitrate=%s sample-rate=%s",this.tokenizer.position-4,t.layer,t.bitrate,t.samplingRate);let o=t.calcSlotSize();if(o===null)throw new Wl("invalid slot_size");let i=t.calcSamplesPerFrame();uo(`samples_per_frame=${i}`);let e=i/8;if(t.bitrate!==null&&t.samplingRate!=null){let a=e*t.bitrate/t.samplingRate+(t.padding?o:0);this.frame_size=Math.floor(a)}if(this.audioFrameHeader=t,t.bitrate!==null&&this.bitrates.push(t.bitrate),this.frameCount===1)return this.offset=Xre.len,await this.skipSideInformation(),!1;if(this.frameCount===4){if(this.areAllSame(this.bitrates)){if(this.samplesPerFrame=i,this.metadata.setFormat("codecProfile","CBR"),this.tokenizer.fileInfo.size)return!0}else if(this.metadata.format.duration)return!0;if(!this.options.duration)return!0}return this.options.duration&&this.frameCount===4&&(this.samplesPerFrame=i,this.calculateEofDuration=!0),this.offset=4,t.isProtectedByCRC?(await this.parseCrc(),!1):(await this.skipSideInformation(),!1)}async parseAdts(t){let o=new Uint8Array(3);if(await this.tokenizer.readBuffer(o),t.frameLength+=ZA(o,0,0,11),this.totalDataLength+=t.frameLength,this.samplesPerFrame=1024,t.samplingRate!==null){let i=t.samplingRate/this.samplesPerFrame,a=8*(this.frameCount===0?0:this.totalDataLength/this.frameCount)*i+.5;this.metadata.setFormat("bitrate",a),uo(`frame-count=${this.frameCount}, size=${t.frameLength} bytes, bit-rate=${a}`)}if(await this.tokenizer.ignore(t.frameLength>7?t.frameLength-7:1),this.frameCount===3)if(this.metadata.setFormat("codecProfile",t.codecProfile),t.mp4ChannelConfig&&this.metadata.setFormat("numberOfChannels",t.mp4ChannelConfig.length),this.options.duration)this.calculateEofDuration=!0;else return!0;return!1}async parseCrc(){return await this.tokenizer.ignore($o.len),this.offset+=$o.len,this.skipSideInformation()}async skipSideInformation(){if(this.audioFrameHeader){let t=this.audioFrameHeader.calculateSideInfoLength();if(t!==null){await this.tokenizer.readToken(new Ot(t)),this.offset+=t,await this.readXtraInfoHeader();return}}}async readXtraInfoHeader(){let t=await this.tokenizer.readToken(f2);switch(this.offset+=f2.len,t){case"Info":return this.metadata.setFormat("codecProfile","CBR"),this.readXingInfoHeader();case"Xing":{let i=await this.readXingInfoHeader();if(i.vbrScale!==null){let e=Mqe(i.vbrScale);this.metadata.setFormat("codecProfile",e)}return null}case"Xtra":break;case"LAME":{let i=await this.tokenizer.readToken(DO);if(this.frame_size!==null&&this.frame_size>=this.offset+DO.len)return this.offset+=DO.len,this.metadata.setFormat("tool",`LAME ${i}`),await this.skipFrameData(this.frame_size-this.offset),null;this.metadata.addWarning("Corrupt LAME header");break}}let o=this.frame_size-this.offset;return o<0?this.metadata.addWarning(`Frame ${this.frameCount}corrupt: negative frameDataLeft`):await this.skipFrameData(o),null}async readXingInfoHeader(){let t=this.tokenizer.position,o=await zre(this.tokenizer);if(this.offset+=this.tokenizer.position-t,o.lame&&(this.metadata.setFormat("tool",`LAME ${tn(o.lame.version)}`),o.lame.extended&&(this.metadata.setFormat("trackPeakLevel",o.lame.extended.track_peak),o.lame.extended.track_gain&&this.metadata.setFormat("trackGain",o.lame.extended.track_gain.adjustment),o.lame.extended.album_gain&&this.metadata.setFormat("albumGain",o.lame.extended.album_gain.adjustment),this.metadata.setFormat("duration",o.lame.extended.music_length/1e3))),o.streamSize&&this.audioFrameHeader&&o.numFrames!==null){let e=this.audioFrameHeader.calcDuration(o.numFrames);return this.metadata.setFormat("duration",e),uo("Get duration from Xing header: %s",this.metadata.format.duration),o}let i=this.frame_size-this.offset;return await this.skipFrameData(i),o}async skipFrameData(t){if(t<0)throw new Wl("frame-data-left cannot be negative");await this.tokenizer.ignore(t)}areAllSame(t){let o=t[0];return t.every(i=>i===o)}}});var tae,rae=Ce(()=>{tae={parserType:"mpeg",extensions:[".mp2",".mp3",".m2a",".aac","aacp"],mimeTypes:["audio/mpeg","audio/mp3","audio/aacs","audio/aacp"],async load(){return(await Promise.resolve().then(()=>(Aae(),eae))).MpegParser}}});var aae,iae=Ce(()=>{aae={parserType:"apev2",extensions:[".ape"],mimeTypes:["audio/ape","audio/monkeys-audio"],async load(){return(await Promise.resolve().then(()=>(Vl(),Gre))).APEv2Parser}}});function y2(n){let t=n.trim();if(t.length!==36||t[8]!=="-"||t[13]!=="-"||t[18]!=="-"||t[23]!=="-")throw new Error(`Invalid GUID format: ${n}`);let o,i=new Uint8Array(16);o=parseInt(t.slice(0,8),16),i[0]=o&255,i[1]=o>>>8&255,i[2]=o>>>16&255,i[3]=o>>>24&255,o=parseInt(t.slice(9,13),16),i[4]=o&255,i[5]=o>>>8&255,o=parseInt(t.slice(14,18),16),i[6]=o&255,i[7]=o>>>8&255,o=parseInt(t.slice(19,23),16),i[8]=o>>>8&255,i[9]=o&255,o=parseInt(t.slice(24,32),16),i[10]=o>>>24&255,i[11]=o>>>16&255,i[12]=o>>>8&255,i[13]=o&255,o=parseInt(t.slice(32,36),16),i[14]=o>>>8&255,i[15]=o&255;for(let e=0;e<16;e++)if(!Number.isFinite(i[e]))throw new Error(`Invalid GUID format: ${n}`);if(!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t))throw new Error(`Invalid GUID format: ${n}`);return i}var OO,oae=Ce(()=>{OO=class n{constructor(t){if(t.length!==16)throw new Error("GUID must be exactly 16 bytes");this.bytes=t}static fromString(t){return new n(y2(t))}toString(){let t=this.bytes,o=s=>s.toString(16).padStart(2,"0"),i=o(t[3])+o(t[2])+o(t[1])+o(t[0]),e=o(t[5])+o(t[4]),a=o(t[7])+o(t[6]),A=o(t[8])+o(t[9]),r=o(t[10])+o(t[11])+o(t[12])+o(t[13])+o(t[14])+o(t[15]);return`${i}-${e}-${a}-${A}-${r}`.toUpperCase()}equals(t,o=0){if(o<0||t.length-o<16)return!1;let i=this.bytes;for(let e=0;e<16;e++)if(t[o+e]!==i[e])return!1;return!0}}});var Ye,tr,m2=Ce(()=>{oae();Ye=class n{static fromBin(t,o=0){return new n(n.decode(t,o))}static decode(t,o=0){return new OO(t.subarray(o,o+16)).toString()}static decodeMediaType(t){switch(t.str){case n.AudioMedia.str:return"audio";case n.VideoMedia.str:return"video";case n.CommandMedia.str:return"command";case n.Degradable_JPEG_Media.str:return"degradable-jpeg";case n.FileTransferMedia.str:return"file-transfer";case n.BinaryMedia.str:return"binary"}}static encode(t){return y2(t)}constructor(t){this.str=t}equals(t){return this.str===t.str}toBin(){return n.encode(this.str)}};Ye.HeaderObject=new Ye("75B22630-668E-11CF-A6D9-00AA0062CE6C");Ye.DataObject=new Ye("75B22636-668E-11CF-A6D9-00AA0062CE6C");Ye.SimpleIndexObject=new Ye("33000890-E5B1-11CF-89F4-00A0C90349CB");Ye.IndexObject=new Ye("D6E229D3-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexObject=new Ye("FEB103F8-12AD-4C64-840F-2A1D2F7AD48C");Ye.TimecodeIndexObject=new Ye("3CB73FD0-0C4A-4803-953D-EDF7B6228F0C");Ye.FilePropertiesObject=new Ye("8CABDCA1-A947-11CF-8EE4-00C00C205365");Ye.StreamPropertiesObject=new Ye("B7DC0791-A9B7-11CF-8EE6-00C00C205365");Ye.HeaderExtensionObject=new Ye("5FBF03B5-A92E-11CF-8EE3-00C00C205365");Ye.CodecListObject=new Ye("86D15240-311D-11D0-A3A4-00A0C90348F6");Ye.ScriptCommandObject=new Ye("1EFB1A30-0B62-11D0-A39B-00A0C90348F6");Ye.MarkerObject=new Ye("F487CD01-A951-11CF-8EE6-00C00C205365");Ye.BitrateMutualExclusionObject=new Ye("D6E229DC-35DA-11D1-9034-00A0C90349BE");Ye.ErrorCorrectionObject=new Ye("75B22635-668E-11CF-A6D9-00AA0062CE6C");Ye.ContentDescriptionObject=new Ye("75B22633-668E-11CF-A6D9-00AA0062CE6C");Ye.ExtendedContentDescriptionObject=new Ye("D2D0A440-E307-11D2-97F0-00A0C95EA850");Ye.ContentBrandingObject=new Ye("2211B3FA-BD23-11D2-B4B7-00A0C955FC6E");Ye.StreamBitratePropertiesObject=new Ye("7BF875CE-468D-11D1-8D82-006097C9A2B2");Ye.ContentEncryptionObject=new Ye("2211B3FB-BD23-11D2-B4B7-00A0C955FC6E");Ye.ExtendedContentEncryptionObject=new Ye("298AE614-2622-4C17-B935-DAE07EE9289C");Ye.DigitalSignatureObject=new Ye("2211B3FC-BD23-11D2-B4B7-00A0C955FC6E");Ye.PaddingObject=new Ye("1806D474-CADF-4509-A4BA-9AABCB96AAE8");Ye.ExtendedStreamPropertiesObject=new Ye("14E6A5CB-C672-4332-8399-A96952065B5A");Ye.AdvancedMutualExclusionObject=new Ye("A08649CF-4775-4670-8A16-6E35357566CD");Ye.GroupMutualExclusionObject=new Ye("D1465A40-5A79-4338-B71B-E36B8FD6C249");Ye.StreamPrioritizationObject=new Ye("D4FED15B-88D3-454F-81F0-ED5C45999E24");Ye.BandwidthSharingObject=new Ye("A69609E6-517B-11D2-B6AF-00C04FD908E9");Ye.LanguageListObject=new Ye("7C4346A9-EFE0-4BFC-B229-393EDE415C85");Ye.MetadataObject=new Ye("C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA");Ye.MetadataLibraryObject=new Ye("44231C94-9498-49D1-A141-1D134E457054");Ye.IndexParametersObject=new Ye("D6E229DF-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexParametersObject=new Ye("6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7");Ye.TimecodeIndexParametersObject=new Ye("F55E496D-9797-4B5D-8C8B-604DFE9BFB24");Ye.CompatibilityObject=new Ye("26F18B5D-4584-47EC-9F5F-0E651F0452C9");Ye.AdvancedContentEncryptionObject=new Ye("43058533-6981-49E6-9B74-AD12CB86D58C");Ye.AudioMedia=new Ye("F8699E40-5B4D-11CF-A8FD-00805F5C442B");Ye.VideoMedia=new Ye("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B");Ye.CommandMedia=new Ye("59DACFC0-59E6-11D0-A3AC-00A0C90348F6");Ye.JFIF_Media=new Ye("B61BE100-5B4E-11CF-A8FD-00805F5C442B");Ye.Degradable_JPEG_Media=new Ye("35907DE0-E415-11CF-A917-00805F5C442B");Ye.FileTransferMedia=new Ye("91BD222C-F21C-497A-8B6D-5AA86BFC0185");Ye.BinaryMedia=new Ye("3AFB65E2-47EF-40F2-AC2C-70A90D71D343");Ye.ASF_Index_Placeholder_Object=new Ye("D9AADE20-7C17-4F9C-BC28-8555DD98E2A2");tr=Ye});function sae(n){return _qe[n]}function If(n){return tn(da(n,"utf-16le"))}function nae(n){return new Uint8Array(n)}function Tqe(n,t=0){return gae(n,t)===1}function Nqe(n,t=0){return Le.get(n,t)}function Rqe(n,t=0){return Gr.get(n,t)}function gae(n,t=0){return SA.get(n,t)}var _qe,cae=Ce(()=>{DA();Ar();_qe=[If,nae,Tqe,Nqe,Rqe,gae,nae]});async function Iae(n){let t=await n.readNumber(SA);return(await n.readToken(new Ve(t*2,"utf-16le"))).replace("\0","")}async function pae(n){let t=await n.readToken(kqe),o=[];for(let i=0;i{DA();Ar();m2();cae();lI();er();jh=class extends Qt("ASF"){},lae={len:30,get:(n,t)=>({objectId:tr.fromBin(n,t),objectSize:Number(Gr.get(n,t+16)),numberOfHeaderObjects:Le.get(n,t+24)})},CI={len:24,get:(n,t)=>({objectId:tr.fromBin(n,t),objectSize:Number(Gr.get(n,t+16))})},Vg=class{constructor(t){this.len=Number(t.objectSize)-CI.len}postProcessTag(t,o,i,e){if(o==="WM/Picture")t.push({id:o,value:S2.fromBuffer(e)});else{let a=sae(i);if(!a)throw new jh(`unexpected value headerType: ${i}`);t.push({id:o,value:a(e)})}}},lf=class extends Vg{get(t,o){return null}},Jh=class extends Vg{get(t,o){return{fileId:tr.fromBin(t,o),fileSize:Gr.get(t,o+16),creationDate:Gr.get(t,o+24),dataPacketsCount:Gr.get(t,o+32),playDuration:Gr.get(t,o+40),sendDuration:Gr.get(t,o+48),preroll:Gr.get(t,o+56),flags:{broadcast:GA(t,o+64,24),seekable:GA(t,o+64,25)},minimumDataPacketSize:Le.get(t,o+68),maximumDataPacketSize:Le.get(t,o+72),maximumBitrate:Le.get(t,o+76)}}};Jh.guid=tr.FilePropertiesObject;qh=class extends Vg{get(t,o){return{streamType:tr.decodeMediaType(tr.fromBin(t,o)),errorCorrectionType:tr.fromBin(t,o+8)}}};qh.guid=tr.StreamPropertiesObject;zh=class{constructor(){this.len=22}get(t,o){let i=new DataView(t.buffer,o);return{reserved1:tr.fromBin(t,o),reserved2:i.getUint16(16,!0),extensionDataSize:i.getUint16(18,!0)}}};zh.guid=tr.HeaderExtensionObject;kqe={len:20,get:(n,t)=>({entryCount:new DataView(n.buffer,t).getUint16(16,!0)})};Zl=class n extends Vg{get(t,o){let i=[],e=new DataView(t.buffer,o),a=10;for(let A=0;A0){let s=n.contentDescTags[A],g=a+r;i.push({id:s,value:If(t.subarray(o+a,o+g))}),a=g}}return i}};Zl.guid=tr.ContentDescriptionObject;Zl.contentDescTags=["Title","Author","Copyright","Description","Rating"];Vh=class extends Vg{get(t,o){let i=[],e=new DataView(t.buffer,o),a=e.getUint16(0,!0),A=2;for(let r=0;rO2});var dae,D2,Fqe,O2,Eae=Ce(()=>{dae=qe(ct(),1);Jl();m2();w2();zi();w2();D2=(0,dae.default)("music-metadata:parser:ASF"),Fqe="asf",O2=class extends vt{async parse(){let t=await this.tokenizer.readToken(lae);if(!t.objectId.equals(tr.HeaderObject))throw new jh(`expected asf header; but was not found; got: ${t.objectId.str}`);await this.parseObjectHeader(t.numberOfHeaderObjects)}async parseObjectHeader(t){let o;do{let i=await this.tokenizer.readToken(CI);switch(D2("header GUID=%s",i.objectId.str),i.objectId.str){case Jh.guid.str:{let e=await this.tokenizer.readToken(new Jh(i));this.metadata.setFormat("duration",Number(e.playDuration/BigInt(1e3))/1e4-Number(e.preroll)/1e3),this.metadata.setFormat("bitrate",e.maximumBitrate);break}case qh.guid.str:{let e=await this.tokenizer.readToken(new qh(i));this.metadata.setFormat("container",`ASF/${e.streamType}`);break}case zh.guid.str:{let e=await this.tokenizer.readToken(new zh);await this.parseExtensionObject(e.extensionDataSize);break}case Zl.guid.str:o=await this.tokenizer.readToken(new Zl(i)),await this.addTags(o);break;case Vh.guid.str:o=await this.tokenizer.readToken(new Vh(i)),await this.addTags(o);break;case tr.CodecListObject.str:{let e=await pae(this.tokenizer);e.forEach(A=>{this.metadata.addStreamInfo({type:A.type.videoCodec?pa.video:pa.audio,codecName:A.codecName})});let a=e.filter(A=>A.type.audioCodec).map(A=>A.codecName).join("/");this.metadata.setFormat("codec",a);break}case tr.StreamBitratePropertiesObject.str:await this.tokenizer.ignore(i.objectSize-CI.len);break;case tr.PaddingObject.str:D2("Padding: %s bytes",i.objectSize-CI.len),await this.tokenizer.ignore(i.objectSize-CI.len);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${i.objectId.str}`),D2("Ignore ASF-Object-GUID: %s",i.objectId.str),await this.tokenizer.readToken(new lf(i))}}while(--t)}async addTags(t){await Promise.all(t.map(({id:o,value:i})=>this.metadata.addTag(Fqe,o,i)))}async parseExtensionObject(t){do{let o=await this.tokenizer.readToken(CI),i=o.objectSize-CI.len;if(i<0)throw new jh(`Invalid ASF header object size: ${o.objectSize}`);switch(o.objectId.str){case Wh.guid.str:await this.tokenizer.readToken(new Wh(o));break;case Xl.guid.str:{let e=await this.tokenizer.readToken(new Xl(o));await this.addTags(e);break}case Zh.guid.str:{let e=await this.tokenizer.readToken(new Zh(o));await this.addTags(e);break}case tr.PaddingObject.str:await this.tokenizer.ignore(i);break;case tr.CompatibilityObject.str:await this.tokenizer.ignore(i);break;case tr.ASF_Index_Placeholder_Object.str:await this.tokenizer.ignore(i);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${o.objectId.str}`),await this.tokenizer.readToken(new lf(o));break}t-=o.objectSize}while(t>0)}}});var Cae,uae=Ce(()=>{Cae={parserType:"asf",extensions:[".asf",".wma",".wmv"],mimeTypes:["audio/ms-wma","video/ms-wmv","audio/ms-asf","video/ms-asf","application/vnd.ms-asf"],async load(){return(await Promise.resolve().then(()=>(Eae(),hae))).AsfParser}}});var $l,Bae=Ce(()=>{DA();ui();$l={len:12,get:(n,t)=>({chunkID:rt.get(n,t),chunkSize:qL.get(n,t+4)})}});var Qae={};Fr(Qae,{DsdiffContentParseError:()=>Xh,DsdiffParser:()=>b2});var fae,Bi,Xh,b2,yae=Ce(()=>{DA();fae=qe(ct(),1);Xo();ui();zi();Yh();Bae();er();Bi=(0,fae.default)("music-metadata:parser:aiff"),Xh=class extends Qt("DSDIFF"){},b2=class extends vt{async parse(){let t=await this.tokenizer.readToken($l);if(t.chunkID!=="FRM8")throw new Xh("Unexpected chunk-ID");this.metadata.setAudioOnly();let o=(await this.tokenizer.readToken(rt)).trim();switch(o){case"DSD":return this.metadata.setFormat("container",`DSDIFF/${o}`),this.metadata.setFormat("lossless",!0),this.readFmt8Chunks(t.chunkSize-BigInt(rt.len));default:throw new Xh(`Unsupported DSDIFF type: ${o}`)}}async readFmt8Chunks(t){for(;t>=$l.len;){let o=await this.tokenizer.readToken($l);Bi(`Chunk id=${o.chunkID}`),await this.readData(o),t-=BigInt($l.len)+o.chunkSize}}async readData(t){Bi(`Reading data of chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);let o=this.tokenizer.position;switch(t.chunkID.trim()){case"FVER":{let e=await this.tokenizer.readToken(Le);Bi(`DSDIFF version=${e}`);break}case"PROP":{if(await this.tokenizer.readToken(rt)!=="SND ")throw new Xh("Unexpected PROP-chunk ID");await this.handleSoundPropertyChunks(t.chunkSize-BigInt(rt.len));break}case"ID3":{let e=await this.tokenizer.readToken(new Ot(Number(t.chunkSize))),a=Co(e);await new on().parse(this.metadata,a,this.options);break}case"DSD":this.metadata.format.numberOfChannels&&this.metadata.setFormat("numberOfSamples",Number(t.chunkSize*BigInt(8)/BigInt(this.metadata.format.numberOfChannels))),this.metadata.format.numberOfSamples&&this.metadata.format.sampleRate&&this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate);break;default:Bi(`Ignore chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);break}let i=t.chunkSize-BigInt(this.tokenizer.position-o);i>0&&(Bi(`After Parsing chunk, remaining ${i} bytes`),await this.tokenizer.ignore(Number(i)))}async handleSoundPropertyChunks(t){for(Bi(`Parsing sound-property-chunks, remainingSize=${t}`);t>0;){let o=await this.tokenizer.readToken($l);Bi(`Sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`);let i=this.tokenizer.position;switch(o.chunkID.trim()){case"FS":{let a=await this.tokenizer.readToken(xe);this.metadata.setFormat("sampleRate",a);break}case"CHNL":{let a=await this.tokenizer.readToken(LA);this.metadata.setFormat("numberOfChannels",a),await this.handleChannelChunks(o.chunkSize-BigInt(LA.len));break}case"CMPR":{let a=(await this.tokenizer.readToken(rt)).trim(),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(new Ve(A,"ascii"));a==="DSD"&&(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("bitsPerSample",1)),this.metadata.setFormat("codec",`${a} (${r})`);break}case"ABSS":{let a=await this.tokenizer.readToken(LA),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(QA),s=await this.tokenizer.readToken(xe);Bi(`ABSS ${a}:${A}:${r}.${s}`);break}case"LSCO":{let a=await this.tokenizer.readToken(LA);Bi(`LSCO lsConfig=${a}`);break}default:Bi(`Unknown sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`),await this.tokenizer.ignore(Number(o.chunkSize))}let e=o.chunkSize-BigInt(this.tokenizer.position-i);e>0&&(Bi(`After Parsing sound-property-chunk ${o.chunkSize}, remaining ${e} bytes`),await this.tokenizer.ignore(Number(e))),t-=BigInt($l.len)+o.chunkSize,Bi(`Parsing sound-property-chunks, remainingSize=${t}`)}if(this.metadata.format.lossless&&this.metadata.format.sampleRate&&this.metadata.format.numberOfChannels&&this.metadata.format.bitsPerSample){let o=this.metadata.format.sampleRate*this.metadata.format.numberOfChannels*this.metadata.format.bitsPerSample;this.metadata.setFormat("bitrate",o)}}async handleChannelChunks(t){Bi(`Parsing channel-chunks, remainingSize=${t}`);let o=[];for(;t>=rt.len;){let i=await this.tokenizer.readToken(rt);Bi(`Channel[ID=${i}]`),o.push(i),t-=BigInt(rt.len)}return Bi(`Channels: ${o.join(", ")}`),o}}});var mae,Sae=Ce(()=>{mae={parserType:"dsdiff",extensions:[".dff"],mimeTypes:["audio/dsf","audio/dsd"],async load(){return(await Promise.resolve().then(()=>(yae(),Qae))).DsdiffParser}}});var wae,uI,bO,M2=Ce(()=>{DA();ui();er();wae={NONE:"not compressed PCM Apple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float Apple Computer",alaw:"ALaw 2:1 8-bit ITU-T G.711 A-law",ulaw:"\xB5Law 2:1 8-bit ITU-T G.711 \xB5-law Apple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 \xB5-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32 IEEE 32-bit float "},uI=class extends Qt("AIFF"){},bO=class{constructor(t,o){this.isAifc=o;let i=o?22:18;if(t.chunkSize>Math.abs(i):e<22){let A=QA.get(t,o+22);if(A>0){let r=(A+1)%2;if(23+A+r===this.len)a.compressionName=new Ve(A,"latin1").get(t,o+23);else throw new uI("Illegal pstring length")}else a.compressionName=void 0}}else a.compressionName="PCM";return a}}});var MO,Dae=Ce(()=>{DA();ui();MO={len:8,get:(n,t)=>({chunkID:rt.get(n,t),chunkSize:Number(BigInt(xe.get(n,t+4)))})}});var bae={};Fr(bae,{AIFFParser:()=>T2});var Oae,_2,T2,Mae=Ce(()=>{DA();Oae=qe(ct(),1);Xo();Yh();ui();zi();M2();M2();Dae();_2=(0,Oae.default)("music-metadata:parser:aiff"),T2=class extends vt{constructor(){super(...arguments),this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(MO)).chunkID!=="FORM")throw new uI("Invalid Chunk-ID, expected 'FORM'");let o=await this.tokenizer.readToken(rt);switch(o){case"AIFF":this.metadata.setFormat("container",o),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new uI(`Unsupported AIFF type: ${o}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{for(;!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=MO.len;){_2(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let i=await this.tokenizer.readToken(MO),e=2*Math.round(i.chunkSize/2),a=await this.readData(i);await this.tokenizer.ignore(e-a)}}catch(i){if(i instanceof kA)_2("End-of-stream");else throw i}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new uI("Failed to parse AIFF.COMM chunk when compression type is unknown");let o=await this.tokenizer.readToken(new bO(t,this.isCompressed));return this.metadata.setFormat("bitsPerSample",o.sampleSize),this.metadata.setFormat("sampleRate",o.sampleRate),this.metadata.setFormat("numberOfChannels",o.numChannels),this.metadata.setFormat("numberOfSamples",o.numSampleFrames),this.metadata.setFormat("duration",o.numSampleFrames/o.sampleRate),(o.compressionName||o.compressionType)&&this.metadata.setFormat("codec",o.compressionName??wae[o.compressionType]),t.chunkSize}case"ID3 ":{let o=await this.tokenizer.readToken(new Ot(t.chunkSize)),i=Co(o);return await new on().parse(this.metadata,i,this.options),t.chunkSize}case"SSND":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration),0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return _2(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let i=(await this.tokenizer.readToken(new Ve(t.chunkSize,"ascii"))).split("\0").map(e=>e.trim()).filter(e=>e?.length);return await Promise.all(i.map(e=>this.metadata.addTag("AIFF",t.chunkID,e))),t.chunkSize}}});var _ae,Tae=Ce(()=>{_ae={parserType:"aiff",extensions:[".aif","aiff","aifc"],mimeTypes:["audio/aiff","audio/aif","audio/aifc","application/aiff"],async load(){return(await Promise.resolve().then(()=>(Mae(),bae))).AIFFParser}}});var pf,Nae,Rae,kae=Ce(()=>{DA();ui();pf={len:12,get:(n,t)=>({id:rt.get(n,t),size:Gr.get(n,t+4)})},Nae={len:16,get:(n,t)=>({fileSize:WB.get(n,t),metadataPointer:WB.get(n,t+8)})},Rae={len:40,get:(n,t)=>({formatVersion:dr.get(n,t),formatID:dr.get(n,t+4),channelType:dr.get(n,t+8),channelNum:dr.get(n,t+12),samplingFrequency:dr.get(n,t+16),bitsPerSample:dr.get(n,t+20),sampleCount:WB.get(n,t+24),blockSizePerChannel:dr.get(n,t+32)})}});var Pae={};Fr(Pae,{DsdContentParseError:()=>_O,DsfParser:()=>R2});var vae,N2,_O,R2,Gae=Ce(()=>{vae=qe(ct(),1);cf();kae();Yh();er();N2=(0,vae.default)("music-metadata:parser:DSF"),_O=class extends Qt("DSD"){},R2=class extends Js{async postId3v2Parse(){let t=this.tokenizer.position,o=await this.tokenizer.readToken(pf);if(o.id!=="DSD ")throw new _O("Invalid chunk signature");this.metadata.setFormat("container","DSF"),this.metadata.setFormat("lossless",!0),this.metadata.setAudioOnly();let i=await this.tokenizer.readToken(Nae);if(i.metadataPointer===BigInt(0))N2("No ID3v2 tag present");else return N2(`expect ID3v2 at offset=${i.metadataPointer}`),await this.parseChunks(i.fileSize-o.size),await this.tokenizer.ignore(Number(i.metadataPointer)-this.tokenizer.position-t),new on().parse(this.metadata,this.tokenizer,this.options)}async parseChunks(t){for(;t>=pf.len;){let o=await this.tokenizer.readToken(pf);switch(N2(`Parsing chunk name=${o.id} size=${o.size}`),o.id){case"fmt ":{let i=await this.tokenizer.readToken(Rae);this.metadata.setFormat("numberOfChannels",i.channelNum),this.metadata.setFormat("sampleRate",i.samplingFrequency),this.metadata.setFormat("bitsPerSample",i.bitsPerSample),this.metadata.setFormat("numberOfSamples",i.sampleCount),this.metadata.setFormat("duration",Number(i.sampleCount)/i.samplingFrequency);let e=i.bitsPerSample*i.samplingFrequency*i.channelNum;this.metadata.setFormat("bitrate",e);return}default:this.tokenizer.ignore(Number(o.size)-pf.len);break}t-=o.size}}}});var Fae,Lae=Ce(()=>{Fae={parserType:"dsf",extensions:[".dsf"],mimeTypes:["audio/dsf"],async load(){return(await Promise.resolve().then(()=>(Gae(),Pae))).DsfParser}}});var BI,df,Uae,TO=Ce(()=>{DA();lI();BI=class n{static fromBase64(t){return n.fromBuffer(Uint8Array.from(atob(t),o=>o.charCodeAt(0)))}static fromBuffer(t){return new n(t.length).get(t,0)}constructor(t){this.len=t}get(t,o){let i=Gh[xe.get(t,o)];o+=4;let e=xe.get(t,o);o+=4;let a=new Ve(e,"utf-8").get(t,o);o+=e;let A=xe.get(t,o);o+=4;let r=new Ve(A,"utf-8").get(t,o);o+=A;let s=xe.get(t,o);o+=4;let g=xe.get(t,o);o+=4;let c=xe.get(t,o);o+=4;let I=xe.get(t,o);o+=4;let d=xe.get(t,o);o+=4;let B=t.slice(o,o+d);return{type:i,format:a,description:r,width:s,height:g,colour_depth:c,indexed_color:I,data:B}}},df={len:7,get:(n,t)=>({packetType:QA.get(n,t),vorbis:new Ve(6,"ascii").get(n,t+1)})},Uae={len:23,get:(n,t)=>({version:Le.get(n,t+0),channelMode:QA.get(n,t+4),sampleRate:Le.get(n,t+5),bitrateMax:Le.get(n,t+9),bitrateNominal:Le.get(n,t+13),bitrateMin:Le.get(n,t+17)})}});var $h,k2=Ce(()=>{DA();Fs();$h=class{constructor(t,o){this.data=t,this.offset=o}readInt32(){let t=Le.get(this.data,this.offset);return this.offset+=4,t}readStringUtf8(){let t=this.readInt32(),o=br(this.data.subarray(this.offset,this.offset+t),"utf-8");return this.offset+=t,o}parseUserComment(){let t=this.offset,o=this.readStringUtf8(),i=o.indexOf("=");return{key:o.substring(0,i).toUpperCase(),value:o.substring(i+1),len:this.offset-t}}}});var Hae,eE,hf,qs,Ef=Ce(()=>{DA();Hae=qe(ct(),1);k2();TO();er();eE=(0,Hae.default)("music-metadata:parser:ogg:vorbis1"),hf=class extends Qt("Vorbis"){},qs=class n{constructor(t,o){this.pageSegments=[],this.durationOnLastPage=!0,this.metadata=t,this.options=o}async parsePage(t,o){if(this.lastPageHeader=t,t.headerType.firstPage)this.parseFirstPage(t,o);else{if(t.headerType.continued){if(this.pageSegments.length===0)throw new hf("Cannot continue on previous page");this.pageSegments.push(o)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){let i=n.mergeUint8Arrays(this.pageSegments);await this.parseFullPage(i)}this.pageSegments=t.headerType.lastPage?[]:[o]}}}static mergeUint8Arrays(t){let o=t.reduce((e,a)=>e+a.length,0),i=new Uint8Array(o);return t.forEach((e,a,A)=>{let r=A.slice(0,a).reduce((s,g)=>s+g.length,0);i.set(e,r)}),i}async flush(){await this.parseFullPage(n.mergeUint8Arrays(this.pageSegments))}async parseUserComment(t,o){let e=new $h(t,o).parseUserComment();return await this.addTag(e.key,e.value),e.len}async addTag(t,o){if(t==="METADATA_BLOCK_PICTURE"&&typeof o=="string"){if(this.options.skipCovers){eE("Ignore picture");return}o=BI.fromBase64(o),eE(`Push picture: id=${t}, format=${o.format}`)}else eE(`Push tag: id=${t}, value=${o}`);await this.metadata.addTag("vorbis",t,o)}calculateDuration(t){this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",this.lastPageHeader.absoluteGranulePosition),this.metadata.setFormat("duration",this.lastPageHeader.absoluteGranulePosition/this.metadata.format.sampleRate))}parseFirstPage(t,o){this.metadata.setFormat("codec","Vorbis I"),this.metadata.setFormat("hasAudio",!0),eE("Parse first page");let i=df.get(o,0);if(i.vorbis!=="vorbis")throw new hf("Metadata does not look like Vorbis");if(i.packetType===1){let e=Uae.get(o,df.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),eE("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}else throw new hf("First Ogg page should be type 1: the identification header")}async parseFullPage(t){let o=df.get(t,0);switch(eE("Parse full page: type=%s, byteLength=%s",o.packetType,t.byteLength),o.packetType){case 3:return this.parseUserCommentList(t,df.len);case 1:case 5:break}}async parseUserCommentList(t,o){let i=Le.get(t,o);o+=4,o+=i;let e=Le.get(t,o);for(o+=4;e-- >0;)o+=await this.parseUserComment(t,o)}}});var fi,Cf,uf,v2=Ce(()=>{Ar();DA();fi={STREAMINFO:0,PADDING:1,APPLICATION:2,SEEKTABLE:3,VORBIS_COMMENT:4,CUESHEET:5,PICTURE:6},Cf={len:4,get:(n,t)=>({lastBlock:GA(n,t,7),type:ZA(n,t,1,7),length:Pr.get(n,t+1)})},uf={len:34,get:(n,t)=>({minimumBlockSize:LA.get(n,t),maximumBlockSize:LA.get(n,t+2)/1e3,minimumFrameSize:Pr.get(n,t+4),maximumFrameSize:Pr.get(n,t+7),sampleRate:Pr.get(n,t+10)>>4,channels:ZA(n,t+12,4,3)+1,bitsPerSample:ZA(n,t+12,7,5)+1,totalSamples:ZA(n,t+13,4,36),fileMD5:new Ot(16).get(n,t+18)})}});var Yae={};Fr(Yae,{FlacParser:()=>Bf});var xae,Hqe,NO,Bf,P2=Ce(()=>{xae=qe(ct(),1);DA();TO();cf();ui();Ef();k2();er();v2();Hqe=(0,xae.default)("music-metadata:parser:FLAC"),NO=class extends Qt("FLAC"){},Bf=class extends Js{constructor(){super(...arguments),this.vorbisParser=new qs(this.metadata,this.options)}async postId3v2Parse(){if((await this.tokenizer.readToken(rt)).toString()!=="fLaC")throw new NO("Invalid FLAC preamble");let o;do o=await this.tokenizer.readToken(Cf),await this.parseDataBlock(o);while(!o.lastBlock);if(this.tokenizer.fileInfo.size&&this.metadata.format.duration){let i=this.tokenizer.fileInfo.size-this.tokenizer.position;this.metadata.setFormat("bitrate",8*i/this.metadata.format.duration)}}async parseDataBlock(t){switch(Hqe(`blockHeader type=${t.type}, length=${t.length}`),t.type){case fi.STREAMINFO:return this.readBlockStreamInfo(t.length);case fi.PADDING:break;case fi.APPLICATION:break;case fi.SEEKTABLE:break;case fi.VORBIS_COMMENT:return this.readComment(t.length);case fi.CUESHEET:break;case fi.PICTURE:await this.parsePicture(t.length);return;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}async readBlockStreamInfo(t){if(t!==uf.len)throw new NO("Unexpected block-stream-info length");let o=await this.tokenizer.readToken(uf);this.metadata.setFormat("container","FLAC"),this.processsStreamInfo(o)}processsStreamInfo(t){this.metadata.setFormat("codec","FLAC"),this.metadata.setFormat("hasAudio",!0),this.metadata.setFormat("lossless",!0),this.metadata.setFormat("numberOfChannels",t.channels),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),t.totalSamples>0&&this.metadata.setFormat("duration",t.totalSamples/t.sampleRate)}async readComment(t){let o=await this.tokenizer.readToken(new Ot(t));return this.parseComment(o)}async parseComment(t){let o=new $h(t,0),i=o.readStringUtf8();i.length>0&&this.metadata.setFormat("tool",i);let e=o.readInt32(),a=new Array(e);for(let A=0;A(A.key==="ENCODER"&&this.metadata.setFormat("tool",A.value),this.addTag(A.key,A.value))))}async parsePicture(t){return this.options.skipCovers?this.tokenizer.ignore(t):this.addPictureTag(await this.tokenizer.readToken(new BI(t)))}addPictureTag(t){return this.addTag("METADATA_BLOCK_PICTURE",t)}addTag(t,o){return this.vorbisParser.addTag(t,o)}}});var jae,Jae=Ce(()=>{jae={parserType:"flac",extensions:[".flac"],mimeTypes:["audio/flac"],async load(){return(await Promise.resolve().then(()=>(P2(),Yae))).FlacParser}}});var Me,G2=Ce(()=>{Me={string:0,uint:1,uid:2,bool:3,binary:4,float:5}});var qae,zae=Ce(()=>{G2();qae={name:"dtd",container:{440786851:{name:"ebml",container:{17030:{name:"ebmlVersion",value:Me.uint},17143:{name:"ebmlReadVersion",value:Me.uint},17138:{name:"ebmlMaxIDWidth",value:Me.uint},17139:{name:"ebmlMaxSizeWidth",value:Me.uint},17026:{name:"docType",value:Me.string},17031:{name:"docTypeVersion",value:Me.uint},17029:{name:"docTypeReadVersion",value:Me.uint}}},408125543:{name:"segment",container:{290298740:{name:"seekHead",container:{19899:{name:"seek",multiple:!0,container:{21419:{name:"id",value:Me.binary},21420:{name:"position",value:Me.uint}}}}},357149030:{name:"info",container:{29604:{name:"uid",value:Me.uid},29572:{name:"filename",value:Me.string},3979555:{name:"prevUID",value:Me.uid},3965867:{name:"prevFilename",value:Me.string},4110627:{name:"nextUID",value:Me.uid},4096955:{name:"nextFilename",value:Me.string},2807729:{name:"timecodeScale",value:Me.uint},17545:{name:"duration",value:Me.float},17505:{name:"dateUTC",value:Me.uint},31657:{name:"title",value:Me.string},19840:{name:"muxingApp",value:Me.string},22337:{name:"writingApp",value:Me.string}}},524531317:{name:"cluster",multiple:!0,container:{231:{name:"timecode",value:Me.uid},22743:{name:"silentTracks ",multiple:!0},167:{name:"position",value:Me.uid},171:{name:"prevSize",value:Me.uid},160:{name:"blockGroup"},163:{name:"simpleBlock"}}},374648427:{name:"tracks",container:{174:{name:"entries",multiple:!0,container:{215:{name:"trackNumber",value:Me.uint},29637:{name:"uid",value:Me.uid},131:{name:"trackType",value:Me.uint},185:{name:"flagEnabled",value:Me.bool},136:{name:"flagDefault",value:Me.bool},21930:{name:"flagForced",value:Me.bool},156:{name:"flagLacing",value:Me.bool},28135:{name:"minCache",value:Me.uint},28136:{name:"maxCache",value:Me.uint},2352003:{name:"defaultDuration",value:Me.uint},2306383:{name:"timecodeScale",value:Me.float},21358:{name:"name",value:Me.string},2274716:{name:"language",value:Me.string},134:{name:"codecID",value:Me.string},25506:{name:"codecPrivate",value:Me.binary},2459272:{name:"codecName",value:Me.string},3839639:{name:"codecSettings",value:Me.string},3883072:{name:"codecInfoUrl",value:Me.string},2536e3:{name:"codecDownloadUrl",value:Me.string},170:{name:"codecDecodeAll",value:Me.bool},28587:{name:"trackOverlay",value:Me.uint},224:{name:"video",container:{154:{name:"flagInterlaced",value:Me.bool},21432:{name:"stereoMode",value:Me.uint},176:{name:"pixelWidth",value:Me.uint},186:{name:"pixelHeight",value:Me.uint},21680:{name:"displayWidth",value:Me.uint},21690:{name:"displayHeight",value:Me.uint},21683:{name:"aspectRatioType",value:Me.uint},3061028:{name:"colourSpace",value:Me.uint},3126563:{name:"gammaValue",value:Me.float}}},225:{name:"audio",container:{181:{name:"samplingFrequency",value:Me.float},30901:{name:"outputSamplingFrequency",value:Me.float},159:{name:"channels",value:Me.uint},148:{name:"channels",value:Me.uint},32123:{name:"channelPositions",value:Me.binary},25188:{name:"bitDepth",value:Me.uint}}},28032:{name:"contentEncodings",container:{25152:{name:"contentEncoding",container:{20529:{name:"order",value:Me.uint},20530:{name:"scope",value:Me.bool},20531:{name:"type",value:Me.uint},20532:{name:"contentEncoding",container:{16980:{name:"contentCompAlgo",value:Me.uint},16981:{name:"contentCompSettings",value:Me.binary}}},20533:{name:"contentEncoding",container:{18401:{name:"contentEncAlgo",value:Me.uint},18402:{name:"contentEncKeyID",value:Me.binary},18403:{name:"contentSignature ",value:Me.binary},18404:{name:"ContentSigKeyID ",value:Me.binary},18405:{name:"contentSigAlgo ",value:Me.uint},18406:{name:"contentSigHashAlgo ",value:Me.uint}}},25188:{name:"bitDepth",value:Me.uint}}}}}}}}},475249515:{name:"cues",container:{187:{name:"cuePoint",container:{179:{name:"cueTime",value:Me.uid},183:{name:"positions",container:{247:{name:"track",value:Me.uint},241:{name:"clusterPosition",value:Me.uint},21368:{name:"blockNumber",value:Me.uint},234:{name:"codecState",value:Me.uint},219:{name:"reference",container:{150:{name:"time",value:Me.uint},151:{name:"cluster",value:Me.uint},21343:{name:"number",value:Me.uint},235:{name:"codecState",value:Me.uint}}},240:{name:"relativePosition",value:Me.uint}}}}}}},423732329:{name:"attachments",container:{24999:{name:"attachedFiles",multiple:!0,container:{18046:{name:"description",value:Me.string},18030:{name:"name",value:Me.string},18016:{name:"mimeType",value:Me.string},18012:{name:"data",value:Me.binary},18094:{name:"uid",value:Me.uid}}}}},272869232:{name:"chapters",container:{17849:{name:"editionEntry",container:{182:{name:"chapterAtom",container:{29636:{name:"uid",value:Me.uid},145:{name:"timeStart",value:Me.uint},146:{name:"timeEnd",value:Me.uid},152:{name:"hidden",value:Me.bool},17816:{name:"enabled",value:Me.uid},143:{name:"track",container:{137:{name:"trackNumber",value:Me.uid},128:{name:"display",container:{133:{name:"string",value:Me.string},17276:{name:"language ",value:Me.string},17278:{name:"country ",value:Me.string}}}}}}}}}}},307544935:{name:"tags",container:{29555:{name:"tag",multiple:!0,container:{25536:{name:"target",container:{25541:{name:"tagTrackUID",value:Me.uid},25540:{name:"tagChapterUID",value:Me.uint},25542:{name:"tagAttachmentUID",value:Me.uid},25546:{name:"targetType",value:Me.string},26826:{name:"targetTypeValue",value:Me.uint},25545:{name:"tagEditionUID",value:Me.uid}}},26568:{name:"simpleTags",multiple:!0,container:{17827:{name:"name",value:Me.string},17543:{name:"string",value:Me.string},17541:{name:"binary",value:Me.binary},17530:{name:"language",value:Me.string},17531:{name:"languageIETF",value:Me.string},17540:{name:"default",value:Me.bool}}}}}}}}}}}});function F2(n,t){return Number(Kqe(n,t))}function Kqe(n,t){let o=new Uint8Array(8),i=n.subarray(0,t);try{return o.set(i,8-t),Hs.get(o,0)}catch{return BigInt(-1)}}function Wae(n){return n.container&&Object.keys(n.container).map(t=>{let o=n.container[t];return o.id=Number.parseInt(t,10),o}).forEach(t=>{t.parent=n,Wae(t)}),n}function ep(n){let t="";return n.parent&&n.parent.name!=="dtd"&&(t+=`${ep(n.parent)}/`),t+n.name}var Vae,AE,RO,zs,kO,Zae=Ce(()=>{DA();Vae=qe(ct(),1);Xo();G2();DA();er();AE=(0,Vae.default)("music-metadata:parser:ebml"),RO=class extends Qt("EBML"){},zs={ReadNext:0,IgnoreElement:2,SkipSiblings:3,TerminateParsing:4,SkipElement:5},kO=class{constructor(t){this.parserMap=new Map,this.ebmlMaxIDLength=4,this.ebmlMaxSizeLength=8,this.tokenizer=t,this.parserMap.set(Me.uint,o=>this.readUint(o)),this.parserMap.set(Me.string,o=>this.readString(o)),this.parserMap.set(Me.binary,o=>this.readBuffer(o)),this.parserMap.set(Me.uid,async o=>this.readBuffer(o)),this.parserMap.set(Me.bool,o=>this.readFlag(o)),this.parserMap.set(Me.float,o=>this.readFloat(o))}async iterate(t,o,i){return this.parseContainer(Wae(t),o,i)}async parseContainer(t,o,i){let e={};for(;this.tokenizer.position=0?this.tokenizer.position+a.len:-1,i);r.multiple?(e[r.name]||(e[r.name]=[]),e[r.name].push(g)):e[r.name]=g,await i.elementValue(r,g,A)}else{let g=this.parserMap.get(r.value);if(typeof g=="function"){let c=await g(a);e[r.name]=c,await i.elementValue(r,c,A)}}break;case zs.SkipElement:AE(`Go to next element: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`);break;case zs.IgnoreElement:AE(`Ignore element: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(a.len);break;case zs.SkipSiblings:AE(`Ignore remaining container, at: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(o-this.tokenizer.position);break;case zs.TerminateParsing:return AE(`Terminate parsing at element: name=${ep(r)}, element.id=0x${a.id}, container=${!!r.container} at position=${A}`),e}else switch(a.id){case 236:await this.tokenizer.ignore(a.len);break;default:AE(`parseEbml: parent=${ep(t)}, unknown child: id=${a.id.toString(16)} at position=${A}`),await this.tokenizer.ignore(a.len)}}return e}async readVintData(t){let o=await this.tokenizer.peekNumber(QA),i=128,e=1;for(;(o&i)===0;){if(e>t)throw new RO("VINT value exceeding maximum size");++e,i>>=1}let a=new Uint8Array(e);return await this.tokenizer.readBuffer(a),a}async readElement(){let t=await this.readVintData(this.ebmlMaxIDLength),o=await this.readVintData(this.ebmlMaxSizeLength);return o[0]^=128>>o.length-1,{id:F2(t,t.length),len:F2(o,o.length)}}async readFloat(t){switch(t.len){case 0:return 0;case 4:return this.tokenizer.readNumber(zL);case 8:return this.tokenizer.readNumber($D);case 10:return this.tokenizer.readNumber($D);default:throw new RO(`Invalid IEEE-754 float length: ${t.len}`)}}async readFlag(t){return await this.readUint(t)===1}async readUint(t){let o=await this.readBuffer(t);return F2(o,t.len)}async readString(t){return(await this.tokenizer.readToken(new Ve(t.len,"utf-8"))).replace(/\x00.*$/g,"")}async readBuffer(t){let o=new Uint8Array(t.len);return await this.tokenizer.readBuffer(o),o}}});var $ae={};Fr($ae,{MatroskaParser:()=>L2});var Xae,vO,L2,eie=Ce(()=>{Xae=qe(ct(),1);zi();zae();o2();Zae();vO=(0,Xae.default)("music-metadata:parser:matroska"),L2=class extends vt{constructor(){super(...arguments),this.seekHeadOffset=0,this.flagUseIndexToSkipClusters=this.options.mkvUseIndex??!1}async parse(){let t=this.tokenizer.fileInfo.size??Number.MAX_SAFE_INTEGER,o=new kO(this.tokenizer);vO("Initializing DTD end MatroskaIterator"),await o.iterate(qae,t,{startNext:i=>{switch(i.id){case 475249515:return vO(`Skip element: name=${i.name}, id=0x${i.id.toString(16)}`),zs.IgnoreElement;case 524531317:if(this.flagUseIndexToSkipClusters&&this.seekHead){let e=this.seekHead.seek.find(a=>a.position+this.seekHeadOffset>this.tokenizer.position);if(e){let a=e.position+this.seekHeadOffset-this.tokenizer.position;return vO(`Use index to go to next position, ignoring ${a} bytes`),this.tokenizer.ignore(a),zs.SkipElement}}return zs.IgnoreElement;default:return zs.ReadNext}},elementValue:async(i,e,a)=>{switch(vO(`Received: name=${i.name}, value=${e}`),i.id){case 17026:this.metadata.setFormat("container",`EBML/${e}`);break;case 290298740:this.seekHead=e,this.seekHeadOffset=a;break;case 357149030:{let A=e,r=A.timecodeScale?A.timecodeScale:1e6;if(typeof A.duration=="number"){let s=A.duration*r/1e9;await this.addTag("segment:title",A.title),this.metadata.setFormat("duration",Number(s))}}break;case 374648427:{let A=e;if(A?.entries){A.entries.forEach(s=>{let g={codecName:s.codecID.replace("A_","").replace("V_",""),codecSettings:s.codecSettings,flagDefault:s.flagDefault,flagLacing:s.flagLacing,flagEnabled:s.flagEnabled,language:s.language,name:s.name,type:s.trackType,audio:s.audio,video:s.video};this.metadata.addStreamInfo(g)});let r=A.entries.filter(s=>s.trackType===pa.audio).reduce((s,g)=>!s||g.flagDefault&&!s.flagDefault||g.trackNumber{let s=r.target,g=s?.targetTypeValue?gre[s.targetTypeValue]:s?.targetType?s.targetType:"track";await Promise.all(r.simpleTags.map(async c=>{let I=c.string?c.string:c.binary;await this.addTag(`${g}:${c.name}`,I)}))}))}break;case 423732329:{let A=e;await Promise.all(A.attachedFiles.filter(r=>r.mimeType.startsWith("image/")).map(r=>this.addTag("picture",{data:r.data,format:r.mimeType,description:r.description,name:r.name})))}break}}})}async addTag(t,o){await this.metadata.addTag("matroska",t,o)}}});var Aie,tie=Ce(()=>{Aie={parserType:"matroska",extensions:[".mka",".mkv",".mk3d",".mks","webm"],mimeTypes:["audio/matroska","video/matroska","audio/webm","video/webm"],async load(){return(await Promise.resolve().then(()=>(eie(),$ae))).MatroskaParser}}});function nie(n,t,o,i,e){if(H2(`remainingLen=${i}, numberOfEntries=${e} * token-len=${t.len}`),i===0)return[];if(i!==e*t.len)throw new Wg("mismatch number-of-entries with remaining atom-length");let a=[];for(let A=0;A{DA();aie=qe(ct(),1);ui();er();Ar();er();H2=(0,aie.default)("music-metadata:parser:MP4:atom"),Wg=class extends Qt("MP4"){},Ap={len:8,get:(n,t)=>{let o=xe.get(n,t);if(o<0)throw new Wg("Invalid atom header length");return{length:BigInt(o),name:new Ve(4,"latin1").get(n,t+4)}},put:(n,t,o)=>(xe.put(n,t,Number(o.length)),rt.put(n,t+4,o.name))},iie=Hs,K2={len:4,get:(n,t)=>({type:new Ve(4,"ascii").get(n,t)})},PO=class{constructor(t,o,i){if(to&&H2(`Warning: atom ${i} expected to be ${o}, but was actually ${t} bytes long.`),this.len=t}},tE={len:4,get:(n,t)=>{let o=xe.get(n,t)-2082844800;return new Date(o*1e3)}},rE={len:8,get:(n,t)=>{let o=Number(Hs.get(n,t))-2082844800;return new Date(o*1e3)}},GO=class extends PO{constructor(t){super(t,24,"mdhd")}get(t,o){let i=QA.get(t,o+0),e=Pr.get(t,o+1);switch(i){case 0:return{version:i,flags:e,creationTime:tE.get(t,o+4),modificationTime:tE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),language:LA.get(t,o+20),quality:LA.get(t,o+22)};case 1:return{version:i,flags:e,creationTime:rE.get(t,o+4),modificationTime:rE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(Hs.get(t,o+24)),language:LA.get(t,o+32),quality:LA.get(t,o+34)};default:throw new An("Invalid mdhd version header")}}},FO=class extends PO{constructor(t){super(t,100,"mvhd")}get(t,o){let i=QA.get(t,o),e=Pr.get(t,o+1);return i===1?{version:i,flags:e,creationTime:rE.get(t,o+4),modificationTime:rE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(Hs.get(t,o+24)),preferredRate:xe.get(t,o+32),preferredVolume:LA.get(t,o+36),previewTime:xe.get(t,o+84),previewDuration:xe.get(t,o+88),posterTime:xe.get(t,o+92),selectionTime:xe.get(t,o+96),selectionDuration:xe.get(t,o+100),currentTime:xe.get(t,o+104),nextTrackID:xe.get(t,o+108)}:{version:i,flags:e,creationTime:tE.get(t,o+4),modificationTime:tE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),preferredRate:xe.get(t,o+20),preferredVolume:LA.get(t,o+24),previewTime:xe.get(t,o+72),previewDuration:xe.get(t,o+76),posterTime:xe.get(t,o+80),selectionTime:xe.get(t,o+84),selectionDuration:xe.get(t,o+88),currentTime:xe.get(t,o+92),nextTrackID:xe.get(t,o+96)}}},LO=class{constructor(t){this.len=t}get(t,o){return{type:{set:QA.get(t,o+0),type:Pr.get(t,o+1)},locale:Pr.get(t,o+4),value:new Ot(this.len-8).get(t,o+8)}}},UO=class{constructor(t){this.len=t}get(t,o){return{version:QA.get(t,o),flags:Pr.get(t,o+1),name:new Ve(this.len-4,"utf-8").get(t,o+4)}}},HO=class{constructor(t){this.len=t}get(t,o){let i=QA.get(t,o),e=Pr.get(t,o+1);switch(i){case 0:return{version:i,flags:e,creationTime:tE.get(t,o+4),modificationTime:tE.get(t,o+8),trackId:xe.get(t,o+12),duration:xe.get(t,o+20),layer:LA.get(t,o+32),alternateGroup:LA.get(t,o+34),volume:LA.get(t,o+36)};case 1:return{version:i,flags:e,creationTime:rE.get(t,o+4),modificationTime:rE.get(t,o+12),trackId:xe.get(t,o+20),duration:Number(Hs.get(t,o+28)),layer:LA.get(t,o+44),alternateGroup:LA.get(t,o+46),volume:LA.get(t,o+48)};default:throw new An("Invalid tkhd version header")}}},rie={len:8,get:(n,t)=>({version:QA.get(n,t),flags:Pr.get(n,t+1),numberOfEntries:xe.get(n,t+4)})},U2=class{constructor(t){this.len=t}get(t,o){let i=this.len-12;return{dataFormat:rt.get(t,o),dataReferenceIndex:LA.get(t,o+10),description:i>0?new Ot(i).get(t,o+12):void 0}}},ff=class{constructor(t){this.len=t}get(t,o){let i=rie.get(t,o);o+=rie.len;let e=[];for(let a=0;a=this.len){H2("TrackRunBox size mismatch");break}let r={};e.flags.sampleDurationPresent&&(r.sampleDuration=xe.get(t,a),a+=4),e.flags.sampleSizePresent&&(r.sampleSize=xe.get(t,a),a+=4),e.flags.sampleFlagsPresent&&(r.sampleFlags=xe.get(t,a),a+=4),e.flags.sampleCompositionTimeOffsetsPresent&&(r.sampleCompositionTimeOffset=xe.get(t,a),a+=4),e.samples.push(r)}return e}},zO=class{constructor(t){this.len=t}get(t,o){let i=o+1,e=new Ve(4,"utf-8");return{version:Us.get(t,o),flags:Pr.get(t,o+1),componentType:e.get(t,o+4),handlerType:e.get(t,o+8),componentName:new Ve(this.len-28,"utf-8").get(t,o+28)}}},VO=class{constructor(t){this.len=t}get(t,o){let i=0,e=[];for(;i{cie=qe(ct(),1);mf();mf();gie=(0,cie.default)("music-metadata:parser:MP4:Atom"),WO=class n{static async readAtom(t,o,i,e){let a=t.position;gie(`Reading next token on offset=${a}...`);let A=await t.readToken(Ap),r=A.length===1n;r&&(A.length=await t.readToken(iie));let s=new n(A,r,i),g=s.getPayloadLength(e);return gie(`parse atom name=${s.atomPath}, extended=${s.extended}, offset=${a}, len=${s.header.length}`),await s.readData(t,o,g),s}constructor(t,o,i){this.header=t,this.extended=o,this.parent=i,this.children=[],this.atomPath=(this.parent?`${this.parent.atomPath}.`:"")+this.header.name}getHeaderLength(){return this.extended?16:8}getPayloadLength(t){return(this.header.length===0n?t:Number(this.header.length))-this.getHeaderLength()}async readAtoms(t,o,i){for(;i>0;){let e=await n.readAtom(t,o,this,i);this.children.push(e),i-=e.header.length===0n?i:Number(e.header.length)}}async readData(t,o,i){switch(this.header.name){case"moov":case"udta":case"mdia":case"minf":case"stbl":case"":case"ilst":case"tref":case"moof":return this.readAtoms(t,o,this.getPayloadLength(i));case"meta":{let a=(await t.peekToken(Ap)).name==="hdlr"?0:4;return await t.ignore(a),this.readAtoms(t,o,this.getPayloadLength(i)-a)}default:return o(this,i)}}}});var hie={};Fr(hie,{MP4Parser:()=>Y2});function pie(n,t,o){return o.indexOf(n)===t}var die,Wi,jqe,lie,Y2,Eie=Ce(()=>{die=qe(ct(),1);DA();zi();nf();Iie();mf();mf();Jl();$B();Fs();Wi=(0,die.default)("music-metadata:parser:MP4"),jqe="iTunes",lie={raw:{lossy:!1,format:"raw"},MAC3:{lossy:!0,format:"MACE 3:1"},MAC6:{lossy:!0,format:"MACE 6:1"},ima4:{lossy:!0,format:"IMA 4:1"},ulaw:{lossy:!0,format:"uLaw 2:1"},alaw:{lossy:!0,format:"uLaw 2:1"},Qclp:{lossy:!0,format:"QUALCOMM PureVoice"},".mp3":{lossy:!0,format:"MPEG-1 layer 3"},alac:{lossy:!1,format:"ALAC"},"ac-3":{lossy:!0,format:"AC-3"},mp4a:{lossy:!0,format:"MPEG-4/AAC"},mp4s:{lossy:!0,format:"MP4S"},c608:{lossy:!0,format:"CEA-608"},c708:{lossy:!0,format:"CEA-708"}};Y2=class n extends vt{constructor(){super(...arguments),this.tracks=new Map,this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.atomParsers={mvhd:async t=>{let o=await this.tokenizer.readToken(new FO(t));this.metadata.setFormat("creationTime",o.creationTime),this.metadata.setFormat("modificationTime",o.modificationTime)},chap:async t=>{let o=this.getTrackDescription(),i=[];for(;t>=xe.len;)i.push(await this.tokenizer.readNumber(xe)),t-=xe.len;o.chapterList=i},mdat:async t=>{if(this.options.includeChapters){let o=[...this.tracks.values()].filter(i=>i.chapterList);if(o.length===1){let i=o[0].chapterList,e=[...this.tracks.values()].filter(a=>i.indexOf(a.header.trackId)!==-1);if(e.length===1)return this.parseChapterTrack(e[0],o[0],t)}}await this.tokenizer.ignore(t)},ftyp:async t=>{let o=[];for(;t>0;){let e=await this.tokenizer.readToken(K2);t-=K2.len;let a=e.type.replace(/\W/g,"");a.length>0&&o.push(a)}Wi(`ftyp: ${o.join("/")}`);let i=o.filter(pie).join("/");this.metadata.setFormat("container",i)},stsd:async t=>{let o=await this.tokenizer.readToken(new ff(t)),i=this.getTrackDescription();i.soundSampleDescription=o.table.map(e=>this.parseSoundSampleDescription(e))},stsz:async t=>{let o=await this.tokenizer.readToken(new yf(t)),i=this.getTrackDescription();i.sampleSize=o.sampleSize,i.sampleSizeTable=o.entries},date:async t=>{let o=await this.tokenizer.readToken(new Ve(t,"utf-8"));await this.addTag("date",o)}}}static read_BE_Integer(t,o){let i=(o?"INT":"UINT")+t.length*8+(t.length>1?"_BE":""),e=VA[i];if(!e)throw new Wg(`Token for integer type not found: "${i}"`);return Number(e.get(t,0))}async parse(){this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.tracks.clear();let t=this.tokenizer.fileInfo.size||0;for(;!this.tokenizer.fileInfo.size||t>0;){try{if((await this.tokenizer.peekToken(Ap)).name==="\0\0\0\0"){let A=`Error at offset=${this.tokenizer.position}: box.id=0`;Wi(A),this.addWarning(A);break}}catch(a){if(a instanceof Error){let A=`Error at offset=${this.tokenizer.position}: ${a.message}`;Wi(A),this.addWarning(A)}else throw a;break}let e=await WO.readAtom(this.tokenizer,(a,A)=>this.handleAtom(a,A),null,t);t-=e.header.length===BigInt(0)?t:Number(e.header.length)}let o=[];this.tracks.forEach(e=>{let a=[];e.soundSampleDescription.forEach(A=>{let r={},s=lie[A.dataFormat];if(s?(a.push(s.format),r.codecName=s.format):r.codecName=`<${A.dataFormat}>`,A.description){let{description:g}=A;g.sampleRate>0&&(r.type=pa.audio,r.audio={samplingFrequency:g.sampleRate,bitDepth:g.sampleSize,channels:g.numAudioChannels})}this.metadata.addStreamInfo(r)}),a.length>=1&&o.push(a.join("/"))}),o.length>0&&this.metadata.setFormat("codec",o.filter(pie).join("+"));let i=[...this.tracks.values()].filter(e=>e.soundSampleDescription.length>=1&&e.soundSampleDescription[0].description&&e.soundSampleDescription[0].description.numAudioChannels>0);for(let e of i){if(e.media.header&&e.media.header.timeScale>0)if(e.sampleRate=e.media.header.timeScale,e.media.header.duration>0&&(Wi("Using duration defined on audio track"),e.samples=e.media.header.duration,e.duration=e.samples/e.sampleRate),e.fragments.length>0){Wi("Calculate duration defined in track fragments");let r=0;e.sizeInBytes=0;for(let s of e.fragments)for(let g of s.trackRun.samples){let c=g.sampleDuration??s.header.defaultSampleDuration??0,I=g.sampleSize??s.header.defaultSampleSize??0;if(c===0)throw new Error("Missing sampleDuration and no defaultSampleDuration in track fragment header");if(I===0)throw new Error("Missing sampleSize and no defaultSampleSize in track fragment header");r+=c,e.sizeInBytes+=I}e.samples||(e.samples=r),e.duration||(e.duration=r/e.sampleRate)}else e.sampleSizeTable.length>0&&(e.sizeInBytes=e.sampleSizeTable.reduce((r,s)=>r+s,0));let a=e.soundSampleDescription[0];if(a.description&&e.media.header&&(this.metadata.setFormat("sampleRate",a.description.sampleRate),this.metadata.setFormat("bitsPerSample",a.description.sampleSize),this.metadata.setFormat("numberOfChannels",a.description.numAudioChannels),e.media.header.timeScale===0&&e.timeToSampleTable.length>0)){let r=e.timeToSampleTable.map(s=>s.count*s.duration).reduce((s,g)=>s+g);e.duration=r/a.description.sampleRate}let A=lie[a.dataFormat];A&&this.metadata.setFormat("lossless",!A.lossy)}if(i.length>=1){let e=i[0];e.duration&&(this.metadata.setFormat("duration",e.duration),e.sizeInBytes&&this.metadata.setFormat("bitrate",8*e.sizeInBytes/e.duration))}this.metadata.setFormat("hasAudio",this.hasAudioTrack),this.metadata.setFormat("hasVideo",this.hasVideoTrack)}async handleAtom(t,o){if(t.parent)switch(t.parent.header.name){case"ilst":case"":return this.parseMetadataItemData(t);case"moov":switch(t.header.name){case"trak":return this.parseTrackBox(t);case"udta":return this.parseTrackBox(t)}break;case"moof":switch(t.header.name){case"traf":return this.parseTrackFragmentBox(t)}}if(this.atomParsers[t.header.name])return this.atomParsers[t.header.name](o);Wi(`No parser for atom path=${t.atomPath}, payload-len=${o}, ignoring atom`),await this.tokenizer.ignore(o)}getTrackDescription(){let t=[...this.tracks.values()];return t[t.length-1]}async addTag(t,o){await this.metadata.addTag(jqe,t,o)}addWarning(t){Wi(`Warning: ${t}`),this.metadata.addWarning(t)}parseMetadataItemData(t){let o=t.header.name;return t.readAtoms(this.tokenizer,async(i,e)=>{let a=i.getPayloadLength(e);switch(i.header.name){case"data":return this.parseValueAtom(o,i);case"name":case"mean":case"rate":{let A=await this.tokenizer.readToken(new UO(a));o+=`:${A.name}`;break}default:{let A=await this.tokenizer.readToken(new Ot(a));this.addWarning(`Unsupported meta-item: ${o}[${i.header.name}] => value=${AO(A)} ascii=${br(A,"ascii")}`)}}},t.getPayloadLength(0))}async parseValueAtom(t,o){let i=await this.tokenizer.readToken(new LO(Number(o.header.length)-Ap.len));if(i.type.set!==0)throw new Wg(`Unsupported type-set != 0: ${i.type.set}`);switch(i.type.type){case 0:switch(t){case"trkn":case"disk":{let e=QA.get(i.value,3),a=QA.get(i.value,5);await this.addTag(t,`${e}/${a}`);break}case"gnre":{let e=QA.get(i.value,1),a=xh[e-1];await this.addTag(t,a);break}case"rate":{let e=br(i.value,"ascii");await this.addTag(t,e);break}default:Wi(`unknown proprietary value type for: ${o.atomPath}`)}break;case 1:case 18:await this.addTag(t,br(i.value));break;case 13:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/jpeg",data:Uint8Array.from(i.value)});break;case 14:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/png",data:Uint8Array.from(i.value)});break;case 21:await this.addTag(t,n.read_BE_Integer(i.value,!0));break;case 22:await this.addTag(t,n.read_BE_Integer(i.value,!1));break;case 65:await this.addTag(t,QA.get(i.value,0));break;case 66:await this.addTag(t,LA.get(i.value,0));break;case 67:await this.addTag(t,xe.get(i.value,0));break;default:this.addWarning(`atom key=${t}, has unknown well-known-type (data-type): ${i.type.type}`)}}async parseTrackBox(t){let o={media:{},fragments:[]};await t.readAtoms(this.tokenizer,async(i,e)=>{let a=i.getPayloadLength(e);switch(i.header.name){case"chap":{let A=await this.tokenizer.readToken(new VO(e));o.chapterList=A;break}case"tkhd":o.header=await this.tokenizer.readToken(new HO(a));break;case"hdlr":o.handler=await this.tokenizer.readToken(new zO(a)),o.isAudio=()=>o.handler.handlerType==="audi"||o.handler.handlerType==="soun",o.isVideo=()=>o.handler.handlerType==="vide",o.isAudio()?this.hasAudioTrack=!0:o.isVideo()&&(this.hasVideoTrack=!0);break;case"mdhd":{let A=await this.tokenizer.readToken(new GO(a));o.media.header=A;break}case"stco":{let A=await this.tokenizer.readToken(new YO(a));o.chunkOffsetTable=A.entries;break}case"stsc":{let A=await this.tokenizer.readToken(new xO(a));o.sampleToChunkTable=A.entries;break}case"stsd":{let A=await this.tokenizer.readToken(new ff(a));o.soundSampleDescription=A.table.map(r=>this.parseSoundSampleDescription(r));break}case"stts":{let A=await this.tokenizer.readToken(new KO(a));o.timeToSampleTable=A.entries;break}case"stsz":{let A=await this.tokenizer.readToken(new yf(a));o.sampleSize=A.sampleSize,o.sampleSizeTable=A.entries;break}case"dinf":case"vmhd":case"smhd":Wi(`Ignoring: ${i.header.name}`),await this.tokenizer.ignore(a);break;default:Wi(`Unexpected track box: ${i.header.name}`),await this.tokenizer.ignore(a)}},t.getPayloadLength(0)),this.tracks.set(o.header.trackId,o)}parseTrackFragmentBox(t){let o;return t.readAtoms(this.tokenizer,async(i,e)=>{let a=i.getPayloadLength(e);switch(i.header.name){case"tfhd":{let A=new JO(i.getPayloadLength(e));o=await this.tokenizer.readToken(A);break}case"tfdt":await this.tokenizer.ignore(a);break;case"trun":{let A=new qO(a),r=await this.tokenizer.readToken(A);o&&this.tracks.get(o.trackId)?.fragments.push({header:o,trackRun:r});break}default:Wi(`Unexpected box: ${i.header.name}`),await this.tokenizer.ignore(a)}},t.getPayloadLength(0))}parseSoundSampleDescription(t){let o={dataFormat:t.dataFormat,dataReferenceIndex:t.dataReferenceIndex},i=0;if(t.description){let e=x2.get(t.description,i);i+=x2.len,e.version===0||e.version===1?o.description=oie.get(t.description,i):Wi(`Warning: sound-sample-description ${e} not implemented`)}return o}async parseChapterTrack(t,o,i){if(!t.sampleSize&&t.chunkOffsetTable.length!==t.sampleSizeTable.length)throw new Error("Expected equal chunk-offset-table & sample-size-table length.");let e=[];for(let a=0;a0;++a){let A=t.timeToSampleTable.slice(0,a).reduce((d,B)=>d+B.duration,0),s=t.chunkOffsetTable[a]-this.tokenizer.position,g=t.sampleSize>0?t.sampleSize:t.sampleSizeTable[a];if(i-=s+g,i<0)throw new Wg("Chapter chunk exceeding token length");await this.tokenizer.ignore(s);let c=await this.tokenizer.readToken(new jO(g));Wi(`Chapter ${a+1}: ${c}`);let I={title:c,timeScale:t.media.header?t.media.header.timeScale:0,start:A,sampleOffset:this.findSampleOffset(o,this.tokenizer.position)};Wi(`Chapter title=${I.title}, offset=${I.sampleOffset}/${o.header.duration}`),e.push(I)}this.metadata.setFormat("chapters",e),await this.tokenizer.ignore(i)}findSampleOffset(t,o){let i=0;for(;i=o[i].firstChunk&&t{Cie={parserType:"mp4",extensions:[".mp4",".m4a",".m4b",".m4pa","m4v","m4r","3gp",".mov",".movie",".qt"],mimeTypes:["audio/mp4","audio/m4a","video/m4v","video/mp4","video/quicktime"],async load(){return(await Promise.resolve().then(()=>(Eie(),hie))).MP4Parser}}});var yie,Bie,Jqe,fie,Qie,ZO,mie=Ce(()=>{DA();yie=qe(ct(),1);Ar();Bie=(0,yie.default)("music-metadata:parser:musepack:sv8"),Jqe=new Ve(2,"latin1"),fie={len:5,get:(n,t)=>({crc:Le.get(n,t),streamVersion:QA.get(n,t+4)})},Qie={len:2,get:(n,t)=>({sampleFrequency:[44100,48e3,37800,32e3][ZA(n,t,0,3)],maxUsedBands:ZA(n,t,3,5),channelCount:ZA(n,t+1,0,4)+1,msUsed:Ta(n,t+1,4),audioBlockFrames:ZA(n,t+1,5,3)})},ZO=class{get tokenizer(){return this._tokenizer}set tokenizer(t){this._tokenizer=t}constructor(t){this._tokenizer=t}async readPacketHeader(){let t=await this.tokenizer.readToken(Jqe),o=await this.readVariableSizeField();return{key:t,payloadLength:o.value-2-o.len}}async readStreamHeader(t){let o={};Bie(`Reading SH at offset=${this.tokenizer.position}`);let i=await this.tokenizer.readToken(fie);t-=fie.len,Object.assign(o,i),Bie(`SH.streamVersion = ${i.streamVersion}`);let e=await this.readVariableSizeField();t-=e.len,o.sampleCount=e.value;let a=await this.readVariableSizeField();t-=a.len,o.beginningOfSilence=a.value;let A=await this.tokenizer.readToken(Qie);return t-=Qie.len,Object.assign(o,A),await this.tokenizer.ignore(t),o}async readVariableSizeField(t=1,o=0){let i=await this.tokenizer.readNumber(QA);return(i&128)===0?{len:t,value:o+i}:(i&=127,i+=o,this.readVariableSizeField(t+1,i<<7))}}});var Zg,XO=Ce(()=>{er();Zg=class extends Qt("Musepack"){}});var Sie,zqe,$O,wie=Ce(()=>{Sie=qe(ct(),1);zi();Vl();ui();mie();XO();zqe=(0,Sie.default)("music-metadata:parser:musepack"),$O=class extends vt{constructor(){super(...arguments),this.audioLength=0}async parse(){if(await this.tokenizer.readToken(rt)!=="MPCK")throw new Zg("Invalid Magic number");return this.metadata.setFormat("container","Musepack, SV8"),this.parsePacket()}async parsePacket(){let t=new ZO(this.tokenizer);do{let o=await t.readPacketHeader();switch(zqe(`packet-header key=${o.key}, payloadLength=${o.payloadLength}`),o.key){case"SH":{let i=await t.readStreamHeader(o.payloadLength);this.metadata.setFormat("numberOfSamples",i.sampleCount),this.metadata.setFormat("sampleRate",i.sampleFrequency),this.metadata.setFormat("duration",i.sampleCount/i.sampleFrequency),this.metadata.setFormat("numberOfChannels",i.channelCount);break}case"AP":this.audioLength+=o.payloadLength,await this.tokenizer.ignore(o.payloadLength);break;case"RG":case"EI":case"SO":case"ST":case"CT":await this.tokenizer.ignore(o.payloadLength);break;case"SE":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioLength*8/this.metadata.format.duration),zl(this.metadata,this.tokenizer,this.options);default:throw new Zg(`Unexpected header: ${o.key}`)}}while(!0)}}});var eb,Die=Ce(()=>{DA();eb=class{constructor(t){this.pos=0,this.dword=null,this.tokenizer=t}async read(t){for(;this.dword===null;)this.dword=await this.tokenizer.readToken(Le);let o=this.dword;return this.pos+=t,this.pos<32?(o>>>=32-this.pos,o&(1<>>32-this.pos),o&(1<0){let e=32-this.pos;this.dword=null,t-=e,this.pos=0}let o=t%32,i=(t-o)/32;return await this.tokenizer.ignore(i*4),this.read(o)}}});var Oie,bie=Ce(()=>{DA();Ar();Fs();Oie={len:24,get:(n,t)=>{let o={signature:br(n.subarray(t,t+3),"latin1"),streamMinorVersion:ZA(n,t+3,0,4),streamMajorVersion:ZA(n,t+3,4,4),frameCount:Le.get(n,t+4),maxLevel:SA.get(n,t+8),sampleFrequency:[44100,48e3,37800,32e3][ZA(n,t+10,0,2)],link:ZA(n,t+10,2,2),profile:ZA(n,t+10,4,4),maxBand:ZA(n,t+11,0,6),intensityStereo:Ta(n,t+11,6),midSideStereo:Ta(n,t+11,7),titlePeak:SA.get(n,t+12),titleGain:SA.get(n,t+14),albumPeak:SA.get(n,t+16),albumGain:SA.get(n,t+18),lastFrameLength:Le.get(n,t+20)>>>20&2047,trueGapless:Ta(n,t+23,0)};return o.lastFrameLength=o.trueGapless?Le.get(n,20)>>>20&2047:0,o}}});var _ie,Mie,Ab,Tie=Ce(()=>{_ie=qe(ct(),1);zi();Vl();Die();bie();XO();Mie=(0,_ie.default)("music-metadata:parser:musepack"),Ab=class extends vt{constructor(){super(...arguments),this.bitreader=null,this.audioLength=0,this.duration=null}async parse(){let t=await this.tokenizer.readToken(Oie);if(t.signature!=="MP+")throw new Zg("Unexpected magic number");Mie(`stream-version=${t.streamMajorVersion}.${t.streamMinorVersion}`),this.metadata.setFormat("container","Musepack, SV7"),this.metadata.setFormat("sampleRate",t.sampleFrequency);let o=1152*(t.frameCount-1)+t.lastFrameLength;this.metadata.setFormat("numberOfSamples",o),this.duration=o/t.sampleFrequency,this.metadata.setFormat("duration",this.duration),this.bitreader=new eb(this.tokenizer),this.metadata.setFormat("numberOfChannels",t.midSideStereo||t.intensityStereo?2:1);let i=await this.bitreader.read(8);return this.metadata.setFormat("codec",(i/100).toFixed(2)),await this.skipAudioData(t.frameCount),Mie(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`),zl(this.metadata,this.tokenizer,this.options)}async skipAudioData(t){for(;t-- >0;){let i=await this.bitreader.read(20);this.audioLength+=20+i,await this.bitreader.ignore(i)}let o=await this.bitreader.read(11);this.audioLength+=o,this.duration!==null&&this.metadata.setFormat("bitrate",this.audioLength/this.duration)}}});var kie={};Fr(kie,{MusepackParser:()=>j2});var Rie,Nie,j2,vie=Ce(()=>{Rie=qe(ct(),1);DA();cf();wie();Tie();XO();Nie=(0,Rie.default)("music-metadata:parser:musepack"),j2=class extends Js{async postId3v2Parse(){let t=await this.tokenizer.peekToken(new Ve(3,"latin1")),o;switch(t){case"MP+":{Nie("Stream-version 7"),o=new Ab(this.metadata,this.tokenizer,this.options);break}case"MPC":{Nie("Stream-version 8"),o=new $O(this.metadata,this.tokenizer,this.options);break}default:throw new Zg("Invalid signature prefix")}return this.metadata.setAudioOnly(),o.parse()}}});var Pie,Gie=Ce(()=>{Pie={parserType:"musepack",extensions:[".mpc"],mimeTypes:["audio/musepack"],async load(){return(await Promise.resolve().then(()=>(vie(),kie))).MusepackParser}}});var Sf,tb,J2=Ce(()=>{DA();er();Sf=class extends Qt("Opus"){},tb=class{constructor(t){if(t<19)throw new Sf("ID-header-page 0 should be at least 19 bytes long");this.len=t}get(t,o){return{magicSignature:new Ve(8,"ascii").get(t,o+0),version:QA.get(t,o+8),channelCount:QA.get(t,o+9),preSkip:SA.get(t,o+10),inputSampleRate:Le.get(t,o+12),outputGain:SA.get(t,o+16),channelMapping:QA.get(t,o+18)}}}});var rb,Fie=Ce(()=>{DA();Ef();J2();J2();rb=class extends qs{constructor(t,o,i){super(t,o),this.idHeader=null,this.lastPos=-1,this.tokenizer=i,this.durationOnLastPage=!0}parseFirstPage(t,o){if(this.metadata.setFormat("codec","Opus"),this.idHeader=new tb(o.length).get(o,0),this.idHeader.magicSignature!=="OpusHead")throw new Sf("Illegal ogg/Opus magic-signature");this.metadata.setFormat("sampleRate",this.idHeader.inputSampleRate),this.metadata.setFormat("numberOfChannels",this.idHeader.channelCount),this.metadata.setAudioOnly()}async parseFullPage(t){switch(new Ve(8,"ascii").get(t,0)){case"OpusTags":await this.parseUserCommentList(t,8),this.lastPos=this.tokenizer.position-t.length;break;default:break}}calculateDuration(t){if(this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0){let o=this.lastPageHeader.absoluteGranulePosition-this.idHeader.preSkip;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.setFormat("duration",o/48e3),this.lastPos!==-1&&this.tokenizer.fileInfo.size&&this.metadata.format.duration){let i=this.tokenizer.fileInfo.size-this.lastPos;this.metadata.setFormat("bitrate",8*i/this.metadata.format.duration)}}}}});var Lie,Uie=Ce(()=>{DA();Ar();Lie={len:80,get:(n,t)=>({speex:new Ve(8,"ascii").get(n,t+0),version:iO(new Ve(20,"ascii").get(n,t+8)),version_id:dr.get(n,t+28),header_size:dr.get(n,t+32),rate:dr.get(n,t+36),mode:dr.get(n,t+40),mode_bitstream_version:dr.get(n,t+44),nb_channels:dr.get(n,t+48),bitrate:dr.get(n,t+52),frame_size:dr.get(n,t+56),vbr:dr.get(n,t+60),frames_per_packet:dr.get(n,t+64),extra_headers:dr.get(n,t+68),reserved1:dr.get(n,t+72),reserved2:dr.get(n,t+76)})}});var Hie,Xqe,ab,Kie=Ce(()=>{Hie=qe(ct(),1);Ef();Uie();Xqe=(0,Hie.default)("music-metadata:parser:ogg:speex"),ab=class extends qs{constructor(t,o,i){super(t,o)}parseFirstPage(t,o){Xqe("First Ogg/Speex page");let i=Lie.get(o,0);this.metadata.setFormat("codec",`Speex ${i.version}`),this.metadata.setFormat("numberOfChannels",i.nb_channels),this.metadata.setFormat("sampleRate",i.rate),i.bitrate!==-1&&this.metadata.setFormat("bitrate",i.bitrate),this.metadata.setAudioOnly()}}});var xie,Yie=Ce(()=>{DA();xie={len:42,get:(n,t)=>({id:new Ve(7,"ascii").get(n,t),vmaj:QA.get(n,t+7),vmin:QA.get(n,t+8),vrev:QA.get(n,t+9),vmbw:LA.get(n,t+10),vmbh:LA.get(n,t+17),nombr:Pr.get(n,t+37),nqual:QA.get(n,t+40)})}});var Jie,jie,ib,qie=Ce(()=>{Jie=qe(ct(),1);Yie();jie=(0,Jie.default)("music-metadata:parser:ogg:theora"),ib=class{constructor(t,o,i){this.durationOnLastPage=!1,this.metadata=t}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){jie("duration calculation not implemented")}async parseFirstPage(t,o){jie("First Ogg/Theora page"),this.metadata.setFormat("codec","Theora");let i=xie.get(o,0);this.metadata.setFormat("bitrate",i.nombr),this.metadata.setFormat("hasVideo",!0)}flush(){return Promise.resolve()}}});var zie,ob,Vie=Ce(()=>{DA();Ar();DA();zie={len:27,get:(n,t)=>({capturePattern:new Ve(4,"latin1").get(n,t),version:QA.get(n,t+4),headerType:{continued:GA(n,t+5,0),firstPage:GA(n,t+5,1),lastPage:GA(n,t+5,2)},absoluteGranulePosition:Number(Gr.get(n,t+6)),streamSerialNumber:Le.get(n,t+14),pageSequenceNo:Le.get(n,t+18),pageChecksum:Le.get(n,t+22),page_segments:QA.get(n,t+26)})},ob=class n{static sum(t,o,i){let e=new DataView(t.buffer,0),a=0;for(let A=o;A{Wie=qe(ct(),1);v2();P2();ui();TO();q2=(0,Wie.default)("music-metadata:parser:ogg:theora"),nb=class{constructor(t,o,i){this.durationOnLastPage=!1,this.metadata=t,this.options=o,this.tokenizer=i,this.flacParser=new Bf(this.metadata,this.tokenizer,o)}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){q2("duration calculation not implemented")}async parseFirstPage(t,o){if(q2("First Ogg/FLAC page"),(await rt.get(o,9)).toString()!=="fLaC")throw new Error("Invalid FLAC preamble");let e=await Cf.get(o,13);await this.parseDataBlock(e,o.subarray(13+Cf.len))}async parseDataBlock(t,o){switch(q2(`blockHeader type=${t.type}, length=${t.length}`),t.type){case fi.STREAMINFO:{let i=uf.get(o,0);return this.flacParser.processsStreamInfo(i)}case fi.PADDING:break;case fi.APPLICATION:break;case fi.SEEKTABLE:break;case fi.VORBIS_COMMENT:return this.flacParser.parseComment(o);case fi.PICTURE:if(!this.options.skipCovers){let i=new BI(o.length).get(o,0);return this.flacParser.addPictureTag(i)}break;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}flush(){return Promise.resolve()}}});var $ie={};Fr($ie,{OggContentError:()=>aE,OggParser:()=>V2});var Xie,aE,Vs,z2,V2,eoe=Ce(()=>{DA();Xo();Xie=qe(ct(),1);zi();Ef();Fie();Kie();qie();er();Vie();Zie();aE=class extends Qt("Ogg"){},Vs=(0,Xie.default)("music-metadata:parser:ogg"),z2=class{constructor(t,o,i){this.pageNumber=0,this.closed=!1,this.metadata=t,this.streamSerial=o,this.options=i}async parsePage(t,o){this.pageNumber=o.pageSequenceNo,Vs("serial=%s page#=%s, Ogg.id=%s",o.streamSerialNumber,o.pageSequenceNo,o.capturePattern);let i=await t.readToken(new ob(o));Vs("totalPageSize=%s",i.totalPageSize);let e=await t.readToken(new Ot(i.totalPageSize));if(Vs("firstPage=%s, lastPage=%s, continued=%s",o.headerType.firstPage,o.headerType.lastPage,o.headerType.continued),o.headerType.firstPage){this.metadata.setFormat("container","Ogg");let a=e.subarray(0,7),A=Array.from(a).filter(r=>r>=32&&r<=126).map(r=>String.fromCharCode(r)).join("");switch(A){case"vorbis":Vs(`Set Ogg stream serial ${o.streamSerialNumber}, codec=Vorbis`),this.pageConsumer=new qs(this.metadata,this.options);break;case"OpusHea":Vs("Set page consumer to Ogg/Opus"),this.pageConsumer=new rb(this.metadata,this.options,t);break;case"Speex ":Vs("Set page consumer to Ogg/Speex"),this.pageConsumer=new ab(this.metadata,this.options,t);break;case"fishead":case"theora":Vs("Set page consumer to Ogg/Theora"),this.pageConsumer=new ib(this.metadata,this.options,t);break;case"FLAC":Vs("Set page consumer to Vorbis"),this.pageConsumer=new nb(this.metadata,this.options,t);break;default:throw new aE(`Ogg codec not recognized (id=${A}`)}}if(o.headerType.lastPage&&(this.closed=!0),this.pageConsumer)await this.pageConsumer.parsePage(o,e);else throw new Error("pageConsumer should be initialized")}},V2=class extends vt{constructor(){super(...arguments),this.streams=new Map}async parse(){this.streams=new Map;let t=!1,o;try{do{if(o=await this.tokenizer.readToken(zie),o.capturePattern!=="OggS")throw new aE("Invalid Ogg capture pattern");let i=this.streams.get(o.streamSerialNumber);if(i||(i=new z2(this.metadata,o.streamSerialNumber,this.options),this.streams.set(o.streamSerialNumber,i)),await i.parsePage(this.tokenizer,o),i.pageNumber>12&&!(this.options.duration&&[...this.streams.values()].find(e=>e.pageConsumer?.durationOnLastPage))){Vs("Stop processing Ogg stream");break}}while(![...this.streams.values()].every(i=>i.closed))}catch(i){if(i instanceof kA)Vs("Reached end-of-stream"),t=!0;else if(i instanceof aE)this.metadata.addWarning(`Corrupt Ogg content at ${this.tokenizer.position}`);else throw i}for(let i of this.streams.values())i.closed||(this.metadata.addWarning(`End-of-stream reached before reaching last page in Ogg stream serial=${i.streamSerial}`),await i.pageConsumer?.flush()),i.pageConsumer?.calculateDuration(t)}}});var Aoe,toe=Ce(()=>{Aoe={parserType:"ogg",extensions:[".ogg",".ogv",".oga",".ogm",".ogx",".opus",".spx"],mimeTypes:["audio/ogg","audio/opus","audio/speex","video/ogg"],async load(){return(await Promise.resolve().then(()=>(eoe(),$ie))).OggParser}}});function Ws(n,t){return sb(n,t,1)===1}function sb(n,t,o){return n>>>t&4294967295>>>32-o}var $qe,wf,gb,roe=Ce(()=>{DA();ui();$qe=[6e3,8e3,9600,11025,12e3,16e3,22050,24e3,32e3,44100,48e3,64e3,88200,96e3,192e3,-1],wf={len:32,get:(n,t)=>{let o=Le.get(n,t+24),i={BlockID:rt.get(n,t),blockSize:Le.get(n,t+4),version:SA.get(n,t+8),totalSamples:Le.get(n,t+12),blockIndex:Le.get(n,t+16),blockSamples:Le.get(n,t+20),flags:{bitsPerSample:(1+sb(o,0,2))*8,isMono:Ws(o,2),isHybrid:Ws(o,3),isJointStereo:Ws(o,4),crossChannel:Ws(o,5),hybridNoiseShaping:Ws(o,6),floatingPoint:Ws(o,7),samplingRate:$qe[sb(o,23,4)],isDSD:Ws(o,31)},crc:new Ot(4).get(n,t+28)};return i.flags.isDSD&&(i.totalSamples*=8),i}},gb={len:1,get:(n,t)=>({functionId:sb(n[t],0,6),isOptional:Ws(n[t],5),isOddSize:Ws(n[t],6),largeBlock:Ws(n[t],7)})}});var ioe={};Fr(ioe,{WavPackContentError:()=>iE,WavPackParser:()=>W2});var aoe,tp,iE,W2,ooe=Ce(()=>{DA();Vl();ui();zi();roe();aoe=qe(ct(),1);$B();er();tp=(0,aoe.default)("music-metadata:parser:WavPack"),iE=class extends Qt("WavPack"){},W2=class extends vt{constructor(){super(...arguments),this.audioDataSize=0}async parse(){return this.metadata.setAudioOnly(),this.audioDataSize=0,await this.parseWavPackBlocks(),zl(this.metadata,this.tokenizer,this.options)}async parseWavPackBlocks(){do{if(await this.tokenizer.peekToken(rt)!=="wvpk")break;let o=await this.tokenizer.readToken(wf);if(o.BlockID!=="wvpk")throw new iE("Invalid WavPack Block-ID");tp(`WavPack header blockIndex=${o.blockIndex}, len=${wf.len}`),o.blockIndex===0&&!this.metadata.format.container&&(this.metadata.setFormat("container","WavPack"),this.metadata.setFormat("lossless",!o.flags.isHybrid),this.metadata.setFormat("bitsPerSample",o.flags.bitsPerSample),o.flags.isDSD||(this.metadata.setFormat("sampleRate",o.flags.samplingRate),this.metadata.setFormat("duration",o.totalSamples/o.flags.samplingRate)),this.metadata.setFormat("numberOfChannels",o.flags.isMono?1:2),this.metadata.setFormat("numberOfSamples",o.totalSamples),this.metadata.setFormat("codec",o.flags.isDSD?"DSD":"PCM"));let i=o.blockSize-(wf.len-8);await(o.blockIndex===0?this.parseMetadataSubBlock(o,i):this.tokenizer.ignore(i)),o.blockSamples>0&&(this.audioDataSize+=o.blockSize)}while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=wf.len);this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioDataSize*8/this.metadata.format.duration)}async parseMetadataSubBlock(t,o){let i=o;for(;i>gb.len;){let e=await this.tokenizer.readToken(gb),a=await this.tokenizer.readNumber(e.largeBlock?VB:QA),A=new Uint8Array(a*2-(e.isOddSize?1:0));switch(await this.tokenizer.readBuffer(A),tp(`Metadata Sub-Blocks functionId=0x${e.functionId.toString(16)}, id.largeBlock=${e.largeBlock},data-size=${A.length}`),e.functionId){case 0:break;case 14:{tp("ID_DSD_BLOCK");let r=1<{noe={parserType:"wavpack",extensions:[".wv",".wvp"],mimeTypes:["audio/wavpack"],async load(){return(await Promise.resolve().then(()=>(ooe(),ioe))).WavPackParser}}});var oE,cb,goe=Ce(()=>{DA();oE={len:8,get:(n,t)=>({chunkID:new Ve(4,"latin1").get(n,t),chunkSize:Le.get(n,t+4)})},cb=class{constructor(t){this.tagHeader=t,this.len=t.chunkSize,this.len+=this.len&1}get(t,o){return new Ve(this.tagHeader.chunkSize,"ascii").get(t,o)}}});var rp,ha,coe,Ib,lb,Z2=Ce(()=>{DA();er();rp=class extends Qt("Wave"){},ha={PCM:1,ADPCM:2,IEEE_FLOAT:3,ALAW:6,MULAW:7,DVI_ADPCM:17,GSM610:49,MPEG_ADTS_AAC:5632,MPEG_LOAS:5634,RAW_AAC1:255,DOLBY_AC3_SPDIF:146,DVM:8192,RAW_SPORT:576,ESST_AC3:577,DRM:9,DTS2:8193,MPEG:80,MPEGLAYER3:85},coe={[ha.PCM]:"PCM",[ha.ADPCM]:"ADPCM",[ha.IEEE_FLOAT]:"IEEE_FLOAT",[ha.ALAW]:"ALAW",[ha.MULAW]:"MULAW",[ha.DVI_ADPCM]:"DVI_ADPCM",[ha.GSM610]:"GSM610",[ha.MPEG_ADTS_AAC]:"MPEG_ADTS_AAC",[ha.MPEG_LOAS]:"MPEG_LOAS",[ha.RAW_AAC1]:"RAW_AAC1",[ha.DOLBY_AC3_SPDIF]:"DOLBY_AC3_SPDIF",[ha.DVM]:"DVM",[ha.RAW_SPORT]:"RAW_SPORT",[ha.ESST_AC3]:"ESST_AC3",[ha.DRM]:"DRM",[ha.DTS2]:"DTS2",[ha.MPEG]:"MPEG",[ha.MPEGLAYER3]:"MPEGLAYER3"},Ib=class{constructor(t){if(t.chunkSize<16)throw new rp("Invalid chunk size");this.len=t.chunkSize}get(t,o){return{wFormatTag:SA.get(t,o),nChannels:SA.get(t,o+2),nSamplesPerSec:Le.get(t,o+4),nAvgBytesPerSec:Le.get(t,o+8),nBlockAlign:SA.get(t,o+12),wBitsPerSample:SA.get(t,o+14)}}},lb=class{constructor(t){if(t.chunkSize<4)throw new rp("Invalid fact chunk size.");this.len=t.chunkSize}get(t,o){return{dwSampleLength:Le.get(t,o)}}}});var X2,Ioe=Ce(()=>{DA();Ar();X2={len:420,get:(n,t)=>({description:tn(new Ve(256,"ascii").get(n,t)).trim(),originator:tn(new Ve(32,"ascii").get(n,t+256)).trim(),originatorReference:tn(new Ve(32,"ascii").get(n,t+288)).trim(),originationDate:tn(new Ve(10,"ascii").get(n,t+320)).trim(),originationTime:tn(new Ve(8,"ascii").get(n,t+330)).trim(),timeReferenceLow:Le.get(n,t+338),timeReferenceHigh:Le.get(n,t+342),version:SA.get(n,t+346),umid:new Ot(64).get(n,t+348),loudnessValue:SA.get(n,t+412),maxTruePeakLevel:SA.get(n,t+414),maxMomentaryLoudness:SA.get(n,t+416),maxShortTermLoudness:SA.get(n,t+418)})}});var poe={};Fr(poe,{WaveParser:()=>$2});var loe,fI,$2,doe=Ce(()=>{Xo();DA();loe=qe(ct(),1);goe();Z2();Yh();Ar();ui();zi();Ioe();Z2();fI=(0,loe.default)("music-metadata:parser:RIFF"),$2=class extends vt{constructor(){super(...arguments),this.blockAlign=0,this.avgBytesPerSec=0}async parse(){let t=await this.tokenizer.readToken(oE);if(fI(`pos=${this.tokenizer.position}, parse: chunkID=${t.chunkID}`),t.chunkID==="RIFF")return this.metadata.setAudioOnly(),this.parseRiffChunk(t.chunkSize).catch(o=>{if(!(o instanceof kA))throw o})}async parseRiffChunk(t){let o=await this.tokenizer.readToken(rt);switch(this.metadata.setFormat("container",o),o){case"WAVE":return this.readWaveChunk(t-rt.len);default:throw new rp(`Unsupported RIFF format: RIFF/${o}`)}}async readWaveChunk(t){for(;t>=oE.len;){let o=await this.tokenizer.readToken(oE);switch(t-=oE.len+o.chunkSize,o.chunkSize>t&&this.metadata.addWarning("Data chunk size exceeds file size"),this.header=o,fI(`pos=${this.tokenizer.position}, readChunk: chunkID=RIFF/WAVE/${o.chunkID}`),o.chunkID){case"LIST":await this.parseListTag(o);break;case"fact":this.metadata.setFormat("lossless",!1),this.fact=await this.tokenizer.readToken(new lb(o));break;case"fmt ":{let i=await this.tokenizer.readToken(new Ib(o)),e=coe[i.wFormatTag];e||(fI(`WAVE/non-PCM format=${i.wFormatTag}`),e=`non-PCM (${i.wFormatTag})`),this.metadata.setFormat("codec",e),this.metadata.setFormat("bitsPerSample",i.wBitsPerSample),this.metadata.setFormat("sampleRate",i.nSamplesPerSec),this.metadata.setFormat("numberOfChannels",i.nChannels),this.blockAlign=i.nBlockAlign,this.avgBytesPerSec=i.nAvgBytesPerSec;break}case"id3 ":case"ID3 ":{let i=await this.tokenizer.readToken(new Ot(o.chunkSize)),e=Co(i);await new on().parse(this.metadata,e,this.options);break}case"data":{this.metadata.format.lossless!==!1&&this.metadata.setFormat("lossless",!0);let i=o.chunkSize;if(this.tokenizer.fileInfo.size){let a=this.tokenizer.fileInfo.size-this.tokenizer.position;a0?this.metadata.setFormat("bitrate",this.avgBytesPerSec*8):this.metadata.format.duration&&this.metadata.setFormat("bitrate",i*8/this.metadata.format.duration),await this.tokenizer.ignore(o.chunkSize);break}case"bext":{let i=await this.tokenizer.readToken(X2);Object.keys(i).forEach(a=>{this.metadata.addTag("exif",`bext.${a}`,i[a])});let e=o.chunkSize-X2.len;await this.tokenizer.ignore(e);break}case"\0\0\0\0":fI(`Ignore padding chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize);break;default:fI(`Ignore chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize)}this.header.chunkSize%2===1&&(fI("Read odd padding byte"),await this.tokenizer.ignore(1))}}async parseListTag(t){let o=await this.tokenizer.readToken(new Ve(4,"latin1"));switch(fI("pos=%s, parseListTag: chunkID=RIFF/WAVE/LIST/%s",this.tokenizer.position,o),o){case"INFO":return this.parseRiffInfoTags(t.chunkSize-4);default:return this.metadata.addWarning(`Ignore chunk: RIFF/WAVE/LIST/${o}`),fI(`Ignoring chunkID=RIFF/WAVE/LIST/${o}`),this.tokenizer.ignore(t.chunkSize-4).then()}}async parseRiffInfoTags(t){for(;t>=8;){let o=await this.tokenizer.readToken(oE),i=new cb(o),e=await this.tokenizer.readToken(i);this.addTag(o.chunkID,tn(e)),t-=8+i.len}if(t!==0)throw new rp(`Illegal remaining size: ${t}`)}addTag(t,o){this.metadata.addTag("exif",t,o)}}});var hoe,Eoe=Ce(()=>{hoe={parserType:"riff",extensions:[".wav","wave",".bwf"],mimeTypes:["audio/vnd.wave","audio/wav","audio/wave"],async load(){return(await Promise.resolve().then(()=>(doe(),poe))).WaveParser}}});function t4e(n){let t=Coe.default.parse(n),o=nre(t.type);return{type:o.type,subtype:o.subtype,suffix:o.suffix,parameters:t.parameters}}function r4e(n){let t=n.lastIndexOf(".");return t===-1?"":n.substring(t)}var Coe,uoe,ap,ip,eU=Ce(()=>{A2();Coe=qe(ore(),1);sre();uoe=qe(ct(),1);_re();Jl();rae();er();iae();uae();Sae();Tae();Lae();Jae();tie();uie();Gie();toe();soe();Eoe();pb();ap=(0,uoe.default)("music-metadata:parser:factory");ip=class{constructor(){this.parsers=[],[jae,tae,aae,Cie,Aie,hoe,Aoe,Cae,_ae,noe,Pie,Fae,mae].forEach(t=>{this.registerParser(t)})}registerParser(t){this.parsers.push(t)}async parse(t,o,i){if(t.supportsRandomAccess()?(ap("tokenizer supports random-access, scanning for appending headers"),await AU(t,i)):ap("tokenizer does not support random-access, cannot scan for appending headers"),!o){let r=new Uint8Array(4100);if(t.fileInfo.mimeType&&(o=this.findLoaderForContentType(t.fileInfo.mimeType)),!o&&t.fileInfo.path&&(o=this.findLoaderForExtension(t.fileInfo.path)),!o){ap("Guess parser on content..."),await t.peekBuffer(r,{mayBeLess:!0});let s=await tf(r,{mpegOffsetTolerance:10});if(!s||!s.mime)throw new cI("Failed to determine audio format");if(ap(`Guessed file type is mime=${s.mime}, extension=${s.ext}`),o=this.findLoaderForContentType(s.mime),!o)throw new II(`Guessed MIME-type not supported: ${s.mime}`)}}ap(`Loading ${o.parserType} parser...`);let e=new uO(i),a=await o.load(),A=new a(e,t,i??{});return ap(`Parser ${o.parserType} loaded`),await A.parse(),e.format.trackInfo&&(e.format.hasAudio===void 0&&e.setFormat("hasAudio",!!e.format.trackInfo.find(r=>r.type===pa.audio)),e.format.hasVideo===void 0&&e.setFormat("hasVideo",!!e.format.trackInfo.find(r=>r.type===pa.video))),e.toCommonMetadata()}findLoaderForExtension(t){if(!t)return;let o=r4e(t).toLocaleLowerCase()||t;return this.parsers.find(i=>i.extensions.indexOf(o)!==-1)}findLoaderForContentType(t){let o;if(!t)return;try{o=t4e(t)}catch{ap(`Invalid HTTP Content-Type header value: ${t}`);return}let i=o.subtype.indexOf("x-")===0?o.subtype.substring(2):o.subtype;return this.parsers.find(e=>e.mimeTypes.find(a=>a.indexOf(`${o.type}/${i}`)!==-1))}getSupportedMimeTypes(){let t=new Set;return this.parsers.forEach(o=>{o.mimeTypes.forEach(i=>{t.add(i),t.add(i.replace("/","/x-"))})}),Array.from(t)}}});async function Boe(n){let t=n.fileInfo.size;if(t>=143){let o=new Uint8Array(15),i=n.position;await n.readBuffer(o,{position:t-143}),n.setPosition(i);let e=br(o,"latin1");if(e.substring(6)===a4e)return Number.parseInt(e.substring(0,6),10)+15}return 0}var a4e,foe=Ce(()=>{Fs();a4e="LYRICS200"});async function i4e(n,t={}){let o=zD(n);try{return await nE(o,t)}finally{await o.close()}}async function o4e(n,t,o={}){let i=qD(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await nE(i,o)}finally{await i.close()}}async function n4e(n,t,o={}){let i=Co(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});return nE(i,o)}function nE(n,t){return new ip().parse(n,void 0,t)}function s4e(n){let t={};for(let{id:o,value:i}of n)(t[o]||(t[o]=[])).push(i);return t}function g4e(n){return n===void 0?0:1+Math.round(n*4)}function c4e(n){return n?n.reduce((t,o)=>o.name&&o.name.toLowerCase()in["front","cover","cover (front)"]?o:t):null}async function AU(n,t={}){let o=n.fileInfo.size;if(await Lre(n)){o-=128;let i=await Boe(n);o-=i}t.apeHeader=await dI.findApeFooterOffset(n,o)}function I4e(){return new ip().getSupportedMimeTypes()}var pb=Ce(()=>{Xo();eU();Vl();nf();foe();Jl();er();er()});var moe={};Fr(moe,{CouldNotDetermineFileTypeError:()=>cI,FieldDecodingError:()=>An,InternalParserError:()=>jl,LyricsContentType:()=>Fh,TimestampFormat:()=>Lh,UnsupportedFileTypeError:()=>II,getSupportedMimeTypes:()=>I4e,makeParseError:()=>Ph,makeUnexpectedFileContentError:()=>Qt,orderTags:()=>s4e,parseBlob:()=>i4e,parseBuffer:()=>n4e,parseFile:()=>p4e,parseFromTokenizer:()=>nE,parseStream:()=>l4e,parseWebStream:()=>o4e,ratingToStars:()=>g4e,scanAppendingHeaders:()=>AU,selectCover:()=>c4e});async function l4e(n,t,o={}){let i=await HL(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await nE(i,o)}finally{await i.close()}}async function p4e(n,t={}){Qoe(`parseFile: ${n}`);let o=await fte(n),i=new ip;try{let e=i.findLoaderForExtension(n);e||Qoe("Parser could not be determined by file extension");try{return await i.parse(o,e,t)}catch(a){throw(a instanceof cI||a instanceof II)&&(a.message+=`: ${n}`),a}}finally{await o.close()}}var yoe,Qoe,Soe=Ce(()=>{Xo();yoe=qe(ct(),1);pb();eU();pb();Qoe=(0,yoe.default)("music-metadata:parser")});var Fne=$((a0A,vU)=>{"use strict";var y8e=Object.prototype.hasOwnProperty,Qi="~";function Ff(){}Object.create&&(Ff.prototype=Object.create(null),new Ff().__proto__||(Qi=!1));function m8e(n,t,o){this.fn=n,this.context=t,this.once=o||!1}function Gne(n,t,o,i,e){if(typeof o!="function")throw new TypeError("The listener must be a function");var a=new m8e(o,i||n,e),A=Qi?Qi+t:t;return n._events[A]?n._events[A].fn?n._events[A]=[n._events[A],a]:n._events[A].push(a):(n._events[A]=a,n._eventsCount++),n}function Ob(n,t){--n._eventsCount===0?n._events=new Ff:delete n._events[t]}function ii(){this._events=new Ff,this._eventsCount=0}ii.prototype.eventNames=function(){var t=[],o,i;if(this._eventsCount===0)return t;for(i in o=this._events)y8e.call(o,i)&&t.push(Qi?i.slice(1):i);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};ii.prototype.listeners=function(t){var o=Qi?Qi+t:t,i=this._events[o];if(!i)return[];if(i.fn)return[i.fn];for(var e=0,a=i.length,A=new Array(a);e{"use strict";var Kf=n=>n&&typeof n.message=="string",VU=n=>{if(!n)return;let t=n.cause;if(typeof t=="function"){let o=n.cause();return Kf(o)?o:void 0}else return Kf(t)?t:void 0},lse=(n,t)=>{if(!Kf(n))return"";let o=n.stack||"";if(t.has(n))return o+` causes have become circular...`;let i=VU(n);return i?(t.add(n),o+` -caused by: `+lse(i,t)):o},ize=n=>lse(n,new Set),pse=(n,t,o)=>{if(!Kf(n))return"";let i=o?"":n.message||"";if(t.has(n))return i+": ...";let e=VU(n);if(e){t.add(n);let a=typeof n.cause=="function";return i+(a?"":": ")+pse(e,t,a)}else return i},oze=n=>pse(n,new Set);dse.exports={isErrorLike:Kf,getErrorCause:VU,stackWithCauses:ize,messageWithCauses:oze}});var ZU=$((RkA,Ese)=>{"use strict";var nze=Symbol("circular-ref-tag"),Lb=Symbol("pino-raw-err-ref"),hse=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Lb]},set:function(n){this[Lb]=n}}});Object.defineProperty(hse,Lb,{writable:!0,value:{}});Ese.exports={pinoErrProto:hse,pinoErrorSymbols:{seen:nze,rawSymbol:Lb}}});var Bse=$((kkA,use)=>{"use strict";use.exports=$U;var{messageWithCauses:sze,stackWithCauses:gze,isErrorLike:Cse}=WU(),{pinoErrProto:cze,pinoErrorSymbols:Ize}=ZU(),{seen:XU}=Ize,{toString:lze}=Object.prototype;function $U(n){if(!Cse(n))return n;n[XU]=void 0;let t=Object.create(cze);t.type=lze.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=sze(n),t.stack=gze(n),Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>$U(o)));for(let o in n)if(t[o]===void 0){let i=n[o];Cse(i)?o!=="cause"&&!Object.prototype.hasOwnProperty.call(i,XU)&&(t[o]=$U(i)):t[o]=i}return delete n[XU],t.raw=n,t}});var Qse=$((vkA,fse)=>{"use strict";fse.exports=Hb;var{isErrorLike:eH}=WU(),{pinoErrProto:pze,pinoErrorSymbols:dze}=ZU(),{seen:Ub}=dze,{toString:hze}=Object.prototype;function Hb(n){if(!eH(n))return n;n[Ub]=void 0;let t=Object.create(pze);t.type=hze.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=n.message,t.stack=n.stack,Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>Hb(o))),eH(n.cause)&&!Object.prototype.hasOwnProperty.call(n.cause,Ub)&&(t.cause=Hb(n.cause));for(let o in n)if(t[o]===void 0){let i=n[o];eH(i)?Object.prototype.hasOwnProperty.call(i,Ub)||(t[o]=Hb(i)):t[o]=i}return delete n[Ub],t.raw=n,t}});var wse=$((PkA,Sse)=>{"use strict";Sse.exports={mapHttpRequest:Eze,reqSerializer:mse};var AH=Symbol("pino-raw-req-ref"),yse=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[AH]},set:function(n){this[AH]=n}}});Object.defineProperty(yse,AH,{writable:!0,value:{}});function mse(n){let t=n.info||n.socket,o=Object.create(yse);if(o.id=typeof n.id=="function"?n.id():n.id||(n.info?n.info.id:void 0),o.method=n.method,n.originalUrl)o.url=n.originalUrl;else{let i=n.path;o.url=typeof i=="string"?i:n.url?n.url.path||n.url:void 0}return n.query&&(o.query=n.query),n.params&&(o.params=n.params),o.headers=n.headers,o.remoteAddress=t&&t.remoteAddress,o.remotePort=t&&t.remotePort,o.raw=n.raw||n,o}function Eze(n){return{req:mse(n)}}});var Mse=$((GkA,bse)=>{"use strict";bse.exports={mapHttpResponse:Cze,resSerializer:Ose};var tH=Symbol("pino-raw-res-ref"),Dse=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[tH]},set:function(n){this[tH]=n}}});Object.defineProperty(Dse,tH,{writable:!0,value:{}});function Ose(n){let t=Object.create(Dse);return t.statusCode=n.headersSent?n.statusCode:null,t.headers=n.getHeaders?n.getHeaders():n._headers,t.raw=n,t}function Cze(n){return{res:Ose(n)}}});var aH=$((FkA,_se)=>{"use strict";var rH=Bse(),uze=Qse(),Kb=wse(),xb=Mse();_se.exports={err:rH,errWithCause:uze,mapHttpRequest:Kb.mapHttpRequest,mapHttpResponse:xb.mapHttpResponse,req:Kb.reqSerializer,res:xb.resSerializer,wrapErrorSerializer:function(t){return t===rH?t:function(i){return t(rH(i))}},wrapRequestSerializer:function(t){return t===Kb.reqSerializer?t:function(i){return t(Kb.reqSerializer(i))}},wrapResponseSerializer:function(t){return t===xb.resSerializer?t:function(i){return t(xb.resSerializer(i))}}}});var iH=$((LkA,Tse)=>{"use strict";function Bze(n,t){return t}Tse.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Bze;let o=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(o))return;let i=o.slice(2),e=[];for(let a of i)a&&e.push(a.getFileName());return e}});var Gse=$((UkA,Pse)=>{"use strict";function oH(n){if(n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(n instanceof Array){let t=[];for(let o=0;o{let Q=[...s.slice(0,I),...f];return o(B,Q)}:o,e,a);else if(a)kse(c,r);else{let d=typeof o=="function"?o(Qze(c,r),[...s.slice(0,I),...r]):o;Rse(c,r,d)}}if(A.length===0)g(n,0);else{let c=n;for(let I=0;I0)o?a===i&&(o=!1,i=""):(o=!0,i=a);else if(a==="["&&!o)t++;else if(a==="]"&&!o&&(t--,t<0))throw new Error(`Invalid redaction path (${n})`)}if(t!==0)throw new Error(`Invalid redaction path (${n})`)}function Oze(n){if(!Array.isArray(n))throw new TypeError("paths must be an array");for(let t of n)Dze(t)}function bze(n={}){let{paths:t=[],censor:o="[REDACTED]",serialize:i=JSON.stringify,strict:e=!0,remove:a=!1}=n;Oze(t);let A=Sze(t);return function(s){if(e&&(s===null||typeof s!="object")&&(s==null||typeof s!="object"))return i?i(s):s;let g=wze(s,A),c=s,I=o;return typeof o=="function"&&(I=o),yze(g,t,I,a),i===!1?(g.restore=function(){return oH(c)},g):typeof i=="function"?i(g):JSON.stringify(g)}}Pse.exports=bze});var BE=$((HkA,Fse)=>{"use strict";var Mze=Symbol("pino.setLevel"),_ze=Symbol("pino.getLevel"),Tze=Symbol("pino.levelVal"),Nze=Symbol("pino.levelComp"),Rze=Symbol("pino.useLevelLabels"),kze=Symbol("pino.useOnlyCustomLevels"),vze=Symbol("pino.mixin"),Pze=Symbol("pino.lsCache"),Gze=Symbol("pino.chindings"),Fze=Symbol("pino.asJson"),Lze=Symbol("pino.write"),Uze=Symbol("pino.redactFmt"),Hze=Symbol("pino.time"),Kze=Symbol("pino.timeSliceIndex"),xze=Symbol("pino.stream"),Yze=Symbol("pino.stringify"),jze=Symbol("pino.stringifySafe"),Jze=Symbol("pino.stringifiers"),qze=Symbol("pino.end"),zze=Symbol("pino.formatOpts"),Vze=Symbol("pino.messageKey"),Wze=Symbol("pino.errorKey"),Zze=Symbol("pino.nestedKey"),Xze=Symbol("pino.nestedKeyStr"),$ze=Symbol("pino.mixinMergeStrategy"),eVe=Symbol("pino.msgPrefix"),AVe=Symbol("pino.wildcardFirst"),tVe=Symbol.for("pino.serializers"),rVe=Symbol.for("pino.formatters"),aVe=Symbol.for("pino.hooks"),iVe=Symbol.for("pino.metadata");Fse.exports={setLevelSym:Mze,getLevelSym:_ze,levelValSym:Tze,levelCompSym:Nze,useLevelLabelsSym:Rze,mixinSym:vze,lsCacheSym:Pze,chindingsSym:Gze,asJsonSym:Fze,writeSym:Lze,serializersSym:tVe,redactFmtSym:Uze,timeSym:Hze,timeSliceIndexSym:Kze,streamSym:xze,stringifySym:Yze,stringifySafeSym:jze,stringifiersSym:Jze,endSym:qze,formatOptsSym:zze,messageKeySym:Vze,errorKeySym:Wze,nestedKeySym:Zze,wildcardFirstSym:AVe,needsMetadataGsym:iVe,useOnlyCustomLevelsSym:kze,formattersSym:rVe,hooksSym:aVe,nestedKeyStrSym:Xze,mixinMergeStrategySym:$ze,msgPrefixSym:eVe}});var sH=$((KkA,Kse)=>{"use strict";var Lse=Gse(),{redactFmtSym:oVe,wildcardFirstSym:jb}=BE(),nH=/[^.[\]]+|\[([^[\]]*?)\]/g,Use="[Redacted]",Hse=!1;function nVe(n,t){let{paths:o,censor:i,remove:e}=sVe(n),a=o.reduce((s,g)=>{nH.lastIndex=0;let c=nH.exec(g),I=nH.exec(g),d=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(d==="*"&&(d=jb),I===null)return s[d]=null,s;if(s[d]===null)return s;let{index:B}=I,f=`${g.substr(B,g.length-1)}`;return s[d]=s[d]||[],d!==jb&&s[d].length===0&&s[d].push(...s[jb]||[]),d===jb&&Object.keys(s).forEach(function(Q){s[Q]&&s[Q].push(f)}),s[d].push(f),s},{}),A={[oVe]:Lse({paths:o,censor:i,serialize:t,strict:Hse,remove:e})},r=(...s)=>t(typeof i=="function"?i(...s):i);return[...Object.keys(a),...Object.getOwnPropertySymbols(a)].reduce((s,g)=>{if(a[g]===null)s[g]=c=>r(c,[g]);else{let c=typeof i=="function"?(I,d)=>i(I,[g,...d]):i;s[g]=Lse({paths:a[g],censor:c,serialize:t,strict:Hse,remove:e})}return s},A)}function sVe(n){if(Array.isArray(n))return n={paths:n,censor:Use},n;let{paths:t,censor:o=Use,remove:i}=n;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(o=void 0),{paths:t,censor:o,remove:i}}Kse.exports=nVe});var jse=$((xkA,Yse)=>{"use strict";var gVe=()=>"",cVe=()=>`,"time":${Date.now()}`,IVe=()=>`,"time":${Math.round(Date.now()/1e3)}`,lVe=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,pVe=1000000n,xse=1000000000n,dVe=BigInt(Date.now())*pVe,hVe=process.hrtime.bigint(),EVe=()=>{let n=process.hrtime.bigint()-hVe,t=dVe+n,o=t/xse,i=t%xse,e=Number(o*1000n+i/1000000n),a=new Date(e),A=a.getUTCFullYear(),r=(a.getUTCMonth()+1).toString().padStart(2,"0"),s=a.getUTCDate().toString().padStart(2,"0"),g=a.getUTCHours().toString().padStart(2,"0"),c=a.getUTCMinutes().toString().padStart(2,"0"),I=a.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${A}-${r}-${s}T${g}:${c}:${I}.${i.toString().padStart(9,"0")}Z"`};Yse.exports={nullTime:gVe,epochTime:cVe,unixTime:IVe,isoTime:lVe,isoTimeNano:EVe}});var qse=$((YkA,Jse)=>{"use strict";function CVe(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}Jse.exports=uVe;function uVe(n,t,o){var i=o&&o.stringify||CVe,e=1;if(typeof n=="object"&&n!==null){var a=t.length+e;if(a===1)return n;var A=new Array(a);A[0]=i(n);for(var r=1;r-1?I:0,n.charCodeAt(B+1)){case 100:case 102:if(c>=s||t[c]==null)break;I=s||t[c]==null)break;I=s||t[c]===void 0)break;I",I=B+2,B++;break}g+=i(t[c]),I=B+2,B++;break;case 115:if(c>=s)break;I{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(o){if((o>0&&o<1/0)===!1)throw typeof o!="number"&&typeof o!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(n,0,0,Number(o))},n=new Int32Array(new SharedArrayBuffer(4));gH.exports=t}else{let n=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(t);for(;i>Date.now(););};gH.exports=n}});var Age=$((JkA,ege)=>{"use strict";var zt=$e("fs"),BVe=$e("events"),fVe=$e("util").inherits,zse=$e("path"),lH=cH(),QVe=$e("assert"),Jb=100,qb=Buffer.allocUnsafe(0),yVe=16*1024,Vse="buffer",Wse="utf8",[mVe,SVe]=(process.versions.node||"0.0").split(".").map(Number),wVe=mVe>=22&&SVe>=7;function Zse(n,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function o(a,A){if(a){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",a)}):t.emit("error",a);return}let r=t._reopening;t.fd=A,t.file=n,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():r&&process.nextTick(()=>t.emit("drain")))}let i=t.append?"a":"w",e=t.mode;if(t.sync)try{t.mkdir&&zt.mkdirSync(zse.dirname(n),{recursive:!0});let a=zt.openSync(n,i,e);o(null,a)}catch(a){throw o(a),a}else t.mkdir?zt.mkdir(zse.dirname(n),{recursive:!0},a=>{if(a)return o(a);zt.open(n,i,e,o)}):zt.open(n,i,e,o)}function Jn(n){if(!(this instanceof Jn))return new Jn(n);let{fd:t,dest:o,minLength:i,maxLength:e,maxWrite:a,periodicFlush:A,sync:r,append:s=!0,mkdir:g,retryEAGAIN:c,fsync:I,contentMode:d,mode:B}=n||{};t=t||o,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=e||0,this.maxWrite=a||yVe,this._periodicFlush=A||0,this._periodicFlushTimer=void 0,this.sync=r||!1,this.writable=!0,this._fsync=I||!1,this.append=s||!1,this.mode=B,this.retryEAGAIN=c||(()=>!0),this.mkdir=g||!1;let f,Q;if(d===Vse)this._writingBuf=qb,this.write=bVe,this.flush=_Ve,this.flushSync=NVe,this._actualWrite=kVe,f=()=>zt.writeSync(this.fd,this._writingBuf),Q=()=>zt.write(this.fd,this._writingBuf,this.release);else if(d===void 0||d===Wse)this._writingBuf="",this.write=OVe,this.flush=MVe,this.flushSync=TVe,this._actualWrite=RVe,f=()=>Buffer.isBuffer(this._writingBuf)?zt.writeSync(this.fd,this._writingBuf):zt.writeSync(this.fd,this._writingBuf,"utf8"),Q=()=>Buffer.isBuffer(this._writingBuf)?zt.write(this.fd,this._writingBuf,this.release):zt.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${Wse}" and "${Vse}", but passed ${d}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")Zse(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{lH(Jb),this.release(void 0,0)}catch(R){this.release(R)}else setTimeout(Q,Jb);else this._writing=!1,this.emit("error",y);return}this.emit("write",m);let T=IH(this._writingBuf,this._len,m);if(this._len=T.len,this._writingBuf=T.writingBuf,this._writingBuf.length){if(!this.sync){Q();return}try{do{let R=f(),K=IH(this._writingBuf,this._len,R);this._len=K.len,this._writingBuf=K.writingBuf}while(this._writingBuf.length)}catch(R){this.release(R);return}}this._fsync&&zt.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,zb(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(DVe,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function IH(n,t,o){return typeof n=="string"&&(n=Buffer.from(n)),t=Math.max(t-o,0),n=n.subarray(o),{writingBuf:n,len:t}}function DVe(n){n.listenerCount("drain")>0&&(n._asyncDrainScheduled=!1,n.emit("drain"))}fVe(Jn,BVe);function Xse(n,t){return n.length===0?qb:n.length===1?n[0]:Buffer.concat(n,t)}function OVe(n){if(this.destroyed)throw new Error("SonicBoom destroyed");n=""+n;let t=Buffer.byteLength(n),o=this._len+t,i=this._bufs;return this.maxLength&&o>this.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?i.push(n):i[i.length-1]+=n,this._len=o,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._lenthis.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?(o.push([n]),i.push(n.length)):(o[o.length-1].push(n),i[i.length-1]+=n.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len{if(this._fsync)this._flushPending=!1,n();else try{zt.fsync(this.fd,i=>{this._flushPending=!1,n(i)})}catch(i){n(i)}this.off("error",o)},o=i=>{this._flushPending=!1,n(i),this.off("drain",t)};this.once("drain",t),this.once("error",o)}function MVe(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&$se.call(this,n),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function _Ve(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&$se.call(this,n),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Jn.prototype.reopen=function(n){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(n)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(n&&(this.file=n),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&zt.close(t,o=>{if(o)return this.emit("error",o)})}),Zse(this.file,this)};Jn.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():zb(this)))};function TVe(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let n="";for(;this._bufs.length||n.length;){n.length<=0&&(n=this._bufs[0]);try{let t=Buffer.isBuffer(n)?zt.writeSync(this.fd,n):zt.writeSync(this.fd,n,"utf8"),o=IH(n,this._len,t);n=o.writingBuf,this._len=o.len,n.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;lH(Jb)}}try{zt.fsyncSync(this.fd)}catch{}}function NVe(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=qb);let n=qb;for(;this._bufs.length||n.length;){n.length<=0&&(n=Xse(this._bufs[0],this._lens[0]));try{let t=zt.writeSync(this.fd,n);n=n.subarray(t),this._len=Math.max(this._len-t,0),n.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;lH(Jb)}}}Jn.prototype.destroy=function(){this.destroyed||zb(this)};function RVe(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?zt.writeSync(this.fd,this._writingBuf):zt.writeSync(this.fd,this._writingBuf,"utf8");n(null,t)}catch(t){n(t)}else zt.write(this.fd,this._writingBuf,n)}function kVe(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Xse(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=zt.writeSync(this.fd,this._writingBuf);n(null,t)}catch(t){n(t)}else wVe&&(this._writingBuf=Buffer.from(this._writingBuf)),zt.write(this.fd,this._writingBuf,n)}function zb(n){if(n.fd===-1){n.once("ready",zb.bind(null,n));return}n._periodicFlushTimer!==void 0&&clearInterval(n._periodicFlushTimer),n.destroyed=!0,n._bufs=[],n._lens=[],QVe(typeof n.fd=="number",`sonic.fd must be a number, got ${typeof n.fd}`);try{zt.fsync(n.fd,t)}catch{}function t(){n.fd!==1&&n.fd!==2?zt.close(n.fd,o):o()}function o(i){if(i){n.emit("error",i);return}n._ending&&!n._writing&&n.emit("finish"),n.emit("close")}}Jn.SonicBoom=Jn;Jn.default=Jn;ege.exports=Jn});var pH=$((qkA,oge)=>{"use strict";var qn={exit:[],beforeExit:[]},tge={exit:GVe,beforeExit:FVe},fE;function vVe(){fE===void 0&&(fE=new FinalizationRegistry(LVe))}function PVe(n){qn[n].length>0||process.on(n,tge[n])}function rge(n){qn[n].length>0||(process.removeListener(n,tge[n]),qn.exit.length===0&&qn.beforeExit.length===0&&(fE=void 0))}function GVe(){age("exit")}function FVe(){age("beforeExit")}function age(n){for(let t of qn[n]){let o=t.deref(),i=t.fn;o!==void 0&&i(o,n)}qn[n]=[]}function LVe(n){for(let t of["exit","beforeExit"]){let o=qn[t].indexOf(n);qn[t].splice(o,o+1),rge(t)}}function ige(n,t,o){if(t===void 0)throw new Error("the object can't be undefined");PVe(n);let i=new WeakRef(t);i.fn=o,vVe(),fE.register(t,i),qn[n].push(i)}function UVe(n,t){ige("exit",n,t)}function HVe(n,t){ige("beforeExit",n,t)}function KVe(n){if(fE!==void 0){fE.unregister(n);for(let t of["exit","beforeExit"])qn[t]=qn[t].filter(o=>{let i=o.deref();return i&&i!==n}),rge(t)}}oge.exports={register:UVe,registerBeforeExit:HVe,unregister:KVe}});var nge=$((zkA,xVe)=>{xVe.exports={name:"thread-stream",version:"3.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var gge=$((VkA,sge)=>{"use strict";function YVe(n,t,o,i,e){let a=Date.now()+i,A=Atomics.load(n,t);if(A===o){e(null,"ok");return}let r=A,s=g=>{Date.now()>a?e(null,"timed-out"):setTimeout(()=>{r=A,A=Atomics.load(n,t),A===r?s(g>=1e3?1e3:g*2):A===o?e(null,"ok"):e(null,"not-equal")},g)};s(1)}function jVe(n,t,o,i,e){let a=Date.now()+i,A=Atomics.load(n,t);if(A!==o){e(null,"ok");return}let r=s=>{Date.now()>a?e(null,"timed-out"):setTimeout(()=>{A=Atomics.load(n,t),A!==o?e(null,"ok"):r(s>=1e3?1e3:s*2)},s)};r(1)}sge.exports={wait:YVe,waitDiff:jVe}});var Ige=$((WkA,cge)=>{"use strict";cge.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Ege=$((ZkA,hge)=>{"use strict";var{version:JVe}=nge(),{EventEmitter:qVe}=$e("events"),{Worker:zVe}=$e("worker_threads"),{join:VVe}=$e("path"),{pathToFileURL:WVe}=$e("url"),{wait:ZVe}=gge(),{WRITE_INDEX:sn,READ_INDEX:Zi,SEQ_INDEX:dH}=Ige(),XVe=$e("buffer"),$Ve=$e("assert"),_e=Symbol("kImpl"),eWe=XVe.constants.MAX_STRING_LENGTH;function QE(n,t){Atomics.add(n[_e].state,dH,1),t(),Atomics.add(n[_e].state,dH,1),Atomics.notify(n[_e].state,dH)}var xf=class{constructor(t){this._value=t}deref(){return this._value}},Wb=class{register(){}unregister(){}},AWe=process.env.NODE_V8_COVERAGE?Wb:global.FinalizationRegistry||Wb,tWe=process.env.NODE_V8_COVERAGE?xf:global.WeakRef||xf,lge=new AWe(n=>{n.exited||n.terminate()});function rWe(n,t){let{filename:o,workerData:i}=t,a=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||VVe(__dirname,"lib","worker.js"),A=new zVe(a,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:o.indexOf("file://")===0?o:WVe(o).href,dataBuf:n[_e].dataBuf,stateBuf:n[_e].stateBuf,workerData:{$context:{threadStreamVersion:JVe},...i}}});return A.stream=new xf(n),A.on("message",aWe),A.on("exit",dge),lge.register(n,A),A}function pge(n){$Ve(!n[_e].sync),n[_e].needDrain&&(n[_e].needDrain=!1,n.emit("drain"))}function Vb(n){let t=Atomics.load(n[_e].state,sn),o=n[_e].data.length-t;if(o>0){if(n[_e].buf.length===0){n[_e].flushing=!1,n[_e].ending?BH(n):n[_e].needDrain&&process.nextTick(pge,n);return}let i=n[_e].buf.slice(0,o),e=Buffer.byteLength(i);e<=o?(n[_e].buf=n[_e].buf.slice(o),Zb(n,i,Vb.bind(null,n))):n.flush(()=>{if(!n.destroyed){for(QE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi);e>n[_e].data.length;)o=o/2,i=n[_e].buf.slice(0,o),e=Buffer.byteLength(i);n[_e].buf=n[_e].buf.slice(o),Zb(n,i,Vb.bind(null,n))}})}else if(o===0){if(t===0&&n[_e].buf.length===0)return;n.flush(()=>{QE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi),Vb(n)})}else eg(n,new Error("overwritten"))}function aWe(n){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(n?.code!=null)switch(n.code){case"READY":this.stream=new tWe(t),t.flush(()=>{t[_e].ready=!0,t.emit("ready")});break;case"ERROR":eg(t,n.err);break;case"EVENT":Array.isArray(n.args)?t.emit(n.name,...n.args):t.emit(n.name,n.args);break;case"WARNING":process.emitWarning(n.err);break;default:eg(t,new Error("this should not happen: "+n.code))}}function dge(n){let t=this.stream.deref();t!==void 0&&(lge.unregister(t),t.worker.exited=!0,t.worker.off("exit",dge),eg(t,n!==0?new Error("the worker thread exited"):null))}var EH=class extends qVe{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[_e]={},this[_e].stateBuf=new SharedArrayBuffer(128),this[_e].state=new Int32Array(this[_e].stateBuf),this[_e].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[_e].data=Buffer.from(this[_e].dataBuf),this[_e].sync=t.sync||!1,this[_e].ending=!1,this[_e].ended=!1,this[_e].needDrain=!1,this[_e].destroyed=!1,this[_e].flushing=!1,this[_e].ready=!1,this[_e].finished=!1,this[_e].errored=null,this[_e].closed=!1,this[_e].buf="",this.worker=rWe(this,t),this.on("message",(o,i)=>{this.worker.postMessage(o,i)})}write(t){if(this[_e].destroyed)return CH(this,new Error("the worker has exited")),!1;if(this[_e].ending)return CH(this,new Error("the worker is ending")),!1;if(this[_e].flushing&&this[_e].buf.length+t.length>=eWe)try{hH(this),this[_e].flushing=!0}catch(o){return eg(this,o),!1}if(this[_e].buf+=t,this[_e].sync)try{return hH(this),!0}catch(o){return eg(this,o),!1}return this[_e].flushing||(this[_e].flushing=!0,setImmediate(Vb,this)),this[_e].needDrain=this[_e].data.length-this[_e].buf.length-Atomics.load(this[_e].state,sn)<=0,!this[_e].needDrain}end(){this[_e].destroyed||(this[_e].ending=!0,BH(this))}flush(t){if(this[_e].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let o=Atomics.load(this[_e].state,sn);ZVe(this[_e].state,Zi,o,1/0,(i,e)=>{if(i){eg(this,i),process.nextTick(t,i);return}if(e==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[_e].destroyed||(hH(this),uH(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[_e].ready}get destroyed(){return this[_e].destroyed}get closed(){return this[_e].closed}get writable(){return!this[_e].destroyed&&!this[_e].ending}get writableEnded(){return this[_e].ending}get writableFinished(){return this[_e].finished}get writableNeedDrain(){return this[_e].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[_e].errored}};function CH(n,t){setImmediate(()=>{n.emit("error",t)})}function eg(n,t){n[_e].destroyed||(n[_e].destroyed=!0,t&&(n[_e].errored=t,CH(n,t)),n.worker.exited?setImmediate(()=>{n[_e].closed=!0,n.emit("close")}):n.worker.terminate().catch(()=>{}).then(()=>{n[_e].closed=!0,n.emit("close")}))}function Zb(n,t,o){let i=Atomics.load(n[_e].state,sn),e=Buffer.byteLength(t);return n[_e].data.write(t,i),QE(n,()=>{Atomics.store(n[_e].state,sn,i+e)}),o(),!0}function BH(n){if(!(n[_e].ended||!n[_e].ending||n[_e].flushing)){n[_e].ended=!0;try{n.flushSync();let t=Atomics.load(n[_e].state,Zi);QE(n,()=>{Atomics.store(n[_e].state,sn,-1)});let o=0;for(;t!==-1;){if(Atomics.wait(n[_e].state,Zi,t,1e3),t=Atomics.load(n[_e].state,Zi),t===-2){eg(n,new Error("end() failed"));return}if(++o===10){eg(n,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{n[_e].finished=!0,n.emit("finish")})}catch(t){eg(n,t)}}}function hH(n){let t=()=>{n[_e].ending?BH(n):n[_e].needDrain&&process.nextTick(pge,n)};for(n[_e].flushing=!1;n[_e].buf.length!==0;){let o=Atomics.load(n[_e].state,sn),i=n[_e].data.length-o;if(i===0){uH(n),QE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi);continue}else if(i<0)throw new Error("overwritten");let e=n[_e].buf.slice(0,i),a=Buffer.byteLength(e);if(a<=i)n[_e].buf=n[_e].buf.slice(i),Zb(n,e,t);else{for(uH(n),QE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi);a>n[_e].buf.length;)i=i/2,e=n[_e].buf.slice(0,i),a=Buffer.byteLength(e);n[_e].buf=n[_e].buf.slice(i),Zb(n,e,t)}}}function uH(n){if(n[_e].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(n[_e].state,sn),o=0;for(;;){let i=Atomics.load(n[_e].state,Zi);if(i===-2)throw Error("_flushSync failed");if(i!==t)Atomics.wait(n[_e].state,Zi,i,1e3);else break;if(++o===10)throw new Error("_flushSync took too long (10s)")}}hge.exports=EH});var yH=$((XkA,Cge)=>{"use strict";var{createRequire:iWe}=$e("module"),oWe=iH(),{join:fH,isAbsolute:nWe,sep:sWe}=$e("node:path"),gWe=cH(),QH=pH(),cWe=Ege();function IWe(n){QH.register(n,pWe),QH.registerBeforeExit(n,dWe),n.on("close",function(){QH.unregister(n)})}function lWe(n,t,o,i){let e=new cWe({filename:n,workerData:t,workerOpts:o,sync:i});e.on("ready",a),e.on("close",function(){process.removeListener("exit",A)}),process.on("exit",A);function a(){process.removeListener("exit",A),e.unref(),o.autoEnd!==!1&&IWe(e)}function A(){e.closed||(e.flushSync(),gWe(100),e.end())}return e}function pWe(n){n.ref(),n.flushSync(),n.end(),n.once("close",function(){n.unref()})}function dWe(n){n.flushSync()}function hWe(n){let{pipeline:t,targets:o,levels:i,dedupe:e,worker:a={},caller:A=oWe(),sync:r=!1}=n,s={...n.options},g=typeof A=="string"?[A]:A,c="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},I=n.target;if(I&&o)throw new Error("only one of target or targets can be specified");return o?(I=c["pino-worker"]||fH(__dirname,"worker.js"),s.targets=o.filter(B=>B.target).map(B=>({...B,target:d(B.target)})),s.pipelines=o.filter(B=>B.pipeline).map(B=>B.pipeline.map(f=>({...f,level:B.level,target:d(f.target)})))):t&&(I=c["pino-worker"]||fH(__dirname,"worker.js"),s.pipelines=[t.map(B=>({...B,target:d(B.target)}))]),i&&(s.levels=i),e&&(s.dedupe=e),s.pinoWillSendConfig=!0,lWe(d(I),s,a,r);function d(B){if(B=c[B]||B,nWe(B)||B.indexOf("file://")===0)return B;if(B==="pino/file")return fH(__dirname,"..","file.js");let f;for(let Q of g)try{let y=Q==="node:repl"?process.cwd()+sWe:Q;f=iWe(y).resolve(B);break}catch{continue}if(!f)throw new Error(`unable to determine transport target for "${B}"`);return f}}Cge.exports=hWe});var AM=$(($kA,_ge)=>{"use strict";var uge=$e("node:diagnostics_channel"),Bge=qse(),{mapHttpRequest:EWe,mapHttpResponse:CWe}=aH(),SH=Age(),fge=pH(),{lsCacheSym:uWe,chindingsSym:Sge,writeSym:Qge,serializersSym:wge,formatOptsSym:yge,endSym:BWe,stringifiersSym:Dge,stringifySym:Oge,stringifySafeSym:wH,wildcardFirstSym:bge,nestedKeySym:fWe,formattersSym:Mge,messageKeySym:QWe,errorKeySym:yWe,nestedKeyStrSym:mWe,msgPrefixSym:Xb}=BE(),{isMainThread:SWe}=$e("worker_threads"),wWe=yH(),eM;typeof uge.tracingChannel=="function"?eM=uge.tracingChannel("pino_asJson"):eM={hasSubscribers:!1,traceSync(n,t,o,...i){return n.call(o,...i)}};function yE(){}function DWe(n,t){if(!t)return o;return function(...e){t.call(this,e,o,n)};function o(i,...e){if(typeof i=="object"){let a=i;i!==null&&(i.method&&i.headers&&i.socket?i=EWe(i):typeof i.setHeader=="function"&&(i=CWe(i)));let A;a===null&&e.length===0?A=[null]:(a=e.shift(),A=e),typeof this[Xb]=="string"&&a!==void 0&&a!==null&&(a=this[Xb]+a),this[Qge](i,Bge(a,A,this[yge]),n)}else{let a=i===void 0?e.shift():i;typeof this[Xb]=="string"&&a!==void 0&&a!==null&&(a=this[Xb]+a),this[Qge](null,Bge(a,e,this[yge]),n)}}}function mH(n){let t="",o=0,i=!1,e=255,a=n.length;if(a>100)return JSON.stringify(n);for(var A=0;A=32;A++)e=n.charCodeAt(A),(e===34||e===92)&&(t+=n.slice(o,A)+"\\",o=A,i=!0);return i?t+=n.slice(o):t=n,e<32?JSON.stringify(n):'"'+t+'"'}function OWe(n,t,o,i){if(eM.hasSubscribers===!1)return mge.call(this,n,t,o,i);let e={instance:this,arguments};return eM.traceSync(mge,e,this,n,t,o,i)}function mge(n,t,o,i){let e=this[Oge],a=this[wH],A=this[Dge],r=this[BWe],s=this[Sge],g=this[wge],c=this[Mge],I=this[QWe],d=this[yWe],B=this[uWe][o]+i;B=B+s;let f;c.log&&(n=c.log(n));let Q=A[bge],y="";for(let T in n)if(f=n[T],Object.prototype.hasOwnProperty.call(n,T)&&f!==void 0){g[T]?f=g[T](f):T===d&&g.err&&(f=g.err(f));let _=A[T]||Q;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":_&&(f=_(f));break;case"string":f=(_||mH)(f);break;default:f=(_||e)(f,a)}if(f===void 0)continue;let R=mH(T);y+=","+R+":"+f}let m="";if(t!==void 0){f=g[I]?g[I](t):t;let T=A[I]||Q;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":T&&(f=T(f)),m=',"'+I+'":'+f;break;case"string":f=(T||mH)(f),m=',"'+I+'":'+f;break;default:f=(T||e)(f,a),m=',"'+I+'":'+f}}return this[fWe]&&y?B+this[mWe]+y.slice(1)+"}"+m+r:B+y+m+r}function bWe(n,t){let o,i=n[Sge],e=n[Oge],a=n[wH],A=n[Dge],r=A[bge],s=n[wge],g=n[Mge].bindings;t=g(t);for(let c in t)if(o=t[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&t.hasOwnProperty(c)&&o!==void 0)===!0){if(o=s[c]?s[c](o):o,o=(A[c]||r||e)(o,a),o===void 0)continue;i+=',"'+c+'":'+o}return i}function MWe(n){return n.write!==n.constructor.prototype.write}function $b(n){let t=new SH(n);return t.on("error",o),!n.sync&&SWe&&(fge.register(t,_We),t.on("close",function(){fge.unregister(t)})),t;function o(i){if(i.code==="EPIPE"){t.write=yE,t.end=yE,t.flushSync=yE,t.destroy=yE;return}t.removeListener("error",o),t.emit("error",i)}}function _We(n,t){n.destroyed||(t==="beforeExit"?(n.flush(),n.on("drain",function(){n.end()})):n.flushSync())}function TWe(n){return function(o,i,e={},a){if(typeof e=="string")a=$b({dest:e}),e={};else if(typeof a=="string"){if(e&&e.transport)throw Error("only one of option.transport or stream can be specified");a=$b({dest:a})}else if(e instanceof SH||e.writable||e._writableState)a=e,e={};else if(e.transport){if(e.transport instanceof SH||e.transport.writable||e.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(e.transport.targets&&e.transport.targets.length&&e.formatters&&typeof e.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let s;e.customLevels&&(s=e.useOnlyCustomLevels?e.customLevels:Object.assign({},e.levels,e.customLevels)),a=wWe({caller:i,...e.transport,levels:s})}if(e=Object.assign({},n,e),e.serializers=Object.assign({},n.serializers,e.serializers),e.formatters=Object.assign({},n.formatters,e.formatters),e.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:A,onChild:r}=e;return A===!1&&(e.level="silent"),r||(e.onChild=yE),a||(MWe(process.stdout)?a=process.stdout:a=$b({fd:process.stdout.fd||1})),{opts:e,stream:a}}}function NWe(n,t){try{return JSON.stringify(n)}catch{try{return(t||this[wH])(n)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function RWe(n,t,o){return{level:n,bindings:t,log:o}}function kWe(n){let t=Number(n);return typeof n=="string"&&Number.isFinite(t)?t:n===void 0?1:n}_ge.exports={noop:yE,buildSafeSonicBoom:$b,asChindings:bWe,asJson:OWe,genLog:DWe,createArgsNormalizer:TWe,stringify:NWe,buildFormatters:RWe,normalizeDestFileDescriptor:kWe}});var tM=$((evA,Tge)=>{var vWe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},PWe={ASC:"ASC",DESC:"DESC"};Tge.exports={DEFAULT_LEVELS:vWe,SORTING_ORDER:PWe}});var bH=$((AvA,vge)=>{"use strict";var{lsCacheSym:GWe,levelValSym:DH,useOnlyCustomLevelsSym:FWe,streamSym:LWe,formattersSym:UWe,hooksSym:HWe,levelCompSym:Nge}=BE(),{noop:KWe,genLog:dp}=AM(),{DEFAULT_LEVELS:Ag,SORTING_ORDER:Rge}=tM(),kge={fatal:n=>{let t=dp(Ag.fatal,n);return function(...o){let i=this[LWe];if(t.call(this,...o),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:n=>dp(Ag.error,n),warn:n=>dp(Ag.warn,n),info:n=>dp(Ag.info,n),debug:n=>dp(Ag.debug,n),trace:n=>dp(Ag.trace,n)},OH=Object.keys(Ag).reduce((n,t)=>(n[Ag[t]]=t,n),{}),xWe=Object.keys(OH).reduce((n,t)=>(n[t]='{"level":'+Number(t),n),{});function YWe(n){let t=n[UWe].level,{labels:o}=n.levels,i={};for(let e in o){let a=t(o[e],Number(e));i[e]=JSON.stringify(a).slice(0,-1)}return n[GWe]=i,n}function jWe(n,t){if(t)return!1;switch(n){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function JWe(n){let{labels:t,values:o}=this.levels;if(typeof n=="number"){if(t[n]===void 0)throw Error("unknown level value"+n);n=t[n]}if(o[n]===void 0)throw Error("unknown level "+n);let i=this[DH],e=this[DH]=o[n],a=this[FWe],A=this[Nge],r=this[HWe].logMethod;for(let s in o){if(A(o[s],e)===!1){this[s]=KWe;continue}this[s]=jWe(s,a)?kge[s](r):dp(o[s],r)}this.emit("level-change",n,e,t[i],i,this)}function qWe(n){let{levels:t,levelVal:o}=this;return t&&t.labels?t.labels[o]:""}function zWe(n){let{values:t}=this.levels,o=t[n];return o!==void 0&&this[Nge](o,this[DH])}function VWe(n,t,o){return n===Rge.DESC?t<=o:t>=o}function WWe(n){return typeof n=="string"?VWe.bind(null,n):n}function ZWe(n=null,t=!1){let o=n?Object.keys(n).reduce((a,A)=>(a[n[A]]=A,a),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:OH,o),e=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:Ag,n);return{labels:i,values:e}}function XWe(n,t,o){if(typeof n=="number"){if(![].concat(Object.keys(t||{}).map(a=>t[a]),o?[]:Object.keys(OH).map(a=>+a),1/0).includes(n))throw Error(`default level:${n} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),o?null:Ag,t);if(!(n in i))throw Error(`default level:${n} must be included in custom levels`)}function $We(n,t){let{labels:o,values:i}=n;for(let e in t){if(e in i)throw Error("levels cannot be overridden");if(t[e]in o)throw Error("pre-existing level values cannot be used for new levels")}}function e6e(n){if(typeof n!="function"&&!(typeof n=="string"&&Object.values(Rge).includes(n)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}vge.exports={initialLsCache:xWe,genLsCache:YWe,levelMethods:kge,getLevel:qWe,setLevel:JWe,isLevelEnabled:zWe,mappings:ZWe,assertNoLevelCollisions:$We,assertDefaultLevelFound:XWe,genLevelComparison:WWe,assertLevelComparison:e6e}});var MH=$((tvA,Pge)=>{"use strict";Pge.exports={version:"9.14.0"}});var Yge=$((avA,xge)=>{"use strict";var{EventEmitter:A6e}=$e("node:events"),{lsCacheSym:t6e,levelValSym:r6e,setLevelSym:aM,getLevelSym:Gge,chindingsSym:iM,parsedChindingsSym:a6e,mixinSym:i6e,asJsonSym:Lge,writeSym:o6e,mixinMergeStrategySym:n6e,timeSym:s6e,timeSliceIndexSym:g6e,streamSym:Uge,serializersSym:hp,formattersSym:Yf,errorKeySym:c6e,messageKeySym:I6e,useOnlyCustomLevelsSym:l6e,needsMetadataGsym:p6e,redactFmtSym:d6e,stringifySym:h6e,formatOptsSym:E6e,stringifiersSym:C6e,msgPrefixSym:TH,hooksSym:u6e}=BE(),{getLevel:B6e,setLevel:f6e,isLevelEnabled:Q6e,mappings:y6e,initialLsCache:m6e,genLsCache:S6e,assertNoLevelCollisions:w6e}=bH(),{asChindings:NH,asJson:D6e,buildFormatters:_H,stringify:Fge,noop:Hge}=AM(),{version:O6e}=MH(),b6e=sH(),M6e=class{},Kge={constructor:M6e,child:_6e,bindings:T6e,setBindings:N6e,flush:v6e,isLevelEnabled:Q6e,version:O6e,get level(){return this[Gge]()},set level(n){this[aM](n)},get levelVal(){return this[r6e]},set levelVal(n){throw Error("levelVal is read-only")},get msgPrefix(){return this[TH]},get[Symbol.toStringTag](){return"Pino"},[t6e]:m6e,[o6e]:k6e,[Lge]:D6e,[Gge]:B6e,[aM]:f6e};Object.setPrototypeOf(Kge,A6e.prototype);xge.exports=function(){return Object.create(Kge)};var rM=n=>n;function _6e(n,t){if(!n)throw Error("missing bindings for child Pino");let o=this[hp],i=this[Yf],e=Object.create(this);if(t==null)return e[Yf].bindings!==rM&&(e[Yf]=_H(i.level,rM,i.log)),e[iM]=NH(e,n),e[aM](this.level),this.onChild!==Hge&&this.onChild(e),e;if(t.hasOwnProperty("serializers")===!0){e[hp]=Object.create(null);for(let c in o)e[hp][c]=o[c];let s=Object.getOwnPropertySymbols(o);for(var a=0;a{"use strict";var{hasOwnProperty:jf}=Object.prototype,Cp=vH();Cp.configure=vH;Cp.stringify=Cp;Cp.default=Cp;PH.stringify=Cp;PH.configure=vH;qge.exports=Cp;var P6e=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function wI(n){return n.length<5e3&&!P6e.test(n)?`"${n}"`:JSON.stringify(n)}function RH(n,t){if(n.length>200||t)return n.sort(t);for(let o=1;oi;)n[e]=n[e-1],e--;n[e]=i}return n}var G6e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function kH(n){return G6e.call(n)!==void 0&&n.length!==0}function jge(n,t,o){n.length= 1`)}return o===void 0?1/0:o}function Ep(n){return n===1?"1 item":`${n} items`}function H6e(n){let t=new Set;for(let o of n)(typeof o=="string"||typeof o=="number")&&t.add(String(o));return t}function K6e(n){if(jf.call(n,"strict")){let t=n.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return o=>{let i=`Object can not safely be stringified. Received type ${typeof o}`;throw typeof o!="function"&&(i+=` (${o.toString()})`),new Error(i)}}}function vH(n){n={...n};let t=K6e(n);t&&(n.bigint===void 0&&(n.bigint=!1),"circularValue"in n||(n.circularValue=Error));let o=F6e(n),i=U6e(n,"bigint"),e=L6e(n),a=typeof e=="function"?e:void 0,A=Jge(n,"maximumDepth"),r=Jge(n,"maximumBreadth");function s(B,f,Q,y,m,T){let _=f[B];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(B)),_=y.call(f,B,_),typeof _){case"string":return wI(_);case"object":{if(_===null)return"null";if(Q.indexOf(_)!==-1)return o;let R="",K=",",L=T;if(Array.isArray(_)){if(_.length===0)return"[]";if(Alse(n,new Set),pse=(n,t,o)=>{if(!Kf(n))return"";let i=o?"":n.message||"";if(t.has(n))return i+": ...";let e=VU(n);if(e){t.add(n);let a=typeof n.cause=="function";return i+(a?"":": ")+pse(e,t,a)}else return i},oze=n=>pse(n,new Set);dse.exports={isErrorLike:Kf,getErrorCause:VU,stackWithCauses:ize,messageWithCauses:oze}});var ZU=$((RkA,Ese)=>{"use strict";var nze=Symbol("circular-ref-tag"),Lb=Symbol("pino-raw-err-ref"),hse=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Lb]},set:function(n){this[Lb]=n}}});Object.defineProperty(hse,Lb,{writable:!0,value:{}});Ese.exports={pinoErrProto:hse,pinoErrorSymbols:{seen:nze,rawSymbol:Lb}}});var Bse=$((kkA,use)=>{"use strict";use.exports=$U;var{messageWithCauses:sze,stackWithCauses:gze,isErrorLike:Cse}=WU(),{pinoErrProto:cze,pinoErrorSymbols:Ize}=ZU(),{seen:XU}=Ize,{toString:lze}=Object.prototype;function $U(n){if(!Cse(n))return n;n[XU]=void 0;let t=Object.create(cze);t.type=lze.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=sze(n),t.stack=gze(n),Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>$U(o)));for(let o in n)if(t[o]===void 0){let i=n[o];Cse(i)?o!=="cause"&&!Object.prototype.hasOwnProperty.call(i,XU)&&(t[o]=$U(i)):t[o]=i}return delete n[XU],t.raw=n,t}});var Qse=$((vkA,fse)=>{"use strict";fse.exports=Hb;var{isErrorLike:eH}=WU(),{pinoErrProto:pze,pinoErrorSymbols:dze}=ZU(),{seen:Ub}=dze,{toString:hze}=Object.prototype;function Hb(n){if(!eH(n))return n;n[Ub]=void 0;let t=Object.create(pze);t.type=hze.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=n.message,t.stack=n.stack,Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>Hb(o))),eH(n.cause)&&!Object.prototype.hasOwnProperty.call(n.cause,Ub)&&(t.cause=Hb(n.cause));for(let o in n)if(t[o]===void 0){let i=n[o];eH(i)?Object.prototype.hasOwnProperty.call(i,Ub)||(t[o]=Hb(i)):t[o]=i}return delete n[Ub],t.raw=n,t}});var wse=$((PkA,Sse)=>{"use strict";Sse.exports={mapHttpRequest:Eze,reqSerializer:mse};var AH=Symbol("pino-raw-req-ref"),yse=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[AH]},set:function(n){this[AH]=n}}});Object.defineProperty(yse,AH,{writable:!0,value:{}});function mse(n){let t=n.info||n.socket,o=Object.create(yse);if(o.id=typeof n.id=="function"?n.id():n.id||(n.info?n.info.id:void 0),o.method=n.method,n.originalUrl)o.url=n.originalUrl;else{let i=n.path;o.url=typeof i=="string"?i:n.url?n.url.path||n.url:void 0}return n.query&&(o.query=n.query),n.params&&(o.params=n.params),o.headers=n.headers,o.remoteAddress=t&&t.remoteAddress,o.remotePort=t&&t.remotePort,o.raw=n.raw||n,o}function Eze(n){return{req:mse(n)}}});var Mse=$((GkA,bse)=>{"use strict";bse.exports={mapHttpResponse:Cze,resSerializer:Ose};var tH=Symbol("pino-raw-res-ref"),Dse=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[tH]},set:function(n){this[tH]=n}}});Object.defineProperty(Dse,tH,{writable:!0,value:{}});function Ose(n){let t=Object.create(Dse);return t.statusCode=n.headersSent?n.statusCode:null,t.headers=n.getHeaders?n.getHeaders():n._headers,t.raw=n,t}function Cze(n){return{res:Ose(n)}}});var aH=$((FkA,_se)=>{"use strict";var rH=Bse(),uze=Qse(),Kb=wse(),xb=Mse();_se.exports={err:rH,errWithCause:uze,mapHttpRequest:Kb.mapHttpRequest,mapHttpResponse:xb.mapHttpResponse,req:Kb.reqSerializer,res:xb.resSerializer,wrapErrorSerializer:function(t){return t===rH?t:function(i){return t(rH(i))}},wrapRequestSerializer:function(t){return t===Kb.reqSerializer?t:function(i){return t(Kb.reqSerializer(i))}},wrapResponseSerializer:function(t){return t===xb.resSerializer?t:function(i){return t(xb.resSerializer(i))}}}});var iH=$((LkA,Tse)=>{"use strict";function Bze(n,t){return t}Tse.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=Bze;let o=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(o))return;let i=o.slice(2),e=[];for(let a of i)a&&e.push(a.getFileName());return e}});var Gse=$((UkA,Pse)=>{"use strict";function oH(n){if(n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(n instanceof Array){let t=[];for(let o=0;o{let Q=[...s.slice(0,I),...f];return o(B,Q)}:o,e,a);else if(a)kse(c,r);else{let d=typeof o=="function"?o(Qze(c,r),[...s.slice(0,I),...r]):o;Rse(c,r,d)}}if(A.length===0)g(n,0);else{let c=n;for(let I=0;I0)o?a===i&&(o=!1,i=""):(o=!0,i=a);else if(a==="["&&!o)t++;else if(a==="]"&&!o&&(t--,t<0))throw new Error(`Invalid redaction path (${n})`)}if(t!==0)throw new Error(`Invalid redaction path (${n})`)}function Oze(n){if(!Array.isArray(n))throw new TypeError("paths must be an array");for(let t of n)Dze(t)}function bze(n={}){let{paths:t=[],censor:o="[REDACTED]",serialize:i=JSON.stringify,strict:e=!0,remove:a=!1}=n;Oze(t);let A=Sze(t);return function(s){if(e&&(s===null||typeof s!="object")&&(s==null||typeof s!="object"))return i?i(s):s;let g=wze(s,A),c=s,I=o;return typeof o=="function"&&(I=o),yze(g,t,I,a),i===!1?(g.restore=function(){return oH(c)},g):typeof i=="function"?i(g):JSON.stringify(g)}}Pse.exports=bze});var fE=$((HkA,Fse)=>{"use strict";var Mze=Symbol("pino.setLevel"),_ze=Symbol("pino.getLevel"),Tze=Symbol("pino.levelVal"),Nze=Symbol("pino.levelComp"),Rze=Symbol("pino.useLevelLabels"),kze=Symbol("pino.useOnlyCustomLevels"),vze=Symbol("pino.mixin"),Pze=Symbol("pino.lsCache"),Gze=Symbol("pino.chindings"),Fze=Symbol("pino.asJson"),Lze=Symbol("pino.write"),Uze=Symbol("pino.redactFmt"),Hze=Symbol("pino.time"),Kze=Symbol("pino.timeSliceIndex"),xze=Symbol("pino.stream"),Yze=Symbol("pino.stringify"),jze=Symbol("pino.stringifySafe"),Jze=Symbol("pino.stringifiers"),qze=Symbol("pino.end"),zze=Symbol("pino.formatOpts"),Vze=Symbol("pino.messageKey"),Wze=Symbol("pino.errorKey"),Zze=Symbol("pino.nestedKey"),Xze=Symbol("pino.nestedKeyStr"),$ze=Symbol("pino.mixinMergeStrategy"),eVe=Symbol("pino.msgPrefix"),AVe=Symbol("pino.wildcardFirst"),tVe=Symbol.for("pino.serializers"),rVe=Symbol.for("pino.formatters"),aVe=Symbol.for("pino.hooks"),iVe=Symbol.for("pino.metadata");Fse.exports={setLevelSym:Mze,getLevelSym:_ze,levelValSym:Tze,levelCompSym:Nze,useLevelLabelsSym:Rze,mixinSym:vze,lsCacheSym:Pze,chindingsSym:Gze,asJsonSym:Fze,writeSym:Lze,serializersSym:tVe,redactFmtSym:Uze,timeSym:Hze,timeSliceIndexSym:Kze,streamSym:xze,stringifySym:Yze,stringifySafeSym:jze,stringifiersSym:Jze,endSym:qze,formatOptsSym:zze,messageKeySym:Vze,errorKeySym:Wze,nestedKeySym:Zze,wildcardFirstSym:AVe,needsMetadataGsym:iVe,useOnlyCustomLevelsSym:kze,formattersSym:rVe,hooksSym:aVe,nestedKeyStrSym:Xze,mixinMergeStrategySym:$ze,msgPrefixSym:eVe}});var sH=$((KkA,Kse)=>{"use strict";var Lse=Gse(),{redactFmtSym:oVe,wildcardFirstSym:jb}=fE(),nH=/[^.[\]]+|\[([^[\]]*?)\]/g,Use="[Redacted]",Hse=!1;function nVe(n,t){let{paths:o,censor:i,remove:e}=sVe(n),a=o.reduce((s,g)=>{nH.lastIndex=0;let c=nH.exec(g),I=nH.exec(g),d=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(d==="*"&&(d=jb),I===null)return s[d]=null,s;if(s[d]===null)return s;let{index:B}=I,f=`${g.substr(B,g.length-1)}`;return s[d]=s[d]||[],d!==jb&&s[d].length===0&&s[d].push(...s[jb]||[]),d===jb&&Object.keys(s).forEach(function(Q){s[Q]&&s[Q].push(f)}),s[d].push(f),s},{}),A={[oVe]:Lse({paths:o,censor:i,serialize:t,strict:Hse,remove:e})},r=(...s)=>t(typeof i=="function"?i(...s):i);return[...Object.keys(a),...Object.getOwnPropertySymbols(a)].reduce((s,g)=>{if(a[g]===null)s[g]=c=>r(c,[g]);else{let c=typeof i=="function"?(I,d)=>i(I,[g,...d]):i;s[g]=Lse({paths:a[g],censor:c,serialize:t,strict:Hse,remove:e})}return s},A)}function sVe(n){if(Array.isArray(n))return n={paths:n,censor:Use},n;let{paths:t,censor:o=Use,remove:i}=n;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(o=void 0),{paths:t,censor:o,remove:i}}Kse.exports=nVe});var jse=$((xkA,Yse)=>{"use strict";var gVe=()=>"",cVe=()=>`,"time":${Date.now()}`,IVe=()=>`,"time":${Math.round(Date.now()/1e3)}`,lVe=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,pVe=1000000n,xse=1000000000n,dVe=BigInt(Date.now())*pVe,hVe=process.hrtime.bigint(),EVe=()=>{let n=process.hrtime.bigint()-hVe,t=dVe+n,o=t/xse,i=t%xse,e=Number(o*1000n+i/1000000n),a=new Date(e),A=a.getUTCFullYear(),r=(a.getUTCMonth()+1).toString().padStart(2,"0"),s=a.getUTCDate().toString().padStart(2,"0"),g=a.getUTCHours().toString().padStart(2,"0"),c=a.getUTCMinutes().toString().padStart(2,"0"),I=a.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${A}-${r}-${s}T${g}:${c}:${I}.${i.toString().padStart(9,"0")}Z"`};Yse.exports={nullTime:gVe,epochTime:cVe,unixTime:IVe,isoTime:lVe,isoTimeNano:EVe}});var qse=$((YkA,Jse)=>{"use strict";function CVe(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}Jse.exports=uVe;function uVe(n,t,o){var i=o&&o.stringify||CVe,e=1;if(typeof n=="object"&&n!==null){var a=t.length+e;if(a===1)return n;var A=new Array(a);A[0]=i(n);for(var r=1;r-1?I:0,n.charCodeAt(B+1)){case 100:case 102:if(c>=s||t[c]==null)break;I=s||t[c]==null)break;I=s||t[c]===void 0)break;I",I=B+2,B++;break}g+=i(t[c]),I=B+2,B++;break;case 115:if(c>=s)break;I{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(o){if((o>0&&o<1/0)===!1)throw typeof o!="number"&&typeof o!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(n,0,0,Number(o))},n=new Int32Array(new SharedArrayBuffer(4));gH.exports=t}else{let n=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(t);for(;i>Date.now(););};gH.exports=n}});var Age=$((JkA,ege)=>{"use strict";var zt=$e("fs"),BVe=$e("events"),fVe=$e("util").inherits,zse=$e("path"),lH=cH(),QVe=$e("assert"),Jb=100,qb=Buffer.allocUnsafe(0),yVe=16*1024,Vse="buffer",Wse="utf8",[mVe,SVe]=(process.versions.node||"0.0").split(".").map(Number),wVe=mVe>=22&&SVe>=7;function Zse(n,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function o(a,A){if(a){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",a)}):t.emit("error",a);return}let r=t._reopening;t.fd=A,t.file=n,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():r&&process.nextTick(()=>t.emit("drain")))}let i=t.append?"a":"w",e=t.mode;if(t.sync)try{t.mkdir&&zt.mkdirSync(zse.dirname(n),{recursive:!0});let a=zt.openSync(n,i,e);o(null,a)}catch(a){throw o(a),a}else t.mkdir?zt.mkdir(zse.dirname(n),{recursive:!0},a=>{if(a)return o(a);zt.open(n,i,e,o)}):zt.open(n,i,e,o)}function Jn(n){if(!(this instanceof Jn))return new Jn(n);let{fd:t,dest:o,minLength:i,maxLength:e,maxWrite:a,periodicFlush:A,sync:r,append:s=!0,mkdir:g,retryEAGAIN:c,fsync:I,contentMode:d,mode:B}=n||{};t=t||o,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=e||0,this.maxWrite=a||yVe,this._periodicFlush=A||0,this._periodicFlushTimer=void 0,this.sync=r||!1,this.writable=!0,this._fsync=I||!1,this.append=s||!1,this.mode=B,this.retryEAGAIN=c||(()=>!0),this.mkdir=g||!1;let f,Q;if(d===Vse)this._writingBuf=qb,this.write=bVe,this.flush=_Ve,this.flushSync=NVe,this._actualWrite=kVe,f=()=>zt.writeSync(this.fd,this._writingBuf),Q=()=>zt.write(this.fd,this._writingBuf,this.release);else if(d===void 0||d===Wse)this._writingBuf="",this.write=OVe,this.flush=MVe,this.flushSync=TVe,this._actualWrite=RVe,f=()=>Buffer.isBuffer(this._writingBuf)?zt.writeSync(this.fd,this._writingBuf):zt.writeSync(this.fd,this._writingBuf,"utf8"),Q=()=>Buffer.isBuffer(this._writingBuf)?zt.write(this.fd,this._writingBuf,this.release):zt.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${Wse}" and "${Vse}", but passed ${d}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")Zse(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{lH(Jb),this.release(void 0,0)}catch(R){this.release(R)}else setTimeout(Q,Jb);else this._writing=!1,this.emit("error",y);return}this.emit("write",m);let T=IH(this._writingBuf,this._len,m);if(this._len=T.len,this._writingBuf=T.writingBuf,this._writingBuf.length){if(!this.sync){Q();return}try{do{let R=f(),K=IH(this._writingBuf,this._len,R);this._len=K.len,this._writingBuf=K.writingBuf}while(this._writingBuf.length)}catch(R){this.release(R);return}}this._fsync&&zt.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,zb(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(DVe,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function IH(n,t,o){return typeof n=="string"&&(n=Buffer.from(n)),t=Math.max(t-o,0),n=n.subarray(o),{writingBuf:n,len:t}}function DVe(n){n.listenerCount("drain")>0&&(n._asyncDrainScheduled=!1,n.emit("drain"))}fVe(Jn,BVe);function Xse(n,t){return n.length===0?qb:n.length===1?n[0]:Buffer.concat(n,t)}function OVe(n){if(this.destroyed)throw new Error("SonicBoom destroyed");n=""+n;let t=Buffer.byteLength(n),o=this._len+t,i=this._bufs;return this.maxLength&&o>this.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?i.push(n):i[i.length-1]+=n,this._len=o,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._lenthis.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?(o.push([n]),i.push(n.length)):(o[o.length-1].push(n),i[i.length-1]+=n.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len{if(this._fsync)this._flushPending=!1,n();else try{zt.fsync(this.fd,i=>{this._flushPending=!1,n(i)})}catch(i){n(i)}this.off("error",o)},o=i=>{this._flushPending=!1,n(i),this.off("drain",t)};this.once("drain",t),this.once("error",o)}function MVe(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&$se.call(this,n),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function _Ve(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&$se.call(this,n),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Jn.prototype.reopen=function(n){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(n)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(n&&(this.file=n),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&zt.close(t,o=>{if(o)return this.emit("error",o)})}),Zse(this.file,this)};Jn.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():zb(this)))};function TVe(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let n="";for(;this._bufs.length||n.length;){n.length<=0&&(n=this._bufs[0]);try{let t=Buffer.isBuffer(n)?zt.writeSync(this.fd,n):zt.writeSync(this.fd,n,"utf8"),o=IH(n,this._len,t);n=o.writingBuf,this._len=o.len,n.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;lH(Jb)}}try{zt.fsyncSync(this.fd)}catch{}}function NVe(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=qb);let n=qb;for(;this._bufs.length||n.length;){n.length<=0&&(n=Xse(this._bufs[0],this._lens[0]));try{let t=zt.writeSync(this.fd,n);n=n.subarray(t),this._len=Math.max(this._len-t,0),n.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;lH(Jb)}}}Jn.prototype.destroy=function(){this.destroyed||zb(this)};function RVe(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?zt.writeSync(this.fd,this._writingBuf):zt.writeSync(this.fd,this._writingBuf,"utf8");n(null,t)}catch(t){n(t)}else zt.write(this.fd,this._writingBuf,n)}function kVe(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Xse(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=zt.writeSync(this.fd,this._writingBuf);n(null,t)}catch(t){n(t)}else wVe&&(this._writingBuf=Buffer.from(this._writingBuf)),zt.write(this.fd,this._writingBuf,n)}function zb(n){if(n.fd===-1){n.once("ready",zb.bind(null,n));return}n._periodicFlushTimer!==void 0&&clearInterval(n._periodicFlushTimer),n.destroyed=!0,n._bufs=[],n._lens=[],QVe(typeof n.fd=="number",`sonic.fd must be a number, got ${typeof n.fd}`);try{zt.fsync(n.fd,t)}catch{}function t(){n.fd!==1&&n.fd!==2?zt.close(n.fd,o):o()}function o(i){if(i){n.emit("error",i);return}n._ending&&!n._writing&&n.emit("finish"),n.emit("close")}}Jn.SonicBoom=Jn;Jn.default=Jn;ege.exports=Jn});var pH=$((qkA,oge)=>{"use strict";var qn={exit:[],beforeExit:[]},tge={exit:GVe,beforeExit:FVe},QE;function vVe(){QE===void 0&&(QE=new FinalizationRegistry(LVe))}function PVe(n){qn[n].length>0||process.on(n,tge[n])}function rge(n){qn[n].length>0||(process.removeListener(n,tge[n]),qn.exit.length===0&&qn.beforeExit.length===0&&(QE=void 0))}function GVe(){age("exit")}function FVe(){age("beforeExit")}function age(n){for(let t of qn[n]){let o=t.deref(),i=t.fn;o!==void 0&&i(o,n)}qn[n]=[]}function LVe(n){for(let t of["exit","beforeExit"]){let o=qn[t].indexOf(n);qn[t].splice(o,o+1),rge(t)}}function ige(n,t,o){if(t===void 0)throw new Error("the object can't be undefined");PVe(n);let i=new WeakRef(t);i.fn=o,vVe(),QE.register(t,i),qn[n].push(i)}function UVe(n,t){ige("exit",n,t)}function HVe(n,t){ige("beforeExit",n,t)}function KVe(n){if(QE!==void 0){QE.unregister(n);for(let t of["exit","beforeExit"])qn[t]=qn[t].filter(o=>{let i=o.deref();return i&&i!==n}),rge(t)}}oge.exports={register:UVe,registerBeforeExit:HVe,unregister:KVe}});var nge=$((zkA,xVe)=>{xVe.exports={name:"thread-stream",version:"3.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var gge=$((VkA,sge)=>{"use strict";function YVe(n,t,o,i,e){let a=Date.now()+i,A=Atomics.load(n,t);if(A===o){e(null,"ok");return}let r=A,s=g=>{Date.now()>a?e(null,"timed-out"):setTimeout(()=>{r=A,A=Atomics.load(n,t),A===r?s(g>=1e3?1e3:g*2):A===o?e(null,"ok"):e(null,"not-equal")},g)};s(1)}function jVe(n,t,o,i,e){let a=Date.now()+i,A=Atomics.load(n,t);if(A!==o){e(null,"ok");return}let r=s=>{Date.now()>a?e(null,"timed-out"):setTimeout(()=>{A=Atomics.load(n,t),A!==o?e(null,"ok"):r(s>=1e3?1e3:s*2)},s)};r(1)}sge.exports={wait:YVe,waitDiff:jVe}});var Ige=$((WkA,cge)=>{"use strict";cge.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Ege=$((ZkA,hge)=>{"use strict";var{version:JVe}=nge(),{EventEmitter:qVe}=$e("events"),{Worker:zVe}=$e("worker_threads"),{join:VVe}=$e("path"),{pathToFileURL:WVe}=$e("url"),{wait:ZVe}=gge(),{WRITE_INDEX:sn,READ_INDEX:Zi,SEQ_INDEX:dH}=Ige(),XVe=$e("buffer"),$Ve=$e("assert"),_e=Symbol("kImpl"),eWe=XVe.constants.MAX_STRING_LENGTH;function yE(n,t){Atomics.add(n[_e].state,dH,1),t(),Atomics.add(n[_e].state,dH,1),Atomics.notify(n[_e].state,dH)}var xf=class{constructor(t){this._value=t}deref(){return this._value}},Wb=class{register(){}unregister(){}},AWe=process.env.NODE_V8_COVERAGE?Wb:global.FinalizationRegistry||Wb,tWe=process.env.NODE_V8_COVERAGE?xf:global.WeakRef||xf,lge=new AWe(n=>{n.exited||n.terminate()});function rWe(n,t){let{filename:o,workerData:i}=t,a=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||VVe(__dirname,"lib","worker.js"),A=new zVe(a,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:o.indexOf("file://")===0?o:WVe(o).href,dataBuf:n[_e].dataBuf,stateBuf:n[_e].stateBuf,workerData:{$context:{threadStreamVersion:JVe},...i}}});return A.stream=new xf(n),A.on("message",aWe),A.on("exit",dge),lge.register(n,A),A}function pge(n){$Ve(!n[_e].sync),n[_e].needDrain&&(n[_e].needDrain=!1,n.emit("drain"))}function Vb(n){let t=Atomics.load(n[_e].state,sn),o=n[_e].data.length-t;if(o>0){if(n[_e].buf.length===0){n[_e].flushing=!1,n[_e].ending?BH(n):n[_e].needDrain&&process.nextTick(pge,n);return}let i=n[_e].buf.slice(0,o),e=Buffer.byteLength(i);e<=o?(n[_e].buf=n[_e].buf.slice(o),Zb(n,i,Vb.bind(null,n))):n.flush(()=>{if(!n.destroyed){for(yE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi);e>n[_e].data.length;)o=o/2,i=n[_e].buf.slice(0,o),e=Buffer.byteLength(i);n[_e].buf=n[_e].buf.slice(o),Zb(n,i,Vb.bind(null,n))}})}else if(o===0){if(t===0&&n[_e].buf.length===0)return;n.flush(()=>{yE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi),Vb(n)})}else eg(n,new Error("overwritten"))}function aWe(n){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(n?.code!=null)switch(n.code){case"READY":this.stream=new tWe(t),t.flush(()=>{t[_e].ready=!0,t.emit("ready")});break;case"ERROR":eg(t,n.err);break;case"EVENT":Array.isArray(n.args)?t.emit(n.name,...n.args):t.emit(n.name,n.args);break;case"WARNING":process.emitWarning(n.err);break;default:eg(t,new Error("this should not happen: "+n.code))}}function dge(n){let t=this.stream.deref();t!==void 0&&(lge.unregister(t),t.worker.exited=!0,t.worker.off("exit",dge),eg(t,n!==0?new Error("the worker thread exited"):null))}var EH=class extends qVe{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[_e]={},this[_e].stateBuf=new SharedArrayBuffer(128),this[_e].state=new Int32Array(this[_e].stateBuf),this[_e].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[_e].data=Buffer.from(this[_e].dataBuf),this[_e].sync=t.sync||!1,this[_e].ending=!1,this[_e].ended=!1,this[_e].needDrain=!1,this[_e].destroyed=!1,this[_e].flushing=!1,this[_e].ready=!1,this[_e].finished=!1,this[_e].errored=null,this[_e].closed=!1,this[_e].buf="",this.worker=rWe(this,t),this.on("message",(o,i)=>{this.worker.postMessage(o,i)})}write(t){if(this[_e].destroyed)return CH(this,new Error("the worker has exited")),!1;if(this[_e].ending)return CH(this,new Error("the worker is ending")),!1;if(this[_e].flushing&&this[_e].buf.length+t.length>=eWe)try{hH(this),this[_e].flushing=!0}catch(o){return eg(this,o),!1}if(this[_e].buf+=t,this[_e].sync)try{return hH(this),!0}catch(o){return eg(this,o),!1}return this[_e].flushing||(this[_e].flushing=!0,setImmediate(Vb,this)),this[_e].needDrain=this[_e].data.length-this[_e].buf.length-Atomics.load(this[_e].state,sn)<=0,!this[_e].needDrain}end(){this[_e].destroyed||(this[_e].ending=!0,BH(this))}flush(t){if(this[_e].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let o=Atomics.load(this[_e].state,sn);ZVe(this[_e].state,Zi,o,1/0,(i,e)=>{if(i){eg(this,i),process.nextTick(t,i);return}if(e==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[_e].destroyed||(hH(this),uH(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[_e].ready}get destroyed(){return this[_e].destroyed}get closed(){return this[_e].closed}get writable(){return!this[_e].destroyed&&!this[_e].ending}get writableEnded(){return this[_e].ending}get writableFinished(){return this[_e].finished}get writableNeedDrain(){return this[_e].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[_e].errored}};function CH(n,t){setImmediate(()=>{n.emit("error",t)})}function eg(n,t){n[_e].destroyed||(n[_e].destroyed=!0,t&&(n[_e].errored=t,CH(n,t)),n.worker.exited?setImmediate(()=>{n[_e].closed=!0,n.emit("close")}):n.worker.terminate().catch(()=>{}).then(()=>{n[_e].closed=!0,n.emit("close")}))}function Zb(n,t,o){let i=Atomics.load(n[_e].state,sn),e=Buffer.byteLength(t);return n[_e].data.write(t,i),yE(n,()=>{Atomics.store(n[_e].state,sn,i+e)}),o(),!0}function BH(n){if(!(n[_e].ended||!n[_e].ending||n[_e].flushing)){n[_e].ended=!0;try{n.flushSync();let t=Atomics.load(n[_e].state,Zi);yE(n,()=>{Atomics.store(n[_e].state,sn,-1)});let o=0;for(;t!==-1;){if(Atomics.wait(n[_e].state,Zi,t,1e3),t=Atomics.load(n[_e].state,Zi),t===-2){eg(n,new Error("end() failed"));return}if(++o===10){eg(n,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{n[_e].finished=!0,n.emit("finish")})}catch(t){eg(n,t)}}}function hH(n){let t=()=>{n[_e].ending?BH(n):n[_e].needDrain&&process.nextTick(pge,n)};for(n[_e].flushing=!1;n[_e].buf.length!==0;){let o=Atomics.load(n[_e].state,sn),i=n[_e].data.length-o;if(i===0){uH(n),yE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi);continue}else if(i<0)throw new Error("overwritten");let e=n[_e].buf.slice(0,i),a=Buffer.byteLength(e);if(a<=i)n[_e].buf=n[_e].buf.slice(i),Zb(n,e,t);else{for(uH(n),yE(n,()=>{Atomics.store(n[_e].state,Zi,0),Atomics.store(n[_e].state,sn,0)}),Atomics.notify(n[_e].state,Zi);a>n[_e].buf.length;)i=i/2,e=n[_e].buf.slice(0,i),a=Buffer.byteLength(e);n[_e].buf=n[_e].buf.slice(i),Zb(n,e,t)}}}function uH(n){if(n[_e].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(n[_e].state,sn),o=0;for(;;){let i=Atomics.load(n[_e].state,Zi);if(i===-2)throw Error("_flushSync failed");if(i!==t)Atomics.wait(n[_e].state,Zi,i,1e3);else break;if(++o===10)throw new Error("_flushSync took too long (10s)")}}hge.exports=EH});var yH=$((XkA,Cge)=>{"use strict";var{createRequire:iWe}=$e("module"),oWe=iH(),{join:fH,isAbsolute:nWe,sep:sWe}=$e("node:path"),gWe=cH(),QH=pH(),cWe=Ege();function IWe(n){QH.register(n,pWe),QH.registerBeforeExit(n,dWe),n.on("close",function(){QH.unregister(n)})}function lWe(n,t,o,i){let e=new cWe({filename:n,workerData:t,workerOpts:o,sync:i});e.on("ready",a),e.on("close",function(){process.removeListener("exit",A)}),process.on("exit",A);function a(){process.removeListener("exit",A),e.unref(),o.autoEnd!==!1&&IWe(e)}function A(){e.closed||(e.flushSync(),gWe(100),e.end())}return e}function pWe(n){n.ref(),n.flushSync(),n.end(),n.once("close",function(){n.unref()})}function dWe(n){n.flushSync()}function hWe(n){let{pipeline:t,targets:o,levels:i,dedupe:e,worker:a={},caller:A=oWe(),sync:r=!1}=n,s={...n.options},g=typeof A=="string"?[A]:A,c="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},I=n.target;if(I&&o)throw new Error("only one of target or targets can be specified");return o?(I=c["pino-worker"]||fH(__dirname,"worker.js"),s.targets=o.filter(B=>B.target).map(B=>({...B,target:d(B.target)})),s.pipelines=o.filter(B=>B.pipeline).map(B=>B.pipeline.map(f=>({...f,level:B.level,target:d(f.target)})))):t&&(I=c["pino-worker"]||fH(__dirname,"worker.js"),s.pipelines=[t.map(B=>({...B,target:d(B.target)}))]),i&&(s.levels=i),e&&(s.dedupe=e),s.pinoWillSendConfig=!0,lWe(d(I),s,a,r);function d(B){if(B=c[B]||B,nWe(B)||B.indexOf("file://")===0)return B;if(B==="pino/file")return fH(__dirname,"..","file.js");let f;for(let Q of g)try{let y=Q==="node:repl"?process.cwd()+sWe:Q;f=iWe(y).resolve(B);break}catch{continue}if(!f)throw new Error(`unable to determine transport target for "${B}"`);return f}}Cge.exports=hWe});var AM=$(($kA,_ge)=>{"use strict";var uge=$e("node:diagnostics_channel"),Bge=qse(),{mapHttpRequest:EWe,mapHttpResponse:CWe}=aH(),SH=Age(),fge=pH(),{lsCacheSym:uWe,chindingsSym:Sge,writeSym:Qge,serializersSym:wge,formatOptsSym:yge,endSym:BWe,stringifiersSym:Dge,stringifySym:Oge,stringifySafeSym:wH,wildcardFirstSym:bge,nestedKeySym:fWe,formattersSym:Mge,messageKeySym:QWe,errorKeySym:yWe,nestedKeyStrSym:mWe,msgPrefixSym:Xb}=fE(),{isMainThread:SWe}=$e("worker_threads"),wWe=yH(),eM;typeof uge.tracingChannel=="function"?eM=uge.tracingChannel("pino_asJson"):eM={hasSubscribers:!1,traceSync(n,t,o,...i){return n.call(o,...i)}};function mE(){}function DWe(n,t){if(!t)return o;return function(...e){t.call(this,e,o,n)};function o(i,...e){if(typeof i=="object"){let a=i;i!==null&&(i.method&&i.headers&&i.socket?i=EWe(i):typeof i.setHeader=="function"&&(i=CWe(i)));let A;a===null&&e.length===0?A=[null]:(a=e.shift(),A=e),typeof this[Xb]=="string"&&a!==void 0&&a!==null&&(a=this[Xb]+a),this[Qge](i,Bge(a,A,this[yge]),n)}else{let a=i===void 0?e.shift():i;typeof this[Xb]=="string"&&a!==void 0&&a!==null&&(a=this[Xb]+a),this[Qge](null,Bge(a,e,this[yge]),n)}}}function mH(n){let t="",o=0,i=!1,e=255,a=n.length;if(a>100)return JSON.stringify(n);for(var A=0;A=32;A++)e=n.charCodeAt(A),(e===34||e===92)&&(t+=n.slice(o,A)+"\\",o=A,i=!0);return i?t+=n.slice(o):t=n,e<32?JSON.stringify(n):'"'+t+'"'}function OWe(n,t,o,i){if(eM.hasSubscribers===!1)return mge.call(this,n,t,o,i);let e={instance:this,arguments};return eM.traceSync(mge,e,this,n,t,o,i)}function mge(n,t,o,i){let e=this[Oge],a=this[wH],A=this[Dge],r=this[BWe],s=this[Sge],g=this[wge],c=this[Mge],I=this[QWe],d=this[yWe],B=this[uWe][o]+i;B=B+s;let f;c.log&&(n=c.log(n));let Q=A[bge],y="";for(let T in n)if(f=n[T],Object.prototype.hasOwnProperty.call(n,T)&&f!==void 0){g[T]?f=g[T](f):T===d&&g.err&&(f=g.err(f));let _=A[T]||Q;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":_&&(f=_(f));break;case"string":f=(_||mH)(f);break;default:f=(_||e)(f,a)}if(f===void 0)continue;let R=mH(T);y+=","+R+":"+f}let m="";if(t!==void 0){f=g[I]?g[I](t):t;let T=A[I]||Q;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":T&&(f=T(f)),m=',"'+I+'":'+f;break;case"string":f=(T||mH)(f),m=',"'+I+'":'+f;break;default:f=(T||e)(f,a),m=',"'+I+'":'+f}}return this[fWe]&&y?B+this[mWe]+y.slice(1)+"}"+m+r:B+y+m+r}function bWe(n,t){let o,i=n[Sge],e=n[Oge],a=n[wH],A=n[Dge],r=A[bge],s=n[wge],g=n[Mge].bindings;t=g(t);for(let c in t)if(o=t[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&t.hasOwnProperty(c)&&o!==void 0)===!0){if(o=s[c]?s[c](o):o,o=(A[c]||r||e)(o,a),o===void 0)continue;i+=',"'+c+'":'+o}return i}function MWe(n){return n.write!==n.constructor.prototype.write}function $b(n){let t=new SH(n);return t.on("error",o),!n.sync&&SWe&&(fge.register(t,_We),t.on("close",function(){fge.unregister(t)})),t;function o(i){if(i.code==="EPIPE"){t.write=mE,t.end=mE,t.flushSync=mE,t.destroy=mE;return}t.removeListener("error",o),t.emit("error",i)}}function _We(n,t){n.destroyed||(t==="beforeExit"?(n.flush(),n.on("drain",function(){n.end()})):n.flushSync())}function TWe(n){return function(o,i,e={},a){if(typeof e=="string")a=$b({dest:e}),e={};else if(typeof a=="string"){if(e&&e.transport)throw Error("only one of option.transport or stream can be specified");a=$b({dest:a})}else if(e instanceof SH||e.writable||e._writableState)a=e,e={};else if(e.transport){if(e.transport instanceof SH||e.transport.writable||e.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(e.transport.targets&&e.transport.targets.length&&e.formatters&&typeof e.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let s;e.customLevels&&(s=e.useOnlyCustomLevels?e.customLevels:Object.assign({},e.levels,e.customLevels)),a=wWe({caller:i,...e.transport,levels:s})}if(e=Object.assign({},n,e),e.serializers=Object.assign({},n.serializers,e.serializers),e.formatters=Object.assign({},n.formatters,e.formatters),e.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:A,onChild:r}=e;return A===!1&&(e.level="silent"),r||(e.onChild=mE),a||(MWe(process.stdout)?a=process.stdout:a=$b({fd:process.stdout.fd||1})),{opts:e,stream:a}}}function NWe(n,t){try{return JSON.stringify(n)}catch{try{return(t||this[wH])(n)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function RWe(n,t,o){return{level:n,bindings:t,log:o}}function kWe(n){let t=Number(n);return typeof n=="string"&&Number.isFinite(t)?t:n===void 0?1:n}_ge.exports={noop:mE,buildSafeSonicBoom:$b,asChindings:bWe,asJson:OWe,genLog:DWe,createArgsNormalizer:TWe,stringify:NWe,buildFormatters:RWe,normalizeDestFileDescriptor:kWe}});var tM=$((evA,Tge)=>{var vWe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},PWe={ASC:"ASC",DESC:"DESC"};Tge.exports={DEFAULT_LEVELS:vWe,SORTING_ORDER:PWe}});var bH=$((AvA,vge)=>{"use strict";var{lsCacheSym:GWe,levelValSym:DH,useOnlyCustomLevelsSym:FWe,streamSym:LWe,formattersSym:UWe,hooksSym:HWe,levelCompSym:Nge}=fE(),{noop:KWe,genLog:dp}=AM(),{DEFAULT_LEVELS:Ag,SORTING_ORDER:Rge}=tM(),kge={fatal:n=>{let t=dp(Ag.fatal,n);return function(...o){let i=this[LWe];if(t.call(this,...o),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:n=>dp(Ag.error,n),warn:n=>dp(Ag.warn,n),info:n=>dp(Ag.info,n),debug:n=>dp(Ag.debug,n),trace:n=>dp(Ag.trace,n)},OH=Object.keys(Ag).reduce((n,t)=>(n[Ag[t]]=t,n),{}),xWe=Object.keys(OH).reduce((n,t)=>(n[t]='{"level":'+Number(t),n),{});function YWe(n){let t=n[UWe].level,{labels:o}=n.levels,i={};for(let e in o){let a=t(o[e],Number(e));i[e]=JSON.stringify(a).slice(0,-1)}return n[GWe]=i,n}function jWe(n,t){if(t)return!1;switch(n){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function JWe(n){let{labels:t,values:o}=this.levels;if(typeof n=="number"){if(t[n]===void 0)throw Error("unknown level value"+n);n=t[n]}if(o[n]===void 0)throw Error("unknown level "+n);let i=this[DH],e=this[DH]=o[n],a=this[FWe],A=this[Nge],r=this[HWe].logMethod;for(let s in o){if(A(o[s],e)===!1){this[s]=KWe;continue}this[s]=jWe(s,a)?kge[s](r):dp(o[s],r)}this.emit("level-change",n,e,t[i],i,this)}function qWe(n){let{levels:t,levelVal:o}=this;return t&&t.labels?t.labels[o]:""}function zWe(n){let{values:t}=this.levels,o=t[n];return o!==void 0&&this[Nge](o,this[DH])}function VWe(n,t,o){return n===Rge.DESC?t<=o:t>=o}function WWe(n){return typeof n=="string"?VWe.bind(null,n):n}function ZWe(n=null,t=!1){let o=n?Object.keys(n).reduce((a,A)=>(a[n[A]]=A,a),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:OH,o),e=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:Ag,n);return{labels:i,values:e}}function XWe(n,t,o){if(typeof n=="number"){if(![].concat(Object.keys(t||{}).map(a=>t[a]),o?[]:Object.keys(OH).map(a=>+a),1/0).includes(n))throw Error(`default level:${n} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),o?null:Ag,t);if(!(n in i))throw Error(`default level:${n} must be included in custom levels`)}function $We(n,t){let{labels:o,values:i}=n;for(let e in t){if(e in i)throw Error("levels cannot be overridden");if(t[e]in o)throw Error("pre-existing level values cannot be used for new levels")}}function e6e(n){if(typeof n!="function"&&!(typeof n=="string"&&Object.values(Rge).includes(n)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}vge.exports={initialLsCache:xWe,genLsCache:YWe,levelMethods:kge,getLevel:qWe,setLevel:JWe,isLevelEnabled:zWe,mappings:ZWe,assertNoLevelCollisions:$We,assertDefaultLevelFound:XWe,genLevelComparison:WWe,assertLevelComparison:e6e}});var MH=$((tvA,Pge)=>{"use strict";Pge.exports={version:"9.14.0"}});var Yge=$((avA,xge)=>{"use strict";var{EventEmitter:A6e}=$e("node:events"),{lsCacheSym:t6e,levelValSym:r6e,setLevelSym:aM,getLevelSym:Gge,chindingsSym:iM,parsedChindingsSym:a6e,mixinSym:i6e,asJsonSym:Lge,writeSym:o6e,mixinMergeStrategySym:n6e,timeSym:s6e,timeSliceIndexSym:g6e,streamSym:Uge,serializersSym:hp,formattersSym:Yf,errorKeySym:c6e,messageKeySym:I6e,useOnlyCustomLevelsSym:l6e,needsMetadataGsym:p6e,redactFmtSym:d6e,stringifySym:h6e,formatOptsSym:E6e,stringifiersSym:C6e,msgPrefixSym:TH,hooksSym:u6e}=fE(),{getLevel:B6e,setLevel:f6e,isLevelEnabled:Q6e,mappings:y6e,initialLsCache:m6e,genLsCache:S6e,assertNoLevelCollisions:w6e}=bH(),{asChindings:NH,asJson:D6e,buildFormatters:_H,stringify:Fge,noop:Hge}=AM(),{version:O6e}=MH(),b6e=sH(),M6e=class{},Kge={constructor:M6e,child:_6e,bindings:T6e,setBindings:N6e,flush:v6e,isLevelEnabled:Q6e,version:O6e,get level(){return this[Gge]()},set level(n){this[aM](n)},get levelVal(){return this[r6e]},set levelVal(n){throw Error("levelVal is read-only")},get msgPrefix(){return this[TH]},get[Symbol.toStringTag](){return"Pino"},[t6e]:m6e,[o6e]:k6e,[Lge]:D6e,[Gge]:B6e,[aM]:f6e};Object.setPrototypeOf(Kge,A6e.prototype);xge.exports=function(){return Object.create(Kge)};var rM=n=>n;function _6e(n,t){if(!n)throw Error("missing bindings for child Pino");let o=this[hp],i=this[Yf],e=Object.create(this);if(t==null)return e[Yf].bindings!==rM&&(e[Yf]=_H(i.level,rM,i.log)),e[iM]=NH(e,n),e[aM](this.level),this.onChild!==Hge&&this.onChild(e),e;if(t.hasOwnProperty("serializers")===!0){e[hp]=Object.create(null);for(let c in o)e[hp][c]=o[c];let s=Object.getOwnPropertySymbols(o);for(var a=0;a{"use strict";var{hasOwnProperty:jf}=Object.prototype,Cp=vH();Cp.configure=vH;Cp.stringify=Cp;Cp.default=Cp;PH.stringify=Cp;PH.configure=vH;qge.exports=Cp;var P6e=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function wI(n){return n.length<5e3&&!P6e.test(n)?`"${n}"`:JSON.stringify(n)}function RH(n,t){if(n.length>200||t)return n.sort(t);for(let o=1;oi;)n[e]=n[e-1],e--;n[e]=i}return n}var G6e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function kH(n){return G6e.call(n)!==void 0&&n.length!==0}function jge(n,t,o){n.length= 1`)}return o===void 0?1/0:o}function Ep(n){return n===1?"1 item":`${n} items`}function H6e(n){let t=new Set;for(let o of n)(typeof o=="string"||typeof o=="number")&&t.add(String(o));return t}function K6e(n){if(jf.call(n,"strict")){let t=n.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return o=>{let i=`Object can not safely be stringified. Received type ${typeof o}`;throw typeof o!="function"&&(i+=` (${o.toString()})`),new Error(i)}}}function vH(n){n={...n};let t=K6e(n);t&&(n.bigint===void 0&&(n.bigint=!1),"circularValue"in n||(n.circularValue=Error));let o=F6e(n),i=U6e(n,"bigint"),e=L6e(n),a=typeof e=="function"?e:void 0,A=Jge(n,"maximumDepth"),r=Jge(n,"maximumBreadth");function s(B,f,Q,y,m,T){let _=f[B];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(B)),_=y.call(f,B,_),typeof _){case"string":return wI(_);case"object":{if(_===null)return"null";if(Q.indexOf(_)!==-1)return o;let R="",K=",",L=T;if(Array.isArray(_)){if(_.length===0)return"[]";if(Ar){let k=_.length-r-1;R+=`${K}"... ${Ep(k)} not stringified"`}return m!==""&&(R+=` ${L}`),Q.pop(),`[${R}]`}let F=Object.keys(_),q=F.length;if(q===0)return"{}";if(Ar){let V=R-r;L+=`${F}"...": "${Ep(V)} not stringified"`,F=K}return F!==""&&(L=` ${m}${L} -${T}`),Q.pop(),`{${L}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return t?t(f):void 0}}function I(B,f,Q){switch(typeof f){case"string":return wI(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(B),typeof f!="object")return I(B,f,Q);if(f===null)return"null"}if(Q.indexOf(f)!==-1)return o;let y="",m=f.length!==void 0;if(m&&Array.isArray(f)){if(f.length===0)return"[]";if(Ar){let V=f.length-r-1;y+=`,"... ${Ep(V)} not stringified"`}return Q.pop(),`[${y}]`}let T=Object.keys(f),_=T.length;if(_===0)return"{}";if(Ar){let L=_-r;y+=`${R}"...":"${Ep(L)} not stringified"`}return Q.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return t?t(f):void 0}}function d(B,f,Q){if(arguments.length>1){let y="";if(typeof Q=="number"?y=" ".repeat(Math.min(Q,10)):typeof Q=="string"&&(y=Q.slice(0,10)),f!=null){if(typeof f=="function")return s("",{"":B},[],f,y,"");if(Array.isArray(f))return g("",B,[],H6e(f),y,"")}if(y.length!==0)return c("",B,[],y,"")}return I("",B,[])}return d}});var Xge=$((ivA,Zge)=>{"use strict";var GH=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Wge}=tM(),x6e=Wge.info;function Y6e(n,t){n=n||[],t=t||{dedupe:!1};let o=Object.create(Wge);o.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(I=>{o[I]=t.levels[I]});let i={write:e,add:r,remove:s,emit:a,flushSync:A,end:g,minLevel:0,lastId:0,streams:[],clone:c,[GH]:!0,streamLevels:o};return Array.isArray(n)?n.forEach(r,i):r.call(i,n),n=null,i;function e(I){let d,B=this.lastLevel,{streams:f}=this,Q=0,y;for(let m=j6e(f.length,t.dedupe);q6e(m,f.length,t.dedupe);m=J6e(m,t.dedupe))if(d=f[m],d.level<=B){if(Q!==0&&Q!==d.level)break;if(y=d.stream,y[GH]){let{lastTime:T,lastMsg:_,lastObj:R,lastLogger:K}=this;y.lastLevel=B,y.lastTime=T,y.lastMsg=_,y.lastObj=R,y.lastLogger=K}y.write(I),t.dedupe&&(Q=d.level)}else if(!t.dedupe)break}function a(...I){for(let{stream:d}of this.streams)typeof d.emit=="function"&&d.emit(...I)}function A(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync()}function r(I){if(!I)return i;let d=typeof I.write=="function"||I.stream,B=I.write?I:I.stream;if(!d)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:Q}=this,y;typeof I.levelVal=="number"?y=I.levelVal:typeof I.level=="string"?y=Q[I.level]:typeof I.level=="number"?y=I.level:y=x6e;let m={stream:B,level:y,levelVal:void 0,id:++i.lastId};return f.unshift(m),f.sort(Vge),this.minLevel=f[0].level,i}function s(I){let{streams:d}=this,B=d.findIndex(f=>f.id===I);return B>=0&&(d.splice(B,1),d.sort(Vge),this.minLevel=d.length>0?d[0].level:-1),i}function g(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync(),I.end()}function c(I){let d=new Array(this.streams.length);for(let B=0;B=0:n{"use strict";var z6e=$e("node:os"),oce=aH(),V6e=iH(),W6e=sH(),nce=jse(),Z6e=Yge(),sce=BE(),{configure:X6e}=zge(),{assertDefaultLevelFound:$6e,mappings:gce,genLsCache:e5e,genLevelComparison:A5e,assertLevelComparison:t5e}=bH(),{DEFAULT_LEVELS:cce,SORTING_ORDER:r5e}=tM(),{createArgsNormalizer:a5e,asChindings:i5e,buildSafeSonicBoom:$ge,buildFormatters:o5e,stringify:FH,normalizeDestFileDescriptor:ece,noop:n5e}=AM(),{version:s5e}=MH(),{chindingsSym:Ace,redactFmtSym:g5e,serializersSym:tce,timeSym:c5e,timeSliceIndexSym:I5e,streamSym:l5e,stringifySym:rce,stringifySafeSym:LH,stringifiersSym:ace,setLevelSym:p5e,endSym:d5e,formatOptsSym:h5e,messageKeySym:E5e,errorKeySym:C5e,nestedKeySym:u5e,mixinSym:B5e,levelCompSym:f5e,useOnlyCustomLevelsSym:Q5e,formattersSym:ice,hooksSym:y5e,nestedKeyStrSym:m5e,mixinMergeStrategySym:S5e,msgPrefixSym:w5e}=sce,{epochTime:Ice,nullTime:D5e}=nce,{pid:O5e}=process,b5e=z6e.hostname(),M5e=oce.err,_5e={level:"info",levelComparison:r5e.ASC,levels:cce,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:O5e,hostname:b5e},serializers:Object.assign(Object.create(null),{err:M5e}),formatters:Object.assign(Object.create(null),{bindings(n){return n},level(n,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Ice,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},T5e=a5e(_5e),N5e=Object.assign(Object.create(null),oce);function UH(...n){let t={},{opts:o,stream:i}=T5e(t,V6e(),...n);o.level&&typeof o.level=="string"&&cce[o.level.toLowerCase()]!==void 0&&(o.level=o.level.toLowerCase());let{redact:e,crlf:a,serializers:A,timestamp:r,messageKey:s,errorKey:g,nestedKey:c,base:I,name:d,level:B,customLevels:f,levelComparison:Q,mixin:y,mixinMergeStrategy:m,useOnlyCustomLevels:T,formatters:_,hooks:R,depthLimit:K,edgeLimit:L,onChild:F,msgPrefix:q}=o,V=X6e({maximumDepth:K,maximumBreadth:L}),x=o5e(_.level,_.bindings,_.log),G=FH.bind({[LH]:V}),J=e?W6e(e,G):{},U=e?{stringify:J[g5e]}:{stringify:G},N="}"+(a?`\r +${T}`),Q.pop(),`{${L}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return t?t(f):void 0}}function I(B,f,Q){switch(typeof f){case"string":return wI(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(B),typeof f!="object")return I(B,f,Q);if(f===null)return"null"}if(Q.indexOf(f)!==-1)return o;let y="",m=f.length!==void 0;if(m&&Array.isArray(f)){if(f.length===0)return"[]";if(Ar){let V=f.length-r-1;y+=`,"... ${Ep(V)} not stringified"`}return Q.pop(),`[${y}]`}let T=Object.keys(f),_=T.length;if(_===0)return"{}";if(Ar){let L=_-r;y+=`${R}"...":"${Ep(L)} not stringified"`}return Q.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return t?t(f):void 0}}function d(B,f,Q){if(arguments.length>1){let y="";if(typeof Q=="number"?y=" ".repeat(Math.min(Q,10)):typeof Q=="string"&&(y=Q.slice(0,10)),f!=null){if(typeof f=="function")return s("",{"":B},[],f,y,"");if(Array.isArray(f))return g("",B,[],H6e(f),y,"")}if(y.length!==0)return c("",B,[],y,"")}return I("",B,[])}return d}});var Xge=$((ivA,Zge)=>{"use strict";var GH=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Wge}=tM(),x6e=Wge.info;function Y6e(n,t){n=n||[],t=t||{dedupe:!1};let o=Object.create(Wge);o.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(I=>{o[I]=t.levels[I]});let i={write:e,add:r,remove:s,emit:a,flushSync:A,end:g,minLevel:0,lastId:0,streams:[],clone:c,[GH]:!0,streamLevels:o};return Array.isArray(n)?n.forEach(r,i):r.call(i,n),n=null,i;function e(I){let d,B=this.lastLevel,{streams:f}=this,Q=0,y;for(let m=j6e(f.length,t.dedupe);q6e(m,f.length,t.dedupe);m=J6e(m,t.dedupe))if(d=f[m],d.level<=B){if(Q!==0&&Q!==d.level)break;if(y=d.stream,y[GH]){let{lastTime:T,lastMsg:_,lastObj:R,lastLogger:K}=this;y.lastLevel=B,y.lastTime=T,y.lastMsg=_,y.lastObj=R,y.lastLogger=K}y.write(I),t.dedupe&&(Q=d.level)}else if(!t.dedupe)break}function a(...I){for(let{stream:d}of this.streams)typeof d.emit=="function"&&d.emit(...I)}function A(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync()}function r(I){if(!I)return i;let d=typeof I.write=="function"||I.stream,B=I.write?I:I.stream;if(!d)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:Q}=this,y;typeof I.levelVal=="number"?y=I.levelVal:typeof I.level=="string"?y=Q[I.level]:typeof I.level=="number"?y=I.level:y=x6e;let m={stream:B,level:y,levelVal:void 0,id:++i.lastId};return f.unshift(m),f.sort(Vge),this.minLevel=f[0].level,i}function s(I){let{streams:d}=this,B=d.findIndex(f=>f.id===I);return B>=0&&(d.splice(B,1),d.sort(Vge),this.minLevel=d.length>0?d[0].level:-1),i}function g(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync(),I.end()}function c(I){let d=new Array(this.streams.length);for(let B=0;B=0:n{"use strict";var z6e=$e("node:os"),oce=aH(),V6e=iH(),W6e=sH(),nce=jse(),Z6e=Yge(),sce=fE(),{configure:X6e}=zge(),{assertDefaultLevelFound:$6e,mappings:gce,genLsCache:e5e,genLevelComparison:A5e,assertLevelComparison:t5e}=bH(),{DEFAULT_LEVELS:cce,SORTING_ORDER:r5e}=tM(),{createArgsNormalizer:a5e,asChindings:i5e,buildSafeSonicBoom:$ge,buildFormatters:o5e,stringify:FH,normalizeDestFileDescriptor:ece,noop:n5e}=AM(),{version:s5e}=MH(),{chindingsSym:Ace,redactFmtSym:g5e,serializersSym:tce,timeSym:c5e,timeSliceIndexSym:I5e,streamSym:l5e,stringifySym:rce,stringifySafeSym:LH,stringifiersSym:ace,setLevelSym:p5e,endSym:d5e,formatOptsSym:h5e,messageKeySym:E5e,errorKeySym:C5e,nestedKeySym:u5e,mixinSym:B5e,levelCompSym:f5e,useOnlyCustomLevelsSym:Q5e,formattersSym:ice,hooksSym:y5e,nestedKeyStrSym:m5e,mixinMergeStrategySym:S5e,msgPrefixSym:w5e}=sce,{epochTime:Ice,nullTime:D5e}=nce,{pid:O5e}=process,b5e=z6e.hostname(),M5e=oce.err,_5e={level:"info",levelComparison:r5e.ASC,levels:cce,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:O5e,hostname:b5e},serializers:Object.assign(Object.create(null),{err:M5e}),formatters:Object.assign(Object.create(null),{bindings(n){return n},level(n,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Ice,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},T5e=a5e(_5e),N5e=Object.assign(Object.create(null),oce);function UH(...n){let t={},{opts:o,stream:i}=T5e(t,V6e(),...n);o.level&&typeof o.level=="string"&&cce[o.level.toLowerCase()]!==void 0&&(o.level=o.level.toLowerCase());let{redact:e,crlf:a,serializers:A,timestamp:r,messageKey:s,errorKey:g,nestedKey:c,base:I,name:d,level:B,customLevels:f,levelComparison:Q,mixin:y,mixinMergeStrategy:m,useOnlyCustomLevels:T,formatters:_,hooks:R,depthLimit:K,edgeLimit:L,onChild:F,msgPrefix:q}=o,V=X6e({maximumDepth:K,maximumBreadth:L}),x=o5e(_.level,_.bindings,_.log),G=FH.bind({[LH]:V}),J=e?W6e(e,G):{},U=e?{stringify:J[g5e]}:{stringify:G},N="}"+(a?`\r `:` -`),k=i5e.bind(null,{[Ace]:"",[tce]:A,[ace]:J,[rce]:FH,[LH]:V,[ice]:x}),z="";I!==null&&(d===void 0?z=k(I):z=k(Object.assign({},I,{name:d})));let Ae=r instanceof Function?r:r?Ice:D5e,ie=Ae().indexOf(":")+1;if(T&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(q&&typeof q!="string")throw Error(`Unknown msgPrefix type "${typeof q}" - expected "string"`);$6e(B,f,T);let we=gce(f,T);typeof i.emit=="function"&&i.emit("message",{code:"PINO_CONFIG",config:{levels:we,messageKey:s,errorKey:g}}),t5e(Q);let se=A5e(Q);return Object.assign(t,{levels:we,[f5e]:se,[Q5e]:T,[l5e]:i,[c5e]:Ae,[I5e]:ie,[rce]:FH,[LH]:V,[ace]:J,[d5e]:N,[h5e]:U,[E5e]:s,[C5e]:g,[u5e]:c,[m5e]:c?`,${JSON.stringify(c)}:{`:"",[tce]:A,[B5e]:y,[S5e]:m,[Ace]:z,[ice]:x,[y5e]:R,silent:n5e,onChild:F,[w5e]:q}),Object.setPrototypeOf(t,Z6e()),e5e(t),t[p5e](B),t}gn.exports=UH;gn.exports.destination=(n=process.stdout.fd)=>typeof n=="object"?(n.dest=ece(n.dest||process.stdout.fd),$ge(n)):$ge({dest:ece(n),minLength:0});gn.exports.transport=yH();gn.exports.multistream=Xge();gn.exports.levels=gce();gn.exports.stdSerializers=N5e;gn.exports.stdTimeFunctions=Object.assign({},nce);gn.exports.symbols=sce;gn.exports.version=s5e;gn.exports.default=UH;gn.exports.pino=UH});import{unlink as HCe}from"node:fs/promises";import{homedir as KCe}from"node:os";import{join as XE,resolve as FI}from"node:path";import{createHash as ale,randomUUID as ix}from"node:crypto";import{mkdir as ile,readFile as ole,rename as nle,unlink as ax,writeFile as sle}from"node:fs/promises";import{dirname as gle}from"node:path";var KK={"\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002":"This question has already been answered from another client; no further reply is needed.","\u4EFB\u52A1\u5DF2\u5B8C\u6210\u3002":"Task completed.",\u7ED3\u679C\u6587\u4EF6:"result file","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002":'The delivery result of the result file "{name}" could not be confirmed. Please check whether it already arrived in the chat before retrying.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Slack \u5E94\u7528\u7F3A\u5C11 files:write \u6743\u9650\u3002\u8BF7\u66F4\u65B0 Manifest\u3001\u91CD\u65B0\u5B89\u88C5\u5E94\u7528\u5E76\u91CD\u65B0\u8FDE\u63A5\u673A\u5668\u4EBA\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but the Slack app is missing the files:write permission. Please update the Manifest, reinstall the app, reconnect the bot, and try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11 Discord \u7684 Send Messages\u3001Attach Files \u6216 Read Message History \u6743\u9650\u3002":'The result file "{name}" was generated, but the bot is missing the Discord Send Messages, Attach Files, or Read Message History permission.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Telegram \u4E0D\u5141\u8BB8\u673A\u5668\u4EBA\u5728\u5F53\u524D\u804A\u5929\u53D1\u9001\u6587\u6863\uFF0C\u8BF7\u68C0\u67E5\u804A\u5929\u6743\u9650\u3002":'The result file "{name}" was generated, but Telegram does not allow the bot to send documents in this chat. Please check the chat permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u6E20\u9053\u6743\u9650\u3002":'The result file "{name}" was generated, but the bot does not have permission to send files. Please check the channel permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u6E20\u9053\u5927\u5C0F\u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the size limit of this channel and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" is empty and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002":'The result file "{name}" cannot be read or prepared for sending right now. Please make sure the file is still accessible and try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5F53\u524D\u6E20\u9053\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by this channel and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but this channel rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but this channel could not send it right now. Please try again later.',"\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Failed to process the message. Please try again later.","\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002":"This card has ended. Please check the next message.","\u5DE5\u5177\u8C03\u7528\u300C{name}\u300D\u672A\u6210\u529F\uFF0C\u8BF7\u68C0\u67E5\u5DE5\u5177\u914D\u7F6E\u6216\u7A0D\u540E\u91CD\u8BD5\u3002":'Tool call "{name}" did not succeed. Check the tool configuration or try again later.',"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002":"Could not connect to the processing service, so the message was not submitted. Make sure DeepSeek Harness is running, then try again.","\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The processing service timed out before the message started. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"The task status could not be confirmed and the task may have started. Wait or send /stop before submitting it again.","\u6D88\u606F\u63D0\u4EA4\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /status \u67E5\u770B\u72B6\u6001\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"The message submission could not be confirmed and the task may have started. Wait or send /status before submitting it again.","\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u4EFB\u52A1\u8FDB\u5EA6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Task progress is temporarily unavailable and the task may still be running. Wait or send /stop before submitting it again.","\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002":"The processing service rejected the bot connection. Ask an administrator to check the Harness address, proxy, or access settings.","\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002":"The bot and DeepSeek Harness use incompatible APIs. Ask an administrator to check the Harness address and update the related components.","DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"DeepSeek Harness could not complete the request. Please try again later.","\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Waiting for the model reply timed out and the task may still be running. Wait or send /stop before submitting it again.","\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002":"The model credentials are missing or invalid. Ask an administrator to check the model settings.","\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002":"The model quota or balance is insufficient. Ask an administrator to add quota or switch models, then try again.","\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is rate-limiting requests. Please try again later.","\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002":"This conversation exceeds the model context limit. Send /compact or /new, then try again.","\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /models \u67E5\u770B\u5E76\u4F7F\u7528 /model \u5207\u6362\u6A21\u578B\u3002":"The current model does not exist or is unavailable. Send /models and use /model to switch models.","\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002":"The current model does not exist or does not support the selected settings. Send /models and use /model to choose again.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002":"The current model does not support this content or the selected settings. Adjust the content, model, or reasoning effort and try again.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u5207\u6362\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002":"The current model does not support the selected settings. Switch the model or reasoning effort, then try again.","\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service timed out and the task did not finish. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is temporarily unreachable and the task did not finish. Please try again later.","\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is temporarily unavailable and the task did not finish. Please try again later.","\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002":"The model reply was interrupted or malformed, so the task did not finish. Please try again.","\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002":"The model returned no displayable content. Try again, or switch models if this keeps happening.","\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002":"The model rejected the current content. Revise the request and try again.","\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002":"The model reached its output limit without producing a displayable result. Reduce the task scope and try again.","\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002":"The task is waiting for an action that cannot be completed in this channel. Handle it in DeepSeek Harness, then try again.","\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002":"The task was unexpectedly interrupted and did not finish. Please try again.","\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002":"The current Session no longer exists. Send /new to create one, then try again.","\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002":"The current Session is still processing the previous task. Wait for it to finish, or send /stop before trying again.","\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002":"The Workspace or Session state just changed. Please send this message again.","\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002":"The current Workspace does not exist or is unavailable. Select another Workspace and try again.","\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002":"The current Agent Preset does not exist or is unavailable. Send /presetlist and select another one.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002":"The reply was generated, but the bot cannot send it. Ask an administrator to check channel permissions or reconnect the bot.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The reply was generated, but this channel is rate-limiting messages. Please try again later.","\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Reply delivery could not be confirmed. Check whether it already arrived before submitting the task again.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The reply was generated, but this channel could not send it. Please try again later.","\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002":"This message contains an image or file that cannot be processed. Adjust it and send it again.","\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002":"The task did not finish and the cause could not be determined. Try again; if it persists, give the reference ID to an administrator.","\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}":"Error code: {code}; reference: {referenceId}","{label}\u673A\u5668\u4EBA":"{label} bot","\u76EE\u524D\u652F\u6301\u6587\u5B57\u548C\u56FE\u7247\u6D88\u606F\u3002":"Only text and image messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002":"Only text, image, and file messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002":"Only text, image, file, and voice-transcription messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002":"Only text, image, file, and voice messages already transcribed to text by WeChat are supported at the moment.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u6216\u56FE\u7247\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text or an image directly to continue the current session.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text, an image, or a file directly to continue the current session.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text, an image, a file, or a voice message already transcribed to text to continue the current session.","{label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The {label} bot is connected to DeepSeek Harness.","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD":"/new Start a brand-new session","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587":"/compact Compact the earlier context of the current session","/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace Switch workspace","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84":"/workspacelist List absolute workspace paths","/sessionlist [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"/sessionlist [workspace index or absolute path] List session IDs and titles","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"/sessionlist or /sessions [workspace index or absolute path] List session IDs and titles","/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD":"/session Bind this chat to the specified session","/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B":"/models List all available models by index","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7":"/reasoninglist or /reasonings List reasoning efforts for the current model by index","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7":"/reasoning [index, effort ID, or --default] Show or switch the current reasoning effort","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B":"/model [index or full model ID] Show or switch the model of the current session","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B":"/model [index or full model ID] [reasoning effort ID] Show or switch the current Session model","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2":"Example: send /models first, then /model 2","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]":"Example: send /models first, then /model 2 [reasoning effort ID]","/presetlist \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist List available Agent Presets by index","/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist or /presets List available Agent Presets by index","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset":"/preset [index or full ID] Show or set the Agent Preset of this bot","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:":"Numeric-only ID: /preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4":"/preset --default Follow the Host default","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1":"/stop Stop the current task","/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1":"/steer Steer the current task","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001":"/status Check the connection status","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C":"/version Show the plugin version","/help \u663E\u793A\u672C\u5E2E\u52A9":"/help Show this help","{label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The {label} bot is connected to DeepSeek Harness and working normally.","{label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002":"{label} bot credentials are missing. Remove the bot and connect it again.","{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The {label} connection is not ready yet. The plugin will retry automatically.","{label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The {label} bot is connected, but its message connection is not ready yet.","{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The {label} connection is still not ready. Please try again later.","{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5":"The {label} bot is not connected yet","{name}\uFF08{id}\uFF09":"{name} ({id})","{label}{connectionLabel}\u8FD0\u884C\u6B63\u5E38":"The {label}{connectionLabel} is running normally","{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The {label} connection is not ready. The plugin will retry automatically","{label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The {label} connection is currently offline","\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002":"A new session has started. Please send your question.","\u6B63\u5728\u4F7F\u7528{name}\u2026":"Using {name}\u2026","\u5DF2\u505C\u6B62\u3002":"Stopped.","\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002":"Please answer the current question with text.","{label}\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the {label} interaction question.","\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002":"Failed to submit the answer.","\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002":"Failed to submit the answer. Please resend your answer to the current question.","\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002":"A pending question left over in this Session was detected. It has been safely cancelled, and your latest message is being processed."};var xK={"\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09":"Usage: /session Session ID or the session index in the current Workspace (/session N)","\u7528\u6CD5\uFF1A\n/sessionlist \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u4F1A\u8BDD\n/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7 \u6309 /workspacelist \u5E8F\u53F7\u5217\u51FA\u4F1A\u8BDD\n/sessionlist \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5217\u51FA\u6307\u5B9A\u5DE5\u4F5C\u533A\u4F1A\u8BDD":`Usage: +`),k=i5e.bind(null,{[Ace]:"",[tce]:A,[ace]:J,[rce]:FH,[LH]:V,[ice]:x}),z="";I!==null&&(d===void 0?z=k(I):z=k(Object.assign({},I,{name:d})));let Ae=r instanceof Function?r:r?Ice:D5e,ie=Ae().indexOf(":")+1;if(T&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(q&&typeof q!="string")throw Error(`Unknown msgPrefix type "${typeof q}" - expected "string"`);$6e(B,f,T);let we=gce(f,T);typeof i.emit=="function"&&i.emit("message",{code:"PINO_CONFIG",config:{levels:we,messageKey:s,errorKey:g}}),t5e(Q);let se=A5e(Q);return Object.assign(t,{levels:we,[f5e]:se,[Q5e]:T,[l5e]:i,[c5e]:Ae,[I5e]:ie,[rce]:FH,[LH]:V,[ace]:J,[d5e]:N,[h5e]:U,[E5e]:s,[C5e]:g,[u5e]:c,[m5e]:c?`,${JSON.stringify(c)}:{`:"",[tce]:A,[B5e]:y,[S5e]:m,[Ace]:z,[ice]:x,[y5e]:R,silent:n5e,onChild:F,[w5e]:q}),Object.setPrototypeOf(t,Z6e()),e5e(t),t[p5e](B),t}gn.exports=UH;gn.exports.destination=(n=process.stdout.fd)=>typeof n=="object"?(n.dest=ece(n.dest||process.stdout.fd),$ge(n)):$ge({dest:ece(n),minLength:0});gn.exports.transport=yH();gn.exports.multistream=Xge();gn.exports.levels=gce();gn.exports.stdSerializers=N5e;gn.exports.stdTimeFunctions=Object.assign({},nce);gn.exports.symbols=sce;gn.exports.version=s5e;gn.exports.default=UH;gn.exports.pino=UH});import{unlink as HCe}from"node:fs/promises";import{homedir as KCe}from"node:os";import{join as XE,resolve as FI}from"node:path";import{createHash as ale,randomUUID as ix}from"node:crypto";import{mkdir as ile,readFile as ole,rename as nle,unlink as ax,writeFile as sle}from"node:fs/promises";import{dirname as gle}from"node:path";var KK={"\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002":"This question has already been answered from another client; no further reply is needed.","\u4EFB\u52A1\u5DF2\u5B8C\u6210\u3002":"Task completed.",\u7ED3\u679C\u6587\u4EF6:"result file","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002":'The delivery result of the result file "{name}" could not be confirmed. Please check whether it already arrived in the chat before retrying.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Slack \u5E94\u7528\u7F3A\u5C11 files:write \u6743\u9650\u3002\u8BF7\u66F4\u65B0 Manifest\u3001\u91CD\u65B0\u5B89\u88C5\u5E94\u7528\u5E76\u91CD\u65B0\u8FDE\u63A5\u673A\u5668\u4EBA\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but the Slack app is missing the files:write permission. Please update the Manifest, reinstall the app, reconnect the bot, and try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11 Discord \u7684 Send Messages\u3001Attach Files \u6216 Read Message History \u6743\u9650\u3002":'The result file "{name}" was generated, but the bot is missing the Discord Send Messages, Attach Files, or Read Message History permission.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Telegram \u4E0D\u5141\u8BB8\u673A\u5668\u4EBA\u5728\u5F53\u524D\u804A\u5929\u53D1\u9001\u6587\u6863\uFF0C\u8BF7\u68C0\u67E5\u804A\u5929\u6743\u9650\u3002":'The result file "{name}" was generated, but Telegram does not allow the bot to send documents in this chat. Please check the chat permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u6E20\u9053\u6743\u9650\u3002":'The result file "{name}" was generated, but the bot does not have permission to send files. Please check the channel permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u6E20\u9053\u5927\u5C0F\u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the size limit of this channel and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" is empty and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002":'The result file "{name}" cannot be read or prepared for sending right now. Please make sure the file is still accessible and try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5F53\u524D\u6E20\u9053\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by this channel and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but this channel rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but this channel could not send it right now. Please try again later.',"\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Failed to process the message. Please try again later.","\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002":"This card has ended. Please check the next message.","\u5DE5\u5177\u8C03\u7528\u300C{name}\u300D\u672A\u6210\u529F\uFF0C\u8BF7\u68C0\u67E5\u5DE5\u5177\u914D\u7F6E\u6216\u7A0D\u540E\u91CD\u8BD5\u3002":'Tool call "{name}" did not succeed. Check the tool configuration or try again later.',"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002":"Could not connect to the processing service, so the message was not submitted. Make sure DeepSeek Harness is running, then try again.","\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The processing service timed out before the message started. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"The task status could not be confirmed and the task may have started. Wait or send /stop before submitting it again.","\u6D88\u606F\u63D0\u4EA4\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /status \u67E5\u770B\u72B6\u6001\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"The message submission could not be confirmed and the task may have started. Wait or send /status before submitting it again.","\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u4EFB\u52A1\u8FDB\u5EA6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Task progress is temporarily unavailable and the task may still be running. Wait or send /stop before submitting it again.","\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002":"The processing service rejected the bot connection. Ask an administrator to check the Harness address, proxy, or access settings.","\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002":"The bot and DeepSeek Harness use incompatible APIs. Ask an administrator to check the Harness address and update the related components.","DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"DeepSeek Harness could not complete the request. Please try again later.","\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Waiting for the model reply timed out and the task may still be running. Wait or send /stop before submitting it again.","\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002":"The model credentials are missing or invalid. Ask an administrator to check the model settings.","\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002":"The model quota or balance is insufficient. Ask an administrator to add quota or switch models, then try again.","\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is rate-limiting requests. Please try again later.","\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002":"This conversation exceeds the model context limit. Send /compact or /new, then try again.","\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /models \u67E5\u770B\u5E76\u4F7F\u7528 /model \u5207\u6362\u6A21\u578B\u3002":"The current model does not exist or is unavailable. Send /models and use /model to switch models.","\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002":"The current model does not exist or does not support the selected settings. Send /models and use /model to choose again.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002":"The current model does not support this content or the selected settings. Adjust the content, model, or reasoning effort and try again.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u5207\u6362\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002":"The current model does not support the selected settings. Switch the model or reasoning effort, then try again.","\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service timed out and the task did not finish. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is temporarily unreachable and the task did not finish. Please try again later.","\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is temporarily unavailable and the task did not finish. Please try again later.","\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002":"The model reply was interrupted or malformed, so the task did not finish. Please try again.","\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002":"The model returned no displayable content. Try again, or switch models if this keeps happening.","\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002":"The model rejected the current content. Revise the request and try again.","\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002":"The model reached its output limit without producing a displayable result. Reduce the task scope and try again.","\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002":"The task is waiting for an action that cannot be completed in this channel. Handle it in DeepSeek Harness, then try again.","\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002":"The task was unexpectedly interrupted and did not finish. Please try again.","\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002":"The current Session no longer exists. Send /new to create one, then try again.","\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002":"The current Session is still processing the previous task. Wait for it to finish, or send /stop before trying again.","\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002":"The Workspace or Session state just changed. Please send this message again.","\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002":"The current Workspace does not exist or is unavailable. Select another Workspace and try again.","\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002":"The current Agent Preset does not exist or is unavailable. Send /presetlist and select another one.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002":"The reply was generated, but the bot cannot send it. Ask an administrator to check channel permissions or reconnect the bot.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The reply was generated, but this channel is rate-limiting messages. Please try again later.","\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Reply delivery could not be confirmed. Check whether it already arrived before submitting the task again.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The reply was generated, but this channel could not send it. Please try again later.","\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002":"This message contains an image or file that cannot be processed. Adjust it and send it again.","\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002":"The task did not finish and the cause could not be determined. Try again; if it persists, give the reference ID to an administrator.","\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}":"Error code: {code}; reference: {referenceId}","{label}\u673A\u5668\u4EBA":"{label} bot","\u76EE\u524D\u652F\u6301\u6587\u5B57\u548C\u56FE\u7247\u6D88\u606F\u3002":"Only text and image messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002":"Only text, image, and file messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002":"Only text, image, file, and voice-transcription messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002":"Only text, image, file, and voice messages already transcribed to text by WeChat are supported at the moment.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u6216\u56FE\u7247\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text or an image directly to continue the current session.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text, an image, or a file directly to continue the current session.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text, an image, a file, or a voice message already transcribed to text to continue the current session.","{label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The {label} bot is connected to DeepSeek Harness.","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD":"/new Start a brand-new session","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587":"/compact Compact the earlier context of the current session","/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace Switch workspace","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84":"/workspacelist List absolute workspace paths","/sessionlist [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"/sessionlist [workspace index or absolute path] List session IDs and titles","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"/sessionlist or /sessions [workspace index or absolute path] List session IDs and titles","/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD":"/session Bind this chat to the specified session","/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B":"/models List all available models by index","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7":"/reasoninglist or /reasonings List reasoning efforts for the current model by index","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7":"/reasoning [index, effort ID, or --default] Show or switch the current reasoning effort","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B":"/model [index or full model ID] Show or switch the model of the current session","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B":"/model [index or full model ID] [reasoning effort ID] Show or switch the current Session model","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2":"Example: send /models first, then /model 2","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]":"Example: send /models first, then /model 2 [reasoning effort ID]","/presetlist \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist List available Agent Presets by index","/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist or /presets List available Agent Presets by index","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset":"/preset [index or full ID] Show or set the Agent Preset of this bot","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:":"Numeric-only ID: /preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4":"/preset --default Follow the Host default","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1":"/stop Stop the current task","/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1":"/steer Steer the current task","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001":"/status Check the connection status","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C":"/version Show the plugin version","/help \u663E\u793A\u672C\u5E2E\u52A9":"/help Show this help","{label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The {label} bot is connected to DeepSeek Harness and working normally.","{label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002":"{label} bot credentials are missing. Remove the bot and connect it again.","{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The {label} connection is not ready yet. The plugin will retry automatically.","{label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The {label} bot is connected, but its message connection is not ready yet.","{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The {label} connection is still not ready. Please try again later.","{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5":"The {label} bot is not connected yet","{name}\uFF08{id}\uFF09":"{name} ({id})","{label}{connectionLabel}\u8FD0\u884C\u6B63\u5E38":"The {label}{connectionLabel} is running normally","{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The {label} connection is not ready. The plugin will retry automatically","{label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The {label} connection is currently offline","\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002":"A new session has started. Please send your question.","\u6B63\u5728\u4F7F\u7528{name}\u2026":"Using {name}\u2026","\u5DF2\u505C\u6B62\u3002":"Stopped.","\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002":"Please answer the current question with text.","{label}\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the {label} interaction question.","\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002":"Failed to submit the answer.","\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002":"Failed to submit the answer. Please resend your answer to the current question.","\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002":"A pending question left over in this Session was detected. It has been safely cancelled, and your latest message is being processed."};var xK={"\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09":"Usage: /session Session ID or the session index in the current Workspace (/session N)","\u7528\u6CD5\uFF1A\n/sessionlist \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u4F1A\u8BDD\n/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7 \u6309 /workspacelist \u5E8F\u53F7\u5217\u51FA\u4F1A\u8BDD\n/sessionlist \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5217\u51FA\u6307\u5B9A\u5DE5\u4F5C\u533A\u4F1A\u8BDD":`Usage: /sessionlist List Sessions in the current Workspace /sessionlist Workspace index List Sessions by /workspacelist index /sessionlist Workspace absolute path List Sessions in the given Workspace`,"\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002\n{usage}":`The Workspace must be an absolute path. {usage}`,"\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5305\u542B\u4E0D\u652F\u6301\u7684\u5B57\u7B26\u6216\u957F\u5EA6\u8D85\u8FC7\u9650\u5236\u3002\n{usage}":`The Workspace path contains unsupported characters or exceeds the length limit. {usage}`,"\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002\n{usage}":`The Workspace path does not exist. {usage}`,"\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002\n{usage}":`The Workspace path must point to a directory. -{usage}`,"\u7528\u6CD5\uFF1A/workspacelist":"Usage: /workspacelist","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u3002":"This bot does not support listing Workspaces yet.","\u5F53\u524D Harness Host \u4E0A\u6CA1\u6709\u4ECD\u7136\u5B58\u5728\u7684\u5DF2\u767B\u8BB0\u5DE5\u4F5C\u533A\u3002":"No registered Workspaces still exist on the current Harness Host.","\u5F53\u524D Harness Host \u4E0A\u5B58\u5728\u7684\u5DE5\u4F5C\u533A\uFF08{count}\uFF09\uFF1A":"Workspaces on the current Harness Host ({count}):","\uFF08\u5F53\u524D\uFF09":"(current)","\u5207\u6362\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84":"To switch: /workspace Workspace absolute path","\u67E5\u770B\u4F1A\u8BDD\uFF1A/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84":"To view Sessions: /sessionlist Workspace index or absolute path","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002":"The bot is being removed or has been reconnected; cannot list Workspaces of the original Session.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to get the Workspace list right now; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\u3002":"This bot has no available Workspace.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u9009\u62E9\u5DE5\u4F5C\u533A\u3002":"This bot does not support selecting a Workspace by index yet.","\u5DE5\u4F5C\u533A\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /workspacelist\u3002":"The Workspace index does not exist; please run /workspacelist first.","\u4ECA\u5929 {time}":"Today {time}","\u6628\u5929 {time}":"Yesterday {time}","\u524D\u5929 {time}":"The day before yesterday {time}","{month}\u6708{day}\u65E5 {time}":"{month}/{day} {time}","{year}\u5E74{month}\u6708{day}\u65E5":"{year}-{month}-{day}",\u6807\u9898\u6682\u4E0D\u53EF\u7528:"Title unavailable",\u6682\u65E0\u6807\u9898:"No title","\uFF08\u5DF2\u5F52\u6863\uFF09":"(archived)","\u5DE5\u4F5C\u533A\uFF1A{workspace}\n\u8BE5\u5DE5\u4F5C\u533A\u6682\u65E0\u4F1A\u8BDD\u3002":`Workspace: {workspace} +{usage}`,"\u7528\u6CD5\uFF1A/workspacelist":"Usage: /workspacelist","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u3002":"This bot does not support listing Workspaces yet.","\u5F53\u524D Harness Host \u4E0A\u6CA1\u6709\u4ECD\u7136\u5B58\u5728\u7684\u5DF2\u767B\u8BB0\u5DE5\u4F5C\u533A\u3002":"No registered Workspaces still exist on the current Harness Host.","\u5F53\u524D Harness Host \u4E0A\u5B58\u5728\u7684\u5DE5\u4F5C\u533A\uFF08{count}\uFF09\uFF1A":"Workspaces on the current Harness Host ({count}):","\uFF08\u5F53\u524D\uFF09":"(current)","\u5207\u6362\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84":"To switch: /workspace Workspace index or absolute path","\u67E5\u770B\u4F1A\u8BDD\uFF1A/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84":"To view Sessions: /sessionlist Workspace index or absolute path","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002":"The bot is being removed or has been reconnected; cannot list Workspaces of the original Session.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to get the Workspace list right now; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\u3002":"This bot has no available Workspace.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u9009\u62E9\u5DE5\u4F5C\u533A\u3002":"This bot does not support selecting a Workspace by index yet.","\u5DE5\u4F5C\u533A\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /workspacelist\u3002":"The Workspace index does not exist; please run /workspacelist first.","\u4ECA\u5929 {time}":"Today {time}","\u6628\u5929 {time}":"Yesterday {time}","\u524D\u5929 {time}":"The day before yesterday {time}","{month}\u6708{day}\u65E5 {time}":"{month}/{day} {time}","{year}\u5E74{month}\u6708{day}\u65E5":"{year}-{month}-{day}",\u6807\u9898\u6682\u4E0D\u53EF\u7528:"Title unavailable",\u6682\u65E0\u6807\u9898:"No title","\uFF08\u5DF2\u5F52\u6863\uFF09":"(archived)","\u5DE5\u4F5C\u533A\uFF1A{workspace}\n\u8BE5\u5DE5\u4F5C\u533A\u6682\u65E0\u4F1A\u8BDD\u3002":`Workspace: {workspace} This Workspace has no Sessions yet.`,"\u5DE5\u4F5C\u533A\uFF1A{workspace}":"Workspace: {workspace}","\u4F1A\u8BDD\uFF08{count}\uFF09\uFF1A":"Sessions ({count}):","\u7ED1\u5B9A\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09":"To bind: /session Session ID or the Session index in the current Workspace (/session N)","\u7ED1\u5B9A\u7528\u6CD5\uFF1A/session Session ID\n\u63D0\u793A\uFF1A/session N \u53EA\u6309\u673A\u5668\u4EBA\u5F53\u524D\u5DE5\u4F5C\u533A\u7684\u5E8F\u53F7\u7ED1\u5B9A\u3002":`To bind: /session Session ID Note: /session N binds by index within the bot's current Workspace only.`,"\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u3002":"This bot does not support listing Workspace Sessions yet.","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u3002":"The bot is being removed or has been reconnected; cannot list Workspace Sessions of the original Session.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to get the Workspace Session list right now; please try again later.","Session ID \u683C\u5F0F\u65E0\u6548\u3002\n{usage}":`Invalid Session ID format. -{usage}`,"\u672A\u627E\u5230\u8BE5\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u786E\u8BA4 Session ID\u3002":"Session not found; please run /sessionlist to confirm the Session ID.","\u5B50\u4EE3\u7406\u4F1A\u8BDD\u4E0D\u80FD\u7ED1\u5B9A\u5230\u673A\u5668\u4EBA\u5BF9\u8BDD\uFF0C\u8BF7\u9009\u62E9\u666E\u901A\u4F1A\u8BDD\u3002":"Sub-agent Sessions cannot be bound to a bot conversation; please choose a regular Session.","\u8BE5\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u5F52\u5C5E\u4E0D\u660E\u786E\uFF0C\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u3002":"The Session's Workspace ownership is ambiguous; cannot bind it right now.","\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u4F1A\u8BDD\u7684\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to read the Session info right now; please try again later.","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u7ED1\u5B9A\u539F\u5BF9\u8BDD\u7684\u4F1A\u8BDD\u3002":"The bot is being removed or has been reconnected; cannot bind the Session of the original conversation.","\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002":"The Workspace or Session state has changed; please try again.","\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to bind the Session right now; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u7ED1\u5B9A\uFF0C\u8BF7\u4F7F\u7528 /session Session ID\u3002":"This bot does not support binding by index yet; please use /session Session ID.","\u4F1A\u8BDD\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u67E5\u770B\u5E8F\u53F7\u3002":"The Session index does not exist; please run /sessionlist to see the indexes.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to get the Session list right now; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD\u3002":"This bot does not support binding existing Sessions yet.","\u5F53\u524D\u6D88\u606F\u7F3A\u5C11\u53EF\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u4E0A\u4E0B\u6587\u3002":"The current message lacks a conversation context to bind to.","\u5F53\u524D\u804A\u5929\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\uFF1A":"This chat is now bound to the Session:","\u53D1\u9001 /history \u67E5\u770B\u6700\u8FD1\u5BF9\u8BDD\u3002":"Send /history to preview recent conversation messages.","\u6807\u9898\uFF1A{title}":"Title: {title}","\u5F52\u6863\uFF1A{archived}":"Archived: {archived}",\u662F:"Yes",\u5426:"No","\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84":"Usage: /workspace Workspace absolute path","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5207\u6362\u5DE5\u4F5C\u533A\u3002":"This bot does not support switching Workspaces yet.","\u5DE5\u4F5C\u533A\u5DF2\u5207\u6362\u4E3A\uFF1A{workspace}":"Workspace switched to: {workspace}","{message}\n\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84":`{message} -Usage: /workspace Workspace absolute path`,"\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5207\u6362\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002":"The bot is being removed or has been reconnected; cannot switch the Workspace of the original Session.","\u7528\u6CD5\uFF1A/presetlist\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /presetlist (no arguments)","\u7528\u6CD5\uFF1A\n/preset \u67E5\u770B\u5F53\u524D\u8BBE\u7F6E\n/preset <\u5E8F\u53F7> \u6309\u6700\u8FD1\u4E00\u6B21 /presetlist \u7684\u5E8F\u53F7\u9009\u62E9\n/preset \u6309 Agent Preset ID \u9009\u62E9\n/preset id:<\u7EAF\u6570\u5B57 ID> \u9009\u62E9\u7EAF\u6570\u5B57 ID\n/preset --default \u8DDF\u968F Host \u9ED8\u8BA4":`Usage: +{usage}`,"\u672A\u627E\u5230\u8BE5\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u786E\u8BA4 Session ID\u3002":"Session not found; please run /sessionlist to confirm the Session ID.","\u5B50\u4EE3\u7406\u4F1A\u8BDD\u4E0D\u80FD\u7ED1\u5B9A\u5230\u673A\u5668\u4EBA\u5BF9\u8BDD\uFF0C\u8BF7\u9009\u62E9\u666E\u901A\u4F1A\u8BDD\u3002":"Sub-agent Sessions cannot be bound to a bot conversation; please choose a regular Session.","\u8BE5\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u5F52\u5C5E\u4E0D\u660E\u786E\uFF0C\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u3002":"The Session's Workspace ownership is ambiguous; cannot bind it right now.","\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u4F1A\u8BDD\u7684\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to read the Session info right now; please try again later.","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u7ED1\u5B9A\u539F\u5BF9\u8BDD\u7684\u4F1A\u8BDD\u3002":"The bot is being removed or has been reconnected; cannot bind the Session of the original conversation.","\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002":"The Workspace or Session state has changed; please try again.","\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to bind the Session right now; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u7ED1\u5B9A\uFF0C\u8BF7\u4F7F\u7528 /session Session ID\u3002":"This bot does not support binding by index yet; please use /session Session ID.","\u4F1A\u8BDD\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u67E5\u770B\u5E8F\u53F7\u3002":"The Session index does not exist; please run /sessionlist to see the indexes.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to get the Session list right now; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD\u3002":"This bot does not support binding existing Sessions yet.","\u5F53\u524D\u6D88\u606F\u7F3A\u5C11\u53EF\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u4E0A\u4E0B\u6587\u3002":"The current message lacks a conversation context to bind to.","\u5F53\u524D\u804A\u5929\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\uFF1A":"This chat is now bound to the Session:","\u53D1\u9001 /history \u67E5\u770B\u6700\u8FD1\u5BF9\u8BDD\u3002":"Send /history to preview recent conversation messages.","\u6807\u9898\uFF1A{title}":"Title: {title}","\u5F52\u6863\uFF1A{archived}":"Archived: {archived}",\u662F:"Yes",\u5426:"No","\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84":"Usage: /workspace Workspace index or absolute path","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5207\u6362\u5DE5\u4F5C\u533A\u3002":"This bot does not support switching Workspaces yet.","\u5DE5\u4F5C\u533A\u5DF2\u5207\u6362\u4E3A\uFF1A{workspace}":"Workspace switched to: {workspace}","{message}\n\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84":`{message} +Usage: /workspace Workspace index or absolute path`,"\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5207\u6362\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002":"The bot is being removed or has been reconnected; cannot switch the Workspace of the original Session.","\u7528\u6CD5\uFF1A/presetlist\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /presetlist (no arguments)","\u7528\u6CD5\uFF1A\n/preset \u67E5\u770B\u5F53\u524D\u8BBE\u7F6E\n/preset <\u5E8F\u53F7> \u6309\u6700\u8FD1\u4E00\u6B21 /presetlist \u7684\u5E8F\u53F7\u9009\u62E9\n/preset \u6309 Agent Preset ID \u9009\u62E9\n/preset id:<\u7EAF\u6570\u5B57 ID> \u9009\u62E9\u7EAF\u6570\u5B57 ID\n/preset --default \u8DDF\u968F Host \u9ED8\u8BA4":`Usage: /preset Show current settings /preset Select by index from the latest /presetlist /preset Select by Agent Preset ID @@ -115,7 +115,7 @@ Send /send to retry or /cancel to cancel.`,"\u4F60\u53EF\u4EE5\u53D1\u9001\u666E {url}`,"\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF1B\u5E73\u53F0\u672A\u8FD4\u56DE\u6210\u529F\u7ED3\u679C\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5DF2\u4FEE\u590D\u3002\u53D1\u9001 /repair \u751F\u6210\u65B0\u94FE\u63A5\u3002":"The authorization link expired; the platform returned no success, so the repair cannot be confirmed. Send /repair for a new link.","\u5DF2\u53D6\u6D88\u672C\u6B21\u4FEE\u590D\u6388\u6743\uFF0C\u672A\u786E\u8BA4\u5B8C\u6210\u4FEE\u590D\u3002":"Repair authorization was cancelled; the repair was not confirmed.","\u4F60\u5DF2\u53D6\u6D88\u6216\u62D2\u7EDD\u6388\u6743\uFF0C\u6CA1\u6709\u786E\u8BA4\u4FEE\u590D\uFF1B\u53D1\u9001 /repair \u53EF\u91CD\u8BD5\u3002":"You cancelled or declined authorization, so the repair was not confirmed. Send /repair to retry.","\u6388\u6743\u5DF2\u63D0\u4EA4\uFF0C\u4F46\u672A\u6536\u5230\u6D4B\u8BD5\u6309\u94AE\u56DE\u8C03\u3002\u53EF\u80FD\u5C1A\u672A\u70B9\u51FB\u6216\u914D\u7F6E\u4ECD\u5728\u4F20\u64AD\uFF1B\u7A0D\u540E\u53D1\u9001 /repair verify \u67E5\u8BE2\uFF0C\u4E0D\u8981\u76F2\u76EE\u91CD\u590D\u6388\u6743\u3002":"Authorization was submitted, but no test-button callback arrived. It may not have been tapped yet, or the config is still propagating. Send /repair verify later to check; do not authorize blindly again.","\u4FEE\u590D\u6D41\u7A0B\u6682\u65F6\u5931\u8D25\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u53D1\u9001 /repair \u53EF\u91CD\u8BD5\u3002":"The repair flow failed for now; the existing bot connection is unaffected. Send /repair to retry.","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u7B49\u5F85\u4E13\u7528\u6D4B\u8BD5\u6309\u94AE\u7684\u771F\u5B9E\u56DE\u8C03\uFF1B\u56DE\u8C03\u5230\u8FBE\u524D\u4E0D\u4F1A\u5BA3\u544A\u6210\u529F\u3002":"Authorization confirmed. Waiting for the real callback from the dedicated test button; success is not declared until it arrives.","\u6388\u6743\u5C1A\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u4E0D\u80FD\u9A8C\u8BC1\u5361\u7247\u6309\u94AE\u3002\u8BF7\u5148\u6253\u5F00\u6388\u6743\u94FE\u63A5\u5E76\u786E\u8BA4\u3002":"Authorization is not complete, so the card buttons cannot be verified yet. Open the authorization link and confirm first.","\u4FEE\u590D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u6388\u6743{remaining}\u3002\u53D1\u9001 /repair qr \u53EF\u83B7\u53D6\u4E8C\u7EF4\u7801\uFF0C/repair cancel \u53EF\u53D6\u6D88\u3002":"The repair task is waiting for authorization{remaining}. Send /repair qr for the QR code, or /repair cancel to cancel.","\uFF0C\u5269\u4F59\u7EA6 {minutes} \u5206\u949F":", about {minutes} minutes left","\u8FD9\u4E2A\u83DC\u5355\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u56DE\u590D /m \u91CD\u65B0\u6253\u5F00\u3002":"This menu has expired. Send /m to reopen it.","\u83DC\u5355\u6CA1\u6709\u8FD9\u4E2A\u7F16\u53F7\uFF0C\u56DE\u590D /m \u91CD\u65B0\u6253\u5F00\u3002":"This menu has no such number. Send /m to reopen it.","\u672C\u9875\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /sessionlist \u91CD\u65B0\u67E5\u770B\u3002":"This page has only {count} sessions. Send /sessionlist to view them again.","\u53EA\u6709 {count} \u4E2A\u5DE5\u4F5C\u533A\uFF0C\u56DE\u590D /workspacelist \u91CD\u65B0\u67E5\u770B\u3002":"There are only {count} workspaces. Send /workspacelist to view them again.","\u5173\u6CE8\u5217\u8868\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002":"The watch list has only {count} sessions.","\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\u300C{title}\u300D\nID\uFF1A{id}":`Session bound: "{title}" ID: {id}`,"\u7ED1\u5B9A\u5931\u8D25\uFF1A{message}":"Binding failed: {message}","\u5207\u6362\u5931\u8D25\uFF1A{message}":"Switch failed: {message}","\u7528\u6CD5\uFF1A/watch ":"Usage: /watch ","\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\uFF0C\u65E0\u6CD5\u6309\u5E8F\u53F7\u89E3\u6790\u4F1A\u8BDD\u3002":"This bot has no available workspace, so sessions cannot be resolved by index.","\u5F53\u524D\u5DE5\u4F5C\u533A\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002":"The current workspace has only {count} sessions.","\u6CA1\u6709\u627E\u5230\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u8BF7\u7528 /sessionlist \u67E5\u770B\u53EF\u7528\u4F1A\u8BDD\u3002":"Session not found. Use /sessionlist to see the available sessions.","\u5F53\u524D\u72B6\u6001\u5B58\u50A8\u4E0D\u652F\u6301\u5173\u6CE8\u3002":"The current state store does not support watching.","\u65E0\u6CD5\u89E3\u6790\u4F1A\u8BDD\uFF1A{message}":"Could not resolve the session: {message}","\u6BCF\u4E2A\u804A\u5929\u6700\u591A\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002":"Each chat can watch at most {count} sessions.","\u5173\u6CE8\u5217\u8868\u91CC\u6CA1\u6709\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /watchlist \u67E5\u770B\u3002":"This session is not in the watch list. Send /watchlist to view it.","\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u300C{title}\u300D\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u63A8\u9001\u7ED3\u679C\u3002":'Watching session "{title}"; results are pushed when the task completes.',"\u5173\u6CE8\u5931\u8D25\uFF1A{message}":"Could not watch: {message}","\u5DF2\u53D6\u6D88\u5173\u6CE8\u300C{title}\u300D\u3002":'Unwatched "{title}".',"\u53D6\u6D88\u5931\u8D25\uFF1A{message}":"Could not unwatch: {message}","\u98DE\u4E66\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the Feishu interaction question.","\u5F53\u524D\u4EFB\u52A1\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u5148\u505C\u6B62\u4EFB\u52A1\u6216\u7B49\u5F85\u4EFB\u52A1\u5B8C\u6210\u540E\u518D\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002":"The current task is still running. Stop it or wait for it to finish before starting a new session.","\u8BF7\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u518D\u63D0\u4EA4\u3002":"Enter an instruction before submitting.","\u64CD\u4F5C\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002":"Too many card actions are pending. Please try again shortly.","\u5361\u7247\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The card action failed. Please try again later.","\u8BF7\u5148\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u4F1A\u8BDD\u3002":"Select at least one session first.","\u5DF2\u6279\u91CF\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002":"Now watching {count} sessions.","\u5DF2\u6279\u91CF\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u53E6\u6709 {failed} \u4E2A\u672A\u6210\u529F\u3002":"Now watching {count} sessions; {failed} could not be processed.","\u5DF2\u5173\u6CE8\uFF08\u6216\u5DF2\u8FBE\u5173\u6CE8\u4E0A\u9650\uFF09\u3002":"Sessions are already watched, or the watch limit has been reached.","\u5DF2\u53D6\u6D88\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002":"Stopped watching {count} sessions.","\u5DF2\u53D6\u6D88\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u53E6\u6709 {failed} \u4E2A\u672A\u6210\u529F\u3002":"Stopped watching {count} sessions; {failed} could not be processed.","\u6240\u9009\u4F1A\u8BDD\u5747\u672A\u5904\u7406\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"None of the selected sessions could be processed. Please try again later.","\u6240\u9009\u4F1A\u8BDD\u5DF2\u5728\u5173\u6CE8\u5217\u8868\u4E2D\u3002":"The selected sessions are already being watched.","\u6240\u9009\u4F1A\u8BDD\u5DF2\u4E0D\u5728\u5173\u6CE8\u5217\u8868\u4E2D\u3002":"The selected sessions are no longer in the watch list.","\u672A\u53D6\u6D88\u4EFB\u4F55\u5173\u6CE8\u3002":"No watches were removed.","\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u4ECE\u4F1A\u8BDD\u5217\u8868\u9009\u62E9\u3002":"No session is currently bound. Select one from the session list first.","\u5DF2\u5C31\u7EEA\uFF0C\u76F4\u63A5\u53D1\u6D88\u606F\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Ready. Send a message to continue the current session.","\u4FEE\u590D\u9700\u5728\u79C1\u804A\u4E2D\u9A8C\u8BC1\u63A5\u5165\u8005\u8EAB\u4EFD\uFF0C\u8BF7\u76F4\u63A5\u53D1\u9001 /repair \u5F00\u59CB\u3002":"Repair must verify the owner in a direct chat. Send /repair there to begin.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u9884\u8BBE\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load the preset list. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u7CFB\u7EDF\u72B6\u6001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load system status. Please try again later.",\u8FDE\u63A5\u6B63\u5E38:"Connected","\u9884\u8BBE\uFF1A{preset}":"Preset: {preset}",\u672A\u77E5:"Unknown","/stop \u6267\u884C\u5B8C\u6210\u3002":"/stop completed.","\u505C\u6B62\u4EFB\u52A1\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not stop the task. Please try again later.","\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\u3002":"Instruction submitted.","\u9884\u8BBE\u91CD\u7F6E\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not reset the preset. Please try again later.","\u9884\u8BBE\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not switch the preset. Please try again later.","\u{1F916} \u52A9\u624B\u4E2D\u5FC3":"\u{1F916} Assistant center","**\u8BBE\u7F6E**":"**Settings**",\u5207\u6362\u4F1A\u8BDD:"Switch session","\u9009\u62E9\u4F1A\u8BDD\uFF08\u5F53\u524D\u672A\u7ED1\u5B9A\uFF09":"Select a session (none currently bound)",\u8DDF\u968F\u9ED8\u8BA4:"Follow default",\u5207\u6362\u9884\u8BBE:"Switch preset",\u5207\u6362\u6A21\u578B:"Switch model","\u5F53\u524D\u5DE5\u4F5C\u533A\u6682\u65E0\u53EF\u7528\u4F1A\u8BDD\u3002":"There are no available sessions in the current workspace.","\u{1F916} \u5207\u6362\u9884\u8BBE":"\u{1F916} Switch preset","\u{1F9E0} \u5207\u6362\u6A21\u578B":"\u{1F9E0} Switch model","\u{1F195} \u65B0\u4F1A\u8BDD":"\u{1F195} New session","\u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8":"\u{1F4CB} Sessions / watches","\u{1F5C2} \u5DE5\u4F5C\u533A\u5217\u8868":"\u{1F5C2} Workspace list","**\u4EFB\u52A1\u63A7\u5236**":"**Task controls**","\u23F9 \u505C\u6B62":"\u23F9 Stop","\u{1F4D0} \u538B\u7F29":"\u{1F4D0} Compact","**\u8865\u5145\u6307\u4EE4**":"**Steer task**",\u9009\u62E9\u8865\u5145\u6307\u4EE4:"Choose an instruction",\u7EE7\u7EED:"Continue",\u52A0\u901F\u8FD0\u884C:"Move faster",\u603B\u7ED3\u5F53\u524D\u8FDB\u5C55:"Summarize current progress",\u66F4\u7B80\u6D01\u4E9B:"Be more concise",\u66F4\u8BE6\u7EC6\u4E9B:"Be more detailed","\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026":"\u270F\uFE0F More / custom\u2026","\u{1F5C4} \u5F52\u6863\uFF1A{state}":"\u{1F5C4} Archived: {state}",\u5DF2\u663E\u793A:"shown",\u5DF2\u9690\u85CF:"hidden",\u5207\u6362\u5F52\u6863\u663E\u793A:"Toggle archived sessions","\u{1F4CA} \u72B6\u6001":"\u{1F4CA} Status","\u{1F4D6} \u5E2E\u52A9":"\u{1F4D6} Help","**\u6570\u5B57\u515C\u5E95**\n**1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD\u5217\u8868 \xB7 **4**\u72B6\u6001\n**5**\u{1F527}\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9":`**Number fallback** **1** Workspace list \xB7 **2** New session \xB7 **3** Session list \xB7 **4** Status -**5** \u{1F527} Complete permissions \xB7 **6** Help`,"\u8DDF\u968F Host \u9ED8\u8BA4{default}":"Follow Host default{default}","**\u5F53\u524D**\uFF1A{value}":"**Current**: {value}","**Host \u9ED8\u8BA4**\uFF1A{value}":"**Host default**: {value}",\u672A\u8BBE\u7F6E:"Not set",\u9009\u62E9\u9884\u8BBE:"Select a preset","\u{1F504} \u8DDF\u968F\u9ED8\u8BA4":"\u{1F504} Follow default","\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u9884\u8BBE\u3002":"There are no presets to choose from.","\u{1F916} \u9884\u8BBE\u5217\u8868":"\u{1F916} Preset list","**\u5F53\u524D\u6A21\u578B**\uFF1A{model}":"**Current model**: {model}",\u9009\u62E9\u6A21\u578B:"Select a model","\u{1F9E0} \u6A21\u578B\u5217\u8868":"\u{1F9E0} Model list","{icon} \u98DE\u4E66\u673A\u5668\u4EBA{state}":"{icon} Feishu bot {state}",\u5DF2\u8FDE\u63A5:"connected",\u672A\u8FDE\u63A5:"disconnected","\u{1F4C2} \u5DE5\u4F5C\u533A\uFF1A`{workspace}`":"\u{1F4C2} Workspace: `{workspace}`","\u{1F916} \u9884\u8BBE\uFF1A{preset}":"\u{1F916} Preset: {preset}","\u{1F9E0} \u6A21\u578B\uFF1A{model}":"\u{1F9E0} Model: {model}","\u{1F4AC} \u4F1A\u8BDD\uFF1A{count} \u4E2A":"\u{1F4AC} Sessions: {count}","\u{1F4CA} \u7CFB\u7EDF\u72B6\u6001":"\u{1F4CA} System status","\u{1F4CB} \u4F1A\u8BDD / \u5DE5\u4F5C\u533A":"\u{1F4CB} Sessions / workspace","/sessionlist \u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD":"/sessionlist List workspace sessions","/sessionlist \u6216 /sessions \u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD":"/sessionlist or /sessions List workspace sessions","/session ID \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD":"/session ID Bind an existing session","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A":"/workspacelist List workspaces","/workspace \u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace PATH Switch workspace","/new \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD":"/new Start a new session","\u{1F4CA} \u72B6\u6001 / \u538B\u7F29":"\u{1F4CA} Status / compact","/status \u8FDE\u63A5\u72B6\u6001":"/status Connection status","`/version` \u2014 \u67E5\u770B\u63D2\u4EF6\u7248\u672C":"`/version` \u2014 show the plugin version","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587":"/compact Compact the current session context","/archived on/off \u4F1A\u8BDD\u5217\u8868\u663E\u793A/\u9690\u85CF\u5F52\u6863":"/archived on/off Show/hide archived sessions","\u{1F441} \u5173\u6CE8":"\u{1F441} Watches","/watch ID \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09":"/watch ID Watch a session (push on completion)","/watchlist \u5173\u6CE8\u5217\u8868":"/watchlist List watched sessions","/unwatch ID \u53D6\u6D88\u5173\u6CE8":"/unwatch ID Stop watching a session","\u{1F4E6} \u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09":"\u{1F4E6} Batch input (direct messages only)","\u{1F916} \u9884\u8BBE / \u6A21\u578B":"\u{1F916} Presets / models","/models \u5217\u51FA\u6A21\u578B":"/models List models","/presetlist \u6216 /presets \u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist or /presets List available Agent Presets","\u{1F3AE} \u4EFB\u52A1\u63A7\u5236":"\u{1F3AE} Task controls","/steer \u6307\u4EE4 \u7ED9 Agent \u8865\u5145\u6307\u4EE4":"/steer INSTRUCTION Steer the Agent","**\u{1F4CB} \u5361\u7247\u529F\u80FD**\n\n1. \u4F1A\u8BDD\u4E0B\u62C9 \u2014 \u5207\u6362\u5F53\u524D\u7ED1\u5B9A\u4F1A\u8BDD\n2. \u5DE5\u4F5C\u533A\u4E0B\u62C9 \u2014 \u5207\u6362\u5DE5\u4F5C\u533A\n3. \u{1F916} \u9884\u8BBE\u4E0B\u62C9 \u2014 \u5207\u6362 Agent \u9884\u8BBE\n4. \u{1F9E0} \u6A21\u578B\u4E0B\u62C9 \u2014 \u5207\u6362\u6A21\u578B\n5. \u{1F195} \u65B0\u4F1A\u8BDD \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD\n6. \u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8 \u2014 \u67E5\u770B/\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u7BA1\u7406\u5173\u6CE8\n7. \u23F9 \u505C\u6B62 \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1\n8. \u{1F4D0} \u538B\u7F29 \u2014 \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587\n9. \u8865\u5145\u6307\u4EE4 \u2014 \u7ED9 Agent \u53D1\u9001\u6307\u4EE4\n10. \u{1F5C4} \u5F52\u6863\u5207\u6362 \u2014 \u663E\u793A/\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\n11. \u{1F4CA} \u72B6\u6001 \u2014 \u67E5\u770B\u7CFB\u7EDF\u8FDE\u63A5\u72B6\u6001\n12. \u{1F4D6} \u5E2E\u52A9 \u2014 \u67E5\u770B\u672C\u5E2E\u52A9":`**\u{1F4CB} Card features** +**5** \u{1F527} Complete permissions \xB7 **6** Help`,"\u8DDF\u968F Host \u9ED8\u8BA4{default}":"Follow Host default{default}","**\u5F53\u524D**\uFF1A{value}":"**Current**: {value}","**Host \u9ED8\u8BA4**\uFF1A{value}":"**Host default**: {value}",\u672A\u8BBE\u7F6E:"Not set",\u9009\u62E9\u9884\u8BBE:"Select a preset","\u{1F504} \u8DDF\u968F\u9ED8\u8BA4":"\u{1F504} Follow default","\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u9884\u8BBE\u3002":"There are no presets to choose from.","\u{1F916} \u9884\u8BBE\u5217\u8868":"\u{1F916} Preset list","**\u5F53\u524D\u6A21\u578B**\uFF1A{model}":"**Current model**: {model}",\u9009\u62E9\u6A21\u578B:"Select a model","\u{1F9E0} \u6A21\u578B\u5217\u8868":"\u{1F9E0} Model list","{icon} \u98DE\u4E66\u673A\u5668\u4EBA{state}":"{icon} Feishu bot {state}",\u5DF2\u8FDE\u63A5:"connected",\u672A\u8FDE\u63A5:"disconnected","\u{1F4C2} \u5DE5\u4F5C\u533A\uFF1A`{workspace}`":"\u{1F4C2} Workspace: `{workspace}`","\u{1F916} \u9884\u8BBE\uFF1A{preset}":"\u{1F916} Preset: {preset}","\u{1F9E0} \u6A21\u578B\uFF1A{model}":"\u{1F9E0} Model: {model}","\u{1F4AC} \u4F1A\u8BDD\uFF1A{count} \u4E2A":"\u{1F4AC} Sessions: {count}","\u{1F4CA} \u7CFB\u7EDF\u72B6\u6001":"\u{1F4CA} System status","\u{1F4CB} \u4F1A\u8BDD / \u5DE5\u4F5C\u533A":"\u{1F4CB} Sessions / workspace","/sessionlist \u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD":"/sessionlist List workspace sessions","/sessionlist \u6216 /sessions \u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD":"/sessionlist or /sessions List workspace sessions","/session ID \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD":"/session ID Bind an existing session","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A":"/workspacelist List workspaces","/new \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD":"/new Start a new session","\u{1F4CA} \u72B6\u6001 / \u538B\u7F29":"\u{1F4CA} Status / compact","/status \u8FDE\u63A5\u72B6\u6001":"/status Connection status","`/version` \u2014 \u67E5\u770B\u63D2\u4EF6\u7248\u672C":"`/version` \u2014 show the plugin version","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587":"/compact Compact the current session context","/archived on/off \u4F1A\u8BDD\u5217\u8868\u663E\u793A/\u9690\u85CF\u5F52\u6863":"/archived on/off Show/hide archived sessions","\u{1F441} \u5173\u6CE8":"\u{1F441} Watches","/watch ID \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09":"/watch ID Watch a session (push on completion)","/watchlist \u5173\u6CE8\u5217\u8868":"/watchlist List watched sessions","/unwatch ID \u53D6\u6D88\u5173\u6CE8":"/unwatch ID Stop watching a session","\u{1F4E6} \u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09":"\u{1F4E6} Batch input (direct messages only)","\u{1F916} \u9884\u8BBE / \u6A21\u578B":"\u{1F916} Presets / models","/models \u5217\u51FA\u6A21\u578B":"/models List models","/presetlist \u6216 /presets \u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist or /presets List available Agent Presets","\u{1F3AE} \u4EFB\u52A1\u63A7\u5236":"\u{1F3AE} Task controls","/steer \u6307\u4EE4 \u7ED9 Agent \u8865\u5145\u6307\u4EE4":"/steer INSTRUCTION Steer the Agent","**\u{1F4CB} \u5361\u7247\u529F\u80FD**\n\n1. \u4F1A\u8BDD\u4E0B\u62C9 \u2014 \u5207\u6362\u5F53\u524D\u7ED1\u5B9A\u4F1A\u8BDD\n2. \u5DE5\u4F5C\u533A\u4E0B\u62C9 \u2014 \u5207\u6362\u5DE5\u4F5C\u533A\n3. \u{1F916} \u9884\u8BBE\u4E0B\u62C9 \u2014 \u5207\u6362 Agent \u9884\u8BBE\n4. \u{1F9E0} \u6A21\u578B\u4E0B\u62C9 \u2014 \u5207\u6362\u6A21\u578B\n5. \u{1F195} \u65B0\u4F1A\u8BDD \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD\n6. \u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8 \u2014 \u67E5\u770B/\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u7BA1\u7406\u5173\u6CE8\n7. \u23F9 \u505C\u6B62 \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1\n8. \u{1F4D0} \u538B\u7F29 \u2014 \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587\n9. \u8865\u5145\u6307\u4EE4 \u2014 \u7ED9 Agent \u53D1\u9001\u6307\u4EE4\n10. \u{1F5C4} \u5F52\u6863\u5207\u6362 \u2014 \u663E\u793A/\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\n11. \u{1F4CA} \u72B6\u6001 \u2014 \u67E5\u770B\u7CFB\u7EDF\u8FDE\u63A5\u72B6\u6001\n12. \u{1F4D6} \u5E2E\u52A9 \u2014 \u67E5\u770B\u672C\u5E2E\u52A9":`**\u{1F4CB} Card features** 1. Session dropdown \u2014 switch the bound session 2. Workspace dropdown \u2014 switch workspace @@ -128,40 +128,40 @@ ID: {id}`,"\u7ED1\u5B9A\u5931\u8D25\uFF1A{message}":"Binding failed: {message}", 9. Steer task \u2014 send an instruction to the Agent 10. \u{1F5C4} Archived toggle \u2014 show or hide archived sessions 11. \u{1F4CA} Status \u2014 view connection status -12. \u{1F4D6} Help \u2014 view this help`,"**\u2328\uFE0F \u6587\u672C\u547D\u4EE4**\n\n`/m` \u2014 \u6253\u5F00\u83DC\u5355\u5361\u7247\n`/new` \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD\n`/session ID` \u2014 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD\n`/sessionlist [\u5DE5\u4F5C\u533A]` \u6216 `/sessions [\u5DE5\u4F5C\u533A]` \u2014 \u5217\u51FA\u4F1A\u8BDD\n`/workspace \u8DEF\u5F84` \u2014 \u5207\u6362\u5DE5\u4F5C\u533A\n`/workspacelist` \u2014 \u5217\u51FA\u5DE5\u4F5C\u533A\n`/status` \u2014 \u67E5\u770B\u8FDE\u63A5\u72B6\u6001\n`/compact` \u2014 \u538B\u7F29\u4E0A\u4E0B\u6587\n`/stop` \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1\n`/steer \u6307\u4EE4` \u2014 \u8865\u5145\u6307\u4EE4\n`/watch ID` \u2014 \u5173\u6CE8\u4F1A\u8BDD\n`/watchlist` \u2014 \u5173\u6CE8\u5217\u8868\n`/unwatch ID` \u2014 \u53D6\u6D88\u5173\u6CE8\n`/archived on/off` \u2014 \u5F52\u6863\u663E\u9690\n`/presetlist` \u6216 `/presets` \u2014 \u5217\u51FA\u9884\u8BBE\n`/preset [\u5E8F\u53F7/ID]` \u2014 \u5207\u6362\u9884\u8BBE\n`/preset --default` \u2014 \u8DDF\u968F\u9ED8\u8BA4\n`/models` \u2014 \u5217\u51FA\u6A21\u578B\n`/reasoninglist` \u6216 `/reasonings` \u2014 \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7\n`/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7\n`/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\n`/batch` \u2014 \u5F00\u542F\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09\n`/send` \u2014 \u63D0\u4EA4\u5F53\u524D\u6279\u6B21\n`/cancel` \u2014 \u53D6\u6D88\u5F53\u524D\u6279\u6B21\n`/repair` \u2014 \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03":"**\u2328\uFE0F Text commands**\n\n`/m` \u2014 open the menu card\n`/new` \u2014 start a new session\n`/session ID` \u2014 bind an existing session\n`/sessionlist [workspace]` or `/sessions [workspace]` \u2014 list sessions\n`/workspace PATH` \u2014 switch workspace\n`/workspacelist` \u2014 list workspaces\n`/status` \u2014 view connection status\n`/compact` \u2014 compact context\n`/stop` \u2014 stop the current task\n`/steer INSTRUCTION` \u2014 steer the task\n`/watch ID` \u2014 watch a session\n`/watchlist` \u2014 list watched sessions\n`/unwatch ID` \u2014 stop watching\n`/archived on/off` \u2014 show or hide archived sessions\n`/presetlist` or `/presets` \u2014 list presets\n`/preset [index/ID]` \u2014 switch preset\n`/preset --default` \u2014 follow default\n`/models` \u2014 list models\n`/reasoninglist` or `/reasonings` \u2014 list reasoning efforts for the current model\n`/reasoning [index, effort ID, or --default]` \u2014 show or switch reasoning effort\n`/model [index or full model ID] [reasoning effort ID]` \u2014 show or switch the current Session model\n`/batch` \u2014 start batch input (direct messages only, up to 10 text messages)\n`/send` \u2014 submit the current batch\n`/cancel` \u2014 cancel the current batch\n`/repair` \u2014 complete Feishu permissions and the card callback","**\u{1F4A1} \u6570\u5B57\u515C\u5E95**\n\u56DE\u590D\u6570\u5B57\u5FEB\u901F\u64CD\u4F5C\uFF1A\n**1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD/\u5173\u6CE8\n**4**\u72B6\u6001 \xB7 **5**\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9":`**\u{1F4A1} Number fallback** +12. \u{1F4D6} Help \u2014 view this help`,"**\u2328\uFE0F \u6587\u672C\u547D\u4EE4**\n\n`/m` \u2014 \u6253\u5F00\u83DC\u5355\u5361\u7247\n`/new` \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD\n`/session ID` \u2014 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD\n`/sessionlist [\u5DE5\u4F5C\u533A]` \u6216 `/sessions [\u5DE5\u4F5C\u533A]` \u2014 \u5217\u51FA\u4F1A\u8BDD\n`/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84` \u2014 \u5207\u6362\u5DE5\u4F5C\u533A\n`/workspacelist` \u2014 \u5217\u51FA\u5DE5\u4F5C\u533A\n`/status` \u2014 \u67E5\u770B\u8FDE\u63A5\u72B6\u6001\n`/compact` \u2014 \u538B\u7F29\u4E0A\u4E0B\u6587\n`/stop` \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1\n`/steer \u6307\u4EE4` \u2014 \u8865\u5145\u6307\u4EE4\n`/watch ID` \u2014 \u5173\u6CE8\u4F1A\u8BDD\n`/watchlist` \u2014 \u5173\u6CE8\u5217\u8868\n`/unwatch ID` \u2014 \u53D6\u6D88\u5173\u6CE8\n`/archived on/off` \u2014 \u5F52\u6863\u663E\u9690\n`/presetlist` \u6216 `/presets` \u2014 \u5217\u51FA\u9884\u8BBE\n`/preset [\u5E8F\u53F7/ID]` \u2014 \u5207\u6362\u9884\u8BBE\n`/preset --default` \u2014 \u8DDF\u968F\u9ED8\u8BA4\n`/models` \u2014 \u5217\u51FA\u6A21\u578B\n`/reasoninglist` \u6216 `/reasonings` \u2014 \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7\n`/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7\n`/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\n`/batch` \u2014 \u5F00\u542F\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09\n`/send` \u2014 \u63D0\u4EA4\u5F53\u524D\u6279\u6B21\n`/cancel` \u2014 \u53D6\u6D88\u5F53\u524D\u6279\u6B21\n`/repair` \u2014 \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03":"**\u2328\uFE0F Text commands**\n\n`/m` \u2014 open the menu card\n`/new` \u2014 start a new session\n`/session ID` \u2014 bind an existing session\n`/sessionlist [workspace]` or `/sessions [workspace]` \u2014 list sessions\n`/workspace ` \u2014 switch workspace\n`/workspacelist` \u2014 list workspaces\n`/status` \u2014 view connection status\n`/compact` \u2014 compact context\n`/stop` \u2014 stop the current task\n`/steer INSTRUCTION` \u2014 steer the task\n`/watch ID` \u2014 watch a session\n`/watchlist` \u2014 list watched sessions\n`/unwatch ID` \u2014 stop watching\n`/archived on/off` \u2014 show or hide archived sessions\n`/presetlist` or `/presets` \u2014 list presets\n`/preset [index/ID]` \u2014 switch preset\n`/preset --default` \u2014 follow default\n`/models` \u2014 list models\n`/reasoninglist` or `/reasonings` \u2014 list reasoning efforts for the current model\n`/reasoning [index, effort ID, or --default]` \u2014 show or switch reasoning effort\n`/model [index or full model ID] [reasoning effort ID]` \u2014 show or switch the current Session model\n`/batch` \u2014 start batch input (direct messages only, up to 10 text messages)\n`/send` \u2014 submit the current batch\n`/cancel` \u2014 cancel the current batch\n`/repair` \u2014 complete Feishu permissions and the card callback","**\u{1F4A1} \u6570\u5B57\u515C\u5E95**\n\u56DE\u590D\u6570\u5B57\u5FEB\u901F\u64CD\u4F5C\uFF1A\n**1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD/\u5173\u6CE8\n**4**\u72B6\u6001 \xB7 **5**\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9":`**\u{1F4A1} Number fallback** Reply with a number for a quick action: **1** Workspace list \xB7 **2** New session \xB7 **3** Sessions/watches **4** Status \xB7 **5** Complete permissions \xB7 **6** Help`,"\u4ECE\u4E0B\u65B9\u4E0B\u62C9\u9009\u62E9\u8865\u5145\u6307\u4EE4\uFF1B\u6700\u540E\u4E00\u9879\u53EF\u81EA\u5B9A\u4E49\u8F93\u5165\u3002":"Choose an instruction below; the last option lets you enter a custom one.","\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u518D\u8865\u5145\u6307\u4EE4\u3002":"No session is bound. Bind one before steering the task.","\u2795 \u8865\u5145\u6307\u4EE4":"\u2795 Steer task","\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u70B9\u300C\u63D0\u4EA4\u300D\uFF0C\u53D1\u9001\u7ED9\u5F53\u524D\u8FD0\u884C\u7684\u4EFB\u52A1\u3002":"Enter an instruction and press Submit to send it to the running task.",\u8F93\u5165\u4F60\u7684\u8865\u5145\u6307\u4EE4:"Enter your instruction",\u63D0\u4EA4:"Submit","\u2795 \u81EA\u5B9A\u4E49\u6307\u4EE4":"\u2795 Custom instruction","\u{1F916} \u52A9\u624B\u83DC\u5355":"\u{1F916} Assistant menu","**\u70B9\u51FB\u6309\u94AE\u6216\u76F4\u63A5\u56DE\u590D\u6570\u5B57**":"**Tap a button or reply with a number**","1 \xB7 \u4F1A\u8BDD\u5217\u8868":"1 \xB7 Sessions","2 \xB7 \u5DE5\u4F5C\u533A":"2 \xB7 Workspace","3 \xB7 \u65B0\u4F1A\u8BDD":"3 \xB7 New session","4 \xB7 \u72B6\u6001":"4 \xB7 Status","5 \xB7 \u5E2E\u52A9":"5 \xB7 Help","**6 \xB7 \u8865\u5168\u6743\u9650**\uFF08\u8BF7\u76F4\u63A5\u56DE\u590D\u6570\u5B57 **6**\uFF09":"**6 \xB7 Complete permissions** (reply with the number **6**)","7 \xB7 \u5173\u6CE8\u5217\u8868":"7 \xB7 Watch list","\u{1F9EA} \u9A8C\u8BC1\u5361\u7247\u6309\u94AE":"\u{1F9EA} Verify card buttons","\u6388\u6743\u5DF2\u63D0\u4EA4\u3002\u8BF7\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\uFF1B\u673A\u5668\u4EBA\u771F\u5B9E\u6536\u5230\u56DE\u8C03\u540E\u624D\u4F1A\u5224\u5B9A\u4FEE\u590D\u6210\u529F\u3002":"Authorization submitted. Tap the button below; the repair is confirmed only after the bot receives the real callback.",\u5B8C\u6210\u9A8C\u8BC1:"Finish verification","**\u5DE5\u4F5C\u533A**\uFF1A{workspace}\n\u5171 **{total}** \u4E2A\u4F1A\u8BDD{paging}":`**Workspace**: {workspace} **{total}** sessions in total{paging}`,"\uFF08\u7B2C {page}/{pageCount} \u9875\uFF09":" (page {page}/{pageCount})","\u2B50\u53D6\u5173":"\u2B50 Unwatch","\u2B50\u5173\u6CE8":"\u2B50 Watch","\u25C0 \u4E0A\u4E00\u9875":"\u25C0 Previous","\u4E0B\u4E00\u9875 \u25B6":"Next \u25B6","\u56DE\u590D\u6570\u5B57\uFF081~N\uFF09\u7ED1\u5B9A\u672C\u9875\u4F1A\u8BDD\u3002":"Reply with a number (1\u2013N) to bind a session on this page.","\u{1F4C2} \u4F1A\u8BDD\u5217\u8868":"\u{1F4C2} Session list","\u5F53\u524D Host \u4E0A\u6CA1\u6709\u5DF2\u767B\u8BB0\u7684\u5DE5\u4F5C\u533A\u3002":"No workspaces are registered on the current Host.","\u56DE\u590D\u6570\u5B57\u5207\u6362\u5DE5\u4F5C\u533A\uFF0C\u6216\u70B9\u51FB\u6309\u94AE\uFF1A":"Reply with a number to switch workspaces, or tap a button:","\u{1F5C2} \u5DE5\u4F5C\u533A":"\u{1F5C2} Workspace","\u{1F916} \u52A9\u624B\u83DC\u5355\uFF08\u56DE\u590D\u6570\u5B57\u5373\u53EF\uFF0C\u65E0\u9700\u8BB0\u547D\u4EE4\uFF09":"\u{1F916} Assistant menu (reply with a number \u2014 no need to memorize commands)","1 \xB7 /sessionlist \u5217\u51FA\u4F1A\u8BDD\uFF08\u56DE\u590D\u6570\u5B57\u7ED1\u5B9A\uFF09":"1 \xB7 /sessionlist List sessions (reply with a number to bind)","2 \xB7 /workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\uFF08\u56DE\u590D\u6570\u5B57\u5207\u6362\uFF09":"2 \xB7 /workspacelist List workspaces (reply with a number to switch)","3 \xB7 /new \u5F00\u542F\u65B0\u4F1A\u8BDD":"3 \xB7 /new Start a new session","4 \xB7 /status \u8FDE\u63A5\u72B6\u6001":"4 \xB7 /status Connection status","5 \xB7 /help \u672C\u5E2E\u52A9":"5 \xB7 /help This help","6 \xB7 /repair \u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\uFF08\u8BF7\u56DE\u590D\u6570\u5B57 6\uFF09":"6 \xB7 /repair Complete permissions and callback (reply with the number 6)","7 \xB7 /watchlist \u5173\u6CE8\u5217\u8868":"7 \xB7 /watchlist Watch list","\u76F4\u63A5\u53D1\u9001\u6587\u5B57/\u56FE\u7247\u5373\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text or an image directly to continue the current session.","/session ID \u6216\u5E8F\u53F7 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD":"/session ID or index Bind an existing session","/watch ID \u6216\u5E8F\u53F7 \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09":"/watch ID or index Watch a session (push when done)","/compact \u538B\u7F29\u4E0A\u4E0B\u6587":"/compact Compact the context","/workspace \u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace Switch workspace","/presetlist \u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist List available Agent Presets","\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\uFF0C\u56DE\u590D\u6570\u5B57\u6216\u70B9\u6309\u94AE\u53D6\u6D88\u5173\u6CE8\uFF1A":"Completion is pushed automatically. Reply with a number or tap a button to unwatch:","\u{1F441} \u5173\u6CE8\u5217\u8868":"\u{1F441} Watch list","\u2B50 \u53D6\u6D88\u5173\u6CE8":"\u2B50 Unwatch","\u2606 \u5173\u6CE8":"\u2606 Watch","\u{1F50D} \u5173\u6CE8\u5217\u8868":"\u{1F50D} Watch list",\u52FE\u9009\u8981\u5173\u6CE8\u7684\u4F1A\u8BDD:"Select sessions to watch",\u52FE\u9009\u8981\u53D6\u6D88\u5173\u6CE8\u7684\u4F1A\u8BDD:"Select sessions to unwatch","\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u7ED3\u679C\u3002":"No sessions are being watched. Results are pushed automatically when tasks complete.","\u5F53\u524D\u5173\u6CE8 **{count}** \u4E2A\u4F1A\u8BDD\uFF1A":"Currently watching **{count}** sessions:","**\u2795 \u6DFB\u52A0\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09":"**\u2795 Add watch** (select from the multi-select dropdown)","**\u2796 \u53D6\u6D88\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09":"**\u2796 Remove watch** (select from the multi-select dropdown)","\u{1F4CB} \u4F1A\u8BDD\u5217\u8868":"\u{1F4CB} Session list","\u{1F519} \u8FD4\u56DE\u83DC\u5355":"\u{1F519} Back to menu",\u5DF2\u5B8C\u6210:"Completed",\u5DF2\u505C\u6B62:"Stopped",\u5DF2\u4E2D\u6B62:"Aborted",\u5DF2\u53D6\u6D88:"Cancelled",\u5DF2\u7ED3\u675F:"Ended","\u2705 \u4EFB\u52A1\u5B8C\u6210":"\u2705 Task complete","**\u72B6\u6001**\uFF1A{reason}":"**Status**: {reason}",\u6253\u5F00\u4F1A\u8BDD\u5217\u8868:"Open session list",\u5DE5\u4F5C\u533A:"Workspace","\u7ED1\u5B9A\u8BE5\u4F1A\u8BDD\u540E\u53EF\u7EE7\u7EED\u8FFD\u95EE\uFF0C\u8F93\u5165\u6587\u5B57\u5373\u53EF\u3002":"After binding this session you can keep asking; just type a message.","\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\n`/watch ` \u5173\u6CE8\u540E\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u3002":"No sessions are being watched.\nWatch one with `/watch ` and completion is pushed automatically.","\u6B63\u5728\u751F\u6210\u2026":"Generating\u2026",\u56DE\u7B54\u5B8C\u6210:"Answer complete","\u5185\u5BB9\u8F83\u957F\uFF0C\u751F\u6210\u5B8C\u6210\u540E\u5C06\u5206\u6BB5\u53D1\u9001\u5B8C\u6574\u56DE\u7B54\u3002":"This response is long. The complete answer will be sent in parts when generation finishes.",\u98DE\u4E66\u673A\u5668\u4EBA:"Feishu bot","\u98DE\u4E66\u673A\u5668\u4EBA\u7F3A\u5C11\u56FE\u7247\u8BFB\u53D6\u6743\u9650 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u6309\u98DE\u4E66\u63D0\u793A\u53D1\u5E03\u65B0\u7248\u672C\u3001\u5B8C\u6210\u5FC5\u8981\u5BA1\u6279\u540E\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002":"The Feishu bot is missing the image-read scope im:message:readonly, shown by Feishu as \u201CRead direct and group messages.\u201D Run /repair in a direct chat with the bot, or click the \u201CComplete permissions\u201D button on the IM Bot settings page and scan the QR code. Publish a new version and complete any approval requested by Feishu, then resend the image.","\u2705 \u4FEE\u590D\u5B8C\u6210\uFF1A\u5DF2\u5B9E\u6D4B\u6536\u5230 card.action.trigger\uFF0C\u83DC\u5355\u6309\u94AE\u73B0\u5728\u53EF\u7528\u3002":"\u2705 Repair complete: card.action.trigger was received in a real test; the menu buttons now work.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u8D85\u65F6\uFF1A\u672A\u6536\u5230\u6D4B\u8BD5\u5361\u6309\u94AE\u7684 card.action.trigger\uFF0C\u4E0D\u80FD\u786E\u8BA4\u6309\u94AE\u5DF2\u4FEE\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u7684\u5361\u7247\u56DE\u8C03\u914D\u7F6E\uFF0C\u786E\u8BA4\u540E\u518D\u53D1\u9001 /repair\u3002":"\u26A0\uFE0F Repair verification timed out: no card.action.trigger from the test card button was received, so the buttons cannot be confirmed repaired. Do not authorize again; check the card-callback configuration in Feishu Open Platform first, then send /repair.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u5931\u8D25\uFF1A\u65E0\u6CD5\u53D1\u9001\u4E13\u7528\u6D4B\u8BD5\u5361\uFF0C\u4E0D\u80FD\u786E\u8BA4 card.action.trigger \u5DF2\u6062\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u673A\u5668\u4EBA\u6D88\u606F\u6743\u9650\u548C\u8FDE\u63A5\u72B6\u6001\u3002":"\u26A0\uFE0F Repair verification failed: the dedicated test card could not be sent, so card.action.trigger cannot be confirmed restored. Do not authorize again; check the bot message permission and connection status first.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u4E2D\u65AD\uFF1ARuntime \u5DF2\u505C\u6B62\uFF0C\u672A\u5B8C\u6210 card.action.trigger \u5B9E\u6D4B\uFF0C\u4E0D\u80FD\u786E\u8BA4\u4FEE\u590D\u6210\u529F\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u7B49\u5F85\u673A\u5668\u4EBA\u6062\u590D\u8FDE\u63A5\u3002":"\u26A0\uFE0F Repair verification interrupted: the Runtime stopped before the card.action.trigger test completed, so the repair cannot be confirmed. Do not authorize again; wait for the bot to reconnect."};var JK={"\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026":"Connected to DeepSeek Harness, thinking\u2026","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The DingTalk bot is connected to DeepSeek Harness.","\u9489\u9489\u672A\u80FD\u6362\u53D6\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u7684\u201C\u4F01\u4E1A\u5185\u673A\u5668\u4EBA\u53D1\u9001\u6D88\u606F\u6743\u9650\u201D\u3002":`DingTalk could not provide the image download address. Please resend; if it keeps failing, check the bot's "Send messages as an internal robot" permission.`,"\u9489\u9489\u6CA1\u6709\u8FD4\u56DE\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"DingTalk did not return an image download address. Please resend.","\u9489\u9489\u8FD4\u56DE\u7684\u56FE\u7247\u4E34\u65F6\u5730\u5740\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The temporary image address returned by DingTalk could not be read. Please resend.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002":'Delivery of the result file "{name}" could not be confirmed. Please check whether it already arrived in the chat before retrying.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u5E94\u7528\u6216\u673A\u5668\u4EBA\u7F3A\u5C11\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002\u8BF7\u5F00\u901A\u5E94\u7528 qyapi_base \u6743\u9650\uFF0C\u5E76\u786E\u8BA4\u673A\u5668\u4EBA\u5177\u5907\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u80FD\u529B\u3002":`Result file "{name}" was generated, but the DingTalk app or bot lacks file message permission. Enable the app's qyapi_base permission and make sure the bot can send file messages.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u9489\u9489\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'Result file "{name}" exceeds the file size limit of the current DingTalk bot and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u9489\u9489\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'Result file "{name}" was rate-limited by DingTalk and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\u548C\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u914D\u7F6E\u3002":`Result file "{name}" was generated, but DingTalk rejected the file message. Check the file type and the bot's file message configuration.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u9489\u9489\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'Result file "{name}" was generated but could not be sent via DingTalk right now. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002":"The result file has been generated.","\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The DingTalk bot is connected to DeepSeek Harness normally.","\u9489\u9489\u547D\u4EE4\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk command.","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002":"The DingTalk message has no safe reply address.","\u9489\u9489\u5BA1\u6279\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk approval.","\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk message.","\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002":"Invalid DingTalk message format.","\u9489\u9489\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the DingTalk interaction question.",\u9489\u9489\u7528\u6237:"DingTalk user",\u9489\u9489\u673A\u5668\u4EBA:"DingTalk bot",\u8EAB\u4EFD\u5DF2\u9690\u85CF:"Identity hidden","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The DingTalk bot credentials are missing. Remove the bot and scan the QR code again.","\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The DingTalk connection is not ready. Please try again later.","\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The DingTalk connection is still not ready. Please try again later.","\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002":"QR code setup has been cancelled.","\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not generate the DingTalk QR code. Please try again later.","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code has expired. Generate a new one.","\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"DingTalk is connected, but the message connection is not ready yet. Please try again later.","\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002":"DingTalk did not complete the bot authorization. Please scan the QR code again.","\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002":"The DingTalk authorization status is temporarily unavailable. Retrying.","\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"DingTalk authorization succeeded, but the configuration could not be saved safely.","\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002":"The DingTalk authorization query failed temporarily. Retrying.","\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09":"DingTalk bot ({clientId})","\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The DingTalk Stream message connection is running normally",\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The DingTalk message connection is currently offline"};var qK={"\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The Enterprise WeChat bot is connected to DeepSeek Harness.","\u5F53\u524D\u5F85\u5904\u7406\u56FE\u7247\u8F83\u591A\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u53D1\u9001\u3002":"Too many images are pending. Please send them again later.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA\u7F3A\u5C11\u7D20\u6750\u4E0A\u4F20\u6216\u6587\u4EF6\u6D88\u606F\u80FD\u529B\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6743\u9650\u3002":'The result file "{name}" was generated, but the Enterprise WeChat bot lacks media upload or file message capability. Please check the bot permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size this Enterprise WeChat bot can send and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u4F01\u4E1A\u5FAE\u4FE1\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty. Enterprise WeChat does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u4F01\u4E1A\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was rate-limited by Enterprise WeChat and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but Enterprise WeChat rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via Enterprise WeChat right now. Please try again later.',"\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u6587\u672C\u3002":"The task completed, but no displayable text was generated.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002":"Currently only text, images, and voice transcription messages are supported.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The connection between the Enterprise WeChat bot and DeepSeek Harness is working.","\u6B63\u5728\u601D\u8003\u4E2D\u2026":"Thinking\u2026","\u4F01\u4E1A\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the Enterprise WeChat interaction question.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The Enterprise WeChat bot credentials are missing. Please remove the bot and scan the QR code again.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The Enterprise WeChat connection is not ready. The plugin will retry automatically.","\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002":"QR code binding has been cancelled.","\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the Enterprise WeChat QR code. Please try again later.","\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The Enterprise WeChat QR code has expired. Please generate a new one.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The Enterprise WeChat bot is bound, but the message connection is not ready yet.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The Enterprise WeChat connection is still not ready. Please try again later.","\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The Enterprise WeChat QR scan was not completed. Please generate a new QR code.","\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The Enterprise WeChat QR service is temporarily unavailable. Please generate a new QR code.","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"Enterprise WeChat authorization succeeded, but the connection configuration could not be saved safely.",\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Enterprise WeChat bot","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{botId}\uFF09":"Enterprise WeChat bot ({botId})","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The Enterprise WeChat WebSocket long connection is running normally","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The Enterprise WeChat connection is not ready. The plugin will retry automatically",\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The Enterprise WeChat connection is currently offline"};var zK={"QQ \u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The QQ bot is connected to DeepSeek Harness.","\u56DE\u7B54\u8F83\u957F\uFF0C\u540E\u7EED\u5185\u5BB9\u672A\u80FD\u901A\u8FC7 QQ \u5B8C\u6574\u53D1\u9001\uFF0C\u8BF7\u56DE\u590D\u201C\u7EE7\u7EED\u201D\u3002":"The answer is long and the rest could not be sent fully through QQ. Reply \u201C\u7EE7\u7EED\u201D (continue) to receive it.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u4ECA\u65E5\u6587\u4EF6\u4E0A\u4F20\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":`The result file "{name}" was generated, but QQ's daily file upload quota is used up. Please try again later.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D QQ \u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002":'The result file "{name}" was generated, but the current QQ bot does not have file message permission.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D QQ \u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size the current QQ bot can send and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0CQQ \u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty, and QQ does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB QQ \u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by QQ and was not sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but QQ rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7 QQ \u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via QQ right now. Please try again later.',"QQ \u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The QQ bot is connected to DeepSeek Harness normally.","QQ \u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the QQ interaction question.","QQ \u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The QQ bot credentials are missing. Remove the bot and scan the QR code again.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The QQ QR service is temporarily unavailable. Please generate a new QR code.","\u65E0\u6CD5\u751F\u6210 QQ \u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the QQ QR code. Please try again later.","QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The QQ bot is bound, but the message connection is not ready yet.","QQ \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The QQ connection is still not ready. Please try again later.",QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The QQ bot is not connected yet","QQ \u673A\u5668\u4EBA\uFF08{appId}\uFF09":"QQ bot ({appId})",QQ\u673A\u5668\u4EBA:"QQ bot","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The QQ WebSocket long connection is running normally","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"QQ authorization succeeded, but the connection configuration could not be saved safely."};var VK={"\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"WeChat is connected to DeepSeek Harness.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002":`The result file "{name}" was generated, but the WeChat bot currently has no permission to send file messages. Please check the bot's file messaging capability.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size limit of the current WeChat conversation and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by WeChat and was not sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but WeChat rejected the file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via WeChat right now. Please try again later.',"\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002":"Currently supports text, images, and voice messages that WeChat has converted to text.","\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"WeChat is connected to DeepSeek Harness normally.","\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the WeChat interaction question.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u53D1\u9001\u5931\u8D25\uFF0C\u53EF\u80FD\u53EA\u6536\u5230\u90E8\u5206\u5185\u5BB9\u3002\u8BF7\u5C06\u4E0B\u9762\u7684\u8BCA\u65AD\u4FE1\u606F\u5B8C\u6574\u53CD\u9988\u7ED9\u7BA1\u7406\u5458\u3002":"The reply was generated, but WeChat delivery failed and only part of it may have arrived. Please send the complete diagnostic below to the administrator.","\u5FAE\u4FE1\u53D1\u9001\u8BCA\u65AD\uFF1A{diagnostic}":"WeChat delivery diagnostic: {diagnostic}","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Please check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Please check that the credential store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be written locally. Please check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Please check DSH_HOME and the workspace directories.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Please check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Please confirm dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u9700\u8981\u8EAB\u4EFD\u8BA4\u8BC1\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u3001\u7F51\u5173\u6216\u81EA\u5B9A\u4E49\u9274\u6743\u914D\u7F6E\u3002":"WeChat was authorized, but the Harness health check requires authentication. Please check proxy, gateway, or custom auth configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u672C\u673A Harness \u8BF7\u6C42\u88AB\u4EE3\u7406\u8981\u6C42\u8BA4\u8BC1\u3002\u8BF7\u8BA9\u56DE\u73AF\u5730\u5740\u7ED5\u8FC7\u4EE3\u7406\uFF0C\u5E76\u68C0\u67E5 NO_PROXY \u914D\u7F6E\u3002":"WeChat was authorized, but the local Harness request was challenged for proxy authentication. Please bypass the proxy for loopback addresses and check the NO_PROXY configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5F02\u5E38\u62D2\u7EDD\u4E86\u56DE\u73AF\u5730\u5740\u7684\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 HTTP \u4EE3\u7406\u3001Harness \u6E90\u7801\u7248\u672C\u548C\u6784\u5EFA\u4EA7\u7269\u3002":"WeChat was authorized, but Harness unexpectedly rejected the health check from a loopback address. Please check the HTTP proxy, Harness source version, and build artifacts.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u7684 Host \u4FE1\u4EFB\u68C0\u67E5\u62D2\u7EDD\u4E86\u975E\u56DE\u73AF\u5730\u5740\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5 harnessBaseUrl \u4E0E trustedHosts \u914D\u7F6E\u3002":"WeChat was authorized, but the Harness Host trust check rejected a non-loopback request. Please check the harnessBaseUrl and trustedHosts configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u5065\u5EB7\u68C0\u67E5\u6536\u5230\u4E86\u975E Harness \u6807\u51C6\u7684 403 \u62D2\u7EDD\u54CD\u5E94\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u6216\u7F51\u5173\u914D\u7F6E\u3002":"WeChat was authorized, but the health check received a non-standard Harness 403 rejection. Please check the proxy or gateway configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health check endpoint was not found. Please confirm the Harness and plugin versions are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a server error. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Please confirm the Harness and plugin versions are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health check request. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed with an unknown error. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection failed to initialize. Please check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Please check the dsh web logs.","\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002":"The login credential is missing. Please remove the account and scan the QR code again.","\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The WeChat connection is not ready; the plugin will retry automatically.","\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The WeChat connection is not ready; the plugin will retry automatically","\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the WeChat QR code. Please try again later.","\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The WeChat connection is still not ready. Please try again later.",\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeChat Bot","\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{name}\uFF09":"WeChat Bot ({name})",\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38:"WeChat message long-polling is running normally",\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The WeChat connection is currently offline","\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The pairing code was entered incorrectly too many times. Please generate a new QR code.","\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002":"This WeChat account is already bound, but no recoverable credential exists on this machine.","\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002":"WeChat authorization succeeded, but the returned account credential is incomplete.","\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002":"The WeChat login credential has expired. Please remove the account and scan the QR code again.","\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002":"The WeChat message sync request was rejected.","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002":"The encryption key of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u6570\u636E\u65E0\u6548\u3002":"The encrypted data of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u89E3\u5BC6\u5931\u8D25\u3002":"Failed to decrypt the WeChat image.","\u5FAE\u4FE1\u56FE\u7247\u6CA1\u6709\u53EF\u7528\u7684\u4E0B\u8F7D\u5730\u5740\u3002":"The WeChat image has no usable download URL.","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u65E0\u6548\u3002":"The download URL of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002":"The download URL of the WeChat image is not trusted.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002":"The WeChat service returned an invalid connection URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002":"The WeChat service returned an untrusted connection URL.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002":"The WeChat service did not return a QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002":"The WeChat service returned an invalid QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002":"The WeChat service returned an untrusted QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service returned an invalid file upload URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service returned an untrusted file upload URL.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service did not return a file upload URL.","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u88AB\u62D2\u7EDD\uFF08HTTP {status}\uFF09\u3002":"The WeChat file upload was rejected (HTTP {status}).","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF08HTTP {status}\uFF09\u3002":"The WeChat file upload failed (HTTP {status}).","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u7F3A\u5C11\u4E0B\u8F7D\u53C2\u6570\u3002":"The WeChat file upload response is missing the download parameter.","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002":"The WeChat file upload failed.","\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002":"Refusing to access an untrusted WeChat service URL.","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP {status}\uFF09\u3002":"The WeChat service request failed (HTTP {status}).","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002":"The WeChat service returned an unparseable response.","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002":"The WeChat service request timed out.","\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002":"The WeChat service is temporarily unreachable.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002":"The WeChat service returned an unrecognized QR-code status.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002":"The WeChat service did not return a QR-code token.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002":"The WeChat service rejected the reply message.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002":"The WeChat service rejected the file upload request.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002":"The WeChat service rejected the file message.","\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002":"Failed to start the WeChat account connection."};var WK={Slack\u673A\u5668\u4EBA:"Slack bot","Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002":"Slack bot credentials are missing. Remove the bot and connect it again.","Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The Slack Socket Mode connection is not ready yet. The plugin will retry automatically.","Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The Slack bot is connected, but the Socket Mode connection is not ready yet.","Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002":"The Slack Socket Mode connection is still not ready. Check both tokens.",Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The Slack bot is not connected yet","Slack Socket Mode \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The Slack Socket Mode long-lived connection is running normally","Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The Slack connection is not ready. The plugin will retry automatically",Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The Slack connection is currently offline","Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002":"Slack has not granted the bot access to this file. Add the files:read scope to the app, reinstall it, then send the image again.","Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002":"The Slack Bot Token must start with xoxb-.","Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002":"The Slack App Token must start with xapp-.","Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002":"The Slack Bot Token did not return a complete bot identity.","Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002":"The Slack App Token could not create a Socket Mode connection. Make sure Socket Mode and connections:write are enabled."};var ZK={\u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD:"Start a brand-new Session",\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587:"Compact the earlier context of the current Session",\u5207\u6362\u5DE5\u4F5C\u533A:"Switch Workspace",\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84:"List Workspace absolute paths","\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"List Session IDs and titles",\u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD:"Bind the current chat to a specific Session",\u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B:"List all available models by number",\u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B:"View or switch the model of the current Session","\u5217\u51FA\u53EF\u7528 Agent Preset":"List available Agent Presets","\u67E5\u770B\u6216\u8BBE\u7F6E\u65B0\u4F1A\u8BDD Agent Preset":"View or set the Agent Preset for new Sessions",\u505C\u6B62\u5F53\u524D\u4EFB\u52A1:"Stop the current task",\u7EA0\u504F\u5F53\u524D\u4EFB\u52A1:"Steer the current task",\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001:"Check connection status",\u67E5\u770B\u63D2\u4EF6\u7248\u672C:"Show plugin version",\u663E\u793A\u5E2E\u52A9:"Show help","\u8BE5 Telegram \u673A\u5668\u4EBA\u5DF2\u914D\u7F6E Webhook\uFF0C\u8BF7\u5148\u5728\u539F\u670D\u52A1\u4E2D\u79FB\u9664 Webhook \u540E\u91CD\u8BD5\u3002":"This Telegram bot already has a Webhook configured. Remove the Webhook from the original service and try again.",Telegram\u673A\u5668\u4EBA:"Telegram Bot"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling"};var XK={"Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002":"The Discord Bot Token is invalid. Please enter it again.","Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002":"The Discord Gateway Intents are misconfigured. Please check the Bot settings in the Developer Portal.",Discord\u673A\u5668\u4EBA:"Discord Bot"," Gateway \u957F\u8FDE\u63A5":" Gateway long-lived connection"};var $K={"WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The WhatsApp linked device is no longer valid. Remove it and scan the QR code again.","WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The WhatsApp connection is not ready yet; the plugin will retry automatically.","WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The WhatsApp connection is still not ready. Please try again later.",WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The WhatsApp bot is not connected yet",WhatsApp\u673A\u5668\u4EBA:"WhatsApp bot","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"The WhatsApp Web linked device is working normally","WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA":"The WhatsApp connection is not ready","WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The WhatsApp connection is currently offline","WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"WhatsApp is linked, but the messaging connection is not ready yet.","WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002":"The QR code was scanned, but the linked device could not be saved.","\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"Unable to connect to WhatsApp. Please generate a new QR code.",WhatsApp\u8D26\u53F7:"WhatsApp account"," Web \u5173\u8054\u8BBE\u5907":" Web linked device"};var ex={"AI Office \u62D2\u7EDD\u4E86 Device Token\u3002":"AI Office rejected the Device Token.","AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002":"The AI Office Connector Hook is not ready yet.","AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002":"The AI Office Connector protocol version is incompatible.","\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002":"This machine cannot reach AI Office right now.","AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002":"The AI Office connection was interrupted.","\u672C\u673A Harness \u5DF2\u505C\u6B62\u8FD9\u6B21\u6267\u884C\u3002":"The local Harness stopped this run.","Office Job \u5DF2\u88AB\u9886\u53D6\u3001\u53D6\u6D88\u6216\u7ED3\u675F\u3002":"The Office Job has already been claimed, cancelled, or finished.","\u672C\u673A Harness \u672A\u80FD\u5B8C\u6210\u4EFB\u52A1\uFF1B\u8BF7\u68C0\u67E5 Harness \u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002":"The local Harness could not complete the task; check the Harness Session and try again.","Office Job \u5F15\u7528\u4E86\u672C\u673A\u672A\u914D\u7F6E\u7684 Workspace/Preset alias\u3002":"The Office Job references a Workspace/Preset alias that is not configured locally.","\u4F60\u6B63\u5728\u672C\u673A DeepSeek Harness \u4E2D\u7EE7\u7EED\u4E00\u4E2A\u6765\u81EA AI Office \u7684\u4EFB\u52A1\u3002":"You are continuing an AI Office task inside the local DeepSeek Harness.","\u53EA\u5728\u5F53\u524D Workspace \u5185\u884C\u52A8\u3002\u5B8C\u6210\u540E\u5FC5\u987B\u8FD4\u56DE\uFF1A\u7ED3\u679C\u6458\u8981\u3001\u6539\u52A8\u6587\u4EF6\u3001\u9A8C\u8BC1\u8BC1\u636E\u3001\u672A\u89E3\u51B3\u98CE\u9669\u3002":"Act only within the current Workspace. When finished you must return: a result summary, changed files, verification evidence, and unresolved risks.","## \u672C\u673A Instruction Preset":"## Local Instruction Preset","## \u672C\u8F6E\u8865\u5145\u6307\u4EE4":"## Additional Instructions for This Round","## Office \u65F6\u95F4\u7EBF":"## Office Timeline","\u6279\u51C6 {tool}":"Approve {tool}","Harness \u5DE5\u5177":"Harness tool","Harness \u9700\u8981 {count} \u9879\u8865\u5145\u4FE1\u606F":"Harness needs {count} pieces of additional information","\u5DF2\u9886\u53D6 Job\uFF0C\u51C6\u5907 Workspace alias\uFF1A{alias}":"Job claimed; preparing Workspace alias: {alias}","Harness Session \u5DF2\u521B\u5EFA\u3002":"Harness Session created.","\u6B63\u5728\u4F7F\u7528 {tool}\u2026":"Using {tool}\u2026"};var Ax=Object.freeze(Object.assign({},KK,xK,YK,jK,JK,qK,zK,VK,WK,ZK,XK,$K,ex));var tx="zh";function rx(n){let t=typeof n=="string"?n.trim().toLowerCase():"";tx=t==="english"||/^en(?:[-_].*)?$/u.test(t)?"en":"zh"}function w(n,t){if(typeof n!="string")return n;let o=tx==="en"?Ax[n]??n:n;return t==null?o:o.replace(/\{(\w+)\}/g,(i,e)=>Object.hasOwn(t,e)?String(t[e]):i)}var LM=Object.freeze({version:1,bots:Object.freeze([])}),cle=new Set(["clientId","secretRef","approvedSenders"]);function dn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Ile(n){return ale("sha256").update(n).digest("hex")}function ox(n){let t=dn(n);return t&&/^dt_[a-f0-9]{24}$/.test(t)?t:null}function lle(n){let t=dn(n);return t&&/^DSH_DINGTALK_BOT_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function ple(n){let t=dn(n);return t&&/^dt_sender_[a-f0-9]{32}$/.test(t)?t:null}function dle(n){let t=typeof n=="string"?{staffId:n}:n;if(!t||typeof t!="object"||Array.isArray(t))return null;let o=ple(t.senderKey),i=dn(t.staffId);return!o||!i?null:Object.freeze({senderKey:o,staffId:i,displayName:dn(t.displayName),approvedAt:dn(t.approvedAt)})}function hle(n){if(!Array.isArray(n))return null;let t=n.map(dle);if(t.some(e=>e===null))return null;let o=new Set,i=new Set;for(let e of t){if(o.has(e.staffId)||i.has(e.senderKey))return null;o.add(e.staffId),i.add(e.senderKey)}return Object.freeze(t)}function dQ(n){let t=dn(n);if(!t)throw new TypeError("clientId is required");let o=Ile(t).slice(0,24);return Object.freeze({botId:`dt_${o}`,secretRef:`DSH_DINGTALK_BOT_SECRET_${o.toUpperCase()}`})}function nx(){return`dt_sender_${ix().replaceAll("-","")}`}function UM(n){return dn(n)?w("\u8EAB\u4EFD\u5DF2\u9690\u85CF"):w("\u9489\u9489\u7528\u6237")}function HM(n){let t=dn(n);return t?t.length<=8?`${t.slice(0,2)}\u2022\u2022\u2022\u2022`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("\u9489\u9489\u673A\u5668\u4EBA")}function sx(n,{stored:t=!1}={}){if(!n||typeof n!="object"||Array.isArray(n)||"clientSecret"in n||"client_secret"in n||"deviceCode"in n||t&&Object.keys(n).some(r=>!cle.has(r)))return null;let o=dn(n.clientId),i=lle(n.secretRef),e=hle(n.approvedSenders??[]);if(!o||!i||!e)return null;let a=dQ(o);return a.secretRef!==i||(n.botId===void 0?a.botId:ox(n.botId))!==a.botId?null:Object.freeze({botId:a.botId,clientId:o,secretRef:i,approvedSenders:e})}function Ele(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(a=>sx(a,{stored:!0}));if(t.some(a=>a===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.clientId)||e.has(a.secretRef))return null;o.add(a.botId),i.add(a.clientId),e.add(a.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}function Cle(n){return{version:1,bots:n.bots.map(t=>({clientId:t.clientId,secretRef:t.secretRef,approvedSenders:t.approvedSenders.map(o=>({senderKey:o.senderKey,staffId:o.staffId,displayName:o.displayName,approvedAt:o.approvedAt}))}))}}var pQ=class{#e;#A=LM;#t=Promise.resolve();constructor(t){if(!dn(t))throw new TypeError("config path is required");this.#e=t}async load(){try{let t=Ele(JSON.parse(await ole(this.#e,"utf8")));if(!t)throw new Error("dsh-dingtalk config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=LM}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByClientId(t){let o=this.#A.bots.find(i=>i.clientId===t);return o?structuredClone(o):null}async save(t){let o=sx(t);if(!o)throw new Error("Refusing to persist invalid dsh-dingtalk bot data");return this.#r(i=>{if(i.find(A=>(A.clientId===o.clientId||A.secretRef===o.secretRef)&&A.botId!==o.botId))throw new Error("Duplicate DingTalk bot identity");let a=i.findIndex(A=>A.botId===o.botId);return a===-1?i.push(o):i[a]=o,structuredClone(o)})}async remove(t){if(!ox(t))throw new TypeError("Invalid DingTalk bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await ax(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=LM});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#l(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#l(t){await ile(gle(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.${process.pid}.${ix()}.tmp`;try{await sle(o,`${JSON.stringify(Cle(t),null,2)} -`,{encoding:"utf8",flag:"wx",mode:384}),await nle(o,this.#e)}catch(i){try{await ax(o)}catch(e){if(e?.code!=="ENOENT")throw new AggregateError([i,e])}throw i}}};var cx="https://oapi.dingtalk.com",ule="DING_DWS_CLAW";function hn(n){return typeof n=="string"&&n.trim()?n.trim():null}function gx(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function Ble(n){let t;try{t=new URL(hn(n)??cx)}catch{throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL")}let o=t.hostname==="dingtalk.com"||t.hostname.endsWith(".dingtalk.com");if(t.protocol!=="https:"||t.port||!o||t.username||t.password||t.search||t.hash)throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL");return t.pathname=t.pathname.replace(/\/+$/,""),t.href.replace(/\/$/,"")}function fle(n){let t=typeof n?.now=="function"?n.now():n();if(!Number.isFinite(t))throw new TypeError("clock must return a finite timestamp");return t}function Qle(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new Zn("invalid-response",`DingTalk ${t} returned an invalid response`,t);if(Number(n.errcode)!==0)throw new Zn("api-error",`DingTalk ${t} request was rejected`,t);return n}var Zn=class extends Error{constructor(t,o,i,e={}){super(o,e),this.name="DingtalkDeviceAuthError",this.code=t,this.action=i}},hQ=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=Date,baseUrl:i=cx,timeoutMs:e=15e3}={}){if(typeof t!="function")throw new TypeError("fetch is required");if(typeof o!="function"&&typeof o?.now!="function")throw new TypeError("clock must be a function or expose now()");if(!Number.isFinite(e)||e<=0)throw new TypeError("timeoutMs must be a positive number");this.#e=t,this.#A=o,this.#t=Ble(i),this.#r=e}async start({signal:t}={}){let o=await this.#l("/app/registration/init",{source:ule},"initialization",t),i=hn(o.nonce);if(!i)throw new Zn("missing-nonce","DingTalk registration initialization did not return a nonce","initialization");let e=await this.#l("/app/registration/begin",{nonce:i},"begin",t),a=hn(e.device_code),A=hn(e.verification_uri_complete);if(!a||!A)throw new Zn("incomplete-registration","DingTalk registration did not return complete QR metadata","begin");let r=gx(e.expires_in,7200),s=gx(e.interval,5)*1e3;return Object.freeze({deviceCode:a,verificationUrl:A,verificationUri:hn(e.verification_uri),userCode:hn(e.user_code),expiresAt:fle(this.#A)+r*1e3,pollIntervalMs:s})}async poll(t){let o=hn(typeof t=="string"?t:t?.deviceCode),i=typeof t=="object"?t?.signal:void 0;if(!o)throw new TypeError("deviceCode is required");let e=await this.#l("/app/registration/poll",{device_code:o},"poll",i),a=hn(e.status)?.toUpperCase(),A=["WAITING","SUCCESS","FAIL","EXPIRED"].includes(a)?a:"UNKNOWN";return Object.freeze({status:A,clientId:hn(e.client_id),clientSecret:hn(e.client_secret),failReason:hn(e.fail_reason)})}async#l(t,o,i,e){let a,A=AbortSignal.timeout(this.#r),r=e?AbortSignal.any([e,A]):A;try{a=await this.#e(`${this.#t}${t}`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o),redirect:"error",signal:r})}catch(g){throw e?.aborted?e.reason??g:A.aborted?new Zn("timeout",`DingTalk ${i} request timed out`,i,{cause:g}):g?.name==="AbortError"?g:new Zn("network-error",`DingTalk ${i} request could not be completed`,i,{cause:g})}if(!a||a.ok===!1||typeof a.json!="function")throw new Zn("http-error",`DingTalk ${i} request failed`,i);let s;try{s=await a.json()}catch(g){throw new Zn("invalid-json",`DingTalk ${i} returned invalid JSON`,i,{cause:g})}return Qle(s,i)}};import{randomUUID as Tle}from"node:crypto";var Ix=new WeakMap,KM=Symbol("dsh-im.connection-test-state-identity");function lx(n){return n?.[KM]??n}function yle(n){return typeof n=="string"&&n.trim()?n.trim():null}function So(n,t){if(!n||!t||typeof t!="object")return!1;try{return Ix.set(lx(n),structuredClone(t)),!0}catch{return!1}}function kE(n){let t=n?Ix.get(lx(n)):null;return t?structuredClone(t):null}function Ra(n,t=w("\u673A\u5668\u4EBA")){let o=yle(n)??t;return`${w("\u2705 DeepSeek Harness \u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F")} -${w("\u8FD9\u6761\u6D88\u606F\u7531\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002",{name:o})}`}function Cr(n=w("\u673A\u5668\u4EBA")){let t=new Error(w("{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002",{channelLabel:n}));return t.code="test-target-unavailable",t}async function nc({state:n,send:t,text:o,channelLabel:i}){let e=kE(n);if(!e)throw Cr(i);return await t(e,o),{sent:!0}}function or(n){return Object.freeze(n?{sent:!1,code:n?.code==="test-target-unavailable"?"test-target-unavailable":"test-message-failed"}:{sent:!0})}import{randomUUID as mle}from"node:crypto";var Sle=Object.freeze({AUTH:"MODEL_AUTH",MISSING_CREDENTIAL:"MODEL_AUTH",INVALID_CREDENTIAL:"MODEL_AUTH",QUOTA:"MODEL_QUOTA",RATE_LIMIT:"MODEL_RATE_LIMIT",CONTEXT_WINDOW_EXCEEDED:"MODEL_CONTEXT_LIMIT",UNKNOWN_MODEL:"MODEL_UNAVAILABLE",NO_ADAPTER:"MODEL_UNAVAILABLE",UNSUPPORTED_OPTION:"MODEL_CONFIG",UNSUPPORTED_REASONING_EFFORT:"MODEL_CONFIG",TIMEOUT:"MODEL_TIMEOUT",TRANSPORT:"MODEL_TRANSPORT",SERVER:"MODEL_SERVICE",STREAM_CLOSED:"MODEL_STREAM",MALFORMED_RESPONSE:"MODEL_STREAM",EMPTY_RESPONSE:"MODEL_EMPTY_REPLY",CONTENT_FILTER:"MODEL_CONTENT_REJECTED",UNSUPPORTED_CONTENT:"MODEL_CONFIG"}),wle=Object.freeze({HARNESS_CONNECT:"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002",HARNESS_TIMEOUT:"\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",HARNESS_RESULT_UNCERTAIN:"\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",HARNESS_ACCESS:"\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",HARNESS_PROTOCOL:"\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002",HARNESS_SERVICE:"DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_REPLY_TIMEOUT:"\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",MODEL_AUTH:"\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",MODEL_QUOTA:"\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",MODEL_RATE_LIMIT:"\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_CONTEXT_LIMIT:"\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002",MODEL_UNAVAILABLE:"\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002",MODEL_CONFIG:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002",MODEL_TIMEOUT:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_TRANSPORT:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_SERVICE:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_STREAM:"\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",MODEL_EMPTY_REPLY:"\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",MODEL_CONTENT_REJECTED:"\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",MODEL_OUTPUT_LIMIT:"\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002",TURN_BLOCKED:"\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002",TURN_INTERRUPTED:"\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",SESSION_NOT_FOUND:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",SESSION_BUSY:"\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002",SESSION_STALE:"\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002",WORKSPACE_UNAVAILABLE:"\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002",PRESET_UNAVAILABLE:"\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002",CHANNEL_PERMISSION:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002",CHANNEL_RATE_LIMIT:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",CHANNEL_DELIVERY_UNCERTAIN:"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",CHANNEL_DELIVERY:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",INPUT_INVALID:"\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002",INTERNAL_UNKNOWN:"\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002"});function Dle(n){if(n?.code!=="harness-turn-failed")return null;let t=n?.providerCode??n?.details?.providerCode;return typeof t!="string"?null:Sle[t.trim().toUpperCase()]??null}function Ole(n){let t=typeof n?.code=="string"?n.code:"",o=Dle(n);if(o)return o;if(t==="harness-connect-failed")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_CONNECT";if(t==="harness-timeout")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_TIMEOUT";if(t==="harness-reply-timeout")return"MODEL_REPLY_TIMEOUT";if(["harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden"].includes(t))return"HARNESS_ACCESS";if(["harness-api-not-found","harness-response-invalid"].includes(t))return"HARNESS_PROTOCOL";if(t==="harness-turn-failed")return"INTERNAL_UNKNOWN";if(["harness-http-failed","harness-rpc-rejected"].includes(t))return"HARNESS_SERVICE";if(t==="model-empty-response")return"MODEL_EMPTY_REPLY";if(t==="model-max-tokens")return"MODEL_OUTPUT_LIMIT";if(t==="turn-blocked")return"TURN_BLOCKED";if(["turn-interrupted","turn-aborted"].includes(t))return"TURN_INTERRUPTED";if(t==="session-not-found")return"SESSION_NOT_FOUND";if(t==="agent-busy")return"SESSION_BUSY";if(t==="workspace-session-stale")return"SESSION_STALE";if(t.startsWith("workspace-"))return"WORKSPACE_UNAVAILABLE";if(t.startsWith("agent-preset-"))return"PRESET_UNAVAILABLE";if(t.startsWith("image-")||t.startsWith("inbound-file-")||t==="attachment-error")return"INPUT_INVALID";let i=Number(n?.status??n?.httpStatus);return i===401||i===403||["channel-permission","permission-required","artifact-permission-required","forbidden","stale-token"].includes(t)?"CHANNEL_PERMISSION":i===429||["channel-rate-limit","rate-limited","artifact-rate-limited"].includes(t)?"CHANNEL_RATE_LIMIT":["channel-delivery-uncertain","delivery-uncertain","artifact-delivery-uncertain"].includes(t)?"CHANNEL_DELIVERY_UNCERTAIN":t==="channel-delivery-failed"||t.startsWith("artifact-")||["network-error","timeout"].includes(t)?"CHANNEL_DELIVERY":"INTERNAL_UNKNOWN"}function ble(n){return typeof n=="string"&&/^[A-Z0-9-]{6,40}$/u.test(n)?n:`MF-${mle().slice(0,8).toUpperCase()}`}function Mle(n){return typeof n!="string"||!/^[A-Za-z0-9_-]{1,64}$/u.test(n)?null:n.toUpperCase().replaceAll("-","_")}function _le(n,{userMessage:t,reason:o,referenceId:i,at:e=Date.now()}={}){let a=Mle(o),A=Ole(n),r=A==="INTERNAL_UNKNOWN"&&a&&typeof t=="string"&&t.trim()?"INPUT_INVALID":A;return Object.freeze({code:r,reason:a??r,message:typeof t=="string"&&t.trim()?t.trim():w(wle[r]),referenceId:ble(i),at:Number.isFinite(e)?e:Date.now()})}function dt(n){return`${n.message} +`,{encoding:"utf8",flag:"wx",mode:384}),await nle(o,this.#e)}catch(i){try{await ax(o)}catch(e){if(e?.code!=="ENOENT")throw new AggregateError([i,e])}throw i}}};var cx="https://oapi.dingtalk.com",ule="DING_DWS_CLAW";function hn(n){return typeof n=="string"&&n.trim()?n.trim():null}function gx(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function Ble(n){let t;try{t=new URL(hn(n)??cx)}catch{throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL")}let o=t.hostname==="dingtalk.com"||t.hostname.endsWith(".dingtalk.com");if(t.protocol!=="https:"||t.port||!o||t.username||t.password||t.search||t.hash)throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL");return t.pathname=t.pathname.replace(/\/+$/,""),t.href.replace(/\/$/,"")}function fle(n){let t=typeof n?.now=="function"?n.now():n();if(!Number.isFinite(t))throw new TypeError("clock must return a finite timestamp");return t}function Qle(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new Zn("invalid-response",`DingTalk ${t} returned an invalid response`,t);if(Number(n.errcode)!==0)throw new Zn("api-error",`DingTalk ${t} request was rejected`,t);return n}var Zn=class extends Error{constructor(t,o,i,e={}){super(o,e),this.name="DingtalkDeviceAuthError",this.code=t,this.action=i}},hQ=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=Date,baseUrl:i=cx,timeoutMs:e=15e3}={}){if(typeof t!="function")throw new TypeError("fetch is required");if(typeof o!="function"&&typeof o?.now!="function")throw new TypeError("clock must be a function or expose now()");if(!Number.isFinite(e)||e<=0)throw new TypeError("timeoutMs must be a positive number");this.#e=t,this.#A=o,this.#t=Ble(i),this.#r=e}async start({signal:t}={}){let o=await this.#l("/app/registration/init",{source:ule},"initialization",t),i=hn(o.nonce);if(!i)throw new Zn("missing-nonce","DingTalk registration initialization did not return a nonce","initialization");let e=await this.#l("/app/registration/begin",{nonce:i},"begin",t),a=hn(e.device_code),A=hn(e.verification_uri_complete);if(!a||!A)throw new Zn("incomplete-registration","DingTalk registration did not return complete QR metadata","begin");let r=gx(e.expires_in,7200),s=gx(e.interval,5)*1e3;return Object.freeze({deviceCode:a,verificationUrl:A,verificationUri:hn(e.verification_uri),userCode:hn(e.user_code),expiresAt:fle(this.#A)+r*1e3,pollIntervalMs:s})}async poll(t){let o=hn(typeof t=="string"?t:t?.deviceCode),i=typeof t=="object"?t?.signal:void 0;if(!o)throw new TypeError("deviceCode is required");let e=await this.#l("/app/registration/poll",{device_code:o},"poll",i),a=hn(e.status)?.toUpperCase(),A=["WAITING","SUCCESS","FAIL","EXPIRED"].includes(a)?a:"UNKNOWN";return Object.freeze({status:A,clientId:hn(e.client_id),clientSecret:hn(e.client_secret),failReason:hn(e.fail_reason)})}async#l(t,o,i,e){let a,A=AbortSignal.timeout(this.#r),r=e?AbortSignal.any([e,A]):A;try{a=await this.#e(`${this.#t}${t}`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o),redirect:"error",signal:r})}catch(g){throw e?.aborted?e.reason??g:A.aborted?new Zn("timeout",`DingTalk ${i} request timed out`,i,{cause:g}):g?.name==="AbortError"?g:new Zn("network-error",`DingTalk ${i} request could not be completed`,i,{cause:g})}if(!a||a.ok===!1||typeof a.json!="function")throw new Zn("http-error",`DingTalk ${i} request failed`,i);let s;try{s=await a.json()}catch(g){throw new Zn("invalid-json",`DingTalk ${i} returned invalid JSON`,i,{cause:g})}return Qle(s,i)}};import{randomUUID as Tle}from"node:crypto";var Ix=new WeakMap,KM=Symbol("dsh-im.connection-test-state-identity");function lx(n){return n?.[KM]??n}function yle(n){return typeof n=="string"&&n.trim()?n.trim():null}function So(n,t){if(!n||!t||typeof t!="object")return!1;try{return Ix.set(lx(n),structuredClone(t)),!0}catch{return!1}}function vE(n){let t=n?Ix.get(lx(n)):null;return t?structuredClone(t):null}function Ra(n,t=w("\u673A\u5668\u4EBA")){let o=yle(n)??t;return`${w("\u2705 DeepSeek Harness \u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F")} +${w("\u8FD9\u6761\u6D88\u606F\u7531\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002",{name:o})}`}function Cr(n=w("\u673A\u5668\u4EBA")){let t=new Error(w("{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002",{channelLabel:n}));return t.code="test-target-unavailable",t}async function nc({state:n,send:t,text:o,channelLabel:i}){let e=vE(n);if(!e)throw Cr(i);return await t(e,o),{sent:!0}}function or(n){return Object.freeze(n?{sent:!1,code:n?.code==="test-target-unavailable"?"test-target-unavailable":"test-message-failed"}:{sent:!0})}import{randomUUID as mle}from"node:crypto";var Sle=Object.freeze({AUTH:"MODEL_AUTH",MISSING_CREDENTIAL:"MODEL_AUTH",INVALID_CREDENTIAL:"MODEL_AUTH",QUOTA:"MODEL_QUOTA",RATE_LIMIT:"MODEL_RATE_LIMIT",CONTEXT_WINDOW_EXCEEDED:"MODEL_CONTEXT_LIMIT",UNKNOWN_MODEL:"MODEL_UNAVAILABLE",NO_ADAPTER:"MODEL_UNAVAILABLE",UNSUPPORTED_OPTION:"MODEL_CONFIG",UNSUPPORTED_REASONING_EFFORT:"MODEL_CONFIG",TIMEOUT:"MODEL_TIMEOUT",TRANSPORT:"MODEL_TRANSPORT",SERVER:"MODEL_SERVICE",STREAM_CLOSED:"MODEL_STREAM",MALFORMED_RESPONSE:"MODEL_STREAM",EMPTY_RESPONSE:"MODEL_EMPTY_REPLY",CONTENT_FILTER:"MODEL_CONTENT_REJECTED",UNSUPPORTED_CONTENT:"MODEL_CONFIG"}),wle=Object.freeze({HARNESS_CONNECT:"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002",HARNESS_TIMEOUT:"\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",HARNESS_RESULT_UNCERTAIN:"\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",HARNESS_ACCESS:"\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",HARNESS_PROTOCOL:"\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002",HARNESS_SERVICE:"DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_REPLY_TIMEOUT:"\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",MODEL_AUTH:"\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",MODEL_QUOTA:"\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",MODEL_RATE_LIMIT:"\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_CONTEXT_LIMIT:"\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002",MODEL_UNAVAILABLE:"\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002",MODEL_CONFIG:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002",MODEL_TIMEOUT:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_TRANSPORT:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_SERVICE:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_STREAM:"\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",MODEL_EMPTY_REPLY:"\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",MODEL_CONTENT_REJECTED:"\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",MODEL_OUTPUT_LIMIT:"\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002",TURN_BLOCKED:"\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002",TURN_INTERRUPTED:"\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",SESSION_NOT_FOUND:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",SESSION_BUSY:"\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002",SESSION_STALE:"\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002",WORKSPACE_UNAVAILABLE:"\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002",PRESET_UNAVAILABLE:"\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002",CHANNEL_PERMISSION:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002",CHANNEL_RATE_LIMIT:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",CHANNEL_DELIVERY_UNCERTAIN:"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",CHANNEL_DELIVERY:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",INPUT_INVALID:"\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002",INTERNAL_UNKNOWN:"\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002"});function Dle(n){if(n?.code!=="harness-turn-failed")return null;let t=n?.providerCode??n?.details?.providerCode;return typeof t!="string"?null:Sle[t.trim().toUpperCase()]??null}function Ole(n){let t=typeof n?.code=="string"?n.code:"",o=Dle(n);if(o)return o;if(t==="harness-connect-failed")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_CONNECT";if(t==="harness-timeout")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_TIMEOUT";if(t==="harness-reply-timeout")return"MODEL_REPLY_TIMEOUT";if(["harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden"].includes(t))return"HARNESS_ACCESS";if(["harness-api-not-found","harness-response-invalid"].includes(t))return"HARNESS_PROTOCOL";if(t==="harness-turn-failed")return"INTERNAL_UNKNOWN";if(["harness-http-failed","harness-rpc-rejected"].includes(t))return"HARNESS_SERVICE";if(t==="model-empty-response")return"MODEL_EMPTY_REPLY";if(t==="model-max-tokens")return"MODEL_OUTPUT_LIMIT";if(t==="turn-blocked")return"TURN_BLOCKED";if(["turn-interrupted","turn-aborted"].includes(t))return"TURN_INTERRUPTED";if(t==="session-not-found")return"SESSION_NOT_FOUND";if(t==="agent-busy")return"SESSION_BUSY";if(t==="workspace-session-stale")return"SESSION_STALE";if(t.startsWith("workspace-"))return"WORKSPACE_UNAVAILABLE";if(t.startsWith("agent-preset-"))return"PRESET_UNAVAILABLE";if(t.startsWith("image-")||t.startsWith("inbound-file-")||t==="attachment-error")return"INPUT_INVALID";let i=Number(n?.status??n?.httpStatus);return i===401||i===403||["channel-permission","permission-required","artifact-permission-required","forbidden","stale-token"].includes(t)?"CHANNEL_PERMISSION":i===429||["channel-rate-limit","rate-limited","artifact-rate-limited"].includes(t)?"CHANNEL_RATE_LIMIT":["channel-delivery-uncertain","delivery-uncertain","artifact-delivery-uncertain"].includes(t)?"CHANNEL_DELIVERY_UNCERTAIN":t==="channel-delivery-failed"||t.startsWith("artifact-")||["network-error","timeout"].includes(t)?"CHANNEL_DELIVERY":"INTERNAL_UNKNOWN"}function ble(n){return typeof n=="string"&&/^[A-Z0-9-]{6,40}$/u.test(n)?n:`MF-${mle().slice(0,8).toUpperCase()}`}function Mle(n){return typeof n!="string"||!/^[A-Za-z0-9_-]{1,64}$/u.test(n)?null:n.toUpperCase().replaceAll("-","_")}function _le(n,{userMessage:t,reason:o,referenceId:i,at:e=Date.now()}={}){let a=Mle(o),A=Ole(n),r=A==="INTERNAL_UNKNOWN"&&a&&typeof t=="string"&&t.trim()?"INPUT_INVALID":A;return Object.freeze({code:r,reason:a??r,message:typeof t=="string"&&t.trim()?t.trim():w(wle[r]),referenceId:ble(i),at:Number.isFinite(e)?e:Date.now()})}function dt(n){return`${n.message} -${w("\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}",n)}`}function At(n,t,o){let i=_le(t,o);return n.lastMessageError=i,i}function wo(n){n.lastMessageError=null}function ka(n,{uncertain:t=!0}={}){let o=new Error("Channel message delivery failed",{cause:n}),i=Number(n?.status??n?.httpStatus);return o.code=i===401||i===403?"channel-permission":i===429?"channel-rate-limit":t?"channel-delivery-uncertain":"channel-delivery-failed",Number.isInteger(i)&&(o.status=i),o}function Xr(n){return!n||typeof n!="object"||typeof n.code!="string"||!n.code||typeof n.reason!="string"||!n.reason||typeof n.message!="string"||!n.message||typeof n.referenceId!="string"||!n.referenceId||!Number.isFinite(n.at)?null:{code:n.code.slice(0,64),reason:n.reason.slice(0,64),message:n.message.slice(0,500),referenceId:n.referenceId.slice(0,40),at:n.at}}var px=new Set(["starting","pending","connecting"]),EQ=new Set(["connected","expired","failed","cancelled"]);function $r(n){return typeof n=="string"&&n.trim()?n.trim():null}function va(n,t){return Object.freeze({code:n,message:t})}function Ex(n){return typeof n?.now=="function"?n.now():n()}function Nle(n){return new Date(Ex(n)).toISOString()}function sc(){return new DOMException("DingTalk provisioning was cancelled","AbortError")}function _I(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.pollIntervalMs?{pollIntervalMs:n.pollIntervalMs}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function xM(n){if(!n)return{};let t=typeof n.status=="function"?n.status():n.status;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function dx(n,t){if(!n||t.connected===!1||t.ready===!1)return!1;let o=$r(t.dingtalkStreamState??t.dingtalkConnectionState??t.connectionState??t.state)?.toLowerCase();return["failed","error","offline","disconnected","stopped"].includes(o)?!1:t.connected===!0||t.ready===!0||o==="connected"||o==="ready"}function Cx(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=$r(n.staffId??n.senderStaffId??n.senderId);if(!t)return null;let o=$r(n.requestId),i=o&&/^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(o)&&!o.includes(t)?o:null;return i?{requestId:i,staffId:t,displayName:$r(n.displayName??n.senderName??n.senderNick)??w("\u9489\u9489\u7528\u6237"),requestedAt:$r(n.requestedAt)}:null}function hx(n){if(!Array.isArray(n.pendingSenders))return[];let t=new Set,o=[];for(let i of n.pendingSenders){let e=Cx(i);!e||t.has(e.staffId)||(t.add(e.staffId),o.push(e))}return o}function Rle(n){return{requestId:n.requestId,displayName:n.displayName,senderIdMasked:UM(n.staffId),requestedAt:n.requestedAt}}function kle(n){return{senderKey:n.senderKey,displayName:$r(n.displayName)??w("\u9489\u9489\u7528\u6237"),senderIdMasked:UM(n.staffId),approvedAt:$r(n.approvedAt)}}var vE=class{#e;#A;#t;#r;#l;#o;#i;#a=new Map;#n=new Map;#s=new Map;#p=null;#c=new Map;#g=0;#I=!1;constructor({deviceAuth:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console,clock:r=Date}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("DingtalkController requires a DingTalk device auth client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("DingtalkController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.get!="function"||typeof i.getByClientId!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("DingtalkController requires a loaded config store");if(typeof e!="function")throw new TypeError("createRuntime is required");if(typeof a!="function")throw new TypeError("deleteState must be a function");if(typeof r!="function"&&typeof r?.now!="function")throw new TypeError("clock must be a function or expose now()");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r}async initialize(){if(this.#I)return this.status();for(let t of this.#t.list()){let o=this.#a.get(t.botId);try{if(dx(o,xM(o)))continue}catch{}await this.#y(t.botId,async()=>{let i=this.#t.get(t.botId);if(!i||this.#I)return;let e=await this.#f(i.secretRef);if(!e){this.#n.set(i.botId,va("missing-secret",w("\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"))),this.#D();return}try{await this.#u(i,e),this.#n.delete(i.botId)}catch{this.#n.set(i.botId,va("connection-failed",w("\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-dingtalk] bot ${i.botId} failed to initialize`)}this.#D()})}return this.status()}async startProvisioning({signal:t}={}){if(this.#I)throw new Error("dsh-dingtalk controller is closed");this.#p&&await this.cancelProvisioning(this.#p);let o={id:Tle(),state:"starting",controller:new AbortController,deviceCode:null,verificationUrl:null,expiresAt:null,pollIntervalMs:null,pollTask:null,botId:null,alreadyConnected:!1,error:null};this.#s.set(o.id,o),this.#p=o.id,this.#D();let i=()=>o.controller.abort(t?.reason);t?.aborted?i():t?.addEventListener("abort",i,{once:!0});try{let e=await this.#e.start({signal:o.controller.signal});if(this.#S(o),o.deviceCode=$r(e.deviceCode),o.verificationUrl=$r(e.verificationUrl),o.expiresAt=Number(e.expiresAt),o.pollIntervalMs=Number(e.pollIntervalMs),!o.deviceCode||!o.verificationUrl||!Number.isFinite(o.expiresAt)||!Number.isFinite(o.pollIntervalMs)||o.pollIntervalMs<=0)throw new Error("DingTalk device auth returned incomplete registration metadata");return o.state="pending",this.#D(),_I(o)}catch(e){if(o.controller.signal.aborted||e?.name==="AbortError"?(o.state="cancelled",o.error=va("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(o.state="failed",o.error=va("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#p===o.id&&(this.#p=null),this.#D(),o.state==="failed")throw e;return _I(o)}finally{t?.removeEventListener("abort",i)}}async bindCredentials({clientId:t,clientSecret:o}={}){if(this.#I)throw new Error("dsh-dingtalk controller is closed");let i=$r(t),e=$r(o);if(!i||!e)throw new TypeError("DingTalk Client ID and Client Secret are required");if(this.#p&&await this.cancelProvisioning(this.#p),this.#I)throw new Error("dsh-dingtalk controller is closed");let a=dQ(i);return await this.#y(a.botId,async()=>{if(this.#I)throw sc();let A=this.#t.getByClientId(i),r=await this.#A.resolve(a.secretRef).catch(()=>{});if(this.#I)throw sc();let s={botId:a.botId,clientId:i,secretRef:a.secretRef,approvedSenders:A?.approvedSenders??[]};await this.#A.set(a.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#Q(a.secretRef,r),g}try{await this.#u(s,e),this.#n.delete(a.botId)}catch{this.#n.set(a.botId,va("connection-failed",w("\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#o.warn?.("[dsh-dingtalk] credential-bound bot saved but its connection is not ready")}this.#D()}),this.status()}async registrationStatus(t){let o=this.#s.get(t);if(!o)return null;if(EQ.has(o.state)||o.state==="starting")return _I(o);if(Ex(this.#i)>=o.expiresAt)return o.state="expired",o.error=va("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===o.id&&(this.#p=null),this.#D(),_I(o);if(!o.pollTask){let i=this.#d(o).finally(()=>{o.pollTask===i&&(o.pollTask=null)});o.pollTask=i}return await o.pollTask,_I(o)}async cancelProvisioning(t){let o=this.#s.get(t);return o?(EQ.has(o.state)||(o.controller.abort(),await o.pollTask?.catch(()=>{}),EQ.has(o.state)||(o.state="cancelled"),o.error??=va("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),this.#p===o.id&&(this.#p=null),this.#D(),_I(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let i=await this.#f(o.secretRef);if(!i)throw new Error("The DingTalk client secret is missing");try{await this.#u(o,i),this.#n.delete(t)}catch(e){throw this.#n.set(t,va("connection-failed",w("\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#D()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let i=this.#a.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Cr(w("\u9489\u9489\u673A\u5668\u4EBA"));return i.sendConnectionTest(Ra(w("\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09",{clientId:HM(o.clientId)})))})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let A=this.#a.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let i=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#B(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw $r(i?.value)&&(await this.#A.set(o.secretRef,i.value).catch(()=>{}),await this.#u(o,i.value).catch(()=>{})),new Error("Unable to remove the DingTalk bot safely.",{cause:e})}try{await this.#l({botId:t,config:o})}catch{this.#o.warn?.(`[dsh-dingtalk] bot ${t} state cleanup failed`)}this.#n.delete(t),this.#D()}),this.status()}async approveSender(t,o){let i=this.#t.get(t);if(!i)throw new Error("Unknown DingTalk bot");let e=this.#a.get(t),a=typeof e?.pendingSender=="function"?Cx(e.pendingSender(o)):null,A=hx(xM(e)),r=a?.requestId===o?a:A.find(g=>g.requestId===o);if(!r)throw new Error("Unknown DingTalk sender approval request");if(i.approvedSenders.some(g=>g.staffId===r.staffId))return this.status();let s={...i,approvedSenders:[...i.approvedSenders,{senderKey:nx(),staffId:r.staffId,displayName:r.displayName,approvedAt:Nle(this.#i)}]};return await this.#C(i,s),this.status()}async revokeSender(t,o){let i=this.#t.get(t);if(!i)throw new Error("Unknown DingTalk bot");let e=i.approvedSenders.findIndex(A=>A.senderKey===o);if(e===-1)throw new Error("Unknown approved DingTalk sender");let a=[...i.approvedSenders];return a.splice(e,1),await this.#C(i,{...i,approvedSenders:a}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#a.get(e.botId),A={};try{A=xM(a)}catch{A={state:"error"}}let r=dx(a,A),s=this.#n.get(e.botId),g=r?"connected":s?"error":"offline",c=new Set(e.approvedSenders.map(d=>d.staffId)),I=hx(A).filter(d=>!c.has(d.staffId)).map(Rle);return{botId:e.botId,state:g,connected:r,configured:!0,bot:{name:w("\u9489\u9489\u673A\u5668\u4EBA"),clientIdMasked:HM(e.clientId)},health:{status:r?"healthy":s?"error":"offline",summary:r?w("\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):s?.message??w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:A.lastCheckedAt??null},stats:{messagesReceived:Number(A.messagesReceived)||0,messagesReplied:Number(A.messagesReplied)||0},lastMessageError:Xr(A.lastMessageError),senders:{pending:I,approved:e.approvedSenders.map(kle)},error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,i=this.#p?this.#s.get(this.#p):null;return{schemaVersion:1,revision:this.#g,state:i&&px.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&px.has(i.state)?{provisioning:_I(i)}:{}}}async close(){this.#I||(this.#I=!0,this.#p&&await this.cancelProvisioning(this.#p),await Promise.allSettled([...this.#a.keys()].map(t=>this.#B(t))),await Promise.allSettled([...this.#c.values()]),await Promise.allSettled([...this.#a.keys()].map(t=>this.#B(t))))}async#d(t){try{this.#S(t);let o=await this.#e.poll({deviceCode:t.deviceCode,signal:t.controller.signal});this.#S(t);let i=$r(o.status)?.toUpperCase();if(i==="WAITING")t.state="pending",t.error=null;else if(i==="SUCCESS"){let e=$r(o.clientId),a=$r(o.clientSecret);if(!e||!a)throw new Error("DingTalk returned incomplete credentials");t.state="connecting",t.error=null,this.#D();let A=await this.#h(t,{clientId:e,clientSecret:a});t.botId=A.botId,t.alreadyConnected=A.alreadyConnected,t.state="connected",this.#p===t.id&&(this.#p=null)}else i==="EXPIRED"?(t.state="expired",t.error=va("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===t.id&&(this.#p=null)):i==="FAIL"?(t.state="failed",t.error=va("authorization-failed",w("\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002")),this.#p===t.id&&(this.#p=null)):(t.state="pending",t.error=va("poll-pending",w("\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=va("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")),this.#p===t.id&&(this.#p=null)):t.state==="connecting"?(t.state="failed",t.error=va("activation-failed",w("\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#p===t.id&&(this.#p=null),this.#o.error?.("[dsh-dingtalk] bot activation failed")):(t.state="pending",t.error=va("poll-failed",w("\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}finally{this.#D(),this.#m()}}async#h(t,{clientId:o,clientSecret:i}){let e=dQ(o),a=this.#t.getByClientId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,clientId:o,secretRef:e.secretRef,approvedSenders:a?.approvedSenders??[]};return this.#y(e.botId,async()=>{let s=async()=>{await this.#B(e.botId),a?await this.#t.save(a).catch(()=>{}):this.#t.get(e.botId)&&await this.#t.remove(e.botId).catch(()=>null)&&await this.#l({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-dingtalk] failed to clean up cancelled bot state:",c)}),await this.#Q(e.secretRef,A),a&&$r(A?.value)&&await this.#u(a,A.value).catch(()=>{})};await this.#A.set(e.secretRef,i);try{this.#S(t),await this.#t.save(r),this.#S(t)}catch(g){throw await s(),g}try{await this.#u(r,i),this.#S(t),this.#n.delete(e.botId)}catch{if(t.controller.signal.aborted||this.#p!==t.id)throw await s(),sc();this.#n.set(e.botId,va("connection-failed",w("\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#o.warn?.("[dsh-dingtalk] authorized bot saved but its connection is not ready")}return{botId:e.botId,alreadyConnected:!!a}})}async#C(t,o){return this.#y(t.botId,async()=>{let i=await this.#f(t.secretRef);if(!i)throw new Error("The DingTalk client secret is missing");await this.#t.save(o);try{await this.#u(o,i),this.#n.delete(t.botId)}catch(e){throw await this.#t.save(t).catch(()=>{}),await this.#u(t,i).catch(()=>{}),this.#n.set(t.botId,va("connection-failed",w("\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#D()}})}async#u(t,o){if(this.#I||(await this.#B(t.botId),this.#I))throw sc();let i=await this.#r({botId:t.botId,config:structuredClone(t),clientSecret:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError("createRuntime returned an invalid DingTalk runtime");if(this.#I)throw await i.stop().catch(()=>{}),sc();this.#a.set(t.botId,i);try{if(await i.start(),this.#I)throw await i.stop().catch(()=>{}),sc()}catch(e){throw this.#a.get(t.botId)===i&&this.#a.delete(t.botId),await i.stop().catch(()=>{}),e}}async#B(t){let o=this.#a.get(t);this.#a.delete(t),await o?.stop().catch(()=>{this.#o.warn?.(`[dsh-dingtalk] bot ${t} failed to stop cleanly`)})}async#f(t){let o=await this.#A.resolve(t).catch(()=>{});return $r(o?.value)}async#Q(t,o){try{$r(o?.value)?await this.#A.set(t,o.value):await this.#A.unset(t)}catch{this.#o.error?.(`[dsh-dingtalk] failed to restore credential ${t}`)}}#S(t){if(t.controller.signal.aborted||this.#p!==t.id)throw sc()}#y(t,o){if(this.#I)return Promise.reject(new Error("dsh-dingtalk controller is closed"));let a=(this.#c.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#c.get(t)===a&&this.#c.delete(t)});return this.#c.set(t,a),a}#m(){for(let[t,o]of this.#s)t!==this.#p&&EQ.has(o.state)&&this.#s.size>16&&this.#s.delete(t)}#D(){this.#g+=1}};import{randomUUID as PE}from"node:crypto";import{extname as Kle}from"node:path";var fx=5*1024*1024,vle=20,Ple=20*1024*1024,Gle="\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002",ut=class extends Error{constructor(t,o,i,e={}){super(o,e),this.name="ImagePromptError",this.code=t,this.userMessage=i}},ux=Object.freeze({MODEL_DOES_NOT_SUPPORT_IMAGES:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002",IMAGE_TOO_LARGE:"\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",IMAGE_TOO_MANY_PIXELS:"\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",INVALID_IMAGE:"\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",INVALID_IMAGE_BASE64:"\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",IMAGE_TYPE_MISMATCH:"\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",TOO_MANY_IMAGES:"\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002",IMAGES_TOO_LARGE:"\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"});function Fle(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function YM(n){try{await n?.body?.cancel?.()}catch{}}async function Do(n,{fetchImpl:t=fetch,headers:o,signal:i,maxBytes:e=fx,timeoutMs:a=15e3,allowedHosts:A}={}){let r=new URL(n);if(r.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(Array.isArray(A)&&!A.some(I=>typeof I=="string"&&(r.hostname===I||I.startsWith(".")&&(r.hostname===I.slice(1)||r.hostname.endsWith(I)))))throw new Error("Image download URL is not hosted by the messaging platform");let s=await t(r,{method:"GET",headers:o,signal:Fle(i,a),redirect:"manual"});if(Number.isInteger(s?.status)&&s.status>=300&&s.status<400)throw await YM(s),new ut("image-redirect-blocked",`Image download redirect was blocked (HTTP ${s.status})`,w("\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002"));if(!s?.ok)throw await YM(s),new ut("image-http-error",`Image download failed with HTTP ${s?.status??"unknown"}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002",{status:s?.status??"unknown"}));let g=Number(s.headers?.get?.("content-length"));if(Number.isFinite(g)&&g>e)throw await YM(s),new ut("image-too-large",`Image response declares ${g} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s.body?.[Symbol.asyncIterator]){let I=[],d=0;for await(let B of s.body){let f=Buffer.from(B);if(d+=f.length,d>e)throw await s.body.cancel?.().catch?.(()=>{}),new ut("image-too-large",`Image response exceeded ${e} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));I.push(f)}return Buffer.concat(I,d)}let c=Buffer.from(await s.arrayBuffer());if(c.length>e)throw new ut("image-too-large",`Image response contains ${c.length} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return c}function Lle(n){return typeof n=="string"?n.trim():""}function Qx(n){return Array.isArray(n?.images)?n.images.filter(Boolean):[]}function Bx(n){return typeof n!="string"?void 0:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||void 0}function Ule(n){if(n.length>=8&&n[0]===137&&n[1]===80&&n[2]===78&&n[3]===71&&n[4]===13&&n[5]===10&&n[6]===26&&n[7]===10)return"image/png";if(n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255)return"image/jpeg";if(n.length>=6){let t=n.subarray(0,6).toString("ascii");if(t==="GIF87a"||t==="GIF89a")return"image/gif"}return n.length>=12&&n.subarray(0,4).toString("ascii")==="RIFF"&&n.subarray(8,12).toString("ascii")==="WEBP"?"image/webp":null}function Hle(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;return Buffer.isBuffer(t)||t instanceof Uint8Array?{data:Buffer.from(t),name:n?.name??n?.filename}:null}function Tt(n){return Qx(n).length>0}async function Oo(n,{signal:t,maxImageBytes:o=fx,maxImages:i=vle,maxTotalImageBytes:e=Ple}={}){let a=Qx(n);if(a.length>i)throw new ut("too-many-images",`Image message contains ${a.length} images; the limit is ${i}`,w("\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002",{maxImages:i}));let A=Lle(n?.content),r=[],s=0;A?r.push({type:"text",text:A}):a.length>0&&r.push({type:"text",text:w(Gle)});for(let[g,c]of a.entries()){if(t?.throwIfAborted(),Number.isFinite(c?.size)&&c.size>o)throw new ut("image-too-large",`Image ${g+1} declares ${c.size} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(Number.isFinite(c?.size)&&s+c.size>e)throw new ut("images-too-large",`Images declare more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));let I;try{I=c?.data===void 0?await c?.load?.({signal:t,maxBytes:o}):c.data}catch(f){throw t?.aborted||f?.name==="AbortError"||f?.name==="TimeoutError"||f instanceof ut?f:new ut("image-download-failed",`Unable to download image ${g+1}: ${f?.message??String(f)}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let d=Hle(I);if(!d?.data.length)throw new ut("invalid-image-data",`Image ${g+1} returned no data`,w("\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002"));if(d.data.length>o)throw new ut("image-too-large",`Image ${g+1} contains ${d.data.length} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s+d.data.length>e)throw new ut("images-too-large",`Images contain more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s+=d.data.length;let B=Ule(d.data);if(!B)throw new ut("unsupported-image-type",`Image ${g+1} is not JPEG, PNG, GIF, or WebP`,w("\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002"));r.push({type:"image",mediaType:B,data:d.data.toString("base64"),...Bx(d.name??c?.name)?{name:Bx(d.name??c?.name)}:{}})}return r}function eo(n){if(n instanceof ut)return{code:"image-prompt-error",reason:n.code,userMessage:n.userMessage};if(n?.code!=="attachment-error"||typeof n?.details?.reason!="string")return null;let t=n.details.reason,o=Object.hasOwn(ux,t)?w(ux[t]):null;return o?{code:"attachment-error",reason:t,userMessage:o}:null}function bo(n){return eo(n)?.userMessage??null}var yx="https://oapi.dingtalk.com/",xle="https://api.dingtalk.com/",Yle="DING_DWS_CLAW",jle="02fcf2f4-5e02-4a85-b672-46d1f715543e.schema",TI="\u{1F914}\u601D\u8003\u4E2D",wx="\u2705\u5DF2\u5B8C\u6210",Dx="\u274C\u5904\u7406\u5931\u8D25",Jle=15e3,qle=5e3,zle="2659900",Vle="im_bg_1",Wle=new Set(["WAITING","SUCCESS","FAIL","EXPIRED"]),gt=class extends Error{constructor(t,o,i={}){super(o,i),this.name="DingtalkApiError",this.code=t,this.status=i.status,this.providerCode=i.providerCode}};function WA(n){return typeof n=="string"&&n.trim()?n.trim():null}function LE(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function Ox(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function GE(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),i=LE(n?.providerCode),e=i??"",a=t,A="DingTalk could not prepare the file for delivery.";o===401||o===403||i==="401"||i==="403"||/(?:permission|forbidden|unauthor|access.?denied|\.auth(?:\.|$))/i.test(e)?(a="artifact-permission-required",A="DingTalk denied permission to send the file."):o===413||i==="413"||/(?:too.?large|size.?limit)/i.test(e)?(a="artifact-too-large",A="The file exceeds DingTalk's size limit."):o===429||i==="429"||/(?:rate.?limit|too.?many|throttl)/i.test(e)?(a="artifact-rate-limited",A="DingTalk rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="DingTalk rejected the file message.");let r=new Error(A,{cause:n});return r.code=a,Ox(r,n)}function Zle(n){let t=new Error("DingTalk file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",Ox(t,n)}function CQ(n){if(!n||typeof n!="object")return null;for(let t of["errcode","code"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return LE(n[t])??"rejected";return null}function Xle(n,t){if(t?.aborted)throw Xn(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?Zle(n):GE(n)}function $le(n){let t;try{t=new URL(n)}catch(o){throw new gt("invalid-image-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u3002",{cause:o})}return t.protocol==="http:"&&(!t.port||t.port==="80")&&(t.protocol="https:",t.port=""),t}function mx(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="dingtalk.com"||t.endsWith(".dingtalk.com")}function zM(n,{label:t,requireSubdomain:o=!0}={}){let i;try{i=new URL(n)}catch{throw new gt("invalid-url",`${t??"\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`)}let e=i.hostname.toLowerCase().replace(/\.$/,""),a=o?e!=="dingtalk.com"&&mx(e):mx(e);if(i.protocol!=="https:"||!a||i.port&&i.port!=="443")throw new gt("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);if(i.username||i.password)throw new gt("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);return i}function gc(n){let t=WA(n);if(!t)throw new gt("invalid-session-webhook","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002");let o=zM(t,{label:"\u9489\u9489\u56DE\u590D",requireSubdomain:!1});return o.hash="",o.toString()}function bx(n,t=4e3){let o=typeof n=="string"?n.trim():"";if(!o)return[];if(!Number.isInteger(t)||t<1)throw new TypeError("maxChars must be a positive integer");if(o.length<=t)return[o];let i=[],e=o;for(;e.length>t;){let a=e.lastIndexOf(` -`,t);a{if(t?.aborted){i(Xn(t));return}let e=setTimeout(()=>{t?.removeEventListener("abort",a),o()},n),a=()=>{clearTimeout(e),i(Xn(t))};t?.addEventListener("abort",a,{once:!0})})}async function En(n,t,{body:o,signal:i,timeoutMs:e=Jle,headers:a={},method:A="POST",action:r="request"}={}){let s=new AbortController,g=!1,c=()=>s.abort(i?.reason);if(i?.aborted)throw Xn(i);i?.addEventListener("abort",c,{once:!0});let I=e>0?setTimeout(()=>{g=!0,s.abort()},e):null;try{let d=await n(t,{method:A,redirect:"error",headers:{"content-type":"application/json",...a},body:JSON.stringify(o??{}),signal:s.signal});if(!d.ok){let B;try{let f=await d.json();B=LE(f?.code??f?.errcode)}catch{}throw new gt("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${d.status}\uFF09\u3002`,{status:d.status,providerCode:B})}try{return await d.json()}catch(B){throw new gt("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:B})}}catch(d){throw i?.aborted?Xn(i):g?new gt("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:d}):d instanceof gt?d:new gt("network-error",`\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489${r}\u8BF7\u6C42\u3002`,{cause:d})}finally{I&&clearTimeout(I),i?.removeEventListener("abort",c)}}async function Ape(n,t,{body:o,signal:i,timeoutMs:e=6e4}={}){let a=new AbortController,A=!1,r=()=>a.abort(i?.reason);if(i?.aborted)throw Xn(i);i?.addEventListener("abort",r,{once:!0});let s=setTimeout(()=>{A=!0,a.abort()},e);try{let g=await n(t,{method:"POST",body:o,signal:a.signal,redirect:"error"}),c,I;try{c=await g.json()}catch(d){I=d}if(!g.ok)throw new gt("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${g.status}\uFF09\u3002`,{status:g.status,providerCode:LE(c?.code??c?.errcode)});if(I)throw new gt("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:I});return c}catch(g){throw i?.aborted?Xn(i):A?new gt("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:g}):g instanceof gt?g:new gt("network-error","\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{cause:g})}finally{clearTimeout(s),i?.removeEventListener("abort",r)}}function Sx(n){let t=WA(n?.robotCode);if(!t)throw new TypeError("DingTalk robotCode is required");if(n?.type==="group"){let o=WA(n.openConversationId);if(o)return{type:"group",robotCode:t,openConversationId:o}}if(n?.type==="user"){let o=WA(n.userId);if(o)return{type:"user",robotCode:t,userId:o}}throw new TypeError("DingTalk file target is invalid")}function tpe(n){return Kle(n).slice(1).toLowerCase()}function rpe(n){if(n?.type==="user"){let t=WA(n.userId);if(t)return{type:"user",userId:t}}if(n?.type==="group"){let t=WA(n.openConversationId);if(t)return{type:"group",openConversationId:t,atUserIds:n.atUserIds}}throw new TypeError("DingTalk AI Card target is invalid")}function FE(n,t){let o=e=>String(e).replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a]),i=t?.type==="group"?Object.entries(t.atUserIds??{}).map(([e,a])=>`${o(a)}`).join(" "):"";return ipe(i?`${i} +${w("\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}",n)}`}function At(n,t,o){let i=_le(t,o);return n.lastMessageError=i,i}function wo(n){n.lastMessageError=null}function ka(n,{uncertain:t=!0}={}){let o=new Error("Channel message delivery failed",{cause:n}),i=Number(n?.status??n?.httpStatus);return o.code=i===401||i===403?"channel-permission":i===429?"channel-rate-limit":t?"channel-delivery-uncertain":"channel-delivery-failed",Number.isInteger(i)&&(o.status=i),o}function Xr(n){return!n||typeof n!="object"||typeof n.code!="string"||!n.code||typeof n.reason!="string"||!n.reason||typeof n.message!="string"||!n.message||typeof n.referenceId!="string"||!n.referenceId||!Number.isFinite(n.at)?null:{code:n.code.slice(0,64),reason:n.reason.slice(0,64),message:n.message.slice(0,500),referenceId:n.referenceId.slice(0,40),at:n.at}}var px=new Set(["starting","pending","connecting"]),EQ=new Set(["connected","expired","failed","cancelled"]);function $r(n){return typeof n=="string"&&n.trim()?n.trim():null}function va(n,t){return Object.freeze({code:n,message:t})}function Ex(n){return typeof n?.now=="function"?n.now():n()}function Nle(n){return new Date(Ex(n)).toISOString()}function sc(){return new DOMException("DingTalk provisioning was cancelled","AbortError")}function _I(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.pollIntervalMs?{pollIntervalMs:n.pollIntervalMs}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function xM(n){if(!n)return{};let t=typeof n.status=="function"?n.status():n.status;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function dx(n,t){if(!n||t.connected===!1||t.ready===!1)return!1;let o=$r(t.dingtalkStreamState??t.dingtalkConnectionState??t.connectionState??t.state)?.toLowerCase();return["failed","error","offline","disconnected","stopped"].includes(o)?!1:t.connected===!0||t.ready===!0||o==="connected"||o==="ready"}function Cx(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=$r(n.staffId??n.senderStaffId??n.senderId);if(!t)return null;let o=$r(n.requestId),i=o&&/^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(o)&&!o.includes(t)?o:null;return i?{requestId:i,staffId:t,displayName:$r(n.displayName??n.senderName??n.senderNick)??w("\u9489\u9489\u7528\u6237"),requestedAt:$r(n.requestedAt)}:null}function hx(n){if(!Array.isArray(n.pendingSenders))return[];let t=new Set,o=[];for(let i of n.pendingSenders){let e=Cx(i);!e||t.has(e.staffId)||(t.add(e.staffId),o.push(e))}return o}function Rle(n){return{requestId:n.requestId,displayName:n.displayName,senderIdMasked:UM(n.staffId),requestedAt:n.requestedAt}}function kle(n){return{senderKey:n.senderKey,displayName:$r(n.displayName)??w("\u9489\u9489\u7528\u6237"),senderIdMasked:UM(n.staffId),approvedAt:$r(n.approvedAt)}}var PE=class{#e;#A;#t;#r;#l;#o;#i;#a=new Map;#n=new Map;#s=new Map;#p=null;#c=new Map;#g=0;#I=!1;constructor({deviceAuth:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console,clock:r=Date}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("DingtalkController requires a DingTalk device auth client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("DingtalkController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.get!="function"||typeof i.getByClientId!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("DingtalkController requires a loaded config store");if(typeof e!="function")throw new TypeError("createRuntime is required");if(typeof a!="function")throw new TypeError("deleteState must be a function");if(typeof r!="function"&&typeof r?.now!="function")throw new TypeError("clock must be a function or expose now()");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r}async initialize(){if(this.#I)return this.status();for(let t of this.#t.list()){let o=this.#a.get(t.botId);try{if(dx(o,xM(o)))continue}catch{}await this.#y(t.botId,async()=>{let i=this.#t.get(t.botId);if(!i||this.#I)return;let e=await this.#f(i.secretRef);if(!e){this.#n.set(i.botId,va("missing-secret",w("\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"))),this.#D();return}try{await this.#u(i,e),this.#n.delete(i.botId)}catch{this.#n.set(i.botId,va("connection-failed",w("\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-dingtalk] bot ${i.botId} failed to initialize`)}this.#D()})}return this.status()}async startProvisioning({signal:t}={}){if(this.#I)throw new Error("dsh-dingtalk controller is closed");this.#p&&await this.cancelProvisioning(this.#p);let o={id:Tle(),state:"starting",controller:new AbortController,deviceCode:null,verificationUrl:null,expiresAt:null,pollIntervalMs:null,pollTask:null,botId:null,alreadyConnected:!1,error:null};this.#s.set(o.id,o),this.#p=o.id,this.#D();let i=()=>o.controller.abort(t?.reason);t?.aborted?i():t?.addEventListener("abort",i,{once:!0});try{let e=await this.#e.start({signal:o.controller.signal});if(this.#S(o),o.deviceCode=$r(e.deviceCode),o.verificationUrl=$r(e.verificationUrl),o.expiresAt=Number(e.expiresAt),o.pollIntervalMs=Number(e.pollIntervalMs),!o.deviceCode||!o.verificationUrl||!Number.isFinite(o.expiresAt)||!Number.isFinite(o.pollIntervalMs)||o.pollIntervalMs<=0)throw new Error("DingTalk device auth returned incomplete registration metadata");return o.state="pending",this.#D(),_I(o)}catch(e){if(o.controller.signal.aborted||e?.name==="AbortError"?(o.state="cancelled",o.error=va("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(o.state="failed",o.error=va("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#p===o.id&&(this.#p=null),this.#D(),o.state==="failed")throw e;return _I(o)}finally{t?.removeEventListener("abort",i)}}async bindCredentials({clientId:t,clientSecret:o}={}){if(this.#I)throw new Error("dsh-dingtalk controller is closed");let i=$r(t),e=$r(o);if(!i||!e)throw new TypeError("DingTalk Client ID and Client Secret are required");if(this.#p&&await this.cancelProvisioning(this.#p),this.#I)throw new Error("dsh-dingtalk controller is closed");let a=dQ(i);return await this.#y(a.botId,async()=>{if(this.#I)throw sc();let A=this.#t.getByClientId(i),r=await this.#A.resolve(a.secretRef).catch(()=>{});if(this.#I)throw sc();let s={botId:a.botId,clientId:i,secretRef:a.secretRef,approvedSenders:A?.approvedSenders??[]};await this.#A.set(a.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#Q(a.secretRef,r),g}try{await this.#u(s,e),this.#n.delete(a.botId)}catch{this.#n.set(a.botId,va("connection-failed",w("\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#o.warn?.("[dsh-dingtalk] credential-bound bot saved but its connection is not ready")}this.#D()}),this.status()}async registrationStatus(t){let o=this.#s.get(t);if(!o)return null;if(EQ.has(o.state)||o.state==="starting")return _I(o);if(Ex(this.#i)>=o.expiresAt)return o.state="expired",o.error=va("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===o.id&&(this.#p=null),this.#D(),_I(o);if(!o.pollTask){let i=this.#d(o).finally(()=>{o.pollTask===i&&(o.pollTask=null)});o.pollTask=i}return await o.pollTask,_I(o)}async cancelProvisioning(t){let o=this.#s.get(t);return o?(EQ.has(o.state)||(o.controller.abort(),await o.pollTask?.catch(()=>{}),EQ.has(o.state)||(o.state="cancelled"),o.error??=va("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),this.#p===o.id&&(this.#p=null),this.#D(),_I(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let i=await this.#f(o.secretRef);if(!i)throw new Error("The DingTalk client secret is missing");try{await this.#u(o,i),this.#n.delete(t)}catch(e){throw this.#n.set(t,va("connection-failed",w("\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#D()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let i=this.#a.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Cr(w("\u9489\u9489\u673A\u5668\u4EBA"));return i.sendConnectionTest(Ra(w("\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09",{clientId:HM(o.clientId)})))})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let A=this.#a.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let i=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#B(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw $r(i?.value)&&(await this.#A.set(o.secretRef,i.value).catch(()=>{}),await this.#u(o,i.value).catch(()=>{})),new Error("Unable to remove the DingTalk bot safely.",{cause:e})}try{await this.#l({botId:t,config:o})}catch{this.#o.warn?.(`[dsh-dingtalk] bot ${t} state cleanup failed`)}this.#n.delete(t),this.#D()}),this.status()}async approveSender(t,o){let i=this.#t.get(t);if(!i)throw new Error("Unknown DingTalk bot");let e=this.#a.get(t),a=typeof e?.pendingSender=="function"?Cx(e.pendingSender(o)):null,A=hx(xM(e)),r=a?.requestId===o?a:A.find(g=>g.requestId===o);if(!r)throw new Error("Unknown DingTalk sender approval request");if(i.approvedSenders.some(g=>g.staffId===r.staffId))return this.status();let s={...i,approvedSenders:[...i.approvedSenders,{senderKey:nx(),staffId:r.staffId,displayName:r.displayName,approvedAt:Nle(this.#i)}]};return await this.#C(i,s),this.status()}async revokeSender(t,o){let i=this.#t.get(t);if(!i)throw new Error("Unknown DingTalk bot");let e=i.approvedSenders.findIndex(A=>A.senderKey===o);if(e===-1)throw new Error("Unknown approved DingTalk sender");let a=[...i.approvedSenders];return a.splice(e,1),await this.#C(i,{...i,approvedSenders:a}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#a.get(e.botId),A={};try{A=xM(a)}catch{A={state:"error"}}let r=dx(a,A),s=this.#n.get(e.botId),g=r?"connected":s?"error":"offline",c=new Set(e.approvedSenders.map(d=>d.staffId)),I=hx(A).filter(d=>!c.has(d.staffId)).map(Rle);return{botId:e.botId,state:g,connected:r,configured:!0,bot:{name:w("\u9489\u9489\u673A\u5668\u4EBA"),clientIdMasked:HM(e.clientId)},health:{status:r?"healthy":s?"error":"offline",summary:r?w("\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):s?.message??w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:A.lastCheckedAt??null},stats:{messagesReceived:Number(A.messagesReceived)||0,messagesReplied:Number(A.messagesReplied)||0},lastMessageError:Xr(A.lastMessageError),senders:{pending:I,approved:e.approvedSenders.map(kle)},error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,i=this.#p?this.#s.get(this.#p):null;return{schemaVersion:1,revision:this.#g,state:i&&px.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&px.has(i.state)?{provisioning:_I(i)}:{}}}async close(){this.#I||(this.#I=!0,this.#p&&await this.cancelProvisioning(this.#p),await Promise.allSettled([...this.#a.keys()].map(t=>this.#B(t))),await Promise.allSettled([...this.#c.values()]),await Promise.allSettled([...this.#a.keys()].map(t=>this.#B(t))))}async#d(t){try{this.#S(t);let o=await this.#e.poll({deviceCode:t.deviceCode,signal:t.controller.signal});this.#S(t);let i=$r(o.status)?.toUpperCase();if(i==="WAITING")t.state="pending",t.error=null;else if(i==="SUCCESS"){let e=$r(o.clientId),a=$r(o.clientSecret);if(!e||!a)throw new Error("DingTalk returned incomplete credentials");t.state="connecting",t.error=null,this.#D();let A=await this.#h(t,{clientId:e,clientSecret:a});t.botId=A.botId,t.alreadyConnected=A.alreadyConnected,t.state="connected",this.#p===t.id&&(this.#p=null)}else i==="EXPIRED"?(t.state="expired",t.error=va("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===t.id&&(this.#p=null)):i==="FAIL"?(t.state="failed",t.error=va("authorization-failed",w("\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002")),this.#p===t.id&&(this.#p=null)):(t.state="pending",t.error=va("poll-pending",w("\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=va("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")),this.#p===t.id&&(this.#p=null)):t.state==="connecting"?(t.state="failed",t.error=va("activation-failed",w("\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#p===t.id&&(this.#p=null),this.#o.error?.("[dsh-dingtalk] bot activation failed")):(t.state="pending",t.error=va("poll-failed",w("\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}finally{this.#D(),this.#m()}}async#h(t,{clientId:o,clientSecret:i}){let e=dQ(o),a=this.#t.getByClientId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,clientId:o,secretRef:e.secretRef,approvedSenders:a?.approvedSenders??[]};return this.#y(e.botId,async()=>{let s=async()=>{await this.#B(e.botId),a?await this.#t.save(a).catch(()=>{}):this.#t.get(e.botId)&&await this.#t.remove(e.botId).catch(()=>null)&&await this.#l({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-dingtalk] failed to clean up cancelled bot state:",c)}),await this.#Q(e.secretRef,A),a&&$r(A?.value)&&await this.#u(a,A.value).catch(()=>{})};await this.#A.set(e.secretRef,i);try{this.#S(t),await this.#t.save(r),this.#S(t)}catch(g){throw await s(),g}try{await this.#u(r,i),this.#S(t),this.#n.delete(e.botId)}catch{if(t.controller.signal.aborted||this.#p!==t.id)throw await s(),sc();this.#n.set(e.botId,va("connection-failed",w("\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#o.warn?.("[dsh-dingtalk] authorized bot saved but its connection is not ready")}return{botId:e.botId,alreadyConnected:!!a}})}async#C(t,o){return this.#y(t.botId,async()=>{let i=await this.#f(t.secretRef);if(!i)throw new Error("The DingTalk client secret is missing");await this.#t.save(o);try{await this.#u(o,i),this.#n.delete(t.botId)}catch(e){throw await this.#t.save(t).catch(()=>{}),await this.#u(t,i).catch(()=>{}),this.#n.set(t.botId,va("connection-failed",w("\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#D()}})}async#u(t,o){if(this.#I||(await this.#B(t.botId),this.#I))throw sc();let i=await this.#r({botId:t.botId,config:structuredClone(t),clientSecret:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError("createRuntime returned an invalid DingTalk runtime");if(this.#I)throw await i.stop().catch(()=>{}),sc();this.#a.set(t.botId,i);try{if(await i.start(),this.#I)throw await i.stop().catch(()=>{}),sc()}catch(e){throw this.#a.get(t.botId)===i&&this.#a.delete(t.botId),await i.stop().catch(()=>{}),e}}async#B(t){let o=this.#a.get(t);this.#a.delete(t),await o?.stop().catch(()=>{this.#o.warn?.(`[dsh-dingtalk] bot ${t} failed to stop cleanly`)})}async#f(t){let o=await this.#A.resolve(t).catch(()=>{});return $r(o?.value)}async#Q(t,o){try{$r(o?.value)?await this.#A.set(t,o.value):await this.#A.unset(t)}catch{this.#o.error?.(`[dsh-dingtalk] failed to restore credential ${t}`)}}#S(t){if(t.controller.signal.aborted||this.#p!==t.id)throw sc()}#y(t,o){if(this.#I)return Promise.reject(new Error("dsh-dingtalk controller is closed"));let a=(this.#c.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#c.get(t)===a&&this.#c.delete(t)});return this.#c.set(t,a),a}#m(){for(let[t,o]of this.#s)t!==this.#p&&EQ.has(o.state)&&this.#s.size>16&&this.#s.delete(t)}#D(){this.#g+=1}};import{randomUUID as GE}from"node:crypto";import{extname as Kle}from"node:path";var fx=5*1024*1024,vle=20,Ple=20*1024*1024,Gle="\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002",ut=class extends Error{constructor(t,o,i,e={}){super(o,e),this.name="ImagePromptError",this.code=t,this.userMessage=i}},ux=Object.freeze({MODEL_DOES_NOT_SUPPORT_IMAGES:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002",IMAGE_TOO_LARGE:"\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",IMAGE_TOO_MANY_PIXELS:"\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",INVALID_IMAGE:"\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",INVALID_IMAGE_BASE64:"\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",IMAGE_TYPE_MISMATCH:"\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",TOO_MANY_IMAGES:"\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002",IMAGES_TOO_LARGE:"\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"});function Fle(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function YM(n){try{await n?.body?.cancel?.()}catch{}}async function Do(n,{fetchImpl:t=fetch,headers:o,signal:i,maxBytes:e=fx,timeoutMs:a=15e3,allowedHosts:A}={}){let r=new URL(n);if(r.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(Array.isArray(A)&&!A.some(I=>typeof I=="string"&&(r.hostname===I||I.startsWith(".")&&(r.hostname===I.slice(1)||r.hostname.endsWith(I)))))throw new Error("Image download URL is not hosted by the messaging platform");let s=await t(r,{method:"GET",headers:o,signal:Fle(i,a),redirect:"manual"});if(Number.isInteger(s?.status)&&s.status>=300&&s.status<400)throw await YM(s),new ut("image-redirect-blocked",`Image download redirect was blocked (HTTP ${s.status})`,w("\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002"));if(!s?.ok)throw await YM(s),new ut("image-http-error",`Image download failed with HTTP ${s?.status??"unknown"}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002",{status:s?.status??"unknown"}));let g=Number(s.headers?.get?.("content-length"));if(Number.isFinite(g)&&g>e)throw await YM(s),new ut("image-too-large",`Image response declares ${g} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s.body?.[Symbol.asyncIterator]){let I=[],d=0;for await(let B of s.body){let f=Buffer.from(B);if(d+=f.length,d>e)throw await s.body.cancel?.().catch?.(()=>{}),new ut("image-too-large",`Image response exceeded ${e} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));I.push(f)}return Buffer.concat(I,d)}let c=Buffer.from(await s.arrayBuffer());if(c.length>e)throw new ut("image-too-large",`Image response contains ${c.length} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return c}function Lle(n){return typeof n=="string"?n.trim():""}function Qx(n){return Array.isArray(n?.images)?n.images.filter(Boolean):[]}function Bx(n){return typeof n!="string"?void 0:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||void 0}function Ule(n){if(n.length>=8&&n[0]===137&&n[1]===80&&n[2]===78&&n[3]===71&&n[4]===13&&n[5]===10&&n[6]===26&&n[7]===10)return"image/png";if(n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255)return"image/jpeg";if(n.length>=6){let t=n.subarray(0,6).toString("ascii");if(t==="GIF87a"||t==="GIF89a")return"image/gif"}return n.length>=12&&n.subarray(0,4).toString("ascii")==="RIFF"&&n.subarray(8,12).toString("ascii")==="WEBP"?"image/webp":null}function Hle(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;return Buffer.isBuffer(t)||t instanceof Uint8Array?{data:Buffer.from(t),name:n?.name??n?.filename}:null}function Tt(n){return Qx(n).length>0}async function Oo(n,{signal:t,maxImageBytes:o=fx,maxImages:i=vle,maxTotalImageBytes:e=Ple}={}){let a=Qx(n);if(a.length>i)throw new ut("too-many-images",`Image message contains ${a.length} images; the limit is ${i}`,w("\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002",{maxImages:i}));let A=Lle(n?.content),r=[],s=0;A?r.push({type:"text",text:A}):a.length>0&&r.push({type:"text",text:w(Gle)});for(let[g,c]of a.entries()){if(t?.throwIfAborted(),Number.isFinite(c?.size)&&c.size>o)throw new ut("image-too-large",`Image ${g+1} declares ${c.size} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(Number.isFinite(c?.size)&&s+c.size>e)throw new ut("images-too-large",`Images declare more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));let I;try{I=c?.data===void 0?await c?.load?.({signal:t,maxBytes:o}):c.data}catch(f){throw t?.aborted||f?.name==="AbortError"||f?.name==="TimeoutError"||f instanceof ut?f:new ut("image-download-failed",`Unable to download image ${g+1}: ${f?.message??String(f)}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let d=Hle(I);if(!d?.data.length)throw new ut("invalid-image-data",`Image ${g+1} returned no data`,w("\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002"));if(d.data.length>o)throw new ut("image-too-large",`Image ${g+1} contains ${d.data.length} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s+d.data.length>e)throw new ut("images-too-large",`Images contain more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s+=d.data.length;let B=Ule(d.data);if(!B)throw new ut("unsupported-image-type",`Image ${g+1} is not JPEG, PNG, GIF, or WebP`,w("\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002"));r.push({type:"image",mediaType:B,data:d.data.toString("base64"),...Bx(d.name??c?.name)?{name:Bx(d.name??c?.name)}:{}})}return r}function eo(n){if(n instanceof ut)return{code:"image-prompt-error",reason:n.code,userMessage:n.userMessage};if(n?.code!=="attachment-error"||typeof n?.details?.reason!="string")return null;let t=n.details.reason,o=Object.hasOwn(ux,t)?w(ux[t]):null;return o?{code:"attachment-error",reason:t,userMessage:o}:null}function bo(n){return eo(n)?.userMessage??null}var yx="https://oapi.dingtalk.com/",xle="https://api.dingtalk.com/",Yle="DING_DWS_CLAW",jle="02fcf2f4-5e02-4a85-b672-46d1f715543e.schema",TI="\u{1F914}\u601D\u8003\u4E2D",wx="\u2705\u5DF2\u5B8C\u6210",Dx="\u274C\u5904\u7406\u5931\u8D25",Jle=15e3,qle=5e3,zle="2659900",Vle="im_bg_1",Wle=new Set(["WAITING","SUCCESS","FAIL","EXPIRED"]),gt=class extends Error{constructor(t,o,i={}){super(o,i),this.name="DingtalkApiError",this.code=t,this.status=i.status,this.providerCode=i.providerCode}};function WA(n){return typeof n=="string"&&n.trim()?n.trim():null}function UE(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function Ox(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function FE(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),i=UE(n?.providerCode),e=i??"",a=t,A="DingTalk could not prepare the file for delivery.";o===401||o===403||i==="401"||i==="403"||/(?:permission|forbidden|unauthor|access.?denied|\.auth(?:\.|$))/i.test(e)?(a="artifact-permission-required",A="DingTalk denied permission to send the file."):o===413||i==="413"||/(?:too.?large|size.?limit)/i.test(e)?(a="artifact-too-large",A="The file exceeds DingTalk's size limit."):o===429||i==="429"||/(?:rate.?limit|too.?many|throttl)/i.test(e)?(a="artifact-rate-limited",A="DingTalk rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="DingTalk rejected the file message.");let r=new Error(A,{cause:n});return r.code=a,Ox(r,n)}function Zle(n){let t=new Error("DingTalk file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",Ox(t,n)}function CQ(n){if(!n||typeof n!="object")return null;for(let t of["errcode","code"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return UE(n[t])??"rejected";return null}function Xle(n,t){if(t?.aborted)throw Xn(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?Zle(n):FE(n)}function $le(n){let t;try{t=new URL(n)}catch(o){throw new gt("invalid-image-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u3002",{cause:o})}return t.protocol==="http:"&&(!t.port||t.port==="80")&&(t.protocol="https:",t.port=""),t}function mx(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="dingtalk.com"||t.endsWith(".dingtalk.com")}function zM(n,{label:t,requireSubdomain:o=!0}={}){let i;try{i=new URL(n)}catch{throw new gt("invalid-url",`${t??"\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`)}let e=i.hostname.toLowerCase().replace(/\.$/,""),a=o?e!=="dingtalk.com"&&mx(e):mx(e);if(i.protocol!=="https:"||!a||i.port&&i.port!=="443")throw new gt("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);if(i.username||i.password)throw new gt("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);return i}function gc(n){let t=WA(n);if(!t)throw new gt("invalid-session-webhook","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002");let o=zM(t,{label:"\u9489\u9489\u56DE\u590D",requireSubdomain:!1});return o.hash="",o.toString()}function bx(n,t=4e3){let o=typeof n=="string"?n.trim():"";if(!o)return[];if(!Number.isInteger(t)||t<1)throw new TypeError("maxChars must be a positive integer");if(o.length<=t)return[o];let i=[],e=o;for(;e.length>t;){let a=e.lastIndexOf(` +`,t);a{if(t?.aborted){i(Xn(t));return}let e=setTimeout(()=>{t?.removeEventListener("abort",a),o()},n),a=()=>{clearTimeout(e),i(Xn(t))};t?.addEventListener("abort",a,{once:!0})})}async function En(n,t,{body:o,signal:i,timeoutMs:e=Jle,headers:a={},method:A="POST",action:r="request"}={}){let s=new AbortController,g=!1,c=()=>s.abort(i?.reason);if(i?.aborted)throw Xn(i);i?.addEventListener("abort",c,{once:!0});let I=e>0?setTimeout(()=>{g=!0,s.abort()},e):null;try{let d=await n(t,{method:A,redirect:"error",headers:{"content-type":"application/json",...a},body:JSON.stringify(o??{}),signal:s.signal});if(!d.ok){let B;try{let f=await d.json();B=UE(f?.code??f?.errcode)}catch{}throw new gt("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${d.status}\uFF09\u3002`,{status:d.status,providerCode:B})}try{return await d.json()}catch(B){throw new gt("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:B})}}catch(d){throw i?.aborted?Xn(i):g?new gt("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:d}):d instanceof gt?d:new gt("network-error",`\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489${r}\u8BF7\u6C42\u3002`,{cause:d})}finally{I&&clearTimeout(I),i?.removeEventListener("abort",c)}}async function Ape(n,t,{body:o,signal:i,timeoutMs:e=6e4}={}){let a=new AbortController,A=!1,r=()=>a.abort(i?.reason);if(i?.aborted)throw Xn(i);i?.addEventListener("abort",r,{once:!0});let s=setTimeout(()=>{A=!0,a.abort()},e);try{let g=await n(t,{method:"POST",body:o,signal:a.signal,redirect:"error"}),c,I;try{c=await g.json()}catch(d){I=d}if(!g.ok)throw new gt("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${g.status}\uFF09\u3002`,{status:g.status,providerCode:UE(c?.code??c?.errcode)});if(I)throw new gt("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:I});return c}catch(g){throw i?.aborted?Xn(i):A?new gt("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:g}):g instanceof gt?g:new gt("network-error","\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{cause:g})}finally{clearTimeout(s),i?.removeEventListener("abort",r)}}function Sx(n){let t=WA(n?.robotCode);if(!t)throw new TypeError("DingTalk robotCode is required");if(n?.type==="group"){let o=WA(n.openConversationId);if(o)return{type:"group",robotCode:t,openConversationId:o}}if(n?.type==="user"){let o=WA(n.userId);if(o)return{type:"user",robotCode:t,userId:o}}throw new TypeError("DingTalk file target is invalid")}function tpe(n){return Kle(n).slice(1).toLowerCase()}function rpe(n){if(n?.type==="user"){let t=WA(n.userId);if(t)return{type:"user",userId:t}}if(n?.type==="group"){let t=WA(n.openConversationId);if(t)return{type:"group",openConversationId:t,atUserIds:n.atUserIds}}throw new TypeError("DingTalk AI Card target is invalid")}function LE(n,t){let o=e=>String(e).replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a]),i=t?.type==="group"?Object.entries(t.atUserIds??{}).map(([e,a])=>`${o(a)}`).join(" "):"";return ipe(i?`${i} -${n}`:n)}function jM(n,t,o){return{cardParamMap:{flowStatus:t,msgContent:FE(n,o),staticMsgContent:"",sys_full_json_obj:JSON.stringify({order:["msgContent"]}),config:JSON.stringify({autoLayout:!0})}}}function ape(n,t,o){let i={outTrackId:n,userIdType:1};return t.type==="group"?{...i,openSpaceId:`dtv1.card//IM_GROUP.${t.openConversationId}`,imGroupOpenDeliverModel:{robotCode:o,atUserIds:t.atUserIds}}:{...i,openSpaceId:`dtv1.card//IM_ROBOT.${t.userId}`,imRobotOpenDeliverModel:{spaceType:"IM_ROBOT",robotCode:o,extension:{dynamicSummary:"true"}}}}function ipe(n){let o=(typeof n=="string"?n.replace(/\r\n?/g,` +${n}`:n)}function jM(n,t,o){return{cardParamMap:{flowStatus:t,msgContent:LE(n,o),staticMsgContent:"",sys_full_json_obj:JSON.stringify({order:["msgContent"]}),config:JSON.stringify({autoLayout:!0})}}}function ape(n,t,o){let i={outTrackId:n,userIdType:1};return t.type==="group"?{...i,openSpaceId:`dtv1.card//IM_GROUP.${t.openConversationId}`,imGroupOpenDeliverModel:{robotCode:o,atUserIds:t.atUserIds}}:{...i,openSpaceId:`dtv1.card//IM_ROBOT.${t.userId}`,imRobotOpenDeliverModel:{spaceType:"IM_ROBOT",robotCode:o,extension:{dynamicSummary:"true"}}}}function ipe(n){let o=(typeof n=="string"?n.replace(/\r\n?/g,` `):"").split(` `),i=!1;return o.map((e,a)=>{let A=/^\s{0,3}```/.test(e),r=i;return A&&(i=!i),a===o.length-1?e:r||A||i||!e||!o[a+1]?`${e} `:/^\s{0,3}(?:[-*+] |\d+[.)] |#{1,6} |\||> )/.test(o[a+1])?`${e} -`:`${e}
`}).join("")}function JM(n,t){if(!n||typeof n!="object"||n.errcode!==0)throw new gt("registration-rejected",`\u9489\u9489\u626B\u7801${t}\u5931\u8D25\u3002`);return n}function qM(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function Mx({fetchImpl:n=fetch,registrationBaseUrl:t=process.env.DINGTALK_REGISTRATION_BASE_URL||yx,registrationSource:o=process.env.DINGTALK_REGISTRATION_SOURCE||Yle,now:i=()=>Date.now(),cardMinIntervalMs:e=50,cardBackoffMs:a=1e3,delay:A=epe}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");if(typeof i!="function")throw new TypeError("now must be a function");if(!Number.isFinite(e)||e<0)throw new TypeError("cardMinIntervalMs must be a non-negative number");if(!Number.isFinite(a)||a<0)throw new TypeError("cardBackoffMs must be a non-negative number");if(typeof A!="function")throw new TypeError("delay must be a function");let r=zM(t,{label:"\u9489\u9489\u6CE8\u518C\u670D\u52A1",requireSubdomain:!1}),s=new URL(xle),g=WA(o);if(!g)throw new TypeError("registrationSource is required");let c=new Map,I=new Map,d=new Map,B=Promise.resolve(),f=0,Q=(F,q)=>new URL(q.replace(/^\//,""),F);async function y({clientId:F,clientSecret:q,signal:V,requestKind:x="normal"}){let G=WA(F),J=WA(q);if(!G||!J)throw new TypeError("clientId and clientSecret are required");let U=c.get(G);if(U&&U.expiresAt>i())return U.token;let N=x==="reaction"?d:I;if(N.has(G))return N.get(G);let z=(async()=>{let Ae=await En(n,Q(s,"v1.0/oauth2/accessToken"),{body:{appKey:G,appSecret:J},signal:V,action:"\u9274\u6743"}),ie=WA(Ae?.accessToken);if(!ie)throw new gt("invalid-access-token","\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002");let we=qM(Ae?.expireIn??Ae?.expiresIn,7200),se=Math.max(1e3,(we-60)*1e3);return c.set(G,{token:ie,expiresAt:i()+se}),ie})().finally(()=>N.delete(G));return N.set(G,z),z}async function m({clientId:F,clientSecret:q,robotCode:V,messageId:x,conversationId:G,reactionName:J=TI,signal:U},N){let k=WA(F),z=WA(q),Ae=WA(V)??k,ie=WA(x),we=WA(G),se=WA(J);if(!k||!z)throw new TypeError("clientId and clientSecret are required");if(!Ae)throw new TypeError("robotCode is required");if(!ie||!we)throw new TypeError("messageId and conversationId are required");if(!se)throw new TypeError("reactionName is required");let Te=await y({clientId:k,clientSecret:z,signal:U,requestKind:"reaction"}),fe=await En(n,Q(s,`v1.0/robot/emotion/${N}`),{body:{robotCode:Ae,openMsgId:ie,openConversationId:we,emotionType:2,emotionName:se,textEmotion:{emotionId:zle,emotionName:se,text:se,backgroundId:Vle}},headers:{"x-acs-dingtalk-access-token":Te},signal:U,timeoutMs:qle,action:N==="reply"?"\u6D88\u606F\u72B6\u6001\u6DFB\u52A0":"\u6D88\u606F\u72B6\u6001\u64A4\u56DE"}),ke=fe?.success===!1?LE(fe?.code??fe?.errcode)??"rejected":CQ(fe);if(ke)throw new gt("reaction-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6D88\u606F\u72B6\u6001\u8BF7\u6C42\u3002",{providerCode:ke});return!0}async function T({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,kind:J}){let U=WA(V),N=WA(x);if(!U||!N)throw new TypeError("robotCode and downloadCode are required");let k=await y({clientId:F,clientSecret:q,signal:G}),z;try{z=await En(n,Q(s,"v1.0/robot/messageFiles/download"),{body:{downloadCode:N,robotCode:U},headers:{"x-acs-dingtalk-access-token":k},signal:G,action:`${J==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740`})}catch(ie){throw G?.aborted?ie:new gt(`${J}-download-address-failed`,`\u9489\u9489${J==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u83B7\u53D6\u5931\u8D25\u3002`,{cause:ie,status:ie?.status,providerCode:ie?.providerCode})}let Ae=WA(z?.downloadUrl??z?.download_url);if(!Ae)throw new gt(`invalid-${J}-download`,`\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE${J==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u3002`);return $le(Ae)}function _(F){let q=async()=>{let x=Math.max(0,f-i());x>0&&await A(x,F),f=Math.max(f,i())+e},V=B.then(q,q);return B=V.catch(()=>{}),V}async function R(F,q){await _(q.signal);try{return await En(n,Q(s,F),q)}catch(V){if(!(V instanceof gt)||V.status!==403)throw V;return await A(a,q.signal),await _(q.signal),En(n,Q(s,F),q)}}async function K({clientId:F,clientSecret:q,cardInstanceId:V,text:x,target:G,signal:J}){let U=WA(V),N=WA(x);if(!U)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let z={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:J})},Ae=[R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:U,guid:PE(),key:"msgContent",content:FE(N,G),isFull:!0,isFinalize:!1,isError:!0},headers:z,signal:J,action:"AI Card \u5931\u8D25\u6536\u53E3"}),R("v1.0/card/instances",{method:"PUT",body:{outTrackId:U,cardData:jM(N,"5",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:z,signal:J,action:"AI Card \u5931\u8D25\u72B6\u6001"})],ie=await Promise.allSettled(Ae);if(ie.every(({status:we})=>we==="rejected"))throw ie[0].reason;return!0}async function L({clientId:F,clientSecret:q,target:V,file:x,signal:G},{uploadType:J,messageKey:U,createMessageParams:N}){if(!x||typeof x!="object"||typeof x.fileName!="string"||!x.fileName||!Buffer.isBuffer(x.bytes))throw new TypeError("A DingTalk file is required");let k=Sx(V),z;try{z=await y({clientId:F,clientSecret:q,signal:G})}catch(ve){if(G?.aborted)throw Xn(G);let aA=Number(ve?.status),Be=ve?.code==="http-error"&&aA>=400&&aA<500?"artifact-provider-rejected":"artifact-provider-failed";throw GE(ve,{fallback:Be})}let Ae=new URL("media/upload",yx);Ae.searchParams.set("access_token",z),Ae.searchParams.set("type",J);let ie=new FormData;ie.append("media",new Blob([x.bytes],{type:x.mediaType??"application/octet-stream"}),x.fileName);let we;try{we=await Ape(n,Ae,{body:ie,signal:G})}catch(ve){if(G?.aborted)throw Xn(G);let aA=Number(ve?.status),Be=ve?.code==="http-error"&&aA>=400&&aA<500?"artifact-provider-rejected":"artifact-provider-failed";throw GE(ve,{fallback:Be})}let se=CQ(we),Te=WA(we?.media_id);if(se||!Te)throw GE(new gt("upload-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u3002",{providerCode:se??"missing-media-id"}));G?.throwIfAborted();let fe={robotCode:k.robotCode,msgKey:U,msgParam:JSON.stringify(N(Te,x)),...k.type==="group"?{openConversationId:k.openConversationId}:{userIds:[k.userId]}},ke=k.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",Re;try{Re=await En(n,Q(s,ke),{body:fe,headers:{"x-acs-dingtalk-access-token":z},signal:G,action:"\u6587\u4EF6\u6D88\u606F\u53D1\u9001"})}catch(ve){throw Xle(ve,G)}let We=CQ(Re);if(We)throw GE(new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:We}));return Re}return Object.freeze({async beginRegistration({signal:F}={}){let q=JM(await En(n,Q(r,"app/registration/init"),{body:{source:g},signal:F,action:"\u521D\u59CB\u5316"}),"\u521D\u59CB\u5316"),V=WA(q.nonce);if(!V)throw new gt("invalid-registration","\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002");let x=JM(await En(n,Q(r,"app/registration/begin"),{body:{nonce:V},signal:F,action:"\u521B\u5EFA"}),"\u521B\u5EFA"),G=WA(x.device_code),J=WA(x.verification_uri_complete);if(!G||!J)throw new gt("invalid-registration","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002");let U=zM(J,{label:"\u9489\u9489\u626B\u7801",requireSubdomain:!1}).toString();return{deviceCode:G,userCode:WA(x.user_code)??void 0,verificationUri:WA(x.verification_uri)??void 0,verificationUriComplete:U,expiresInSeconds:qM(x.expires_in,7200),intervalSeconds:qM(x.interval,5)}},async pollRegistration({deviceCode:F,signal:q}={}){let V=WA(F);if(!V)throw new TypeError("deviceCode is required");let x=JM(await En(n,Q(r,"app/registration/poll"),{body:{device_code:V},signal:q,action:"\u72B6\u6001\u67E5\u8BE2"}),"\u72B6\u6001\u67E5\u8BE2"),G=WA(x.status)?.toUpperCase();if(!G||!Wle.has(G))throw new gt("invalid-registration-status","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002");let J={status:G,failReason:WA(x.fail_reason)??void 0};if(G==="SUCCESS"&&(J.clientId=WA(x.client_id)??void 0,J.clientSecret=WA(x.client_secret)??void 0,!J.clientId||!J.clientSecret))throw new gt("missing-credentials","\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002");return J},accessToken:y,async addReaction(F){return m(F,"reply")},async recallReaction(F){return m(F,"recall")},async addThinkingReaction(F){return m({...F,reactionName:TI},"reply")},async recallThinkingReaction(F){return m({...F,reactionName:TI},"recall")},async downloadImage({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,maxBytes:J}){let U=await T({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,kind:"image"});try{return await Do(U,{fetchImpl:n,signal:G,maxBytes:J})}catch(N){throw G?.aborted||N instanceof ut?N:new gt("image-content-download-failed","\u9489\u9489\u56FE\u7247\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:N})}},async downloadFile({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G}){let J=await T({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,kind:"file"});if(J.protocol!=="https:")throw new gt("invalid-file-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0B\u8F7D\u5730\u5740\u3002");try{let U=await n(J,{method:"GET",redirect:"follow",signal:G});if(!U?.ok)throw await U?.body?.cancel?.().catch?.(()=>{}),new gt("file-content-download-failed",`\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${U?.status??"unknown"}\uFF09\u3002`,{status:U?.status});return Buffer.from(await U.arrayBuffer())}catch(U){throw G?.aborted?Xn(G):U instanceof gt?U:new gt("file-content-download-failed","\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:U})}},async createAiCard({clientId:F,clientSecret:q,target:V,initialText:x,signal:G}){let J=WA(F),U=WA(q),N=WA(x);if(!J||!U)throw new TypeError("clientId and clientSecret are required");if(!N)throw new TypeError("initialText is required");let k=rpe(V),z=await y({clientId:J,clientSecret:U,signal:G}),Ae=`dsh_${PE()}`,ie={"x-acs-dingtalk-access-token":z},we=!1;try{await R("v1.0/card/instances",{body:{cardTemplateId:jle,outTrackId:Ae,cardData:{cardParamMap:{config:JSON.stringify({autoLayout:!0})}},callbackType:"STREAM",cardAtUserIds:k.atUserIds?Object.keys(k.atUserIds):void 0,imGroupOpenSpaceModel:{supportForward:!0},imRobotOpenSpaceModel:{supportForward:!0}},headers:ie,signal:G,action:"AI Card \u521B\u5EFA"}),await R("v1.0/card/instances/deliver",{body:ape(Ae,k,J),headers:ie,signal:G,action:"AI Card \u6295\u653E"}),we=!0,await R("v1.0/card/instances",{method:"PUT",body:{outTrackId:Ae,cardData:jM(N,"2",k)},headers:ie,signal:G,action:"AI Card \u542F\u52A8"}),await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:Ae,guid:PE(),key:"msgContent",content:FE(N,k).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:ie,signal:G,action:"AI Card \u542F\u52A8"})}catch(se){if(we){let Te=AbortSignal.timeout(5e3);await K({clientId:J,clientSecret:U,cardInstanceId:Ae,text:w("\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002"),target:k,signal:Te}).catch(()=>{})}throw se}return{cardInstanceId:Ae}},async updateAiCard({clientId:F,clientSecret:q,cardInstanceId:V,text:x,target:G,signal:J}){let U=WA(V),N=WA(x);if(!U)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let k=await y({clientId:F,clientSecret:q,signal:J});return await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:U,guid:PE(),key:"msgContent",content:FE(N,G).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:{"x-acs-dingtalk-access-token":k},signal:J,action:"AI Card \u66F4\u65B0"}),!0},async finishAiCard({clientId:F,clientSecret:q,cardInstanceId:V,text:x,target:G,signal:J}){let U=WA(V),N=WA(x);if(!U)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let z={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:J})},Ae=FE(N,G);await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:U,guid:PE(),key:"msgContent",content:Ae,isFull:!0,isFinalize:!0,isError:!1},headers:z,signal:J,action:"AI Card \u5B8C\u6210"});let ie=!0,we={method:"PUT",body:{outTrackId:U,cardData:jM(N,"3",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:z,signal:J,action:"AI Card \u6536\u53E3"};try{await R("v1.0/card/instances",we)}catch{try{await R("v1.0/card/instances",we)}catch{ie=!1}}return{delivered:!0,completed:ie}},failAiCard:K,async sendText({clientId:F,clientSecret:q,sessionWebhook:V,text:x,at:G,signal:J}){let U=WA(x);if(!U)throw new TypeError("text is required");let N=gc(V),k=await y({clientId:F,clientSecret:q,signal:J}),z=G&&typeof G=="object"&&(Array.isArray(G.atUserIds)&&G.atUserIds.length>0||Array.isArray(G.atMobiles)&&G.atMobiles.length>0||G.isAtAll===!0)?{at:G}:{},Ae=await En(n,N,{body:{msgtype:"text",text:{content:U},...z},headers:{"x-acs-dingtalk-access-token":k},signal:J,action:"\u6D88\u606F\u56DE\u590D"});if(Ae?.errcode!==void 0&&Ae.errcode!==0||Ae?.code!==void 0&&Ae.code!==0)throw new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002");return!0},async sendRobotText({clientId:F,clientSecret:q,target:V,text:x,signal:G}){if(typeof x!="string"||!x.trim())throw new TypeError("text is required");let J=x,U=Sx(V),N=await y({clientId:F,clientSecret:q,signal:G}),k={robotCode:U.robotCode,msgKey:"sampleText",msgParam:JSON.stringify({content:J}),...U.type==="group"?{openConversationId:U.openConversationId}:{userIds:[U.userId]}},z=U.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",Ae=await En(n,Q(s,z),{body:k,headers:{"x-acs-dingtalk-access-token":N},signal:G,action:"\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u53D1\u9001"}),ie=CQ(Ae);if(ie)throw new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u3002",{providerCode:ie});return Ae},async sendFile(F){return L(F,{uploadType:"file",messageKey:"sampleFile",createMessageParams:(q,V)=>({mediaId:q,fileName:V.fileName,fileType:tpe(V.fileName)})})},async sendImage(F){return L(F,{uploadType:"image",messageKey:"sampleImageMsg",createMessageParams:q=>({photoURL:q})})},clearAccessToken(F){let q=WA(F);q&&c.delete(q)}})}var ope=500,npe="\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002";function VM(n,t){if(typeof n!="string")throw new TypeError(`${t} must be a string`);return n}function _x(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} is required`);return n.trim()}function Tx({api:n,clientId:t,clientSecret:o,target:i,signal:e,logger:a=console,updateIntervalMs:A=ope,clock:r=()=>Date.now(),timer:s={setTimeout:(g,c)=>globalThis.setTimeout(g,c),clearTimeout:g=>globalThis.clearTimeout(g)}}={}){if(!n||typeof n.createAiCard!="function"||typeof n.updateAiCard!="function"||typeof n.finishAiCard!="function")throw new TypeError("DingTalk AI Card API is required");let g=_x(t,"clientId"),c=_x(o,"clientSecret");if(i==null)throw new TypeError("target is required");if(!Number.isFinite(A)||A<0)throw new TypeError("updateIntervalMs must be a non-negative number");if(typeof r!="function")throw new TypeError("clock must be a function");if(typeof s?.setTimeout!="function"||typeof s?.clearTimeout!="function")throw new TypeError("timer must provide setTimeout and clearTimeout");let I=()=>{let N=r();if(!Number.isFinite(N))throw new TypeError("clock must return a finite timestamp");return N};I();let d=e?.aborted?"aborted":"idle",B=null,f=null,Q=null,y=null,m=null,T=null,_=0,R=()=>{Q!==null&&(s.clearTimeout(Q),Q=null)},K=()=>e?.removeEventListener("abort",V),L=N=>{d=N,f=null,R(),K()},F=()=>!B||typeof n.failAiCard!="function"?Promise.resolve(!1):(T||(T=n.failAiCard({...B,text:w(npe),signal:AbortSignal.timeout(5e3)}).then(()=>!0,()=>!1)),T),q=N=>{d==="failed"||d==="finished"||d==="aborted"||(F(),L("failed"),a?.error?.(`[dsh-dingtalk] AI Card ${N} failed`))};function V(){d==="finished"||d==="failed"||d==="aborted"||(F(),L("aborted"))}d!=="aborted"&&e?.addEventListener("abort",V,{once:!0});let x=()=>{if(d!=="active"||y||f===null)return;let N=Math.max(0,_+A-I());if(N>0){Q=s.setTimeout(()=>{Q=null,x()},N);return}let k=f;f=null,y=(async()=>{try{await n.updateAiCard({...B,text:k,finished:!1}),_=I()}catch{if(e?.aborted||d==="aborted")return;q("update")}})().finally(()=>{y=null,d==="active"&&f!==null&&x()})};return Object.freeze({start:async N=>{if(VM(N,"initialText"),d!=="idle")return!1;d="starting";try{let k=await n.createAiCard({clientId:g,clientSecret:c,target:i,initialText:N,signal:e}),z=typeof k?.cardInstanceId=="string"?k.cardInstanceId.trim():"";if(!z)throw new TypeError("DingTalk did not return a card instance id");return B=Object.freeze({clientId:g,clientSecret:c,target:i,cardInstanceId:z,signal:e}),d!=="starting"?(F(),!1):(_=I(),d="active",!0)}catch{return e?.aborted||d==="aborted"?(L("aborted"),!1):(q("creation"),!1)}},push:N=>{VM(N,"progressText"),d==="active"&&(f=N,!Q&&!y&&x())},finish:N=>{if(VM(N,"finalText"),d==="finished")return Promise.resolve(!0);if(d==="finishing")return m;if(d!=="active")return Promise.resolve(!1);d="finishing",f=null,R();let k=y;return m=(async()=>{if(k&&await k,d!=="finishing")return!1;try{return await n.finishAiCard({...B,text:N}),d!=="finishing"?!1:(L("finished"),!0)}catch{return e?.aborted||d==="aborted"?(L("aborted"),!1):(q("finish"),!1)}})(),m}})}function uQ(n){return typeof n=="string"&&n.trim()?n.trim():null}function mi(n){return n&&typeof n.id=="string"&&typeof n.question=="string"&&(n.header===void 0||typeof n.header=="string")&&(n.detail===void 0||typeof n.detail=="string")&&(n.multiSelect===void 0||typeof n.multiSelect=="boolean")&&(n.options===void 0||Array.isArray(n.options)&&n.options.every(t=>t&&typeof t.label=="string"&&(t.description===void 0||typeof t.description=="string")))}function Si(n,t,o,{requiresMention:i=!1}={}){let e=[],a=o>1?`\uFF08${t+1}/${o}\uFF09`:"";e.push(w("DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A",{progress:a})),uQ(n.header)&&e.push("",n.header.trim()),e.push("",uQ(n.question)??w("\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002")),uQ(n.detail)&&e.push("",n.detail.trim());let A=Array.isArray(n.options)?n.options:[];return A.length>0?(e.push(""),A.forEach((r,s)=>{let g=typeof r?.label=="string"?r.label:"",c=uQ(r?.description);e.push(`${s+1}. ${g}${c?` \u2014 ${c}`:""}`)}),e.push("",n.multiSelect===!0?w("\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002"):w("\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002"))):e.push("",w("\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002")),i&&e.push("",w("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002")),e.join(` +`:`${e}
`}).join("")}function JM(n,t){if(!n||typeof n!="object"||n.errcode!==0)throw new gt("registration-rejected",`\u9489\u9489\u626B\u7801${t}\u5931\u8D25\u3002`);return n}function qM(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function Mx({fetchImpl:n=fetch,registrationBaseUrl:t=process.env.DINGTALK_REGISTRATION_BASE_URL||yx,registrationSource:o=process.env.DINGTALK_REGISTRATION_SOURCE||Yle,now:i=()=>Date.now(),cardMinIntervalMs:e=50,cardBackoffMs:a=1e3,delay:A=epe}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");if(typeof i!="function")throw new TypeError("now must be a function");if(!Number.isFinite(e)||e<0)throw new TypeError("cardMinIntervalMs must be a non-negative number");if(!Number.isFinite(a)||a<0)throw new TypeError("cardBackoffMs must be a non-negative number");if(typeof A!="function")throw new TypeError("delay must be a function");let r=zM(t,{label:"\u9489\u9489\u6CE8\u518C\u670D\u52A1",requireSubdomain:!1}),s=new URL(xle),g=WA(o);if(!g)throw new TypeError("registrationSource is required");let c=new Map,I=new Map,d=new Map,B=Promise.resolve(),f=0,Q=(F,q)=>new URL(q.replace(/^\//,""),F);async function y({clientId:F,clientSecret:q,signal:V,requestKind:x="normal"}){let G=WA(F),J=WA(q);if(!G||!J)throw new TypeError("clientId and clientSecret are required");let U=c.get(G);if(U&&U.expiresAt>i())return U.token;let N=x==="reaction"?d:I;if(N.has(G))return N.get(G);let z=(async()=>{let Ae=await En(n,Q(s,"v1.0/oauth2/accessToken"),{body:{appKey:G,appSecret:J},signal:V,action:"\u9274\u6743"}),ie=WA(Ae?.accessToken);if(!ie)throw new gt("invalid-access-token","\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002");let we=qM(Ae?.expireIn??Ae?.expiresIn,7200),se=Math.max(1e3,(we-60)*1e3);return c.set(G,{token:ie,expiresAt:i()+se}),ie})().finally(()=>N.delete(G));return N.set(G,z),z}async function m({clientId:F,clientSecret:q,robotCode:V,messageId:x,conversationId:G,reactionName:J=TI,signal:U},N){let k=WA(F),z=WA(q),Ae=WA(V)??k,ie=WA(x),we=WA(G),se=WA(J);if(!k||!z)throw new TypeError("clientId and clientSecret are required");if(!Ae)throw new TypeError("robotCode is required");if(!ie||!we)throw new TypeError("messageId and conversationId are required");if(!se)throw new TypeError("reactionName is required");let Te=await y({clientId:k,clientSecret:z,signal:U,requestKind:"reaction"}),fe=await En(n,Q(s,`v1.0/robot/emotion/${N}`),{body:{robotCode:Ae,openMsgId:ie,openConversationId:we,emotionType:2,emotionName:se,textEmotion:{emotionId:zle,emotionName:se,text:se,backgroundId:Vle}},headers:{"x-acs-dingtalk-access-token":Te},signal:U,timeoutMs:qle,action:N==="reply"?"\u6D88\u606F\u72B6\u6001\u6DFB\u52A0":"\u6D88\u606F\u72B6\u6001\u64A4\u56DE"}),ke=fe?.success===!1?UE(fe?.code??fe?.errcode)??"rejected":CQ(fe);if(ke)throw new gt("reaction-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6D88\u606F\u72B6\u6001\u8BF7\u6C42\u3002",{providerCode:ke});return!0}async function T({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,kind:J}){let U=WA(V),N=WA(x);if(!U||!N)throw new TypeError("robotCode and downloadCode are required");let k=await y({clientId:F,clientSecret:q,signal:G}),z;try{z=await En(n,Q(s,"v1.0/robot/messageFiles/download"),{body:{downloadCode:N,robotCode:U},headers:{"x-acs-dingtalk-access-token":k},signal:G,action:`${J==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740`})}catch(ie){throw G?.aborted?ie:new gt(`${J}-download-address-failed`,`\u9489\u9489${J==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u83B7\u53D6\u5931\u8D25\u3002`,{cause:ie,status:ie?.status,providerCode:ie?.providerCode})}let Ae=WA(z?.downloadUrl??z?.download_url);if(!Ae)throw new gt(`invalid-${J}-download`,`\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE${J==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u3002`);return $le(Ae)}function _(F){let q=async()=>{let x=Math.max(0,f-i());x>0&&await A(x,F),f=Math.max(f,i())+e},V=B.then(q,q);return B=V.catch(()=>{}),V}async function R(F,q){await _(q.signal);try{return await En(n,Q(s,F),q)}catch(V){if(!(V instanceof gt)||V.status!==403)throw V;return await A(a,q.signal),await _(q.signal),En(n,Q(s,F),q)}}async function K({clientId:F,clientSecret:q,cardInstanceId:V,text:x,target:G,signal:J}){let U=WA(V),N=WA(x);if(!U)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let z={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:J})},Ae=[R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:U,guid:GE(),key:"msgContent",content:LE(N,G),isFull:!0,isFinalize:!1,isError:!0},headers:z,signal:J,action:"AI Card \u5931\u8D25\u6536\u53E3"}),R("v1.0/card/instances",{method:"PUT",body:{outTrackId:U,cardData:jM(N,"5",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:z,signal:J,action:"AI Card \u5931\u8D25\u72B6\u6001"})],ie=await Promise.allSettled(Ae);if(ie.every(({status:we})=>we==="rejected"))throw ie[0].reason;return!0}async function L({clientId:F,clientSecret:q,target:V,file:x,signal:G},{uploadType:J,messageKey:U,createMessageParams:N}){if(!x||typeof x!="object"||typeof x.fileName!="string"||!x.fileName||!Buffer.isBuffer(x.bytes))throw new TypeError("A DingTalk file is required");let k=Sx(V),z;try{z=await y({clientId:F,clientSecret:q,signal:G})}catch(ve){if(G?.aborted)throw Xn(G);let aA=Number(ve?.status),Be=ve?.code==="http-error"&&aA>=400&&aA<500?"artifact-provider-rejected":"artifact-provider-failed";throw FE(ve,{fallback:Be})}let Ae=new URL("media/upload",yx);Ae.searchParams.set("access_token",z),Ae.searchParams.set("type",J);let ie=new FormData;ie.append("media",new Blob([x.bytes],{type:x.mediaType??"application/octet-stream"}),x.fileName);let we;try{we=await Ape(n,Ae,{body:ie,signal:G})}catch(ve){if(G?.aborted)throw Xn(G);let aA=Number(ve?.status),Be=ve?.code==="http-error"&&aA>=400&&aA<500?"artifact-provider-rejected":"artifact-provider-failed";throw FE(ve,{fallback:Be})}let se=CQ(we),Te=WA(we?.media_id);if(se||!Te)throw FE(new gt("upload-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u3002",{providerCode:se??"missing-media-id"}));G?.throwIfAborted();let fe={robotCode:k.robotCode,msgKey:U,msgParam:JSON.stringify(N(Te,x)),...k.type==="group"?{openConversationId:k.openConversationId}:{userIds:[k.userId]}},ke=k.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",Re;try{Re=await En(n,Q(s,ke),{body:fe,headers:{"x-acs-dingtalk-access-token":z},signal:G,action:"\u6587\u4EF6\u6D88\u606F\u53D1\u9001"})}catch(ve){throw Xle(ve,G)}let We=CQ(Re);if(We)throw FE(new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:We}));return Re}return Object.freeze({async beginRegistration({signal:F}={}){let q=JM(await En(n,Q(r,"app/registration/init"),{body:{source:g},signal:F,action:"\u521D\u59CB\u5316"}),"\u521D\u59CB\u5316"),V=WA(q.nonce);if(!V)throw new gt("invalid-registration","\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002");let x=JM(await En(n,Q(r,"app/registration/begin"),{body:{nonce:V},signal:F,action:"\u521B\u5EFA"}),"\u521B\u5EFA"),G=WA(x.device_code),J=WA(x.verification_uri_complete);if(!G||!J)throw new gt("invalid-registration","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002");let U=zM(J,{label:"\u9489\u9489\u626B\u7801",requireSubdomain:!1}).toString();return{deviceCode:G,userCode:WA(x.user_code)??void 0,verificationUri:WA(x.verification_uri)??void 0,verificationUriComplete:U,expiresInSeconds:qM(x.expires_in,7200),intervalSeconds:qM(x.interval,5)}},async pollRegistration({deviceCode:F,signal:q}={}){let V=WA(F);if(!V)throw new TypeError("deviceCode is required");let x=JM(await En(n,Q(r,"app/registration/poll"),{body:{device_code:V},signal:q,action:"\u72B6\u6001\u67E5\u8BE2"}),"\u72B6\u6001\u67E5\u8BE2"),G=WA(x.status)?.toUpperCase();if(!G||!Wle.has(G))throw new gt("invalid-registration-status","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002");let J={status:G,failReason:WA(x.fail_reason)??void 0};if(G==="SUCCESS"&&(J.clientId=WA(x.client_id)??void 0,J.clientSecret=WA(x.client_secret)??void 0,!J.clientId||!J.clientSecret))throw new gt("missing-credentials","\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002");return J},accessToken:y,async addReaction(F){return m(F,"reply")},async recallReaction(F){return m(F,"recall")},async addThinkingReaction(F){return m({...F,reactionName:TI},"reply")},async recallThinkingReaction(F){return m({...F,reactionName:TI},"recall")},async downloadImage({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,maxBytes:J}){let U=await T({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,kind:"image"});try{return await Do(U,{fetchImpl:n,signal:G,maxBytes:J})}catch(N){throw G?.aborted||N instanceof ut?N:new gt("image-content-download-failed","\u9489\u9489\u56FE\u7247\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:N})}},async downloadFile({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G}){let J=await T({clientId:F,clientSecret:q,robotCode:V,downloadCode:x,signal:G,kind:"file"});if(J.protocol!=="https:")throw new gt("invalid-file-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0B\u8F7D\u5730\u5740\u3002");try{let U=await n(J,{method:"GET",redirect:"follow",signal:G});if(!U?.ok)throw await U?.body?.cancel?.().catch?.(()=>{}),new gt("file-content-download-failed",`\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${U?.status??"unknown"}\uFF09\u3002`,{status:U?.status});return Buffer.from(await U.arrayBuffer())}catch(U){throw G?.aborted?Xn(G):U instanceof gt?U:new gt("file-content-download-failed","\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:U})}},async createAiCard({clientId:F,clientSecret:q,target:V,initialText:x,signal:G}){let J=WA(F),U=WA(q),N=WA(x);if(!J||!U)throw new TypeError("clientId and clientSecret are required");if(!N)throw new TypeError("initialText is required");let k=rpe(V),z=await y({clientId:J,clientSecret:U,signal:G}),Ae=`dsh_${GE()}`,ie={"x-acs-dingtalk-access-token":z},we=!1;try{await R("v1.0/card/instances",{body:{cardTemplateId:jle,outTrackId:Ae,cardData:{cardParamMap:{config:JSON.stringify({autoLayout:!0})}},callbackType:"STREAM",cardAtUserIds:k.atUserIds?Object.keys(k.atUserIds):void 0,imGroupOpenSpaceModel:{supportForward:!0},imRobotOpenSpaceModel:{supportForward:!0}},headers:ie,signal:G,action:"AI Card \u521B\u5EFA"}),await R("v1.0/card/instances/deliver",{body:ape(Ae,k,J),headers:ie,signal:G,action:"AI Card \u6295\u653E"}),we=!0,await R("v1.0/card/instances",{method:"PUT",body:{outTrackId:Ae,cardData:jM(N,"2",k)},headers:ie,signal:G,action:"AI Card \u542F\u52A8"}),await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:Ae,guid:GE(),key:"msgContent",content:LE(N,k).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:ie,signal:G,action:"AI Card \u542F\u52A8"})}catch(se){if(we){let Te=AbortSignal.timeout(5e3);await K({clientId:J,clientSecret:U,cardInstanceId:Ae,text:w("\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002"),target:k,signal:Te}).catch(()=>{})}throw se}return{cardInstanceId:Ae}},async updateAiCard({clientId:F,clientSecret:q,cardInstanceId:V,text:x,target:G,signal:J}){let U=WA(V),N=WA(x);if(!U)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let k=await y({clientId:F,clientSecret:q,signal:J});return await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:U,guid:GE(),key:"msgContent",content:LE(N,G).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:{"x-acs-dingtalk-access-token":k},signal:J,action:"AI Card \u66F4\u65B0"}),!0},async finishAiCard({clientId:F,clientSecret:q,cardInstanceId:V,text:x,target:G,signal:J}){let U=WA(V),N=WA(x);if(!U)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let z={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:J})},Ae=LE(N,G);await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:U,guid:GE(),key:"msgContent",content:Ae,isFull:!0,isFinalize:!0,isError:!1},headers:z,signal:J,action:"AI Card \u5B8C\u6210"});let ie=!0,we={method:"PUT",body:{outTrackId:U,cardData:jM(N,"3",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:z,signal:J,action:"AI Card \u6536\u53E3"};try{await R("v1.0/card/instances",we)}catch{try{await R("v1.0/card/instances",we)}catch{ie=!1}}return{delivered:!0,completed:ie}},failAiCard:K,async sendText({clientId:F,clientSecret:q,sessionWebhook:V,text:x,at:G,signal:J}){let U=WA(x);if(!U)throw new TypeError("text is required");let N=gc(V),k=await y({clientId:F,clientSecret:q,signal:J}),z=G&&typeof G=="object"&&(Array.isArray(G.atUserIds)&&G.atUserIds.length>0||Array.isArray(G.atMobiles)&&G.atMobiles.length>0||G.isAtAll===!0)?{at:G}:{},Ae=await En(n,N,{body:{msgtype:"text",text:{content:U},...z},headers:{"x-acs-dingtalk-access-token":k},signal:J,action:"\u6D88\u606F\u56DE\u590D"});if(Ae?.errcode!==void 0&&Ae.errcode!==0||Ae?.code!==void 0&&Ae.code!==0)throw new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002");return!0},async sendRobotText({clientId:F,clientSecret:q,target:V,text:x,signal:G}){if(typeof x!="string"||!x.trim())throw new TypeError("text is required");let J=x,U=Sx(V),N=await y({clientId:F,clientSecret:q,signal:G}),k={robotCode:U.robotCode,msgKey:"sampleText",msgParam:JSON.stringify({content:J}),...U.type==="group"?{openConversationId:U.openConversationId}:{userIds:[U.userId]}},z=U.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",Ae=await En(n,Q(s,z),{body:k,headers:{"x-acs-dingtalk-access-token":N},signal:G,action:"\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u53D1\u9001"}),ie=CQ(Ae);if(ie)throw new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u3002",{providerCode:ie});return Ae},async sendFile(F){return L(F,{uploadType:"file",messageKey:"sampleFile",createMessageParams:(q,V)=>({mediaId:q,fileName:V.fileName,fileType:tpe(V.fileName)})})},async sendImage(F){return L(F,{uploadType:"image",messageKey:"sampleImageMsg",createMessageParams:q=>({photoURL:q})})},clearAccessToken(F){let q=WA(F);q&&c.delete(q)}})}var ope=500,npe="\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002";function VM(n,t){if(typeof n!="string")throw new TypeError(`${t} must be a string`);return n}function _x(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} is required`);return n.trim()}function Tx({api:n,clientId:t,clientSecret:o,target:i,signal:e,logger:a=console,updateIntervalMs:A=ope,clock:r=()=>Date.now(),timer:s={setTimeout:(g,c)=>globalThis.setTimeout(g,c),clearTimeout:g=>globalThis.clearTimeout(g)}}={}){if(!n||typeof n.createAiCard!="function"||typeof n.updateAiCard!="function"||typeof n.finishAiCard!="function")throw new TypeError("DingTalk AI Card API is required");let g=_x(t,"clientId"),c=_x(o,"clientSecret");if(i==null)throw new TypeError("target is required");if(!Number.isFinite(A)||A<0)throw new TypeError("updateIntervalMs must be a non-negative number");if(typeof r!="function")throw new TypeError("clock must be a function");if(typeof s?.setTimeout!="function"||typeof s?.clearTimeout!="function")throw new TypeError("timer must provide setTimeout and clearTimeout");let I=()=>{let N=r();if(!Number.isFinite(N))throw new TypeError("clock must return a finite timestamp");return N};I();let d=e?.aborted?"aborted":"idle",B=null,f=null,Q=null,y=null,m=null,T=null,_=0,R=()=>{Q!==null&&(s.clearTimeout(Q),Q=null)},K=()=>e?.removeEventListener("abort",V),L=N=>{d=N,f=null,R(),K()},F=()=>!B||typeof n.failAiCard!="function"?Promise.resolve(!1):(T||(T=n.failAiCard({...B,text:w(npe),signal:AbortSignal.timeout(5e3)}).then(()=>!0,()=>!1)),T),q=N=>{d==="failed"||d==="finished"||d==="aborted"||(F(),L("failed"),a?.error?.(`[dsh-dingtalk] AI Card ${N} failed`))};function V(){d==="finished"||d==="failed"||d==="aborted"||(F(),L("aborted"))}d!=="aborted"&&e?.addEventListener("abort",V,{once:!0});let x=()=>{if(d!=="active"||y||f===null)return;let N=Math.max(0,_+A-I());if(N>0){Q=s.setTimeout(()=>{Q=null,x()},N);return}let k=f;f=null,y=(async()=>{try{await n.updateAiCard({...B,text:k,finished:!1}),_=I()}catch{if(e?.aborted||d==="aborted")return;q("update")}})().finally(()=>{y=null,d==="active"&&f!==null&&x()})};return Object.freeze({start:async N=>{if(VM(N,"initialText"),d!=="idle")return!1;d="starting";try{let k=await n.createAiCard({clientId:g,clientSecret:c,target:i,initialText:N,signal:e}),z=typeof k?.cardInstanceId=="string"?k.cardInstanceId.trim():"";if(!z)throw new TypeError("DingTalk did not return a card instance id");return B=Object.freeze({clientId:g,clientSecret:c,target:i,cardInstanceId:z,signal:e}),d!=="starting"?(F(),!1):(_=I(),d="active",!0)}catch{return e?.aborted||d==="aborted"?(L("aborted"),!1):(q("creation"),!1)}},push:N=>{VM(N,"progressText"),d==="active"&&(f=N,!Q&&!y&&x())},finish:N=>{if(VM(N,"finalText"),d==="finished")return Promise.resolve(!0);if(d==="finishing")return m;if(d!=="active")return Promise.resolve(!1);d="finishing",f=null,R();let k=y;return m=(async()=>{if(k&&await k,d!=="finishing")return!1;try{return await n.finishAiCard({...B,text:N}),d!=="finishing"?!1:(L("finished"),!0)}catch{return e?.aborted||d==="aborted"?(L("aborted"),!1):(q("finish"),!1)}})(),m}})}function uQ(n){return typeof n=="string"&&n.trim()?n.trim():null}function mi(n){return n&&typeof n.id=="string"&&typeof n.question=="string"&&(n.header===void 0||typeof n.header=="string")&&(n.detail===void 0||typeof n.detail=="string")&&(n.multiSelect===void 0||typeof n.multiSelect=="boolean")&&(n.options===void 0||Array.isArray(n.options)&&n.options.every(t=>t&&typeof t.label=="string"&&(t.description===void 0||typeof t.description=="string")))}function Si(n,t,o,{requiresMention:i=!1}={}){let e=[],a=o>1?`\uFF08${t+1}/${o}\uFF09`:"";e.push(w("DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A",{progress:a})),uQ(n.header)&&e.push("",n.header.trim()),e.push("",uQ(n.question)??w("\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002")),uQ(n.detail)&&e.push("",n.detail.trim());let A=Array.isArray(n.options)?n.options:[];return A.length>0?(e.push(""),A.forEach((r,s)=>{let g=typeof r?.label=="string"?r.label:"",c=uQ(r?.description);e.push(`${s+1}. ${g}${c?` \u2014 ${c}`:""}`)}),e.push("",n.multiSelect===!0?w("\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002"):w("\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002"))):e.push("",w("\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002")),i&&e.push("",w("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002")),e.join(` `)}function Nx(n,t){let o=n.trim();if(!o)return null;if(/^\d+$/.test(o)){let e=t[Number(o)-1];return typeof e?.label=="string"?e.label:null}let i=t.find(e=>e?.label===o);return typeof i?.label=="string"?i.label:null}function wi(n,t){let o=Array.isArray(n.options)?n.options:[];if(o.length===0)return{id:n.id,selected:[],custom:t};let i=Nx(t,o);if(n.multiSelect!==!0)return i?{id:n.id,selected:[i]}:{id:n.id,selected:[],custom:t};if(i)return{id:n.id,selected:[i]};let e=[],a=[];for(let A of t.split(/[,,、;;\n]+/)){let r=A.trim();if(!r)continue;let s=Nx(r,o);s?e.includes(s)||e.push(s):a.push(r)}return{id:n.id,selected:e,...a.length>0?{custom:a.join("\u3001")}:{}}}var spe=new Map([["\u6279\u51C6","allowed-once"],["\u540C\u610F","allowed-once"],["yes","allowed-once"],["\u62D2\u7EDD","rejected"],["\u4E0D\u540C\u610F","rejected"],["no","rejected"]]),WM="\u8BF7\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\uFF08\u4E5F\u652F\u6301\uFF1A\u540C\u610F / \u4E0D\u540C\u610F / yes / no\uFF09\u3002",gpe="\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002",wp="\u8BE5\u5BA1\u6279\u5DF2\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u590D\u3002",cpe=5*6e4,Ipe=2048;function Pa(n){return typeof n=="string"?n.trim():""}function ZM(n){return Pa(n).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"")}function lpe(n){return spe.get(Pa(n).toLowerCase())??null}function kx(n){return n?.type==="approval/requested"&&!!Pa(n.sessionId)&&!!Pa(n.approvalId)&&!!Pa(n.toolName)&&(n.callId===void 0||!!Pa(n.callId))&&(n.reason===void 0||typeof n.reason=="string")}function ppe(n){let t=n?.arguments;if(t!==null&&typeof t=="object")try{return JSON.stringify(t,null,2)}catch{return null}if(typeof t!="string")return null;let o=ZM(t);if(!o)return t===""?"{}":null;try{return JSON.stringify(JSON.parse(o),null,2)}catch{return o}}function XM(n,{toolCall:t,requiresMention:o=!1,maxArgumentsLength:i=6e3}={}){if(!kx(n))return null;let e=Pa(n.callId);if(!e||Pa(t?.callId)!==e||Pa(t?.name)!==Pa(n.toolName))return null;let a=ppe(t);if(!a||a.length>i)return null;let A=[w("DeepSeek Harness \u9700\u8981\u4F60\u7684\u5BA1\u6279\uFF1A"),"",w("\u5DE5\u5177\uFF1A{tool}",{tool:ZM(n.toolName)}),w("\u64CD\u4F5C\u53C2\u6570\uFF1A"),a],r=ZM(n.reason);return r&&A.push(w("\u539F\u56E0\uFF1A{reason}",{reason:r})),A.push("",w(WM)),o&&A.push("",w("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u5BA1\u6279\u51B3\u5B9A\u3002")),A.join(` `)}function Rx(n,t){return{ok:!0,value:{sessionId:n.sessionId,approvalId:n.approvalId,outcome:t}}}function BQ(n){return n==="allowed-once"?w("\u5DF2\u6279\u51C6\uFF0C\u4EC5\u5BF9\u672C\u6B21\u64CD\u4F5C\u6709\u6548\u3002"):n==="rejected"?w("\u5DF2\u62D2\u7EDD\u6B64\u6B21\u64CD\u4F5C\u3002"):w(wp)}var Di=class{#e;#A;#t=new Map;#r=new Map;#l=new Map;constructor({label:t="IM",logger:o=console}={}){this.#e=t,this.#A=o}hasPending(t){return this.#r.get(t)?.items.some(o=>!o.inactive)===!0}claimReply({key:t,actor:o,text:i,addressed:e=!0,hasPendingQuestion:a=!1,questionCompletion:A,isQuestionPending:r,send:s}){let c=this.#r.get(t)?.items[0],I=lpe(i),d=(f,Q=!1)=>({...Q?{resolved:!0}:{},process:async y=>{typeof y=="function"&&await y()===!1||await s(f)}}),B=a&&c&&A&&typeof A.then=="function";return a&&!B?null:!c||c.inactive?(this.#l.get(t)??0)<=Date.now()?(this.#l.delete(t),null):I?d(w(wp),!0):null:c.actor!==o||c.requiresMention&&e!==!0?I?d(w("\u53EA\u6709\u53D1\u8D77\u5F53\u524D\u4EFB\u52A1\u7684\u7528\u6237\u53EF\u4EE5\u5904\u7406\u8FD9\u6761\u5BA1\u6279\u3002")):null:{process:async f=>{let Q=c.presented,m=(c.replyTail??Promise.resolve()).catch(()=>{}).then(async()=>{if(!(typeof f=="function"&&await f()===!1)){if(B){if(await A.catch(()=>{}),c.inactive||c.resolving)return;if(typeof r=="function"&&r()){await s(w(gpe));return}}if(await c.activationTask?.catch(()=>{}),await c.presentationTask?.catch(()=>{}),c.inactive||c.resolving){await s(w(wp));return}if(c.send=s,!Q||!c.presented){if(c.presented||await this.#o(c),c.inactive||c.resolving)return;await s(w(WM));return}if(c.submitting){await s(w("\u5BA1\u6279\u51B3\u5B9A\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7A0D\u5019\u3002"));return}if(!I){await s(w(WM));return}await this.#i(c,I)}});c.replyTail=m;try{await m}finally{c.replyTail===m&&(c.replyTail=null)}}}}async handleRequested(t,o){if(t?.kind!=="approval")return!1;let i=t.payload,e=Pa(i?.approvalId);if(!Pa(t.rpcId)||!Pa(t.sessionId)||!e||!kx(i)||i.sessionId!==t.sessionId||typeof t.respond!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an invalid Harness approval`),!0;if(t.recovered===!0)return await this.#c(t,i),!0;let a=this.#t.get(e);if(a)return a.interaction=t,a.toolCall=t.toolCall,a.presented||await this.#o(a),!0;let A=o?.send,r=Pa(o?.key),s=Pa(o?.actor);if(!r||!s||typeof A!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an approval without a reply route`),await this.#c(t,i),!0;let g=XM(i,{toolCall:t.toolCall,requiresMention:o.requiresMention===!0});if(!g){let d=await this.#c(t,i);return await A(d?w("\u65E0\u6CD5\u5B8C\u6574\u5C55\u793A\u8FD9\u6B21\u64CD\u4F5C\uFF0C\u5DF2\u5B89\u5168\u62D2\u7EDD\u6B64\u6B21\u5BA1\u6279\u3002"):w(wp)),!0}let c={approvalId:e,sessionId:t.sessionId,interaction:t,toolCall:t.toolCall,key:r,actor:s,requiresMention:o.requiresMention===!0,send:A,text:g,presented:!1,presentationTask:null,deliveryCompleted:!1,replyTail:null,submitting:!1,inactive:!1,resolving:!1,closedOutcome:null,resolutionNotified:!1,activationTask:null};this.#t.set(e,c);let I=this.#r.get(r)??{items:[]};return I.items.push(c),this.#r.set(r,I),I.items[0]===c&&await this.#o(c),!0}async handleResolved(t){if(t?.kind!=="approval")return!1;let o=this.#t.get(Pa(t.interactionId));if(!o||(o.resolving=!0,o.activationTask&&await o.activationTask.catch(()=>{}),o.inactive||this.#t.get(o.approvalId)!==o))return!0;let i=o.presentationTask,e=o.presented||i,a=o.send,A=this.#s(o);return await this.#a(A,async()=>{let r=o.presented;i&&(r=await i.then(()=>!0,()=>!1)),e&&r&&(o.resolutionNotified=!0,await a(BQ(t.outcome)).catch(()=>{}))}),!0}async closeRoute(t){let o=this.#r.get(t);if(!o)return;let i=[...o.items];for(let e of i)this.#s(e);await Promise.all(i.map(async e=>{try{await e.interaction.respond(Rx(e,"rejected"),{signal:AbortSignal.timeout(5e3)}),e.closedOutcome="rejected",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(BQ("rejected")).catch(()=>{}))}catch(a){a?.code==="interaction-not-pending"?(e.closedOutcome="resolved",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(w(wp)).catch(()=>{}))):this.#A.warn?.(`[dsh-im:${this.#e}] failed to reject a closing approval:`,a)}}))}async#o(t){if(this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented||(await t.activationTask?.catch(()=>{}),this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented))return;if(t.presentationTask)return t.presentationTask;let o=Promise.resolve().then(()=>t.send(t.text));t.presentationTask=o;try{await o,t.deliveryCompleted=!0,t.inactive?t.closedOutcome&&!t.resolutionNotified&&(t.resolutionNotified=!0,await t.send(BQ(t.closedOutcome)).catch(()=>{})):t.presented=!0}finally{t.presentationTask===o&&(t.presentationTask=null)}}async#i(t,o){t.submitting=!0;try{await t.interaction.respond(Rx(t,o))}catch(a){if(a?.code==="interaction-not-pending"){let A=t.send,r=this.#s(t);await this.#a(r,async()=>{t.resolutionNotified||await A(w(wp)).catch(()=>{})});return}if(t.inactive)return;t.submitting=!1,this.#A.error?.(`[dsh-im:${this.#e}] failed to submit an approval:`,a),await t.send(w("\u5BA1\u6279\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002")).catch(()=>{});return}let i=t.send,e=this.#s(t);await this.#a(e,async()=>{t.resolutionNotified||await i(BQ(o)).catch(()=>{})})}async#a(t,o){let i,e=new Promise(a=>{i=a});t&&(t.activationTask=e);try{await o()}finally{i(),t?.activationTask===e&&(t.activationTask=null)}await this.#n(t)}async#n(t){if(t)try{await this.#o(t)}catch(o){this.#A.error?.(`[dsh-im:${this.#e}] failed to present the next approval:`,o);try{t.interaction.reconnect?.()}catch{}}}#s(t){if(t.inactive)return null;t.inactive=!0,this.#p(t.key),this.#t.delete(t.approvalId);let o=this.#r.get(t.key);if(!o)return null;let i=o.items[0]===t,e=o.items.indexOf(t);return e!==-1&&o.items.splice(e,1),o.items.length===0?(this.#r.delete(t.key),null):i?o.items[0]:null}#p(t){let o=Date.now();for(let[i,e]of this.#l)e<=o&&this.#l.delete(i);for(this.#l.delete(t),this.#l.set(t,o+cpe);this.#l.size>Ipe;)this.#l.delete(this.#l.keys().next().value)}async#c(t,o){try{return await t.respond({ok:!0,value:{sessionId:t.sessionId,approvalId:o.approvalId,outcome:"rejected"}},{signal:AbortSignal.timeout(5e3)}),!0}catch(i){if(i?.code==="interaction-not-pending")return!1;throw i}}};var $M=new WeakMap;function dpe(n){let t=$M.get(n);return t||(t=new Map,$M.set(n,t)),t}async function ag(n,t,o){let i=typeof n;if(i!=="object"&&i!=="function"||n===null)throw new TypeError("state is required");if(typeof t!="string"||!t)throw new TypeError("conversation key is required");if(typeof o!="function")throw new TypeError("operation is required");let e=dpe(n),a=e.get(t)??Promise.resolve(),A,r=new Promise(s=>{A=s});e.set(t,r),await a;try{return await o()}finally{A(),e.get(t)===r&&(e.delete(t),e.size===0&&$M.delete(n))}}var Ga="workspace-session-stale";function vx(n,t){return typeof n.workspaceSession=="function"?n.workspaceSession(t):Object.freeze({sessionId:t,sessionExists:(...o)=>n.sessionExists(t,...o),models:(...o)=>n.getSessionModels(t,...o),selectModel:(...o)=>n.selectSessionModel(t,...o),isRunning:(...o)=>n.isSessionRunning(t,...o),hasActiveTurn:(...o)=>n.hasActiveTurn(t,...o),stopActiveTurn:(...o)=>n.stopActiveTurn(t,...o),steerActiveTurn:(...o)=>n.steerActiveTurn(t,...o),ask:(...o)=>n.ask(t,...o)})}async function hpe(n,t){return t===void 0?n.sessionExists():n.sessionExists(t)}async function Epe(n,t){return t===void 0?n.createSession():n.createSession(t)}async function Oi({harness:n,state:t,key:o,text:i,content:e,createOptions:a,existsOptions:A,askOptions:r}){for(;;)try{let s=await ag(t,o,async()=>{let B=t.sessionFor(o),f=B?vx(n,B):null;if(!f||!await hpe(f,A)){if(B=await Epe(n,a),await t.setSession(o,B)===!1)return null;f=vx(n,B)}return{sessionId:B,session:f}});if(!s)continue;let g=[],c=typeof r=="object"&&typeof r?.onArtifact=="function"?r.onArtifact:null,I=typeof r=="number"?{timeoutMs:r}:{...r};I.onArtifact=async B=>{g.push(B),await c?.(B)};let d=await s.session.ask(e??i,I);return{sessionId:s.sessionId,answer:d,...g.length>0?{artifacts:g}:{}}}catch(s){if(s?.code!==Ga)throw s}}var Gx=/^\/compact(?=$|\s)([\s\S]*)$/i,Cpe="\u7528\u6CD5\uFF1A/compact\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",Px=new Map([["No compactable history yet.","\u6682\u65E0\u53EF\u538B\u7F29\u7684\u5386\u53F2\u8BB0\u5F55\u3002"],["Compaction is unavailable because this process has an active compaction, or the agent is not idle.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\u6216\u6267\u884C\u538B\u7F29\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"],["Compaction cancelled.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"],["The history selected for compaction changed before it could be replaced. The conversation is unchanged; the attempt is recorded in the session log.","\u538B\u7F29\u671F\u95F4\u4F1A\u8BDD\u5386\u53F2\u53D1\u751F\u53D8\u5316\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002"],["Compaction could not produce a useful summary. The conversation is unchanged; the attempt is recorded in the session log.","\u672A\u80FD\u751F\u6210\u6709\u6548\u7684\u538B\u7F29\u6458\u8981\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\u3002"],["Compaction did not finish cleanly; some session history may have changed. Inspect the current session state before retrying.","\u4E0A\u4E0B\u6587\u538B\u7F29\u672A\u6B63\u5E38\u5B8C\u6210\uFF0C\u90E8\u5206\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u4F1A\u8BDD\u540E\u518D\u91CD\u8BD5\u3002"],["Compaction finished, but the session could not be saved.","\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29\uFF0C\u4F46\u4F1A\u8BDD\u4FDD\u5B58\u5931\u8D25\u3002"]]);function NI(n){return{handled:!0,message:n,messages:[n]}}function upe(n){if(!n||typeof n!="object"||!["success","error"].includes(n.kind)||n.text!==void 0&&typeof n.text!="string")throw new TypeError("Harness returned an invalid /compact result");let t=n.text?.trim()??"",o=/^Compacted (\d+) history items \(~(\d+) tokens\)\.$/u.exec(t);return o?w("\u5DF2\u538B\u7F29 {count} \u6761\u5386\u53F2\u8BB0\u5F55\uFF08\u7EA6 {tokens} \u4E2A token\uFF09\u3002",{count:o[1],tokens:o[2]}):Px.has(t)?w(Px.get(t)):t||(n.kind==="success"?w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210\u3002"):w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002"))}function Bpe(n){let t=n?.code??n?.failure?.code;return t==="session-not-found"?w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u53D1\u9001\u65B0\u6D88\u606F\u5F00\u542F\u4F1A\u8BDD\u3002"):t==="agent-busy"?w("\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="cancelled"||n?.name==="AbortError"?w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"):t===Ga||t==="workspace-bot-not-found"?w("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):t==="commands-unavailable"?w("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u4ECE\u673A\u5668\u4EBA\u6267\u884C\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"):w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function bi(n,t,o,i,e={}){if(!e_(n))return null;if(Gx.exec(n.trim())[1].trim())return NI(w(Cpe));if(typeof o?.sessionFor!="function")return NI(w("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u72B6\u6001\u3002"));let A=o.sessionFor(i);if(typeof A!="string"||!A)return NI(w("\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u53EF\u538B\u7F29\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u6D88\u606F\u3002"));if(typeof t?.executeCommand!="function")return NI(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"));try{let r=await t.executeCommand(A,"/compact",e);return NI(r===void 0?w("\u5F53\u524D Harness \u672A\u6CE8\u518C /compact \u547D\u4EE4\uFF0C\u8BF7\u786E\u8BA4\u4E0A\u4E0B\u6587\u538B\u7F29\u7EC4\u4EF6\u5DF2\u542F\u7528\u3002"):upe(r?.result))}catch(r){return NI(Bpe(r))}}function e_(n){return typeof n=="string"&&Gx.test(n.trim())}import{isDeepStrictEqual as Npe}from"node:util";import{realpath as Ux,stat as Hx}from"node:fs/promises";import{isAbsolute as Kx,resolve as fpe}from"node:path";var xx=/^\/workspace(?:\s+([\s\S]+))?$/i,Yx=/^\/workspacelist(?:\s+([\s\S]+))?$/i,jx=/^\/(?:sessionlist|sessions)(?:\s+([\s\S]+))?$/i,Jx=/^\/session(?=$|\s)/i,Qpe=/^\/session[ \t]+([^\s]+)$/i,ype=4096,mpe=1800,Spe=256,qx=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,wpe=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu,zx="\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09",Dp=["\u7528\u6CD5\uFF1A","/sessionlist \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u4F1A\u8BDD","/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7 \u6309 /workspacelist \u5E8F\u53F7\u5217\u51FA\u4F1A\u8BDD","/sessionlist \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5217\u51FA\u6307\u5B9A\u5DE5\u4F5C\u533A\u4F1A\u8BDD"].join(` -`);function Ut(n,t=[n]){return{handled:!0,message:n,messages:t}}function Op(n){return typeof n!="string"||n.length>ype||!Kx(n)||qx.test(n)?null:fpe(n)}function fQ(n){return typeof n!="string"?"":n.replace(wpe," ").replace(/\s+/gu," ").trim()}function Fx(n){return typeof n=="string"&&n.length>0&&n.length<=Spe&&!new RegExp("\\p{White_Space}","u").test(n)&&!qx.test(n)}async function A_(n){let t=await Promise.all(n.map(async o=>{let i=Op(o);if(!i)return null;try{return(await Hx(i)).isDirectory()?Op(await Ux(i)):null}catch{return null}}));return[...new Set(t.filter(Boolean))]}async function t_(n){if(typeof n!="string"||!Kx(n.trim()))return{error:w(`\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002 +`);function Nt(n,t=[n]){return{handled:!0,message:n,messages:t}}function Op(n){return typeof n!="string"||n.length>ype||!Kx(n)||qx.test(n)?null:fpe(n)}function fQ(n){return typeof n!="string"?"":n.replace(wpe," ").replace(/\s+/gu," ").trim()}function Fx(n){return typeof n=="string"&&n.length>0&&n.length<=Spe&&!new RegExp("\\p{White_Space}","u").test(n)&&!qx.test(n)}async function A_(n){let t=await Promise.all(n.map(async o=>{let i=Op(o);if(!i)return null;try{return(await Hx(i)).isDirectory()?Op(await Ux(i)):null}catch{return null}}));return[...new Set(t.filter(Boolean))]}async function t_(n){if(typeof n!="string"||!Kx(n.trim()))return{error:w(`\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002 {usage}`,{usage:w(Dp)})};let t=Op(n.trim());if(!t)return{error:w(`\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5305\u542B\u4E0D\u652F\u6301\u7684\u5B57\u7B26\u6216\u957F\u5EA6\u8D85\u8FC7\u9650\u5236\u3002 {usage}`,{usage:w(Dp)})};let o;try{o=await Hx(t)}catch{return{error:w(`\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002 {usage}`,{usage:w(Dp)})}}if(!o.isDirectory())return{error:w(`\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002 {usage}`,{usage:w(Dp)})};try{let i=Op(await Ux(t));return i?{workspace:i}:{error:w(`\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5305\u542B\u4E0D\u652F\u6301\u7684\u5B57\u7B26\u6216\u957F\u5EA6\u8D85\u8FC7\u9650\u5236\u3002 {usage}`,{usage:w(Dp)})}}catch{return{error:w(`\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002 -{usage}`,{usage:w(Dp)})}}}async function UE(n,t={}){let o=await n.listWorkspaces(t),i=typeof n?.currentWorkspace=="function"?n.currentWorkspace():null,[e]=i?await A_([i]):[],a=await A_(Array.isArray(o)?o:[]),A=[...new Set([...e?[e]:[],...a])];return n.assertWorkspaceScope?.(),{current:e??null,paths:A}}function ig(n){let t=[],o=0;for(;o=o)i=e+1;else{let a=n.charCodeAt(i-1),A=n.charCodeAt(i);a>=55296&&a<=56319&&A>=56320&&A<=57343&&(i-=1)}}t.push(n.slice(o,i)),o=i}return t}async function Dpe(n,t){if(n[1]?.trim())return Ut(w("\u7528\u6CD5\uFF1A/workspacelist"));if(typeof t?.listWorkspaces!="function")return Ut(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u3002"));try{let{current:o,paths:i}=await UE(t);if(i.length===0)return Ut(w("\u5F53\u524D Harness Host \u4E0A\u6CA1\u6709\u4ECD\u7136\u5B58\u5728\u7684\u5DF2\u767B\u8BB0\u5DE5\u4F5C\u533A\u3002"));let a=[w("\u5F53\u524D Harness Host \u4E0A\u5B58\u5728\u7684\u5DE5\u4F5C\u533A\uFF08{count}\uFF09\uFF1A",{count:i.length}),...i.map((A,r)=>`${r+1}. ${A}${A===o?w("\uFF08\u5F53\u524D\uFF09"):""}`),"",w("\u5207\u6362\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("\u67E5\u770B\u4F1A\u8BDD\uFF1A/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84")].join(` -`);return Ut(a,ig(a))}catch(o){return o?.code==="workspace-bot-not-found"?Ut(w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002")):Ut(w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))}}async function r_(n,t,o={}){if(!n){if(typeof t?.currentWorkspace!="function")return{error:w("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\u3002")};let e=await t_(t.currentWorkspace());return t.assertWorkspaceScope?.(),e}if(/^\d+$/u.test(n)){if(typeof t?.listWorkspaces!="function")return{error:w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u9009\u62E9\u5DE5\u4F5C\u533A\u3002")};let{paths:e}=await UE(t,o),a=Number(n);return!Number.isSafeInteger(a)||a<1||a>e.length?{error:w("\u5DE5\u4F5C\u533A\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /workspacelist\u3002")}:{workspace:e[a-1]}}let i=await t_(n);return t.assertWorkspaceScope?.(),i}function Ope(n){let t=typeof n=="number"&&Number.isFinite(n)?n:null;if(t===null)return"";let o=new Date(t);if(Number.isNaN(o.getTime()))return"";let i=s=>String(s).padStart(2,"0"),e=`${i(o.getHours())}:${i(o.getMinutes())}`,a=s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),A=new Date,r=Math.round((a(A)-a(o))/864e5);return r===0?w("\u4ECA\u5929 {time}",{time:e}):r===1?w("\u6628\u5929 {time}",{time:e}):r===2?w("\u524D\u5929 {time}",{time:e}):o.getFullYear()===A.getFullYear()?w("{month}\u6708{day}\u65E5 {time}",{month:o.getMonth()+1,day:o.getDate(),time:e}):w("{year}\u5E74{month}\u6708{day}\u65E5",{year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()})}function bpe(n,t,{currentWorkspace:o=!1}={}){let i=t.map(e=>{let a=fQ(e?.sessionId);if(!a)throw new TypeError("Harness returned an invalid session id");let A=e?.summaryAvailable===!1?w("\u6807\u9898\u6682\u4E0D\u53EF\u7528"):fQ(e?.title)||w("\u6682\u65E0\u6807\u9898"),r=Ope(e?.time),s=`${r?` \xB7 ${r}`:""}${e?.archived===!0?w("\uFF08\u5DF2\u5F52\u6863\uFF09"):""}`;return`${A}${s} +{usage}`,{usage:w(Dp)})}}}async function bp(n,t={}){let o=await n.listWorkspaces(t),i=typeof n?.currentWorkspace=="function"?n.currentWorkspace():null,[e]=i?await A_([i]):[],a=await A_(Array.isArray(o)?o:[]),A=[...new Set([...e?[e]:[],...a])];return n.assertWorkspaceScope?.(),{current:e??null,paths:A}}function ig(n){let t=[],o=0;for(;o=o)i=e+1;else{let a=n.charCodeAt(i-1),A=n.charCodeAt(i);a>=55296&&a<=56319&&A>=56320&&A<=57343&&(i-=1)}}t.push(n.slice(o,i)),o=i}return t}async function Dpe(n,t){if(n[1]?.trim())return Nt(w("\u7528\u6CD5\uFF1A/workspacelist"));if(typeof t?.listWorkspaces!="function")return Nt(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u3002"));try{let{current:o,paths:i}=await bp(t);if(i.length===0)return Nt(w("\u5F53\u524D Harness Host \u4E0A\u6CA1\u6709\u4ECD\u7136\u5B58\u5728\u7684\u5DF2\u767B\u8BB0\u5DE5\u4F5C\u533A\u3002"));let a=[w("\u5F53\u524D Harness Host \u4E0A\u5B58\u5728\u7684\u5DE5\u4F5C\u533A\uFF08{count}\uFF09\uFF1A",{count:i.length}),...i.map((A,r)=>`${r+1}. ${A}${A===o?w("\uFF08\u5F53\u524D\uFF09"):""}`),"",w("\u5207\u6362\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84"),w("\u67E5\u770B\u4F1A\u8BDD\uFF1A/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84")].join(` +`);return Nt(a,ig(a))}catch(o){return o?.code==="workspace-bot-not-found"?Nt(w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002")):Nt(w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))}}async function r_(n,t,o={}){if(!n){if(typeof t?.currentWorkspace!="function")return{error:w("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\u3002")};let e=await t_(t.currentWorkspace());return t.assertWorkspaceScope?.(),e}if(/^\d+$/u.test(n)){if(typeof t?.listWorkspaces!="function")return{error:w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u9009\u62E9\u5DE5\u4F5C\u533A\u3002")};let{paths:e}=await bp(t,o),a=Number(n);return!Number.isSafeInteger(a)||a<1||a>e.length?{error:w("\u5DE5\u4F5C\u533A\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /workspacelist\u3002")}:{workspace:e[a-1]}}let i=await t_(n);return t.assertWorkspaceScope?.(),i}function Ope(n){let t=typeof n=="number"&&Number.isFinite(n)?n:null;if(t===null)return"";let o=new Date(t);if(Number.isNaN(o.getTime()))return"";let i=s=>String(s).padStart(2,"0"),e=`${i(o.getHours())}:${i(o.getMinutes())}`,a=s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),A=new Date,r=Math.round((a(A)-a(o))/864e5);return r===0?w("\u4ECA\u5929 {time}",{time:e}):r===1?w("\u6628\u5929 {time}",{time:e}):r===2?w("\u524D\u5929 {time}",{time:e}):o.getFullYear()===A.getFullYear()?w("{month}\u6708{day}\u65E5 {time}",{month:o.getMonth()+1,day:o.getDate(),time:e}):w("{year}\u5E74{month}\u6708{day}\u65E5",{year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()})}function bpe(n,t,{currentWorkspace:o=!1}={}){let i=t.map(e=>{let a=fQ(e?.sessionId);if(!a)throw new TypeError("Harness returned an invalid session id");let A=e?.summaryAvailable===!1?w("\u6807\u9898\u6682\u4E0D\u53EF\u7528"):fQ(e?.title)||w("\u6682\u65E0\u6807\u9898"),r=Ope(e?.time),s=`${r?` \xB7 ${r}`:""}${e?.archived===!0?w("\uFF08\u5DF2\u5F52\u6863\uFF09"):""}`;return`${A}${s} ID: ${a}`});return i.length===0?w(`\u5DE5\u4F5C\u533A\uFF1A{workspace} \u8BE5\u5DE5\u4F5C\u533A\u6682\u65E0\u4F1A\u8BDD\u3002`,{workspace:n}):[w("\u5DE5\u4F5C\u533A\uFF1A{workspace}",{workspace:n}),w("\u4F1A\u8BDD\uFF08{count}\uFF09\uFF1A",{count:i.length}),"",...i.map((e,a)=>`${a+1}. ${e}`),"",o?w("\u7ED1\u5B9A\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09"):w(`\u7ED1\u5B9A\u7528\u6CD5\uFF1A/session Session ID \u63D0\u793A\uFF1A/session N \u53EA\u6309\u673A\u5668\u4EBA\u5F53\u524D\u5DE5\u4F5C\u533A\u7684\u5E8F\u53F7\u7ED1\u5B9A\u3002`)].join(` -`)}async function Mpe(n){if(typeof n?.currentWorkspace!="function")return null;let[t]=await A_([n.currentWorkspace()]);return n.assertWorkspaceScope?.(),t??null}async function _pe(n,t){if(typeof t?.listWorkspaceSessions!="function")return Ut(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u3002"));let o=n[1]?.trim()??"";try{let i=await r_(o,t);if(i.error)return Ut(i.error);let e=await t.listWorkspaceSessions(i.workspace);if(!e||!Array.isArray(e.sessions))throw new TypeError("Harness returned an invalid workspace session list");t.assertWorkspaceScope?.();let a=Op(e.workspace)??i.workspace,A=await Mpe(t),r=bpe(a,e.sessions,{currentWorkspace:a===A});return Ut(r,ig(r))}catch(i){return i?.code==="workspace-bot-not-found"?Ut(w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u3002")):Ut(w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))}}function Lx(n){return n?.code==="session-id-invalid"?w(`Session ID \u683C\u5F0F\u65E0\u6548\u3002 -{usage}`,{usage:w(zx)}):["session-not-registered","session-not-found"].includes(n?.code)?w("\u672A\u627E\u5230\u8BE5\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u786E\u8BA4 Session ID\u3002"):n?.code==="session-subagent-unsupported"?w("\u5B50\u4EE3\u7406\u4F1A\u8BDD\u4E0D\u80FD\u7ED1\u5B9A\u5230\u673A\u5668\u4EBA\u5BF9\u8BDD\uFF0C\u8BF7\u9009\u62E9\u666E\u901A\u4F1A\u8BDD\u3002"):n?.code==="session-workspace-ambiguous"?w("\u8BE5\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u5F52\u5C5E\u4E0D\u660E\u786E\uFF0C\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u3002"):n?.code==="session-summary-unavailable"?w("\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u4F1A\u8BDD\u7684\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):n?.code==="workspace-bot-not-found"?w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u7ED1\u5B9A\u539F\u5BF9\u8BDD\u7684\u4F1A\u8BDD\u3002"):[Ga,"agent-busy","session-conflict","workspace-conflict"].includes(n?.code)?w("\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):w("\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function Tpe(n,t,o){let e=Qpe.exec(n)?.[1];if(typeof e=="string"&&/^\d+$/u.test(e)){if(typeof t?.listWorkspaceSessions!="function"||typeof t?.currentWorkspace!="function")return Ut(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u7ED1\u5B9A\uFF0C\u8BF7\u4F7F\u7528 /session Session ID\u3002"));try{let a=await t_(t.currentWorkspace());if(a.error)return Ut(a.error);let A=await t.listWorkspaceSessions(a.workspace);if(!A||!Array.isArray(A.sessions))throw new TypeError("Harness returned an invalid workspace session list");t.assertWorkspaceScope?.();let r=Number(e);if(!Number.isSafeInteger(r)||r<1||r>A.sessions.length)return Ut(w("\u4F1A\u8BDD\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u67E5\u770B\u5E8F\u53F7\u3002"));let s=A.sessions[r-1]?.sessionId;if(!Fx(s))throw new TypeError("Harness returned an invalid session id");e=s}catch(a){return a?.code==="workspace-bot-not-found"?Ut(Lx(a)):Ut(w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))}}if(!Fx(e))return Ut(w(zx));if(typeof t?.bindWorkspaceSession!="function")return Ut(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD\u3002"));if(typeof o!="string"||!o)return Ut(w("\u5F53\u524D\u6D88\u606F\u7F3A\u5C11\u53EF\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u4E0A\u4E0B\u6587\u3002"));try{let a=await t.bindWorkspaceSession(o,e);t.assertWorkspaceScope?.();let A=Op(a?.workspace),r=fQ(a?.sessionId);if(!A||!r)throw new TypeError("Harness returned an invalid bound session");let s=fQ(a?.title)||w("\u6682\u65E0\u6807\u9898"),g=[w("\u5F53\u524D\u804A\u5929\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\uFF1A"),w("\u5DE5\u4F5C\u533A\uFF1A{workspace}",{workspace:A}),w("\u6807\u9898\uFF1A{title}",{title:s}),`ID\uFF1A${r}`,w("\u5F52\u6863\uFF1A{archived}",{archived:a?.archived===!0?w("\u662F"):w("\u5426")}),w("\u53D1\u9001 /history \u67E5\u770B\u6700\u8FD1\u5BF9\u8BDD\u3002")].join(` -`);return Ut(g,ig(g))}catch(a){return Ut(Lx(a))}}async function Mo(n,t,o){if(!a_(n))return null;let i=n.trim();if(Jx.test(i))return Tpe(i,t,o);let e=jx.exec(i);if(e)return _pe(e,t);let a=Yx.exec(i);if(a)return Dpe(a,t);let A=xx.exec(i);if(!A)return null;let r=A[1]?.trim();if(!r)return Ut(w("\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"));if(typeof t?.switchWorkspace!="function")return Ut(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5207\u6362\u5DE5\u4F5C\u533A\u3002"));try{let s=await t.switchWorkspace(r);return Ut(w("\u5DE5\u4F5C\u533A\u5DF2\u5207\u6362\u4E3A\uFF1A{workspace}",{workspace:s}))}catch(s){if(["workspace-not-absolute","workspace-not-found","workspace-not-directory"].includes(s?.code))return Ut(w(`{message} -\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84`,{message:s.message}));if(s?.code==="workspace-bot-not-found")return Ut(w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5207\u6362\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002"));throw s}}function a_(n){if(typeof n!="string")return!1;let t=n.trim();return Jx.test(t)||jx.test(t)||Yx.test(t)||xx.test(t)}var Wx=/^\/history(?=$|\s)([\s\S]*)$/iu,Rpe="\u7528\u6CD5\uFF1A/history [\u6570\u91CF]\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09",kpe=5,vpe=50,Ppe=3,Vx=1e4;function cc(n){return{handled:!0,message:n,messages:ig(n)}}function Zx(n){if(!Array.isArray(n))throw new TypeError("Invalid history message content");return n.flatMap(t=>t?.type==="text"&&typeof t.text=="string"?[t.text]:t?.type==="image"?[w("[\u56FE\u7247]")]:t?.type==="file"?[w("[\u6587\u4EF6]")]:[]).join(` +`)}async function Mpe(n){if(typeof n?.currentWorkspace!="function")return null;let[t]=await A_([n.currentWorkspace()]);return n.assertWorkspaceScope?.(),t??null}async function _pe(n,t){if(typeof t?.listWorkspaceSessions!="function")return Nt(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u3002"));let o=n[1]?.trim()??"";try{let i=await r_(o,t);if(i.error)return Nt(i.error);let e=await t.listWorkspaceSessions(i.workspace);if(!e||!Array.isArray(e.sessions))throw new TypeError("Harness returned an invalid workspace session list");t.assertWorkspaceScope?.();let a=Op(e.workspace)??i.workspace,A=await Mpe(t),r=bpe(a,e.sessions,{currentWorkspace:a===A});return Nt(r,ig(r))}catch(i){return i?.code==="workspace-bot-not-found"?Nt(w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5217\u51FA\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u3002")):Nt(w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))}}function Lx(n){return n?.code==="session-id-invalid"?w(`Session ID \u683C\u5F0F\u65E0\u6548\u3002 +{usage}`,{usage:w(zx)}):["session-not-registered","session-not-found"].includes(n?.code)?w("\u672A\u627E\u5230\u8BE5\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u786E\u8BA4 Session ID\u3002"):n?.code==="session-subagent-unsupported"?w("\u5B50\u4EE3\u7406\u4F1A\u8BDD\u4E0D\u80FD\u7ED1\u5B9A\u5230\u673A\u5668\u4EBA\u5BF9\u8BDD\uFF0C\u8BF7\u9009\u62E9\u666E\u901A\u4F1A\u8BDD\u3002"):n?.code==="session-workspace-ambiguous"?w("\u8BE5\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u5F52\u5C5E\u4E0D\u660E\u786E\uFF0C\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u3002"):n?.code==="session-summary-unavailable"?w("\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u4F1A\u8BDD\u7684\u4FE1\u606F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):n?.code==="workspace-bot-not-found"?w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u7ED1\u5B9A\u539F\u5BF9\u8BDD\u7684\u4F1A\u8BDD\u3002"):[Ga,"agent-busy","session-conflict","workspace-conflict"].includes(n?.code)?w("\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):w("\u6682\u65F6\u65E0\u6CD5\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function Tpe(n,t,o){let e=Qpe.exec(n)?.[1];if(typeof e=="string"&&/^\d+$/u.test(e)){if(typeof t?.listWorkspaceSessions!="function"||typeof t?.currentWorkspace!="function")return Nt(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u7ED1\u5B9A\uFF0C\u8BF7\u4F7F\u7528 /session Session ID\u3002"));try{let a=await t_(t.currentWorkspace());if(a.error)return Nt(a.error);let A=await t.listWorkspaceSessions(a.workspace);if(!A||!Array.isArray(A.sessions))throw new TypeError("Harness returned an invalid workspace session list");t.assertWorkspaceScope?.();let r=Number(e);if(!Number.isSafeInteger(r)||r<1||r>A.sessions.length)return Nt(w("\u4F1A\u8BDD\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /sessionlist \u67E5\u770B\u5E8F\u53F7\u3002"));let s=A.sessions[r-1]?.sessionId;if(!Fx(s))throw new TypeError("Harness returned an invalid session id");e=s}catch(a){return a?.code==="workspace-bot-not-found"?Nt(Lx(a)):Nt(w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u4F1A\u8BDD\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))}}if(!Fx(e))return Nt(w(zx));if(typeof t?.bindWorkspaceSession!="function")return Nt(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD\u3002"));if(typeof o!="string"||!o)return Nt(w("\u5F53\u524D\u6D88\u606F\u7F3A\u5C11\u53EF\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u4E0A\u4E0B\u6587\u3002"));try{let a=await t.bindWorkspaceSession(o,e);t.assertWorkspaceScope?.();let A=Op(a?.workspace),r=fQ(a?.sessionId);if(!A||!r)throw new TypeError("Harness returned an invalid bound session");let s=fQ(a?.title)||w("\u6682\u65E0\u6807\u9898"),g=[w("\u5F53\u524D\u804A\u5929\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\uFF1A"),w("\u5DE5\u4F5C\u533A\uFF1A{workspace}",{workspace:A}),w("\u6807\u9898\uFF1A{title}",{title:s}),`ID\uFF1A${r}`,w("\u5F52\u6863\uFF1A{archived}",{archived:a?.archived===!0?w("\u662F"):w("\u5426")}),w("\u53D1\u9001 /history \u67E5\u770B\u6700\u8FD1\u5BF9\u8BDD\u3002")].join(` +`);return Nt(g,ig(g))}catch(a){return Nt(Lx(a))}}async function Mo(n,t,o){if(!a_(n))return null;let i=n.trim();if(Jx.test(i))return Tpe(i,t,o);let e=jx.exec(i);if(e)return _pe(e,t);let a=Yx.exec(i);if(a)return Dpe(a,t);let A=xx.exec(i);if(!A)return null;let r=A[1]?.trim();if(!r)return Nt(w("\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84"));if(typeof t?.switchWorkspace!="function")return Nt(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u5207\u6362\u5DE5\u4F5C\u533A\u3002"));try{let s=r;if(/^\d+$/u.test(r)){if(typeof t?.listWorkspaces!="function")return Nt(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u6309\u5E8F\u53F7\u9009\u62E9\u5DE5\u4F5C\u533A\u3002"));let{paths:c}=await bp(t),I=Number(r);if(!Number.isSafeInteger(I)||I<1||I>c.length)return Nt(w("\u5DE5\u4F5C\u533A\u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6267\u884C /workspacelist\u3002"));s=c[I-1]}let g=await t.switchWorkspace(s);return Nt(w("\u5DE5\u4F5C\u533A\u5DF2\u5207\u6362\u4E3A\uFF1A{workspace}",{workspace:g}))}catch(s){if(["workspace-not-absolute","workspace-not-found","workspace-not-directory"].includes(s?.code))return Nt(w(`{message} +\u7528\u6CD5\uFF1A/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84`,{message:s.message}));if(s?.code==="workspace-bot-not-found")return Nt(w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u5207\u6362\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002"));throw s}}function a_(n){if(typeof n!="string")return!1;let t=n.trim();return Jx.test(t)||jx.test(t)||Yx.test(t)||xx.test(t)}var Wx=/^\/history(?=$|\s)([\s\S]*)$/iu,Rpe="\u7528\u6CD5\uFF1A/history [\u6570\u91CF]\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09",kpe=5,vpe=50,Ppe=3,Vx=1e4;function cc(n){return{handled:!0,message:n,messages:ig(n)}}function Zx(n){if(!Array.isArray(n))throw new TypeError("Invalid history message content");return n.flatMap(t=>t?.type==="text"&&typeof t.text=="string"?[t.text]:t?.type==="image"?[w("[\u56FE\u7247]")]:t?.type==="file"?[w("[\u6587\u4EF6]")]:[]).join(` `).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/gu,"").trim()||w("\u672C\u6761\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u6587\u5B57\u3002")}function Gpe(n){let t=[],o=new Map;for(let i of n){let e=i.data;if(i.type==="user/message"&&i.surfaceOp==="append"&&e?.source?.kind==="user"){if(Fa(Zx(e.content)))continue;t.push({seq:i.seq,role:"user",content:e.content})}else if(i.type==="assistant/message"&&i.surfaceOp==="append"&&Number.isSafeInteger(e?.turn)&&e.turn>=0)o.set(e.turn,i);else if(i.type==="turn/end"){let a=o.get(e?.turn);if(o.delete(e?.turn),(e?.reason?.kind??e?.reason)!=="completed"||!a||a.data.interrupted===!0)continue;t.push({seq:a.seq,role:"assistant",content:a.data.message?.content})}}return t.sort((i,e)=>i.seq-e.seq)}function Fpe(n,t){if(n.length<=t)return n;let o=w("\uFF08\u5DF2\u622A\u65AD\uFF09"),i=Math.max(0,t-o.length),e=n.charCodeAt(i-1);return e>=55296&&e<=56319&&(i-=1),`${n.slice(0,Math.max(0,i))}${o}`}function Lpe(n,t,o,i){let e=n.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu,"").slice(0,12),a=w("\u4F1A\u8BDD\u5386\u53F2\uFF5C{session}\uFF5C\u6700\u8FD1 {count} \u6761",{session:e,count:t.length}),A=[w("\u4EE5\u4E0A\u4E3A\u5386\u53F2\u8BB0\u5F55\uFF0C\u4E0D\u662F\u672C\u6B21\u65B0\u56DE\u590D\u3002")];t.length({...c,text:Zx(c.content)})),s=500,g;do{let c=r.map((I,d)=>`${d+1}. ${I.role==="user"?w("\u7528\u6237"):w("\u52A9\u624B")} ${Fpe(I.text,s)}`);g=cc([a,...c,A.join(` `)].join(` @@ -177,25 +177,25 @@ ${Fpe(I.text,s)}`);g=cc([a,...c,A.join(` `);for(let[a,A]of o.reasoning.efforts.entries()){let r=HE(o,A.id),s=nde(A.id,i,o.reasoning.defaultEffort);e.push(`${a+1}. ${r}${s}`);let g=ea(A.description);g&&e.push(` ${g}`)}return e.push("",w("\u5207\u6362\u63A8\u7406\u7B49\u7EA7\uFF1A/reasoning <\u5E8F\u53F7\u6216\u7B49\u7EA7ID>"),w("\u6062\u590D\u9ED8\u8BA4\u7B49\u7EA7\uFF1A/reasoning --default")),e.join(` `)}function lde(){return[w("\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u4F1A\u8BDD\u3002"),"",w("\u67E5\u770B\u6A21\u578B\uFF1A/models"),w("\u9009\u62E9\u6A21\u578B\uFF1A/model <\u5E8F\u53F7>")].join(` `)}function o_(){return[w("\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u4F1A\u8BDD\u3002"),"",w("\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u666E\u901A\u6D88\u606F\u521B\u5EFA\u4F1A\u8BDD\u3002")].join(` -`)}function pde(n){return n?.code??n?.failure?.code}function bp(n,t){let o=pde(n);if(o==="agent-busy")return w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210\u6216\u5148\u53D1\u9001 /stop\u3002");if(o==="session-not-found")return w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u91CD\u8BD5\u3002");if(o==="model-unavailable")return t==="reasoning-select"?w("\u65E0\u6CD5\u5207\u6362\u63A8\u7406\u7B49\u7EA7\u3002\u5F53\u524D\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u4E0D\u53EF\u7528\u3002"):w("\u65E0\u6CD5\u5207\u6362\u5230\u8BE5\u6A21\u578B\u3002\u6A21\u578B\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u6216\u4E0D\u652F\u6301\u5F53\u524D\u4F1A\u8BDD\u4E2D\u7684\u56FE\u7247\u3002");if(o===Ga||o==="workspace-bot-not-found")return w("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002");if(o===lY)return w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002");if(o===pY){let i=n?.expected,e=n?.actual,a=[t==="reasoning-select"?w("\u63A8\u7406\u7B49\u7EA7\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("\u6A21\u578B\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")];if(i?.provider&&i?.model&&a.push("",`requested: ${ea(s_(i))}`),e?.provider&&e?.model){let A=n?.source==="models.current"?w("\u5F53\u524D\u6A21\u578B\uFF1A"):"selectModel.selected:";a.push(`${A} ${ea(s_(e))}`)}else a.push(`${n?.source??"Harness"}: unconfirmed`);return a.join(` -`)}return o==="cancelled"||n?.name==="AbortError"?t==="list"?w("\u83B7\u53D6\u6A21\u578B\u5217\u8868\u5DF2\u53D6\u6D88\u3002"):t==="reasoning-list"?w("\u83B7\u53D6\u63A8\u7406\u7B49\u7EA7\u5217\u8868\u5DF2\u53D6\u6D88\u3002"):t==="reasoning-select"?w("\u63A8\u7406\u7B49\u7EA7\u5207\u6362\u5DF2\u53D6\u6D88\u3002"):w("\u6A21\u578B\u5207\u6362\u5DF2\u53D6\u6D88\u3002"):t==="list"?w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u6A21\u578B\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="reasoning-list"?w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u63A8\u7406\u7B49\u7EA7\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="reasoning-select"?w("\u63A8\u7406\u7B49\u7EA7\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("\u6A21\u578B\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function Mp(n,t,o,i){if(typeof t?.sessionFor!="function")return null;let e=t.sessionFor(o);if(typeof e!="string"||!e)return null;if(typeof n?.workspaceSession!="function")throw new TypeError("Harness does not support workspace sessions");let a=n.workspaceSession(e);if(!a||typeof a.sessionExists!="function")throw new TypeError("Harness returned an invalid workspace session");return await a.sessionExists(i)?{sessionId:e,session:a}:(typeof t.clearSession=="function"&&t.sessionFor(o)===e&&await t.clearSession(o),null)}async function oY(n,t,o){if(typeof n?.isRunning!="function"||typeof n?.hasActiveTurn!="function")throw new TypeError("Harness session does not expose run state");return await n.isRunning(o)?!0:!!await n.hasActiveTurn(t,o)}async function nY(n,t){if(typeof n?.listModels!="function")throw new TypeError("Harness does not support listing models");return dY(await n.listModels(t))}async function RI(n,t){if(typeof n?.models!="function")throw new TypeError("Harness session does not support listing models");return dY(await n.models(t),{requireCurrent:!0})}async function n_(n,t,o){if(typeof n?.selectModel!="function")throw new TypeError("Harness session does not support model selection");let i=(await n.selectModel(t,o))?.selected;if(!rde(i,t))throw AY(t,i,"selectModel.selected");let e=(await RI(n,o)).current;if(!tde(e,i))throw AY(i,e,"models.current");return e}function dde(n){return sY.test(n)}function hde(n){return IY.test(n)||cY.test(n)}function Ede(n){return gY.test(n)}function si(n){if(typeof n!="string")return!1;let t=n.trim();return sY.test(t)||Vpe.test(t)||IY.test(t)||cY.test(t)||gY.test(t)}async function to(n,t,o,i,e={}){if(!si(n))return null;let a=n.trim();if(e.hasImages)return ht(w("\u6A21\u578B\u548C\u63A8\u7406\u7B49\u7EA7\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002"));let A=ede(e.signal);if(dde(a)){if(!/^\/models[ \t]*$/iu.test(a))return ht(w(Wpe));try{let I=await Mp(t,o,i,A),d=I?await RI(I.session,A):await nY(t,A);return ht(sde(d))}catch(I){return ht(bp(I,"list"))}}if(hde(a)){if(!/^\/(?:reasoninglist|reasonings)[ \t]*$/iu.test(a))return ht(w(Xpe));try{let I=await Mp(t,o,i,A);return ht(I?Ide(await RI(I.session,A)):o_())}catch(I){return ht(bp(I,"reasoning-list"))}}if(Ede(a)){let I=/^\/reasoning(?:[ \t]+([^\s]+))?[ \t]*$/iu.exec(a);if(!I)return ht(w(Zpe));let d=I[1];if(!d)try{let B=await Mp(t,o,i,A);return ht(B?cde(await RI(B.session,A)):o_())}catch(B){return ht(bp(B,"reasoning-list"))}if(e.pendingInteraction)return ht([w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",w("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` -`));try{return await ag(o,i,async()=>{let B=await Mp(t,o,i,A);if(!B)return ht(o_());if(await oY(B.session,e.control,A))return ht(w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210\u6216\u5148\u53D1\u9001 /stop\u3002"));let f=await RI(B.session,A),Q=f.current,y=yQ(f,Q),m;if(d.toLowerCase()==="--default")m=void 0;else{if(!y?.reasoning)return ht(i_(Q,d,y));if(m=g_(y,d),!m){let R=rY(d);if(R?.index===null)return ht(iY(d));if(!R)return ht(i_(Q,d,y));if(m=ode(y,R.index),!m)return ht(iY(d))}m=m.id}let T={provider:Q.provider,model:Q.model,...m===void 0?{}:{reasoningEffort:m}},_=await n_(B.session,T,A);return tY(o,i,B.sessionId),ht(w(`\u63A8\u7406\u7B49\u7EA7\u5DF2\u5207\u6362\u4E3A\uFF1A +`)}function pde(n){return n?.code??n?.failure?.code}function Mp(n,t){let o=pde(n);if(o==="agent-busy")return w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210\u6216\u5148\u53D1\u9001 /stop\u3002");if(o==="session-not-found")return w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u91CD\u8BD5\u3002");if(o==="model-unavailable")return t==="reasoning-select"?w("\u65E0\u6CD5\u5207\u6362\u63A8\u7406\u7B49\u7EA7\u3002\u5F53\u524D\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u4E0D\u53EF\u7528\u3002"):w("\u65E0\u6CD5\u5207\u6362\u5230\u8BE5\u6A21\u578B\u3002\u6A21\u578B\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u6216\u4E0D\u652F\u6301\u5F53\u524D\u4F1A\u8BDD\u4E2D\u7684\u56FE\u7247\u3002");if(o===Ga||o==="workspace-bot-not-found")return w("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002");if(o===lY)return w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002");if(o===pY){let i=n?.expected,e=n?.actual,a=[t==="reasoning-select"?w("\u63A8\u7406\u7B49\u7EA7\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("\u6A21\u578B\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")];if(i?.provider&&i?.model&&a.push("",`requested: ${ea(s_(i))}`),e?.provider&&e?.model){let A=n?.source==="models.current"?w("\u5F53\u524D\u6A21\u578B\uFF1A"):"selectModel.selected:";a.push(`${A} ${ea(s_(e))}`)}else a.push(`${n?.source??"Harness"}: unconfirmed`);return a.join(` +`)}return o==="cancelled"||n?.name==="AbortError"?t==="list"?w("\u83B7\u53D6\u6A21\u578B\u5217\u8868\u5DF2\u53D6\u6D88\u3002"):t==="reasoning-list"?w("\u83B7\u53D6\u63A8\u7406\u7B49\u7EA7\u5217\u8868\u5DF2\u53D6\u6D88\u3002"):t==="reasoning-select"?w("\u63A8\u7406\u7B49\u7EA7\u5207\u6362\u5DF2\u53D6\u6D88\u3002"):w("\u6A21\u578B\u5207\u6362\u5DF2\u53D6\u6D88\u3002"):t==="list"?w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u6A21\u578B\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="reasoning-list"?w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u63A8\u7406\u7B49\u7EA7\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="reasoning-select"?w("\u63A8\u7406\u7B49\u7EA7\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("\u6A21\u578B\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function _p(n,t,o,i){if(typeof t?.sessionFor!="function")return null;let e=t.sessionFor(o);if(typeof e!="string"||!e)return null;if(typeof n?.workspaceSession!="function")throw new TypeError("Harness does not support workspace sessions");let a=n.workspaceSession(e);if(!a||typeof a.sessionExists!="function")throw new TypeError("Harness returned an invalid workspace session");return await a.sessionExists(i)?{sessionId:e,session:a}:(typeof t.clearSession=="function"&&t.sessionFor(o)===e&&await t.clearSession(o),null)}async function oY(n,t,o){if(typeof n?.isRunning!="function"||typeof n?.hasActiveTurn!="function")throw new TypeError("Harness session does not expose run state");return await n.isRunning(o)?!0:!!await n.hasActiveTurn(t,o)}async function nY(n,t){if(typeof n?.listModels!="function")throw new TypeError("Harness does not support listing models");return dY(await n.listModels(t))}async function RI(n,t){if(typeof n?.models!="function")throw new TypeError("Harness session does not support listing models");return dY(await n.models(t),{requireCurrent:!0})}async function n_(n,t,o){if(typeof n?.selectModel!="function")throw new TypeError("Harness session does not support model selection");let i=(await n.selectModel(t,o))?.selected;if(!rde(i,t))throw AY(t,i,"selectModel.selected");let e=(await RI(n,o)).current;if(!tde(e,i))throw AY(i,e,"models.current");return e}function dde(n){return sY.test(n)}function hde(n){return IY.test(n)||cY.test(n)}function Ede(n){return gY.test(n)}function si(n){if(typeof n!="string")return!1;let t=n.trim();return sY.test(t)||Vpe.test(t)||IY.test(t)||cY.test(t)||gY.test(t)}async function to(n,t,o,i,e={}){if(!si(n))return null;let a=n.trim();if(e.hasImages)return ht(w("\u6A21\u578B\u548C\u63A8\u7406\u7B49\u7EA7\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002"));let A=ede(e.signal);if(dde(a)){if(!/^\/models[ \t]*$/iu.test(a))return ht(w(Wpe));try{let I=await _p(t,o,i,A),d=I?await RI(I.session,A):await nY(t,A);return ht(sde(d))}catch(I){return ht(Mp(I,"list"))}}if(hde(a)){if(!/^\/(?:reasoninglist|reasonings)[ \t]*$/iu.test(a))return ht(w(Xpe));try{let I=await _p(t,o,i,A);return ht(I?Ide(await RI(I.session,A)):o_())}catch(I){return ht(Mp(I,"reasoning-list"))}}if(Ede(a)){let I=/^\/reasoning(?:[ \t]+([^\s]+))?[ \t]*$/iu.exec(a);if(!I)return ht(w(Zpe));let d=I[1];if(!d)try{let B=await _p(t,o,i,A);return ht(B?cde(await RI(B.session,A)):o_())}catch(B){return ht(Mp(B,"reasoning-list"))}if(e.pendingInteraction)return ht([w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",w("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` +`));try{return await ag(o,i,async()=>{let B=await _p(t,o,i,A);if(!B)return ht(o_());if(await oY(B.session,e.control,A))return ht(w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210\u6216\u5148\u53D1\u9001 /stop\u3002"));let f=await RI(B.session,A),Q=f.current,y=yQ(f,Q),m;if(d.toLowerCase()==="--default")m=void 0;else{if(!y?.reasoning)return ht(i_(Q,d,y));if(m=g_(y,d),!m){let R=rY(d);if(R?.index===null)return ht(iY(d));if(!R)return ht(i_(Q,d,y));if(m=ode(y,R.index),!m)return ht(iY(d))}m=m.id}let T={provider:Q.provider,model:Q.model,...m===void 0?{}:{reasoningEffort:m}},_=await n_(B.session,T,A);return tY(o,i,B.sessionId),ht(w(`\u63A8\u7406\u7B49\u7EA7\u5DF2\u5207\u6362\u4E3A\uFF1A {effort} \u5F53\u524D\u6A21\u578B\uFF1A{model} -\u540E\u7EED\u6D88\u606F\u5C06\u4F7F\u7528\u8BE5\u63A8\u7406\u7B49\u7EA7\u3002`,{model:og(_.provider,_.model),effort:HE(y,mQ(_,y))}))})}catch(B){return ht(bp(B,"reasoning-select"))}}let r=/^\/model(?:[ \t]+([^\s]+)(?:[ \t]+([^\s]+))?)?[ \t]*$/iu.exec(a);if(!r)return ht(w(eY));let s=r[1],g=r[2];if(!s)try{let I=await Mp(t,o,i,A);if(!I)return ht(lde());let d=await RI(I.session,A);return ht(gde(d))}catch(I){return ht(bp(I,"select"))}let c=rY(s);if(c?.index===null)return ht(aY(s));if(!c&&(!s.includes("/")||s.startsWith("/")||s.endsWith("/")))return ht(w(eY));if(e.pendingInteraction)return ht([w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",w("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` -`));try{return await ag(o,i,async()=>{let I=await Mp(t,o,i,A);if(I&&await oY(I.session,e.control,A))return ht(w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210\u6216\u5148\u53D1\u9001 /stop\u3002"));let d=I?await RI(I.session,A):await nY(t,A),B=c?ide(d,c.index):ade(d,s);if(!B)return ht(c?aY(s):[w("\u6CA1\u6709\u627E\u5230\u6A21\u578B\uFF1A{model}",{model:ea(s)}),"",w("\u8BF7\u53D1\u9001 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\u3002")].join(` +\u540E\u7EED\u6D88\u606F\u5C06\u4F7F\u7528\u8BE5\u63A8\u7406\u7B49\u7EA7\u3002`,{model:og(_.provider,_.model),effort:HE(y,mQ(_,y))}))})}catch(B){return ht(Mp(B,"reasoning-select"))}}let r=/^\/model(?:[ \t]+([^\s]+)(?:[ \t]+([^\s]+))?)?[ \t]*$/iu.exec(a);if(!r)return ht(w(eY));let s=r[1],g=r[2];if(!s)try{let I=await _p(t,o,i,A);if(!I)return ht(lde());let d=await RI(I.session,A);return ht(gde(d))}catch(I){return ht(Mp(I,"select"))}let c=rY(s);if(c?.index===null)return ht(aY(s));if(!c&&(!s.includes("/")||s.startsWith("/")||s.endsWith("/")))return ht(w(eY));if(e.pendingInteraction)return ht([w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",w("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` +`));try{return await ag(o,i,async()=>{let I=await _p(t,o,i,A);if(I&&await oY(I.session,e.control,A))return ht(w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u8FD0\u884C\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210\u6216\u5148\u53D1\u9001 /stop\u3002"));let d=I?await RI(I.session,A):await nY(t,A),B=c?ide(d,c.index):ade(d,s);if(!B)return ht(c?aY(s):[w("\u6CA1\u6709\u627E\u5230\u6A21\u578B\uFF1A{model}",{model:ea(s)}),"",w("\u8BF7\u53D1\u9001 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\u3002")].join(` `));let f=yQ(d,B);if(g!==void 0){let y=g_(f,g);if(!y)return ht(i_(B,g,f));B.reasoningEffort=y.id}let Q;if(I)Q=await n_(I.session,B,A),tY(o,i,I.sessionId);else{if(typeof t?.createSession!="function"||typeof t?.workspaceSession!="function"||typeof o?.sessionFor!="function"||typeof o?.setSession!="function")throw new TypeError("Harness cannot create a conversation session");let y=await t.createSession(A);if(typeof y!="string"||!y)throw new TypeError("Harness returned an invalid session id");let m=t.workspaceSession(y);Q=await n_(m,B,A);let T=o.sessionFor(i);if(typeof T=="string"&&T)throw EY();if(await o.setSession(i,y)===!1){let _=new Error("Workspace changed while binding the new session");throw _.code=Ga,_}}return ht(w(`\u6A21\u578B\u5DF2\u5207\u6362\u4E3A\uFF1A {model} \u63A8\u7406\u7B49\u7EA7\uFF1A{effort} -\u540E\u7EED\u6D88\u606F\u5C06\u4F7F\u7528\u8BE5\u6A21\u578B\u548C\u63A8\u7406\u7B49\u7EA7\u3002`,{model:og(Q.provider,Q.model),effort:HE(f,mQ(Q,f))}))})}catch(I){return ht(bp(I,"select"))}}var c_=/^[a-z0-9][a-z0-9-]*$/,g7e=Object.freeze({defaultId:"",items:Object.freeze([])});function ng(n){if(n==null||typeof n!="string")return null;let t=n.trim();return c_.test(t)?t:null}function _p(n){if(n==null||n==="")return null;let t=ng(n);if(!t){let o=new Error(w("Agent Preset \u65E0\u6548\u3002"));throw o.code="agent-preset-invalid",o}return t}function Cde(n){if(typeof n=="string"){let i=ng(n);return i?{id:i,label:i}:null}if(!n||typeof n!="object"||n.broken!==void 0)return null;let t=ng(n.id);if(!t)return null;let o=typeof n.name=="string"&&n.name.trim()?n.name.trim().slice(0,128):typeof n.label=="string"&&n.label.trim()?n.label.trim().slice(0,128):t;return{id:t,label:o}}function $n(n){if(!n||typeof n!="object"||Array.isArray(n))return{defaultId:"",items:[]};let t=[],o=new Set;for(let i of Array.isArray(n.items)?n.items:[]){let e=Cde(i);!e||o.has(e.id)||(o.add(e.id),t.push(e))}return{defaultId:ng(n.defaultId)??"",items:t}}async function La(n){try{let t=typeof n?.get=="function"?n.get("agentPresets"):n?.agentPresets;if(!t||typeof t.list!="function")return{defaultId:"",items:[]};let o=await t.list();return $n({defaultId:typeof t.defaultId=="string"?t.defaultId:"",items:Array.isArray(o)?o:[]})}catch{return{defaultId:"",items:[]}}}var ude=/^\/preset(?=$|\s)/iu,fY=/^\/(?:presetlist|presets)(?=$|\s)/iu,Bde="\u7528\u6CD5\uFF1A/presetlist\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",l_=["\u7528\u6CD5\uFF1A","/preset \u67E5\u770B\u5F53\u524D\u8BBE\u7F6E","/preset <\u5E8F\u53F7> \u6309\u6700\u8FD1\u4E00\u6B21 /presetlist \u7684\u5E8F\u53F7\u9009\u62E9","/preset \u6309 Agent Preset ID \u9009\u62E9","/preset id:<\u7EAF\u6570\u5B57 ID> \u9009\u62E9\u7EAF\u6570\u5B57 ID","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"].join(` +\u540E\u7EED\u6D88\u606F\u5C06\u4F7F\u7528\u8BE5\u6A21\u578B\u548C\u63A8\u7406\u7B49\u7EA7\u3002`,{model:og(Q.provider,Q.model),effort:HE(f,mQ(Q,f))}))})}catch(I){return ht(Mp(I,"select"))}}var c_=/^[a-z0-9][a-z0-9-]*$/,g7e=Object.freeze({defaultId:"",items:Object.freeze([])});function ng(n){if(n==null||typeof n!="string")return null;let t=n.trim();return c_.test(t)?t:null}function Tp(n){if(n==null||n==="")return null;let t=ng(n);if(!t){let o=new Error(w("Agent Preset \u65E0\u6548\u3002"));throw o.code="agent-preset-invalid",o}return t}function Cde(n){if(typeof n=="string"){let i=ng(n);return i?{id:i,label:i}:null}if(!n||typeof n!="object"||n.broken!==void 0)return null;let t=ng(n.id);if(!t)return null;let o=typeof n.name=="string"&&n.name.trim()?n.name.trim().slice(0,128):typeof n.label=="string"&&n.label.trim()?n.label.trim().slice(0,128):t;return{id:t,label:o}}function $n(n){if(!n||typeof n!="object"||Array.isArray(n))return{defaultId:"",items:[]};let t=[],o=new Set;for(let i of Array.isArray(n.items)?n.items:[]){let e=Cde(i);!e||o.has(e.id)||(o.add(e.id),t.push(e))}return{defaultId:ng(n.defaultId)??"",items:t}}async function La(n){try{let t=typeof n?.get=="function"?n.get("agentPresets"):n?.agentPresets;if(!t||typeof t.list!="function")return{defaultId:"",items:[]};let o=await t.list();return $n({defaultId:typeof t.defaultId=="string"?t.defaultId:"",items:Array.isArray(o)?o:[]})}catch{return{defaultId:"",items:[]}}}var ude=/^\/preset(?=$|\s)/iu,fY=/^\/(?:presetlist|presets)(?=$|\s)/iu,Bde="\u7528\u6CD5\uFF1A/presetlist\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",l_=["\u7528\u6CD5\uFF1A","/preset \u67E5\u770B\u5F53\u524D\u8BBE\u7F6E","/preset <\u5E8F\u53F7> \u6309\u6700\u8FD1\u4E00\u6B21 /presetlist \u7684\u5E8F\u53F7\u9009\u62E9","/preset \u6309 Agent Preset ID \u9009\u62E9","/preset id:<\u7EAF\u6570\u5B57 ID> \u9009\u62E9\u7EAF\u6570\u5B57 ID","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"].join(` `),fde=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu,uY=new WeakMap,Qde=15*6e4,yde=256;function Cn(n){return{handled:!0,message:n,messages:ig(n)}}function mde(n){return typeof n!="string"?"":n.replace(fde," ").replace(/\s+/gu," ").trim()}function Sde(n){return n?{signal:n}:{}}function QY(n){if(!n||typeof n!="object"||Array.isArray(n)||!n.agentPresetCatalog||typeof n.agentPresetCatalog!="object"||!Array.isArray(n.agentPresetCatalog.items))throw new TypeError("Harness returned invalid Agent Preset settings");let t=n.agentPreset===null?null:ng(n.agentPreset);if(n.agentPreset!==null&&t===null)throw new TypeError("Harness returned an invalid current Agent Preset");return{agentPreset:t,agentPresetCatalog:$n(n.agentPresetCatalog)}}function SQ(n){let t=mde(n.label)||n.id;return w("{label}\uFF08{id}\uFF09",{label:t,id:n.id})}function p_(n,t){return n.items.find(o=>o.id===t)??null}function wde(n){if(!n.defaultId)return w("\u672A\u8BBE\u7F6E\u6216\u5F53\u524D\u4E0D\u53EF\u7528");let t=p_(n,n.defaultId);return t?SQ(t):w("{id}\uFF08\u5F53\u524D\u4E0D\u53EF\u7528\uFF09",{id:n.defaultId})}function d_(n){let{agentPreset:t,agentPresetCatalog:o}=n;if(t===null){let e=p_(o,o.defaultId);return e?w("\u8DDF\u968F Host \u9ED8\u8BA4\uFF1A{preset}",{preset:SQ(e)}):w("\u8DDF\u968F Host \u9ED8\u8BA4\uFF08Host \u9ED8\u8BA4\u5F53\u524D\u4E0D\u53EF\u7528\uFF09")}let i=p_(o,t);return i?SQ(i):w("{id}\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09",{id:t})}function Dde(n){return[w("\u5F53\u524D\u673A\u5668\u4EBA\u7528\u4E8E\u65B0\u4F1A\u8BDD\u7684 Agent Preset\uFF1A"),d_(n),"",w("\u5DF2\u6709\u4F1A\u8BDD\u4E0D\u4F1A\u53D7\u6B64\u8BBE\u7F6E\u5F71\u54CD\u3002"),w("\u67E5\u770B\u53EF\u7528\u9879\uFF1A/presetlist"),w("\u6062\u590D\u8DDF\u968F Host \u9ED8\u8BA4\uFF1A/preset --default")].join(` `)}function Ode(n){let{agentPreset:t,agentPresetCatalog:o}=n,i=[w("\u5F53\u524D\u673A\u5668\u4EBA\u7528\u4E8E\u65B0\u4F1A\u8BDD\u7684 Agent Preset\uFF1A"),d_(n),"",w("Host \u9ED8\u8BA4\uFF1A{preset}",{preset:wde(o)}),"",w("\u53EF\u7528 Agent Preset\uFF08{count}\uFF09\uFF1A",{count:o.items.length})];return o.items.length===0?i.push(w("\u5F53\u524D\u6CA1\u6709\u53EF\u7528 Agent Preset\u3002")):o.items.forEach((e,a)=>{let A=[];e.id===o.defaultId&&A.push(w("Host \u9ED8\u8BA4")),e.id===t&&A.push(w("\u5F53\u524D\u9009\u62E9")),t===null&&e.id===o.defaultId&&A.push(w("\u5F53\u524D\u751F\u6548"));let r=A.length>0?`\uFF08${A.join("\uFF0C")}\uFF09`:"";i.push(`${a+1}. ${SQ(e)}${r}`)}),i.push("",w("\u9009\u62E9\uFF1A/preset <\u5E8F\u53F7\u6216 ID>"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("\u6062\u590D\u8DDF\u968F Host \u9ED8\u8BA4\uFF1A/preset --default")),i.join(` `)}function bde(n){return[w("\u5F53\u524D\u673A\u5668\u4EBA\u7528\u4E8E\u65B0\u4F1A\u8BDD\u7684 Agent Preset \u5DF2\u8BBE\u7F6E\u4E3A\uFF1A"),d_(n),"",w("\u5DF2\u6709\u4F1A\u8BDD\u4E0D\u53D8\u3002\u82E5\u5F53\u524D\u804A\u5929\u5DF2\u6709\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001 /new\uFF0C\u518D\u53D1\u9001\u666E\u901A\u6D88\u606F\uFF0C\u624D\u4F1A\u4F7F\u7528\u65B0\u8BBE\u7F6E\u521B\u5EFA\u4F1A\u8BDD\u3002")].join(` `)}function yY(n,{create:t=!1}={}){if((typeof n!="object"||n===null)&&typeof n!="function")return null;let o=uY.get(n);return!o&&t&&(o=new Map,uY.set(n,o)),o??null}function Mde(n,t){for(let[o,i]of n)i.expiresAt<=t&&n.delete(o)}function _de(n,t,o){let i=yY(n,{create:!0});if(!i)return;let e=Date.now();for(Mde(i,e),i.delete(t),i.set(t,{expiresAt:e+Qde,ids:o.map(a=>a.id)});i.size>yde;){let a=i.keys().next();if(a.done)break;i.delete(a.value)}}function Tde(n,t){let o=yY(n),i=o?.get(t);return!o||!i?null:i.expiresAt<=Date.now()?(o.delete(t),null):(o.delete(t),o.set(t,i),i.ids)}function Nde(n,t,o){if(!/^\d+$/u.test(o))return{numeric:!1,id:null};let i=Number(o);if(!Number.isSafeInteger(i)||i<1)return{numeric:!0,error:w("Agent Preset \u5E8F\u53F7\u65E0\u6548\uFF0C\u8BF7\u5148\u6267\u884C /presetlist\u3002")};let e=Tde(n,t);if(!e)return{numeric:!0,error:w("\u8BF7\u5148\u6267\u884C /presetlist\uFF0C\u518D\u6309\u5217\u8868\u5E8F\u53F7\u9009\u62E9 Agent Preset\u3002")};let a=e[i-1];return a?{numeric:!0,id:a}:{numeric:!0,error:w("Agent Preset \u5E8F\u53F7\u4E0D\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C /presetlist\u3002")}}function Rde(n){return n?.code??n?.failure?.code}function I_(n,t){let o=Rde(n);return o==="agent-preset-invalid"?w(`Agent Preset ID \u683C\u5F0F\u65E0\u6548\u3002 {usage}`,{usage:w(l_)}):o==="agent-preset-unavailable"?w("Agent Preset \u4E0D\u5B58\u5728\u6216\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C /presetlist\u3002"):o===Ga||o==="workspace-bot-not-found"?w("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):o==="cancelled"||n?.name==="AbortError"?t==="list"?w("\u83B7\u53D6 Agent Preset \u5217\u8868\u5DF2\u53D6\u6D88\u3002"):t==="current"?w("\u83B7\u53D6 Agent Preset \u8BBE\u7F6E\u5DF2\u53D6\u6D88\u3002"):w("Agent Preset \u4FEE\u6539\u5DF2\u53D6\u6D88\u3002"):t==="list"?w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6 Agent Preset \u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="current"?w("\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6 Agent Preset \u8BBE\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("Agent Preset \u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function BY(n,t){if(typeof n?.agentPresetSettings!="function")throw new TypeError("Harness does not support Agent Preset settings");return QY(await n.agentPresetSettings(t))}async function kde(n,t,o){if(typeof n?.updateAgentPreset!="function")throw new TypeError("Harness does not support updating Agent Preset settings");return QY(await n.updateAgentPreset(t,o))}function gi(n){if(typeof n!="string")return!1;let t=n.trim();return fY.test(t)||ude.test(t)}async function _i(n,t,o,i,e={}){if(!gi(n))return null;let a=n.trim();if(e.hasImages)return Cn(w("Agent Preset \u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002"));let A=Sde(e.signal);if(fY.test(a)){if(!/^\/(?:presetlist|presets)[ \t]*$/iu.test(a))return Cn(w(Bde));try{let c=await BY(t,A);return _de(o,i,c.agentPresetCatalog.items),Cn(Ode(c))}catch(c){return Cn(I_(c,"list"))}}let r=/^\/preset(?:[ \t]+([^\s]+))?[ \t]*$/iu.exec(a);if(!r)return Cn(w(l_));let s=r[1];if(!s)try{return Cn(Dde(await BY(t,A)))}catch(c){return Cn(I_(c,"current"))}let g;if(s.toLowerCase()==="--default")g=null;else{let c=/^id:(\d+)$/iu.exec(s);if(c)g=c[1];else{let I=Nde(o,i,s);if(I.numeric){if(I.error)return Cn(I.error);g=I.id}else if(g=ng(s),!g)return Cn(w(`Agent Preset ID \u683C\u5F0F\u65E0\u6548\u3002 -{usage}`,{usage:w(l_)}))}}try{return await ag(o,i,async()=>Cn(bde(await kde(t,g,A))))}catch(c){return Cn(I_(c,"update"))}}var mY=Object.freeze(["channel","conversationType","senderId","senderName","botId"]),SY=8e3;var h_=Object.freeze({group:Object.freeze({enabled:!1,fields:Object.freeze(["senderId"]),guidance:""}),direct:Object.freeze({enabled:!1,fields:Object.freeze(["senderId"]),guidance:""})}),vde=["group","direct"],Pde=["enabled","fields","guidance"],Gde=["groupEnabled","directEnabled","fields","guidance"],Fde=new Set(["wecom","weixin","feishu","dingtalk","qq","slack","telegram","discord","whatsapp"]),Lde={channel:16,conversationType:6,senderId:256,senderName:256,botId:128},Ude=/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g;function Tp(n){let t=new TypeError(n);return t.code="context-enhancement-invalid",t}function E_(n,t){return n&&typeof n=="object"&&!Array.isArray(n)&&[Object.prototype,null].includes(Object.getPrototypeOf(n))&&Reflect.ownKeys(n).length===t.length&&t.every(o=>Object.hasOwn(n,o))}function wY(n){if(!E_(n,Pde))throw Tp("\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002");let{enabled:t,fields:o,guidance:i}=n;if(typeof t!="boolean")throw Tp("\u7FA4\u804A\u548C\u79C1\u804A\u5F00\u5173\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");if(!Array.isArray(o)||![...o].every(e=>mY.includes(e)))throw Tp("\u6765\u6E90\u5B57\u6BB5\u53EA\u80FD\u9009\u62E9\u5DF2\u5B9A\u4E49\u7684\u4E94\u4E2A\u5B57\u6BB5\u3002");if(typeof i!="string"||i.length>SY)throw Tp(`\u589E\u5F3A\u63D0\u793A\u8BCD\u4E0D\u5F97\u8D85\u8FC7 ${SY} \u4E2A\u5B57\u7B26\u3002`);return Object.freeze({enabled:t,fields:Object.freeze(mY.filter(e=>o.includes(e))),guidance:i.trim()?i:""})}function kI(n){if(!E_(n,vde))throw Tp("\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002");return Object.freeze({group:wY(n.group),direct:wY(n.direct)})}function Hde(n){if(!E_(n,Gde))throw Tp("\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002");return kI({group:{enabled:n.groupEnabled,fields:n.fields,guidance:n.guidance},direct:{enabled:n.directEnabled,fields:n.fields,guidance:n.guidance}})}function Np(n){try{return kI(n)}catch{try{return Hde(n)}catch{return h_}}}function Aa(n,t){if(t!=="group"&&t!=="direct")return null;try{let o=n?.getSettings?.(),i=t==="group"?"groupEnabled":"directEnabled";if((Object.hasOwn(o??{},t)?o?.[t]?.enabled:o?.[i])!==!0)return null;let A=Np(o)[t];return A.enabled!==!0?null:Object.freeze({config:A,botId:n.botId,conversationType:t})}catch{return null}}function Kde(n,t){if(t==="senderId"&&(typeof n=="bigint"||Number.isFinite(n))&&(n=String(n)),typeof n!="string")return;let o=n.replace(Ude,"").trim().slice(0,Lde[t]);if(!(!o||t==="channel"&&!Fde.has(o)))return o}function xde(n,t){let{fields:o}=n.config,e=o.some(r=>["channel","senderId","senderName"].includes(r))?t?.():null,a={};for(let r of o){let s=r==="botId"||r==="conversationType"?n[r]:e?.[r],g=Kde(s,r);g!==void 0&&(a[r]=g)}return Object.keys(a).length===0?"":`${JSON.stringify(a).replace(/[<>&]/g,r=>({"<":"\\u003c",">":"\\u003e","&":"\\u0026"})[r])}`}function Yde(n){return n.trim()?` +{usage}`,{usage:w(l_)}))}}try{return await ag(o,i,async()=>Cn(bde(await kde(t,g,A))))}catch(c){return Cn(I_(c,"update"))}}var mY=Object.freeze(["channel","conversationType","senderId","senderName","botId"]),SY=8e3;var h_=Object.freeze({group:Object.freeze({enabled:!1,fields:Object.freeze(["senderId"]),guidance:""}),direct:Object.freeze({enabled:!1,fields:Object.freeze(["senderId"]),guidance:""})}),vde=["group","direct"],Pde=["enabled","fields","guidance"],Gde=["groupEnabled","directEnabled","fields","guidance"],Fde=new Set(["wecom","weixin","feishu","dingtalk","qq","slack","telegram","discord","whatsapp"]),Lde={channel:16,conversationType:6,senderId:256,senderName:256,botId:128},Ude=/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g;function Np(n){let t=new TypeError(n);return t.code="context-enhancement-invalid",t}function E_(n,t){return n&&typeof n=="object"&&!Array.isArray(n)&&[Object.prototype,null].includes(Object.getPrototypeOf(n))&&Reflect.ownKeys(n).length===t.length&&t.every(o=>Object.hasOwn(n,o))}function wY(n){if(!E_(n,Pde))throw Np("\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002");let{enabled:t,fields:o,guidance:i}=n;if(typeof t!="boolean")throw Np("\u7FA4\u804A\u548C\u79C1\u804A\u5F00\u5173\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");if(!Array.isArray(o)||![...o].every(e=>mY.includes(e)))throw Np("\u6765\u6E90\u5B57\u6BB5\u53EA\u80FD\u9009\u62E9\u5DF2\u5B9A\u4E49\u7684\u4E94\u4E2A\u5B57\u6BB5\u3002");if(typeof i!="string"||i.length>SY)throw Np(`\u589E\u5F3A\u63D0\u793A\u8BCD\u4E0D\u5F97\u8D85\u8FC7 ${SY} \u4E2A\u5B57\u7B26\u3002`);return Object.freeze({enabled:t,fields:Object.freeze(mY.filter(e=>o.includes(e))),guidance:i.trim()?i:""})}function kI(n){if(!E_(n,vde))throw Np("\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002");return Object.freeze({group:wY(n.group),direct:wY(n.direct)})}function Hde(n){if(!E_(n,Gde))throw Np("\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002");return kI({group:{enabled:n.groupEnabled,fields:n.fields,guidance:n.guidance},direct:{enabled:n.directEnabled,fields:n.fields,guidance:n.guidance}})}function Rp(n){try{return kI(n)}catch{try{return Hde(n)}catch{return h_}}}function Aa(n,t){if(t!=="group"&&t!=="direct")return null;try{let o=n?.getSettings?.(),i=t==="group"?"groupEnabled":"directEnabled";if((Object.hasOwn(o??{},t)?o?.[t]?.enabled:o?.[i])!==!0)return null;let A=Rp(o)[t];return A.enabled!==!0?null:Object.freeze({config:A,botId:n.botId,conversationType:t})}catch{return null}}function Kde(n,t){if(t==="senderId"&&(typeof n=="bigint"||Number.isFinite(n))&&(n=String(n)),typeof n!="string")return;let o=n.replace(Ude,"").trim().slice(0,Lde[t]);if(!(!o||t==="channel"&&!Fde.has(o)))return o}function xde(n,t){let{fields:o}=n.config,e=o.some(r=>["channel","senderId","senderName"].includes(r))?t?.():null,a={};for(let r of o){let s=r==="botId"||r==="conversationType"?n[r]:e?.[r],g=Kde(s,r);g!==void 0&&(a[r]=g)}return Object.keys(a).length===0?"":`${JSON.stringify(a).replace(/[<>&]/g,r=>({"<":"\\u003c",">":"\\u003e","&":"\\u0026"})[r])}`}function Yde(n){return n.trim()?` ${n.replace(/<\/?dsh_im_source_guidance\b[^>]*(?:>|$)/gi,o=>o.replace(//g,">"))} `:""}function To(n,t,o){if(!t)return n;try{let i=[xde(t,o),Yde(t.config.guidance)].filter(Boolean);if(i.length===0)return n;let e=i.join(` @@ -213,61 +213,61 @@ ${o}`);return[w("\u4EE5\u4E0B\u662F\u7528\u6237\u901A\u8FC7\u6279\u91CF\u8F93\u5 \u5982\u9700\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\uFF0C\u8BF7\u53D1\u9001 /stop\u3002`)):a==="batch"?ua("submitting",w("\u5F53\u524D\u6279\u6B21\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u5904\u7406\u5B8C\u6210\u540E\u518D\u5F00\u542F\u65B0\u6279\u6B21\u3002")):{handled:!1};if(a==="batch")return ua("status",qde(e.messages.length),{count:e.messages.length,limit:ta});if(a==="cancel"){let s=e.messages.length;return this.#e.delete(t),ua("cancelled",s===0?w("\u5DF2\u53D6\u6D88\u6279\u91CF\u8F93\u5165\u3002"):w("\u5DF2\u53D6\u6D88\u6279\u91CF\u8F93\u5165\uFF0C\u5171\u4E22\u5F03 {count} \u6761\u6D88\u606F\u3002",{count:s}),{count:s})}if(a==="send"){if(e.messages.length===0)return ua("empty",w("\u5F53\u524D\u6279\u6B21\u8FD8\u6CA1\u6709\u5185\u5BB9\uFF0C\u8BF7\u5148\u53D1\u9001\u6587\u5B57\uFF0C\u6216\u4F7F\u7528 /cancel \u53D6\u6D88\u3002"),{count:0});let s=Object.freeze([...e.messages]),g=Object.freeze({});return e.phase="submitting",e.token=g,ua("submit",null,{token:g,messages:s,prompt:zde(s),count:s.length})}if(typeof o!="string")return ua("unsupported-content",w(`\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\uFF0C\u8FD9\u6761\u6D88\u606F\u672A\u6536\u5F55\u3002 \u8BF7\u7EE7\u7EED\u53D1\u9001\u6587\u5B57\uFF0C\u6216\u4F7F\u7528 /send\u3001/cancel\u3002`),{count:e.messages.length,limit:ta});if(o.trim().startsWith("/"))return ua("blocked-command",w("\u5F53\u524D\u6B63\u5728\u6279\u91CF\u8F93\u5165\uFF0C\u8BF7\u5148\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\u3002"),{count:e.messages.length,limit:ta});if(e.messages.length===ta)return ua("full",w(`\u5F53\u524D\u6279\u6B21\u5DF2\u6EE1\uFF0C\u8FD9\u6761\u6D88\u606F\u672A\u6536\u5F55\u3002 \u8BF7\u5148\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\uFF0C\u7136\u540E\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002`),{count:ta,limit:ta});e.messages.push(o);let r=e.messages.length;return ua("collected",r===ta?w("\u5DF2\u6536\u96C6 {count}/{limit} \u6761\uFF0C\u5F53\u524D\u6279\u6B21\u5DF2\u6EE1\uFF0C\u8BF7\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\u3002",{count:r,limit:ta}):null,{count:r,limit:ta})}complete(t,o){let i=this.#e.get(t);if(!i||i.phase!=="submitting"||i.token!==o)return Object.freeze({completed:!1});let e=i.messages.length;return this.#e.delete(t),Object.freeze({completed:!0,count:e})}fail(t,o){let i=this.#e.get(t);if(!i||i.phase!=="submitting"||i.token!==o)return Object.freeze({retained:!1});i.phase="collecting",i.token=null;let e=i.messages.length;return Object.freeze({retained:!0,count:e,message:w(`\u6279\u91CF\u5185\u5BB9\u63D0\u4EA4\u5931\u8D25\uFF0C\u5DF2\u4FDD\u7559 {count} \u6761\u6D88\u606F\u3002 -\u8BF7\u518D\u6B21\u53D1\u9001 /send \u91CD\u8BD5\u6216 /cancel \u53D6\u6D88\u3002`,{count:e})})}};import{createWriteStream as Vde}from"node:fs";import{mkdir as Wde,mkdtemp as Zde,rm as OY,writeFile as Xde}from"node:fs/promises";import{isAbsolute as bY,join as C_,relative as $de,resolve as MY}from"node:path";import{pipeline as ehe}from"node:stream/promises";var Ahe=C_(".dsh-im","inbound"),Ro=class extends Error{constructor(t,o,i=w("\u6587\u4EF6\u63A5\u6536\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),e={}){super(o,e),this.name="InboundFileError",this.code=t,this.userMessage=i}};function u_(n){return Array.isArray(n?.files)?n.files.filter(Boolean):[]}function _Y(n,t){return typeof n!="string"?t:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim()||t}function the(n,t){let o=_Y(n,"file").replace(/[^\p{L}\p{N}._ -]/gu,"_").replace(/^\.+/,"").slice(0,160)||"file";return`${String(t+1).padStart(2,"0")}-${o}`}function rhe(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;if(Buffer.isBuffer(t)||t instanceof Uint8Array)return{data:Buffer.from(t),name:n?.name??n?.filename,mediaType:n?.mediaType??n?.mimetype};let o=n?.stream??n;return o&&typeof o[Symbol.asyncIterator]=="function"?{stream:o,name:n?.name??n?.filename,mediaType:n?.mediaType??n?.mimetype}:null}function wt(n){return u_(n).length>0}function Rp(n,{signal:t}={}){let o=u_(n);return o.length===0?n:{...n,files:o.map(i=>{if(i?.data!==void 0||typeof i?.load!="function")return i;let e;try{e=Promise.resolve(i.load({signal:t}))}catch(a){e=Promise.reject(a)}return e.catch(()=>{}),{...i,async load({signal:a}={}){a?.throwIfAborted();let A=await e;return a?.throwIfAborted(),A}}})}}async function TY(n,{workspace:t,signal:o}={}){let i=u_(n);if(i.length===0)return null;if(typeof t!="string"||!bY(t))throw new Ro("inbound-file-workspace-unavailable","The Harness Session workspace is unavailable for inbound files.");o?.throwIfAborted();let e=MY(t,Ahe);await Wde(e,{recursive:!0,mode:448});let a=await Zde(C_(e,"turn-")),A=[];try{for(let[r,s]of i.entries()){o?.throwIfAborted();let g;try{g=s?.data===void 0?await s?.load?.({signal:o}):s.data}catch(f){throw o?.aborted?f:new Ro("inbound-file-download-failed",`Unable to download inbound file ${r+1}: ${f?.message??String(f)}`,w("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let c=rhe(g);if(!c)throw new Ro("inbound-file-data-invalid",`Inbound file ${r+1} returned no readable data.`);let I=_Y(c.name??s?.name,`file-${r+1}`),d=C_(a,the(I,r));if(c.data)await Xde(d,c.data,{mode:384,signal:o});else try{await ehe(c.stream,Vde(d,{flags:"wx",mode:384}),{signal:o})}catch(f){throw o?.aborted?f:new Ro("inbound-file-download-failed",`Unable to stream inbound file ${r+1}: ${f?.message??String(f)}`,w("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let B=$de(MY(t),d);if(!B||B.startsWith("..")||bY(B))throw new Ro("inbound-file-path-invalid","The staged inbound file escaped the Harness Session workspace.");A.push(Object.freeze({name:I,path:B,...typeof(c.mediaType??s?.mediaType)=="string"&&(c.mediaType??s.mediaType).trim()?{mediaType:(c.mediaType??s.mediaType).trim()}:{}}))}return Object.freeze({files:Object.freeze(A),async cleanup(){await OY(a,{recursive:!0,force:!0})}})}catch(r){throw await OY(a,{recursive:!0,force:!0}).catch(()=>{}),r}}function NY(n,t){if(!t?.files?.length)return n;let o=["",JSON.stringify({description:"Files uploaded with this user message. Paths are relative to the current Harness workspace.",files:t.files}),""].join(` +\u8BF7\u518D\u6B21\u53D1\u9001 /send \u91CD\u8BD5\u6216 /cancel \u53D6\u6D88\u3002`,{count:e})})}};import{createWriteStream as Vde}from"node:fs";import{mkdir as Wde,mkdtemp as Zde,rm as OY,writeFile as Xde}from"node:fs/promises";import{isAbsolute as bY,join as C_,relative as $de,resolve as MY}from"node:path";import{pipeline as ehe}from"node:stream/promises";var Ahe=C_(".dsh-im","inbound"),Ro=class extends Error{constructor(t,o,i=w("\u6587\u4EF6\u63A5\u6536\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),e={}){super(o,e),this.name="InboundFileError",this.code=t,this.userMessage=i}};function u_(n){return Array.isArray(n?.files)?n.files.filter(Boolean):[]}function _Y(n,t){return typeof n!="string"?t:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim()||t}function the(n,t){let o=_Y(n,"file").replace(/[^\p{L}\p{N}._ -]/gu,"_").replace(/^\.+/,"").slice(0,160)||"file";return`${String(t+1).padStart(2,"0")}-${o}`}function rhe(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;if(Buffer.isBuffer(t)||t instanceof Uint8Array)return{data:Buffer.from(t),name:n?.name??n?.filename,mediaType:n?.mediaType??n?.mimetype};let o=n?.stream??n;return o&&typeof o[Symbol.asyncIterator]=="function"?{stream:o,name:n?.name??n?.filename,mediaType:n?.mediaType??n?.mimetype}:null}function wt(n){return u_(n).length>0}function kp(n,{signal:t}={}){let o=u_(n);return o.length===0?n:{...n,files:o.map(i=>{if(i?.data!==void 0||typeof i?.load!="function")return i;let e;try{e=Promise.resolve(i.load({signal:t}))}catch(a){e=Promise.reject(a)}return e.catch(()=>{}),{...i,async load({signal:a}={}){a?.throwIfAborted();let A=await e;return a?.throwIfAborted(),A}}})}}async function TY(n,{workspace:t,signal:o}={}){let i=u_(n);if(i.length===0)return null;if(typeof t!="string"||!bY(t))throw new Ro("inbound-file-workspace-unavailable","The Harness Session workspace is unavailable for inbound files.");o?.throwIfAborted();let e=MY(t,Ahe);await Wde(e,{recursive:!0,mode:448});let a=await Zde(C_(e,"turn-")),A=[];try{for(let[r,s]of i.entries()){o?.throwIfAborted();let g;try{g=s?.data===void 0?await s?.load?.({signal:o}):s.data}catch(f){throw o?.aborted?f:new Ro("inbound-file-download-failed",`Unable to download inbound file ${r+1}: ${f?.message??String(f)}`,w("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let c=rhe(g);if(!c)throw new Ro("inbound-file-data-invalid",`Inbound file ${r+1} returned no readable data.`);let I=_Y(c.name??s?.name,`file-${r+1}`),d=C_(a,the(I,r));if(c.data)await Xde(d,c.data,{mode:384,signal:o});else try{await ehe(c.stream,Vde(d,{flags:"wx",mode:384}),{signal:o})}catch(f){throw o?.aborted?f:new Ro("inbound-file-download-failed",`Unable to stream inbound file ${r+1}: ${f?.message??String(f)}`,w("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let B=$de(MY(t),d);if(!B||B.startsWith("..")||bY(B))throw new Ro("inbound-file-path-invalid","The staged inbound file escaped the Harness Session workspace.");A.push(Object.freeze({name:I,path:B,...typeof(c.mediaType??s?.mediaType)=="string"&&(c.mediaType??s.mediaType).trim()?{mediaType:(c.mediaType??s.mediaType).trim()}:{}}))}return Object.freeze({files:Object.freeze(A),async cleanup(){await OY(a,{recursive:!0,force:!0})}})}catch(r){throw await OY(a,{recursive:!0,force:!0}).catch(()=>{}),r}}function NY(n,t){if(!t?.files?.length)return n;let o=["",JSON.stringify({description:"Files uploaded with this user message. Paths are relative to the current Harness workspace.",files:t.files}),""].join(` `);if(Array.isArray(n))return[...n,{type:"text",text:o}];let i=typeof n=="string"?n.trim():"";return i?`${i} -${o}`:o}function ko(n){return n instanceof Ro?n.userMessage:null}import{createHash as FY,randomUUID as LY}from"node:crypto";import{constants as KE}from"node:fs";import{copyFile as ahe,lstat as RY,mkdtemp as ihe,open as UY,realpath as ohe,unlink as HY}from"node:fs/promises";import{tmpdir as nhe}from"node:os";import{basename as she,extname as ghe,isAbsolute as che,join as KY,resolve as Ihe}from"node:path";var OQ="dsh_im_return_file",DQ="dsh-im-outbound-artifact",B_=64*1024,lhe=new Map([[".csv","text/csv"],[".doc","application/msword"],[".docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],[".gif","image/gif"],[".html","text/html"],[".jpeg","image/jpeg"],[".jpg","image/jpeg"],[".json","application/json"],[".md","text/markdown"],[".pdf","application/pdf"],[".png","image/png"],[".rar","application/vnd.rar"],[".txt","text/plain"],[".webp","image/webp"],[".xls","application/vnd.ms-excel"],[".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],[".xml","application/xml"],[".zip","application/zip"]]),cg=new WeakMap,xY=new WeakMap,xE=new WeakMap,kY;function phe(){return kY??=ihe(KY(nhe(),"dsh-im-outbound-")),kY}function gg(n,t){let o=new Error(t);return o.code=n,o}function vY(n){let t=n?.session?.events;if(!Array.isArray(t))return null;let o=null;for(let i of t)i?.type==="turn/start"?o=Number.isInteger(i.data?.turn)?i.data.turn:null:i?.type==="turn/end"&&i.data?.turn===o&&(o=null);return Number.isInteger(o)&&o>=0?o:null}function PY(n){let t=n?.id??n?.header?.id;return typeof t=="string"&&t?t:null}function sg(n,t){return`${n}\0${t}`}function GY(n,t){return`${n}\0${t}`}function dhe(n){let t=String(n??"").replace(/[\u0000-\u001f\u007f]/g," ").replace(new RegExp("\\p{Cf}","gu"),"").replace(/\s+/g," ").trim();return t?[...t].slice(0,255).join(""):"result.bin"}function hhe(n){return lhe.get(ghe(n).toLowerCase())??"application/octet-stream"}function Ehe(n){return FY("sha256").update(n).digest("hex")}function Che(n,t){return typeof n?.dev=="bigint"&&typeof n?.ino=="bigint"&&typeof n?.size=="bigint"&&typeof n?.mtimeNs=="bigint"&&typeof n?.ctimeNs=="bigint"&&n.dev===t?.dev&&n.ino===t?.ino&&n.size===t?.size&&n.mtimeNs===t?.mtimeNs&&n.ctimeNs===t?.ctimeNs}async function uhe(n,t){let o;try{o=await UY(n,KE.O_RDONLY);let i=FY("sha256"),e=o.createReadStream({autoClose:!1,highWaterMark:B_,...t?{signal:t}:{}});for await(let a of e)t?.throwIfAborted(),i.update(a);return i.digest("hex")}finally{await o?.close().catch(()=>{})}}async function Bhe(n,t,{signal:o,errorCode:i="artifact-changed",errorMessage:e="The result file changed while it was being read."}={}){let a=()=>gg(i,e);if(!Number.isSafeInteger(t)||t<0)throw a();o?.throwIfAborted();let A;try{A=Buffer.allocUnsafe(t)}catch{throw a()}if(typeof n?.createReadStream=="function"){let g=n.createReadStream({autoClose:!1,start:0,end:t,highWaterMark:B_,...o?{signal:o}:{}}),c=0;for await(let I of g){o?.throwIfAborted();let d=Buffer.isBuffer(I)?I:Buffer.from(I);if(c+d.length>t)throw a();d.copy(A,c),c+=d.length}if(c!==t)throw a();return A}let r=0;for(;rg)throw a();r+=I}o?.throwIfAborted();let s=Buffer.allocUnsafe(1);if((await n.read(s,0,1,t))?.bytesRead!==0)throw a();return A}async function fhe(n,t,o){o?.throwIfAborted();let i;try{let e=che(t)?t:Ihe(n,t),a=await ohe(e);if(!(await RY(a,{bigint:!0})).isFile())throw gg("artifact-not-file","The requested path is not a file.");let r=await phe();i=KY(r,`${LY()}.artifact`),await ahe(a,i,KE.COPYFILE_EXCL),o?.throwIfAborted();let s=await RY(i,{bigint:!0}),g=Number(s.size);if(!s.isFile()||!Number.isSafeInteger(g)||g<0)throw gg("artifact-unavailable","The file could not be prepared for delivery.");let c=dhe(she(e));return Object.freeze({fileName:c,mediaType:hhe(c),size:g,digest:await uhe(i,o),storagePath:i})}catch(e){throw i&&await HY(i).catch(()=>{}),e?.code?.startsWith?.("artifact-")?e:o?.aborted?o.reason??e:gg("artifact-unavailable","The requested file is unavailable.")}}function YY(n){return Object.freeze({artifactId:n.artifactId,fileName:n.fileName,size:n.size})}function wQ(n){return n.artifactId}function As(n){let t=cg.get(n);if(!t)return;if(t.releaseRequested=!0,t.materializing>0){t.cleanupRequested=!0;return}let o=[...xE.get(n)??[]];if(o.length>0){t.cleanupDeferred||(t.cleanupDeferred=!0,Promise.allSettled(o).finally(()=>{t.cleanupDeferred=!1,As(n)}));return}cg.delete(n),xE.delete(n),t.onCleanup?.(),HY(t.path).catch(()=>{})}var f_=class{#e=new Map;#A=new Map;#t=new Map;#r=new Map;#l=new Map;#o=new Map;#i=new Map;#a=new Map;#n;constructor({uuid:t=LY}={}){if(typeof t!="function")throw new TypeError("uuid must be a function");this.#n=t}openConsumer(t,o){if(typeof t!="string"||!t||typeof o!="string"||!o)throw new TypeError("sessionId and promptRpcId are required");let i=GY(t,o),e={sessionId:t,promptRpcId:o,turn:null,released:!1};return this.#o.set(i,e),()=>{if(!e.released&&(e.released=!0,this.#o.get(i)===e&&this.#o.delete(i),e.turn!==null)){let a=sg(t,e.turn);this.#i.get(a)===e&&this.#i.delete(a),this.discard(t,e.turn)}}}observeSessionEvent(t,o){let i=PY(t);if(!i||!o||typeof o!="object")return;if(o.type==="turn/start"){let A=o.data?.turn;Number.isInteger(A)&&A>=0&&this.#a.set(i,A);return}if(o.type==="user/message"){let A=o.data?.source?.rpcId,r=this.#a.get(i)??vY({session:t});if(typeof A!="string"||!A||!Number.isInteger(r))return;this.#a.set(i,r);let s=this.#o.get(GY(i,A));if(!s||s.released)return;s.turn=r,this.#i.set(sg(i,r),s);return}if(o.type!=="turn/end")return;let e=o.data?.turn;if(!Number.isInteger(e)||e<0)return;this.#a.get(i)===e&&this.#a.delete(i);let a=this.#i.get(sg(i,e));(!a||a.released)&&this.discard(i,e)}disposeSession(t){let o=PY(t);if(!o)return;let i=`${o}\0`,e=new Set;for(let a of[this.#e,this.#A])for(let[A,r]of a)if(A.startsWith(i)){for(let s of r.values())e.add(s);a.delete(A)}for(let[a,A]of this.#o)a.startsWith(i)&&(A.released=!0,this.#o.delete(a));for(let a of this.#i.keys())a.startsWith(i)&&this.#i.delete(a);this.#a.delete(o);for(let a of e)As(a)}async stage(t,o){let i=t?.path;if(typeof i!="string"||!i.trim())throw new TypeError("A file path is required.");let e=o?.agent,a=e?.session?.header?.id,A=e?.session?.header?.cwd,r=vY(e);if(typeof a!="string"||!a||typeof A!="string"||!A||r===null)throw gg("artifact-context-required","A live Harness Session is required to return a file.");let s=await fhe(A,i,o?.signal),{storagePath:g,...c}=s,I=Object.freeze({kind:DQ,schemaVersion:1,artifactId:this.#n(),deliveryKey:this.#n(),...c,source:"managed-temp",registeredBy:Object.freeze({kind:"tool-result",eventId:typeof o?.callId=="string"?o.callId:"unknown",toolName:OQ}),origin:Object.freeze({sessionId:a,turn:r,callId:typeof o?.callId=="string"?o.callId:null}),createdAt:Date.now()});cg.set(I,{path:g,materializing:0,materialized:!1,releaseRequested:!1,cleanupRequested:!1,cleanupDeferred:!1,onCleanup:()=>this.#c(I)});let d=sg(a,r),B=this.#A.get(d);return B||(B=new Map,this.#A.set(d,B)),B.set(wQ(I),I),I}commit(t){if(t?.kind!==DQ||!cg.has(t))return null;let o=sg(t.origin.sessionId,t.origin.turn),i=wQ(t),e=this.#A.get(o);if(e?.get(i)!==t)return null;e.delete(i),e.size===0&&this.#A.delete(o);let a=this.#e.get(o);return a||(a=new Map,this.#e.set(o,a)),a.set(i,t),YY(t)}release(t){if(t?.kind!==DQ)return;let o=sg(t.origin.sessionId,t.origin.turn),i=wQ(t),e=this.#A.get(o);e?.get(i)===t&&e.delete(i),e?.size===0&&this.#A.delete(o),As(t)}take(t,o,{signal:i}={}){let e=sg(t,o),a=this.#e.get(e);if(this.#e.delete(e),!a)return[];if(i?.aborted){for(let s of a.values())As(s);return[]}let A=this.#t.get(e)??new Map;this.#t.set(e,A);let r=[];for(let[s,g]of a)cg.has(g)&&(A.set(s,g),r.push(g));if(A.size===0)this.#t.delete(e);else if(!this.#s(e,i))return[];return r}discard(t,o){if(typeof t!="string"||!Number.isInteger(o))return;let i=sg(t,o),e=new Set([...this.#e.get(i)?.values()??[],...this.#A.get(i)?.values()??[]]);this.#e.delete(i),this.#A.delete(i);for(let a of e)As(a)}clear(){let t=new Set;for(let o of this.#e.values())for(let i of o.values())t.add(i);for(let o of this.#A.values())for(let i of o.values())t.add(i);for(let o of this.#t.values())for(let i of o.values())t.add(i);for(let o of t)As(o);this.#e.clear(),this.#A.clear(),this.#t.clear();for(let o of this.#r.keys())this.#p(o);for(let o of this.#o.values())o.released=!0;this.#o.clear(),this.#i.clear(),this.#a.clear()}#s(t,o){if(!o)return!0;this.#p(t);let i=this.#l.get(o);return i||(i={turnKeys:new Set,onAbort:null},i.onAbort=()=>{for(let e of[...i.turnKeys])for(let a of this.#t.get(e)?.values()??[])As(a)},this.#l.set(o,i),o.addEventListener("abort",i.onAbort,{once:!0})),i.turnKeys.add(t),this.#r.set(t,o),o.aborted?(i.onAbort(),!1):!0}#p(t){let o=this.#r.get(t);if(!o)return;this.#r.delete(t);let i=this.#l.get(o);i?.turnKeys.delete(t),i?.turnKeys.size===0&&(o.removeEventListener("abort",i.onAbort),this.#l.delete(o))}#c(t){let o=sg(t.origin.sessionId,t.origin.turn),i=wQ(t),e=this.#e.get(o);e?.get(i)===t&&e.delete(i),e?.size===0&&this.#e.delete(o);let a=this.#A.get(o);a?.get(i)===t&&a.delete(i),a?.size===0&&this.#A.delete(o);let A=this.#t.get(o);A?.get(i)===t&&A.delete(i),A?.size===0&&(this.#t.delete(o),this.#p(o))}},vI=new f_;function Qhe({registry:n=vI}={}){let t=new WeakMap,o=new Map,i=(A,r)=>{let s=o.get(A);s||(s={artifacts:[]},o.set(A,s)),s.artifacts.push(r)},e=Object.freeze({name:OQ,description:"Send a readable file or generated image to the user through the current conversation. Existing and newly created files are both valid.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",description:"Absolute path, or a path relative to the current workspace."}},required:["path"]},output:{schema:{type:"object",additionalProperties:!1,properties:{artifactId:{type:"string"},fileName:{type:"string"},size:{type:"number"}},required:["artifactId","fileName","size"]},render:(A,r)=>[{type:"text",text:`Registered ${r.fileName} (${r.size} bytes) for IM delivery.`}]},async execute(A,r){let s=await n.stage(A,r);return t.set(r,s),YY(s)}});return Object.freeze({definition:e,onResult:(A,r)=>{if(A?.name===OQ){let g=t.get(A);if(!g)return;if(t.delete(A),r?.isError){n.release(g);return}A.parent===void 0?n.commit(g):i(A.parent,g);return}let s=o.get(A?.token);if(s){if(o.delete(A.token),r?.isError){for(let g of s.artifacts)n.release(g);return}if(A.parent!==void 0){for(let g of s.artifacts)i(A.parent,g);return}for(let g of s.artifacts)n.commit(g)}}})}function Q_(n,{registry:t=vI}={}){if(typeof n?.tools?.register!="function"||typeof n?.systemPrompt?.section!="function"||typeof n?.on!="function")return!1;let o=Qhe({registry:t});return n.tools.register(o.definition),n.on("tools/result",o.onResult),n.on("session/event",(i,e)=>t.observeSessionEvent(i,e)),n.on("session/disposed",i=>t.disposeSession(i)),n.systemPrompt.section({name:"dsh-im:return-file",order:115,text:`When the user asks to receive a file or generated image, call ${OQ} with its path. Existing files can be sent directly; do not recreate or rename a file solely for delivery.`}),!0}async function jY(n,{signal:t}={}){if(t?.aborted&&(As(n),t.throwIfAborted()),n?.kind!==DQ||n.schemaVersion!==1||!cg.has(n)||typeof n.digest!="string"||!Number.isSafeInteger(n.size)||n.size<0)throw gg("artifact-invalid","The file registration is invalid.");let o=cg.get(n);o.materializing+=1;let i,e=!1;try{let a=Number.isInteger(KE.O_NOFOLLOW)?KE.O_NOFOLLOW:0;i=await UY(o.path,KE.O_RDONLY|a);let A=await i.stat({bigint:!0});if(!A.isFile()||A.size!==BigInt(n.size))throw gg("artifact-invalid","The file registration is invalid.");let r=await Bhe(i,n.size,{signal:t,errorCode:"artifact-invalid",errorMessage:"The file registration is invalid."}),s=await i.stat({bigint:!0});if(!Che(A,s)||r.byteLength!==n.size||Ehe(r)!==n.digest)throw gg("artifact-invalid","The file registration is invalid.");t?.throwIfAborted(),e=!0;let g=Object.freeze({artifactId:n.artifactId,deliveryKey:n.deliveryKey,fileName:n.fileName,mediaType:n.mediaType,size:n.size,bytes:r});return xY.set(g,n),o.materialized=!0,g}catch(a){throw a?.code?.startsWith?.("artifact-")?a:t?.aborted?t.reason??a:gg("artifact-invalid","The file registration is invalid.")}finally{await i?.close().catch(()=>{}),o.materializing-=1,(!e||o.cleanupRequested)&&As(n)}}function un(n,t){let o=xY.get(n);if(!o||!cg.has(o)||!t||typeof t.then!="function")return t;let i=xE.get(o)??new Set,e=Promise.resolve(t).then(()=>{},()=>{});return i.add(e),xE.set(o,i),e.finally(()=>{i.delete(e),i.size===0&&xE.delete(o)}),t}function y_(n){let t=cg.get(n);t&&(t.releaseRequested=!0),As(n)}var yhe=new Set(["sent","rejected","failed","unknown"]),mhe=new Set(["sent","failed","unknown"]),She=new Set(["plain","markdown"]),whe=new Set(["artifact-changed","artifact-context-required","artifact-empty","artifact-invalid","artifact-not-file","artifact-permission-required","artifact-provider-rejected","artifact-too-large","artifact-unavailable"]);function Ua(n){if(!n||typeof n!="object")return[];let t=Array.isArray(n.providerMessageIds)?n.providerMessageIds.filter(e=>typeof e=="string"&&e.trim()||Number.isSafeInteger(e)).map(String):[],i=[n.message_id,n.messageId,n.id,n.ts,n.message?.message_id,n.message?.messageId,n.message?.id,n.message?.ts,n.key?.id,n.data?.message_id,n.body?.msgid,n.body?.message_id].find(e=>typeof e=="string"&&e.trim()||Number.isSafeInteger(e));return i!==void 0&&t.push(String(i)),[...new Set(t)]}function kp(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} must be a non-empty string`);return n}function ts(n,t="plain"){let o=typeof n=="string"?{kind:"text",text:n,format:t}:n;if(!o||typeof o!="object"||Array.isArray(o)||o.kind!=="text"||typeof o.text!="string"||!o.text.trim())throw new TypeError("text delivery block must contain non-empty text");if(!She.has(o.format))throw new TypeError("text delivery format must be plain or markdown");return Object.freeze({kind:"text",text:o.text,format:o.format})}function Dhe(n){if(!Array.isArray(n))throw new TypeError("providerMessageIds must be an array");let t=[],o=new Set;for(let i of n){let e=kp(i,"providerMessageId");o.has(e)||(o.add(e),t.push(e))}return Object.freeze(t)}function Ohe(n){if(!Array.isArray(n))throw new TypeError("artifacts must be an array");return Object.freeze(n.map(t=>{if(!t||typeof t!="object")throw new TypeError("artifact result must be an object");let o=kp(t.artifactId,"artifactId");if(!yhe.has(t.outcome))throw new TypeError("artifact outcome must be sent, rejected, failed, or unknown");let i=t.reason===void 0?void 0:kp(t.reason,"artifact reason");return Object.freeze({artifactId:o,outcome:t.outcome,...i===void 0?{}:{reason:i}})}))}function bhe(n){let t=typeof n=="string"?n:n?.code;return t==="artifact-delivery-uncertain"?"unknown":whe.has(t)?"rejected":"failed"}function Zt({deliveryId:n,presentation:t,providerMessageIds:o=[],artifacts:i=[],deliveryOutcome:e,reason:a}){if(e!==void 0&&!mhe.has(e))throw new TypeError("deliveryOutcome must be sent, failed, or unknown");let A=a===void 0?void 0:kp(a,"delivery reason");return Object.freeze({schemaVersion:1,deliveryId:kp(n,"deliveryId"),presentation:kp(t,"presentation"),providerMessageIds:Dhe(o),...e===void 0?{}:{deliveryOutcome:e},...A===void 0?{}:{reason:A},artifacts:Ohe(i)})}function JY({artifactId:n,deliveryId:t,error:o,presentation:i="text-fallback",providerMessageIds:e=[]}){let a=typeof o=="string"?o:o?.code,A=typeof a=="string"&&a?a:"artifact-provider-failed";return Zt({deliveryId:t,presentation:i,providerMessageIds:e,artifacts:[{artifactId:n,outcome:bhe(o),reason:A}]})}function qY({deliveryId:n,presentation:t,receipts:o}){if(!Array.isArray(o)||o.length===0)throw new TypeError("receipts must contain at least one delivery receipt");let i=[],e=new Map,a,A;for(let r of o){if(!r||r.schemaVersion!==1)throw new TypeError("receipt must use DeliveryReceipt schema version 1");i.push(...r.providerMessageIds??[]),a===void 0&&r.deliveryOutcome!==void 0&&(a=r.deliveryOutcome,A=r.reason);for(let s of r.artifacts??[])e.set(s.artifactId,s)}return Zt({deliveryId:n,presentation:t,providerMessageIds:i,deliveryOutcome:a,reason:A,artifacts:[...e.values()]})}function Mhe(){let n=new Error("Native file delivery is unavailable");return n.code="artifact-provider-unavailable",n}function m_(n,t){return t?.aborted||n?.name==="AbortError"||n?.code==="ABORT_ERR"}function zY(n){return Array.isArray(n)?[...new Set(n.filter(t=>typeof t=="string"&&t.trim()||Number.isSafeInteger(t)).map(String))]:Ua(n)}async function _he(n,{sendFile:t,sendImage:o,signal:i}){if(n.mediaType?.startsWith("image/")&&typeof o=="function")try{return{presentation:"image",result:await o(n)}}catch(e){if(m_(e,i)||e?.code==="artifact-delivery-uncertain")throw e}if(i?.throwIfAborted(),typeof t!="function")throw Mhe();return{presentation:"file",result:await t(n)}}async function vo({artifacts:n=[],baseReceipt:t=null,deliveryId:o,aggregatePresentation:i,alwaysMerge:e=!1,channelKey:a,signal:A,sendFile:r,sendImage:s,sendFailureNotice:g,onFailure:c,logger:I}){let d=t?[t]:[],B=!!t&&t.deliveryOutcome!=="failed",f=!1,Q=0,y=0,m=0;try{for(;m0&&(T=qY({deliveryId:o??t?.deliveryId??n[0]?.deliveryKey,presentation:i??`${a}-${t?"text-and-files":"files"}`,receipts:d})),{receipt:T,userVisible:B,failureNoticeVisible:f,artifactsSent:Q,artifactSendErrors:y}}var The=Object.freeze(["open","allowlist"]),Nhe=Object.freeze(["direct","group"]),VY=256,Rhe=["direct","group"],khe=["mode","open","allowlist"],vhe=["defaultCanExecuteCommands","commandPermissionOverrides"],Phe=["users"],Ghe=["id","canExecuteCommands"],Fhe=/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/;function ro(n){let t=new TypeError(n);return t.code="access-policy-invalid",t}function YE(n,t){return n&&typeof n=="object"&&!Array.isArray(n)&&[Object.prototype,null].includes(Object.getPrototypeOf(n))&&Reflect.ownKeys(n).length===t.length&&t.every(o=>Object.hasOwn(n,o))}function $Y(n){if(typeof n=="number"){if(!Number.isFinite(n))throw ro("\u7528\u6237\u6807\u8BC6\u65E0\u6548\u3002");n=String(n)}else typeof n=="bigint"&&(n=String(n));if(typeof n!="string")throw ro("\u7528\u6237\u6807\u8BC6\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u3002");let t=n.trim();if(!t||t.length>VY||Fhe.test(t))throw ro(`\u7528\u6237\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A\u3001\u5305\u542B\u63A7\u5236\u5B57\u7B26\u6216\u8D85\u8FC7 ${VY} \u4E2A\u5B57\u7B26\u3002`);return t}function Lhe(n){if(!YE(n,Ghe))throw ro("\u7528\u6237\u6761\u76EE\u5FC5\u987B\u5305\u542B\u7528\u6237\u6807\u8BC6\u548C\u547D\u4EE4\u6743\u9650\u3002");if(typeof n.canExecuteCommands!="boolean")throw ro("\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");return Object.freeze({id:$Y(n.id),canExecuteCommands:n.canExecuteCommands})}function e1(n,{listMessage:t,duplicateMessage:o}){if(!Array.isArray(n))throw ro(t);let i=n.map(Lhe);if(new Set(i.map(({id:e})=>e)).size!==i.length)throw ro(o);return Object.freeze(i)}function Uhe(n){if(!YE(n,vhe))throw ro("\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002");if(typeof n.defaultCanExecuteCommands!="boolean")throw ro("\u5F00\u653E\u6A21\u5F0F\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");return Object.freeze({defaultCanExecuteCommands:n.defaultCanExecuteCommands,commandPermissionOverrides:e1(n.commandPermissionOverrides,{listMessage:"\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002",duplicateMessage:"\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002"})})}function Hhe(n){if(!YE(n,Phe))throw ro("\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002");return Object.freeze({users:e1(n.users,{listMessage:"\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002",duplicateMessage:"\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002"})})}function S_(n){if(!YE(n,khe))throw ro("\u8BBF\u95EE\u573A\u666F\u8BBE\u7F6E\u5FC5\u987B\u540C\u65F6\u5305\u542B\u6A21\u5F0F\u3001\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u548C\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u3002");if(!The.includes(n.mode))throw ro("\u8BBF\u95EE\u6A21\u5F0F\u53EA\u80FD\u662F open \u6216 allowlist\u3002");return Object.freeze({mode:n.mode,open:Uhe(n.open),allowlist:Hhe(n.allowlist)})}function Ic(n){if(!YE(n,Rhe))throw ro("\u8BF7\u540C\u65F6\u63D0\u4EA4\u5B8C\u6574\u7684\u79C1\u804A\u548C\u7FA4\u804A\u8BBF\u95EE\u8BBE\u7F6E\u3002");return Object.freeze({direct:S_(n.direct),group:S_(n.group)})}function vp(n){try{return Ic(n)}catch{return null}}function bQ(n){return S_(n===void 0?{mode:"allowlist",open:{defaultCanExecuteCommands:!1,commandPermissionOverrides:[]},allowlist:{users:[]}}:n)}var WY=bQ(),ZY=Object.freeze({direct:WY,group:WY});function Ig({direct:n=ZY.direct,group:t=ZY.group}={}){return Ic({direct:n,group:t})}var Khe=Object.freeze({allowed:!0,reason:"allowed"}),xhe=Object.freeze({allowed:!1,reason:"policy-unavailable"}),XY=Object.freeze({allowed:!1,reason:"invalid-context"}),Yhe=Object.freeze({allowed:!1,reason:"sender-unavailable"}),jhe=Object.freeze({allowed:!1,reason:"sender-not-allowed"}),Jhe=Object.freeze({allowed:!1,reason:"command-not-allowed"});function A1(n,{conversationType:t,senderIds:o,isCommand:i=!1,equals:e=(a,A)=>a===A}={}){let a=vp(n);if(!a)return xhe;if(!Nhe.includes(t)||typeof i!="boolean"||typeof e!="function")return XY;let A=(Array.isArray(o)?o:[o]).flatMap(c=>{try{return[$Y(c)]}catch{return[]}});if(A.length===0)return Yhe;let r=a[t],s=r.mode==="open"?r.open.commandPermissionOverrides:r.allowlist.users,g;try{g=s.filter(c=>A.some(I=>e(I,c.id)===!0))}catch{return XY}return r.mode==="allowlist"&&g.length===0?jhe:i&&!(r.mode==="open"?g.length>0?g.every(I=>I.canExecuteCommands):r.open.defaultCanExecuteCommands:g.every(I=>I.canExecuteCommands))?Jhe:Khe}var qhe=new Set(["/help","/status","/new"]);function MQ(n,{hasImages:t=!1,hasFiles:o=!1}={}){if(typeof n!="string")return!1;let i=n.trim();return i?Ni(i)||Fa(i)||!o&&(ni(i)||si(i)||gi(i))?!0:t||o?!1:qhe.has(i.toLowerCase())||a_(i)||e_(i):!1}var ao="\u4F60\u53EF\u4EE5\u53D1\u9001\u666E\u901A\u6D88\u606F\uFF0C\u4F46\u6CA1\u6709\u6267\u884C\u547D\u4EE4\u7684\u6743\u9650\u3002",zhe=Object.freeze({allowed:!0,reason:"policy-not-configured"}),Vhe=Object.freeze({allowed:!0,reason:"privileged-sender"});function Ba(n,{conversationType:t,senderIds:o,text:i="",hasImages:e=!1,hasFiles:a=!1,isCommand:A=MQ(i,{hasImages:e,hasFiles:a})}={}){if(!n)return zhe;try{if(typeof n.isPrivileged=="function"&&n.isPrivileged(o,t)===!0)return Vhe}catch{}let r=null;try{r=n.getSettings()}catch{}return A1(r,{conversationType:t,senderIds:o,isCommand:A,...typeof n.equals=="function"?{equals:n.equals}:{}})}var Whe="\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026",w_="\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002",Zhe=["\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002","","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587","/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09","/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898","/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD","/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]","/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1","/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09","/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21","/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C","/help \u663E\u793A\u672C\u5E2E\u52A9"];function Xhe(){return Zhe.map(n=>w(n)).join(` +${o}`:o}function ko(n){return n instanceof Ro?n.userMessage:null}import{createHash as FY,randomUUID as LY}from"node:crypto";import{constants as KE}from"node:fs";import{copyFile as ahe,lstat as RY,mkdtemp as ihe,open as UY,realpath as ohe,unlink as HY}from"node:fs/promises";import{tmpdir as nhe}from"node:os";import{basename as she,extname as ghe,isAbsolute as che,join as KY,resolve as Ihe}from"node:path";var OQ="dsh_im_return_file",DQ="dsh-im-outbound-artifact",B_=64*1024,lhe=new Map([[".csv","text/csv"],[".doc","application/msword"],[".docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],[".gif","image/gif"],[".html","text/html"],[".jpeg","image/jpeg"],[".jpg","image/jpeg"],[".json","application/json"],[".md","text/markdown"],[".pdf","application/pdf"],[".png","image/png"],[".rar","application/vnd.rar"],[".txt","text/plain"],[".webp","image/webp"],[".xls","application/vnd.ms-excel"],[".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],[".xml","application/xml"],[".zip","application/zip"]]),cg=new WeakMap,xY=new WeakMap,xE=new WeakMap,kY;function phe(){return kY??=ihe(KY(nhe(),"dsh-im-outbound-")),kY}function gg(n,t){let o=new Error(t);return o.code=n,o}function vY(n){let t=n?.session?.events;if(!Array.isArray(t))return null;let o=null;for(let i of t)i?.type==="turn/start"?o=Number.isInteger(i.data?.turn)?i.data.turn:null:i?.type==="turn/end"&&i.data?.turn===o&&(o=null);return Number.isInteger(o)&&o>=0?o:null}function PY(n){let t=n?.id??n?.header?.id;return typeof t=="string"&&t?t:null}function sg(n,t){return`${n}\0${t}`}function GY(n,t){return`${n}\0${t}`}function dhe(n){let t=String(n??"").replace(/[\u0000-\u001f\u007f]/g," ").replace(new RegExp("\\p{Cf}","gu"),"").replace(/\s+/g," ").trim();return t?[...t].slice(0,255).join(""):"result.bin"}function hhe(n){return lhe.get(ghe(n).toLowerCase())??"application/octet-stream"}function Ehe(n){return FY("sha256").update(n).digest("hex")}function Che(n,t){return typeof n?.dev=="bigint"&&typeof n?.ino=="bigint"&&typeof n?.size=="bigint"&&typeof n?.mtimeNs=="bigint"&&typeof n?.ctimeNs=="bigint"&&n.dev===t?.dev&&n.ino===t?.ino&&n.size===t?.size&&n.mtimeNs===t?.mtimeNs&&n.ctimeNs===t?.ctimeNs}async function uhe(n,t){let o;try{o=await UY(n,KE.O_RDONLY);let i=FY("sha256"),e=o.createReadStream({autoClose:!1,highWaterMark:B_,...t?{signal:t}:{}});for await(let a of e)t?.throwIfAborted(),i.update(a);return i.digest("hex")}finally{await o?.close().catch(()=>{})}}async function Bhe(n,t,{signal:o,errorCode:i="artifact-changed",errorMessage:e="The result file changed while it was being read."}={}){let a=()=>gg(i,e);if(!Number.isSafeInteger(t)||t<0)throw a();o?.throwIfAborted();let A;try{A=Buffer.allocUnsafe(t)}catch{throw a()}if(typeof n?.createReadStream=="function"){let g=n.createReadStream({autoClose:!1,start:0,end:t,highWaterMark:B_,...o?{signal:o}:{}}),c=0;for await(let I of g){o?.throwIfAborted();let d=Buffer.isBuffer(I)?I:Buffer.from(I);if(c+d.length>t)throw a();d.copy(A,c),c+=d.length}if(c!==t)throw a();return A}let r=0;for(;rg)throw a();r+=I}o?.throwIfAborted();let s=Buffer.allocUnsafe(1);if((await n.read(s,0,1,t))?.bytesRead!==0)throw a();return A}async function fhe(n,t,o){o?.throwIfAborted();let i;try{let e=che(t)?t:Ihe(n,t),a=await ohe(e);if(!(await RY(a,{bigint:!0})).isFile())throw gg("artifact-not-file","The requested path is not a file.");let r=await phe();i=KY(r,`${LY()}.artifact`),await ahe(a,i,KE.COPYFILE_EXCL),o?.throwIfAborted();let s=await RY(i,{bigint:!0}),g=Number(s.size);if(!s.isFile()||!Number.isSafeInteger(g)||g<0)throw gg("artifact-unavailable","The file could not be prepared for delivery.");let c=dhe(she(e));return Object.freeze({fileName:c,mediaType:hhe(c),size:g,digest:await uhe(i,o),storagePath:i})}catch(e){throw i&&await HY(i).catch(()=>{}),e?.code?.startsWith?.("artifact-")?e:o?.aborted?o.reason??e:gg("artifact-unavailable","The requested file is unavailable.")}}function YY(n){return Object.freeze({artifactId:n.artifactId,fileName:n.fileName,size:n.size})}function wQ(n){return n.artifactId}function As(n){let t=cg.get(n);if(!t)return;if(t.releaseRequested=!0,t.materializing>0){t.cleanupRequested=!0;return}let o=[...xE.get(n)??[]];if(o.length>0){t.cleanupDeferred||(t.cleanupDeferred=!0,Promise.allSettled(o).finally(()=>{t.cleanupDeferred=!1,As(n)}));return}cg.delete(n),xE.delete(n),t.onCleanup?.(),HY(t.path).catch(()=>{})}var f_=class{#e=new Map;#A=new Map;#t=new Map;#r=new Map;#l=new Map;#o=new Map;#i=new Map;#a=new Map;#n;constructor({uuid:t=LY}={}){if(typeof t!="function")throw new TypeError("uuid must be a function");this.#n=t}openConsumer(t,o){if(typeof t!="string"||!t||typeof o!="string"||!o)throw new TypeError("sessionId and promptRpcId are required");let i=GY(t,o),e={sessionId:t,promptRpcId:o,turn:null,released:!1};return this.#o.set(i,e),()=>{if(!e.released&&(e.released=!0,this.#o.get(i)===e&&this.#o.delete(i),e.turn!==null)){let a=sg(t,e.turn);this.#i.get(a)===e&&this.#i.delete(a),this.discard(t,e.turn)}}}observeSessionEvent(t,o){let i=PY(t);if(!i||!o||typeof o!="object")return;if(o.type==="turn/start"){let A=o.data?.turn;Number.isInteger(A)&&A>=0&&this.#a.set(i,A);return}if(o.type==="user/message"){let A=o.data?.source?.rpcId,r=this.#a.get(i)??vY({session:t});if(typeof A!="string"||!A||!Number.isInteger(r))return;this.#a.set(i,r);let s=this.#o.get(GY(i,A));if(!s||s.released)return;s.turn=r,this.#i.set(sg(i,r),s);return}if(o.type!=="turn/end")return;let e=o.data?.turn;if(!Number.isInteger(e)||e<0)return;this.#a.get(i)===e&&this.#a.delete(i);let a=this.#i.get(sg(i,e));(!a||a.released)&&this.discard(i,e)}disposeSession(t){let o=PY(t);if(!o)return;let i=`${o}\0`,e=new Set;for(let a of[this.#e,this.#A])for(let[A,r]of a)if(A.startsWith(i)){for(let s of r.values())e.add(s);a.delete(A)}for(let[a,A]of this.#o)a.startsWith(i)&&(A.released=!0,this.#o.delete(a));for(let a of this.#i.keys())a.startsWith(i)&&this.#i.delete(a);this.#a.delete(o);for(let a of e)As(a)}async stage(t,o){let i=t?.path;if(typeof i!="string"||!i.trim())throw new TypeError("A file path is required.");let e=o?.agent,a=e?.session?.header?.id,A=e?.session?.header?.cwd,r=vY(e);if(typeof a!="string"||!a||typeof A!="string"||!A||r===null)throw gg("artifact-context-required","A live Harness Session is required to return a file.");let s=await fhe(A,i,o?.signal),{storagePath:g,...c}=s,I=Object.freeze({kind:DQ,schemaVersion:1,artifactId:this.#n(),deliveryKey:this.#n(),...c,source:"managed-temp",registeredBy:Object.freeze({kind:"tool-result",eventId:typeof o?.callId=="string"?o.callId:"unknown",toolName:OQ}),origin:Object.freeze({sessionId:a,turn:r,callId:typeof o?.callId=="string"?o.callId:null}),createdAt:Date.now()});cg.set(I,{path:g,materializing:0,materialized:!1,releaseRequested:!1,cleanupRequested:!1,cleanupDeferred:!1,onCleanup:()=>this.#c(I)});let d=sg(a,r),B=this.#A.get(d);return B||(B=new Map,this.#A.set(d,B)),B.set(wQ(I),I),I}commit(t){if(t?.kind!==DQ||!cg.has(t))return null;let o=sg(t.origin.sessionId,t.origin.turn),i=wQ(t),e=this.#A.get(o);if(e?.get(i)!==t)return null;e.delete(i),e.size===0&&this.#A.delete(o);let a=this.#e.get(o);return a||(a=new Map,this.#e.set(o,a)),a.set(i,t),YY(t)}release(t){if(t?.kind!==DQ)return;let o=sg(t.origin.sessionId,t.origin.turn),i=wQ(t),e=this.#A.get(o);e?.get(i)===t&&e.delete(i),e?.size===0&&this.#A.delete(o),As(t)}take(t,o,{signal:i}={}){let e=sg(t,o),a=this.#e.get(e);if(this.#e.delete(e),!a)return[];if(i?.aborted){for(let s of a.values())As(s);return[]}let A=this.#t.get(e)??new Map;this.#t.set(e,A);let r=[];for(let[s,g]of a)cg.has(g)&&(A.set(s,g),r.push(g));if(A.size===0)this.#t.delete(e);else if(!this.#s(e,i))return[];return r}discard(t,o){if(typeof t!="string"||!Number.isInteger(o))return;let i=sg(t,o),e=new Set([...this.#e.get(i)?.values()??[],...this.#A.get(i)?.values()??[]]);this.#e.delete(i),this.#A.delete(i);for(let a of e)As(a)}clear(){let t=new Set;for(let o of this.#e.values())for(let i of o.values())t.add(i);for(let o of this.#A.values())for(let i of o.values())t.add(i);for(let o of this.#t.values())for(let i of o.values())t.add(i);for(let o of t)As(o);this.#e.clear(),this.#A.clear(),this.#t.clear();for(let o of this.#r.keys())this.#p(o);for(let o of this.#o.values())o.released=!0;this.#o.clear(),this.#i.clear(),this.#a.clear()}#s(t,o){if(!o)return!0;this.#p(t);let i=this.#l.get(o);return i||(i={turnKeys:new Set,onAbort:null},i.onAbort=()=>{for(let e of[...i.turnKeys])for(let a of this.#t.get(e)?.values()??[])As(a)},this.#l.set(o,i),o.addEventListener("abort",i.onAbort,{once:!0})),i.turnKeys.add(t),this.#r.set(t,o),o.aborted?(i.onAbort(),!1):!0}#p(t){let o=this.#r.get(t);if(!o)return;this.#r.delete(t);let i=this.#l.get(o);i?.turnKeys.delete(t),i?.turnKeys.size===0&&(o.removeEventListener("abort",i.onAbort),this.#l.delete(o))}#c(t){let o=sg(t.origin.sessionId,t.origin.turn),i=wQ(t),e=this.#e.get(o);e?.get(i)===t&&e.delete(i),e?.size===0&&this.#e.delete(o);let a=this.#A.get(o);a?.get(i)===t&&a.delete(i),a?.size===0&&this.#A.delete(o);let A=this.#t.get(o);A?.get(i)===t&&A.delete(i),A?.size===0&&(this.#t.delete(o),this.#p(o))}},vI=new f_;function Qhe({registry:n=vI}={}){let t=new WeakMap,o=new Map,i=(A,r)=>{let s=o.get(A);s||(s={artifacts:[]},o.set(A,s)),s.artifacts.push(r)},e=Object.freeze({name:OQ,description:"Send a readable file or generated image to the user through the current conversation. Existing and newly created files are both valid.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",description:"Absolute path, or a path relative to the current workspace."}},required:["path"]},output:{schema:{type:"object",additionalProperties:!1,properties:{artifactId:{type:"string"},fileName:{type:"string"},size:{type:"number"}},required:["artifactId","fileName","size"]},render:(A,r)=>[{type:"text",text:`Registered ${r.fileName} (${r.size} bytes) for IM delivery.`}]},async execute(A,r){let s=await n.stage(A,r);return t.set(r,s),YY(s)}});return Object.freeze({definition:e,onResult:(A,r)=>{if(A?.name===OQ){let g=t.get(A);if(!g)return;if(t.delete(A),r?.isError){n.release(g);return}A.parent===void 0?n.commit(g):i(A.parent,g);return}let s=o.get(A?.token);if(s){if(o.delete(A.token),r?.isError){for(let g of s.artifacts)n.release(g);return}if(A.parent!==void 0){for(let g of s.artifacts)i(A.parent,g);return}for(let g of s.artifacts)n.commit(g)}}})}function Q_(n,{registry:t=vI}={}){if(typeof n?.tools?.register!="function"||typeof n?.systemPrompt?.section!="function"||typeof n?.on!="function")return!1;let o=Qhe({registry:t});return n.tools.register(o.definition),n.on("tools/result",o.onResult),n.on("session/event",(i,e)=>t.observeSessionEvent(i,e)),n.on("session/disposed",i=>t.disposeSession(i)),n.systemPrompt.section({name:"dsh-im:return-file",order:115,text:`When the user asks to receive a file or generated image, call ${OQ} with its path. Existing files can be sent directly; do not recreate or rename a file solely for delivery.`}),!0}async function jY(n,{signal:t}={}){if(t?.aborted&&(As(n),t.throwIfAborted()),n?.kind!==DQ||n.schemaVersion!==1||!cg.has(n)||typeof n.digest!="string"||!Number.isSafeInteger(n.size)||n.size<0)throw gg("artifact-invalid","The file registration is invalid.");let o=cg.get(n);o.materializing+=1;let i,e=!1;try{let a=Number.isInteger(KE.O_NOFOLLOW)?KE.O_NOFOLLOW:0;i=await UY(o.path,KE.O_RDONLY|a);let A=await i.stat({bigint:!0});if(!A.isFile()||A.size!==BigInt(n.size))throw gg("artifact-invalid","The file registration is invalid.");let r=await Bhe(i,n.size,{signal:t,errorCode:"artifact-invalid",errorMessage:"The file registration is invalid."}),s=await i.stat({bigint:!0});if(!Che(A,s)||r.byteLength!==n.size||Ehe(r)!==n.digest)throw gg("artifact-invalid","The file registration is invalid.");t?.throwIfAborted(),e=!0;let g=Object.freeze({artifactId:n.artifactId,deliveryKey:n.deliveryKey,fileName:n.fileName,mediaType:n.mediaType,size:n.size,bytes:r});return xY.set(g,n),o.materialized=!0,g}catch(a){throw a?.code?.startsWith?.("artifact-")?a:t?.aborted?t.reason??a:gg("artifact-invalid","The file registration is invalid.")}finally{await i?.close().catch(()=>{}),o.materializing-=1,(!e||o.cleanupRequested)&&As(n)}}function un(n,t){let o=xY.get(n);if(!o||!cg.has(o)||!t||typeof t.then!="function")return t;let i=xE.get(o)??new Set,e=Promise.resolve(t).then(()=>{},()=>{});return i.add(e),xE.set(o,i),e.finally(()=>{i.delete(e),i.size===0&&xE.delete(o)}),t}function y_(n){let t=cg.get(n);t&&(t.releaseRequested=!0),As(n)}var yhe=new Set(["sent","rejected","failed","unknown"]),mhe=new Set(["sent","failed","unknown"]),She=new Set(["plain","markdown"]),whe=new Set(["artifact-changed","artifact-context-required","artifact-empty","artifact-invalid","artifact-not-file","artifact-permission-required","artifact-provider-rejected","artifact-too-large","artifact-unavailable"]);function Ua(n){if(!n||typeof n!="object")return[];let t=Array.isArray(n.providerMessageIds)?n.providerMessageIds.filter(e=>typeof e=="string"&&e.trim()||Number.isSafeInteger(e)).map(String):[],i=[n.message_id,n.messageId,n.id,n.ts,n.message?.message_id,n.message?.messageId,n.message?.id,n.message?.ts,n.key?.id,n.data?.message_id,n.body?.msgid,n.body?.message_id].find(e=>typeof e=="string"&&e.trim()||Number.isSafeInteger(e));return i!==void 0&&t.push(String(i)),[...new Set(t)]}function vp(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} must be a non-empty string`);return n}function ts(n,t="plain"){let o=typeof n=="string"?{kind:"text",text:n,format:t}:n;if(!o||typeof o!="object"||Array.isArray(o)||o.kind!=="text"||typeof o.text!="string"||!o.text.trim())throw new TypeError("text delivery block must contain non-empty text");if(!She.has(o.format))throw new TypeError("text delivery format must be plain or markdown");return Object.freeze({kind:"text",text:o.text,format:o.format})}function Dhe(n){if(!Array.isArray(n))throw new TypeError("providerMessageIds must be an array");let t=[],o=new Set;for(let i of n){let e=vp(i,"providerMessageId");o.has(e)||(o.add(e),t.push(e))}return Object.freeze(t)}function Ohe(n){if(!Array.isArray(n))throw new TypeError("artifacts must be an array");return Object.freeze(n.map(t=>{if(!t||typeof t!="object")throw new TypeError("artifact result must be an object");let o=vp(t.artifactId,"artifactId");if(!yhe.has(t.outcome))throw new TypeError("artifact outcome must be sent, rejected, failed, or unknown");let i=t.reason===void 0?void 0:vp(t.reason,"artifact reason");return Object.freeze({artifactId:o,outcome:t.outcome,...i===void 0?{}:{reason:i}})}))}function bhe(n){let t=typeof n=="string"?n:n?.code;return t==="artifact-delivery-uncertain"?"unknown":whe.has(t)?"rejected":"failed"}function Zt({deliveryId:n,presentation:t,providerMessageIds:o=[],artifacts:i=[],deliveryOutcome:e,reason:a}){if(e!==void 0&&!mhe.has(e))throw new TypeError("deliveryOutcome must be sent, failed, or unknown");let A=a===void 0?void 0:vp(a,"delivery reason");return Object.freeze({schemaVersion:1,deliveryId:vp(n,"deliveryId"),presentation:vp(t,"presentation"),providerMessageIds:Dhe(o),...e===void 0?{}:{deliveryOutcome:e},...A===void 0?{}:{reason:A},artifacts:Ohe(i)})}function JY({artifactId:n,deliveryId:t,error:o,presentation:i="text-fallback",providerMessageIds:e=[]}){let a=typeof o=="string"?o:o?.code,A=typeof a=="string"&&a?a:"artifact-provider-failed";return Zt({deliveryId:t,presentation:i,providerMessageIds:e,artifacts:[{artifactId:n,outcome:bhe(o),reason:A}]})}function qY({deliveryId:n,presentation:t,receipts:o}){if(!Array.isArray(o)||o.length===0)throw new TypeError("receipts must contain at least one delivery receipt");let i=[],e=new Map,a,A;for(let r of o){if(!r||r.schemaVersion!==1)throw new TypeError("receipt must use DeliveryReceipt schema version 1");i.push(...r.providerMessageIds??[]),a===void 0&&r.deliveryOutcome!==void 0&&(a=r.deliveryOutcome,A=r.reason);for(let s of r.artifacts??[])e.set(s.artifactId,s)}return Zt({deliveryId:n,presentation:t,providerMessageIds:i,deliveryOutcome:a,reason:A,artifacts:[...e.values()]})}function Mhe(){let n=new Error("Native file delivery is unavailable");return n.code="artifact-provider-unavailable",n}function m_(n,t){return t?.aborted||n?.name==="AbortError"||n?.code==="ABORT_ERR"}function zY(n){return Array.isArray(n)?[...new Set(n.filter(t=>typeof t=="string"&&t.trim()||Number.isSafeInteger(t)).map(String))]:Ua(n)}async function _he(n,{sendFile:t,sendImage:o,signal:i}){if(n.mediaType?.startsWith("image/")&&typeof o=="function")try{return{presentation:"image",result:await o(n)}}catch(e){if(m_(e,i)||e?.code==="artifact-delivery-uncertain")throw e}if(i?.throwIfAborted(),typeof t!="function")throw Mhe();return{presentation:"file",result:await t(n)}}async function vo({artifacts:n=[],baseReceipt:t=null,deliveryId:o,aggregatePresentation:i,alwaysMerge:e=!1,channelKey:a,signal:A,sendFile:r,sendImage:s,sendFailureNotice:g,onFailure:c,logger:I}){let d=t?[t]:[],B=!!t&&t.deliveryOutcome!=="failed",f=!1,Q=0,y=0,m=0;try{for(;m0&&(T=qY({deliveryId:o??t?.deliveryId??n[0]?.deliveryKey,presentation:i??`${a}-${t?"text-and-files":"files"}`,receipts:d})),{receipt:T,userVisible:B,failureNoticeVisible:f,artifactsSent:Q,artifactSendErrors:y}}var The=Object.freeze(["open","allowlist"]),Nhe=Object.freeze(["direct","group"]),VY=256,Rhe=["direct","group"],khe=["mode","open","allowlist"],vhe=["defaultCanExecuteCommands","commandPermissionOverrides"],Phe=["users"],Ghe=["id","canExecuteCommands"],Fhe=/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/;function ro(n){let t=new TypeError(n);return t.code="access-policy-invalid",t}function YE(n,t){return n&&typeof n=="object"&&!Array.isArray(n)&&[Object.prototype,null].includes(Object.getPrototypeOf(n))&&Reflect.ownKeys(n).length===t.length&&t.every(o=>Object.hasOwn(n,o))}function $Y(n){if(typeof n=="number"){if(!Number.isFinite(n))throw ro("\u7528\u6237\u6807\u8BC6\u65E0\u6548\u3002");n=String(n)}else typeof n=="bigint"&&(n=String(n));if(typeof n!="string")throw ro("\u7528\u6237\u6807\u8BC6\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u3002");let t=n.trim();if(!t||t.length>VY||Fhe.test(t))throw ro(`\u7528\u6237\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A\u3001\u5305\u542B\u63A7\u5236\u5B57\u7B26\u6216\u8D85\u8FC7 ${VY} \u4E2A\u5B57\u7B26\u3002`);return t}function Lhe(n){if(!YE(n,Ghe))throw ro("\u7528\u6237\u6761\u76EE\u5FC5\u987B\u5305\u542B\u7528\u6237\u6807\u8BC6\u548C\u547D\u4EE4\u6743\u9650\u3002");if(typeof n.canExecuteCommands!="boolean")throw ro("\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");return Object.freeze({id:$Y(n.id),canExecuteCommands:n.canExecuteCommands})}function e1(n,{listMessage:t,duplicateMessage:o}){if(!Array.isArray(n))throw ro(t);let i=n.map(Lhe);if(new Set(i.map(({id:e})=>e)).size!==i.length)throw ro(o);return Object.freeze(i)}function Uhe(n){if(!YE(n,vhe))throw ro("\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002");if(typeof n.defaultCanExecuteCommands!="boolean")throw ro("\u5F00\u653E\u6A21\u5F0F\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");return Object.freeze({defaultCanExecuteCommands:n.defaultCanExecuteCommands,commandPermissionOverrides:e1(n.commandPermissionOverrides,{listMessage:"\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002",duplicateMessage:"\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002"})})}function Hhe(n){if(!YE(n,Phe))throw ro("\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002");return Object.freeze({users:e1(n.users,{listMessage:"\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002",duplicateMessage:"\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002"})})}function S_(n){if(!YE(n,khe))throw ro("\u8BBF\u95EE\u573A\u666F\u8BBE\u7F6E\u5FC5\u987B\u540C\u65F6\u5305\u542B\u6A21\u5F0F\u3001\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u548C\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u3002");if(!The.includes(n.mode))throw ro("\u8BBF\u95EE\u6A21\u5F0F\u53EA\u80FD\u662F open \u6216 allowlist\u3002");return Object.freeze({mode:n.mode,open:Uhe(n.open),allowlist:Hhe(n.allowlist)})}function Ic(n){if(!YE(n,Rhe))throw ro("\u8BF7\u540C\u65F6\u63D0\u4EA4\u5B8C\u6574\u7684\u79C1\u804A\u548C\u7FA4\u804A\u8BBF\u95EE\u8BBE\u7F6E\u3002");return Object.freeze({direct:S_(n.direct),group:S_(n.group)})}function Pp(n){try{return Ic(n)}catch{return null}}function bQ(n){return S_(n===void 0?{mode:"allowlist",open:{defaultCanExecuteCommands:!1,commandPermissionOverrides:[]},allowlist:{users:[]}}:n)}var WY=bQ(),ZY=Object.freeze({direct:WY,group:WY});function Ig({direct:n=ZY.direct,group:t=ZY.group}={}){return Ic({direct:n,group:t})}var Khe=Object.freeze({allowed:!0,reason:"allowed"}),xhe=Object.freeze({allowed:!1,reason:"policy-unavailable"}),XY=Object.freeze({allowed:!1,reason:"invalid-context"}),Yhe=Object.freeze({allowed:!1,reason:"sender-unavailable"}),jhe=Object.freeze({allowed:!1,reason:"sender-not-allowed"}),Jhe=Object.freeze({allowed:!1,reason:"command-not-allowed"});function A1(n,{conversationType:t,senderIds:o,isCommand:i=!1,equals:e=(a,A)=>a===A}={}){let a=Pp(n);if(!a)return xhe;if(!Nhe.includes(t)||typeof i!="boolean"||typeof e!="function")return XY;let A=(Array.isArray(o)?o:[o]).flatMap(c=>{try{return[$Y(c)]}catch{return[]}});if(A.length===0)return Yhe;let r=a[t],s=r.mode==="open"?r.open.commandPermissionOverrides:r.allowlist.users,g;try{g=s.filter(c=>A.some(I=>e(I,c.id)===!0))}catch{return XY}return r.mode==="allowlist"&&g.length===0?jhe:i&&!(r.mode==="open"?g.length>0?g.every(I=>I.canExecuteCommands):r.open.defaultCanExecuteCommands:g.every(I=>I.canExecuteCommands))?Jhe:Khe}var qhe=new Set(["/help","/status","/new"]);function MQ(n,{hasImages:t=!1,hasFiles:o=!1}={}){if(typeof n!="string")return!1;let i=n.trim();return i?Ni(i)||Fa(i)||!o&&(ni(i)||si(i)||gi(i))?!0:t||o?!1:qhe.has(i.toLowerCase())||a_(i)||e_(i):!1}var ao="\u4F60\u53EF\u4EE5\u53D1\u9001\u666E\u901A\u6D88\u606F\uFF0C\u4F46\u6CA1\u6709\u6267\u884C\u547D\u4EE4\u7684\u6743\u9650\u3002",zhe=Object.freeze({allowed:!0,reason:"policy-not-configured"}),Vhe=Object.freeze({allowed:!0,reason:"privileged-sender"});function Ba(n,{conversationType:t,senderIds:o,text:i="",hasImages:e=!1,hasFiles:a=!1,isCommand:A=MQ(i,{hasImages:e,hasFiles:a})}={}){if(!n)return zhe;try{if(typeof n.isPrivileged=="function"&&n.isPrivileged(o,t)===!0)return Vhe}catch{}let r=null;try{r=n.getSettings()}catch{}return A1(r,{conversationType:t,senderIds:o,isCommand:A,...typeof n.equals=="function"?{equals:n.equals}:{}})}var Whe="\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026",w_="\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002",Zhe=["\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002","","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587","/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09","/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898","/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD","/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]","/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1","/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09","/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21","/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C","/help \u663E\u793A\u672C\u5E2E\u52A9"];function Xhe(){return Zhe.map(n=>w(n)).join(` `)}function mt(n){return typeof n=="string"&&n.trim()?n.trim():null}function $he(n){let t=Ua(n),o=mt(n?.processQueryKey);return o&&!t.includes(o)&&t.push(o),t}function _Q(n){let t=[],o=new Set,i=n;for(;i&&typeof i=="object"&&t.length<3&&!o.has(i);){o.add(i);let e=mt(i.name)?.slice(0,80),a=mt(i.code)?.slice(0,80),A=mt(i.providerCode)?.slice(0,160),r=Number.isInteger(i.status)?i.status:void 0;t.push({...e?{name:e}:{},...a?{code:a}:{},...A?{providerCode:A}:{},...r?{status:r}:{}}),i=i.cause}return t}function eEe(n){let t=n,o=new Set;for(;t&&typeof t=="object"&&!o.has(t);){if(o.add(t),t.code==="image-download-address-failed")return w("\u9489\u9489\u672A\u80FD\u6362\u53D6\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u7684\u201C\u4F01\u4E1A\u5185\u673A\u5668\u4EBA\u53D1\u9001\u6D88\u606F\u6743\u9650\u201D\u3002");if(t.code==="invalid-image-download")return w("\u9489\u9489\u6CA1\u6709\u8FD4\u56DE\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002");if(t.code==="image-content-download-failed")return w("\u9489\u9489\u8FD4\u56DE\u7684\u56FE\u7247\u4E34\u65F6\u5730\u5740\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002");t=t.cause}return bo(n)}function t1(n){return mt(n?.senderStaffId)??mt(n?.senderId)}function AEe(n){if(n?.content&&typeof n.content=="object")return n.content;if(typeof n?.content!="string")return null;try{let t=JSON.parse(n.content);return t&&typeof t=="object"?t:null}catch{return null}}function tEe(n){let t=n?.richText??n?.rich_text;return Array.isArray(t)?t:[]}function rEe(n){return typeof n?.text=="string"?mt(n.text):typeof n?.text?.content=="string"?mt(n.text.content):String(n?.type).toLowerCase()==="text"&&typeof n?.content=="string"?mt(n.content):null}function D_(n){return mt(n?.downloadCode)??mt(n?.pictureDownloadCode)}function O_(n,{api:t,clientId:o,clientSecret:i}={}){let e=String(n?.msgtype??"").toLowerCase(),a=AEe(n),A=e==="richtext"?tEe(a):[],r=e==="text"?mt(n?.text?.content)??"":A.map(rEe).filter(Boolean).join(` -`),s=[];if(e==="picture"){let c=D_(a);c&&s.push(c)}else if(e==="richtext")for(let c of A){if(String(c?.type??"").toLowerCase()!=="picture")continue;let I=D_(c);I&&s.push(I)}let g=e==="file"?D_(a):null;return{content:r,images:s.map((c,I)=>({name:I===0?"image":`image-${I+1}`,load:({signal:d,maxBytes:B})=>{if(typeof t?.downloadImage!="function")throw new Error("DingTalk API does not support image downloads");return t.downloadImage({clientId:o,clientSecret:i,robotCode:n?.robotCode,downloadCode:c,signal:d,maxBytes:B})}})),files:g?[{name:mt(a?.fileName??a?.file_name)??"file",load:({signal:c}={})=>{if(typeof t?.downloadFile!="function")throw new Error("DingTalk API does not support file downloads");return t.downloadFile({clientId:o,clientSecret:i,robotCode:n?.robotCode,downloadCode:g,signal:c})}}]:[]}}function aEe(n,t){if(String(n?.conversationType)==="2"){let o=mt(n?.conversationId);if(!o)throw new Error("DingTalk group message has no conversation id");return`group:${o}`}return`p2p:${t}`}function iEe(n,t){return String(n?.conversationType)==="2"?{type:"group",openConversationId:mt(n?.conversationId),atUserIds:{[t]:mt(n?.senderNick)??t}}:{type:"user",userId:t}}function oEe(n,t,o){let i=mt(n?.robotCode)??o;return String(n?.conversationType)==="2"?{type:"group",openConversationId:mt(n?.conversationId),robotCode:i}:{type:"user",userId:t,robotCode:i}}function nEe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u5E94\u7528\u6216\u673A\u5668\u4EBA\u7F3A\u5C11\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002\u8BF7\u5F00\u901A\u5E94\u7528 qyapi_base \u6743\u9650\uFF0C\u5E76\u786E\u8BA4\u673A\u5668\u4EBA\u5177\u5907\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u9489\u9489\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u9489\u9489\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\u548C\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u914D\u7F6E\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u9489\u9489\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function sEe(n){return n?.type==="text"&&mt(n.text)?n.text:n?.type==="tool"?n.name==="web_search"?w("_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_"):w("_\u6B63\u5728\u4F7F\u7528 {name}\u2026_",{name:mt(n.name)??w("\u5DE5\u5177")}):w("_{text}_",{text:mt(n?.text)??w("\u6B63\u5728\u5904\u7406\u2026")})}function gEe(n,t,o){if(t.needsPresentation||!t.questions[t.index]||t.actor!==o||String(n?.conversationType)==="2"&&n?.isInAtList!==!0||n?.msgtype!=="text"||!mt(n?.text?.content))return!1;try{return gc(n.sessionWebhook),!0}catch{return!1}}function cEe(n){n.stats??={};for(let t of["messagesReceived","messagesReplied","messagesRejected","messagesIgnored","reactionsAdded","reactionsRemoved","reactionErrors"])n[t]??=0,n.stats[t]=n[t];n.pendingSenders??=[]}function Lr(n,t){n[t]=(n[t]??0)+1,n.stats??={},n.stats[t]=n[t]}function b_({pendingSenders:n=[]}={}){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,messagesIgnored:0,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null,pendingSenders:structuredClone(n),stats:{messagesReceived:0,messagesReplied:0,messagesRejected:0,messagesIgnored:0,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0}}}var TQ=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I=new Map;#d=new Map;#h=new Map;#C=new Set;#u=new Set;#B=new Map;#f;#Q=new Ti;constructor({api:t,clientId:o,clientSecret:i,harness:e,state:a,contextEnhancement:A,accessPolicy:r,status:s=b_(),logger:g=console,replyTimeoutMs:c=6e5,reactionTimeoutMs:I=5e3,maxMessageChars:d=4e3,signal:B}){if(!t||typeof t.sendText!="function")throw new TypeError("DingTalk API is required");if(!mt(o)||!mt(i))throw new TypeError("DingTalk app credentials are required");if(!e||!a)throw new TypeError("Harness client and state store are required");this.#e=t,this.#A=o.trim(),this.#t=i.trim(),this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#f=new Di({label:"DingTalk",logger:g}),this.#s=c,this.#p=Number.isFinite(I)&&I>0?Math.floor(I):5e3,this.#c=d,this.#g=B,cEe(this.#a),this.#U()}get status(){return this.#U(),structuredClone(this.#a)}accept(t,{contextSnapshot:o}={}){if(this.#g?.aborted)return Promise.resolve();let i=mt(t?.msgId),e=t1(t);if(!i||!e||this.#l.hasSeen(i)||this.#B.has(i))return Promise.resolve();let a=String(t.conversationType)==="2"?"group":String(t.conversationType)==="1"?"direct":null,A;try{A=aEe(t,e)}catch{return Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),Promise.resolve()}let r=null;try{r=gc(t.sessionWebhook)}catch{}let s=this.#d.get(A),g=O_(t,{api:this.#e,clientId:this.#A,clientSecret:this.#t}),c=mt(g.content)??"",I=String(t.conversationType)!=="2"||t?.isInAtList===!0,d=String(t.conversationType)!=="2";if(I){let _=Ba(this.#i,{conversationType:a,senderIds:e,text:c,hasImages:Tt(g),hasFiles:wt(g)});if(!_.allowed)return this.#B.set(i,null),this.#T(t,i,r,_)}this.#B.set(i,o===void 0?Aa(this.#o,a):o),r&&d&&So(this.#l,{sessionWebhook:r});let B=r&&I?this.#y(t):null,f=_=>Promise.resolve(_).then(R=>(this.#m(B,this.#g?.aborted?"clear":"success"),R),R=>{throw this.#m(B,this.#g?.aborted||R?.name==="AbortError"||R?.code==="turn-stopped"?"clear":"error"),R}),Q=String(t?.msgtype).toLowerCase()==="text"&&Ni(c),y=this.#Q.status(A);if(Q&&!d&&r&&I)return f(this.#N(i,r,{message:es()},B));if(d&&r&&(Q||y.phase==="collecting")){let R=/^\/batch$/iu.test(c)&&y.phase==="idle"&&(this.#I.has(A)||s||this.#f.hasPending(A))?{handled:!0,kind:"busy",message:No()}:this.#Q.handle(A,c,{plainText:!!c&&String(t?.msgtype).toLowerCase()==="text"&&!wt(g)&&!Tt(g)});if(R.handled)return R.kind==="submit"?f(this.#D({...t,msgtype:"text",text:{content:R.prompt}},i,e,A,{batchSubmission:R,statusReaction:B})):f(this.#N(i,r,R,B))}let m=Fa(c)?Ao:wt(g)?null:ni(c)?Mi:si(c)?to:gi(c)?_i:null;if(m&&r&&I){let _;return _=this.#E(t,i,A,r,g,m).catch(R=>{if(R?.code==="turn-stopped"||this.#g?.aborted){this.#m(B,"clear");return}this.#m(B,"error"),this.#a.lastError=R?.message??String(R);let K=At(this.#a,R);return this.#n.error?.(`[dsh-dingtalk] failed to process a command [${K.referenceId}]`,_Q(R)),this.#v(r,dt(K),this.#L(t)).catch(()=>{})}).finally(()=>{this.#B.delete(i),this.#u.delete(_)}),this.#u.add(_),f(_)}let T=this.#f.claimReply({key:A,actor:e,messageId:i,text:r&&t?.msgtype==="text"?mt(t?.text?.content)??"":"",addressed:String(t?.conversationType)!=="2"||t?.isInAtList===!0,hasPendingQuestion:!!s,questionCompletion:s?.submitting||s?.claimedReplyMessageId?s.queue:null,isQuestionPending:()=>this.#d.has(A),send:r?_=>this.#v(r,_,this.#L(t)):async()=>{}});if(T){let _;return _=T.process(async()=>this.#l.hasSeen(i)?!1:(await this.#l.markSeen(i),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),r||(Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),this.#a.lastError=w("\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002")),!0)).catch(R=>{if(this.#g?.aborted){this.#m(B,"clear");return}this.#m(B,"error"),this.#a.lastError=w("\u9489\u9489\u5BA1\u6279\u5904\u7406\u5931\u8D25\u3002"),this.#n.error?.("[dsh-dingtalk] failed to process an approval reply",R)}).finally(()=>{this.#B.delete(i),this.#C.delete(_)}),this.#C.add(_),f(_)}if(s&&s.actor!==e)return f(this.#D(t,i,e,A,{statusReaction:B}));if(s?.submitting||s?.claimedReplyMessageId)return f(this.#D(t,i,e,A,{statusReaction:B}));if(s){gEe(t,s,e)&&(s.claimedReplyMessageId=i);let R=(s.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#w(t,i,e,A,s,B)).finally(()=>{this.#B.delete(i),s.claimedReplyMessageId===i&&(s.claimedReplyMessageId=null),s.queue===R&&(s.queue=null)});return s.queue=R,f(R)}return f(this.#D(t,i,e,A,{statusReaction:B}))}#S(t,o,i,e){let a=new AbortController,A=Promise.resolve().then(()=>this.#e[t]({clientId:this.#A,clientSecret:this.#t,...o,reactionName:i,signal:a.signal})),r,s=new Promise((g,c)=>{r=setTimeout(()=>{let I=new DOMException("DingTalk reaction timed out","TimeoutError");a.abort(I),c(I)},this.#p),r.unref?.()});return Promise.race([A,s]).then(()=>(Lr(this.#a,e==="add"?"reactionsAdded":"reactionsRemoved"),!0)).catch(g=>(Lr(this.#a,"reactionErrors"),this.#n.debug?.(`[dsh-dingtalk] ${t} failed`,_Q(g)),!1)).finally(()=>clearTimeout(r))}#y(t){if(typeof this.#e.addReaction!="function"||typeof this.#e.recallReaction!="function")return null;let o=mt(t?.msgId),i=mt(t?.conversationId);if(!o||!i)return null;let e={messageId:o,conversationId:i,robotCode:mt(t?.robotCode)??this.#A};return{target:e,attached:this.#S("addReaction",e,TI,"add"),terminal:!1}}#m(t,o){if(!t||t.terminal)return;t.terminal=!0;let i=o==="success"?wx:o==="error"?Dx:null;t.attached.then(async e=>{let a=await this.#S("recallReaction",t.target,TI,"remove");(!e||!a)&&(await new Promise(A=>{setTimeout(A,Math.min(1e3,this.#p)).unref?.()}),a=await this.#S("recallReaction",t.target,TI,"remove")||a),!(!a||!i||this.#g?.aborted)&&await this.#S("addReaction",t.target,i,"add")}).catch(()=>{})}#D(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1,batchSubmission:r=null,statusReaction:s=null}={}){let g=!1;try{gc(t.sessionWebhook),g=!0}catch{}let c=String(t.conversationType)!=="2"||t.isInAtList===!0,I=g&&c?Rp(O_(t,{api:this.#e,clientId:this.#A,clientSecret:this.#t}),{signal:this.#g}):void 0,B=(this.#I.get(e)??Promise.resolve()).catch(()=>{}).then(()=>this.#O(t,o,i,e,{alreadyRecorded:A,preparedMessage:I,batchSubmission:r,statusReaction:s})).finally(()=>{a&&this.#B.delete(o),this.#I.get(e)===B&&this.#I.delete(e)});return this.#I.set(e,B),B}async waitForIdle(){await Promise.allSettled([...this.#I.values(),...[...this.#d.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#C,...this.#u])}async#E(t,o,i,e,a,A){if(this.#g?.throwIfAborted(),this.#l.hasSeen(o))return;await this.#l.markSeen(o),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString();let r=await A(mt(a.content)??"",this.#r,this.#l,i,{signal:this.#g,isDirect:String(t.conversationType)==="1",hasImages:Tt(a),hasFiles:wt(a),pendingInteraction:this.#d.has(i)||this.#f.hasPending(i),control:{owner:this,key:i}});r?.stopped&&await Promise.allSettled([this.#H(i),this.#f.closeRoute(i)]);for(let s of r?.messages??[r?.message])s&&await this.#v(e,s,this.#L(t));this.#a.lastError=null}#N(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#l.hasSeen(t)||(await this.#l.markSeen(t),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),i.message&&await this.#v(o,i.message),this.#a.lastError=null)}).catch(async A=>{if(this.#g?.aborted){this.#m(e,"clear");return}this.#m(e,"error"),this.#a.lastError=A?.message??String(A);let r=At(this.#a,A);this.#n.error?.(`[dsh-dingtalk] failed to process a batch input message [${r.referenceId}]`,_Q(A)),await this.#v(o,dt(r)).catch(()=>{})}).finally(()=>{this.#B.delete(t),this.#u.delete(a)}),this.#u.add(a),a}#T(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#l.hasSeen(o)||(await this.#l.markSeen(o),e.reason==="command-not-allowed"&&i?(Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),await this.#v(i,w(ao),this.#L(t)),Lr(this.#a,"messagesReplied"),this.#a.lastReplyAt=new Date().toISOString()):(Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString()),this.#a.lastError=null)}).catch(A=>{this.#g?.aborted||(this.#a.lastError=A?.message??String(A),this.#n.error?.("[dsh-dingtalk] failed to apply inbound access policy",A))}).finally(()=>{this.#B.delete(o),this.#u.delete(a)}),this.#u.add(a),a}async#O(t,o,i,e,{alreadyRecorded:a=!1,preparedMessage:A,batchSubmission:r=null,statusReaction:s=null}={}){if(this.#g?.throwIfAborted(),!a){if(this.#l.hasSeen(o))return;await this.#l.markSeen(o),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString()}if(String(t.conversationType)==="2"&&t.isInAtList!==!0){Lr(this.#a,"messagesIgnored");return}let g;try{g=gc(t.sessionWebhook)}catch{Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),this.#a.lastError=w("\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002");return}let c=A??O_(t,{api:this.#e,clientId:this.#A,clientSecret:this.#t}),I=c.content,d=Tt(c),B=wt(c),f=String(t?.msgtype).toLowerCase()==="text",Q=null,y=!1,m=r===null;try{if(!I&&!d&&!B){await this.#v(g,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002"),this.#L(t));return}let T=I.toLowerCase();if(f&&!d&&!B&&T==="/help"){await this.#v(g,Xhe(),this.#L(t));return}if(f&&!d&&!B&&T==="/status"){await this.#r.ensureRunning({signal:this.#g}),await this.#v(g,w("\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),this.#L(t));return}if(f&&!d&&!B&&T==="/new"){await this.#l.clearSession(e),await this.#v(g,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),this.#L(t));return}let _=f&&!d&&!B?await Mo(I,this.#r,e):null;if(_){for(let N of _.messages??[_.message])await this.#v(g,N,this.#L(t));return}let R=f&&!d&&!B?await bi(I,this.#r,this.#l,e,{signal:this.#g}):null;if(R){await this.#v(g,R.message,this.#L(t));return}let K=d?await Oo(c,{signal:this.#g}):void 0,L=this.#B.get(o);L&&(K=To(K??I,L,()=>({channel:"dingtalk",senderId:i,senderName:t.senderNick}))),typeof this.#e.createAiCard=="function"&&typeof this.#e.updateAiCard=="function"&&typeof this.#e.finishAiCard=="function"&&(Q=Tx({api:this.#e,clientId:this.#A,clientSecret:this.#t,target:iEe(t,i),signal:this.#g,logger:this.#n}),y=await Q.start(w(Whe)));let{answer:F,artifacts:q=[]}=await Oi({harness:this.#r,state:this.#l,key:e,...K!==void 0?{content:K}:{text:I},createOptions:{signal:this.#g},existsOptions:{signal:this.#g},askOptions:{timeoutMs:this.#s,signal:this.#g,control:{owner:this,key:e},onUpdate:y?N=>Q.push(sEe(N)):void 0,onInteraction:N=>this.#R(N,{key:e,actor:i,sessionWebhook:g,requiresMention:String(t.conversationType)==="2"}),onInteractionResolved:N=>this.#_(N),files:c.files}});r&&(this.#Q.complete(e,r.token),m=!0);let V=typeof F=="string"&&F.trim()?F:q.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):F,x=null,G=null,J=!1;try{J=y&&await Q.finish(V),J?G=Zt({deliveryId:o,presentation:"dingtalk-card"}):G=Zt({deliveryId:o,presentation:"dingtalk-text",providerMessageIds:await this.#v(g,V,this.#L(t))})}catch(N){x=ka(N)}let U=await this.#K(oEe(t,i,this.#A),g,o,q,G);if(x&&!U.userVisible)throw x;return x&&U.artifactSendErrors===0&&At(this.#a,x),Lr(this.#a,"messagesReplied"),this.#a.lastReplyAt=new Date().toISOString(),this.#a.lastError=null,!x&&U.artifactSendErrors===0&&wo(this.#a),U.receipt}catch(T){let _=null;if(!m&&r&&(T?.code==="turn-stopped"?this.#Q.complete(e,r.token):_=this.#Q.fail(e,r.token).message??null,m=!0),T?.code==="turn-stopped"){this.#m(s,"clear"),y&&await Q.finish(w("\u5DF2\u505C\u6B62\u3002")).catch(()=>{});return}if(this.#g?.aborted){this.#m(s,"clear");return}this.#m(s,"error"),this.#a.lastError=T?.message??String(T);let R=ko(T)??eEe(T),K=At(this.#a,T,{userMessage:R,reason:eo(T)?.reason});this.#n.error?.(`[dsh-dingtalk] failed to process an inbound message [${K.referenceId}]`,_Q(T));try{let L=dt(K),F=_?`${L} +`),s=[];if(e==="picture"){let c=D_(a);c&&s.push(c)}else if(e==="richtext")for(let c of A){if(String(c?.type??"").toLowerCase()!=="picture")continue;let I=D_(c);I&&s.push(I)}let g=e==="file"?D_(a):null;return{content:r,images:s.map((c,I)=>({name:I===0?"image":`image-${I+1}`,load:({signal:d,maxBytes:B})=>{if(typeof t?.downloadImage!="function")throw new Error("DingTalk API does not support image downloads");return t.downloadImage({clientId:o,clientSecret:i,robotCode:n?.robotCode,downloadCode:c,signal:d,maxBytes:B})}})),files:g?[{name:mt(a?.fileName??a?.file_name)??"file",load:({signal:c}={})=>{if(typeof t?.downloadFile!="function")throw new Error("DingTalk API does not support file downloads");return t.downloadFile({clientId:o,clientSecret:i,robotCode:n?.robotCode,downloadCode:g,signal:c})}}]:[]}}function aEe(n,t){if(String(n?.conversationType)==="2"){let o=mt(n?.conversationId);if(!o)throw new Error("DingTalk group message has no conversation id");return`group:${o}`}return`p2p:${t}`}function iEe(n,t){return String(n?.conversationType)==="2"?{type:"group",openConversationId:mt(n?.conversationId),atUserIds:{[t]:mt(n?.senderNick)??t}}:{type:"user",userId:t}}function oEe(n,t,o){let i=mt(n?.robotCode)??o;return String(n?.conversationType)==="2"?{type:"group",openConversationId:mt(n?.conversationId),robotCode:i}:{type:"user",userId:t,robotCode:i}}function nEe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u5E94\u7528\u6216\u673A\u5668\u4EBA\u7F3A\u5C11\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002\u8BF7\u5F00\u901A\u5E94\u7528 qyapi_base \u6743\u9650\uFF0C\u5E76\u786E\u8BA4\u673A\u5668\u4EBA\u5177\u5907\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u9489\u9489\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u9489\u9489\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\u548C\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u914D\u7F6E\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u9489\u9489\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function sEe(n){return n?.type==="text"&&mt(n.text)?n.text:n?.type==="tool"?n.name==="web_search"?w("_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_"):w("_\u6B63\u5728\u4F7F\u7528 {name}\u2026_",{name:mt(n.name)??w("\u5DE5\u5177")}):w("_{text}_",{text:mt(n?.text)??w("\u6B63\u5728\u5904\u7406\u2026")})}function gEe(n,t,o){if(t.needsPresentation||!t.questions[t.index]||t.actor!==o||String(n?.conversationType)==="2"&&n?.isInAtList!==!0||n?.msgtype!=="text"||!mt(n?.text?.content))return!1;try{return gc(n.sessionWebhook),!0}catch{return!1}}function cEe(n){n.stats??={};for(let t of["messagesReceived","messagesReplied","messagesRejected","messagesIgnored","reactionsAdded","reactionsRemoved","reactionErrors"])n[t]??=0,n.stats[t]=n[t];n.pendingSenders??=[]}function Lr(n,t){n[t]=(n[t]??0)+1,n.stats??={},n.stats[t]=n[t]}function b_({pendingSenders:n=[]}={}){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,messagesIgnored:0,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null,pendingSenders:structuredClone(n),stats:{messagesReceived:0,messagesReplied:0,messagesRejected:0,messagesIgnored:0,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0}}}var TQ=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I=new Map;#d=new Map;#h=new Map;#C=new Set;#u=new Set;#B=new Map;#f;#Q=new Ti;constructor({api:t,clientId:o,clientSecret:i,harness:e,state:a,contextEnhancement:A,accessPolicy:r,status:s=b_(),logger:g=console,replyTimeoutMs:c=6e5,reactionTimeoutMs:I=5e3,maxMessageChars:d=4e3,signal:B}){if(!t||typeof t.sendText!="function")throw new TypeError("DingTalk API is required");if(!mt(o)||!mt(i))throw new TypeError("DingTalk app credentials are required");if(!e||!a)throw new TypeError("Harness client and state store are required");this.#e=t,this.#A=o.trim(),this.#t=i.trim(),this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#f=new Di({label:"DingTalk",logger:g}),this.#s=c,this.#p=Number.isFinite(I)&&I>0?Math.floor(I):5e3,this.#c=d,this.#g=B,cEe(this.#a),this.#U()}get status(){return this.#U(),structuredClone(this.#a)}accept(t,{contextSnapshot:o}={}){if(this.#g?.aborted)return Promise.resolve();let i=mt(t?.msgId),e=t1(t);if(!i||!e||this.#l.hasSeen(i)||this.#B.has(i))return Promise.resolve();let a=String(t.conversationType)==="2"?"group":String(t.conversationType)==="1"?"direct":null,A;try{A=aEe(t,e)}catch{return Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),Promise.resolve()}let r=null;try{r=gc(t.sessionWebhook)}catch{}let s=this.#d.get(A),g=O_(t,{api:this.#e,clientId:this.#A,clientSecret:this.#t}),c=mt(g.content)??"",I=String(t.conversationType)!=="2"||t?.isInAtList===!0,d=String(t.conversationType)!=="2";if(I){let _=Ba(this.#i,{conversationType:a,senderIds:e,text:c,hasImages:Tt(g),hasFiles:wt(g)});if(!_.allowed)return this.#B.set(i,null),this.#T(t,i,r,_)}this.#B.set(i,o===void 0?Aa(this.#o,a):o),r&&d&&So(this.#l,{sessionWebhook:r});let B=r&&I?this.#y(t):null,f=_=>Promise.resolve(_).then(R=>(this.#m(B,this.#g?.aborted?"clear":"success"),R),R=>{throw this.#m(B,this.#g?.aborted||R?.name==="AbortError"||R?.code==="turn-stopped"?"clear":"error"),R}),Q=String(t?.msgtype).toLowerCase()==="text"&&Ni(c),y=this.#Q.status(A);if(Q&&!d&&r&&I)return f(this.#N(i,r,{message:es()},B));if(d&&r&&(Q||y.phase==="collecting")){let R=/^\/batch$/iu.test(c)&&y.phase==="idle"&&(this.#I.has(A)||s||this.#f.hasPending(A))?{handled:!0,kind:"busy",message:No()}:this.#Q.handle(A,c,{plainText:!!c&&String(t?.msgtype).toLowerCase()==="text"&&!wt(g)&&!Tt(g)});if(R.handled)return R.kind==="submit"?f(this.#D({...t,msgtype:"text",text:{content:R.prompt}},i,e,A,{batchSubmission:R,statusReaction:B})):f(this.#N(i,r,R,B))}let m=Fa(c)?Ao:wt(g)?null:ni(c)?Mi:si(c)?to:gi(c)?_i:null;if(m&&r&&I){let _;return _=this.#E(t,i,A,r,g,m).catch(R=>{if(R?.code==="turn-stopped"||this.#g?.aborted){this.#m(B,"clear");return}this.#m(B,"error"),this.#a.lastError=R?.message??String(R);let K=At(this.#a,R);return this.#n.error?.(`[dsh-dingtalk] failed to process a command [${K.referenceId}]`,_Q(R)),this.#v(r,dt(K),this.#L(t)).catch(()=>{})}).finally(()=>{this.#B.delete(i),this.#u.delete(_)}),this.#u.add(_),f(_)}let T=this.#f.claimReply({key:A,actor:e,messageId:i,text:r&&t?.msgtype==="text"?mt(t?.text?.content)??"":"",addressed:String(t?.conversationType)!=="2"||t?.isInAtList===!0,hasPendingQuestion:!!s,questionCompletion:s?.submitting||s?.claimedReplyMessageId?s.queue:null,isQuestionPending:()=>this.#d.has(A),send:r?_=>this.#v(r,_,this.#L(t)):async()=>{}});if(T){let _;return _=T.process(async()=>this.#l.hasSeen(i)?!1:(await this.#l.markSeen(i),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),r||(Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),this.#a.lastError=w("\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002")),!0)).catch(R=>{if(this.#g?.aborted){this.#m(B,"clear");return}this.#m(B,"error"),this.#a.lastError=w("\u9489\u9489\u5BA1\u6279\u5904\u7406\u5931\u8D25\u3002"),this.#n.error?.("[dsh-dingtalk] failed to process an approval reply",R)}).finally(()=>{this.#B.delete(i),this.#C.delete(_)}),this.#C.add(_),f(_)}if(s&&s.actor!==e)return f(this.#D(t,i,e,A,{statusReaction:B}));if(s?.submitting||s?.claimedReplyMessageId)return f(this.#D(t,i,e,A,{statusReaction:B}));if(s){gEe(t,s,e)&&(s.claimedReplyMessageId=i);let R=(s.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#w(t,i,e,A,s,B)).finally(()=>{this.#B.delete(i),s.claimedReplyMessageId===i&&(s.claimedReplyMessageId=null),s.queue===R&&(s.queue=null)});return s.queue=R,f(R)}return f(this.#D(t,i,e,A,{statusReaction:B}))}#S(t,o,i,e){let a=new AbortController,A=Promise.resolve().then(()=>this.#e[t]({clientId:this.#A,clientSecret:this.#t,...o,reactionName:i,signal:a.signal})),r,s=new Promise((g,c)=>{r=setTimeout(()=>{let I=new DOMException("DingTalk reaction timed out","TimeoutError");a.abort(I),c(I)},this.#p),r.unref?.()});return Promise.race([A,s]).then(()=>(Lr(this.#a,e==="add"?"reactionsAdded":"reactionsRemoved"),!0)).catch(g=>(Lr(this.#a,"reactionErrors"),this.#n.debug?.(`[dsh-dingtalk] ${t} failed`,_Q(g)),!1)).finally(()=>clearTimeout(r))}#y(t){if(typeof this.#e.addReaction!="function"||typeof this.#e.recallReaction!="function")return null;let o=mt(t?.msgId),i=mt(t?.conversationId);if(!o||!i)return null;let e={messageId:o,conversationId:i,robotCode:mt(t?.robotCode)??this.#A};return{target:e,attached:this.#S("addReaction",e,TI,"add"),terminal:!1}}#m(t,o){if(!t||t.terminal)return;t.terminal=!0;let i=o==="success"?wx:o==="error"?Dx:null;t.attached.then(async e=>{let a=await this.#S("recallReaction",t.target,TI,"remove");(!e||!a)&&(await new Promise(A=>{setTimeout(A,Math.min(1e3,this.#p)).unref?.()}),a=await this.#S("recallReaction",t.target,TI,"remove")||a),!(!a||!i||this.#g?.aborted)&&await this.#S("addReaction",t.target,i,"add")}).catch(()=>{})}#D(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1,batchSubmission:r=null,statusReaction:s=null}={}){let g=!1;try{gc(t.sessionWebhook),g=!0}catch{}let c=String(t.conversationType)!=="2"||t.isInAtList===!0,I=g&&c?kp(O_(t,{api:this.#e,clientId:this.#A,clientSecret:this.#t}),{signal:this.#g}):void 0,B=(this.#I.get(e)??Promise.resolve()).catch(()=>{}).then(()=>this.#O(t,o,i,e,{alreadyRecorded:A,preparedMessage:I,batchSubmission:r,statusReaction:s})).finally(()=>{a&&this.#B.delete(o),this.#I.get(e)===B&&this.#I.delete(e)});return this.#I.set(e,B),B}async waitForIdle(){await Promise.allSettled([...this.#I.values(),...[...this.#d.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#C,...this.#u])}async#E(t,o,i,e,a,A){if(this.#g?.throwIfAborted(),this.#l.hasSeen(o))return;await this.#l.markSeen(o),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString();let r=await A(mt(a.content)??"",this.#r,this.#l,i,{signal:this.#g,isDirect:String(t.conversationType)==="1",hasImages:Tt(a),hasFiles:wt(a),pendingInteraction:this.#d.has(i)||this.#f.hasPending(i),control:{owner:this,key:i}});r?.stopped&&await Promise.allSettled([this.#H(i),this.#f.closeRoute(i)]);for(let s of r?.messages??[r?.message])s&&await this.#v(e,s,this.#L(t));this.#a.lastError=null}#N(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#l.hasSeen(t)||(await this.#l.markSeen(t),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),i.message&&await this.#v(o,i.message),this.#a.lastError=null)}).catch(async A=>{if(this.#g?.aborted){this.#m(e,"clear");return}this.#m(e,"error"),this.#a.lastError=A?.message??String(A);let r=At(this.#a,A);this.#n.error?.(`[dsh-dingtalk] failed to process a batch input message [${r.referenceId}]`,_Q(A)),await this.#v(o,dt(r)).catch(()=>{})}).finally(()=>{this.#B.delete(t),this.#u.delete(a)}),this.#u.add(a),a}#T(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#l.hasSeen(o)||(await this.#l.markSeen(o),e.reason==="command-not-allowed"&&i?(Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),await this.#v(i,w(ao),this.#L(t)),Lr(this.#a,"messagesReplied"),this.#a.lastReplyAt=new Date().toISOString()):(Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString()),this.#a.lastError=null)}).catch(A=>{this.#g?.aborted||(this.#a.lastError=A?.message??String(A),this.#n.error?.("[dsh-dingtalk] failed to apply inbound access policy",A))}).finally(()=>{this.#B.delete(o),this.#u.delete(a)}),this.#u.add(a),a}async#O(t,o,i,e,{alreadyRecorded:a=!1,preparedMessage:A,batchSubmission:r=null,statusReaction:s=null}={}){if(this.#g?.throwIfAborted(),!a){if(this.#l.hasSeen(o))return;await this.#l.markSeen(o),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString()}if(String(t.conversationType)==="2"&&t.isInAtList!==!0){Lr(this.#a,"messagesIgnored");return}let g;try{g=gc(t.sessionWebhook)}catch{Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),this.#a.lastError=w("\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002");return}let c=A??O_(t,{api:this.#e,clientId:this.#A,clientSecret:this.#t}),I=c.content,d=Tt(c),B=wt(c),f=String(t?.msgtype).toLowerCase()==="text",Q=null,y=!1,m=r===null;try{if(!I&&!d&&!B){await this.#v(g,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002"),this.#L(t));return}let T=I.toLowerCase();if(f&&!d&&!B&&T==="/help"){await this.#v(g,Xhe(),this.#L(t));return}if(f&&!d&&!B&&T==="/status"){await this.#r.ensureRunning({signal:this.#g}),await this.#v(g,w("\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),this.#L(t));return}if(f&&!d&&!B&&T==="/new"){await this.#l.clearSession(e),await this.#v(g,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),this.#L(t));return}let _=f&&!d&&!B?await Mo(I,this.#r,e):null;if(_){for(let N of _.messages??[_.message])await this.#v(g,N,this.#L(t));return}let R=f&&!d&&!B?await bi(I,this.#r,this.#l,e,{signal:this.#g}):null;if(R){await this.#v(g,R.message,this.#L(t));return}let K=d?await Oo(c,{signal:this.#g}):void 0,L=this.#B.get(o);L&&(K=To(K??I,L,()=>({channel:"dingtalk",senderId:i,senderName:t.senderNick}))),typeof this.#e.createAiCard=="function"&&typeof this.#e.updateAiCard=="function"&&typeof this.#e.finishAiCard=="function"&&(Q=Tx({api:this.#e,clientId:this.#A,clientSecret:this.#t,target:iEe(t,i),signal:this.#g,logger:this.#n}),y=await Q.start(w(Whe)));let{answer:F,artifacts:q=[]}=await Oi({harness:this.#r,state:this.#l,key:e,...K!==void 0?{content:K}:{text:I},createOptions:{signal:this.#g},existsOptions:{signal:this.#g},askOptions:{timeoutMs:this.#s,signal:this.#g,control:{owner:this,key:e},onUpdate:y?N=>Q.push(sEe(N)):void 0,onInteraction:N=>this.#R(N,{key:e,actor:i,sessionWebhook:g,requiresMention:String(t.conversationType)==="2"}),onInteractionResolved:N=>this.#_(N),files:c.files}});r&&(this.#Q.complete(e,r.token),m=!0);let V=typeof F=="string"&&F.trim()?F:q.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):F,x=null,G=null,J=!1;try{J=y&&await Q.finish(V),J?G=Zt({deliveryId:o,presentation:"dingtalk-card"}):G=Zt({deliveryId:o,presentation:"dingtalk-text",providerMessageIds:await this.#v(g,V,this.#L(t))})}catch(N){x=ka(N)}let U=await this.#K(oEe(t,i,this.#A),g,o,q,G);if(x&&!U.userVisible)throw x;return x&&U.artifactSendErrors===0&&At(this.#a,x),Lr(this.#a,"messagesReplied"),this.#a.lastReplyAt=new Date().toISOString(),this.#a.lastError=null,!x&&U.artifactSendErrors===0&&wo(this.#a),U.receipt}catch(T){let _=null;if(!m&&r&&(T?.code==="turn-stopped"?this.#Q.complete(e,r.token):_=this.#Q.fail(e,r.token).message??null,m=!0),T?.code==="turn-stopped"){this.#m(s,"clear"),y&&await Q.finish(w("\u5DF2\u505C\u6B62\u3002")).catch(()=>{});return}if(this.#g?.aborted){this.#m(s,"clear");return}this.#m(s,"error"),this.#a.lastError=T?.message??String(T);let R=ko(T)??eEe(T),K=At(this.#a,T,{userMessage:R,reason:eo(T)?.reason});this.#n.error?.(`[dsh-dingtalk] failed to process an inbound message [${K.referenceId}]`,_Q(T));try{let L=dt(K),F=_?`${L} ${_}`:L;y&&await Q.finish(F)||await this.#v(g,F,this.#L(t))}catch{this.#n.error?.("[dsh-dingtalk] failed to send the safe error reply")}}finally{await this.#H(e),await this.#f.closeRoute(e)}}async#w(t,o,i,e,a,A){this.#g?.throwIfAborted();let r=this.#d.get(e),s=a.claimedReplyMessageId===o;if(!r||r!==a||r.submitting)return s&&(!r||r!==a)?this.#k(t,o):this.#D(t,o,i,e,{releaseMessageId:!1,statusReaction:A});if(this.#l.hasSeen(o))return;if(await this.#l.markSeen(o),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString(),String(t.conversationType)==="2"&&t.isInAtList!==!0){Lr(this.#a,"messagesIgnored");return}let g;try{g=gc(t.sessionWebhook)}catch{Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString(),this.#a.lastError=w("\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002");return}let c=t?.msgtype==="text"?mt(t?.text?.content):null;if(!c){try{await this.#v(g,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),this.#L(t))}catch{this.#n.error?.("[dsh-dingtalk] failed to reject a non-text interaction reply")}return}let I=this.#d.get(e);if(!I||I!==a||I.submitting){if(s&&(!I||I!==a)){try{await this.#v(g,w(w_),this.#L(t))}catch{this.#n.error?.("[dsh-dingtalk] failed to send an expired interaction notice")}return}return this.#D(t,o,i,e,{releaseMessageId:!1,alreadyRecorded:!0,statusReaction:A})}if(I.sessionWebhook=g,I.needsPresentation){try{await this.#G(I)}catch{this.#m(A,"error"),this.#a.lastError=w("\u9489\u9489\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#n.error?.("[dsh-dingtalk] failed to retry an interaction question"),I.interaction.reconnect?.()}return}let d=I.questions[I.index];if(d){if(I.answers.push(wi(d,c)),I.index+=1,I.indexthis.#v(e,c)})||t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#n.warn?.("[dsh-dingtalk] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"DingTalk safely cancelled an interaction left by an earlier client.",details:{}}});try{await this.#v(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"))}catch{this.#n.error?.("[dsh-dingtalk] failed to send an interaction recovery notice")}return}let s=this.#d.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#G(s);return}if(this.#h.has(r))return;if(s){this.#n.warn?.("[dsh-dingtalk] cancelled a second pending Harness question"),await t.respond({ok:!1,error:{code:"cancelled",message:"DingTalk is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,sessionWebhook:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0};this.#d.set(o,g),this.#h.set(g.interactionId,o),await this.#G(g)}async#_(t){if(await this.#f.handleResolved(t))return;let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#h.get(o);i&&this.#P(i,o)}async#G(t){let o=t.questions[t.index];o&&(await this.#v(t.sessionWebhook,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})),t.needsPresentation=!1)}async#k(t,o){if(this.#l.hasSeen(o))return;await this.#l.markSeen(o),Lr(this.#a,"messagesReceived"),this.#a.lastMessageAt=new Date().toISOString();let i;try{i=gc(t.sessionWebhook)}catch{Lr(this.#a,"messagesRejected"),this.#a.lastRejectedAt=new Date().toISOString();return}try{await this.#v(i,w(w_),this.#L(t))}catch{this.#n.error?.("[dsh-dingtalk] failed to send an expired interaction notice")}}#F(t,o){let i=this.#d.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#d.delete(t),this.#h.delete(i.interactionId),i)}#P(t,o){return this.#F(t,o)!==null}async#H(t){let o=this.#F(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The DingTalk interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#n.warn?.("[dsh-dingtalk] failed to cancel a pending Harness interaction")}}#U(){typeof this.#l.pendingSenders=="function"&&(this.#a.pendingSenders=this.#l.pendingSenders())}#L(t){let o=t1(t);return String(t?.conversationType)==="2"&&o?{atUserIds:[o]}:void 0}async#v(t,o,i){let e=[];for(let a of bx(o,this.#c)){this.#g?.throwIfAborted();let A=await this.#e.sendText({clientId:this.#A,clientSecret:this.#t,sessionWebhook:t,text:a,at:i,signal:this.#g});e.push(...Ua(A))}return e}async#K(t,o,i,e,a){let A=async(s,g)=>$he(await this.#e[s]({clientId:this.#A,clientSecret:this.#t,target:t,file:g,signal:this.#g})),r=await vo({artifacts:e,baseReceipt:a,deliveryId:i,aggregatePresentation:a?"dingtalk-text-and-files":"dingtalk-files",channelKey:"dingtalk",signal:this.#g,sendImage:typeof this.#e.sendImage=="function"?s=>A("sendImage",s):void 0,sendFile:typeof this.#e.sendFile=="function"?s=>A("sendFile",s):void 0,onFailure:(s,g)=>At(this.#a,g,{userMessage:nEe(s?.fileName,g),reason:g?.code}),sendFailureNotice:(s,g,c)=>this.#v(o,dt(c)),logger:this.#n});return this.#a.artifactsSent=(this.#a.artifactsSent??0)+r.artifactsSent,this.#a.artifactSendErrors=(this.#a.artifactSendErrors??0)+r.artifactSendErrors,{receipt:r.receipt,userVisible:r.userVisible,artifactSendErrors:r.artifactSendErrors}}};function NQ(n){return typeof n=="string"&&n.trim()?n.trim():null}function r1(n){let t=Array.isArray(n?.approvedSenders)?n.approvedSenders:n?.approvedSenders instanceof Set?[...n.approvedSenders]:[];return new Set(t.map(o=>NQ(typeof o=="string"?o:o?.staffId)).filter(Boolean))}function IEe(n){return r1(n).size}function a1(n){return n?.connected===!0||n?.socket?.readyState===1}function lEe(n,t){return new Promise((o,i)=>{if(t.aborted){i(t.reason);return}let e=()=>i(t.reason);t.addEventListener("abort",e,{once:!0}),Promise.resolve(n).then(a=>{t.removeEventListener("abort",e),o(a)},a=>{t.removeEventListener("abort",e),i(a)})})}async function pEe(n,t,o){for(;;){if(o?.throwIfAborted(),a1(n))return;await new Promise((i,e)=>{let a=setTimeout(()=>{o?.removeEventListener("abort",A),i()},t),A=()=>{clearTimeout(a),e(o.reason??new DOMException("Aborted","AbortError"))};o?.addEventListener("abort",A,{once:!0})})}}async function dEe(n,t,o,i){let e=AbortSignal.timeout(t),a=AbortSignal.any([i,e]),A=!1,r=Promise.resolve().then(()=>n.connect()).finally(()=>{A=!0});try{await lEe(r,a),await pEe(n,o,a)}catch(s){throw a.aborted?(A||r.then(()=>n.disconnect()).catch(()=>{}),i.aborted?i.reason:new Error(`DingTalk Stream handshake timed out after ${t}ms`)):s}}async function hEe({clientId:n,clientSecret:t}){let{DWClient:o,TOPIC_ROBOT:i}=await import("dingtalk-stream");return{client:new o({clientId:n,clientSecret:t,endpoint:"https://api.dingtalk.com",autoReconnect:!1,keepAlive:!0,debug:!1}),topic:i}}function EEe({pendingSenders:n=[],approvedSenders:t=0}={}){return{startedAt:null,ready:!1,dingtalkStreamState:"idle",harnessReachable:!1,lastConnectedAt:null,lastCheckedAt:null,lastCallbackAt:null,authorizationMode:"sender-staff-id-approval",approvedSenderCount:t,...b_({pendingSenders:n})}}var jE=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d=null;#h=null;#C=null;#u=null;#B=null;#f=null;#Q=new Set;constructor({config:t,clientSecret:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,maxMessageChars:g=4e3,connectTimeoutMs:c=15e3,connectPollIntervalMs:I=25,api:d=Mx(),streamFactory:B=hEe}){if(!t||!NQ(t.clientId)||!NQ(o))throw new TypeError("DingtalkRuntime requires app credentials");if(!i||!e)throw new TypeError("DingtalkRuntime requires Harness and state");if(typeof B!="function")throw new TypeError("streamFactory must be a function");this.#e=t,this.#A=o.trim(),this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=d,this.#g=B,this.#I=EEe({pendingSenders:this.#y(),approvedSenders:IEe(t)})}get status(){if(this.#h){let t=this.#h.status;Object.assign(this.#I,t)}else this.#I.pendingSenders=this.#y();return structuredClone(this.#I)}pendingSender(t){return typeof this.#r.pendingSender=="function"?this.#r.pendingSender(t):null}pendingSenders(){return this.#y()}async start(){return this.#d&&this.#I.ready?this.status:this.#u?this.#u:(this.#u=this.#S().finally(()=>{this.#u=null}),this.#u)}async#S(){await this.stop();let t=new AbortController;this.#f=t;let{signal:o}=t;this.#I.startedAt=new Date().toISOString(),this.#I.dingtalkStreamState="connecting",this.#I.lastError=null;try{if(await this.#t.ensureRunning({signal:o}),this.#I.harnessReachable=!0,typeof this.#r.removePendingSenderByStaffId=="function"){for(let A of r1(this.#e))await this.#r.removePendingSenderByStaffId(A);this.#I.pendingSenders=this.#y()}this.#h=new TQ({api:this.#c,clientId:this.#e.clientId,clientSecret:this.#A,approvedSenders:this.#e.approvedSenders,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#I,logger:this.#i,replyTimeoutMs:this.#a,maxMessageChars:this.#n,signal:o});let i=await this.#g({clientId:this.#e.clientId,clientSecret:this.#A});if(o.throwIfAborted(),this.#d=i?.client??i,this.#C=i?.topic??i?.TOPIC_ROBOT??"/v1.0/im/bot/messages/get",!this.#d||typeof this.#d.registerCallbackListener!="function"||typeof this.#d.connect!="function"||typeof this.#d.disconnect!="function"||typeof this.#d.socketCallBackResponse!="function")throw new TypeError("streamFactory returned an invalid DingTalk Stream client");let e=this.#d,a=this.#h;return e.registerCallbackListener(this.#C,A=>{if(this.#d!==e||this.#h!==a)return;let r=NQ(A?.headers?.messageId);if(r)try{e.socketCallBackResponse(r,{success:!0})}catch{this.#i.warn?.("[dsh-dingtalk] unable to acknowledge an inbound callback")}let s=this.#l,g;try{g=s?.getSettings?.()}catch{}let c=Promise.resolve().then(async()=>{if(this.#h!==a)return;let I;try{I=typeof A?.data=="string"?JSON.parse(A.data):A?.data}catch{this.#I.lastError=w("\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002"),this.#i.warn?.("[dsh-dingtalk] ignored an invalid callback payload");return}if(!I||typeof I!="object")return;this.#I.lastCallbackAt=Date.now();let d=Aa({getSettings:()=>g,get botId(){return s?.botId}},I.conversationType==="1"||I.conversationType===1?"direct":I.conversationType==="2"||I.conversationType===2?"group":null);await a.accept(I,{contextSnapshot:d})}).catch(()=>{o.aborted||this.#h!==a||(this.#I.lastError=w("\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002"),this.#i.error?.("[dsh-dingtalk] callback processing failed"))}).finally(()=>this.#Q.delete(c));this.#Q.add(c)}),await dEe(e,this.#s,this.#p,o),this.#I.ready=!0,this.#I.dingtalkStreamState="connected",this.#I.lastConnectedAt=Date.now(),this.#I.lastCheckedAt=Date.now(),this.#I.lastError=null,this.#B=setInterval(()=>{let A=a1(e);this.#I.ready=A,this.#I.dingtalkStreamState=A?"connected":"reconnecting",this.#I.lastCheckedAt=Date.now(),A&&(this.#I.lastError=null)},1e3),this.#B.unref?.(),this.status}catch(i){let e=o.aborted;throw this.#I.ready=!1,this.#I.dingtalkStreamState=e?"idle":"failed",this.#I.lastError=e?null:i?.message??String(i),await this.stop({preserveError:!e}),i}}async stop({preserveError:t=!1}={}){let o=t?this.#I.lastError:null,i=this.#f;this.#f=null,i?.abort(new DOMException("DingTalk runtime stopped","AbortError")),this.#B&&clearInterval(this.#B),this.#B=null,this.#I.ready=!1;let e=this.#d;if(this.#d=null,this.#C=null,e)try{await e.disconnect()}catch{this.#i.warn?.("[dsh-dingtalk] DingTalk Stream disconnect failed")}return await Promise.allSettled([...this.#Q]),this.#Q.clear(),this.#h&&await this.#h.waitForIdle(),this.#h=null,this.#I.dingtalkStreamState=t?"failed":"idle",this.#I.lastError=o,this.status}async sendConnectionTest(t){return nc({state:this.#r,text:t,channelLabel:w("\u9489\u9489\u673A\u5668\u4EBA"),send:async({sessionWebhook:o},i)=>{if(!this.#I.ready||!this.#f)throw new Error("DingTalk runtime is not connected");await this.#c.sendText({clientId:this.#e.clientId,clientSecret:this.#A,sessionWebhook:o,text:i,signal:this.#f.signal})}})}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.userId=="string"?t.route.userId.trim():"",a=typeof t?.route?.openConversationId=="string"?t.route.openConversationId.trim():"";if(t?.kind==="user"&&(!e||a)||t?.kind==="group"&&(!a||e)||t?.kind!=="user"&&t?.kind!=="group"){let A=new TypeError("Invalid DingTalk proactive delivery target");throw A.code="invalid-target",A}if(!this.#I.ready||!this.#f){let A=new Error("DingTalk runtime is not connected");throw A.code="bot-not-connected",A}i?.throwIfAborted();try{await this.#c.sendRobotText({clientId:this.#e.clientId,clientSecret:this.#A,target:{type:t.kind,robotCode:this.#e.clientId,...t.kind==="user"?{userId:e}:{openConversationId:a}},text:o,signal:i??this.#f.signal})}catch(A){if(A?.code!=="send-rejected")throw A;let r=new Error("DingTalk rejected the proactive delivery target",{cause:A});throw r.code="target-rejected",r}return{sent:!0}}#y(){return typeof this.#r.pendingSenders=="function"?this.#r.pendingSenders():[]}};import{spawn as DEe}from"node:child_process";import{randomUUID as M_}from"node:crypto";import{isAbsolute as OEe}from"node:path";import{isAbsolute as CEe}from"node:path";var uEe=256,BEe=/[\p{White_Space}\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,fEe=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u;function JE(n,t){let o=new Error(t);return o.code=n,o}function QEe(n){if(typeof n!="string"||!n||n.length>uEe||BEe.test(n))throw JE("session-id-invalid","A non-empty, safe session id is required");return n}function yEe(n,t){if(!Array.isArray(t?.items)||!Array.isArray(t?.archivedSessionIds)||t.archivedSessionIds.some(i=>typeof i!="string"||!i))throw new Error("Harness returned an invalid response for workspace.list");let o=[];for(let i of t.items){if(typeof i?.workspaceId!="string"||!i.workspaceId||typeof i.path!="string"||!CEe(i.path)||!Array.isArray(i.sessionIds)||i.sessionIds.some(e=>typeof e!="string"||!e))throw new Error("Harness returned an invalid response for workspace.list");for(let e of i.sessionIds)e===n&&o.push(i)}if(o.length===0)throw JE("session-not-registered","The session is not registered to a Harness workspace");if(o.length!==1)throw JE("session-workspace-ambiguous","The session is registered to more than one Harness workspace");if(fEe.test(o[0].path))throw new Error("Harness returned an unsafe workspace path for the session");return{workspace:o[0],archived:t.archivedSessionIds.includes(n)}}function mEe(n,t){if(!Array.isArray(t?.items)||t.items.some(a=>typeof a?.sessionId!="string"||!a.sessionId))throw new Error("Harness returned an invalid response for session.list");let o=t.items.filter(a=>a.sessionId===n);if(o.length===0)throw JE("session-summary-unavailable","The session is no longer available from Harness");if(o.length!==1)throw new Error("Harness returned duplicate session summaries for session.list");let[i]=o;if(i.origin==="subagent")throw JE("session-subagent-unsupported","Subagent sessions cannot be adopted as a bot conversation");if(i.origin!==void 0)throw new Error("Harness returned an invalid session origin for session.list");let e=i.projections?.values?.title;if(e!=null&&typeof e!="string")throw new Error("Harness returned an invalid session title for session.list");return{title:typeof e=="string"?e:null}}async function i1(n,t,o={},i=3e4){let e=QEe(t);await n.ensureRunning(o);let a=await n.rpc("workspace.list",{},i,o),{workspace:A,archived:r}=yEe(e,a),s=mEe(e,await n.rpc("session.list",{},i,o)),g=await n.rpc("session.create",{workspaceId:A.workspaceId,sessionId:e},i,o);if(!g||g.sessionId!==e)throw new Error("Harness returned an invalid response for session.create");return{sessionId:e,workspace:A.path,title:s.title,archived:r}}function qE(n,t,o){try{let i=n?.(t);i&&typeof i.then=="function"&&Promise.resolve(i).catch(o)}catch(i){o(i)}}async function SEe({apiProxy:n,rpcId:t,signal:o,onOpen:i,onEnvelope:e}){let a=new AbortController,A=()=>a.abort(o.reason),r,s,g,c=I=>{a.signal.aborted||(g=I,A())};o.addEventListener("abort",A,{once:!0});try{for(r=n.events.mux({rpcId:t,payload:{}},a.signal)[Symbol.asyncIterator](),s=Promise.resolve(r.next()),a.signal.aborted||qE(i,A,c);!a.signal.aborted;){let{value:I,done:d}=await s;if(d||a.signal.aborted)break;qE(e,{type:"server-request",rpcId:I?.rpcId,method:I?.payload?.type,payload:I?.payload},c),a.signal.aborted||(s=Promise.resolve(r.next()))}}catch(I){c(I)}finally{let I=a.signal.aborted;o.removeEventListener("abort",A),A(),await s?.catch(()=>{});try{await r?.return?.()}catch(d){I||(g??=d)}}if(g)throw g}function wEe({baseUrl:n,createWebSocket:t,signal:o,onOpen:i,onEnvelope:e,onMalformed:a}){let A=new URL("/api/events.mux",n);return A.protocol=A.protocol==="https:"?"wss:":"ws:",new Promise((r,s)=>{let g=t(A.toString()),c=!1,I=!1,d=_=>{if(!I){I=!0,g.removeEventListener("open",f),g.removeEventListener("message",Q),g.removeEventListener("close",y),g.removeEventListener("error",m),o.removeEventListener("abort",T);try{(g.readyState===0||g.readyState===1)&&g.close()}catch{}_&&!o.aborted?s(_):r()}},B=()=>d(),f=()=>{I||c||(c=!0,qE(i,B,d))},Q=_=>{if(I)return;let R;try{if(typeof _.data!="string")throw new Error("binary WebSocket frame");R=JSON.parse(_.data)}catch(K){qE(a,K,()=>{});return}qE(e,R,d)},y=()=>d(c?void 0:new Error("Harness event mux WebSocket closed before opening")),m=()=>d(new Error(c?"Harness event mux WebSocket failed":"Harness event mux WebSocket failed before opening")),T=()=>d();g.addEventListener("open",f),g.addEventListener("message",Q),g.addEventListener("close",y,{once:!0}),g.addEventListener("error",m,{once:!0}),o.addEventListener("abort",T,{once:!0}),o.aborted&&T()})}async function o1(n){if(!n.signal.aborted)return n.baseUrl!==void 0&&n.baseUrl!==null?wEe(n):SEe(n)}var bEe=new Map,MEe=new WeakMap,_Ee=64;async function TEe(n){let t=n?.body;if(!t||typeof t.getReader!="function")return null;let o=t.getReader(),i=[],e=0;try{for(;;){let{done:r,value:s}=await o.read();if(r)break;if(!(s instanceof Uint8Array)||e+s.byteLength>_Ee)return null;i.push(s),e+=s.byteLength}}catch{return null}finally{try{await o.cancel()}catch{}}let a=new Uint8Array(e),A=0;for(let r of i)a.set(r,A),A+=r.byteLength;return new TextDecoder().decode(a)}function NEe(n){if(n==="localhost"||n==="[::1]")return!0;let t=n.split(".");return t.length===4&&t[0]==="127"&&t.every(o=>/^\d{1,3}$/.test(o)&&Number(o)<=255)}async function REe(n,t){return n.status===401?"harness-auth-required":n.status===407?"harness-proxy-auth-required":n.status===403?(await TEe(n))?.trim()!=="forbidden"?"harness-request-forbidden":NEe(t)?"harness-loopback-forbidden":"harness-host-untrusted":n.status===404?"harness-api-not-found":"harness-http-failed"}function l1(n){let t=typeof n=="string"?bEe:MEe,o=t.get(n);return o||(o={ownerships:new Map,claims:new Map,controls:new WeakMap,nextOrder:0},t.set(n,o)),o}function n1(n,t){return new Promise((o,i)=>{let e=()=>t.removeEventListener("abort",a),a=()=>{e(),i(t.reason)};if(t.aborted){a();return}t.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>(t.throwIfAborted(),n())).then(A=>{e(),o(A)},A=>{e(),i(A)})})}function s1(n){let t=typeof n?.owner;return t!=="object"&&t!=="function"||n.owner===null||typeof n.key!="string"||!n.key?null:{owner:n.owner,key:n.key}}function __(n){return n!==null&&typeof n=="object"&&typeof n.provider=="string"&&!!n.provider&&typeof n.model=="string"&&!!n.model&&(n.reasoningEffort===void 0||typeof n.reasoningEffort=="string"&&!!n.reasoningEffort)}function kEe(n){return n!==null&&typeof n=="object"&&Array.isArray(n.efforts)&&n.efforts.length>0&&n.efforts.every(t=>t!==null&&typeof t=="object"&&typeof t.id=="string"&&!!t.id&&typeof t.name=="string"&&!!t.name&&(t.description===void 0||typeof t.description=="string"))&&(n.defaultEffort===void 0||typeof n.defaultEffort=="string"&&!!n.defaultEffort)}function g1(n,t,{session:o=!1}={}){if(!n||typeof n!="object"||!Array.isArray(n.groups)||!Array.isArray(n.failures))throw new Error(`Harness returned an invalid response for ${t}`);for(let i of n.groups){if(!i||typeof i!="object"||typeof i.id!="string"||!i.id||typeof i.name!="string"||!i.name||!Array.isArray(i.models))throw new Error(`Harness returned an invalid response for ${t}`);for(let e of i.models)if(!e||typeof e!="object"||typeof e.id!="string"||!e.id||typeof e.name!="string"||!e.name||e.description!==void 0&&typeof e.description!="string"||e.reasoning!==void 0&&!kEe(e.reasoning))throw new Error(`Harness returned an invalid response for ${t}`)}for(let i of n.failures)if(!i||typeof i!="object"||typeof i.id!="string"||!i.id||typeof i.name!="string"||!i.name||i.message!==void 0&&typeof i.message!="string")throw new Error(`Harness returned an invalid response for ${t}`);if(o&&(!__(n.current)||typeof n.routable!="boolean"))throw new Error(`Harness returned an invalid response for ${t}`);return n}function c1(){let n=new Error("Harness turn was stopped before producing a text reply");return n.code="turn-stopped",n}function vEe(n){return Array.isArray(n?.items)?n.items.flatMap(t=>typeof t?.path=="string"&&OEe(t.path)?[t.path]:[]):[]}function PEe(n,t){if(!Array.isArray(t?.items)||!Array.isArray(t?.archivedSessionIds))throw new Error("Harness returned an invalid response for workspace.list");let o=t.items.find(i=>i?.path===n);if(!o)return null;if(!Array.isArray(o.sessionIds)||o.sessionIds.some(i=>typeof i!="string"))throw new Error("Harness returned invalid session IDs for workspace.list");return o}function GEe(n){if(typeof n=="number"&&Number.isFinite(n))return n<1e12?n*1e3:n;if(typeof n=="string"&&n){let t=Date.parse(n);if(!Number.isNaN(t))return t}return null}function FEe(n){if(!n||typeof n!="object")return null;let t=[n?.header?.lastActivityAt,n?.header?.updatedAt,n?.header?.createdAt,n?.projections?.values?.lastActivityAt,n?.projections?.values?.updatedAt,n?.projections?.values?.createdAt,n?.lastActivityAt,n?.updatedAt,n?.createdAt];for(let o of t){let i=GEe(o);if(i!==null)return i}return null}function LEe(n,t,o){if(!Array.isArray(o?.items))throw new Error("Harness returned an invalid response for session.list");let i=new Set(t),e=new Map(o.items.flatMap(a=>typeof a?.sessionId=="string"?[[a.sessionId,a]]:[]));return{workspace:n.path,sessions:n.sessionIds.map(a=>{let A=e.get(a),r=A?.projections?.values?.title,s={sessionId:a,title:typeof r=="string"?r:null,archived:i.has(a),blank:A?.blank===!0,origin:A?.origin==="subagent"?"subagent":null,summaryAvailable:A!==void 0},g=A?.projections?.asOfSeq;Number.isSafeInteger(g)&&g>=-1&&(s.lastSeq=g);let c=FEe(A);return c!==null&&(s.time=c),s})}}function zE(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(()=>{t?.removeEventListener("abort",a),o()},n),a=()=>{clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",a,{once:!0})})}function UEe(n){return(n?.data?.message?.content??[]).filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(` -`).trim()}function Ri(n){return typeof n=="string"&&n.trim()?n.trim():null}function HEe(n){if(!n||typeof n!="object")return null;let t=Ri(n.message);if(t)return t;let o=Ri(n.name),i=Ri(n.code);return o||i?[o??"Error",i].filter(Boolean).join(": "):null}function p1(n,t){let o=[...t].map(i=>i?.event??i).filter(Boolean).sort((i,e)=>(i.seq??-1)-(e.seq??-1));for(let i of o){let e=i.seq??-1;if(e<=n.lastSeq)continue;if(n.lastSeq=e,i.type==="turn/start"){let A=i.data?.turn??null;n.active&&A!==n.turn&&(n.active=!1),n.turn!==null&&A!==n.turn&&(n.completed=!0),n.openTurn=A;continue}if(i.type==="user/message"&&i.data?.source?.rpcId===n.promptRpcId){n.active=!0,n.started=!0,n.completed=!1,n.turn=i.data?.turn??n.openTurn;continue}if(i.type==="turn/end"&&i.data?.turn===n.turn){n.active=!1,n.completed=!0;continue}let a=null;if(i.type==="tool/call"&&n.active&&i.data?.turn===n.turn&&typeof i.data?.callId=="string"&&i.data.callId)a={callId:i.data.callId,name:i.data?.name,arguments:i.data?.arguments};else if(i.type==="tool/code-dispatch-start"&&n.active&&typeof i.data?.subCallId=="string"&&i.data.subCallId){let A;try{A=JSON.stringify(i.data?.arguments)}catch{A=void 0}a={callId:i.data.subCallId,name:i.data?.name,arguments:A}}a&&n.toolCalls.set(a.callId,Object.freeze(a))}}function d1(n,t,o=[]){if(!n||!["object","function","string"].includes(typeof n)||typeof t!="string"||!t)return!1;let i=l1(n).ownerships.get(t);if(!i||i.size===0)return!1;for(let e of i)p1(e,o);return[...i].some(e=>e.active&&!e.completed&&typeof e.reconnect=="function")}var Pp=class{#e;#A;#t=null;#r=null;#l=new Map;#o="";#i=!1;#a=null;#n=new Map;#s=null;constructor({promptRpcId:t,afterSeq:o=-1}){this.#e=t,this.#A=o}get finished(){return this.#i}get answer(){return this.#o.trim()}get reason(){return this.#a}get tracking(){return this.#r!==null&&!this.#i}get turn(){return this.#r}consumeAll(t){let o=[],i=a=>{if(a.type==="text"&&o.length>0&&o[o.length-1].type==="text"){o[o.length-1]=a;return}o.push(a)},e=[...t].map(a=>a?.event??a).filter(Boolean).sort((a,A)=>(a.seq??-1)-(A.seq??-1));for(let a of e){let A=a.seq??-1;if(!(A<=this.#A)){if(this.#A=A,a.type==="turn/start"&&(this.#t=a.data?.turn??null),a.type==="user/message"&&a.data?.source?.rpcId===this.#e){this.#r=this.#t;continue}if(this.#r!==null){if(a.type==="turn/end"){if(a.data?.turn!==this.#r)continue;this.#i=!0,this.#a=a.data?.reason??null,this.#t=null;continue}if(a.data?.turn===this.#r){if(a.type==="assistant/chunk"&&a.data?.chunk?.type==="text-delta"){let r=a.data?.step??0,s=a.data.chunk.index??0,g=`${r}:${s}`;this.#l.set(g,(this.#l.get(g)??"")+a.data.chunk.text);let c=`${r}:`,I=[...this.#l.entries()].filter(([d])=>d.startsWith(c)).sort(([d],[B])=>Number(d.split(":")[1])-Number(B.split(":")[1])).map(([,d])=>d).join(` -`).trim();I&&I!==this.#o&&(this.#o=I,i({type:"text",text:I}));continue}if(a.type==="assistant/message"){let r=UEe(a);r&&r!==this.#o&&(this.#o=r,i({type:"text",text:r}));continue}if(a.type==="tool/call"){let r=Ri(a.data?.name)??w("\u5DE5\u5177"),s=Ri(a.data?.callId)??Ri(a.data?.subCallId);s&&this.#n.set(s,r),this.#s=r,i({type:"tool",name:r,...s?{callId:s}:{}})}else if(a.type==="tool/result"){let r=Ri(a.data?.message?.source?.callId)??Ri(a.data?.callId)??Ri(a.data?.subCallId),s=(r?this.#n.get(r):null)??this.#s,g=HEe(a.data?.error);i({type:"status",text:w("\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026"),...s?{toolName:s}:{},...g?{error:g}:{}})}}}}}return o}consume(t){return this.consumeAll(t).at(-1)??null}},Bn=class extends Error{constructor(t,o){super(`${t}: ${o?.message??"unknown Harness RPC error"}`),this.name="HarnessRpcError",this.method=t,this.code=o?.code??"internal",this.details=o?.details??{}}},rs=class extends Error{constructor(t,o,{cause:i,status:e}={}){let a=Number.isInteger(e)?`, HTTP ${e}`:"";super(`Harness ${o} transport failed (${t}${a})`,{cause:i}),this.name="HarnessTransportError",this.code=t,this.method=o,Number.isInteger(e)&&(this.status=e)}},T_=class extends Error{constructor(t){super("Harness health RPC was rejected",{cause:t}),this.name="HarnessHealthError",this.code="harness-rpc-rejected",this.method="host.describe"}},Gp=class extends Error{constructor(t,o){super(o),this.name="HarnessInteractionError",this.code=t}},as=class extends Error{constructor(t,{reason:o,providerCode:i}={}){super(`Harness turn failed (${t})`),this.name="HarnessTurnError",this.code=t,this.promptAccepted=!0,o&&typeof o=="object"&&(this.reason=o),typeof i=="string"&&i&&(this.providerCode=i)}};function I1(n){let t=Ri(n?.kind)??Ri(n);if(t==="error"){let o=n?.error??n?.failure;return new as("harness-turn-failed",{reason:n,providerCode:Ri(o?.code)??void 0})}return t==="max-tokens"?new as("model-max-tokens",{reason:n}):t==="blocked"?new as("turn-blocked",{reason:n}):["interrupted","stopped","cancelled","canceled"].includes(t)?new as("turn-interrupted",{reason:n}):t==="aborted"?new as("turn-aborted",{reason:n}):t==="completed"?new as("model-empty-response",{reason:n}):new as("harness-turn-failed",{reason:n})}function KEe(n){return n==null?!0:(Ri(n?.kind)??Ri(n))==="completed"}var ur=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d;#h=null;#C;#u;#B;#f;constructor({baseUrl:t,apiProxy:o,interactionScope:i=o,workspace:e,agentPreset:a,autostart:A=!1,dshBin:r="dsh",fetchImpl:s=fetch,createWebSocket:g=m=>new WebSocket(m),interactionReconnectDelayMs:c=500,rpcIdPrefix:I="im",logPrefix:d="dsh-im",commandExecutor:B,controlExecutor:f,sessionMaintenanceExecutor:Q,fileIngressExecutor:y}){if(typeof g!="function")throw new TypeError("createWebSocket must be a function");if(!Number.isFinite(c)||c<0)throw new TypeError("interactionReconnectDelayMs must be a non-negative number");if(typeof I!="string"||!I.trim())throw new TypeError("rpcIdPrefix must be a non-empty string");if(typeof d!="string"||!d.trim())throw new TypeError("logPrefix must be a non-empty string");if(B!==void 0&&typeof B!="function")throw new TypeError("commandExecutor must be a function");if(f!==void 0&&typeof f!="function")throw new TypeError("controlExecutor must be a function");if(Q!==void 0&&typeof Q!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(y!==void 0&&typeof y!="function")throw new TypeError("fileIngressExecutor must be a function");if(this.#e=t===void 0?null:new URL(t),this.#A=this.#e?null:o,!this.#e&&(!this.#A||typeof this.#A!="object"))throw new TypeError("HarnessClient requires the current Host apiProxy or an explicit baseUrl");if(this.#A&&(!i||!["object","function"].includes(typeof i)))throw new TypeError("interactionScope must identify the current Host");this.#t=e,this.#r=a??void 0,this.#l=!!(this.#e&&A),this.#o=r,this.#i=s,this.#a=g,this.#n=c,this.#s=I.trim(),this.#p=d.trim(),this.#c=B,this.#g=f,this.#I=Q,this.#d=y,this.#C=l1(this.#e?.origin??i),this.#u=this.#C.ownerships,this.#B=this.#C.claims,this.#f=this.#C.controls}async rpc(t,o={},i=3e4,e={}){let a=e.rpcId??`${this.#s}-${M_()}`,A=AbortSignal.timeout(i),r=e.signal?AbortSignal.any([e.signal,A]):A,s;try{if(this.#A){let[g,c,I]=t.split("."),d={host:"host",workspace:"workspace",session:"sessions",llm:"llm"}[g],B=d&&this.#A[d];if(I!==void 0||!Object.hasOwn(B??{},c)||typeof B[c]!="function")throw new rs("harness-api-not-found",t);s={type:"server-response",...await n1(()=>B[c]({rpcId:a,payload:o},r),r)}}else{let g=await this.#i(new URL(`/api/${t}`,this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"client-request",rpcId:a,method:t,payload:o}),signal:r});if(!g.ok){let c=await REe(g,this.#e.hostname);throw new rs(c,t,{status:g.status})}try{s=await g.json()}catch(c){throw new rs("harness-response-invalid",t,{cause:c})}}}catch(g){throw e.signal?.aborted||g instanceof rs?g:new rs(A.aborted?"harness-timeout":"harness-connect-failed",t,{cause:g})}if(s?.type!=="server-response"||s?.rpcId!==a)throw new rs("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid response for ${t}`)});if(!s.result||typeof s.result!="object"||typeof s.result.ok!="boolean")throw new rs("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid result for ${t}`)});if(!s.result?.ok)throw new Bn(t,s.result?.error);return s.result.value}async health(t={}){try{return await this.rpc("host.describe",{},5e3,t),!0}catch(o){throw o instanceof Bn?new T_(o):o}}async ensureRunning(t={}){try{return await this.health(t)}catch(e){if(!this.#l)throw e}if(!this.#h||this.#h.exitCode!==null){let e=this.#e.port||(this.#e.protocol==="https:"?"443":"80");this.#h=DEe(this.#o,["web","--host",this.#e.hostname,"--port",e],{cwd:this.#t,env:process.env,stdio:["ignore","inherit","inherit"]}),this.#h.on("error",a=>{console.error(`[${this.#p}] failed to start Harness:`,a.message)})}let o=Date.now()+6e4,i;for(;Date.now(){let r=A&&i.signal?AbortSignal.any([A,i.signal]):A??i.signal;return this.rpc("session.selectModel",{sessionId:t,provider:o.provider,model:o.model,...o.reasoningEffort===void 0?{}:{reasoningEffort:o.reasoningEffort}},3e4,r?{...i,signal:r}:i)},a=this.#I?await this.#I({sessionId:t,operation:e}):await e();if(!a||typeof a!="object"||!__(a.selected))throw new Error("Harness returned an invalid response for session.selectModel");return a}async isSessionRunning(t,o={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");await this.ensureRunning(o);let i=await this.rpc("session.list",{},3e4,o);if(!i||typeof i!="object"||!Array.isArray(i.items))throw new Error("Harness returned an invalid response for session.list");for(let e of i.items)if(!e||typeof e!="object"||typeof e.sessionId!="string"||!e.sessionId||typeof e.running!="boolean")throw new Error("Harness returned an invalid response for session.list");return i.items.find(e=>e.sessionId===t)?.running??!1}async adoptWorkspaceSession(t,o={}){return i1(this,t,o)}async workspaceId(t={}){let{workspace:o=this.#t,...i}=t,{items:e}=await this.rpc("workspace.list",{},3e4,i),a=e.find(r=>r.path===o);return a?a.workspaceId:(await this.rpc("workspace.create",{path:o},3e4,i)).workspace.workspaceId}async createSession(t={}){let{agentPreset:o,...i}=t;await this.ensureRunning(i);let a={workspaceId:await this.workspaceId(i)},A=o!==void 0?o:this.#r;return A!=null&&(a.agentPreset=A),(await this.rpc("session.create",a,3e4,i)).sessionId}async executeCommand(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o)throw new TypeError("command line is required");if(!this.#c){let e=new Error("Harness command execution is unavailable");throw e.code="commands-unavailable",e}try{return await this.#c(t,o,i)}catch(e){throw e?.failure&&typeof e.failure=="object"?new Bn("commands.execute",e.failure):e}}async readSessionHistory(t,{maxMessages:o=50,beforeSeq:i,timeoutMs:e=1e4,...a}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!Number.isSafeInteger(o)||o<1||i!==void 0&&(!Number.isSafeInteger(i)||i<0))throw new TypeError("Invalid history pagination");return this.rpc("session.history",{sessionId:t,maxMessages:o,...i===void 0?{}:{beforeSeq:i}},e,a)}async sessionExists(t,o={}){try{return await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,o),!0}catch(i){if(i instanceof Bn&&i.code==="session-not-found")return!1;throw i}}async respondInteraction(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("rpcId is required");if(!o||typeof o!="object"||typeof o.ok!="boolean")throw new TypeError("A Harness RPC result is required");let e=AbortSignal.timeout(i.timeoutMs??3e4),a=i.signal?AbortSignal.any([i.signal,e]):e,A={type:"client-response",rpcId:t,result:o},r;if(this.#A)r=await n1(()=>this.#A.respond(A),a);else{let g=await this.#i(new URL("/api/respond",this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(A),signal:a});if(!g.ok)throw new Error(`Harness transport respond failed: HTTP ${g.status}`);r=await g.json()}if(r?.accepted===!0)return r;if(r?.accepted!==!1||r.reason!=="bad-response"&&r.reason!=="not-pending")throw new Error("Harness returned an invalid interaction response receipt");let s=r.reason;throw new Gp(`interaction-${s}`,`Harness interaction response was rejected (${s})`)}async watchInteractions(t,{signal:o,onInteraction:i,onResolved:e,onOpen:a,ownership:A}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!o||typeof o.addEventListener!="function")throw new TypeError("watchInteractions requires an AbortSignal");if(i!==void 0&&typeof i!="function")throw new TypeError("onInteraction must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("onResolved must be a function");if(a!==void 0&&typeof a!="function")throw new TypeError("onOpen must be a function");for(;!o.aborted;){try{await this.#R(t,{signal:o,onInteraction:i,onResolved:e,onOpen:a,ownership:A})}catch(r){if(o.aborted)return;console.warn(`[${this.#p}] Harness interaction stream disconnected:`,r.message)}if(o.aborted)return;try{await zE(this.#n,o)}catch{if(o.aborted)return;throw new Error("Harness interaction reconnect wait failed")}}}#Q(t,o){let i=this.#u.get(t)??new Set;o.order=this.#C.nextOrder,this.#C.nextOrder+=1,i.add(o),this.#u.set(t,i)}#S(t,o){let i=this.#u.get(t);i?.delete(o),i?.size===0&&this.#u.delete(t);for(let[e,a]of this.#B)a.ownership===o&&this.#B.delete(e)}#y(t){if(!t.control)return;let o=this.#f.get(t.control.owner);o||(o=new Map,this.#f.set(t.control.owner,o));let i=o.get(t.control.key)??new Set;i.add(t),o.set(t.control.key,i)}#m(t){if(!t.control)return;let o=this.#f.get(t.control.owner),i=o?.get(t.control.key);i?.delete(t),i?.size===0&&o.delete(t.control.key),o?.size===0&&this.#f.delete(t.control.owner)}#D(t,o){let i=s1(o);return i?[...this.#f.get(i.owner)?.get(i.key)??[]].filter(a=>a.sessionId===t).sort((a,A)=>a.order-A.order):[]}#E(t,o){return this.#D(t,o).find(i=>i.started&&i.active&&!i.completed&&i.turn!==null)??null}async#N(t,o,i){let e=this.#D(t,o);if(e.length===0)return null;try{let a=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,i);this.#T(t,a.events??[])}catch(a){if(!(a instanceof Bn)||a.code!=="session-not-found")throw a;for(let A of e)A.active=!1,A.completed=!0;return null}return this.#E(t,o)}async hasActiveTurn(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");return!!await this.#N(t,o,i)}async stopActiveTurn(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");let e=await this.#N(t,o,i);if(!e)return!1;if(e.stopRequested)return!0;if(this.#E(t,o)!==e)return!1;e.stopRequested=!0;try{if(this.#g){let a=this.#g({sessionId:t,expectedTurn:e.turn,promptRpcId:e.promptRpcId,action:"stop"});if(a&&typeof a.then=="function")throw new TypeError("controlExecutor must return synchronously");if(a!==void 0){if(typeof a!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return a||(e.stopRequested=!1),a}}return await this.rpc("session.cancel",{sessionId:t,keepInbox:!0},3e4,i),!0}catch(a){if(this.#E(t,o)===e&&(e.stopRequested=!1),a instanceof Bn&&a.code==="session-not-found")return!1;throw a}}async steerActiveTurn(t,o,i,e={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o.trim())throw new TypeError("Steering text is required");let a=await this.#N(t,i,e);if(!a||a.stopRequested||this.#E(t,i)!==a)return!1;if(this.#g){let A=this.#g({sessionId:t,expectedTurn:a.turn,promptRpcId:a.promptRpcId,action:"steer",text:o});if(A&&typeof A.then=="function")throw new TypeError("controlExecutor must return synchronously");if(A!==void 0){if(typeof A!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return A}}return await this.rpc("session.prompt",{sessionId:t,mode:"steer",content:[{type:"text",text:o}],clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,e),!0}#T(t,o){for(let i of this.#u.get(t)??[])p1(i,o)}async#O(t,o){let i=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,{signal:o});this.#T(t,i.events??[])}#w(t,o,i){let e=this.#B.get(o);if(e&&this.#u.get(t)?.has(e.ownership))return e;let a=[...this.#u.get(t)??[]],A=a.filter(s=>s.active).sort((s,g)=>s.order-g.order);if(A.length>0)return{ownership:A[0],recovered:!1};let r=a.filter(s=>!s.started&&!s.completed).sort((s,g)=>s.order-g.order)[0]??null;return r?{ownership:r,recovered:!0}:null}async ask(t,o,i={}){typeof i=="number"&&(i={timeoutMs:i});let e=i.timeoutMs??6e5,a=i.signal,A=typeof i.onUpdate=="function"?i.onUpdate:null,r=i.progressMode==="all"?"all":"latest",s=typeof i.onArtifact=="function"?i.onArtifact:null,g=typeof i.onInteraction=="function"?i.onInteraction:void 0,c=typeof i.onInteractionResolved=="function"?i.onInteractionResolved:void 0,I=s1(i.control),d=Array.isArray(i.files)?i.files.filter(Boolean):[];await this.ensureRunning({signal:a});let B=await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,{signal:a}),f=Math.max(-1,...(B.events??[]).map(({event:J})=>J.seq??-1)),Q=`${this.#s}-${M_()}`,y=new Pp({promptRpcId:Q,afterSeq:f}),m=g||c?new AbortController:null,T=m?a?AbortSignal.any([a,m.signal]):m.signal:null,_=m||I?{sessionId:t,promptRpcId:Q,active:!1,started:!1,completed:!1,stopRequested:!1,turn:null,openTurn:null,lastSeq:f,reconnect:null,order:-1,toolCalls:new Map,control:I}:null,R=null,K=!1,L=0,F=null,q=!1,V=!1,x=async()=>{if(!s||K||y.turn===null)return L;K=!0;let J=vI.take(t,y.turn,{signal:a});for(let U of J)try{await s(U),L+=1}catch(N){vI.release(U),console.warn(`[${this.#p}] ignored an artifact handoff failure:`,N.message)}return L};_&&(this.#Q(t,_),this.#y(_));let G=vI.openConsumer(t,Q);try{if(d.length>0){if(!this.#d)throw new Ro("inbound-file-ingress-unavailable","Harness file ingress is unavailable in this Host process.");let N=(await this.rpc("session.list",{},3e4,{signal:a}))?.items?.find(k=>k?.sessionId===t)?.cwd;F=await this.#d({sessionId:t,workspace:N,files:d,signal:a}),o=NY(o,F)}if(T){let U,N=new Promise(k=>{U=k});R=this.watchInteractions(t,{signal:T,onInteraction:g,onResolved:c,onOpen:U,ownership:_}),R.catch(()=>{}),await Promise.race([N,zE(3e4,T).then(()=>{throw new Error("Harness interaction stream did not open within 30 seconds")})])}let J=typeof o=="string"?[{type:"text",text:o}]:o;if(!Array.isArray(J)||J.length===0)throw new TypeError("Harness prompt content is required");await this.rpc("session.prompt",{sessionId:t,mode:"queue",content:J,clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,{rpcId:Q,signal:a}),q=!0;try{let U=Date.now()+e;for(;Date.now()0)return"";throw _?.stopRequested?c1():I1(y.reason)}throw new as("harness-reply-timeout")}catch(U){if(!_?.stopRequested)throw U;if(y.answer)return y.answer;throw U?.code==="turn-stopped"?U:c1()}}finally{F&&(!q||V)&&await F.cleanup().catch(J=>{console.warn(`[${this.#p}] unable to clean inbound files:`,J.message)}),G(),_&&(this.#m(_),this.#S(t,_)),y.turn!==null&&vI.discard(t,y.turn),m?.abort(new DOMException("Harness turn finished","AbortError")),R&&await R.catch(()=>{})}}async#R(t,{signal:o,onInteraction:i,onResolved:e,onOpen:a,ownership:A}){let r=!1,s=null,g=Promise.resolve(),c=A==null,I=[],d=()=>{},B=m=>{d=m,A&&(A.reconnect=d);try{a?.()}catch(T){console.warn(`[${this.#p}] ignored an interaction open callback failure:`,T.message)}A&&this.#O(t,o).then(()=>{if(!r){c=!0;for(let T of I.splice(0))Q(T)}}).catch(T=>{s??=T,d()})},f=(m,T)=>{m&&(g=g.then(()=>m(T)).catch(_=>{s??=_,d()}))},Q=m=>{let T=m.payload;if(A&&T.type==="session/event"){this.#T(t,[T.event]);return}if(T.type==="question/requested"||T.type==="approval/requested"){let _=T.type==="question/requested"?"question":"approval",R=_==="question"?m.rpcId:T.approvalId,K=`${_}:${R}`;if(A){let F=this.#w(t,K,_);if(F?.ownership!==A)return;this.#B.set(K,F)}let L=_==="approval"&&A&&typeof T.callId=="string"?this.#B.get(K)?.ownership.toolCalls.get(T.callId):void 0;f(i,Object.freeze({kind:_,interactionId:R,rpcId:m.rpcId,sessionId:t,payload:T,recovered:A?this.#B.get(K)?.recovered===!0:!1,...L?{toolCall:L}:{},reconnect:d,respond:(F,q={})=>this.respondInteraction(m.rpcId,F,{...q,signal:q.signal??o})}));return}if(T.type==="question/resolved"||T.type==="approval/resolved"){let _=T.type==="question/resolved"?"question":"approval",R=_==="question"?T.questionRpcId:T.approvalId,K=`${_}:${R}`;if(A){if(this.#B.get(K)?.ownership!==A)return;this.#B.delete(K)}f(e,Object.freeze({kind:_,interactionId:R,sessionId:t,outcome:T.outcome,payload:T}))}},y=m=>{try{let T=m?.payload;if(m?.type!=="server-request"||typeof m.rpcId!="string"||!T||typeof T!="object"||m.method!==T.type)throw new Error("invalid server-request envelope");if(T.sessionId!==t)return;c?Q(m):I.push(m)}catch(T){console.warn(`[${this.#p}] ignored a malformed Harness interaction frame:`,T.message)}};try{await this.#_({signal:o,onOpen:B,onEnvelope:y})}finally{r=!0,A?.reconnect===d&&(A.reconnect=null),o.aborted||await g}if(!o.aborted&&s)throw s}async watchHarnessEvents({signal:t,onSessionEvent:o,onReconnect:i}={}){if(typeof o!="function")throw new TypeError("watchHarnessEvents requires onSessionEvent");if(!t||typeof t.addEventListener!="function")throw new TypeError("watchHarnessEvents requires an AbortSignal");if(i!==void 0&&typeof i!="function")throw new TypeError("onReconnect must be a function");for(;!t.aborted;){try{await this.#_({signal:t,onOpen:()=>{try{i?.()}catch(e){console.warn(`[${this.#p}] mux reconnect hook failed:`,e.message)}},onEnvelope:e=>{try{let a=e?.payload;if(e?.type!=="server-request"||!a||typeof a!="object"||e.method!==a.type||a.type!=="session/event"||typeof a.sessionId!="string"||!a.event||typeof a.event!="object")return;o({sessionId:a.sessionId,event:a.event})}catch(a){console.warn(`[${this.#p}] ignored a malformed global mux frame:`,a.message)}}})}catch(e){if(t.aborted)return;console.warn(`[${this.#p}] Harness event mux disconnected:`,e.message)}if(t.aborted)return;try{await zE(this.#n,t)}catch{if(t.aborted)return;throw new Error("Harness event mux reconnect wait failed")}}}#_(t){return o1({apiProxy:this.#A,baseUrl:this.#e,createWebSocket:this.#a,rpcId:`${this.#s}-${M_()}`,...t,onMalformed:o=>{console.warn(`[${this.#p}] ignored a malformed Harness mux frame:`,o.message)}})}stopManagedProcess(){this.#h?.exitCode===null&&this.#h.kill("SIGTERM")}};var RQ=class extends ur{constructor(t){super({...t,rpcIdPrefix:"dingtalk",logPrefix:"dsh-dingtalk"})}};import{randomUUID as xEe}from"node:crypto";import{mkdir as YEe,readFile as jEe,rename as JEe,unlink as qEe,writeFile as zEe}from"node:fs/promises";import{dirname as VEe}from"node:path";var kQ=Object.freeze({version:1,sessions:{},seenMessageIds:[],pendingSenders:{}});function Br(n){return typeof n=="string"&&n.trim()?n.trim():null}function h1(n){return(Br(n)??w("\u9489\u9489\u7528\u6237")).slice(0,100)}function WEe(n,t){if(!n||typeof n!="object")return null;let o=Br(n.requestId)??Br(t),i=Br(n.staffId),e=Br(n.requestedAt)??Br(n.lastSeenAt),a=Br(n.lastSeenAt)??e;return!o||!i||!e||!a?null:{requestId:o,staffId:i,displayName:h1(n.displayName??n.nick),requestedAt:e,lastSeenAt:a}}function ZEe(n){if(!n||typeof n!="object")return structuredClone(kQ);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[e,a]of Object.entries(n.sessions)){let A=Br(e),r=Br(a);A&&r&&(t[A]=r)}let o={},i=Array.isArray(n.pendingSenders)?n.pendingSenders.map(e=>[e?.requestId,e]):Object.entries(n.pendingSenders&&typeof n.pendingSenders=="object"?n.pendingSenders:{});for(let[e,a]of i){let A=WEe(a,e);if(!A)continue;let r=Object.values(o).find(s=>s.staffId===A.staffId);(!r||r.lastSeenAtnew Date().toISOString()}={}){if(!Br(t))throw new TypeError("state path is required");if(typeof o!="function"||typeof i!="function")throw new TypeError("idFactory and now must be functions");this.#e=t,this.#r=o,this.#l=i}async load(){try{this.#A=ZEe(JSON.parse(await jEe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(kQ),await this.#o()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){let i=Br(t),e=Br(o);if(!i||!e)throw new TypeError("key and sessionId are required");this.#A.sessions[i]=e,await this.#o()}async clearSession(t){let o=Br(t);!o||!(o in this.#A.sessions)||(delete this.#A.sessions[o],await this.#o())}async clearSessions(){this.#A.sessions={},await this.#o()}hasSeen(t){let o=Br(t);return!!(o&&this.#A.seenMessageIds.includes(o))}async markSeen(t){let o=Br(t);if(!o)throw new TypeError("messageId is required");this.hasSeen(o)||(this.#A.seenMessageIds.push(o),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#o())}pendingSenders(){return Object.values(this.#A.pendingSenders).sort((t,o)=>t.requestedAt.localeCompare(o.requestedAt)).map(t=>structuredClone(t))}pendingSender(t){let o=Br(t),i=o?this.#A.pendingSenders[o]:null;return i?structuredClone(i):null}async recordPendingSender(t,o,i){let e=t&&typeof t=="object"?t:{staffId:t,displayName:o,lastSeenAt:i},a=Br(e.staffId);if(!a)throw new TypeError("staffId is required");let A=Br(e.lastSeenAt)??Br(e.requestedAt)??this.#l(),r=Object.values(this.#A.pendingSenders).find(g=>g.staffId===a),s={requestId:r?.requestId??`ding_sender_${this.#r()}`,staffId:a,displayName:h1(e.displayName??e.nick??o),requestedAt:r?.requestedAt??A,lastSeenAt:A};return this.#A.pendingSenders[s.requestId]=s,await this.#o(),structuredClone(s)}async removePendingSender(t){let o=Br(t);return!o||!this.#A.pendingSenders[o]?!1:(delete this.#A.pendingSenders[o],await this.#o(),!0)}async removePendingSenderByStaffId(t){let o=Br(t),i=o?Object.values(this.#A.pendingSenders).find(e=>e.staffId===o):null;return i?this.removePendingSender(i.requestId):!1}snapshot(){return structuredClone(this.#A)}async remove(){await this.#t;try{await qEe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(kQ)}async#o(){let t=`${JSON.stringify(this.#A,null,2)} -`,o=this.#t.then(async()=>{await YEe(VEe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await zEe(i,t,{encoding:"utf8",mode:384}),await JEe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{mkdir as XEe,readFile as $Ee,realpath as eCe,rename as ACe,stat as tCe,unlink as rCe,writeFile as aCe}from"node:fs/promises";import{dirname as iCe,isAbsolute as u1,resolve as WE}from"node:path";var V$e=Object.freeze({version:1,workspaces:Object.freeze({})});function PI(n){let t=new Error(n);return t.code=Ga,t}async function N_(n){return WE(await eCe(n))}async function oCe(n,t){if(n===t)return!0;try{return await N_(n)===await N_(t)}catch{return!1}}function xt(n){if(typeof n!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n))throw new TypeError("Invalid bot id");return n}function ci(n,t,o){let i=new Error(t,o);return i.code=n,i}function PQ(n){if(typeof n!="string"||!/^[A-Za-z0-9._:@-]{1,128}$/.test(n))throw ci("invalid-target","Invalid target id");return n}function nCe(n){if(!n||typeof n!="object"||Array.isArray(n))throw ci("invalid-target","Invalid target route");try{let t=JSON.stringify(n);if(t===void 0)throw new TypeError("route is not JSON");let o=JSON.parse(t);if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError("route is not an object");return o}catch(t){throw ci("invalid-target","Invalid target route",{cause:t})}}function GI(n,{targetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw ci("invalid-target","Invalid delivery target");let o=t===void 0?new Set(["targetId","name","kind","route"]):new Set(["name","kind","route"]);if(Object.keys(n).some(a=>!o.has(a)))throw ci("invalid-target","Invalid delivery target");let i=PQ(t??n.targetId);if(typeof n.kind!="string"||!/^[a-z][a-z0-9-]{0,31}$/.test(n.kind))throw ci("invalid-target","Invalid target kind");let e;if(n.name!==void 0){if(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)throw ci("invalid-target","Invalid target name");e=n.name.trim()}return{targetId:i,...e===void 0?{}:{name:e},kind:n.kind,route:nCe(n.route)}}function sCe(n){let t=Object.create(null);if(n===void 0)return t;if(!n||typeof n!="object"||Array.isArray(n))return null;try{for(let[o,i]of Object.entries(n)){if(xt(o),!i||typeof i!="object"||Array.isArray(i))return null;let e=Object.create(null);for(let[a,A]of Object.entries(i)){let r=GI(A,{targetId:a}),{targetId:s,...g}=r;e[a]=g}t[o]=e}}catch{return null}return t}function gCe(n,t){let o=Object.create(null);if(n===void 0)return o;if(!n||typeof n!="object"||Array.isArray(n)){for(let i of Object.keys(t))o[i]=null;return o}for(let[i,e]of Object.entries(n))try{xt(i),o[i]=vp(e)}catch{}return o}function cCe(n){if(!n||![1,2].includes(n.version)||!n.workspaces||typeof n.workspaces!="object"||Array.isArray(n.workspaces))return null;let t={};for(let[r,s]of Object.entries(n.workspaces)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(r)||typeof s!="string"||!u1(s))return null;t[r]=WE(s)}let o={};if(n.agentPresets!==void 0){if(!n.agentPresets||typeof n.agentPresets!="object"||Array.isArray(n.agentPresets))return null;for(let[r,s]of Object.entries(n.agentPresets)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(r))return null;try{let g=_p(s);if(!g)return null;o[r]=g}catch{return null}}}let i=Object.create(null);if(n.contextEnhancement&&typeof n.contextEnhancement=="object"&&!Array.isArray(n.contextEnhancement))for(let[r,s]of Object.entries(n.contextEnhancement))/^[A-Za-z0-9_-]{1,128}$/.test(r)&&(i[r]=Np(s));if(n.version===1&&n.deliveryTargets!==void 0)return null;let e=sCe(n.deliveryTargets);if(!e)return null;let a=gCe(n.accessPolicies,t);return{version:n.accessPolicies===void 0?n.version:2,workspaces:t,agentPresets:o,contextEnhancement:i,deliveryTargets:e,accessPolicies:a}}function ICe({version:n,workspaces:t,agentPresets:o,contextEnhancement:i,deliveryTargets:e,accessPolicies:a}){let A={version:n,workspaces:t};return Object.keys(o).length>0&&(A.agentPresets=o),Object.keys(i).length>0&&(A.contextEnhancement=i),n>=2&&Object.keys(e).length>0&&(A.deliveryTargets=e),n>=2&&Object.keys(a).length>0&&(A.accessPolicies=a),A}async function lCe(n,t){await XEe(iCe(n),{recursive:!0,mode:448});let o=`${n}.tmp`;await aCe(o,`${JSON.stringify(t,null,2)} -`,{encoding:"utf8",mode:384}),await ACe(o,n)}async function E1(n){if(typeof n!="string"||!n.trim()||!u1(n.trim())){let i=new Error("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");throw i.code="workspace-not-absolute",i}let t=WE(n.trim()),o;try{o=await tCe(t)}catch(i){let e=new Error("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002",{cause:i});throw e.code="workspace-not-found",e}if(!o.isDirectory()){let i=new Error("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");throw i.code="workspace-not-directory",i}return t}var ra=class{#e;#A;#t=1;#r={};#l={};#o={};#i=Object.create(null);#a=Object.create(null);#n=new Map;#s=1;#p=new Map;#c=1;#g=new Map;#I=new WeakMap;#d=new Set;#h=Promise.resolve();#C=new Map;constructor(t,{defaultWorkspace:o=process.cwd()}={}){if(typeof t!="string"||!t)throw new TypeError("workspace store path is required");this.#e=t,this.#A=WE(o)}async load(){try{let t=cCe(JSON.parse(await $Ee(this.#e,"utf8")));if(!t)throw new Error("dsh-im workspace config is invalid");this.#t=t.version,this.#r=t.workspaces,this.#l=t.agentPresets,this.#o=t.contextEnhancement,this.#i=t.deliveryTargets,this.#a=t.accessPolicies}catch(t){if(t?.code!=="ENOENT")throw t;this.#t=1,this.#r={},this.#l={},this.#o={},this.#i=Object.create(null),this.#a=Object.create(null)}this.#n.clear(),this.#s=1,this.#p.clear(),this.#c=1,this.#g.clear(),this.#d.clear();for(let t of Object.keys(this.#r))this.#n.set(t,this.#u()),this.#p.set(t,this.#B());return this}has(t){let o=xt(t);return Object.hasOwn(this.#r,o)&&!this.#g.has(o)}incarnationFor(t){return this.#p.get(xt(t))??null}workspaceFor(t){return this.#r[xt(t)]??this.#A}agentPresetFor(t){return this.#l[xt(t)]??null}contextEnhancementFor(t){let o=xt(t);return this.has(o)&&Object.hasOwn(this.#o,o)?this.#o[o]:h_}accessPolicyFor(t){let o=xt(t);return this.has(o)&&Object.hasOwn(this.#a,o)?this.#a[o]:null}listDeliveryTargets(t){let o=xt(t);if(!this.has(o))throw ci("unknown-bot","Unknown bot");return Object.entries(this.#i[o]??{}).map(([i,e])=>GI(e,{targetId:i})).sort((i,e)=>i.targetId.localeCompare(e.targetId))}deliveryTargetFor(t,o){let i=xt(t),e=PQ(o);if(!this.has(i))throw ci("unknown-bot","Unknown bot");let a=this.#i[i]?.[e];return a?GI(a,{targetId:e}):null}async createDeliveryTarget(t,o){let i=xt(t),e=GI(o);return this.#S(i,async()=>{if(!this.has(i))throw ci("unknown-bot","Unknown bot");if(Object.hasOwn(this.#i[i]??{},e.targetId))throw ci("target-conflict","Target already exists");let{targetId:a,...A}=e,r={...this.#i,[i]:{...this.#i[i]??{},[a]:A}};return await this.#y(this.#o,r,2),this.#i=r,this.#t=2,GI(A,{targetId:a})})}async updateDeliveryTarget(t,o,i){let e=xt(t),a=PQ(o),A=GI(i,{targetId:a});return this.#S(e,async()=>{if(!this.has(e))throw ci("unknown-bot","Unknown bot");if(!Object.hasOwn(this.#i[e]??{},a))throw ci("unknown-target","Unknown target");let{targetId:r,...s}=A,g={...this.#i,[e]:{...this.#i[e],[a]:s}};return await this.#y(this.#o,g,2),this.#i=g,this.#t=2,GI(s,{targetId:a})})}async deleteDeliveryTarget(t,o){let i=xt(t),e=PQ(o);return this.#S(i,async()=>{if(!this.has(i))throw ci("unknown-bot","Unknown bot");if(!Object.hasOwn(this.#i[i]??{},e))throw ci("unknown-target","Unknown target");let a={...this.#i[i]};delete a[e];let A={...this.#i};return Object.keys(a).length>0?A[i]=a:delete A[i],await this.#y(this.#o,A,2),this.#i=A,this.#t=2,!0})}generationFor(t){return this.#n.get(xt(t))??null}async whenIdle(){await this.#h}async whenBotIdle(t){let o=xt(t);for(;;){let i=this.#C.get(o);if(!i||(await i,this.#C.get(o)===i))return}}async ensure(t,{workspace:o=this.#A,defaultAgentPreset:i,initialAccessPolicy:e}={}){let a=xt(t),A=WE(o);return this.#S(a,async()=>{let r=!this.#r[a],s=e!==void 0&&!Object.hasOwn(this.#a,a);if(r||s){let g=s?Ic(e):void 0,c=r?_p(i):null,I=Object.hasOwn(this.#l,a),d=this.#l[a],B=s?{...this.#a,[a]:g}:this.#a;r&&(this.#r[a]=A,c&&(this.#l[a]=c),this.#n.set(a,this.#u()),this.#p.set(a,this.#B()));let f=s?2:this.#t;try{await this.#y(this.#o,this.#i,f,B)}catch(Q){throw r&&(delete this.#r[a],I?this.#l[a]=d:delete this.#l[a],this.#n.delete(a),this.#p.delete(a)),Q}this.#a=B,this.#t=f}else this.#n.has(a)||this.#n.set(a,this.#u());return this.#r[a]})}async setWorkspace(t,o,{clearSessions:i,incarnation:e}={}){let a=xt(t);if(!this.has(a)||e!==void 0&&e!==this.incarnationFor(a)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=await E1(o);return this.#S(a,async()=>{if(!this.has(a)||e!==void 0&&e!==this.incarnationFor(a)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}if(A===this.workspaceFor(a))return A;let r=this.#r[a];this.#n.set(a,this.#u()),await i?.(),this.#r[a]=A;try{await this.#y()}catch(s){throw this.#r[a]=r,s}return A})}async setAgentPreset(t,o,{incarnation:i}={}){let e=xt(t);if(!this.has(e)||i!==void 0&&i!==this.incarnationFor(e)){let A=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw A.code="workspace-bot-not-found",A}let a=_p(o);return this.#S(e,async()=>{if(!this.has(e)||i!==void 0&&i!==this.incarnationFor(e)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=this.#l[e]??null;if(A===a)return a;a?this.#l[e]=a:delete this.#l[e];try{await this.#y()}catch(r){throw A?this.#l[e]=A:delete this.#l[e],r}return a})}async setContextEnhancement(t,o,{incarnation:i}={}){let e=xt(t),a=i===void 0?this.incarnationFor(e):i,A=kI(o);return this.#S(e,async()=>{if(!this.has(e)||a!==this.incarnationFor(e)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}let r={...this.#o,[e]:A};return await this.#y(r),this.#o=r,A})}async setAccessPolicy(t,o,{incarnation:i}={}){let e=xt(t),a=i===void 0?this.incarnationFor(e):i,A=Ic(o);return this.#S(e,async()=>{if(!this.has(e)||a!==this.incarnationFor(e)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}let r={...this.#a,[e]:A};return await this.#y(this.#o,this.#i,2,r),this.#a=r,this.#t=2,A})}async bindWorkspaceSession(t,o,{conversationKey:i,sessionId:e,clearSessions:a,setSession:A,incarnation:r,expectedGeneration:s}={}){let g=xt(t);if(typeof i!="string"||!i||typeof e!="string"||!e)throw new TypeError("conversationKey and sessionId are required");if(typeof a!="function"||typeof A!="function")throw new TypeError("session state callbacks are required");if(!this.has(g)||r!==void 0&&r!==this.incarnationFor(g)){let I=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw I.code="workspace-bot-not-found",I}let c=await N_(await E1(o));return this.#S(g,async()=>{if(!this.has(g)||r!==void 0&&r!==this.incarnationFor(g)){let I=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw I.code="workspace-bot-not-found",I}if(s!==void 0&&s!==this.generationFor(g))throw PI("The bot workspace changed before the session binding could be committed.");if(!await oCe(c,this.workspaceFor(g))){let I=this.#r[g];this.#n.set(g,this.#u()),await a(),this.#r[g]=c;try{await this.#y()}catch(d){throw this.#r[g]=I,d}}return await A(i,e),{workspace:c,sessionId:e,generation:this.#n.get(g)}})}async invalidateSessions(t,{clearSessions:o}={}){let i=xt(t);return this.#S(i,async()=>{this.#n.set(i,this.#u()),await o?.()})}async beginRemoval(t,{clearSessions:o}={}){let i=xt(t);return this.#S(i,async()=>{let e=this.#g.get(i);if(e)return e;let a=Object.freeze({});this.#g.set(i,a),this.#I.set(a,{botId:i,incarnation:this.incarnationFor(i)}),this.#n.set(i,this.#u());try{await o?.()}catch(A){throw this.#g.get(i)===a&&this.#g.delete(i),A}return a})}async abortRemoval(t){let{botId:o}=this.#f(t);return this.#S(o,async()=>this.#g.get(o)!==t?!1:(this.#g.delete(o),Object.hasOwn(this.#r,o)&&(this.#n.set(o,this.#u()),this.#p.has(o)||this.#p.set(o,this.#B())),!0))}async finishRemoval(t){let{botId:o,incarnation:i}=this.#f(t);return this.#S(o,async()=>this.#g.get(o)!==t?{removed:!1,persisted:!0,error:null,stale:!0}:this.incarnationFor(o)!==i?(this.#g.delete(o),{removed:!1,persisted:!0,error:null,stale:!0}):(this.#g.delete(o),this.#Q(o)))}async retireAfterConfigCommit(t){let o=xt(t);return this.#S(o,async()=>(this.#g.delete(o),this.#Q(o)))}flushPendingRemoval(t){if(this.#d.has(t))return this.#S(t,async()=>{this.#d.has(t)&&await this.#m()})}async remove(t){let o=await this.retireAfterConfigCommit(t);if(o.error)throw o.error;return o.removed}async reconcile(t){let o=new Set([...t].map(xt)),i=new Set([...Object.keys(this.#r),...Object.keys(this.#l),...Object.keys(this.#o),...Object.keys(this.#i),...Object.keys(this.#a),...this.#d]);for(let e of i)o.has(e)||await this.remove(e)}decorateStatus(t){return!t||typeof t!="object"||!Array.isArray(t.bots)?t:{...t,bots:t.bots.map(o=>o?.botId?{...o,workspace:this.workspaceFor(o.botId),agentPreset:this.agentPresetFor(o.botId),contextEnhancement:this.contextEnhancementFor(o.botId),accessPolicy:this.accessPolicyFor(o.botId)}:o)}}#u(){let t=this.#s;return this.#s+=1,t}#B(){let t=this.#c;return this.#c+=1,t}#f(t){if(!t||typeof t!="object")throw new TypeError("Invalid workspace removal transaction");let o=this.#I.get(t);if(!o)throw new TypeError("Invalid workspace removal transaction");return o}async#Q(t){let o=Object.hasOwn(this.#r,t),i=Object.hasOwn(this.#l,t),e=Object.hasOwn(this.#o,t),a=Object.hasOwn(this.#i,t),A=Object.hasOwn(this.#a,t),r=o||i||e||a||A||this.#d.has(t);if(delete this.#r[t],delete this.#l[t],delete this.#o[t],delete this.#i[t],delete this.#a[t],this.#n.delete(t),this.#p.delete(t),!r)return{removed:!1,persisted:!0,error:null,stale:!1};try{return await this.#m(),{removed:o,persisted:!0,error:null,stale:!1}}catch(s){return this.#d.add(t),{removed:o,persisted:!1,error:s,stale:!1}}}async#S(t,o){let i=this.#h.then(o,o),e=i.then(()=>{},()=>{});return this.#h=e,this.#C.set(t,e),e.finally(()=>{this.#C.get(t)===e&&this.#C.delete(t)}),i}async#y(t=this.#o,o=this.#i,i=this.#t,e=this.#a){await lCe(this.#e,ICe({version:i,workspaces:this.#r,agentPresets:this.#l,contextEnhancement:t,deliveryTargets:o,accessPolicies:e})),this.#d.clear()}async#m(){if(Object.keys(this.#r).length>0||Object.keys(this.#l).length>0||Object.keys(this.#o).length>0||Object.keys(this.#i).length>0||Object.keys(this.#a).length>0){await this.#y();return}try{await rCe(this.#e),this.#d.clear()}catch(t){if(t?.code!=="ENOENT")throw t;this.#d.clear()}}};function VE(n){if(!n)return null;let t=typeof n=="function"?n():n;return t&&typeof t.then=="function"?t.then($n):$n(t)}function B1(){let n=new Error("Agent Preset \u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u7528\u3002");return n.code="agent-preset-unavailable",n}function Fp(n){if(n())return;let t=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw t.code="workspace-bot-not-found",t}function C1(n,t,o){let i=e=>{let a=n.decorateStatus(e);if(!o||!a||typeof a!="object")return a;let A=s=>s?{...a,agentPresetCatalog:s}:a,r=VE(o);return r&&typeof r.then=="function"?r.then(A):A(r)};return t&&typeof t.then=="function"?t.then(i):i(t)}function pCe(n){return Promise.resolve(n.status())}function Ha(n,{workspaces:t,method:o="remove",botIdFromRemoved:i=A=>A?.botId,saveMethod:e="save",botIdFromSave:a=A=>A?.botId}){if(!n||!t||typeof n[o]!="function")throw new TypeError("configStore removal observer dependencies are required");return new Proxy(n,{get(A,r){let s=Reflect.get(A,r,A);return r===o?async(...g)=>{let c=await s.apply(A,g),I=c?i(c,g):null;return I&&await t.retireAfterConfigCommit(I),c}:r===e&&typeof s=="function"?(...g)=>{let c=t.flushPendingRemoval(a(g[0],g));return c?c.then(()=>s.apply(A,g)):s.apply(A,g)}:typeof s=="function"?s.bind(A):s}})}function Ka(n,{botId:t,workspaces:o,state:i,agentPresetCatalog:e}={}){if(!n||!o||!i)throw new TypeError("harness, workspaces, and state are required");let a=o.incarnationFor(t),A=()=>o.has(t)&&o.incarnationFor(t)===a,r=async(I=e)=>{let d;try{d=await VE(I)??$n(null)}catch(B){throw Fp(A),B}return Fp(A),{agentPreset:o.agentPresetFor(t),agentPresetCatalog:d}},s=new Map,g=new Proxy(n,{get(I,d){if(d==="agentPresetSettings")return async(f={})=>{f?.signal?.throwIfAborted(),Fp(A);let Q=await r();return f?.signal?.throwIfAborted(),Q};if(d==="updateAgentPreset")return async(f,Q={})=>{Q?.signal?.throwIfAborted(),Fp(A);let y=f==="--default"?null:_p(f),m=null;if(y&&({agentPresetCatalog:m}=await r(),Q?.signal?.throwIfAborted(),!m.items.some(T=>T.id===y)))throw B1();if(await o.setAgentPreset(t,y,{incarnation:a}),Fp(A),m)return{agentPreset:o.agentPresetFor(t),agentPresetCatalog:m};try{return await r()}catch(T){if(T?.code==="workspace-bot-not-found")throw T;return Fp(A),{agentPreset:o.agentPresetFor(t),agentPresetCatalog:$n(null)}}};if(d==="currentWorkspace")return()=>{if(!A()){let f=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw f.code="workspace-bot-not-found",f}return o.workspaceFor(t)};if(d==="assertWorkspaceScope")return()=>{if(!A()){let f=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw f.code="workspace-bot-not-found",f}};if((d==="listWorkspaces"||d==="listWorkspaceSessions"||d==="listModels")&&typeof I[d]=="function")return async(...f)=>{if(!A()){let y=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw y.code="workspace-bot-not-found",y}let Q=await I[d](...f);if(!A()){let y=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw y.code="workspace-bot-not-found",y}return Q};if(d==="switchWorkspace")return f=>{if(!A()){let Q=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");return Q.code="workspace-bot-not-found",Promise.reject(Q)}return o.setWorkspace(t,f,{clearSessions:()=>i.clearSessions(),incarnation:a})};if(d==="bindWorkspaceSession")return async(f,Q)=>{if(typeof f!="string"||!f||typeof Q!="string"||!Q)throw new TypeError("conversationKey and sessionId are required");if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(typeof I.adoptWorkspaceSession!="function")throw new TypeError("Harness does not support adopting workspace sessions");let y=o.generationFor(t),m=await I.adoptWorkspaceSession(Q);if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(y!==o.generationFor(t))throw PI("The bot workspace changed while the session was being adopted.");if(!m||typeof m!="object"||m.sessionId!==Q||typeof m.workspace!="string")throw new TypeError("Harness returned an invalid adopted workspace session");let T=await o.bindWorkspaceSession(t,m.workspace,{conversationKey:f,sessionId:Q,clearSessions:()=>i.clearSessions(),setSession:(_,R)=>i.setSession(_,R),incarnation:a,expectedGeneration:y});if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(T.generation!==o.generationFor(t))throw PI("The bot workspace changed before the session binding completed.");return s.set(Q,T.generation),{...m,workspace:T.workspace,sessionId:T.sessionId}};if(d==="createSession")return async(f={})=>{if(await o.whenBotIdle(t),!A()){let T=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw T.code="workspace-bot-not-found",T}let Q=o.generationFor(t),y=o.agentPresetFor(t),m=await I.createSession({...f,workspace:o.workspaceFor(t),...y==null?{}:{agentPreset:y}});return s.set(m,Q),m};if(d==="workspaceSession")return f=>{if(typeof f!="string"||!f)throw new TypeError("sessionId is required");let Q=s.get(f)??o.generationFor(t);s.delete(f);let y=()=>A()&&Q===o.generationFor(t),m=async(_,R,K)=>{if(!y())throw PI(`The bot workspace changed before this ${K} started.`);let L=await I[_](f,...R);if(!y())throw PI(`The bot workspace changed while this ${K} was running.`);return L},T=async(_,R,K)=>{if(!y())throw PI(`The bot workspace changed before this ${K} started.`);return I[_](f,...R)};return Object.freeze({sessionId:f,async sessionExists(..._){if(!y())return!1;let R=await I.sessionExists(f,..._);return y()&&R},models(..._){return m("getSessionModels",_,"model listing")},readHistory(..._){return m("readSessionHistory",_,"history read")},selectModel(..._){return m("selectSessionModel",_,"model selection")},isRunning(..._){return m("isSessionRunning",_,"run-state check")},hasActiveTurn(..._){return m("hasActiveTurn",_,"turn ownership check")},stopActiveTurn(..._){return T("stopActiveTurn",_,"turn stop")},steerActiveTurn(..._){return T("steerActiveTurn",_,"turn steering")},ask(..._){if(!y())throw PI("The bot workspace changed before this prompt started.");return I.ask(f,..._)}})};if(d==="sessionExists")return(f,...Q)=>{if(!A())return!1;let y=s.get(f);return y!==void 0&&y!==o.generationFor(t)?(s.delete(f),!1):I.sessionExists(f,...Q)};if(d==="ask")return(f,...Q)=>{let y=s.get(f);if(s.delete(f),!A()||y!==void 0&&y!==o.generationFor(t)){let m=new Error("The bot workspace changed before this prompt started.");throw m.code=Ga,m}return I.ask(f,...Q)};if(d==="executeCommand"&&typeof I.executeCommand=="function")return(f,...Q)=>{let y=s.get(f);if(s.delete(f),!A()||y!==void 0&&y!==o.generationFor(t)){let m=new Error("The bot workspace changed before this command started.");throw m.code=Ga,m}return I.executeCommand(f,...Q)};let B=Reflect.get(I,d,I);return typeof B=="function"?B.bind(I):B}}),c=new Proxy(i,{get(I,d){if(d===KM)return I;if(d==="sessionFor")return(f,...Q)=>{if(!A())return null;let y=I.sessionFor(f,...Q);return y&&!s.has(y)&&s.set(y,o.generationFor(t)),y};if(d==="setSession")return(f,Q,...y)=>{let m=s.get(Q);return!A()||m!==void 0&&m!==o.generationFor(t)?(s.delete(Q),!1):I.setSession(f,Q,...y)};let B=Reflect.get(I,d,I);return typeof B=="function"?B.bind(I):B}});return Object.freeze({harness:g,state:c})}function xa(n,{workspaces:t,stateFor:o,agentPresetCatalog:i}={}){if(!n||!t||typeof o!="function")throw new TypeError("controller, workspaces, and stateFor are required");let e=new Map,a=(d,B)=>{let Q=(e.get(d)??Promise.resolve()).catch(()=>{}).then(B);return e.set(d,Q),Q.finally(()=>{e.get(d)===Q&&e.delete(d)})},A=d=>C1(t,d,i),r=(d,B)=>{let f=t.incarnationFor(d);return a(d,async()=>{if(!(await n.status())?.bots?.some(m=>m?.botId===d)){let m=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw m.code="workspace-bot-not-found",m}let y=await o(d);return await t.setWorkspace(d,B,{clearSessions:()=>y.clearSessions(),incarnation:f}),A(await n.status())})},s=(d,B)=>{let f=t.incarnationFor(d),Q=_p(B);return a(d,async()=>{if(!(await n.status())?.bots?.some(T=>T?.botId===d)){let T=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw T.code="workspace-bot-not-found",T}let m=Q&&i?await VE(i):null;if(Q&&i&&!m?.items.some(T=>T.id===Q))throw B1();return await t.setAgentPreset(d,Q,{incarnation:f}),C1(t,await n.status(),m??i)})},g=(d,B,f)=>{let Q=t.incarnationFor(d),y=kI(B);return a(d,async()=>{let m=await n.status();if(!m?.bots?.some(L=>L?.botId===d)){let L=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw L.code="workspace-bot-not-found",L}let T=await VE(i),_=t.decorateStatus(m),R={..._,bots:_.bots.map(L=>L?.botId===d?{...L,contextEnhancement:y}:L),...T?{agentPresetCatalog:T}:{}},K=f?await f(R):R;return await t.setContextEnhancement(d,y,{incarnation:Q}),K})},c=(d,B,f)=>{let Q=t.incarnationFor(d),y=Ic(B);return a(d,async()=>{let m=await n.status();if(!m?.bots?.some(L=>L?.botId===d)){let L=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw L.code="workspace-bot-not-found",L}let T=await VE(i),_=t.decorateStatus(m),R={..._,bots:_.bots.map(L=>L?.botId===d?{...L,accessPolicy:y}:L),...T?{agentPresetCatalog:T}:{}},K=f?await f(R):R;return await t.setAccessPolicy(d,y,{incarnation:Q}),K})},I=(d,B)=>a(d,async()=>{let f=await t.beginRemoval(d,{clearSessions:async()=>{try{let Q=await o(d);if(!Q||typeof Q.clearSessions!="function")throw new TypeError("bot state does not support session cleanup");await Q.clearSessions()}catch(Q){console.warn(`[dsh-im] ignored session cleanup failure while deleting bot ${d}:`,Q?.message??Q)}}});try{let Q=await B();return await t.finishRemoval(f),A(Q)}catch(Q){let y=await pCe(n).catch(()=>null);throw Array.isArray(y?.bots)&&!y.bots.some(T=>T?.botId===d)?await t.finishRemoval(f):await t.abortRemoval(f),Q}});return new Proxy(n,{get(d,B){if(B==="updateWorkspace")return r;if(B==="updateAgentPreset")return s;if(B==="updateContextEnhancement")return g;if(B==="updateAccessPolicy")return c;let f=Reflect.get(d,B,d);return typeof f!="function"?f:B==="deleteBot"?(Q,...y)=>I(Q,()=>f.call(d,Q,...y)):B==="disconnect"?async(...Q)=>{let m=(await d.status())?.bots?.[0]?.botId;return m?I(m,()=>f.apply(d,Q)):A(f.apply(d,Q))}:(...Q)=>A(f.apply(d,Q))}})}var f1=new Set(["weixin","feishu","dingtalk","wecom","qq","slack","telegram","discord","whatsapp"]);function dCe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function hCe(n){return typeof n=="string"&&n.length>0&&n.length<=512&&n.trim()===n&&!/[\s:\u0000-\u001f\u007f]/u.test(n)}function R_(n,t){let o=`${t}:`;if(!n.startsWith(o))return null;let i=n.slice(o.length);return hCe(i)?i:null}function ZE(n,t){for(let[o,i,e]of t){let a=R_(n,o);if(a)return{kind:i,route:{[e]:a}}}return null}function ECe(n){let t=R_(n,"p2p");return t?.startsWith("ou_")?{kind:"user",route:{openId:t}}:ZE(n,[["group","group","chatId"]])}function CCe(n){let t=R_(n,"direct");if(t&&/^[A-Za-z0-9_-]{1,128}$/.test(t))return{kind:"conversation",route:{channelId:t}};let o=/^group:([^:]+):(\d{1,20}(?:\.\d{1,20})?)$/.exec(n);return!o||!/^[A-Za-z0-9_-]{1,128}$/.test(o[1])?null:{kind:"thread",route:{channelId:o[1],threadTs:o[2]}}}function uCe(n){let t=/^(direct|group):(-?\d+)(?::([1-9]\d*))?$/.exec(n);if(!t)return null;let o=Number(t[2]);if(!Number.isSafeInteger(o)||t[1]==="direct"&&t[3]!==void 0)return null;if(t[3]===void 0)return{kind:"chat",route:{chatId:t[2]}};let i=Number(t[3]);return!Number.isSafeInteger(i)||i<=0?null:{kind:"topic",route:{chatId:t[2],messageThreadId:i}}}function BCe(n){let t=/^(?:direct|group):(\d{1,32})$/.exec(n);return t?{kind:"channel",route:{channelId:t[1]}}:null}function fCe(n){let t=/^direct:(\d{5,32}@(s\.whatsapp\.net|lid))$/.exec(n);if(t)return{kind:"user",route:{jid:t[1]}};let o=/^group:(\d{5,32}(?:-\d{1,32})?@g\.us)$/.exec(n);return o?{kind:"group",route:{jid:o[1]}}:null}function QCe(n,t){if(!f1.has(n)||typeof t!="string")return null;switch(n){case"weixin":return ZE(t,[["p2p","user","toUserId"]]);case"feishu":return ECe(t);case"dingtalk":return ZE(t,[["p2p","user","userId"],["group","group","openConversationId"]]);case"wecom":return ZE(t,[["direct","user","chatId"],["group","group","chatId"]]);case"qq":return ZE(t,[["c2c","user","userOpenId"],["group","group","groupOpenId"]]);case"slack":return CCe(t);case"telegram":return uCe(t);case"discord":return BCe(t);case"whatsapp":return fCe(t);default:return null}}function Q1(n,t){if(!f1.has(n)||!dCe(t))return[];let o=[],i=new Set;for(let e of Object.keys(t)){let a=QCe(n,e);if(!a)continue;let A=JSON.stringify(a);i.has(A)||(i.add(A),o.push(a))}return o}var yCe=new Set(["weixin","feishu","dingtalk","wecom","qq","slack","telegram","discord","whatsapp"]);function FQ(n){return yCe.has(n)}function pc(n){let t=new Error(n);return t.code="invalid-target",t}function mCe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function k_(n,t,o){if(!mCe(n))throw pc(`${o} must be an object`);if(Object.keys(n).find(e=>!t.includes(e))!==void 0)throw pc(`${o} contains an unknown field`)}function GQ(n,t){if(typeof n!="string"||!n||n.trim()!==n)throw pc(`${t} must be a non-empty string without surrounding whitespace`);return n}function SCe(n){if(typeof n!="string"||!n.trim()||n.trim().length>80)throw pc("target.name must contain 1 to 80 characters");return n.trim()}function lc(n,t){k_(n,t,"route");let o={};for(let i of t)o[i]=GQ(n[i],`route.${i}`);return o}function lg(n,t){if(!t.includes(n))throw pc("target kind is not supported by this channel");return n}function wCe(n,t,o){switch(n){case"weixin":return lg(t,["user"]),lc(o,["toUserId"]);case"feishu":return lg(t,["user","group"]),lc(o,t==="user"?["openId"]:["chatId"]);case"dingtalk":return lg(t,["user","group"]),lc(o,t==="user"?["userId"]:["openConversationId"]);case"wecom":return lg(t,["user","group"]),lc(o,["chatId"]);case"qq":return lg(t,["user","group"]),lc(o,t==="user"?["userOpenId"]:["groupOpenId"]);case"slack":return lg(t,["conversation","thread"]),lc(o,t==="conversation"?["channelId"]:["channelId","threadTs"]);case"telegram":{lg(t,["chat","topic"]),k_(o,t==="chat"?["chatId"]:["chatId","messageThreadId"],"route");let i=GQ(o.chatId,"route.chatId");if(!/^-?\d+$/.test(i))throw pc("route.chatId must be a decimal string");if(t==="chat")return{chatId:i};if(!Number.isSafeInteger(o.messageThreadId)||o.messageThreadId<=0)throw pc("route.messageThreadId must be a positive integer");return{chatId:i,messageThreadId:o.messageThreadId}}case"discord":return lg(t,["channel"]),lc(o,["channelId"]);case"whatsapp":{lg(t,["user","group"]);let i=lc(o,["jid"]);if(!(t==="user"?/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(i.jid):/^\d{5,32}(?:-\d{1,32})?@g\.us$/.test(i.jid)))throw pc(`route.jid must be a ${t} WhatsApp JID`);return i}default:throw new TypeError(`Unsupported delivery channel: ${n}`)}}function Lp(n,t,{targetIdRequired:o=!0}={}){if(!FQ(n))throw new TypeError(`Unsupported delivery channel: ${n}`);k_(t,o?["targetId","name","kind","route"]:["name","kind","route"],"target");let i={};return o&&(i.targetId=GQ(t.targetId,"target.targetId")),t.name!==void 0&&(i.name=SCe(t.name)),i.kind=GQ(t.kind,"target.kind"),i.route=wCe(n,i.kind,t.route),i}function Ya({channel:n,workspaces:t,coreController:o,stateFor:i}){if(!FQ(n))throw new TypeError(`Unsupported delivery channel: ${n}`);if(!t||typeof t!="object")throw new TypeError("delivery adapter requires a workspace store");if(!o||typeof o!="object")throw new TypeError("delivery adapter requires a proactive text controller");if(typeof i!="function")throw new TypeError("delivery adapter requires a bot state getter");return Object.freeze({channel:n,ownsBot:e=>t.has(e),listTargets:e=>t.listDeliveryTargets(e),async listSuggestions(e){let a=await i(e);if(!a||typeof a.snapshot!="function")throw new TypeError("delivery suggestion state cannot be inspected");return Q1(n,a.snapshot()?.sessions).map(r=>Lp(n,r,{targetIdRequired:!1}))},createTarget:(e,a)=>t.createDeliveryTarget(e,Lp(n,a)),updateTarget:(e,a,A)=>t.updateDeliveryTarget(e,a,Lp(n,A,{targetIdRequired:!1})),deleteTarget:(e,a)=>t.deleteDeliveryTarget(e,a),async sendText(e,a,A,r={}){let s=Lp(n,a);if(typeof o.sendProactiveText!="function")throw new TypeError("delivery controller cannot send proactive text");return await o.sendProactiveText(e,s,A,r),{sent:!0}}})}var y1=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function DCe(n){if(!Array.isArray(n)||n.length===0)return[...y1];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...y1]}var LQ=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=DCe(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(i{let A={namespace:"commands",method:"execute",args:{agentId:i,line:e,images:[]},signal:a.signal};try{return await o.invoke(A)}catch(r){if(r?.name!=="TypertGatewayError"||r.code!=="arguments-invalid"||r.endpoint!=="commands/execute"||r.message!=='typert gateway: commands/execute: args fields do not match the descriptor: unexpected "images"')throw r;return a.signal?.throwIfAborted(),o.invoke({...A,args:{agentId:i,line:e}})}}}}import{randomUUID as P_}from"node:crypto";var UQ=new WeakMap;function OCe(n){let t=n?.failure;return t&&typeof t=="object"&&typeof t.code=="string"&&typeof t.message=="string"?{code:t.code,message:t.message,details:t.details&&typeof t.details=="object"?t.details:{}}:n?.name==="AbortError"||n?.name==="RemoteInvocationCancelled"?{code:"cancelled",message:n instanceof Error?n.message:"Harness request was cancelled",details:{}}:{code:"internal",message:n instanceof Error?n.message:String(n),details:{}}}function fn(n,t){return Promise.resolve().then(t).then(o=>({rpcId:n.rpcId,result:{ok:!0,value:o}}),o=>({rpcId:n.rpcId,result:{ok:!1,error:OCe(o)}}))}function m1(n,t,o,i){return{namespace:n,method:t,args:o,...i===void 0?{}:{signal:i}}}function HQ(n,t){let o=new Error(n);return o.name="UserQuestionError",o.code=t,o}function bCe(n,t){return!n||typeof n!="object"||n.sessionId!==t.sessionId||!n.answer||typeof n.answer!="object"||!Array.isArray(n.answer.answers)||n.answer.answers.length!==t.questions.length?!1:n.answer.answers.every((o,i)=>{let e=t.questions[i];if(!o||typeof o!="object"||o.id!==e.id||!Array.isArray(o.selected)||o.selected.some(r=>typeof r!="string")||new Set(o.selected).size!==o.selected.length||o.custom!==void 0&&typeof o.custom!="string")return!1;let a=o.custom?.trim();if(a!==void 0&&!a||e.multiSelect!==!0&&(a!==void 0&&o.selected.length>0||o.selected.length>1))return!1;let A=new Set(e.options?.map(r=>r.label)??[]);return o.selected.every(r=>A.has(r))})}function MCe(n){if(n?.type==="event"&&n.event&&typeof n.event=="object")return[{event:n.event}];let t=n?.type==="chunks"?n.event:null;if(!t||typeof t!="object")throw new Error("Harness returned an invalid session history record");let{data:o}=t,i=t.type,e=i==="chunkrow/tool-call-chunks"?o?.args:o?.texts;if(!o||!Array.isArray(e)||e.length===0||e.some(A=>typeof A!="string")||!Array.isArray(o.dt)||o.dt.length!==e.length-1)throw new Error("Harness returned an invalid packed session chunk");let a=t.time;return e.map((A,r)=>{r>0&&(a+=o.dt[r-1]);let s;if(i==="chunkrow/text-chunks")s={type:"text-delta",index:o.index,text:A};else if(i==="chunkrow/reasoning-chunks")s={type:"reasoning-delta",index:o.index,text:A};else if(i==="chunkrow/tool-call-chunks")s={type:"tool-call-delta",index:o.index,id:o.id,...Object.hasOwn(o,"name")?{name:o.name}:{},argumentsDelta:A};else throw new Error(`Harness returned an unsupported packed session chunk: ${String(i)}`);return{event:{type:"assistant/chunk",seq:t.seq+r,time:a,data:{turn:o.turn,step:o.step,chunk:s}}}})}function S1(n){if(!Array.isArray(n))throw new Error("Harness returned invalid session history records");return n.flatMap(MCe)}var G_=class{#e=[];#A=null;#t=!1;#r;#l;#o;constructor(t,o){this.#r=t,this.#o=o,this.#l=()=>this.close(),t?.addEventListener("abort",this.#l,{once:!0}),t?.aborted&&this.close()}push(t){if(!this.#t)if(this.#A){let o=this.#A;this.#A=null,o({value:t,done:!1})}else this.#e.push(t)}next(){return this.#e.length>0?Promise.resolve({value:this.#e.shift(),done:!1}):this.#t?Promise.resolve({value:void 0,done:!0}):new Promise(t=>{this.#A=t})}return(){return this.close(),Promise.resolve({value:void 0,done:!0})}close(){if(!this.#t&&(this.#t=!0,this.#r?.removeEventListener("abort",this.#l),this.#o?.(),this.#o=null,this.#A)){let t=this.#A;this.#A=null,t({value:void 0,done:!0})}}[Symbol.asyncIterator](){return this}},F_=class{#e;#A;#t=new Set;#r=new Map;#l=new Map;#o=new Map;#i=[];#a=!1;constructor(t,o,i){this.#e=o,this.#A=i,this.host=Object.freeze({describe:e=>fn(e,()=>({ready:!0,transport:"typert"}))}),this.workspace=Object.freeze({list:(e,a)=>fn(e,()=>this.#p(a)),create:(e,a)=>fn(e,()=>this.#n("workspace","create",{request:e.payload},a))}),this.sessions=Object.freeze({list:(e,a)=>fn(e,()=>this.#n("session","list",{_request:e.payload},a)),create:(e,a)=>fn(e,()=>this.#n("session","create",{request:e.payload},a)),history:(e,a)=>fn(e,()=>this.#g(e.payload,a)),prompt:(e,a)=>fn(e,()=>this.#n("session","prompt",{request:{requestId:e.rpcId,...e.payload}},a)),cancel:(e,a)=>fn(e,()=>this.#n("session","cancel",{request:{sessionId:e.payload.sessionId}},a)),models:(e,a)=>fn(e,()=>this.#h(e.payload.sessionId,a)),selectModel:(e,a)=>fn(e,()=>this.#n("session","selectModel",{request:e.payload},a))}),this.llm=Object.freeze({models:(e,a)=>fn(e,async()=>{let A=await this.#d(a);return{groups:A.groups,failures:A.failures}})}),this.events=Object.freeze({mux:(e,a)=>this.#C(a)}),this.respond=e=>Promise.resolve(this.#m(e)),typeof t?.on=="function"&&(this.#i.push(t.on("session/event",(e,a)=>{let A=e?.id;typeof A!="string"||!a||typeof a!="object"||(Number.isSafeInteger(a.seq)&&this.#I(A,a.seq),this.#u({type:"session/event",sessionId:A,event:a}))},{global:!0})),this.#i.push(t.on("approval/request",(e,a)=>this.#y(e,a),{global:!0,prepend:!0})),this.#i.push(t.on("user-questions/request",(e,a)=>this.#Q(e,a),{global:!0,prepend:!0})))}async#n(t,o,i,e){return this.#e.invoke(m1(t,o,i,e))}async#s(t,o,i,e){let a=new AbortController,A=e?AbortSignal.any([e,a.signal]):a.signal,r;try{r=(await this.#e.stream(m1(t,o,i,A)))[Symbol.asyncIterator]();let g=await r.next();if(g.done)throw new Error(`Harness ${t}.${o} stream ended before its baseline`);return g.value}finally{a.abort(new DOMException("Baseline received","AbortError")),await Promise.resolve(r?.return?.()).catch(()=>{})}}async#p(t){let o=await this.#s("workspace","follow",{},t);if(o?.type!=="baseline"||!o.value||typeof o.value!="object")throw new Error("Harness workspace.follow returned no baseline");return o.value}async#c(t,o,i){let e=await this.#s("session","follow",{request:{address:{kind:"session",sessionId:t},maxMessages:o}},i);if(e?.type!=="snapshot"||!Number.isSafeInteger(e.cursor))throw new Error("Harness session.follow returned no snapshot");return this.#I(t,e.cursor),e}async#g(t,o){let{sessionId:i,maxMessages:e=50,beforeSeq:a}=t,A=this.#o.get(i);if(A===void 0){let s=await this.#c(i,e,o);if(A=this.#o.get(i)??s.cursor,a===void 0&&A===s.cursor)return{events:S1(s.records),hasMore:s.hasMore===!0,...s.projections===void 0?{}:{projections:s.projections}}}let r=await this.#n("session","page",{request:{address:{kind:"session",sessionId:i},throughSeq:A,maxMessages:e,...a===void 0?{}:{beforeSeq:a}}},o);return{events:S1(r.records),hasMore:r.hasMore===!0}}#I(t,o){let i=this.#o.get(t);(i===void 0||o>i)&&this.#o.set(t,o)}#d(t){return this.#n("session","modelCatalog",{},t)}async#h(t,o){let[i,e]=await Promise.all([this.#d(o),this.#n("session","list",{_request:{}},o)]),a=e?.items?.find(s=>s?.sessionId===t);if(!a){let s=new Error(`session "${t}" not found`);throw s.failure={code:"session-not-found",message:s.message,details:{sessionId:t}},s}let A=a.projections?.values?.modelSelection,r=A?.next??A?.lastUsed??i.default;return{current:r,routable:i.routableProviders.includes(r.provider),groups:i.groups,failures:i.failures}}#C(t){let o;o=new G_(t,()=>this.#t.delete(o)),this.#t.add(o);for(let i of this.#r.values())o.push(this.#f(i));for(let i of this.#l.values())o.push(this.#S(i));return o}#u(t,o=P_()){let i={rpcId:o,payload:t};for(let e of this.#t)e.push(i)}#B(t){let o=t?.session?.id??t?.id;return typeof o!="string"||!t?.session||!Array.isArray(t.session.events)?null:d1(this.#A,o,t.session.events)?{sessionId:o,session:t.session}:null}#f(t){return{rpcId:t.rpcId,payload:{type:"question/requested",sessionId:t.sessionId,questions:t.questions}}}#Q(t,o){let i=this.#B(t?.agent);return i?t.signal?.aborted?Promise.reject(HQ("ask_user_question was aborted before the user answered","ASK_ABORTED")):new Promise((e,a)=>{let A={rpcId:P_(),sessionId:i.sessionId,questions:t.questions,signal:t.signal,settle:(s,g)=>{this.#r.delete(A.rpcId)&&(t.signal?.removeEventListener("abort",r),this.#u({type:"question/resolved",sessionId:A.sessionId,questionRpcId:A.rpcId,outcome:s}),s==="answered"?e(g):a(g))}},r=()=>A.settle("cancelled",HQ("ask_user_question was aborted before the user answered","ASK_ABORTED"));this.#r.set(A.rpcId,A),t.signal?.addEventListener("abort",r,{once:!0}),this.#u(this.#f(A).payload,A.rpcId)}):o()}#S(t){return{rpcId:t.rpcId,payload:{type:"approval/requested",sessionId:t.sessionId,approvalId:t.approvalId,toolName:t.toolName,...t.callId===void 0?{}:{callId:t.callId},...t.reason===void 0?{}:{reason:t.reason}}}}#y(t,o){let i=this.#B(t?.agent);if(!i)return o();if(t.signal?.aborted)return Promise.resolve("cancelled");let e=new Set([...this.#l.values()].map(r=>r.approvalId)),a=new Set,A;for(let r=i.session.events.length-1;r>=0;r-=1){let s=i.session.events[r];if(s.type==="approval/decided")a.add(s.data?.id);else if(s.type==="approval/asked"){let g=s.data?.id;if(!g||a.has(g)||e.has(g)||(t.callId??null)!==(s.data?.callId??null))continue;A=g;break}}return A===void 0?o():new Promise(r=>{let s={rpcId:P_(),sessionId:i.sessionId,approvalId:A,toolName:t.toolName,callId:t.callId,reason:t.reason,settle:c=>{this.#l.delete(s.rpcId)&&(t.signal?.removeEventListener("abort",g),this.#u({type:"approval/resolved",sessionId:s.sessionId,approvalId:s.approvalId,outcome:c}),r(c))}},g=()=>s.settle("cancelled");this.#l.set(s.rpcId,s),t.signal?.addEventListener("abort",g,{once:!0}),this.#u(this.#S(s).payload,s.rpcId)})}#m(t){let o=this.#l.get(t?.rpcId);if(o){let a=t?.result?.value;return t?.result?.ok!==!0||!a||typeof a!="object"||a.sessionId!==o.sessionId||a.approvalId!==o.approvalId||a.outcome!=="allowed-once"&&a.outcome!=="rejected"?{accepted:!1,reason:"bad-response"}:(o.settle(a.outcome),{accepted:!0})}let i=this.#r.get(t?.rpcId);if(!i)return{accepted:!1,reason:"not-pending"};if(t?.result?.ok!==!0)return t?.result?.error?.code!=="cancelled"?{accepted:!1,reason:"bad-response"}:(i.settle("cancelled",HQ("the user cancelled ask_user_question","ASK_CANCELLED")),{accepted:!0});if(!bCe(t.result.value,i))return{accepted:!1,reason:"bad-response"};let e={answers:t.result.value.answer.answers.map(a=>({id:a.id,selected:[...a.selected],...a.custom===void 0?{}:{custom:a.custom}}))};return i.settle("answered",e),{accepted:!0}}dispose(){if(!this.#a){this.#a=!0;for(let t of[...this.#t])t.close();for(let t of[...this.#l.values()])t.settle("cancelled");for(let t of[...this.#r.values()])t.settle("cancelled",HQ("dsh-im interaction adapter was disposed","ASK_ABORTED"));for(let t of this.#i.splice(0).reverse())t?.()}}};function w1(n){let t=n?.root??n;if(!t||!["object","function"].includes(typeof t))throw new TypeError("dsh-im requires a Cordis Host context");let o=UQ.get(t);if(o)return o;let i=n?.typertGateway;if(!i||typeof i.invoke!="function"||typeof i.stream!="function")throw new TypeError("dsh-im requires the modern Host Typert gateway");let e=new F_(n,i,t);return UQ.set(t,e),typeof n.effect=="function"&&n.effect(()=>()=>{UQ.get(t)===e&&UQ.delete(t),e.dispose()},"dsh-im: modern Harness compatibility API"),e}function _Ce(n,t){return n&&Object.hasOwn(n,t)?n[t]:typeof n?.get=="function"?n.get(t):void 0}function aa(n,t={}){return t.harnessBaseUrl!==void 0?{baseUrl:new URL(t.harnessBaseUrl)}:{apiProxy:_Ce(n,"apiProxy")??w1(n),interactionScope:n.root??n}}import{randomUUID as TCe}from"node:crypto";function NCe(n){if(typeof n?.get!="function")return;let t;try{t=n.get("agents")}catch{return}if(t!=null){if(typeof t.get!="function")throw new TypeError('dsh-im requires a callable AgentRegistry when ctx.get("agents") is present');return t}}function RCe(n,t,o){if(n?.status!=="running")return!1;let i=n?.session?.events;if(!Array.isArray(i))return!1;let e=null,a=!1;for(let A of i){if(A?.type==="turn/start"){e=A.data?.turn??null,a=!1;continue}if(A?.type==="turn/end"&&A.data?.turn===e){e=null,a=!1;continue}e===t&&A?.type==="user/message"&&A.data?.source?.rpcId===o&&(a=!0)}return e===t&&a}function D1(n){if(!n||typeof n!="object"||Object.isFrozen(n))return n;for(let t of Object.values(n))D1(t);return Object.freeze(n)}function kCe(n){return D1({id:TCe(),role:"user",content:[{type:"text",text:n}],source:{kind:"user"}})}function vCe(n){let t=new Error("Session is busy with an active turn or maintenance task",{cause:n});return t.code="agent-busy",t}function PCe(n){return({sessionId:t,expectedTurn:o,promptRpcId:i,action:e,text:a})=>{let A=n.get(t);if(A){if(!RCe(A,o,i))return!1;if(e==="stop")return A.cancel({kind:"user"},{keepInbox:!0}),!0;if(e==="steer")return typeof a!="string"||!a.trim()?!1:(A.inject(kCe(a)),!0);throw new TypeError(`Unsupported Harness control action: ${String(e)}`)}}}function GCe(n){return({sessionId:t,operation:o})=>{if(typeof o!="function")throw new TypeError("maintenance operation is required");let i=n.get(t);if(!i)return o();try{return i.runMaintenance(e=>{if(n.get(t)!==i){let a=new Error("Session agent changed before maintenance started");throw a.code="agent-unavailable",a}return o(e)})}catch(e){throw vCe(e)}}}function FCe(n){return({sessionId:t,workspace:o,files:i,signal:e})=>{let A=n.get(t)?.session?.header?.cwd,r=typeof A=="string"&&A?A:o;if(typeof r!="string"||!r)throw new Ro("inbound-file-workspace-unavailable","The Harness Session workspace is unavailable for inbound files.");return TY({files:i},{workspace:r,signal:e})}}function Ja(n,t={}){let{controlExecutor:o,sessionMaintenanceExecutor:i,fileIngressExecutor:e}=t;if(o!==void 0&&typeof o!="function")throw new TypeError("controlExecutor must be a function");if(i!==void 0&&typeof i!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("fileIngressExecutor must be a function");let a=o&&i&&e?void 0:NCe(n);return{controlExecutor:o??(a?PCe(a):void 0),sessionMaintenanceExecutor:i??(a?GCe(a):void 0),fileIngressExecutor:e??FCe(a??{get:()=>{}})}}function O1(n){return n.map(t=>({id:t,canExecuteCommands:!0}))}function pg(n=[]){return bQ({mode:"open",open:{defaultCanExecuteCommands:!0,commandPermissionOverrides:[]},allowlist:{users:O1(n)}})}function dc(n=[]){return bQ({mode:"allowlist",open:{defaultCanExecuteCommands:!1,commandPermissionOverrides:[]},allowlist:{users:O1(n)}})}function dg(n){return[...new Set((Array.isArray(n)?n:[n]).filter(t=>typeof t=="string"||typeof t=="number"||typeof t=="bigint").map(t=>String(t).trim()).filter(Boolean))]}function LCe(n){return dg(n).map(t=>`${t.replace(/^\+/,"")}@s.whatsapp.net`)}function nr(n,t={}){let o=String(n??"").trim().toLowerCase();if(o==="weixin")return Ig({direct:dc(),group:dc()});if(o==="feishu"){let e=dg(t.ownerOpenIds??t.ownerOpenId).includes("*")?pg():dc();return Ig({direct:e,group:e})}if(o==="qq"){let i=dg(t.ownerUserOpenid);return Ig({direct:i.includes("*")?pg():dc(),group:pg()})}if(o==="telegram"){let i=dg(t.allowedUsers);return(t.accessMode??"compatible")==="private-allowlist"?Ig({direct:dc(i),group:dc()}):Ig({direct:pg(i),group:pg()})}if(o==="whatsapp"){let i=t.accessMode??"self-only",e=LCe(t.allowedNumbers);return i==="open"?Ig({direct:pg(e),group:pg()}):Ig({direct:dc(i==="private-allowlist"?e:[]),group:dc()})}if(["dingtalk","wecom","slack","discord"].includes(o))return Ig({direct:pg(),group:pg()});throw new TypeError(`Unsupported access-policy channel: ${n}`)}function UCe(n,t={}){let o=String(n??"").trim().toLowerCase();if(o==="weixin")return dg(t.ownerUserId);if(o==="feishu")return dg(t.ownerOpenIds??t.ownerOpenId).filter(i=>i!=="*");if(o==="dingtalk"){let i=Array.isArray(t.approvedSenders)?t.approvedSenders:[];return dg(i.map(e=>e?.staffId))}return o==="qq"?dg(t.ownerUserOpenid).filter(i=>i!=="*"):o==="whatsapp"?dg(t.accountJid):[]}function qa(n,t,{channel:o,config:i,equals:e}={}){if(!n||typeof n.accessPolicyFor!="function")throw new TypeError("A workspace store with access policies is required");let a=new Set(UCe(o,i)),A=typeof e=="function"?e:(r,s)=>r===s;return Object.freeze({botId:t,getSettings:()=>n.accessPolicyFor(t),isPrivileged(r,s){if(!["direct","group"].includes(s))return!1;let g=Array.isArray(r)?r:[r];try{return g.some(c=>typeof c=="string"&&[...a].some(I=>A(c.trim(),I)===!0))}catch{return!1}}})}function xCe(n){let t=FI(n.dshHome??process.env.DSH_HOME??XE(KCe(),".dsh")),o=FI(n.dataDir??XE(t,"integrations","dsh-dingtalk"));return{root:o,config:FI(n.configPath??XE(o,"config.json")),bots:FI(n.botsDir??XE(o,"bots")),workspaces:FI(n.workspacesPath??XE(o,"workspaces.json"))}}async function L_(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-dingtalk requires ctx.credentials");let i=aa(n,t),e=o.ConfigStore??pQ,a=o.DeviceAuth??hQ,A=o.StateStore??vQ,r=o.HarnessClient??RQ,s=o.Controller??vE,g=o.Runtime??jE,c=o.createConnectionSupervisor??v_,I=typeof n.logger=="function"?n.logger("dsh-dingtalk"):n.logger??console,d=()=>La(n),B=xCe(t),f=await new e(B.config).load(),Q=FI(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=typeof f.list=="function",_=T?f.list():[];T&&await m.reconcile(_.map(Ae=>Ae.botId)),await Promise.all(_.map(Ae=>m.ensure(Ae.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("dingtalk",Ae)})));let R=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,K=o.deviceAuth??new a({baseUrl:t.registrationBaseUrl}),L=new Map,F=Ae=>FI(B.bots,Ae,"state.json"),q=async Ae=>{let ie=L.get(Ae);return ie||(ie=await new A(F(Ae)).load(),L.set(Ae,ie)),ie},V=ja(n,o.commandExecutor),{controlExecutor:x,sessionMaintenanceExecutor:G,fileIngressExecutor:J}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),U=new r({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...V?{commandExecutor:V}:{},...x?{controlExecutor:x}:{},...G?{sessionMaintenanceExecutor:G}:{},...J?{fileIngressExecutor:J}:{}}),N=new s({deviceAuth:K,credentials:n.credentials,configStore:R,logger:I,createRuntime:async({botId:Ae,config:ie,clientSecret:we})=>{let se=await q(Ae);await m.ensure(Ae,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("dingtalk",ie)});let Te=Ka(U,{botId:Ae,workspaces:m,state:se,agentPresetCatalog:d});return new g({config:ie,clientSecret:we,harness:Te.harness,state:Te.state,contextEnhancement:{botId:Ae,getSettings:()=>m.contextEnhancementFor(Ae)},accessPolicy:qa(m,Ae,{channel:"dingtalk",config:ie}),replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??4e3,connectTimeoutMs:t.connectTimeoutMs??15e3,logger:{error:(...fe)=>I.error?.(`[${Ae}]`,...fe),warn:(...fe)=>I.warn?.(`[${Ae}]`,...fe),info:(...fe)=>I.info?.(`[${Ae}]`,...fe),debug:(...fe)=>I.debug?.(`[${Ae}]`,...fe)}})},deleteState:async({botId:Ae})=>{let ie=L.get(Ae);if(L.delete(Ae),ie&&typeof ie.remove=="function")await ie.remove();else try{await HCe(F(Ae))}catch(we){if(we?.code!=="ENOENT")throw we}}}),k=xa(N,{workspaces:m,stateFor:q,agentPresetCatalog:d}),z=c({controller:k,harness:U,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:k,deliveryAdapter:Ya({channel:"dingtalk",workspaces:m,coreController:N,stateFor:q}),ready:z.ready,async close(){await z.close(),await k.close(),U.stopManagedProcess()}}}import qCe from"qrcode";var ki="bot.context-enhancement.set";function za(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"config")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(kI(n.config),!0)}catch{return!1}}var Va="bot.access-policy.set";function Wa(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"policy")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(Ic(n.policy),!0)}catch{return!1}}var YCe=new Set(["loopback","trusted-host"]);function fr(n){if(n===void 0)return"loopback";if(YCe.has(n))return n;throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"')}import{isAbsolute as jCe}from"node:path";var vi="bot.workspace.set";function Za(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.keys(n).every(t=>["botId","workspace"].includes(t))&&typeof n.botId=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)&&typeof n.workspace=="string"&&n.workspace.length<=4096&&jCe(n.workspace.trim())}function Xa(n){return["workspace-not-absolute","workspace-not-found","workspace-not-directory","workspace-bot-not-found","agent-preset-invalid","agent-preset-unavailable","context-enhancement-invalid"].includes(n?.code)?{code:n.code,message:n.message}:null}var Pi="bot.preset.set";function JCe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function $a(n){return JCe(n)&&Object.keys(n).every(t=>["botId","agentPreset"].includes(t))&&typeof n.botId=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)&&(n.agentPreset===null||typeof n.agentPreset=="string"&&c_.test(n.agentPreset))}var M1="/dingtalk",Gt=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va,approveSender:"bot.sender.approve",revokeSender:"bot.sender.revoke"}),_1=Object.freeze(Object.values(Gt)),zCe=new Set(["clientSecret","client_secret","deviceCode","device_code","secretRef","staffId","senderStaffId","verificationUrl","verificationUri","userCode"]);function H_(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function hc(n,t){return H_(n)&&Object.keys(n).every(o=>t.includes(o))}function LI(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function b1(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function VCe(n,t){return H_(t)?n===Gt.status?hc(t,[])?null:"connection.status does not accept fields.":n===Gt.beginProvisioning?hc(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Gt.pollProvisioning,Gt.cancelProvisioning].includes(n)?hc(t,["attemptId"])&&LI(t.attemptId)?null:`${n} requires an attemptId.`:n===Gt.bindCredentials?hc(t,["clientId","clientSecret"])&&b1(t.clientId,256)&&b1(t.clientSecret,1024)?null:"bot.bind-credentials requires Client ID and Client Secret.":n===Gt.reconnectBot?hc(t,["botId","sendTest"])&&LI(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Gt.deleteBot?hc(t,["botId","confirm"])&&LI(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Gt.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Gt.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Gt.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Gt.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Gt.approveSender?hc(t,["botId","requestId","confirm"])&&LI(t.botId)&&LI(t.requestId)&&t.confirm===!0?null:"bot.sender.approve requires botId, requestId, and confirm=true.":n===Gt.revokeSender?hc(t,["botId","senderKey","confirm"])&&LI(t.botId)&&LI(t.senderKey)&&t.confirm===!0?null:"bot.sender.revoke requires botId, senderKey, and confirm=true.":"Unknown DingTalk endpoint.":"Payload must be an object."}function KQ(n){return{ok:!1,error:{code:"bad-request",message:n}}}function $E(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function WCe(){return{ok:!1,error:{code:"dingtalk-operation-failed",message:"\u9489\u9489\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}function Up(n){if(Array.isArray(n))return n.map(Up);if(!H_(n))return n;let t={};for(let[o,i]of Object.entries(n))zCe.has(o)||(t[o]=Up(i));return t}async function ZCe(n){return qCe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function U_(n,t){return!n||typeof n.verificationUrl!="string"?Up(n):Up({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function is(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await U_(o.provisioning,t)),Up(o)}function XCe(n){for(let t of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot","approveSender","revokeSender"])if(typeof n?.[t]!="function")throw new TypeError(`A complete DingTalk controller is required (${t})`)}function T1(n,{encodeQr:t=ZCe}={}){XCe(n);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return $E();if(!_1.includes(e))return KQ("Unknown DingTalk endpoint.");let r=VCe(e,a);if(r)return KQ(r);try{let s;if(e===Gt.status)s=await is(await n.status(),i);else if(e===Gt.beginProvisioning){let g=await n.startProvisioning({signal:A});if(A?.aborted)return await n.cancelProvisioning(g.attemptId),$E();s=await U_(g,i)}else if(e===Gt.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return KQ("The provisioning attempt no longer exists.");s=await U_(g,i)}else if(e===Gt.cancelProvisioning){if(s=await n.cancelProvisioning(a.attemptId),!s)return KQ("The provisioning attempt no longer exists.");s=Up(s)}else if(e===Gt.bindCredentials)s=await is(await n.bindCredentials(a),i);else if(e===Gt.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return $E();let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("\u9489\u9489\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=or()}catch(d){c=or(d)}s=await is({...g,...c?{testMessage:c}:{}},i)}else if(e===Gt.deleteBot)s=await is(await n.deleteBot(a.botId),i);else if(e===Gt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await is(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===Gt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>is(g,i))}else if(e===Gt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>is(g,i))}else if(e===Gt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await is(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else e===Gt.approveSender?s=await is(await n.approveSender(a.botId,a.requestId),i):s=await is(await n.revokeSender(a.botId,a.senderKey),i);return A?.aborted?$E():{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?$E():g?{ok:!1,error:g}:WCe()}}}function xQ(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(M1,T1(t,o),{authority:fr(i)})}async function N1(n,t={}){if(t?.controller)return xQ(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await L_(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=xQ(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-dingtalk: close bot connections"),e}import{createHash as $Ce}from"node:crypto";import{mkdir as eue,readFile as Aue,rename as tue,unlink as rue,writeFile as aue}from"node:fs/promises";import{dirname as iue}from"node:path";var K_=Object.freeze({version:1,bots:Object.freeze([])});function hg(n){return typeof n=="string"&&n.trim()?n.trim():null}function R1(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eC(n,{botPrefix:t,tokenRefPrefix:o}){let i=hg(n);if(!i)throw new TypeError("platformId is required");let e=$Ce("sha256").update(i).digest("hex").slice(0,24);return{botId:`${t}_${e}`,tokenRef:`${o}_${e.toUpperCase()}`}}function YQ(n,t){let o=hg(n)??"";return o.length<=10?o?`${o.slice(0,3)}\u2022\u2022\u2022`:t:`${o.slice(0,6)}\u2022\u2022\u2022\u2022${o.slice(-4)}`}var Hp=class{#e;#A;#t;#r;#l;#o;#i;#a=K_;#n=Promise.resolve();constructor(t,{channel:o,botPrefix:i,tokenRefPrefix:e,normalizeBotExtension:a=()=>({})}){if(typeof a!="function")throw new TypeError("normalizeBotExtension must be a function");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=new RegExp(`^${R1(i)}_[a-f0-9]{24}$`),this.#i=new RegExp(`^${R1(e)}_[A-F0-9]{24}$`)}async load(){try{let t=this.#p(JSON.parse(await Aue(this.#e,"utf8")));if(!t)throw new Error(`dsh-im ${this.#A} config contains invalid bot data`);this.#a=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#a=K_}return this}list(){return structuredClone(this.#a.bots)}get(t){let o=this.#a.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByPlatformId(t){let o=this.#a.bots.find(i=>i.platformId===t);return o?structuredClone(o):null}async save(t){let o=this.#s(t);if(!o)throw new Error(`Refusing to persist incomplete ${this.#A} bot data`);return this.#c(i=>{let e=i.find(r=>r.platformId===o.platformId&&r.botId!==o.botId),a=i.find(r=>r.tokenRef===o.tokenRef&&r.botId!==o.botId);if(e||a)throw new Error(`Duplicate ${this.#A} bot identity`);let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!this.#o.test(t))throw new TypeError(`Invalid ${this.#A} bot id`);return this.#c(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#n.then(async()=>{try{await rue(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#a=K_});this.#n=t.then(()=>{},()=>{}),await t}#s(t){if(!t||typeof t!="object")return null;let o=hg(t.platformId),i=hg(t.botId),e=hg(t.tokenRef),a=hg(t.name);if(!o||!i||!e||!a||!this.#o.test(i)||!this.#i.test(e))return null;let A=eC(o,{botPrefix:this.#t,tokenRefPrefix:this.#r});if(A.botId!==i||A.tokenRef!==e)return null;let r=this.#l(t);return!r||typeof r!="object"||Array.isArray(r)?null:Object.freeze({botId:i,platformId:o,tokenRef:e,name:a,username:hg(t.username),createdAt:hg(t.createdAt)??new Date().toISOString(),connectedAt:hg(t.connectedAt),...r})}#p(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#s(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.platformId)||a.has(A.tokenRef))return null;i.add(A.botId),e.add(A.platformId),a.add(A.tokenRef)}return Object.freeze({version:1,bots:Object.freeze(o)})}async#c(t){let o,i=this.#n.then(async()=>{let e=[...this.#a.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#g(a),this.#a=a});return this.#n=i.then(()=>{},()=>{}),await i,o}async#g(t){await eue(iue(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await aue(o,`${JSON.stringify(t,null,2)} -`,{encoding:"utf8",mode:384}),await tue(o,this.#e)}};var k1=Object.freeze({botPrefix:"discord",tokenRefPrefix:"DSH_DISCORD_BOT_TOKEN"});function v1(n){return eC(n,k1)}function P1(n){return YQ(n,w("Discord\u673A\u5668\u4EBA"))}var jQ=class extends Hp{constructor(t){super(t,{channel:"Discord",...k1})}};function AC(n){return typeof n=="string"&&n.trim()?n.trim():null}function tC(n,t){return Object.freeze({code:n,message:t})}var Kp=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s=new Map;#p=new Map;#c=new Map;#g=0;#I=!1;constructor({descriptor:t,credentials:o,configStore:i,inspectToken:e,deriveIdentity:a,maskPlatformId:A,createRuntime:r,deleteState:s=async()=>{},logger:g=console}){if(!t?.key||!t?.label||!t?.connectionLabel)throw new TypeError("TokenBotController requires a channel descriptor");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError(`${t.label} requires the DSH credential provider`);if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError(`${t.label} requires a config store`);if(typeof e!="function"||typeof a!="function"||typeof A!="function"||typeof r!="function")throw new TypeError(`${t.label} controller dependencies are incomplete`);this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g}async initialize(){if(this.#I)return this.status();for(let t of this.#t.list())await this.#B(t.botId,async()=>{if(this.#I||this.#s.get(t.botId)?.status?.ready)return;let o=await this.#C(t.tokenRef);if(!o){this.#p.set(t.botId,tC("missing-token",w("{label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002",{label:this.#e.label})));return}try{await this.#d(t,o),this.#p.delete(t.botId)}catch(i){this.#p.set(t.botId,tC("connection-failed",w("{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002",{label:this.#e.label}))),this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${t.botId} failed to initialize:`,i)}finally{this.#f()}});return this.status()}async bindCredentials({token:t}={}){if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let o=AC(t);if(!o)throw new TypeError(`${this.#e.label} Bot Token is required`);let i=await this.#r(o),e=AC(i?.platformId),a=AC(i?.name);if(!e||!a)throw new Error(`${this.#e.label} returned an invalid bot identity`);let A=this.#l(e);return await this.#B(A.botId,async()=>{if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let r=this.#t.getByPlatformId(e),s=await this.#A.resolve(A.tokenRef).catch(()=>{}),g={botId:A.botId,platformId:e,tokenRef:A.tokenRef,name:a,username:AC(i.username),createdAt:r?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(A.tokenRef,o);try{await this.#t.save(g)}catch(c){throw await this.#u(A.tokenRef,s),c}try{await this.#d(g,o),this.#p.delete(A.botId)}catch(c){this.#p.set(A.botId,tC("connection-failed",w("{label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002",{label:this.#e.label}))),this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${A.botId} credential connection failed:`,c)}this.#f()}),this.status()}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return await this.#B(t,async()=>{let i=await this.#C(o.tokenRef);if(!i)throw new Error(`${this.#e.label} bot token is missing`);try{await this.#d(o,i),this.#p.delete(t)}catch(e){throw this.#p.set(t,tC("connection-failed",w("{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{label:this.#e.label}))),e}finally{this.#f()}}),this.status()}async updateBotConfig(t,o){if(this.#I)throw new Error(`${this.#e.label} controller is closed`);if(typeof o!="function")throw new TypeError("Bot config update must be a function");return await this.#B(t,async()=>{if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let i=this.#t.get(t);if(!i)throw new Error(`Unknown ${this.#e.label} bot`);let e=await this.#C(i.tokenRef);if(!e)throw new Error(`${this.#e.label} bot token is missing`);if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let a=o(i),A=await this.#t.save(a);try{await this.#d(A,e),this.#p.delete(t)}catch(r){throw this.#p.set(t,tC("connection-failed",w("{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{label:this.#e.label}))),r}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return this.#B(t,async()=>{let i=this.#s.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let a=new Error(w("{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",{label:this.#e.label}));throw a.code="test-target-unavailable",a}let e=w("{name}\uFF08{id}\uFF09",{name:o.name,id:this.#o(o.platformId)});return await i.sendConnectionTest(Ra(e,w("{label}\u673A\u5668\u4EBA",{label:this.#e.label}))),{sent:!0}})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error(`Unknown ${this.#e.label} bot`);return this.#B(t,async()=>{let A=this.#s.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",{label:this.#e.label}));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return await this.#B(t,async()=>{let i=await this.#A.resolve(o.tokenRef).catch(()=>{});await this.#h(t);try{await this.#A.unset(o.tokenRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.tokenRef,i.value).catch(()=>{}),await this.#d(o,i.value).catch(()=>{})),new Error(`Unable to remove the ${this.#e.label} bot safely.`,{cause:e})}await this.#a({botId:t,config:o}).catch(e=>{this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${t} state cleanup failed:`,e)}),this.#p.delete(t),this.#f()}),this.status()}status(){let t=this.#t.list().map(i=>{let e=this.#s.get(i.botId)?.status??null,a=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=a?"connected":e?.connectionState==="connecting"?"connecting":this.#p.has(i.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:i.botId,state:A,connected:a,configured:!0,bot:{name:i.name,username:i.username,idMasked:this.#o(i.platformId)},health:{status:a?"healthy":A==="error"?"error":"offline",summary:a?w("{label}{connectionLabel}\u8FD0\u884C\u6B63\u5E38",{label:this.#e.label,connectionLabel:w(this.#e.connectionLabel)}):A==="error"?w("{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5",{label:this.#e.label}):w("{label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF",{label:this.#e.label}),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:Xr(e?.lastMessageError),error:structuredClone(this.#p.get(i.botId)??null)}}),o=t.filter(i=>i.connected).length;return{schemaVersion:1,revision:this.#g,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#I||(this.#I=!0,await Promise.allSettled([...this.#c.values()]),await Promise.allSettled([...this.#s.keys()].map(t=>this.#h(t))))}async#d(t,o){if(this.#I)throw new Error(`${this.#e.label} controller is closed`);if(await this.#h(t.botId),this.#I)throw new Error(`${this.#e.label} controller is closed`);let i=await this.#i({botId:t.botId,config:t,token:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError(`createRuntime returned an invalid ${this.#e.label} runtime`);this.#s.set(t.botId,i);try{await i.start()}catch(e){throw await i.stop().catch(()=>{}),this.#s.delete(t.botId),e}}async#h(t){let o=this.#s.get(t);this.#s.delete(t),await o?.stop().catch(i=>{this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${t} failed to stop cleanly:`,i)})}async#C(t){let o=await this.#A.resolve(t).catch(()=>{});return AC(o?.value)}async#u(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#B(t,o){let a=(this.#c.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#c.get(t)===a&&this.#c.delete(t)});return this.#c.set(t,a),a}#f(){this.#g+=1}};import{createHash as oue}from"node:crypto";var nue="https://discord.com/api/v10/",sue=12e4,gue=new Set([50001,50013]),cue=new Set([40005]);function os(n){return typeof n=="string"&&n.trim()?n.trim():null}function G1(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function x_(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function Iue(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function L1(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function lue(n){let t=Number(n?.providerCode),o=Number(n?.status),i=os(n?.message)??"",e="artifact-provider-rejected",a="Discord rejected the attachment.";o===401||o===403||gue.has(t)?(e="artifact-permission-required",a="Discord denied permission to send the attachment."):o===413||cue.has(t)||/(?:request|attachment|file).{0,24}too large/i.test(i)?(e="artifact-too-large",a="The attachment exceeds Discord's size limit."):o===429?(e="artifact-rate-limited",a="Discord rate-limited attachment delivery."):o>=500&&(e="artifact-delivery-uncertain",a="Discord attachment delivery result is uncertain.");let A=new Error(a,{cause:n});return A.code=e,L1(A,n)}function pue(n){let t=new Error("Discord attachment delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",L1(t,n)}function due(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function ei(n,t){let o=os(n);if(!o||!/^\d{5,30}$/.test(o))throw new TypeError(`Invalid Discord ${t}`);return o}function F1(n){let t=os(n);if(!t)throw new TypeError("A Discord reaction emoji is required");return t}function hue(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{20,}$/.test(n.trim())}var rC=class{#e;#A;#t;#r;constructor({token:t,fetchImpl:o=fetch,baseUrl:i=nue,fileUploadTimeoutMs:e=sue}){if(!hue(t))throw new TypeError("Discord Bot Token is invalid");if(typeof o!="function")throw new TypeError("DiscordApi requires fetch");this.#e=t.trim(),this.#A=o,this.#t=new URL(i),this.#r=Iue(e,"fileUploadTimeoutMs")}getCurrentUser(t={}){return this.#l("users/@me",{...t,method:"GET"})}getGatewayBot(t={}){return this.#l("gateway/bot",{...t,method:"GET"})}getChannel({channelId:t,signal:o}={}){return this.#l(`channels/${ei(t,"channel id")}`,{method:"GET",signal:o})}startThreadFromMessage({channelId:t,messageId:o,name:i,signal:e}={}){let a=os(i);if(!a||[...a].length>100)throw new TypeError("Discord thread name must contain 1-100 characters");if(e?.aborted)throw x_(e);return this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}/threads`,{method:"POST",signal:e,body:{name:a}})}createMessage({channelId:t,content:o,replyToMessageId:i,signal:e}){return this.#l(`channels/${ei(t,"channel id")}/messages`,{method:"POST",signal:e,body:{content:o,allowed_mentions:{parse:[],replied_user:!1},...i?{message_reference:{message_id:ei(i,"message id"),channel_id:ei(t,"channel id"),fail_if_not_exists:!1}}:{}}})}async createFileMessage({channelId:t,file:o,replyToMessageId:i,signal:e}){if(!o||typeof o!="object"||typeof o.fileName!="string"||!o.fileName||!Buffer.isBuffer(o.bytes))throw new TypeError("A Discord attachment is required");let a=os(o.deliveryKey)??os(o.artifactId),A=a?oue("sha256").update(a).digest("hex").slice(0,25):void 0,r=new FormData;r.append("payload_json",JSON.stringify({allowed_mentions:{parse:[],replied_user:!1},attachments:[{id:0,filename:o.fileName}],...A?{nonce:A,enforce_nonce:!0}:{},...i?{message_reference:{message_id:ei(i,"message id"),channel_id:ei(t,"channel id"),fail_if_not_exists:!1}}:{}})),r.append("files[0]",new Blob([o.bytes],{type:o.mediaType??"application/octet-stream"}),o.fileName);let s=ei(t,"channel id");if(e?.aborted)throw x_(e);let g=G1(e,this.#r);try{return await this.#l(`channels/${s}/messages`,{method:"POST",signal:g,timeoutMs:this.#r,body:r,multipart:!0})}catch(c){throw e?.aborted?x_(e):c?.code?.startsWith?.("discord-")?lue(c):pue(c)}}editMessage({channelId:t,messageId:o,content:i,signal:e}){return this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}`,{method:"PATCH",signal:e,body:{content:i,allowed_mentions:{parse:[],replied_user:!1}}})}sendTyping({channelId:t,signal:o}){return this.#l(`channels/${ei(t,"channel id")}/typing`,{method:"POST",signal:o,expectBody:!1})}async addOwnReaction({channelId:t,messageId:o,emoji:i,signal:e}={}){let a=F1(i);return await this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}/reactions/${encodeURIComponent(a)}/@me`,{method:"PUT",signal:e,expectBody:!1,retry:!1}),a}removeOwnReaction({channelId:t,messageId:o,emoji:i,signal:e}={}){let a=F1(i);return this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}/reactions/${encodeURIComponent(a)}/@me`,{method:"DELETE",signal:e,expectBody:!1,retry:!1})}async#l(t,{method:o,body:i,signal:e,timeoutMs:a=15e3,expectBody:A=!0,retry:r=!0,multipart:s=!1}){let g;try{g=await this.#A(new URL(t,this.#t),{method:o,headers:{authorization:`Bot ${this.#e}`,...s?{}:{"content-type":"application/json"},"user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 1.1.0)"},...i===void 0?{}:{body:s?i:JSON.stringify(i)},signal:G1(e,a),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Discord ${o} transport failed`)}let c=null;if(A||g.status===429||!g.ok)try{c=await g.json()}catch{if(A){let I=new Error(`Discord ${o} returned invalid JSON`);throw I.status=g?.status,I}}if(g.status===429&&r){let I=Math.min(1e4,Math.max(50,Number(c?.retry_after)*1e3||1e3));return await due(I,e),this.#l(t,{method:o,body:i,signal:e,timeoutMs:a,expectBody:A,retry:!1,multipart:s})}if(!g.ok){let I=new Error(os(c?.message)??`Discord API failed with HTTP ${g.status}`);I.code=`discord-${g.status}`,I.status=g.status,(Number.isInteger(c?.code)||typeof c?.code=="string")&&(I.providerCode=c.code);let d=Number(c?.retry_after);throw Number.isFinite(d)&&d>=0&&(I.retry_after=d,I.retryAfter=d),I}return A?c:null}};async function U1(n,t={}){let i=await new rC({token:n,...t}).getCurrentUser();if(!i?.id||i?.bot!==!0)throw new Error("Discord token does not belong to a bot");return{platformId:String(i.id),name:os(i.global_name)??os(i.username)??w("Discord\u673A\u5668\u4EBA"),username:os(i.username)}}var Eue=Object.freeze({success(){},error(){},clear(){},settled:()=>Promise.resolve()});function H1(n,t){!n||typeof n!="object"||(n[t]=(n[t]??0)+1)}async function Cue(n,t){let o=AbortSignal.timeout(t),i,e=new Promise((a,A)=>{i=()=>A(o.reason??new DOMException("Timed out","TimeoutError")),o.addEventListener("abort",i,{once:!0})});try{return await Promise.race([n(o),e])}finally{o.removeEventListener("abort",i)}}function JQ({adapter:n,target:t,reactions:o,status:i,logger:e=console,label:a="channel",timeoutMs:A=2e3}={}){if(!t||typeof n?.addReaction!="function"||typeof n?.removeReaction!="function"||typeof o?.processing!="string"||!o.processing||!Number.isSafeInteger(A)||A<=0)return Eue;let r=null,s=!1,g=async(B,f)=>{try{let Q=await Cue(f,A);return H1(i,B==="add"?"reactionsAdded":"reactionsRemoved"),{ok:!0,value:Q}}catch(Q){return H1(i,"reactionErrors"),e.warn?.(`[dsh-im:${a}] status reaction ${B} failed:`,Q?.message??Q?.name??String(Q)),{ok:!1,value:null}}},c=async B=>{if(r!==null){let Q=r;r=null,await g("remove",y=>n.removeReaction(t,Q,{signal:y}))}if(typeof B!="string"||!B)return;let f=await g("add",Q=>n.addReaction(t,B,{signal:Q}));f.ok&&f.value!==void 0&&f.value!==null&&(r=f.value)},I=c(o.processing),d=B=>{s||(s=!0,I=I.then(()=>c(B),()=>c(B)),I.catch(()=>{}))};return Object.freeze({success:()=>d(o.success),error:()=>d(o.error),clear:()=>d(null),settled:()=>I})}var K1="\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002",uue="\u4EFB\u52A1\u5DF2\u5B8C\u6210\u3002";function Ii(n){return typeof n=="string"?n.trim():""}function Bue(n,t,o){return t.actor===o&&(n.kind!=="group"||n.addressed===!0)&&!Tt(n)&&!wt(n)&&!!Ii(n.content)}function fue(n,t,o){let i=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim().slice(0,255)||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:i});case"artifact-permission-required":return o?.key==="slack"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Slack \u5E94\u7528\u7F3A\u5C11 files:write \u6743\u9650\u3002\u8BF7\u66F4\u65B0 Manifest\u3001\u91CD\u65B0\u5B89\u88C5\u5E94\u7528\u5E76\u91CD\u65B0\u8FDE\u63A5\u673A\u5668\u4EBA\u540E\u91CD\u8BD5\u3002",{name:i}):o?.key==="discord"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11 Discord \u7684 Send Messages\u3001Attach Files \u6216 Read Message History \u6743\u9650\u3002",{name:i}):o?.key==="telegram"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Telegram \u4E0D\u5141\u8BB8\u673A\u5668\u4EBA\u5728\u5F53\u524D\u804A\u5929\u53D1\u9001\u6587\u6863\uFF0C\u8BF7\u68C0\u67E5\u804A\u5929\u6743\u9650\u3002",{name:i}):w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u6E20\u9053\u6743\u9650\u3002",{name:i});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u6E20\u9053\u5927\u5C0F\u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:i});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u672A\u53D1\u9001\u3002",{name:i});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:i});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5F53\u524D\u6E20\u9053\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:i});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:i});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:i})}}function io(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0}}var ns=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p=new Map;#c=new Map;#g=new Map;#I=new Map;#d=new Set;#h=new Set;#C;#u=new Ti;constructor({descriptor:t,bot:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,status:r=io(),logger:s=console,replyTimeoutMs:g=6e5,signal:c}){if(!t?.key||!t?.label)throw new TypeError("A channel descriptor is required");if(!o||typeof o.sendText!="function")throw new TypeError("A bot client is required");if(!i||!e)throw new TypeError("Harness client and state store are required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#C=new Di({label:t.key,logger:s})}get status(){return structuredClone(this.#i)}accept(t,{contextSnapshot:o,accessDecision:i}={}){if(this.#s?.aborted)return Promise.resolve();let e=Ii(t?.conversationId),a=t?.kind==="group"?"group":"direct",A={...t,kind:a,conversationId:e},r=Ii(A.messageId),s=Ii(A.senderId);if(!r||!s||!e||A.senderIsBot===!0||this.#r.hasSeen(r)||this.#I.has(r))return Promise.resolve();if(a==="group"&&A.addressed!==!0)return this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString(),this.#I.set(r,null),this.#f(A,r,null);if(this.#o||i){let I=Tt(A),d=wt(A),B=i??Ba(this.#o,{conversationType:a,senderIds:[s,Ii(A.senderAlternateId)].filter(Boolean),text:A.content,hasImages:I,hasFiles:d});if(!B.allowed)return this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString(),this.#I.set(r,null),this.#f(A,r,B.reason==="command-not-allowed"?w(ao):null,{recordReceived:B.reason==="command-not-allowed"})}this.#I.set(r,o===void 0?Aa(this.#l,t?.kind):o);let g=JQ({adapter:this.#A,target:A.kind==="direct"||A.addressed===!0?A.reactionTarget:null,reactions:this.#e.reactions,status:this.#i,logger:this.#a,label:this.#e.key});A.statusReaction=g;let c=this.#B(A,r,s);return c.then(()=>g.success(),()=>g.error()),c}#B(t,o,i){t.kind==="direct"&&So(this.#r,t.connectionTestTarget??t.replyTarget);let e=`${t.kind}:${t.conversationId}`,a=this.#c.get(e),A=Ii(t.content),r=Ni(A);if(r&&t.kind==="group"&&t.addressed===!0)return this.#f(t,o,es());if(r&&t.kind==="direct"){if(/^\/batch$/iu.test(A)&&(this.#p.has(e)||a||this.#C.hasPending(e)))return this.#f(t,o,No());let d=this.#u.handle(e,A,{plainText:!!A&&t.plainText!==!1&&!Tt(t)&&!wt(t)});if(d.handled)return d.kind==="submit"?this.#Q({...t,content:d.prompt,batchSubmission:{token:d.token}},o,i,e):this.#f(t,o,d.message)}else if(t.kind==="direct"&&this.#u.status(e).phase==="collecting"){let I=this.#u.handle(e,A,{plainText:!!A&&t.plainText!==!1&&!Tt(t)&&!wt(t)});if(I.handled)return this.#f(t,o,I.message)}let g=t.kind==="direct"&&this.#u.status(e).phase==="collecting"?null:Fa(A)?Ao:wt(t)?null:ni(A)?Mi:si(A)?to:gi(A)?_i:null;if(g&&(t.kind!=="group"||t.addressed===!0)){let I;return I=this.#S(t,o,e,g).finally(()=>{this.#I.delete(o),this.#h.delete(I)}),this.#h.add(I),I}let c=this.#C.claimReply({key:e,actor:i,messageId:o,text:Tt(t)||wt(t)?"":t.content,addressed:t.kind!=="group"||t.addressed===!0,hasPendingQuestion:!!a,questionCompletion:a?.submitting||a?.claimedReplyMessageId?a.queue:null,isQuestionPending:()=>this.#c.has(e),send:I=>this.#A.sendText(t.replyTarget,I)});if(c){let I;return I=c.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#I.delete(o),this.#d.delete(I)}),this.#d.add(I),I}if(a&&a.actor!==i)return this.#Q(t,o,i,e);if(a?.submitting||a?.claimedReplyMessageId)return this.#Q(t,o,i,e);if(a){Bue(t,a,i)&&(a.claimedReplyMessageId=o);let d=(a.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#D(t,o,i,e,a)).finally(()=>{this.#I.delete(o),a.claimedReplyMessageId===o&&(a.claimedReplyMessageId=null),a.queue===d&&(a.queue=null)});return a.queue=d,d}return this.#Q(t,o,i,e)}#f(t,o,i,{recordReceived:e=!0}={}){let a;return a=(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),e&&(this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()),i&&await this.#A.sendText(t.replyTarget,i),this.#i.lastError=null)})().catch(async A=>{if(this.#s?.aborted){t.statusReaction?.clear();return}t.statusReaction?.error(),this.#i.lastError=A?.message??String(A);let r=At(this.#i,A);this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a batch input message [${r.referenceId}]:`,A)}).finally(()=>{this.#I.delete(o),this.#h.delete(a)}),this.#h.add(a),a}#Q(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1}={}){let s=(this.#p.get(e)??Promise.resolve()).catch(()=>{}).then(()=>this.#m(t,o,i,e,{alreadyRecorded:A})).finally(()=>{a&&this.#I.delete(o),this.#p.get(e)===s&&this.#p.delete(e)});return this.#p.set(e,s),s}async waitForIdle(){await Promise.allSettled([...this.#p.values(),...[...this.#c.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#d,...this.#h])}async#S(t,o,i,e){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString();let a=t.replyTarget;try{let A=await e(Ii(t.content),this.#t,this.#r,i,{signal:this.#s,isDirect:t.kind==="direct",hasImages:Tt(t),hasFiles:wt(t),pendingInteraction:this.#c.has(i)||this.#C.hasPending(i),control:{owner:this,key:i}});A?.stopped&&await Promise.allSettled([this.#G(i),this.#C.closeRoute(i)]);for(let r of A?.messages??[A?.message])r&&await this.#A.sendText(a,r);this.#i.lastError=null}catch(A){if(A?.code==="turn-stopped"||this.#s?.aborted){t.statusReaction?.clear();return}t.statusReaction?.error(),this.#i.lastError=A?.message??String(A);let r=At(this.#i,A);this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a command [${r.referenceId}]:`,A),await this.#A.sendText(a,dt(r)).catch(()=>{})}}sendConnectionTest(t){return nc({state:this.#r,text:t,channelLabel:w("{label}\u673A\u5668\u4EBA",{label:this.#e.label}),send:(o,i)=>this.#A.sendText(o,i)})}sendProactiveText(t,o,{signal:i}={}){return i?.throwIfAborted(),this.#A.sendText(t,o)}async#y(t,o,i=[],e){let a=await vo({artifacts:i,baseReceipt:e,deliveryId:o,channelKey:this.#e.key,signal:this.#s,sendImage:typeof this.#A.sendImage=="function"?A=>this.#A.sendImage(t,A):void 0,sendFile:typeof this.#A.sendFile=="function"?A=>this.#A.sendFile(t,A):void 0,onFailure:(A,r)=>At(this.#i,r,{userMessage:fue(A?.fileName,r,this.#e),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#A.sendText(t,dt(s)),logger:this.#a});return this.#i.artifactsSent=(this.#i.artifactsSent??0)+a.artifactsSent,this.#i.artifactSendErrors=(this.#i.artifactSendErrors??0)+a.artifactSendErrors,{receipt:a.receipt,userVisible:a.userVisible,artifactSendErrors:a.artifactSendErrors}}async#m(t,o,i,e,{alreadyRecorded:a=!1}={}){if(!a){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}let A=t.replyTarget,r=Ii(t.content),s=t.batchSubmission,g=null,c=!1;try{if(this.#s?.throwIfAborted(),t.kind==="group"&&t.addressed!==!0){this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString();return}let I=Tt(t),d=wt(t);if(!r&&!I&&!d){await this.#A.sendText(A,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002"));return}let B=r.toLowerCase();if(!I&&!d&&B==="/help"){await this.#A.sendText(A,[w("{label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002",{label:this.#e.label}),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` +`).trim()}function Ri(n){return typeof n=="string"&&n.trim()?n.trim():null}function HEe(n){if(!n||typeof n!="object")return null;let t=Ri(n.message);if(t)return t;let o=Ri(n.name),i=Ri(n.code);return o||i?[o??"Error",i].filter(Boolean).join(": "):null}function p1(n,t){let o=[...t].map(i=>i?.event??i).filter(Boolean).sort((i,e)=>(i.seq??-1)-(e.seq??-1));for(let i of o){let e=i.seq??-1;if(e<=n.lastSeq)continue;if(n.lastSeq=e,i.type==="turn/start"){let A=i.data?.turn??null;n.active&&A!==n.turn&&(n.active=!1),n.turn!==null&&A!==n.turn&&(n.completed=!0),n.openTurn=A;continue}if(i.type==="user/message"&&i.data?.source?.rpcId===n.promptRpcId){n.active=!0,n.started=!0,n.completed=!1,n.turn=i.data?.turn??n.openTurn;continue}if(i.type==="turn/end"&&i.data?.turn===n.turn){n.active=!1,n.completed=!0;continue}let a=null;if(i.type==="tool/call"&&n.active&&i.data?.turn===n.turn&&typeof i.data?.callId=="string"&&i.data.callId)a={callId:i.data.callId,name:i.data?.name,arguments:i.data?.arguments};else if(i.type==="tool/code-dispatch-start"&&n.active&&typeof i.data?.subCallId=="string"&&i.data.subCallId){let A;try{A=JSON.stringify(i.data?.arguments)}catch{A=void 0}a={callId:i.data.subCallId,name:i.data?.name,arguments:A}}a&&n.toolCalls.set(a.callId,Object.freeze(a))}}function d1(n,t,o=[]){if(!n||!["object","function","string"].includes(typeof n)||typeof t!="string"||!t)return!1;let i=l1(n).ownerships.get(t);if(!i||i.size===0)return!1;for(let e of i)p1(e,o);return[...i].some(e=>e.active&&!e.completed&&typeof e.reconnect=="function")}var Gp=class{#e;#A;#t=null;#r=null;#l=new Map;#o="";#i=!1;#a=null;#n=new Map;#s=null;constructor({promptRpcId:t,afterSeq:o=-1}){this.#e=t,this.#A=o}get finished(){return this.#i}get answer(){return this.#o.trim()}get reason(){return this.#a}get tracking(){return this.#r!==null&&!this.#i}get turn(){return this.#r}consumeAll(t){let o=[],i=a=>{if(a.type==="text"&&o.length>0&&o[o.length-1].type==="text"){o[o.length-1]=a;return}o.push(a)},e=[...t].map(a=>a?.event??a).filter(Boolean).sort((a,A)=>(a.seq??-1)-(A.seq??-1));for(let a of e){let A=a.seq??-1;if(!(A<=this.#A)){if(this.#A=A,a.type==="turn/start"&&(this.#t=a.data?.turn??null),a.type==="user/message"&&a.data?.source?.rpcId===this.#e){this.#r=this.#t;continue}if(this.#r!==null){if(a.type==="turn/end"){if(a.data?.turn!==this.#r)continue;this.#i=!0,this.#a=a.data?.reason??null,this.#t=null;continue}if(a.data?.turn===this.#r){if(a.type==="assistant/chunk"&&a.data?.chunk?.type==="text-delta"){let r=a.data?.step??0,s=a.data.chunk.index??0,g=`${r}:${s}`;this.#l.set(g,(this.#l.get(g)??"")+a.data.chunk.text);let c=`${r}:`,I=[...this.#l.entries()].filter(([d])=>d.startsWith(c)).sort(([d],[B])=>Number(d.split(":")[1])-Number(B.split(":")[1])).map(([,d])=>d).join(` +`).trim();I&&I!==this.#o&&(this.#o=I,i({type:"text",text:I}));continue}if(a.type==="assistant/message"){let r=UEe(a);r&&r!==this.#o&&(this.#o=r,i({type:"text",text:r}));continue}if(a.type==="tool/call"){let r=Ri(a.data?.name)??w("\u5DE5\u5177"),s=Ri(a.data?.callId)??Ri(a.data?.subCallId);s&&this.#n.set(s,r),this.#s=r,i({type:"tool",name:r,...s?{callId:s}:{}})}else if(a.type==="tool/result"){let r=Ri(a.data?.message?.source?.callId)??Ri(a.data?.callId)??Ri(a.data?.subCallId),s=(r?this.#n.get(r):null)??this.#s,g=HEe(a.data?.error);i({type:"status",text:w("\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026"),...s?{toolName:s}:{},...g?{error:g}:{}})}}}}}return o}consume(t){return this.consumeAll(t).at(-1)??null}},Bn=class extends Error{constructor(t,o){super(`${t}: ${o?.message??"unknown Harness RPC error"}`),this.name="HarnessRpcError",this.method=t,this.code=o?.code??"internal",this.details=o?.details??{}}},rs=class extends Error{constructor(t,o,{cause:i,status:e}={}){let a=Number.isInteger(e)?`, HTTP ${e}`:"";super(`Harness ${o} transport failed (${t}${a})`,{cause:i}),this.name="HarnessTransportError",this.code=t,this.method=o,Number.isInteger(e)&&(this.status=e)}},T_=class extends Error{constructor(t){super("Harness health RPC was rejected",{cause:t}),this.name="HarnessHealthError",this.code="harness-rpc-rejected",this.method="host.describe"}},Fp=class extends Error{constructor(t,o){super(o),this.name="HarnessInteractionError",this.code=t}},as=class extends Error{constructor(t,{reason:o,providerCode:i}={}){super(`Harness turn failed (${t})`),this.name="HarnessTurnError",this.code=t,this.promptAccepted=!0,o&&typeof o=="object"&&(this.reason=o),typeof i=="string"&&i&&(this.providerCode=i)}};function I1(n){let t=Ri(n?.kind)??Ri(n);if(t==="error"){let o=n?.error??n?.failure;return new as("harness-turn-failed",{reason:n,providerCode:Ri(o?.code)??void 0})}return t==="max-tokens"?new as("model-max-tokens",{reason:n}):t==="blocked"?new as("turn-blocked",{reason:n}):["interrupted","stopped","cancelled","canceled"].includes(t)?new as("turn-interrupted",{reason:n}):t==="aborted"?new as("turn-aborted",{reason:n}):t==="completed"?new as("model-empty-response",{reason:n}):new as("harness-turn-failed",{reason:n})}function KEe(n){return n==null?!0:(Ri(n?.kind)??Ri(n))==="completed"}var ur=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d;#h=null;#C;#u;#B;#f;constructor({baseUrl:t,apiProxy:o,interactionScope:i=o,workspace:e,agentPreset:a,autostart:A=!1,dshBin:r="dsh",fetchImpl:s=fetch,createWebSocket:g=m=>new WebSocket(m),interactionReconnectDelayMs:c=500,rpcIdPrefix:I="im",logPrefix:d="dsh-im",commandExecutor:B,controlExecutor:f,sessionMaintenanceExecutor:Q,fileIngressExecutor:y}){if(typeof g!="function")throw new TypeError("createWebSocket must be a function");if(!Number.isFinite(c)||c<0)throw new TypeError("interactionReconnectDelayMs must be a non-negative number");if(typeof I!="string"||!I.trim())throw new TypeError("rpcIdPrefix must be a non-empty string");if(typeof d!="string"||!d.trim())throw new TypeError("logPrefix must be a non-empty string");if(B!==void 0&&typeof B!="function")throw new TypeError("commandExecutor must be a function");if(f!==void 0&&typeof f!="function")throw new TypeError("controlExecutor must be a function");if(Q!==void 0&&typeof Q!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(y!==void 0&&typeof y!="function")throw new TypeError("fileIngressExecutor must be a function");if(this.#e=t===void 0?null:new URL(t),this.#A=this.#e?null:o,!this.#e&&(!this.#A||typeof this.#A!="object"))throw new TypeError("HarnessClient requires the current Host apiProxy or an explicit baseUrl");if(this.#A&&(!i||!["object","function"].includes(typeof i)))throw new TypeError("interactionScope must identify the current Host");this.#t=e,this.#r=a??void 0,this.#l=!!(this.#e&&A),this.#o=r,this.#i=s,this.#a=g,this.#n=c,this.#s=I.trim(),this.#p=d.trim(),this.#c=B,this.#g=f,this.#I=Q,this.#d=y,this.#C=l1(this.#e?.origin??i),this.#u=this.#C.ownerships,this.#B=this.#C.claims,this.#f=this.#C.controls}async rpc(t,o={},i=3e4,e={}){let a=e.rpcId??`${this.#s}-${M_()}`,A=AbortSignal.timeout(i),r=e.signal?AbortSignal.any([e.signal,A]):A,s;try{if(this.#A){let[g,c,I]=t.split("."),d={host:"host",workspace:"workspace",session:"sessions",llm:"llm"}[g],B=d&&this.#A[d];if(I!==void 0||!Object.hasOwn(B??{},c)||typeof B[c]!="function")throw new rs("harness-api-not-found",t);s={type:"server-response",...await n1(()=>B[c]({rpcId:a,payload:o},r),r)}}else{let g=await this.#i(new URL(`/api/${t}`,this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"client-request",rpcId:a,method:t,payload:o}),signal:r});if(!g.ok){let c=await REe(g,this.#e.hostname);throw new rs(c,t,{status:g.status})}try{s=await g.json()}catch(c){throw new rs("harness-response-invalid",t,{cause:c})}}}catch(g){throw e.signal?.aborted||g instanceof rs?g:new rs(A.aborted?"harness-timeout":"harness-connect-failed",t,{cause:g})}if(s?.type!=="server-response"||s?.rpcId!==a)throw new rs("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid response for ${t}`)});if(!s.result||typeof s.result!="object"||typeof s.result.ok!="boolean")throw new rs("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid result for ${t}`)});if(!s.result?.ok)throw new Bn(t,s.result?.error);return s.result.value}async health(t={}){try{return await this.rpc("host.describe",{},5e3,t),!0}catch(o){throw o instanceof Bn?new T_(o):o}}async ensureRunning(t={}){try{return await this.health(t)}catch(e){if(!this.#l)throw e}if(!this.#h||this.#h.exitCode!==null){let e=this.#e.port||(this.#e.protocol==="https:"?"443":"80");this.#h=DEe(this.#o,["web","--host",this.#e.hostname,"--port",e],{cwd:this.#t,env:process.env,stdio:["ignore","inherit","inherit"]}),this.#h.on("error",a=>{console.error(`[${this.#p}] failed to start Harness:`,a.message)})}let o=Date.now()+6e4,i;for(;Date.now(){let r=A&&i.signal?AbortSignal.any([A,i.signal]):A??i.signal;return this.rpc("session.selectModel",{sessionId:t,provider:o.provider,model:o.model,...o.reasoningEffort===void 0?{}:{reasoningEffort:o.reasoningEffort}},3e4,r?{...i,signal:r}:i)},a=this.#I?await this.#I({sessionId:t,operation:e}):await e();if(!a||typeof a!="object"||!__(a.selected))throw new Error("Harness returned an invalid response for session.selectModel");return a}async isSessionRunning(t,o={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");await this.ensureRunning(o);let i=await this.rpc("session.list",{},3e4,o);if(!i||typeof i!="object"||!Array.isArray(i.items))throw new Error("Harness returned an invalid response for session.list");for(let e of i.items)if(!e||typeof e!="object"||typeof e.sessionId!="string"||!e.sessionId||typeof e.running!="boolean")throw new Error("Harness returned an invalid response for session.list");return i.items.find(e=>e.sessionId===t)?.running??!1}async adoptWorkspaceSession(t,o={}){return i1(this,t,o)}async workspaceId(t={}){let{workspace:o=this.#t,...i}=t,{items:e}=await this.rpc("workspace.list",{},3e4,i),a=e.find(r=>r.path===o);return a?a.workspaceId:(await this.rpc("workspace.create",{path:o},3e4,i)).workspace.workspaceId}async createSession(t={}){let{agentPreset:o,...i}=t;await this.ensureRunning(i);let a={workspaceId:await this.workspaceId(i)},A=o!==void 0?o:this.#r;return A!=null&&(a.agentPreset=A),(await this.rpc("session.create",a,3e4,i)).sessionId}async executeCommand(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o)throw new TypeError("command line is required");if(!this.#c){let e=new Error("Harness command execution is unavailable");throw e.code="commands-unavailable",e}try{return await this.#c(t,o,i)}catch(e){throw e?.failure&&typeof e.failure=="object"?new Bn("commands.execute",e.failure):e}}async readSessionHistory(t,{maxMessages:o=50,beforeSeq:i,timeoutMs:e=1e4,...a}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!Number.isSafeInteger(o)||o<1||i!==void 0&&(!Number.isSafeInteger(i)||i<0))throw new TypeError("Invalid history pagination");return this.rpc("session.history",{sessionId:t,maxMessages:o,...i===void 0?{}:{beforeSeq:i}},e,a)}async sessionExists(t,o={}){try{return await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,o),!0}catch(i){if(i instanceof Bn&&i.code==="session-not-found")return!1;throw i}}async respondInteraction(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("rpcId is required");if(!o||typeof o!="object"||typeof o.ok!="boolean")throw new TypeError("A Harness RPC result is required");let e=AbortSignal.timeout(i.timeoutMs??3e4),a=i.signal?AbortSignal.any([i.signal,e]):e,A={type:"client-response",rpcId:t,result:o},r;if(this.#A)r=await n1(()=>this.#A.respond(A),a);else{let g=await this.#i(new URL("/api/respond",this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(A),signal:a});if(!g.ok)throw new Error(`Harness transport respond failed: HTTP ${g.status}`);r=await g.json()}if(r?.accepted===!0)return r;if(r?.accepted!==!1||r.reason!=="bad-response"&&r.reason!=="not-pending")throw new Error("Harness returned an invalid interaction response receipt");let s=r.reason;throw new Fp(`interaction-${s}`,`Harness interaction response was rejected (${s})`)}async watchInteractions(t,{signal:o,onInteraction:i,onResolved:e,onOpen:a,ownership:A}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!o||typeof o.addEventListener!="function")throw new TypeError("watchInteractions requires an AbortSignal");if(i!==void 0&&typeof i!="function")throw new TypeError("onInteraction must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("onResolved must be a function");if(a!==void 0&&typeof a!="function")throw new TypeError("onOpen must be a function");for(;!o.aborted;){try{await this.#R(t,{signal:o,onInteraction:i,onResolved:e,onOpen:a,ownership:A})}catch(r){if(o.aborted)return;console.warn(`[${this.#p}] Harness interaction stream disconnected:`,r.message)}if(o.aborted)return;try{await zE(this.#n,o)}catch{if(o.aborted)return;throw new Error("Harness interaction reconnect wait failed")}}}#Q(t,o){let i=this.#u.get(t)??new Set;o.order=this.#C.nextOrder,this.#C.nextOrder+=1,i.add(o),this.#u.set(t,i)}#S(t,o){let i=this.#u.get(t);i?.delete(o),i?.size===0&&this.#u.delete(t);for(let[e,a]of this.#B)a.ownership===o&&this.#B.delete(e)}#y(t){if(!t.control)return;let o=this.#f.get(t.control.owner);o||(o=new Map,this.#f.set(t.control.owner,o));let i=o.get(t.control.key)??new Set;i.add(t),o.set(t.control.key,i)}#m(t){if(!t.control)return;let o=this.#f.get(t.control.owner),i=o?.get(t.control.key);i?.delete(t),i?.size===0&&o.delete(t.control.key),o?.size===0&&this.#f.delete(t.control.owner)}#D(t,o){let i=s1(o);return i?[...this.#f.get(i.owner)?.get(i.key)??[]].filter(a=>a.sessionId===t).sort((a,A)=>a.order-A.order):[]}#E(t,o){return this.#D(t,o).find(i=>i.started&&i.active&&!i.completed&&i.turn!==null)??null}async#N(t,o,i){let e=this.#D(t,o);if(e.length===0)return null;try{let a=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,i);this.#T(t,a.events??[])}catch(a){if(!(a instanceof Bn)||a.code!=="session-not-found")throw a;for(let A of e)A.active=!1,A.completed=!0;return null}return this.#E(t,o)}async hasActiveTurn(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");return!!await this.#N(t,o,i)}async stopActiveTurn(t,o,i={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");let e=await this.#N(t,o,i);if(!e)return!1;if(e.stopRequested)return!0;if(this.#E(t,o)!==e)return!1;e.stopRequested=!0;try{if(this.#g){let a=this.#g({sessionId:t,expectedTurn:e.turn,promptRpcId:e.promptRpcId,action:"stop"});if(a&&typeof a.then=="function")throw new TypeError("controlExecutor must return synchronously");if(a!==void 0){if(typeof a!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return a||(e.stopRequested=!1),a}}return await this.rpc("session.cancel",{sessionId:t,keepInbox:!0},3e4,i),!0}catch(a){if(this.#E(t,o)===e&&(e.stopRequested=!1),a instanceof Bn&&a.code==="session-not-found")return!1;throw a}}async steerActiveTurn(t,o,i,e={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o.trim())throw new TypeError("Steering text is required");let a=await this.#N(t,i,e);if(!a||a.stopRequested||this.#E(t,i)!==a)return!1;if(this.#g){let A=this.#g({sessionId:t,expectedTurn:a.turn,promptRpcId:a.promptRpcId,action:"steer",text:o});if(A&&typeof A.then=="function")throw new TypeError("controlExecutor must return synchronously");if(A!==void 0){if(typeof A!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return A}}return await this.rpc("session.prompt",{sessionId:t,mode:"steer",content:[{type:"text",text:o}],clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,e),!0}#T(t,o){for(let i of this.#u.get(t)??[])p1(i,o)}async#O(t,o){let i=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,{signal:o});this.#T(t,i.events??[])}#w(t,o,i){let e=this.#B.get(o);if(e&&this.#u.get(t)?.has(e.ownership))return e;let a=[...this.#u.get(t)??[]],A=a.filter(s=>s.active).sort((s,g)=>s.order-g.order);if(A.length>0)return{ownership:A[0],recovered:!1};let r=a.filter(s=>!s.started&&!s.completed).sort((s,g)=>s.order-g.order)[0]??null;return r?{ownership:r,recovered:!0}:null}async ask(t,o,i={}){typeof i=="number"&&(i={timeoutMs:i});let e=i.timeoutMs??6e5,a=i.signal,A=typeof i.onUpdate=="function"?i.onUpdate:null,r=i.progressMode==="all"?"all":"latest",s=typeof i.onArtifact=="function"?i.onArtifact:null,g=typeof i.onInteraction=="function"?i.onInteraction:void 0,c=typeof i.onInteractionResolved=="function"?i.onInteractionResolved:void 0,I=s1(i.control),d=Array.isArray(i.files)?i.files.filter(Boolean):[];await this.ensureRunning({signal:a});let B=await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,{signal:a}),f=Math.max(-1,...(B.events??[]).map(({event:J})=>J.seq??-1)),Q=`${this.#s}-${M_()}`,y=new Gp({promptRpcId:Q,afterSeq:f}),m=g||c?new AbortController:null,T=m?a?AbortSignal.any([a,m.signal]):m.signal:null,_=m||I?{sessionId:t,promptRpcId:Q,active:!1,started:!1,completed:!1,stopRequested:!1,turn:null,openTurn:null,lastSeq:f,reconnect:null,order:-1,toolCalls:new Map,control:I}:null,R=null,K=!1,L=0,F=null,q=!1,V=!1,x=async()=>{if(!s||K||y.turn===null)return L;K=!0;let J=vI.take(t,y.turn,{signal:a});for(let U of J)try{await s(U),L+=1}catch(N){vI.release(U),console.warn(`[${this.#p}] ignored an artifact handoff failure:`,N.message)}return L};_&&(this.#Q(t,_),this.#y(_));let G=vI.openConsumer(t,Q);try{if(d.length>0){if(!this.#d)throw new Ro("inbound-file-ingress-unavailable","Harness file ingress is unavailable in this Host process.");let N=(await this.rpc("session.list",{},3e4,{signal:a}))?.items?.find(k=>k?.sessionId===t)?.cwd;F=await this.#d({sessionId:t,workspace:N,files:d,signal:a}),o=NY(o,F)}if(T){let U,N=new Promise(k=>{U=k});R=this.watchInteractions(t,{signal:T,onInteraction:g,onResolved:c,onOpen:U,ownership:_}),R.catch(()=>{}),await Promise.race([N,zE(3e4,T).then(()=>{throw new Error("Harness interaction stream did not open within 30 seconds")})])}let J=typeof o=="string"?[{type:"text",text:o}]:o;if(!Array.isArray(J)||J.length===0)throw new TypeError("Harness prompt content is required");await this.rpc("session.prompt",{sessionId:t,mode:"queue",content:J,clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,{rpcId:Q,signal:a}),q=!0;try{let U=Date.now()+e;for(;Date.now()0)return"";throw _?.stopRequested?c1():I1(y.reason)}throw new as("harness-reply-timeout")}catch(U){if(!_?.stopRequested)throw U;if(y.answer)return y.answer;throw U?.code==="turn-stopped"?U:c1()}}finally{F&&(!q||V)&&await F.cleanup().catch(J=>{console.warn(`[${this.#p}] unable to clean inbound files:`,J.message)}),G(),_&&(this.#m(_),this.#S(t,_)),y.turn!==null&&vI.discard(t,y.turn),m?.abort(new DOMException("Harness turn finished","AbortError")),R&&await R.catch(()=>{})}}async#R(t,{signal:o,onInteraction:i,onResolved:e,onOpen:a,ownership:A}){let r=!1,s=null,g=Promise.resolve(),c=A==null,I=[],d=()=>{},B=m=>{d=m,A&&(A.reconnect=d);try{a?.()}catch(T){console.warn(`[${this.#p}] ignored an interaction open callback failure:`,T.message)}A&&this.#O(t,o).then(()=>{if(!r){c=!0;for(let T of I.splice(0))Q(T)}}).catch(T=>{s??=T,d()})},f=(m,T)=>{m&&(g=g.then(()=>m(T)).catch(_=>{s??=_,d()}))},Q=m=>{let T=m.payload;if(A&&T.type==="session/event"){this.#T(t,[T.event]);return}if(T.type==="question/requested"||T.type==="approval/requested"){let _=T.type==="question/requested"?"question":"approval",R=_==="question"?m.rpcId:T.approvalId,K=`${_}:${R}`;if(A){let F=this.#w(t,K,_);if(F?.ownership!==A)return;this.#B.set(K,F)}let L=_==="approval"&&A&&typeof T.callId=="string"?this.#B.get(K)?.ownership.toolCalls.get(T.callId):void 0;f(i,Object.freeze({kind:_,interactionId:R,rpcId:m.rpcId,sessionId:t,payload:T,recovered:A?this.#B.get(K)?.recovered===!0:!1,...L?{toolCall:L}:{},reconnect:d,respond:(F,q={})=>this.respondInteraction(m.rpcId,F,{...q,signal:q.signal??o})}));return}if(T.type==="question/resolved"||T.type==="approval/resolved"){let _=T.type==="question/resolved"?"question":"approval",R=_==="question"?T.questionRpcId:T.approvalId,K=`${_}:${R}`;if(A){if(this.#B.get(K)?.ownership!==A)return;this.#B.delete(K)}f(e,Object.freeze({kind:_,interactionId:R,sessionId:t,outcome:T.outcome,payload:T}))}},y=m=>{try{let T=m?.payload;if(m?.type!=="server-request"||typeof m.rpcId!="string"||!T||typeof T!="object"||m.method!==T.type)throw new Error("invalid server-request envelope");if(T.sessionId!==t)return;c?Q(m):I.push(m)}catch(T){console.warn(`[${this.#p}] ignored a malformed Harness interaction frame:`,T.message)}};try{await this.#_({signal:o,onOpen:B,onEnvelope:y})}finally{r=!0,A?.reconnect===d&&(A.reconnect=null),o.aborted||await g}if(!o.aborted&&s)throw s}async watchHarnessEvents({signal:t,onSessionEvent:o,onReconnect:i}={}){if(typeof o!="function")throw new TypeError("watchHarnessEvents requires onSessionEvent");if(!t||typeof t.addEventListener!="function")throw new TypeError("watchHarnessEvents requires an AbortSignal");if(i!==void 0&&typeof i!="function")throw new TypeError("onReconnect must be a function");for(;!t.aborted;){try{await this.#_({signal:t,onOpen:()=>{try{i?.()}catch(e){console.warn(`[${this.#p}] mux reconnect hook failed:`,e.message)}},onEnvelope:e=>{try{let a=e?.payload;if(e?.type!=="server-request"||!a||typeof a!="object"||e.method!==a.type||a.type!=="session/event"||typeof a.sessionId!="string"||!a.event||typeof a.event!="object")return;o({sessionId:a.sessionId,event:a.event})}catch(a){console.warn(`[${this.#p}] ignored a malformed global mux frame:`,a.message)}}})}catch(e){if(t.aborted)return;console.warn(`[${this.#p}] Harness event mux disconnected:`,e.message)}if(t.aborted)return;try{await zE(this.#n,t)}catch{if(t.aborted)return;throw new Error("Harness event mux reconnect wait failed")}}}#_(t){return o1({apiProxy:this.#A,baseUrl:this.#e,createWebSocket:this.#a,rpcId:`${this.#s}-${M_()}`,...t,onMalformed:o=>{console.warn(`[${this.#p}] ignored a malformed Harness mux frame:`,o.message)}})}stopManagedProcess(){this.#h?.exitCode===null&&this.#h.kill("SIGTERM")}};var RQ=class extends ur{constructor(t){super({...t,rpcIdPrefix:"dingtalk",logPrefix:"dsh-dingtalk"})}};import{randomUUID as xEe}from"node:crypto";import{mkdir as YEe,readFile as jEe,rename as JEe,unlink as qEe,writeFile as zEe}from"node:fs/promises";import{dirname as VEe}from"node:path";var kQ=Object.freeze({version:1,sessions:{},seenMessageIds:[],pendingSenders:{}});function Br(n){return typeof n=="string"&&n.trim()?n.trim():null}function h1(n){return(Br(n)??w("\u9489\u9489\u7528\u6237")).slice(0,100)}function WEe(n,t){if(!n||typeof n!="object")return null;let o=Br(n.requestId)??Br(t),i=Br(n.staffId),e=Br(n.requestedAt)??Br(n.lastSeenAt),a=Br(n.lastSeenAt)??e;return!o||!i||!e||!a?null:{requestId:o,staffId:i,displayName:h1(n.displayName??n.nick),requestedAt:e,lastSeenAt:a}}function ZEe(n){if(!n||typeof n!="object")return structuredClone(kQ);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[e,a]of Object.entries(n.sessions)){let A=Br(e),r=Br(a);A&&r&&(t[A]=r)}let o={},i=Array.isArray(n.pendingSenders)?n.pendingSenders.map(e=>[e?.requestId,e]):Object.entries(n.pendingSenders&&typeof n.pendingSenders=="object"?n.pendingSenders:{});for(let[e,a]of i){let A=WEe(a,e);if(!A)continue;let r=Object.values(o).find(s=>s.staffId===A.staffId);(!r||r.lastSeenAtnew Date().toISOString()}={}){if(!Br(t))throw new TypeError("state path is required");if(typeof o!="function"||typeof i!="function")throw new TypeError("idFactory and now must be functions");this.#e=t,this.#r=o,this.#l=i}async load(){try{this.#A=ZEe(JSON.parse(await jEe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(kQ),await this.#o()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){let i=Br(t),e=Br(o);if(!i||!e)throw new TypeError("key and sessionId are required");this.#A.sessions[i]=e,await this.#o()}async clearSession(t){let o=Br(t);!o||!(o in this.#A.sessions)||(delete this.#A.sessions[o],await this.#o())}async clearSessions(){this.#A.sessions={},await this.#o()}hasSeen(t){let o=Br(t);return!!(o&&this.#A.seenMessageIds.includes(o))}async markSeen(t){let o=Br(t);if(!o)throw new TypeError("messageId is required");this.hasSeen(o)||(this.#A.seenMessageIds.push(o),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#o())}pendingSenders(){return Object.values(this.#A.pendingSenders).sort((t,o)=>t.requestedAt.localeCompare(o.requestedAt)).map(t=>structuredClone(t))}pendingSender(t){let o=Br(t),i=o?this.#A.pendingSenders[o]:null;return i?structuredClone(i):null}async recordPendingSender(t,o,i){let e=t&&typeof t=="object"?t:{staffId:t,displayName:o,lastSeenAt:i},a=Br(e.staffId);if(!a)throw new TypeError("staffId is required");let A=Br(e.lastSeenAt)??Br(e.requestedAt)??this.#l(),r=Object.values(this.#A.pendingSenders).find(g=>g.staffId===a),s={requestId:r?.requestId??`ding_sender_${this.#r()}`,staffId:a,displayName:h1(e.displayName??e.nick??o),requestedAt:r?.requestedAt??A,lastSeenAt:A};return this.#A.pendingSenders[s.requestId]=s,await this.#o(),structuredClone(s)}async removePendingSender(t){let o=Br(t);return!o||!this.#A.pendingSenders[o]?!1:(delete this.#A.pendingSenders[o],await this.#o(),!0)}async removePendingSenderByStaffId(t){let o=Br(t),i=o?Object.values(this.#A.pendingSenders).find(e=>e.staffId===o):null;return i?this.removePendingSender(i.requestId):!1}snapshot(){return structuredClone(this.#A)}async remove(){await this.#t;try{await qEe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(kQ)}async#o(){let t=`${JSON.stringify(this.#A,null,2)} +`,o=this.#t.then(async()=>{await YEe(VEe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await zEe(i,t,{encoding:"utf8",mode:384}),await JEe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{mkdir as XEe,readFile as $Ee,realpath as eCe,rename as ACe,stat as tCe,unlink as rCe,writeFile as aCe}from"node:fs/promises";import{dirname as iCe,isAbsolute as u1,resolve as WE}from"node:path";var V$e=Object.freeze({version:1,workspaces:Object.freeze({})});function PI(n){let t=new Error(n);return t.code=Ga,t}async function N_(n){return WE(await eCe(n))}async function oCe(n,t){if(n===t)return!0;try{return await N_(n)===await N_(t)}catch{return!1}}function xt(n){if(typeof n!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n))throw new TypeError("Invalid bot id");return n}function ci(n,t,o){let i=new Error(t,o);return i.code=n,i}function PQ(n){if(typeof n!="string"||!/^[A-Za-z0-9._:@-]{1,128}$/.test(n))throw ci("invalid-target","Invalid target id");return n}function nCe(n){if(!n||typeof n!="object"||Array.isArray(n))throw ci("invalid-target","Invalid target route");try{let t=JSON.stringify(n);if(t===void 0)throw new TypeError("route is not JSON");let o=JSON.parse(t);if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError("route is not an object");return o}catch(t){throw ci("invalid-target","Invalid target route",{cause:t})}}function GI(n,{targetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw ci("invalid-target","Invalid delivery target");let o=t===void 0?new Set(["targetId","name","kind","route"]):new Set(["name","kind","route"]);if(Object.keys(n).some(a=>!o.has(a)))throw ci("invalid-target","Invalid delivery target");let i=PQ(t??n.targetId);if(typeof n.kind!="string"||!/^[a-z][a-z0-9-]{0,31}$/.test(n.kind))throw ci("invalid-target","Invalid target kind");let e;if(n.name!==void 0){if(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)throw ci("invalid-target","Invalid target name");e=n.name.trim()}return{targetId:i,...e===void 0?{}:{name:e},kind:n.kind,route:nCe(n.route)}}function sCe(n){let t=Object.create(null);if(n===void 0)return t;if(!n||typeof n!="object"||Array.isArray(n))return null;try{for(let[o,i]of Object.entries(n)){if(xt(o),!i||typeof i!="object"||Array.isArray(i))return null;let e=Object.create(null);for(let[a,A]of Object.entries(i)){let r=GI(A,{targetId:a}),{targetId:s,...g}=r;e[a]=g}t[o]=e}}catch{return null}return t}function gCe(n,t){let o=Object.create(null);if(n===void 0)return o;if(!n||typeof n!="object"||Array.isArray(n)){for(let i of Object.keys(t))o[i]=null;return o}for(let[i,e]of Object.entries(n))try{xt(i),o[i]=Pp(e)}catch{}return o}function cCe(n){if(!n||![1,2].includes(n.version)||!n.workspaces||typeof n.workspaces!="object"||Array.isArray(n.workspaces))return null;let t={};for(let[r,s]of Object.entries(n.workspaces)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(r)||typeof s!="string"||!u1(s))return null;t[r]=WE(s)}let o={};if(n.agentPresets!==void 0){if(!n.agentPresets||typeof n.agentPresets!="object"||Array.isArray(n.agentPresets))return null;for(let[r,s]of Object.entries(n.agentPresets)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(r))return null;try{let g=Tp(s);if(!g)return null;o[r]=g}catch{return null}}}let i=Object.create(null);if(n.contextEnhancement&&typeof n.contextEnhancement=="object"&&!Array.isArray(n.contextEnhancement))for(let[r,s]of Object.entries(n.contextEnhancement))/^[A-Za-z0-9_-]{1,128}$/.test(r)&&(i[r]=Rp(s));if(n.version===1&&n.deliveryTargets!==void 0)return null;let e=sCe(n.deliveryTargets);if(!e)return null;let a=gCe(n.accessPolicies,t);return{version:n.accessPolicies===void 0?n.version:2,workspaces:t,agentPresets:o,contextEnhancement:i,deliveryTargets:e,accessPolicies:a}}function ICe({version:n,workspaces:t,agentPresets:o,contextEnhancement:i,deliveryTargets:e,accessPolicies:a}){let A={version:n,workspaces:t};return Object.keys(o).length>0&&(A.agentPresets=o),Object.keys(i).length>0&&(A.contextEnhancement=i),n>=2&&Object.keys(e).length>0&&(A.deliveryTargets=e),n>=2&&Object.keys(a).length>0&&(A.accessPolicies=a),A}async function lCe(n,t){await XEe(iCe(n),{recursive:!0,mode:448});let o=`${n}.tmp`;await aCe(o,`${JSON.stringify(t,null,2)} +`,{encoding:"utf8",mode:384}),await ACe(o,n)}async function E1(n){if(typeof n!="string"||!n.trim()||!u1(n.trim())){let i=new Error("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");throw i.code="workspace-not-absolute",i}let t=WE(n.trim()),o;try{o=await tCe(t)}catch(i){let e=new Error("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002",{cause:i});throw e.code="workspace-not-found",e}if(!o.isDirectory()){let i=new Error("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");throw i.code="workspace-not-directory",i}return t}var ra=class{#e;#A;#t=1;#r={};#l={};#o={};#i=Object.create(null);#a=Object.create(null);#n=new Map;#s=1;#p=new Map;#c=1;#g=new Map;#I=new WeakMap;#d=new Set;#h=Promise.resolve();#C=new Map;constructor(t,{defaultWorkspace:o=process.cwd()}={}){if(typeof t!="string"||!t)throw new TypeError("workspace store path is required");this.#e=t,this.#A=WE(o)}async load(){try{let t=cCe(JSON.parse(await $Ee(this.#e,"utf8")));if(!t)throw new Error("dsh-im workspace config is invalid");this.#t=t.version,this.#r=t.workspaces,this.#l=t.agentPresets,this.#o=t.contextEnhancement,this.#i=t.deliveryTargets,this.#a=t.accessPolicies}catch(t){if(t?.code!=="ENOENT")throw t;this.#t=1,this.#r={},this.#l={},this.#o={},this.#i=Object.create(null),this.#a=Object.create(null)}this.#n.clear(),this.#s=1,this.#p.clear(),this.#c=1,this.#g.clear(),this.#d.clear();for(let t of Object.keys(this.#r))this.#n.set(t,this.#u()),this.#p.set(t,this.#B());return this}has(t){let o=xt(t);return Object.hasOwn(this.#r,o)&&!this.#g.has(o)}incarnationFor(t){return this.#p.get(xt(t))??null}workspaceFor(t){return this.#r[xt(t)]??this.#A}agentPresetFor(t){return this.#l[xt(t)]??null}contextEnhancementFor(t){let o=xt(t);return this.has(o)&&Object.hasOwn(this.#o,o)?this.#o[o]:h_}accessPolicyFor(t){let o=xt(t);return this.has(o)&&Object.hasOwn(this.#a,o)?this.#a[o]:null}listDeliveryTargets(t){let o=xt(t);if(!this.has(o))throw ci("unknown-bot","Unknown bot");return Object.entries(this.#i[o]??{}).map(([i,e])=>GI(e,{targetId:i})).sort((i,e)=>i.targetId.localeCompare(e.targetId))}deliveryTargetFor(t,o){let i=xt(t),e=PQ(o);if(!this.has(i))throw ci("unknown-bot","Unknown bot");let a=this.#i[i]?.[e];return a?GI(a,{targetId:e}):null}async createDeliveryTarget(t,o){let i=xt(t),e=GI(o);return this.#S(i,async()=>{if(!this.has(i))throw ci("unknown-bot","Unknown bot");if(Object.hasOwn(this.#i[i]??{},e.targetId))throw ci("target-conflict","Target already exists");let{targetId:a,...A}=e,r={...this.#i,[i]:{...this.#i[i]??{},[a]:A}};return await this.#y(this.#o,r,2),this.#i=r,this.#t=2,GI(A,{targetId:a})})}async updateDeliveryTarget(t,o,i){let e=xt(t),a=PQ(o),A=GI(i,{targetId:a});return this.#S(e,async()=>{if(!this.has(e))throw ci("unknown-bot","Unknown bot");if(!Object.hasOwn(this.#i[e]??{},a))throw ci("unknown-target","Unknown target");let{targetId:r,...s}=A,g={...this.#i,[e]:{...this.#i[e],[a]:s}};return await this.#y(this.#o,g,2),this.#i=g,this.#t=2,GI(s,{targetId:a})})}async deleteDeliveryTarget(t,o){let i=xt(t),e=PQ(o);return this.#S(i,async()=>{if(!this.has(i))throw ci("unknown-bot","Unknown bot");if(!Object.hasOwn(this.#i[i]??{},e))throw ci("unknown-target","Unknown target");let a={...this.#i[i]};delete a[e];let A={...this.#i};return Object.keys(a).length>0?A[i]=a:delete A[i],await this.#y(this.#o,A,2),this.#i=A,this.#t=2,!0})}generationFor(t){return this.#n.get(xt(t))??null}async whenIdle(){await this.#h}async whenBotIdle(t){let o=xt(t);for(;;){let i=this.#C.get(o);if(!i||(await i,this.#C.get(o)===i))return}}async ensure(t,{workspace:o=this.#A,defaultAgentPreset:i,initialAccessPolicy:e}={}){let a=xt(t),A=WE(o);return this.#S(a,async()=>{let r=!this.#r[a],s=e!==void 0&&!Object.hasOwn(this.#a,a);if(r||s){let g=s?Ic(e):void 0,c=r?Tp(i):null,I=Object.hasOwn(this.#l,a),d=this.#l[a],B=s?{...this.#a,[a]:g}:this.#a;r&&(this.#r[a]=A,c&&(this.#l[a]=c),this.#n.set(a,this.#u()),this.#p.set(a,this.#B()));let f=s?2:this.#t;try{await this.#y(this.#o,this.#i,f,B)}catch(Q){throw r&&(delete this.#r[a],I?this.#l[a]=d:delete this.#l[a],this.#n.delete(a),this.#p.delete(a)),Q}this.#a=B,this.#t=f}else this.#n.has(a)||this.#n.set(a,this.#u());return this.#r[a]})}async setWorkspace(t,o,{clearSessions:i,incarnation:e}={}){let a=xt(t);if(!this.has(a)||e!==void 0&&e!==this.incarnationFor(a)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=await E1(o);return this.#S(a,async()=>{if(!this.has(a)||e!==void 0&&e!==this.incarnationFor(a)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}if(A===this.workspaceFor(a))return A;let r=this.#r[a];this.#n.set(a,this.#u()),await i?.(),this.#r[a]=A;try{await this.#y()}catch(s){throw this.#r[a]=r,s}return A})}async setAgentPreset(t,o,{incarnation:i}={}){let e=xt(t);if(!this.has(e)||i!==void 0&&i!==this.incarnationFor(e)){let A=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw A.code="workspace-bot-not-found",A}let a=Tp(o);return this.#S(e,async()=>{if(!this.has(e)||i!==void 0&&i!==this.incarnationFor(e)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=this.#l[e]??null;if(A===a)return a;a?this.#l[e]=a:delete this.#l[e];try{await this.#y()}catch(r){throw A?this.#l[e]=A:delete this.#l[e],r}return a})}async setContextEnhancement(t,o,{incarnation:i}={}){let e=xt(t),a=i===void 0?this.incarnationFor(e):i,A=kI(o);return this.#S(e,async()=>{if(!this.has(e)||a!==this.incarnationFor(e)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}let r={...this.#o,[e]:A};return await this.#y(r),this.#o=r,A})}async setAccessPolicy(t,o,{incarnation:i}={}){let e=xt(t),a=i===void 0?this.incarnationFor(e):i,A=Ic(o);return this.#S(e,async()=>{if(!this.has(e)||a!==this.incarnationFor(e)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}let r={...this.#a,[e]:A};return await this.#y(this.#o,this.#i,2,r),this.#a=r,this.#t=2,A})}async bindWorkspaceSession(t,o,{conversationKey:i,sessionId:e,clearSessions:a,setSession:A,incarnation:r,expectedGeneration:s}={}){let g=xt(t);if(typeof i!="string"||!i||typeof e!="string"||!e)throw new TypeError("conversationKey and sessionId are required");if(typeof a!="function"||typeof A!="function")throw new TypeError("session state callbacks are required");if(!this.has(g)||r!==void 0&&r!==this.incarnationFor(g)){let I=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw I.code="workspace-bot-not-found",I}let c=await N_(await E1(o));return this.#S(g,async()=>{if(!this.has(g)||r!==void 0&&r!==this.incarnationFor(g)){let I=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw I.code="workspace-bot-not-found",I}if(s!==void 0&&s!==this.generationFor(g))throw PI("The bot workspace changed before the session binding could be committed.");if(!await oCe(c,this.workspaceFor(g))){let I=this.#r[g];this.#n.set(g,this.#u()),await a(),this.#r[g]=c;try{await this.#y()}catch(d){throw this.#r[g]=I,d}}return await A(i,e),{workspace:c,sessionId:e,generation:this.#n.get(g)}})}async invalidateSessions(t,{clearSessions:o}={}){let i=xt(t);return this.#S(i,async()=>{this.#n.set(i,this.#u()),await o?.()})}async beginRemoval(t,{clearSessions:o}={}){let i=xt(t);return this.#S(i,async()=>{let e=this.#g.get(i);if(e)return e;let a=Object.freeze({});this.#g.set(i,a),this.#I.set(a,{botId:i,incarnation:this.incarnationFor(i)}),this.#n.set(i,this.#u());try{await o?.()}catch(A){throw this.#g.get(i)===a&&this.#g.delete(i),A}return a})}async abortRemoval(t){let{botId:o}=this.#f(t);return this.#S(o,async()=>this.#g.get(o)!==t?!1:(this.#g.delete(o),Object.hasOwn(this.#r,o)&&(this.#n.set(o,this.#u()),this.#p.has(o)||this.#p.set(o,this.#B())),!0))}async finishRemoval(t){let{botId:o,incarnation:i}=this.#f(t);return this.#S(o,async()=>this.#g.get(o)!==t?{removed:!1,persisted:!0,error:null,stale:!0}:this.incarnationFor(o)!==i?(this.#g.delete(o),{removed:!1,persisted:!0,error:null,stale:!0}):(this.#g.delete(o),this.#Q(o)))}async retireAfterConfigCommit(t){let o=xt(t);return this.#S(o,async()=>(this.#g.delete(o),this.#Q(o)))}flushPendingRemoval(t){if(this.#d.has(t))return this.#S(t,async()=>{this.#d.has(t)&&await this.#m()})}async remove(t){let o=await this.retireAfterConfigCommit(t);if(o.error)throw o.error;return o.removed}async reconcile(t){let o=new Set([...t].map(xt)),i=new Set([...Object.keys(this.#r),...Object.keys(this.#l),...Object.keys(this.#o),...Object.keys(this.#i),...Object.keys(this.#a),...this.#d]);for(let e of i)o.has(e)||await this.remove(e)}decorateStatus(t){return!t||typeof t!="object"||!Array.isArray(t.bots)?t:{...t,bots:t.bots.map(o=>o?.botId?{...o,workspace:this.workspaceFor(o.botId),agentPreset:this.agentPresetFor(o.botId),contextEnhancement:this.contextEnhancementFor(o.botId),accessPolicy:this.accessPolicyFor(o.botId)}:o)}}#u(){let t=this.#s;return this.#s+=1,t}#B(){let t=this.#c;return this.#c+=1,t}#f(t){if(!t||typeof t!="object")throw new TypeError("Invalid workspace removal transaction");let o=this.#I.get(t);if(!o)throw new TypeError("Invalid workspace removal transaction");return o}async#Q(t){let o=Object.hasOwn(this.#r,t),i=Object.hasOwn(this.#l,t),e=Object.hasOwn(this.#o,t),a=Object.hasOwn(this.#i,t),A=Object.hasOwn(this.#a,t),r=o||i||e||a||A||this.#d.has(t);if(delete this.#r[t],delete this.#l[t],delete this.#o[t],delete this.#i[t],delete this.#a[t],this.#n.delete(t),this.#p.delete(t),!r)return{removed:!1,persisted:!0,error:null,stale:!1};try{return await this.#m(),{removed:o,persisted:!0,error:null,stale:!1}}catch(s){return this.#d.add(t),{removed:o,persisted:!1,error:s,stale:!1}}}async#S(t,o){let i=this.#h.then(o,o),e=i.then(()=>{},()=>{});return this.#h=e,this.#C.set(t,e),e.finally(()=>{this.#C.get(t)===e&&this.#C.delete(t)}),i}async#y(t=this.#o,o=this.#i,i=this.#t,e=this.#a){await lCe(this.#e,ICe({version:i,workspaces:this.#r,agentPresets:this.#l,contextEnhancement:t,deliveryTargets:o,accessPolicies:e})),this.#d.clear()}async#m(){if(Object.keys(this.#r).length>0||Object.keys(this.#l).length>0||Object.keys(this.#o).length>0||Object.keys(this.#i).length>0||Object.keys(this.#a).length>0){await this.#y();return}try{await rCe(this.#e),this.#d.clear()}catch(t){if(t?.code!=="ENOENT")throw t;this.#d.clear()}}};function VE(n){if(!n)return null;let t=typeof n=="function"?n():n;return t&&typeof t.then=="function"?t.then($n):$n(t)}function B1(){let n=new Error("Agent Preset \u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u7528\u3002");return n.code="agent-preset-unavailable",n}function Lp(n){if(n())return;let t=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw t.code="workspace-bot-not-found",t}function C1(n,t,o){let i=e=>{let a=n.decorateStatus(e);if(!o||!a||typeof a!="object")return a;let A=s=>s?{...a,agentPresetCatalog:s}:a,r=VE(o);return r&&typeof r.then=="function"?r.then(A):A(r)};return t&&typeof t.then=="function"?t.then(i):i(t)}function pCe(n){return Promise.resolve(n.status())}function Ha(n,{workspaces:t,method:o="remove",botIdFromRemoved:i=A=>A?.botId,saveMethod:e="save",botIdFromSave:a=A=>A?.botId}){if(!n||!t||typeof n[o]!="function")throw new TypeError("configStore removal observer dependencies are required");return new Proxy(n,{get(A,r){let s=Reflect.get(A,r,A);return r===o?async(...g)=>{let c=await s.apply(A,g),I=c?i(c,g):null;return I&&await t.retireAfterConfigCommit(I),c}:r===e&&typeof s=="function"?(...g)=>{let c=t.flushPendingRemoval(a(g[0],g));return c?c.then(()=>s.apply(A,g)):s.apply(A,g)}:typeof s=="function"?s.bind(A):s}})}function Ka(n,{botId:t,workspaces:o,state:i,agentPresetCatalog:e}={}){if(!n||!o||!i)throw new TypeError("harness, workspaces, and state are required");let a=o.incarnationFor(t),A=()=>o.has(t)&&o.incarnationFor(t)===a,r=async(I=e)=>{let d;try{d=await VE(I)??$n(null)}catch(B){throw Lp(A),B}return Lp(A),{agentPreset:o.agentPresetFor(t),agentPresetCatalog:d}},s=new Map,g=new Proxy(n,{get(I,d){if(d==="agentPresetSettings")return async(f={})=>{f?.signal?.throwIfAborted(),Lp(A);let Q=await r();return f?.signal?.throwIfAborted(),Q};if(d==="updateAgentPreset")return async(f,Q={})=>{Q?.signal?.throwIfAborted(),Lp(A);let y=f==="--default"?null:Tp(f),m=null;if(y&&({agentPresetCatalog:m}=await r(),Q?.signal?.throwIfAborted(),!m.items.some(T=>T.id===y)))throw B1();if(await o.setAgentPreset(t,y,{incarnation:a}),Lp(A),m)return{agentPreset:o.agentPresetFor(t),agentPresetCatalog:m};try{return await r()}catch(T){if(T?.code==="workspace-bot-not-found")throw T;return Lp(A),{agentPreset:o.agentPresetFor(t),agentPresetCatalog:$n(null)}}};if(d==="currentWorkspace")return()=>{if(!A()){let f=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw f.code="workspace-bot-not-found",f}return o.workspaceFor(t)};if(d==="assertWorkspaceScope")return()=>{if(!A()){let f=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw f.code="workspace-bot-not-found",f}};if((d==="listWorkspaces"||d==="listWorkspaceSessions"||d==="listModels")&&typeof I[d]=="function")return async(...f)=>{if(!A()){let y=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw y.code="workspace-bot-not-found",y}let Q=await I[d](...f);if(!A()){let y=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw y.code="workspace-bot-not-found",y}return Q};if(d==="switchWorkspace")return f=>{if(!A()){let Q=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");return Q.code="workspace-bot-not-found",Promise.reject(Q)}return o.setWorkspace(t,f,{clearSessions:()=>i.clearSessions(),incarnation:a})};if(d==="bindWorkspaceSession")return async(f,Q)=>{if(typeof f!="string"||!f||typeof Q!="string"||!Q)throw new TypeError("conversationKey and sessionId are required");if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(typeof I.adoptWorkspaceSession!="function")throw new TypeError("Harness does not support adopting workspace sessions");let y=o.generationFor(t),m=await I.adoptWorkspaceSession(Q);if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(y!==o.generationFor(t))throw PI("The bot workspace changed while the session was being adopted.");if(!m||typeof m!="object"||m.sessionId!==Q||typeof m.workspace!="string")throw new TypeError("Harness returned an invalid adopted workspace session");let T=await o.bindWorkspaceSession(t,m.workspace,{conversationKey:f,sessionId:Q,clearSessions:()=>i.clearSessions(),setSession:(_,R)=>i.setSession(_,R),incarnation:a,expectedGeneration:y});if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(T.generation!==o.generationFor(t))throw PI("The bot workspace changed before the session binding completed.");return s.set(Q,T.generation),{...m,workspace:T.workspace,sessionId:T.sessionId}};if(d==="createSession")return async(f={})=>{if(await o.whenBotIdle(t),!A()){let T=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw T.code="workspace-bot-not-found",T}let Q=o.generationFor(t),y=o.agentPresetFor(t),m=await I.createSession({...f,workspace:o.workspaceFor(t),...y==null?{}:{agentPreset:y}});return s.set(m,Q),m};if(d==="workspaceSession")return f=>{if(typeof f!="string"||!f)throw new TypeError("sessionId is required");let Q=s.get(f)??o.generationFor(t);s.delete(f);let y=()=>A()&&Q===o.generationFor(t),m=async(_,R,K)=>{if(!y())throw PI(`The bot workspace changed before this ${K} started.`);let L=await I[_](f,...R);if(!y())throw PI(`The bot workspace changed while this ${K} was running.`);return L},T=async(_,R,K)=>{if(!y())throw PI(`The bot workspace changed before this ${K} started.`);return I[_](f,...R)};return Object.freeze({sessionId:f,async sessionExists(..._){if(!y())return!1;let R=await I.sessionExists(f,..._);return y()&&R},models(..._){return m("getSessionModels",_,"model listing")},readHistory(..._){return m("readSessionHistory",_,"history read")},selectModel(..._){return m("selectSessionModel",_,"model selection")},isRunning(..._){return m("isSessionRunning",_,"run-state check")},hasActiveTurn(..._){return m("hasActiveTurn",_,"turn ownership check")},stopActiveTurn(..._){return T("stopActiveTurn",_,"turn stop")},steerActiveTurn(..._){return T("steerActiveTurn",_,"turn steering")},ask(..._){if(!y())throw PI("The bot workspace changed before this prompt started.");return I.ask(f,..._)}})};if(d==="sessionExists")return(f,...Q)=>{if(!A())return!1;let y=s.get(f);return y!==void 0&&y!==o.generationFor(t)?(s.delete(f),!1):I.sessionExists(f,...Q)};if(d==="ask")return(f,...Q)=>{let y=s.get(f);if(s.delete(f),!A()||y!==void 0&&y!==o.generationFor(t)){let m=new Error("The bot workspace changed before this prompt started.");throw m.code=Ga,m}return I.ask(f,...Q)};if(d==="executeCommand"&&typeof I.executeCommand=="function")return(f,...Q)=>{let y=s.get(f);if(s.delete(f),!A()||y!==void 0&&y!==o.generationFor(t)){let m=new Error("The bot workspace changed before this command started.");throw m.code=Ga,m}return I.executeCommand(f,...Q)};let B=Reflect.get(I,d,I);return typeof B=="function"?B.bind(I):B}}),c=new Proxy(i,{get(I,d){if(d===KM)return I;if(d==="sessionFor")return(f,...Q)=>{if(!A())return null;let y=I.sessionFor(f,...Q);return y&&!s.has(y)&&s.set(y,o.generationFor(t)),y};if(d==="setSession")return(f,Q,...y)=>{let m=s.get(Q);return!A()||m!==void 0&&m!==o.generationFor(t)?(s.delete(Q),!1):I.setSession(f,Q,...y)};let B=Reflect.get(I,d,I);return typeof B=="function"?B.bind(I):B}});return Object.freeze({harness:g,state:c})}function xa(n,{workspaces:t,stateFor:o,agentPresetCatalog:i}={}){if(!n||!t||typeof o!="function")throw new TypeError("controller, workspaces, and stateFor are required");let e=new Map,a=(d,B)=>{let Q=(e.get(d)??Promise.resolve()).catch(()=>{}).then(B);return e.set(d,Q),Q.finally(()=>{e.get(d)===Q&&e.delete(d)})},A=d=>C1(t,d,i),r=(d,B)=>{let f=t.incarnationFor(d);return a(d,async()=>{if(!(await n.status())?.bots?.some(m=>m?.botId===d)){let m=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw m.code="workspace-bot-not-found",m}let y=await o(d);return await t.setWorkspace(d,B,{clearSessions:()=>y.clearSessions(),incarnation:f}),A(await n.status())})},s=(d,B)=>{let f=t.incarnationFor(d),Q=Tp(B);return a(d,async()=>{if(!(await n.status())?.bots?.some(T=>T?.botId===d)){let T=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw T.code="workspace-bot-not-found",T}let m=Q&&i?await VE(i):null;if(Q&&i&&!m?.items.some(T=>T.id===Q))throw B1();return await t.setAgentPreset(d,Q,{incarnation:f}),C1(t,await n.status(),m??i)})},g=(d,B,f)=>{let Q=t.incarnationFor(d),y=kI(B);return a(d,async()=>{let m=await n.status();if(!m?.bots?.some(L=>L?.botId===d)){let L=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw L.code="workspace-bot-not-found",L}let T=await VE(i),_=t.decorateStatus(m),R={..._,bots:_.bots.map(L=>L?.botId===d?{...L,contextEnhancement:y}:L),...T?{agentPresetCatalog:T}:{}},K=f?await f(R):R;return await t.setContextEnhancement(d,y,{incarnation:Q}),K})},c=(d,B,f)=>{let Q=t.incarnationFor(d),y=Ic(B);return a(d,async()=>{let m=await n.status();if(!m?.bots?.some(L=>L?.botId===d)){let L=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw L.code="workspace-bot-not-found",L}let T=await VE(i),_=t.decorateStatus(m),R={..._,bots:_.bots.map(L=>L?.botId===d?{...L,accessPolicy:y}:L),...T?{agentPresetCatalog:T}:{}},K=f?await f(R):R;return await t.setAccessPolicy(d,y,{incarnation:Q}),K})},I=(d,B)=>a(d,async()=>{let f=await t.beginRemoval(d,{clearSessions:async()=>{try{let Q=await o(d);if(!Q||typeof Q.clearSessions!="function")throw new TypeError("bot state does not support session cleanup");await Q.clearSessions()}catch(Q){console.warn(`[dsh-im] ignored session cleanup failure while deleting bot ${d}:`,Q?.message??Q)}}});try{let Q=await B();return await t.finishRemoval(f),A(Q)}catch(Q){let y=await pCe(n).catch(()=>null);throw Array.isArray(y?.bots)&&!y.bots.some(T=>T?.botId===d)?await t.finishRemoval(f):await t.abortRemoval(f),Q}});return new Proxy(n,{get(d,B){if(B==="updateWorkspace")return r;if(B==="updateAgentPreset")return s;if(B==="updateContextEnhancement")return g;if(B==="updateAccessPolicy")return c;let f=Reflect.get(d,B,d);return typeof f!="function"?f:B==="deleteBot"?(Q,...y)=>I(Q,()=>f.call(d,Q,...y)):B==="disconnect"?async(...Q)=>{let m=(await d.status())?.bots?.[0]?.botId;return m?I(m,()=>f.apply(d,Q)):A(f.apply(d,Q))}:(...Q)=>A(f.apply(d,Q))}})}var f1=new Set(["weixin","feishu","dingtalk","wecom","qq","slack","telegram","discord","whatsapp"]);function dCe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function hCe(n){return typeof n=="string"&&n.length>0&&n.length<=512&&n.trim()===n&&!/[\s:\u0000-\u001f\u007f]/u.test(n)}function R_(n,t){let o=`${t}:`;if(!n.startsWith(o))return null;let i=n.slice(o.length);return hCe(i)?i:null}function ZE(n,t){for(let[o,i,e]of t){let a=R_(n,o);if(a)return{kind:i,route:{[e]:a}}}return null}function ECe(n){let t=R_(n,"p2p");return t?.startsWith("ou_")?{kind:"user",route:{openId:t}}:ZE(n,[["group","group","chatId"]])}function CCe(n){let t=R_(n,"direct");if(t&&/^[A-Za-z0-9_-]{1,128}$/.test(t))return{kind:"conversation",route:{channelId:t}};let o=/^group:([^:]+):(\d{1,20}(?:\.\d{1,20})?)$/.exec(n);return!o||!/^[A-Za-z0-9_-]{1,128}$/.test(o[1])?null:{kind:"thread",route:{channelId:o[1],threadTs:o[2]}}}function uCe(n){let t=/^(direct|group):(-?\d+)(?::([1-9]\d*))?$/.exec(n);if(!t)return null;let o=Number(t[2]);if(!Number.isSafeInteger(o)||t[1]==="direct"&&t[3]!==void 0)return null;if(t[3]===void 0)return{kind:"chat",route:{chatId:t[2]}};let i=Number(t[3]);return!Number.isSafeInteger(i)||i<=0?null:{kind:"topic",route:{chatId:t[2],messageThreadId:i}}}function BCe(n){let t=/^(?:direct|group):(\d{1,32})$/.exec(n);return t?{kind:"channel",route:{channelId:t[1]}}:null}function fCe(n){let t=/^direct:(\d{5,32}@(s\.whatsapp\.net|lid))$/.exec(n);if(t)return{kind:"user",route:{jid:t[1]}};let o=/^group:(\d{5,32}(?:-\d{1,32})?@g\.us)$/.exec(n);return o?{kind:"group",route:{jid:o[1]}}:null}function QCe(n,t){if(!f1.has(n)||typeof t!="string")return null;switch(n){case"weixin":return ZE(t,[["p2p","user","toUserId"]]);case"feishu":return ECe(t);case"dingtalk":return ZE(t,[["p2p","user","userId"],["group","group","openConversationId"]]);case"wecom":return ZE(t,[["direct","user","chatId"],["group","group","chatId"]]);case"qq":return ZE(t,[["c2c","user","userOpenId"],["group","group","groupOpenId"]]);case"slack":return CCe(t);case"telegram":return uCe(t);case"discord":return BCe(t);case"whatsapp":return fCe(t);default:return null}}function Q1(n,t){if(!f1.has(n)||!dCe(t))return[];let o=[],i=new Set;for(let e of Object.keys(t)){let a=QCe(n,e);if(!a)continue;let A=JSON.stringify(a);i.has(A)||(i.add(A),o.push(a))}return o}var yCe=new Set(["weixin","feishu","dingtalk","wecom","qq","slack","telegram","discord","whatsapp"]);function FQ(n){return yCe.has(n)}function pc(n){let t=new Error(n);return t.code="invalid-target",t}function mCe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function k_(n,t,o){if(!mCe(n))throw pc(`${o} must be an object`);if(Object.keys(n).find(e=>!t.includes(e))!==void 0)throw pc(`${o} contains an unknown field`)}function GQ(n,t){if(typeof n!="string"||!n||n.trim()!==n)throw pc(`${t} must be a non-empty string without surrounding whitespace`);return n}function SCe(n){if(typeof n!="string"||!n.trim()||n.trim().length>80)throw pc("target.name must contain 1 to 80 characters");return n.trim()}function lc(n,t){k_(n,t,"route");let o={};for(let i of t)o[i]=GQ(n[i],`route.${i}`);return o}function lg(n,t){if(!t.includes(n))throw pc("target kind is not supported by this channel");return n}function wCe(n,t,o){switch(n){case"weixin":return lg(t,["user"]),lc(o,["toUserId"]);case"feishu":return lg(t,["user","group"]),lc(o,t==="user"?["openId"]:["chatId"]);case"dingtalk":return lg(t,["user","group"]),lc(o,t==="user"?["userId"]:["openConversationId"]);case"wecom":return lg(t,["user","group"]),lc(o,["chatId"]);case"qq":return lg(t,["user","group"]),lc(o,t==="user"?["userOpenId"]:["groupOpenId"]);case"slack":return lg(t,["conversation","thread"]),lc(o,t==="conversation"?["channelId"]:["channelId","threadTs"]);case"telegram":{lg(t,["chat","topic"]),k_(o,t==="chat"?["chatId"]:["chatId","messageThreadId"],"route");let i=GQ(o.chatId,"route.chatId");if(!/^-?\d+$/.test(i))throw pc("route.chatId must be a decimal string");if(t==="chat")return{chatId:i};if(!Number.isSafeInteger(o.messageThreadId)||o.messageThreadId<=0)throw pc("route.messageThreadId must be a positive integer");return{chatId:i,messageThreadId:o.messageThreadId}}case"discord":return lg(t,["channel"]),lc(o,["channelId"]);case"whatsapp":{lg(t,["user","group"]);let i=lc(o,["jid"]);if(!(t==="user"?/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(i.jid):/^\d{5,32}(?:-\d{1,32})?@g\.us$/.test(i.jid)))throw pc(`route.jid must be a ${t} WhatsApp JID`);return i}default:throw new TypeError(`Unsupported delivery channel: ${n}`)}}function Up(n,t,{targetIdRequired:o=!0}={}){if(!FQ(n))throw new TypeError(`Unsupported delivery channel: ${n}`);k_(t,o?["targetId","name","kind","route"]:["name","kind","route"],"target");let i={};return o&&(i.targetId=GQ(t.targetId,"target.targetId")),t.name!==void 0&&(i.name=SCe(t.name)),i.kind=GQ(t.kind,"target.kind"),i.route=wCe(n,i.kind,t.route),i}function Ya({channel:n,workspaces:t,coreController:o,stateFor:i}){if(!FQ(n))throw new TypeError(`Unsupported delivery channel: ${n}`);if(!t||typeof t!="object")throw new TypeError("delivery adapter requires a workspace store");if(!o||typeof o!="object")throw new TypeError("delivery adapter requires a proactive text controller");if(typeof i!="function")throw new TypeError("delivery adapter requires a bot state getter");return Object.freeze({channel:n,ownsBot:e=>t.has(e),listTargets:e=>t.listDeliveryTargets(e),async listSuggestions(e){let a=await i(e);if(!a||typeof a.snapshot!="function")throw new TypeError("delivery suggestion state cannot be inspected");return Q1(n,a.snapshot()?.sessions).map(r=>Up(n,r,{targetIdRequired:!1}))},createTarget:(e,a)=>t.createDeliveryTarget(e,Up(n,a)),updateTarget:(e,a,A)=>t.updateDeliveryTarget(e,a,Up(n,A,{targetIdRequired:!1})),deleteTarget:(e,a)=>t.deleteDeliveryTarget(e,a),async sendText(e,a,A,r={}){let s=Up(n,a);if(typeof o.sendProactiveText!="function")throw new TypeError("delivery controller cannot send proactive text");return await o.sendProactiveText(e,s,A,r),{sent:!0}}})}var y1=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function DCe(n){if(!Array.isArray(n)||n.length===0)return[...y1];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...y1]}var LQ=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=DCe(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(i{let A={namespace:"commands",method:"execute",args:{agentId:i,line:e,images:[]},signal:a.signal};try{return await o.invoke(A)}catch(r){if(r?.name!=="TypertGatewayError"||r.code!=="arguments-invalid"||r.endpoint!=="commands/execute"||r.message!=='typert gateway: commands/execute: args fields do not match the descriptor: unexpected "images"')throw r;return a.signal?.throwIfAborted(),o.invoke({...A,args:{agentId:i,line:e}})}}}}import{randomUUID as P_}from"node:crypto";var UQ=new WeakMap;function OCe(n){let t=n?.failure;return t&&typeof t=="object"&&typeof t.code=="string"&&typeof t.message=="string"?{code:t.code,message:t.message,details:t.details&&typeof t.details=="object"?t.details:{}}:n?.name==="AbortError"||n?.name==="RemoteInvocationCancelled"?{code:"cancelled",message:n instanceof Error?n.message:"Harness request was cancelled",details:{}}:{code:"internal",message:n instanceof Error?n.message:String(n),details:{}}}function fn(n,t){return Promise.resolve().then(t).then(o=>({rpcId:n.rpcId,result:{ok:!0,value:o}}),o=>({rpcId:n.rpcId,result:{ok:!1,error:OCe(o)}}))}function m1(n,t,o,i){return{namespace:n,method:t,args:o,...i===void 0?{}:{signal:i}}}function HQ(n,t){let o=new Error(n);return o.name="UserQuestionError",o.code=t,o}function bCe(n,t){return!n||typeof n!="object"||n.sessionId!==t.sessionId||!n.answer||typeof n.answer!="object"||!Array.isArray(n.answer.answers)||n.answer.answers.length!==t.questions.length?!1:n.answer.answers.every((o,i)=>{let e=t.questions[i];if(!o||typeof o!="object"||o.id!==e.id||!Array.isArray(o.selected)||o.selected.some(r=>typeof r!="string")||new Set(o.selected).size!==o.selected.length||o.custom!==void 0&&typeof o.custom!="string")return!1;let a=o.custom?.trim();if(a!==void 0&&!a||e.multiSelect!==!0&&(a!==void 0&&o.selected.length>0||o.selected.length>1))return!1;let A=new Set(e.options?.map(r=>r.label)??[]);return o.selected.every(r=>A.has(r))})}function MCe(n){if(n?.type==="event"&&n.event&&typeof n.event=="object")return[{event:n.event}];let t=n?.type==="chunks"?n.event:null;if(!t||typeof t!="object")throw new Error("Harness returned an invalid session history record");let{data:o}=t,i=t.type,e=i==="chunkrow/tool-call-chunks"?o?.args:o?.texts;if(!o||!Array.isArray(e)||e.length===0||e.some(A=>typeof A!="string")||!Array.isArray(o.dt)||o.dt.length!==e.length-1)throw new Error("Harness returned an invalid packed session chunk");let a=t.time;return e.map((A,r)=>{r>0&&(a+=o.dt[r-1]);let s;if(i==="chunkrow/text-chunks")s={type:"text-delta",index:o.index,text:A};else if(i==="chunkrow/reasoning-chunks")s={type:"reasoning-delta",index:o.index,text:A};else if(i==="chunkrow/tool-call-chunks")s={type:"tool-call-delta",index:o.index,id:o.id,...Object.hasOwn(o,"name")?{name:o.name}:{},argumentsDelta:A};else throw new Error(`Harness returned an unsupported packed session chunk: ${String(i)}`);return{event:{type:"assistant/chunk",seq:t.seq+r,time:a,data:{turn:o.turn,step:o.step,chunk:s}}}})}function S1(n){if(!Array.isArray(n))throw new Error("Harness returned invalid session history records");return n.flatMap(MCe)}var G_=class{#e=[];#A=null;#t=!1;#r;#l;#o;constructor(t,o){this.#r=t,this.#o=o,this.#l=()=>this.close(),t?.addEventListener("abort",this.#l,{once:!0}),t?.aborted&&this.close()}push(t){if(!this.#t)if(this.#A){let o=this.#A;this.#A=null,o({value:t,done:!1})}else this.#e.push(t)}next(){return this.#e.length>0?Promise.resolve({value:this.#e.shift(),done:!1}):this.#t?Promise.resolve({value:void 0,done:!0}):new Promise(t=>{this.#A=t})}return(){return this.close(),Promise.resolve({value:void 0,done:!0})}close(){if(!this.#t&&(this.#t=!0,this.#r?.removeEventListener("abort",this.#l),this.#o?.(),this.#o=null,this.#A)){let t=this.#A;this.#A=null,t({value:void 0,done:!0})}}[Symbol.asyncIterator](){return this}},F_=class{#e;#A;#t=new Set;#r=new Map;#l=new Map;#o=new Map;#i=[];#a=!1;constructor(t,o,i){this.#e=o,this.#A=i,this.host=Object.freeze({describe:e=>fn(e,()=>({ready:!0,transport:"typert"}))}),this.workspace=Object.freeze({list:(e,a)=>fn(e,()=>this.#p(a)),create:(e,a)=>fn(e,()=>this.#n("workspace","create",{request:e.payload},a))}),this.sessions=Object.freeze({list:(e,a)=>fn(e,()=>this.#n("session","list",{_request:e.payload},a)),create:(e,a)=>fn(e,()=>this.#n("session","create",{request:e.payload},a)),history:(e,a)=>fn(e,()=>this.#g(e.payload,a)),prompt:(e,a)=>fn(e,()=>this.#n("session","prompt",{request:{requestId:e.rpcId,...e.payload}},a)),cancel:(e,a)=>fn(e,()=>this.#n("session","cancel",{request:{sessionId:e.payload.sessionId}},a)),models:(e,a)=>fn(e,()=>this.#h(e.payload.sessionId,a)),selectModel:(e,a)=>fn(e,()=>this.#n("session","selectModel",{request:e.payload},a))}),this.llm=Object.freeze({models:(e,a)=>fn(e,async()=>{let A=await this.#d(a);return{groups:A.groups,failures:A.failures}})}),this.events=Object.freeze({mux:(e,a)=>this.#C(a)}),this.respond=e=>Promise.resolve(this.#m(e)),typeof t?.on=="function"&&(this.#i.push(t.on("session/event",(e,a)=>{let A=e?.id;typeof A!="string"||!a||typeof a!="object"||(Number.isSafeInteger(a.seq)&&this.#I(A,a.seq),this.#u({type:"session/event",sessionId:A,event:a}))},{global:!0})),this.#i.push(t.on("approval/request",(e,a)=>this.#y(e,a),{global:!0,prepend:!0})),this.#i.push(t.on("user-questions/request",(e,a)=>this.#Q(e,a),{global:!0,prepend:!0})))}async#n(t,o,i,e){return this.#e.invoke(m1(t,o,i,e))}async#s(t,o,i,e){let a=new AbortController,A=e?AbortSignal.any([e,a.signal]):a.signal,r;try{r=(await this.#e.stream(m1(t,o,i,A)))[Symbol.asyncIterator]();let g=await r.next();if(g.done)throw new Error(`Harness ${t}.${o} stream ended before its baseline`);return g.value}finally{a.abort(new DOMException("Baseline received","AbortError")),await Promise.resolve(r?.return?.()).catch(()=>{})}}async#p(t){let o=await this.#s("workspace","follow",{},t);if(o?.type!=="baseline"||!o.value||typeof o.value!="object")throw new Error("Harness workspace.follow returned no baseline");return o.value}async#c(t,o,i){let e=await this.#s("session","follow",{request:{address:{kind:"session",sessionId:t},maxMessages:o}},i);if(e?.type!=="snapshot"||!Number.isSafeInteger(e.cursor))throw new Error("Harness session.follow returned no snapshot");return this.#I(t,e.cursor),e}async#g(t,o){let{sessionId:i,maxMessages:e=50,beforeSeq:a}=t,A=this.#o.get(i);if(A===void 0){let s=await this.#c(i,e,o);if(A=this.#o.get(i)??s.cursor,a===void 0&&A===s.cursor)return{events:S1(s.records),hasMore:s.hasMore===!0,...s.projections===void 0?{}:{projections:s.projections}}}let r=await this.#n("session","page",{request:{address:{kind:"session",sessionId:i},throughSeq:A,maxMessages:e,...a===void 0?{}:{beforeSeq:a}}},o);return{events:S1(r.records),hasMore:r.hasMore===!0}}#I(t,o){let i=this.#o.get(t);(i===void 0||o>i)&&this.#o.set(t,o)}#d(t){return this.#n("session","modelCatalog",{},t)}async#h(t,o){let[i,e]=await Promise.all([this.#d(o),this.#n("session","list",{_request:{}},o)]),a=e?.items?.find(s=>s?.sessionId===t);if(!a){let s=new Error(`session "${t}" not found`);throw s.failure={code:"session-not-found",message:s.message,details:{sessionId:t}},s}let A=a.projections?.values?.modelSelection,r=A?.next??A?.lastUsed??i.default;return{current:r,routable:i.routableProviders.includes(r.provider),groups:i.groups,failures:i.failures}}#C(t){let o;o=new G_(t,()=>this.#t.delete(o)),this.#t.add(o);for(let i of this.#r.values())o.push(this.#f(i));for(let i of this.#l.values())o.push(this.#S(i));return o}#u(t,o=P_()){let i={rpcId:o,payload:t};for(let e of this.#t)e.push(i)}#B(t){let o=t?.session?.id??t?.id;return typeof o!="string"||!t?.session||!Array.isArray(t.session.events)?null:d1(this.#A,o,t.session.events)?{sessionId:o,session:t.session}:null}#f(t){return{rpcId:t.rpcId,payload:{type:"question/requested",sessionId:t.sessionId,questions:t.questions}}}#Q(t,o){let i=this.#B(t?.agent);return i?t.signal?.aborted?Promise.reject(HQ("ask_user_question was aborted before the user answered","ASK_ABORTED")):new Promise((e,a)=>{let A={rpcId:P_(),sessionId:i.sessionId,questions:t.questions,signal:t.signal,settle:(s,g)=>{this.#r.delete(A.rpcId)&&(t.signal?.removeEventListener("abort",r),this.#u({type:"question/resolved",sessionId:A.sessionId,questionRpcId:A.rpcId,outcome:s}),s==="answered"?e(g):a(g))}},r=()=>A.settle("cancelled",HQ("ask_user_question was aborted before the user answered","ASK_ABORTED"));this.#r.set(A.rpcId,A),t.signal?.addEventListener("abort",r,{once:!0}),this.#u(this.#f(A).payload,A.rpcId)}):o()}#S(t){return{rpcId:t.rpcId,payload:{type:"approval/requested",sessionId:t.sessionId,approvalId:t.approvalId,toolName:t.toolName,...t.callId===void 0?{}:{callId:t.callId},...t.reason===void 0?{}:{reason:t.reason}}}}#y(t,o){let i=this.#B(t?.agent);if(!i)return o();if(t.signal?.aborted)return Promise.resolve("cancelled");let e=new Set([...this.#l.values()].map(r=>r.approvalId)),a=new Set,A;for(let r=i.session.events.length-1;r>=0;r-=1){let s=i.session.events[r];if(s.type==="approval/decided")a.add(s.data?.id);else if(s.type==="approval/asked"){let g=s.data?.id;if(!g||a.has(g)||e.has(g)||(t.callId??null)!==(s.data?.callId??null))continue;A=g;break}}return A===void 0?o():new Promise(r=>{let s={rpcId:P_(),sessionId:i.sessionId,approvalId:A,toolName:t.toolName,callId:t.callId,reason:t.reason,settle:c=>{this.#l.delete(s.rpcId)&&(t.signal?.removeEventListener("abort",g),this.#u({type:"approval/resolved",sessionId:s.sessionId,approvalId:s.approvalId,outcome:c}),r(c))}},g=()=>s.settle("cancelled");this.#l.set(s.rpcId,s),t.signal?.addEventListener("abort",g,{once:!0}),this.#u(this.#S(s).payload,s.rpcId)})}#m(t){let o=this.#l.get(t?.rpcId);if(o){let a=t?.result?.value;return t?.result?.ok!==!0||!a||typeof a!="object"||a.sessionId!==o.sessionId||a.approvalId!==o.approvalId||a.outcome!=="allowed-once"&&a.outcome!=="rejected"?{accepted:!1,reason:"bad-response"}:(o.settle(a.outcome),{accepted:!0})}let i=this.#r.get(t?.rpcId);if(!i)return{accepted:!1,reason:"not-pending"};if(t?.result?.ok!==!0)return t?.result?.error?.code!=="cancelled"?{accepted:!1,reason:"bad-response"}:(i.settle("cancelled",HQ("the user cancelled ask_user_question","ASK_CANCELLED")),{accepted:!0});if(!bCe(t.result.value,i))return{accepted:!1,reason:"bad-response"};let e={answers:t.result.value.answer.answers.map(a=>({id:a.id,selected:[...a.selected],...a.custom===void 0?{}:{custom:a.custom}}))};return i.settle("answered",e),{accepted:!0}}dispose(){if(!this.#a){this.#a=!0;for(let t of[...this.#t])t.close();for(let t of[...this.#l.values()])t.settle("cancelled");for(let t of[...this.#r.values()])t.settle("cancelled",HQ("dsh-im interaction adapter was disposed","ASK_ABORTED"));for(let t of this.#i.splice(0).reverse())t?.()}}};function w1(n){let t=n?.root??n;if(!t||!["object","function"].includes(typeof t))throw new TypeError("dsh-im requires a Cordis Host context");let o=UQ.get(t);if(o)return o;let i=n?.typertGateway;if(!i||typeof i.invoke!="function"||typeof i.stream!="function")throw new TypeError("dsh-im requires the modern Host Typert gateway");let e=new F_(n,i,t);return UQ.set(t,e),typeof n.effect=="function"&&n.effect(()=>()=>{UQ.get(t)===e&&UQ.delete(t),e.dispose()},"dsh-im: modern Harness compatibility API"),e}function _Ce(n,t){return n&&Object.hasOwn(n,t)?n[t]:typeof n?.get=="function"?n.get(t):void 0}function aa(n,t={}){return t.harnessBaseUrl!==void 0?{baseUrl:new URL(t.harnessBaseUrl)}:{apiProxy:_Ce(n,"apiProxy")??w1(n),interactionScope:n.root??n}}import{randomUUID as TCe}from"node:crypto";function NCe(n){if(typeof n?.get!="function")return;let t;try{t=n.get("agents")}catch{return}if(t!=null){if(typeof t.get!="function")throw new TypeError('dsh-im requires a callable AgentRegistry when ctx.get("agents") is present');return t}}function RCe(n,t,o){if(n?.status!=="running")return!1;let i=n?.session?.events;if(!Array.isArray(i))return!1;let e=null,a=!1;for(let A of i){if(A?.type==="turn/start"){e=A.data?.turn??null,a=!1;continue}if(A?.type==="turn/end"&&A.data?.turn===e){e=null,a=!1;continue}e===t&&A?.type==="user/message"&&A.data?.source?.rpcId===o&&(a=!0)}return e===t&&a}function D1(n){if(!n||typeof n!="object"||Object.isFrozen(n))return n;for(let t of Object.values(n))D1(t);return Object.freeze(n)}function kCe(n){return D1({id:TCe(),role:"user",content:[{type:"text",text:n}],source:{kind:"user"}})}function vCe(n){let t=new Error("Session is busy with an active turn or maintenance task",{cause:n});return t.code="agent-busy",t}function PCe(n){return({sessionId:t,expectedTurn:o,promptRpcId:i,action:e,text:a})=>{let A=n.get(t);if(A){if(!RCe(A,o,i))return!1;if(e==="stop")return A.cancel({kind:"user"},{keepInbox:!0}),!0;if(e==="steer")return typeof a!="string"||!a.trim()?!1:(A.inject(kCe(a)),!0);throw new TypeError(`Unsupported Harness control action: ${String(e)}`)}}}function GCe(n){return({sessionId:t,operation:o})=>{if(typeof o!="function")throw new TypeError("maintenance operation is required");let i=n.get(t);if(!i)return o();try{return i.runMaintenance(e=>{if(n.get(t)!==i){let a=new Error("Session agent changed before maintenance started");throw a.code="agent-unavailable",a}return o(e)})}catch(e){throw vCe(e)}}}function FCe(n){return({sessionId:t,workspace:o,files:i,signal:e})=>{let A=n.get(t)?.session?.header?.cwd,r=typeof A=="string"&&A?A:o;if(typeof r!="string"||!r)throw new Ro("inbound-file-workspace-unavailable","The Harness Session workspace is unavailable for inbound files.");return TY({files:i},{workspace:r,signal:e})}}function Ja(n,t={}){let{controlExecutor:o,sessionMaintenanceExecutor:i,fileIngressExecutor:e}=t;if(o!==void 0&&typeof o!="function")throw new TypeError("controlExecutor must be a function");if(i!==void 0&&typeof i!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("fileIngressExecutor must be a function");let a=o&&i&&e?void 0:NCe(n);return{controlExecutor:o??(a?PCe(a):void 0),sessionMaintenanceExecutor:i??(a?GCe(a):void 0),fileIngressExecutor:e??FCe(a??{get:()=>{}})}}function O1(n){return n.map(t=>({id:t,canExecuteCommands:!0}))}function pg(n=[]){return bQ({mode:"open",open:{defaultCanExecuteCommands:!0,commandPermissionOverrides:[]},allowlist:{users:O1(n)}})}function dc(n=[]){return bQ({mode:"allowlist",open:{defaultCanExecuteCommands:!1,commandPermissionOverrides:[]},allowlist:{users:O1(n)}})}function dg(n){return[...new Set((Array.isArray(n)?n:[n]).filter(t=>typeof t=="string"||typeof t=="number"||typeof t=="bigint").map(t=>String(t).trim()).filter(Boolean))]}function LCe(n){return dg(n).map(t=>`${t.replace(/^\+/,"")}@s.whatsapp.net`)}function nr(n,t={}){let o=String(n??"").trim().toLowerCase();if(o==="weixin")return Ig({direct:dc(),group:dc()});if(o==="feishu"){let e=dg(t.ownerOpenIds??t.ownerOpenId).includes("*")?pg():dc();return Ig({direct:e,group:e})}if(o==="qq"){let i=dg(t.ownerUserOpenid);return Ig({direct:i.includes("*")?pg():dc(),group:pg()})}if(o==="telegram"){let i=dg(t.allowedUsers);return(t.accessMode??"compatible")==="private-allowlist"?Ig({direct:dc(i),group:dc()}):Ig({direct:pg(i),group:pg()})}if(o==="whatsapp"){let i=t.accessMode??"self-only",e=LCe(t.allowedNumbers);return i==="open"?Ig({direct:pg(e),group:pg()}):Ig({direct:dc(i==="private-allowlist"?e:[]),group:dc()})}if(["dingtalk","wecom","slack","discord"].includes(o))return Ig({direct:pg(),group:pg()});throw new TypeError(`Unsupported access-policy channel: ${n}`)}function UCe(n,t={}){let o=String(n??"").trim().toLowerCase();if(o==="weixin")return dg(t.ownerUserId);if(o==="feishu")return dg(t.ownerOpenIds??t.ownerOpenId).filter(i=>i!=="*");if(o==="dingtalk"){let i=Array.isArray(t.approvedSenders)?t.approvedSenders:[];return dg(i.map(e=>e?.staffId))}return o==="qq"?dg(t.ownerUserOpenid).filter(i=>i!=="*"):o==="whatsapp"?dg(t.accountJid):[]}function qa(n,t,{channel:o,config:i,equals:e}={}){if(!n||typeof n.accessPolicyFor!="function")throw new TypeError("A workspace store with access policies is required");let a=new Set(UCe(o,i)),A=typeof e=="function"?e:(r,s)=>r===s;return Object.freeze({botId:t,getSettings:()=>n.accessPolicyFor(t),isPrivileged(r,s){if(!["direct","group"].includes(s))return!1;let g=Array.isArray(r)?r:[r];try{return g.some(c=>typeof c=="string"&&[...a].some(I=>A(c.trim(),I)===!0))}catch{return!1}}})}function xCe(n){let t=FI(n.dshHome??process.env.DSH_HOME??XE(KCe(),".dsh")),o=FI(n.dataDir??XE(t,"integrations","dsh-dingtalk"));return{root:o,config:FI(n.configPath??XE(o,"config.json")),bots:FI(n.botsDir??XE(o,"bots")),workspaces:FI(n.workspacesPath??XE(o,"workspaces.json"))}}async function L_(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-dingtalk requires ctx.credentials");let i=aa(n,t),e=o.ConfigStore??pQ,a=o.DeviceAuth??hQ,A=o.StateStore??vQ,r=o.HarnessClient??RQ,s=o.Controller??PE,g=o.Runtime??jE,c=o.createConnectionSupervisor??v_,I=typeof n.logger=="function"?n.logger("dsh-dingtalk"):n.logger??console,d=()=>La(n),B=xCe(t),f=await new e(B.config).load(),Q=FI(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=typeof f.list=="function",_=T?f.list():[];T&&await m.reconcile(_.map(Ae=>Ae.botId)),await Promise.all(_.map(Ae=>m.ensure(Ae.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("dingtalk",Ae)})));let R=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,K=o.deviceAuth??new a({baseUrl:t.registrationBaseUrl}),L=new Map,F=Ae=>FI(B.bots,Ae,"state.json"),q=async Ae=>{let ie=L.get(Ae);return ie||(ie=await new A(F(Ae)).load(),L.set(Ae,ie)),ie},V=ja(n,o.commandExecutor),{controlExecutor:x,sessionMaintenanceExecutor:G,fileIngressExecutor:J}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),U=new r({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...V?{commandExecutor:V}:{},...x?{controlExecutor:x}:{},...G?{sessionMaintenanceExecutor:G}:{},...J?{fileIngressExecutor:J}:{}}),N=new s({deviceAuth:K,credentials:n.credentials,configStore:R,logger:I,createRuntime:async({botId:Ae,config:ie,clientSecret:we})=>{let se=await q(Ae);await m.ensure(Ae,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("dingtalk",ie)});let Te=Ka(U,{botId:Ae,workspaces:m,state:se,agentPresetCatalog:d});return new g({config:ie,clientSecret:we,harness:Te.harness,state:Te.state,contextEnhancement:{botId:Ae,getSettings:()=>m.contextEnhancementFor(Ae)},accessPolicy:qa(m,Ae,{channel:"dingtalk",config:ie}),replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??4e3,connectTimeoutMs:t.connectTimeoutMs??15e3,logger:{error:(...fe)=>I.error?.(`[${Ae}]`,...fe),warn:(...fe)=>I.warn?.(`[${Ae}]`,...fe),info:(...fe)=>I.info?.(`[${Ae}]`,...fe),debug:(...fe)=>I.debug?.(`[${Ae}]`,...fe)}})},deleteState:async({botId:Ae})=>{let ie=L.get(Ae);if(L.delete(Ae),ie&&typeof ie.remove=="function")await ie.remove();else try{await HCe(F(Ae))}catch(we){if(we?.code!=="ENOENT")throw we}}}),k=xa(N,{workspaces:m,stateFor:q,agentPresetCatalog:d}),z=c({controller:k,harness:U,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:k,deliveryAdapter:Ya({channel:"dingtalk",workspaces:m,coreController:N,stateFor:q}),ready:z.ready,async close(){await z.close(),await k.close(),U.stopManagedProcess()}}}import qCe from"qrcode";var ki="bot.context-enhancement.set";function za(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"config")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(kI(n.config),!0)}catch{return!1}}var Va="bot.access-policy.set";function Wa(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"policy")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(Ic(n.policy),!0)}catch{return!1}}var YCe=new Set(["loopback","trusted-host"]);function fr(n){if(n===void 0)return"loopback";if(YCe.has(n))return n;throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"')}import{isAbsolute as jCe}from"node:path";var vi="bot.workspace.set";function Za(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.keys(n).every(t=>["botId","workspace"].includes(t))&&typeof n.botId=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)&&typeof n.workspace=="string"&&n.workspace.length<=4096&&jCe(n.workspace.trim())}function Xa(n){return["workspace-not-absolute","workspace-not-found","workspace-not-directory","workspace-bot-not-found","agent-preset-invalid","agent-preset-unavailable","context-enhancement-invalid"].includes(n?.code)?{code:n.code,message:n.message}:null}var Pi="bot.preset.set";function JCe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function $a(n){return JCe(n)&&Object.keys(n).every(t=>["botId","agentPreset"].includes(t))&&typeof n.botId=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)&&(n.agentPreset===null||typeof n.agentPreset=="string"&&c_.test(n.agentPreset))}var M1="/dingtalk",Ft=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va,approveSender:"bot.sender.approve",revokeSender:"bot.sender.revoke"}),_1=Object.freeze(Object.values(Ft)),zCe=new Set(["clientSecret","client_secret","deviceCode","device_code","secretRef","staffId","senderStaffId","verificationUrl","verificationUri","userCode"]);function H_(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function hc(n,t){return H_(n)&&Object.keys(n).every(o=>t.includes(o))}function LI(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function b1(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function VCe(n,t){return H_(t)?n===Ft.status?hc(t,[])?null:"connection.status does not accept fields.":n===Ft.beginProvisioning?hc(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Ft.pollProvisioning,Ft.cancelProvisioning].includes(n)?hc(t,["attemptId"])&&LI(t.attemptId)?null:`${n} requires an attemptId.`:n===Ft.bindCredentials?hc(t,["clientId","clientSecret"])&&b1(t.clientId,256)&&b1(t.clientSecret,1024)?null:"bot.bind-credentials requires Client ID and Client Secret.":n===Ft.reconnectBot?hc(t,["botId","sendTest"])&&LI(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Ft.deleteBot?hc(t,["botId","confirm"])&&LI(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Ft.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Ft.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Ft.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Ft.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Ft.approveSender?hc(t,["botId","requestId","confirm"])&&LI(t.botId)&&LI(t.requestId)&&t.confirm===!0?null:"bot.sender.approve requires botId, requestId, and confirm=true.":n===Ft.revokeSender?hc(t,["botId","senderKey","confirm"])&&LI(t.botId)&&LI(t.senderKey)&&t.confirm===!0?null:"bot.sender.revoke requires botId, senderKey, and confirm=true.":"Unknown DingTalk endpoint.":"Payload must be an object."}function KQ(n){return{ok:!1,error:{code:"bad-request",message:n}}}function $E(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function WCe(){return{ok:!1,error:{code:"dingtalk-operation-failed",message:"\u9489\u9489\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}function Hp(n){if(Array.isArray(n))return n.map(Hp);if(!H_(n))return n;let t={};for(let[o,i]of Object.entries(n))zCe.has(o)||(t[o]=Hp(i));return t}async function ZCe(n){return qCe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function U_(n,t){return!n||typeof n.verificationUrl!="string"?Hp(n):Hp({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function is(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await U_(o.provisioning,t)),Hp(o)}function XCe(n){for(let t of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot","approveSender","revokeSender"])if(typeof n?.[t]!="function")throw new TypeError(`A complete DingTalk controller is required (${t})`)}function T1(n,{encodeQr:t=ZCe}={}){XCe(n);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return $E();if(!_1.includes(e))return KQ("Unknown DingTalk endpoint.");let r=VCe(e,a);if(r)return KQ(r);try{let s;if(e===Ft.status)s=await is(await n.status(),i);else if(e===Ft.beginProvisioning){let g=await n.startProvisioning({signal:A});if(A?.aborted)return await n.cancelProvisioning(g.attemptId),$E();s=await U_(g,i)}else if(e===Ft.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return KQ("The provisioning attempt no longer exists.");s=await U_(g,i)}else if(e===Ft.cancelProvisioning){if(s=await n.cancelProvisioning(a.attemptId),!s)return KQ("The provisioning attempt no longer exists.");s=Hp(s)}else if(e===Ft.bindCredentials)s=await is(await n.bindCredentials(a),i);else if(e===Ft.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return $E();let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("\u9489\u9489\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=or()}catch(d){c=or(d)}s=await is({...g,...c?{testMessage:c}:{}},i)}else if(e===Ft.deleteBot)s=await is(await n.deleteBot(a.botId),i);else if(e===Ft.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await is(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===Ft.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>is(g,i))}else if(e===Ft.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>is(g,i))}else if(e===Ft.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await is(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else e===Ft.approveSender?s=await is(await n.approveSender(a.botId,a.requestId),i):s=await is(await n.revokeSender(a.botId,a.senderKey),i);return A?.aborted?$E():{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?$E():g?{ok:!1,error:g}:WCe()}}}function xQ(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(M1,T1(t,o),{authority:fr(i)})}async function N1(n,t={}){if(t?.controller)return xQ(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await L_(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=xQ(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-dingtalk: close bot connections"),e}import{createHash as $Ce}from"node:crypto";import{mkdir as eue,readFile as Aue,rename as tue,unlink as rue,writeFile as aue}from"node:fs/promises";import{dirname as iue}from"node:path";var K_=Object.freeze({version:1,bots:Object.freeze([])});function hg(n){return typeof n=="string"&&n.trim()?n.trim():null}function R1(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eC(n,{botPrefix:t,tokenRefPrefix:o}){let i=hg(n);if(!i)throw new TypeError("platformId is required");let e=$Ce("sha256").update(i).digest("hex").slice(0,24);return{botId:`${t}_${e}`,tokenRef:`${o}_${e.toUpperCase()}`}}function YQ(n,t){let o=hg(n)??"";return o.length<=10?o?`${o.slice(0,3)}\u2022\u2022\u2022`:t:`${o.slice(0,6)}\u2022\u2022\u2022\u2022${o.slice(-4)}`}var Kp=class{#e;#A;#t;#r;#l;#o;#i;#a=K_;#n=Promise.resolve();constructor(t,{channel:o,botPrefix:i,tokenRefPrefix:e,normalizeBotExtension:a=()=>({})}){if(typeof a!="function")throw new TypeError("normalizeBotExtension must be a function");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=new RegExp(`^${R1(i)}_[a-f0-9]{24}$`),this.#i=new RegExp(`^${R1(e)}_[A-F0-9]{24}$`)}async load(){try{let t=this.#p(JSON.parse(await Aue(this.#e,"utf8")));if(!t)throw new Error(`dsh-im ${this.#A} config contains invalid bot data`);this.#a=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#a=K_}return this}list(){return structuredClone(this.#a.bots)}get(t){let o=this.#a.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByPlatformId(t){let o=this.#a.bots.find(i=>i.platformId===t);return o?structuredClone(o):null}async save(t){let o=this.#s(t);if(!o)throw new Error(`Refusing to persist incomplete ${this.#A} bot data`);return this.#c(i=>{let e=i.find(r=>r.platformId===o.platformId&&r.botId!==o.botId),a=i.find(r=>r.tokenRef===o.tokenRef&&r.botId!==o.botId);if(e||a)throw new Error(`Duplicate ${this.#A} bot identity`);let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!this.#o.test(t))throw new TypeError(`Invalid ${this.#A} bot id`);return this.#c(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#n.then(async()=>{try{await rue(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#a=K_});this.#n=t.then(()=>{},()=>{}),await t}#s(t){if(!t||typeof t!="object")return null;let o=hg(t.platformId),i=hg(t.botId),e=hg(t.tokenRef),a=hg(t.name);if(!o||!i||!e||!a||!this.#o.test(i)||!this.#i.test(e))return null;let A=eC(o,{botPrefix:this.#t,tokenRefPrefix:this.#r});if(A.botId!==i||A.tokenRef!==e)return null;let r=this.#l(t);return!r||typeof r!="object"||Array.isArray(r)?null:Object.freeze({botId:i,platformId:o,tokenRef:e,name:a,username:hg(t.username),createdAt:hg(t.createdAt)??new Date().toISOString(),connectedAt:hg(t.connectedAt),...r})}#p(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#s(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.platformId)||a.has(A.tokenRef))return null;i.add(A.botId),e.add(A.platformId),a.add(A.tokenRef)}return Object.freeze({version:1,bots:Object.freeze(o)})}async#c(t){let o,i=this.#n.then(async()=>{let e=[...this.#a.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#g(a),this.#a=a});return this.#n=i.then(()=>{},()=>{}),await i,o}async#g(t){await eue(iue(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await aue(o,`${JSON.stringify(t,null,2)} +`,{encoding:"utf8",mode:384}),await tue(o,this.#e)}};var k1=Object.freeze({botPrefix:"discord",tokenRefPrefix:"DSH_DISCORD_BOT_TOKEN"});function v1(n){return eC(n,k1)}function P1(n){return YQ(n,w("Discord\u673A\u5668\u4EBA"))}var jQ=class extends Kp{constructor(t){super(t,{channel:"Discord",...k1})}};function AC(n){return typeof n=="string"&&n.trim()?n.trim():null}function tC(n,t){return Object.freeze({code:n,message:t})}var xp=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s=new Map;#p=new Map;#c=new Map;#g=0;#I=!1;constructor({descriptor:t,credentials:o,configStore:i,inspectToken:e,deriveIdentity:a,maskPlatformId:A,createRuntime:r,deleteState:s=async()=>{},logger:g=console}){if(!t?.key||!t?.label||!t?.connectionLabel)throw new TypeError("TokenBotController requires a channel descriptor");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError(`${t.label} requires the DSH credential provider`);if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError(`${t.label} requires a config store`);if(typeof e!="function"||typeof a!="function"||typeof A!="function"||typeof r!="function")throw new TypeError(`${t.label} controller dependencies are incomplete`);this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g}async initialize(){if(this.#I)return this.status();for(let t of this.#t.list())await this.#B(t.botId,async()=>{if(this.#I||this.#s.get(t.botId)?.status?.ready)return;let o=await this.#C(t.tokenRef);if(!o){this.#p.set(t.botId,tC("missing-token",w("{label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002",{label:this.#e.label})));return}try{await this.#d(t,o),this.#p.delete(t.botId)}catch(i){this.#p.set(t.botId,tC("connection-failed",w("{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002",{label:this.#e.label}))),this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${t.botId} failed to initialize:`,i)}finally{this.#f()}});return this.status()}async bindCredentials({token:t}={}){if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let o=AC(t);if(!o)throw new TypeError(`${this.#e.label} Bot Token is required`);let i=await this.#r(o),e=AC(i?.platformId),a=AC(i?.name);if(!e||!a)throw new Error(`${this.#e.label} returned an invalid bot identity`);let A=this.#l(e);return await this.#B(A.botId,async()=>{if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let r=this.#t.getByPlatformId(e),s=await this.#A.resolve(A.tokenRef).catch(()=>{}),g={botId:A.botId,platformId:e,tokenRef:A.tokenRef,name:a,username:AC(i.username),createdAt:r?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(A.tokenRef,o);try{await this.#t.save(g)}catch(c){throw await this.#u(A.tokenRef,s),c}try{await this.#d(g,o),this.#p.delete(A.botId)}catch(c){this.#p.set(A.botId,tC("connection-failed",w("{label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002",{label:this.#e.label}))),this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${A.botId} credential connection failed:`,c)}this.#f()}),this.status()}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return await this.#B(t,async()=>{let i=await this.#C(o.tokenRef);if(!i)throw new Error(`${this.#e.label} bot token is missing`);try{await this.#d(o,i),this.#p.delete(t)}catch(e){throw this.#p.set(t,tC("connection-failed",w("{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{label:this.#e.label}))),e}finally{this.#f()}}),this.status()}async updateBotConfig(t,o){if(this.#I)throw new Error(`${this.#e.label} controller is closed`);if(typeof o!="function")throw new TypeError("Bot config update must be a function");return await this.#B(t,async()=>{if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let i=this.#t.get(t);if(!i)throw new Error(`Unknown ${this.#e.label} bot`);let e=await this.#C(i.tokenRef);if(!e)throw new Error(`${this.#e.label} bot token is missing`);if(this.#I)throw new Error(`${this.#e.label} controller is closed`);let a=o(i),A=await this.#t.save(a);try{await this.#d(A,e),this.#p.delete(t)}catch(r){throw this.#p.set(t,tC("connection-failed",w("{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{label:this.#e.label}))),r}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return this.#B(t,async()=>{let i=this.#s.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let a=new Error(w("{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",{label:this.#e.label}));throw a.code="test-target-unavailable",a}let e=w("{name}\uFF08{id}\uFF09",{name:o.name,id:this.#o(o.platformId)});return await i.sendConnectionTest(Ra(e,w("{label}\u673A\u5668\u4EBA",{label:this.#e.label}))),{sent:!0}})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error(`Unknown ${this.#e.label} bot`);return this.#B(t,async()=>{let A=this.#s.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",{label:this.#e.label}));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return await this.#B(t,async()=>{let i=await this.#A.resolve(o.tokenRef).catch(()=>{});await this.#h(t);try{await this.#A.unset(o.tokenRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.tokenRef,i.value).catch(()=>{}),await this.#d(o,i.value).catch(()=>{})),new Error(`Unable to remove the ${this.#e.label} bot safely.`,{cause:e})}await this.#a({botId:t,config:o}).catch(e=>{this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${t} state cleanup failed:`,e)}),this.#p.delete(t),this.#f()}),this.status()}status(){let t=this.#t.list().map(i=>{let e=this.#s.get(i.botId)?.status??null,a=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=a?"connected":e?.connectionState==="connecting"?"connecting":this.#p.has(i.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:i.botId,state:A,connected:a,configured:!0,bot:{name:i.name,username:i.username,idMasked:this.#o(i.platformId)},health:{status:a?"healthy":A==="error"?"error":"offline",summary:a?w("{label}{connectionLabel}\u8FD0\u884C\u6B63\u5E38",{label:this.#e.label,connectionLabel:w(this.#e.connectionLabel)}):A==="error"?w("{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5",{label:this.#e.label}):w("{label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF",{label:this.#e.label}),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:Xr(e?.lastMessageError),error:structuredClone(this.#p.get(i.botId)??null)}}),o=t.filter(i=>i.connected).length;return{schemaVersion:1,revision:this.#g,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#I||(this.#I=!0,await Promise.allSettled([...this.#c.values()]),await Promise.allSettled([...this.#s.keys()].map(t=>this.#h(t))))}async#d(t,o){if(this.#I)throw new Error(`${this.#e.label} controller is closed`);if(await this.#h(t.botId),this.#I)throw new Error(`${this.#e.label} controller is closed`);let i=await this.#i({botId:t.botId,config:t,token:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError(`createRuntime returned an invalid ${this.#e.label} runtime`);this.#s.set(t.botId,i);try{await i.start()}catch(e){throw await i.stop().catch(()=>{}),this.#s.delete(t.botId),e}}async#h(t){let o=this.#s.get(t);this.#s.delete(t),await o?.stop().catch(i=>{this.#n.warn?.(`[dsh-im:${this.#e.key}] bot ${t} failed to stop cleanly:`,i)})}async#C(t){let o=await this.#A.resolve(t).catch(()=>{});return AC(o?.value)}async#u(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#B(t,o){let a=(this.#c.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#c.get(t)===a&&this.#c.delete(t)});return this.#c.set(t,a),a}#f(){this.#g+=1}};import{createHash as oue}from"node:crypto";var nue="https://discord.com/api/v10/",sue=12e4,gue=new Set([50001,50013]),cue=new Set([40005]);function os(n){return typeof n=="string"&&n.trim()?n.trim():null}function G1(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function x_(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function Iue(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function L1(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function lue(n){let t=Number(n?.providerCode),o=Number(n?.status),i=os(n?.message)??"",e="artifact-provider-rejected",a="Discord rejected the attachment.";o===401||o===403||gue.has(t)?(e="artifact-permission-required",a="Discord denied permission to send the attachment."):o===413||cue.has(t)||/(?:request|attachment|file).{0,24}too large/i.test(i)?(e="artifact-too-large",a="The attachment exceeds Discord's size limit."):o===429?(e="artifact-rate-limited",a="Discord rate-limited attachment delivery."):o>=500&&(e="artifact-delivery-uncertain",a="Discord attachment delivery result is uncertain.");let A=new Error(a,{cause:n});return A.code=e,L1(A,n)}function pue(n){let t=new Error("Discord attachment delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",L1(t,n)}function due(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function ei(n,t){let o=os(n);if(!o||!/^\d{5,30}$/.test(o))throw new TypeError(`Invalid Discord ${t}`);return o}function F1(n){let t=os(n);if(!t)throw new TypeError("A Discord reaction emoji is required");return t}function hue(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{20,}$/.test(n.trim())}var rC=class{#e;#A;#t;#r;constructor({token:t,fetchImpl:o=fetch,baseUrl:i=nue,fileUploadTimeoutMs:e=sue}){if(!hue(t))throw new TypeError("Discord Bot Token is invalid");if(typeof o!="function")throw new TypeError("DiscordApi requires fetch");this.#e=t.trim(),this.#A=o,this.#t=new URL(i),this.#r=Iue(e,"fileUploadTimeoutMs")}getCurrentUser(t={}){return this.#l("users/@me",{...t,method:"GET"})}getGatewayBot(t={}){return this.#l("gateway/bot",{...t,method:"GET"})}getChannel({channelId:t,signal:o}={}){return this.#l(`channels/${ei(t,"channel id")}`,{method:"GET",signal:o})}startThreadFromMessage({channelId:t,messageId:o,name:i,signal:e}={}){let a=os(i);if(!a||[...a].length>100)throw new TypeError("Discord thread name must contain 1-100 characters");if(e?.aborted)throw x_(e);return this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}/threads`,{method:"POST",signal:e,body:{name:a}})}createMessage({channelId:t,content:o,replyToMessageId:i,signal:e}){return this.#l(`channels/${ei(t,"channel id")}/messages`,{method:"POST",signal:e,body:{content:o,allowed_mentions:{parse:[],replied_user:!1},...i?{message_reference:{message_id:ei(i,"message id"),channel_id:ei(t,"channel id"),fail_if_not_exists:!1}}:{}}})}async createFileMessage({channelId:t,file:o,replyToMessageId:i,signal:e}){if(!o||typeof o!="object"||typeof o.fileName!="string"||!o.fileName||!Buffer.isBuffer(o.bytes))throw new TypeError("A Discord attachment is required");let a=os(o.deliveryKey)??os(o.artifactId),A=a?oue("sha256").update(a).digest("hex").slice(0,25):void 0,r=new FormData;r.append("payload_json",JSON.stringify({allowed_mentions:{parse:[],replied_user:!1},attachments:[{id:0,filename:o.fileName}],...A?{nonce:A,enforce_nonce:!0}:{},...i?{message_reference:{message_id:ei(i,"message id"),channel_id:ei(t,"channel id"),fail_if_not_exists:!1}}:{}})),r.append("files[0]",new Blob([o.bytes],{type:o.mediaType??"application/octet-stream"}),o.fileName);let s=ei(t,"channel id");if(e?.aborted)throw x_(e);let g=G1(e,this.#r);try{return await this.#l(`channels/${s}/messages`,{method:"POST",signal:g,timeoutMs:this.#r,body:r,multipart:!0})}catch(c){throw e?.aborted?x_(e):c?.code?.startsWith?.("discord-")?lue(c):pue(c)}}editMessage({channelId:t,messageId:o,content:i,signal:e}){return this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}`,{method:"PATCH",signal:e,body:{content:i,allowed_mentions:{parse:[],replied_user:!1}}})}sendTyping({channelId:t,signal:o}){return this.#l(`channels/${ei(t,"channel id")}/typing`,{method:"POST",signal:o,expectBody:!1})}async addOwnReaction({channelId:t,messageId:o,emoji:i,signal:e}={}){let a=F1(i);return await this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}/reactions/${encodeURIComponent(a)}/@me`,{method:"PUT",signal:e,expectBody:!1,retry:!1}),a}removeOwnReaction({channelId:t,messageId:o,emoji:i,signal:e}={}){let a=F1(i);return this.#l(`channels/${ei(t,"channel id")}/messages/${ei(o,"message id")}/reactions/${encodeURIComponent(a)}/@me`,{method:"DELETE",signal:e,expectBody:!1,retry:!1})}async#l(t,{method:o,body:i,signal:e,timeoutMs:a=15e3,expectBody:A=!0,retry:r=!0,multipart:s=!1}){let g;try{g=await this.#A(new URL(t,this.#t),{method:o,headers:{authorization:`Bot ${this.#e}`,...s?{}:{"content-type":"application/json"},"user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 1.1.0)"},...i===void 0?{}:{body:s?i:JSON.stringify(i)},signal:G1(e,a),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Discord ${o} transport failed`)}let c=null;if(A||g.status===429||!g.ok)try{c=await g.json()}catch{if(A){let I=new Error(`Discord ${o} returned invalid JSON`);throw I.status=g?.status,I}}if(g.status===429&&r){let I=Math.min(1e4,Math.max(50,Number(c?.retry_after)*1e3||1e3));return await due(I,e),this.#l(t,{method:o,body:i,signal:e,timeoutMs:a,expectBody:A,retry:!1,multipart:s})}if(!g.ok){let I=new Error(os(c?.message)??`Discord API failed with HTTP ${g.status}`);I.code=`discord-${g.status}`,I.status=g.status,(Number.isInteger(c?.code)||typeof c?.code=="string")&&(I.providerCode=c.code);let d=Number(c?.retry_after);throw Number.isFinite(d)&&d>=0&&(I.retry_after=d,I.retryAfter=d),I}return A?c:null}};async function U1(n,t={}){let i=await new rC({token:n,...t}).getCurrentUser();if(!i?.id||i?.bot!==!0)throw new Error("Discord token does not belong to a bot");return{platformId:String(i.id),name:os(i.global_name)??os(i.username)??w("Discord\u673A\u5668\u4EBA"),username:os(i.username)}}var Eue=Object.freeze({success(){},error(){},clear(){},settled:()=>Promise.resolve()});function H1(n,t){!n||typeof n!="object"||(n[t]=(n[t]??0)+1)}async function Cue(n,t){let o=AbortSignal.timeout(t),i,e=new Promise((a,A)=>{i=()=>A(o.reason??new DOMException("Timed out","TimeoutError")),o.addEventListener("abort",i,{once:!0})});try{return await Promise.race([n(o),e])}finally{o.removeEventListener("abort",i)}}function JQ({adapter:n,target:t,reactions:o,status:i,logger:e=console,label:a="channel",timeoutMs:A=2e3}={}){if(!t||typeof n?.addReaction!="function"||typeof n?.removeReaction!="function"||typeof o?.processing!="string"||!o.processing||!Number.isSafeInteger(A)||A<=0)return Eue;let r=null,s=!1,g=async(B,f)=>{try{let Q=await Cue(f,A);return H1(i,B==="add"?"reactionsAdded":"reactionsRemoved"),{ok:!0,value:Q}}catch(Q){return H1(i,"reactionErrors"),e.warn?.(`[dsh-im:${a}] status reaction ${B} failed:`,Q?.message??Q?.name??String(Q)),{ok:!1,value:null}}},c=async B=>{if(r!==null){let Q=r;r=null,await g("remove",y=>n.removeReaction(t,Q,{signal:y}))}if(typeof B!="string"||!B)return;let f=await g("add",Q=>n.addReaction(t,B,{signal:Q}));f.ok&&f.value!==void 0&&f.value!==null&&(r=f.value)},I=c(o.processing),d=B=>{s||(s=!0,I=I.then(()=>c(B),()=>c(B)),I.catch(()=>{}))};return Object.freeze({success:()=>d(o.success),error:()=>d(o.error),clear:()=>d(null),settled:()=>I})}var K1="\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002",uue="\u4EFB\u52A1\u5DF2\u5B8C\u6210\u3002";function Ii(n){return typeof n=="string"?n.trim():""}function Bue(n,t,o){return t.actor===o&&(n.kind!=="group"||n.addressed===!0)&&!Tt(n)&&!wt(n)&&!!Ii(n.content)}function fue(n,t,o){let i=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim().slice(0,255)||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:i});case"artifact-permission-required":return o?.key==="slack"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Slack \u5E94\u7528\u7F3A\u5C11 files:write \u6743\u9650\u3002\u8BF7\u66F4\u65B0 Manifest\u3001\u91CD\u65B0\u5B89\u88C5\u5E94\u7528\u5E76\u91CD\u65B0\u8FDE\u63A5\u673A\u5668\u4EBA\u540E\u91CD\u8BD5\u3002",{name:i}):o?.key==="discord"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11 Discord \u7684 Send Messages\u3001Attach Files \u6216 Read Message History \u6743\u9650\u3002",{name:i}):o?.key==="telegram"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Telegram \u4E0D\u5141\u8BB8\u673A\u5668\u4EBA\u5728\u5F53\u524D\u804A\u5929\u53D1\u9001\u6587\u6863\uFF0C\u8BF7\u68C0\u67E5\u804A\u5929\u6743\u9650\u3002",{name:i}):w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u6E20\u9053\u6743\u9650\u3002",{name:i});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u6E20\u9053\u5927\u5C0F\u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:i});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u672A\u53D1\u9001\u3002",{name:i});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:i});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5F53\u524D\u6E20\u9053\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:i});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:i});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:i})}}function io(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0}}var ns=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p=new Map;#c=new Map;#g=new Map;#I=new Map;#d=new Set;#h=new Set;#C;#u=new Ti;constructor({descriptor:t,bot:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,status:r=io(),logger:s=console,replyTimeoutMs:g=6e5,signal:c}){if(!t?.key||!t?.label)throw new TypeError("A channel descriptor is required");if(!o||typeof o.sendText!="function")throw new TypeError("A bot client is required");if(!i||!e)throw new TypeError("Harness client and state store are required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#C=new Di({label:t.key,logger:s})}get status(){return structuredClone(this.#i)}accept(t,{contextSnapshot:o,accessDecision:i}={}){if(this.#s?.aborted)return Promise.resolve();let e=Ii(t?.conversationId),a=t?.kind==="group"?"group":"direct",A={...t,kind:a,conversationId:e},r=Ii(A.messageId),s=Ii(A.senderId);if(!r||!s||!e||A.senderIsBot===!0||this.#r.hasSeen(r)||this.#I.has(r))return Promise.resolve();if(a==="group"&&A.addressed!==!0)return this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString(),this.#I.set(r,null),this.#f(A,r,null);if(this.#o||i){let I=Tt(A),d=wt(A),B=i??Ba(this.#o,{conversationType:a,senderIds:[s,Ii(A.senderAlternateId)].filter(Boolean),text:A.content,hasImages:I,hasFiles:d});if(!B.allowed)return this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString(),this.#I.set(r,null),this.#f(A,r,B.reason==="command-not-allowed"?w(ao):null,{recordReceived:B.reason==="command-not-allowed"})}this.#I.set(r,o===void 0?Aa(this.#l,t?.kind):o);let g=JQ({adapter:this.#A,target:A.kind==="direct"||A.addressed===!0?A.reactionTarget:null,reactions:this.#e.reactions,status:this.#i,logger:this.#a,label:this.#e.key});A.statusReaction=g;let c=this.#B(A,r,s);return c.then(()=>g.success(),()=>g.error()),c}#B(t,o,i){t.kind==="direct"&&So(this.#r,t.connectionTestTarget??t.replyTarget);let e=`${t.kind}:${t.conversationId}`,a=this.#c.get(e),A=Ii(t.content),r=Ni(A);if(r&&t.kind==="group"&&t.addressed===!0)return this.#f(t,o,es());if(r&&t.kind==="direct"){if(/^\/batch$/iu.test(A)&&(this.#p.has(e)||a||this.#C.hasPending(e)))return this.#f(t,o,No());let d=this.#u.handle(e,A,{plainText:!!A&&t.plainText!==!1&&!Tt(t)&&!wt(t)});if(d.handled)return d.kind==="submit"?this.#Q({...t,content:d.prompt,batchSubmission:{token:d.token}},o,i,e):this.#f(t,o,d.message)}else if(t.kind==="direct"&&this.#u.status(e).phase==="collecting"){let I=this.#u.handle(e,A,{plainText:!!A&&t.plainText!==!1&&!Tt(t)&&!wt(t)});if(I.handled)return this.#f(t,o,I.message)}let g=t.kind==="direct"&&this.#u.status(e).phase==="collecting"?null:Fa(A)?Ao:wt(t)?null:ni(A)?Mi:si(A)?to:gi(A)?_i:null;if(g&&(t.kind!=="group"||t.addressed===!0)){let I;return I=this.#S(t,o,e,g).finally(()=>{this.#I.delete(o),this.#h.delete(I)}),this.#h.add(I),I}let c=this.#C.claimReply({key:e,actor:i,messageId:o,text:Tt(t)||wt(t)?"":t.content,addressed:t.kind!=="group"||t.addressed===!0,hasPendingQuestion:!!a,questionCompletion:a?.submitting||a?.claimedReplyMessageId?a.queue:null,isQuestionPending:()=>this.#c.has(e),send:I=>this.#A.sendText(t.replyTarget,I)});if(c){let I;return I=c.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#I.delete(o),this.#d.delete(I)}),this.#d.add(I),I}if(a&&a.actor!==i)return this.#Q(t,o,i,e);if(a?.submitting||a?.claimedReplyMessageId)return this.#Q(t,o,i,e);if(a){Bue(t,a,i)&&(a.claimedReplyMessageId=o);let d=(a.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#D(t,o,i,e,a)).finally(()=>{this.#I.delete(o),a.claimedReplyMessageId===o&&(a.claimedReplyMessageId=null),a.queue===d&&(a.queue=null)});return a.queue=d,d}return this.#Q(t,o,i,e)}#f(t,o,i,{recordReceived:e=!0}={}){let a;return a=(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),e&&(this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()),i&&await this.#A.sendText(t.replyTarget,i),this.#i.lastError=null)})().catch(async A=>{if(this.#s?.aborted){t.statusReaction?.clear();return}t.statusReaction?.error(),this.#i.lastError=A?.message??String(A);let r=At(this.#i,A);this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a batch input message [${r.referenceId}]:`,A)}).finally(()=>{this.#I.delete(o),this.#h.delete(a)}),this.#h.add(a),a}#Q(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1}={}){let s=(this.#p.get(e)??Promise.resolve()).catch(()=>{}).then(()=>this.#m(t,o,i,e,{alreadyRecorded:A})).finally(()=>{a&&this.#I.delete(o),this.#p.get(e)===s&&this.#p.delete(e)});return this.#p.set(e,s),s}async waitForIdle(){await Promise.allSettled([...this.#p.values(),...[...this.#c.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#d,...this.#h])}async#S(t,o,i,e){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString();let a=t.replyTarget;try{let A=await e(Ii(t.content),this.#t,this.#r,i,{signal:this.#s,isDirect:t.kind==="direct",hasImages:Tt(t),hasFiles:wt(t),pendingInteraction:this.#c.has(i)||this.#C.hasPending(i),control:{owner:this,key:i}});A?.stopped&&await Promise.allSettled([this.#G(i),this.#C.closeRoute(i)]);for(let r of A?.messages??[A?.message])r&&await this.#A.sendText(a,r);this.#i.lastError=null}catch(A){if(A?.code==="turn-stopped"||this.#s?.aborted){t.statusReaction?.clear();return}t.statusReaction?.error(),this.#i.lastError=A?.message??String(A);let r=At(this.#i,A);this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a command [${r.referenceId}]:`,A),await this.#A.sendText(a,dt(r)).catch(()=>{})}}sendConnectionTest(t){return nc({state:this.#r,text:t,channelLabel:w("{label}\u673A\u5668\u4EBA",{label:this.#e.label}),send:(o,i)=>this.#A.sendText(o,i)})}sendProactiveText(t,o,{signal:i}={}){return i?.throwIfAborted(),this.#A.sendText(t,o)}async#y(t,o,i=[],e){let a=await vo({artifacts:i,baseReceipt:e,deliveryId:o,channelKey:this.#e.key,signal:this.#s,sendImage:typeof this.#A.sendImage=="function"?A=>this.#A.sendImage(t,A):void 0,sendFile:typeof this.#A.sendFile=="function"?A=>this.#A.sendFile(t,A):void 0,onFailure:(A,r)=>At(this.#i,r,{userMessage:fue(A?.fileName,r,this.#e),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#A.sendText(t,dt(s)),logger:this.#a});return this.#i.artifactsSent=(this.#i.artifactsSent??0)+a.artifactsSent,this.#i.artifactSendErrors=(this.#i.artifactSendErrors??0)+a.artifactSendErrors,{receipt:a.receipt,userVisible:a.userVisible,artifactSendErrors:a.artifactSendErrors}}async#m(t,o,i,e,{alreadyRecorded:a=!1}={}){if(!a){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}let A=t.replyTarget,r=Ii(t.content),s=t.batchSubmission,g=null,c=!1;try{if(this.#s?.throwIfAborted(),t.kind==="group"&&t.addressed!==!0){this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString();return}let I=Tt(t),d=wt(t);if(!r&&!I&&!d){await this.#A.sendText(A,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002"));return}let B=r.toLowerCase();if(!I&&!d&&B==="/help"){await this.#A.sendText(A,[w("{label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002",{label:this.#e.label}),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` `));return}if(!I&&!d&&B==="/status"){await this.#t.ensureRunning({signal:this.#s}),await this.#A.sendText(A,w("{label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002",{label:this.#e.label}));return}let f=!I&&!d?await Mo(r,this.#t,e):null;if(f){for(let J of f.messages??[f.message])await this.#A.sendText(A,J);return}if(!I&&!d&&B==="/new"){await this.#r.clearSession(e),await this.#A.sendText(A,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"));return}let Q=!I&&!d?await bi(r,this.#t,this.#r,e,{signal:this.#s}):null;if(Q){await this.#A.sendText(A,Q.message);return}await this.#A.sendTyping?.(A).catch(J=>{this.#a.warn?.(`[dsh-im:${this.#e.key}] typing indicator failed:`,J)});let y=!1;if(typeof this.#A.openDeliveryStream=="function")try{g=await this.#A.openDeliveryStream(A),c=!0}catch(J){this.#a.warn?.(`[dsh-im:${this.#e.key}] unable to start a semantic reply stream; using final delivery:`,J)}else if(typeof this.#A.openStream=="function")try{g=await this.#A.openStream(A)}catch(J){this.#a.warn?.(`[dsh-im:${this.#e.key}] unable to start a streamed reply; using text:`,J)}let m=I?await Oo(t,{signal:this.#s}):void 0,T=this.#I.get(o);T&&(m=To(m??r,T,()=>({channel:this.#e.key,senderId:i,senderName:t.contextSource?.()?.senderName})));let{answer:_,artifacts:R=[]}=await Oi({harness:this.#t,state:this.#r,key:e,text:r,content:m,createOptions:this.#s?{signal:this.#s}:void 0,existsOptions:this.#s?{signal:this.#s}:void 0,askOptions:{timeoutMs:this.#n,signal:this.#s,control:{owner:this,key:e},onUpdate:g?async J=>{let U=J.type==="text"?J.text:J.type==="tool"?w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:J.name}):J.text;if(U){let N=J.type==="text"?"markdown":"plain";await g.update(c?ts(U,N):U)}}:void 0,onInteraction:J=>this.#E(J,{key:e,actor:i,target:A,requiresMention:t.kind==="group"&&t.requiresMention!==!1}),onInteractionResolved:J=>this.#N(J),files:t.files}});s&&this.#u.complete(e,s.token);let K=!Ii(_)&&R.length>0,L=K?w(uue):_,F=K?"plain":"markdown",q=null,V=null;if(g)try{let J=await g.finish(c?ts(L,F):L);y=!0,V=Zt({deliveryId:o,presentation:J?.presentation??g.presentation??`${this.#e.key}-stream`,providerMessageIds:[...Ua(g),...Ua(J)],deliveryOutcome:J?.deliveryOutcome,reason:J?.reason})}catch(J){g.cancel?.(),this.#a.warn?.(`[dsh-im:${this.#e.key}] streamed reply finalization failed; using text:`,J)}if(!y)try{let J=typeof this.#A.sendDelivery=="function"?await this.#A.sendDelivery(A,ts(L,F)):await this.#A.sendText(A,L);V=Zt({deliveryId:o,presentation:J?.presentation??`${this.#e.key}-text`,providerMessageIds:Ua(J),deliveryOutcome:J?.deliveryOutcome,reason:J?.reason})}catch(J){q=ka(J)}let x=V?.deliveryOutcome==="unknown";V?.deliveryOutcome==="failed"?q=ka(new Error(`Final text delivery failed (${V.reason??"unknown"})`),{uncertain:!1}):x&&(q=ka(new Error(`Final text delivery outcome is unknown (${V.reason??"unknown"})`)));let G=await this.#y(A,o,R,V);if(q&&(!G.userVisible||x))throw q.deliveryReceipt=G.receipt,q;return q&&G.artifactSendErrors===0&&At(this.#i,q),G.userVisible&&(this.#i.messagesReplied+=1,this.#i.lastReplyAt=new Date().toISOString(),this.#i.lastError=null,!q&&G.artifactSendErrors===0&&wo(this.#i)),G.receipt}catch(I){let d=I?.code==="turn-stopped";s&&d&&this.#u.complete(e,s.token);let B=s&&!d?this.#u.fail(e,s.token):null;if(d){if(t.statusReaction?.clear(),g)try{await g.finish(w("\u5DF2\u505C\u6B62\u3002"))}catch{g.cancel?.()}return}if(this.#s?.aborted){t.statusReaction?.clear(),g?.cancel?.();return}t.statusReaction?.error(),this.#i.lastError=I?.message??String(I);let f=async _=>{let R=typeof g?.fail=="function"?"fail":typeof g?.finish=="function"?"finish":null;if(!R)return!1;try{let K=await g[R](_);return R==="fail"?!!K&&K.deliveryOutcome!=="failed":K!==!1&&K?.deliveryOutcome!=="failed"}catch(K){return this.#a.warn?.(`[dsh-im:${this.#e.key}] unable to finalize the failed stream:`,K),!1}},Q=bo(I),y=ko(I),m=At(this.#i,I,{userMessage:y??Q,reason:eo(I)?.reason}),T=B?.retained?`${dt(m)} -${B.message}`:dt(m);if(this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a message [${m.referenceId}]:`,I),await f(T))return I.deliveryReceipt;g?.cancel?.();try{await this.#A.sendText(A,T)}catch(_){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to send the safe error reply:`,_)}return I.deliveryReceipt}finally{await Promise.allSettled([this.#G(e),this.#C.closeRoute(e)])}}async#D(t,o,i,e,a){if(this.#s?.aborted){t.statusReaction?.clear();return}let A=this.#c.get(e),r=a.claimedReplyMessageId===o;if(!A||A!==a||A.submitting)return r&&(!A||A!==a)?this.#O(t,o):this.#Q(t,o,i,e,{releaseMessageId:!1});if(this.#r.hasSeen(o))return;if(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),t.kind==="group"&&t.addressed!==!0){this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString();return}let s=t.replyTarget,g=Ii(t.content);if(!g||Tt(t)||wt(t)){try{await this.#A.sendText(s,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"))}catch(d){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to reject a non-text interaction reply:`,d)}return}let c=this.#c.get(e);if(!c||c!==a||c.submitting)return r&&(!c||c!==a)?this.#O(t,o,{alreadyRecorded:!0}):this.#Q(t,o,i,e,{releaseMessageId:!1,alreadyRecorded:!0});if(c.target=s,c.needsPresentation){let d=c.presentationTask!==null;try{await this.#T(c)}catch(f){t.statusReaction?.error(),this.#i.lastError=w("{label}\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002",{label:this.#e.label}),this.#a.error?.(`[dsh-im:${this.#e.key}] failed to retry an interaction question:`,f),c.interaction.reconnect?.();return}let B=this.#c.get(e);if(!B||B!==a||B.submitting)return r&&(!B||B!==a)?this.#O(t,o,{alreadyRecorded:!0}):this.#Q(t,o,i,e,{releaseMessageId:!1,alreadyRecorded:!0});if(!d)return}let I=c.questions[c.index];if(I){if(c.answers.push(wi(I,g)),c.index+=1,c.indexthis.#A.sendText(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=Ii(t?.interactionId)||Ii(t?.rpcId);if(!Ii(t?.rpcId)||!r||!Ii(t?.sessionId)||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#a.warn?.(`[dsh-im:${this.#e.key}] ignored an invalid Harness question interaction`);return}if(t.recovered===!0){await this.#_(t,`${this.#e.label} safely cancelled an interaction left by an earlier client.`);try{await this.#A.sendText(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"))}catch(c){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to send an interaction recovery notice:`,c)}return}let s=this.#c.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#T(s);return}if(this.#g.has(r))return;if(s){this.#a.warn?.(`[dsh-im:${this.#e.key}] cancelled a second pending Harness question`),await this.#_(t,`${this.#e.label} is already handling another user interaction.`);return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,target:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,presentationTask:null};this.#c.set(o,g),this.#g.set(r,o),await this.#T(g)}async#N(t){if(t?.kind==="approval"){await this.#C.handleResolved(t);return}let o=Ii(t?.interactionId);if(t?.kind!=="question"||!o)return;let i=this.#g.get(o);i&&this.#R(i,o)}#T(t){if(t.presentationTask)return t.presentationTask;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=(async()=>{await this.#A.sendText(t.target,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})),t.needsPresentation=!1})();return t.presentationTask=i,i.then(()=>{t.presentationTask===i&&(t.presentationTask=null)},()=>{t.presentationTask===i&&(t.presentationTask=null)}),i}async#O(t,o,{alreadyRecorded:i=!1}={}){if(!i){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}try{await this.#A.sendText(t.replyTarget,w(K1))}catch(e){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to send an expired interaction notice:`,e)}}#w(t,o){let i=this.#c.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#c.delete(t),this.#g.delete(i.interactionId),i)}#R(t,o){return this.#w(t,o)!==null}async#_(t,o){try{await t.respond({ok:!1,error:{code:"cancelled",message:o,details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){if(i?.code!=="interaction-not-pending")throw i}}async#G(t){let o=this.#w(t);if(!(!o||o.kind!=="question"))try{await this.#_(o.interaction,`The ${this.#e.label} interaction ended before the user answered.`)}catch(i){this.#a.warn?.(`[dsh-im:${this.#e.key}] failed to cancel a pending Harness interaction:`,i)}}};var Y_=Object.freeze({key:"discord",label:"Discord",connectionLabel:" Gateway \u957F\u8FDE\u63A5",reactions:Object.freeze({processing:"\u{1F440}",success:"\u2705",error:"\u274C"})}),qQ=class extends ns{constructor(t){super({descriptor:Y_,...t})}};var aC=class extends Kp{constructor(t){super({...t,descriptor:Y_,inspectToken:t.inspectToken??U1,deriveIdentity:v1,maskPlatformId:P1})}};var zQ=class extends ur{constructor(t){super({...t,rpcIdPrefix:"discord",logPrefix:"dsh-discord"})}};function ss(n,t){let o=typeof n=="string"?n.trim():"";if(!o)return[];let i=[],e=o;for(;e.length>t;){let a=e.lastIndexOf(` -`,t);anull,logger:r=console}){let s,g=[],c=null,I=null,d=null,B=!1,f=n,Q=()=>{B||I!==null||d||!c||(I=setTimeout(()=>{I=null;let y=c;c=null;let m=ss(y,t)[0]??n;d=Promise.resolve(m===f?void 0:e(s,m)).then(()=>{f=m}).catch(T=>r.warn?.("[dsh-im] streamed message update failed:",T)).finally(()=>{d=null,Q()})},o),I?.unref?.())};return{get messageId(){return s},get providerMessageIds(){return[...g]},async start(){return s=await i(n),(typeof s=="string"&&s.trim()||Number.isSafeInteger(s))&&g.push(String(s)),this},update(y){B||typeof y!="string"||!y.trim()||(c=y,Q())},async finish(y){if(B)throw new Error("Message stream is already closed");B=!0,I!==null&&clearTimeout(I),I=null,c=null,await d?.catch(()=>{});let m=ss(y,t),T=m[0]??w("\u5904\u7406\u5B8C\u6210\u3002");T!==f&&await e(s,T),f=T;for(let _ of m.slice(1)){let R=await a(_),K=A(R);(typeof K=="string"&&K.trim()||Number.isSafeInteger(K))&&g.push(String(K))}},cancel(){B=!0,c=null,I!==null&&clearTimeout(I),I=null}}}async function x1(n){try{await n?.body?.cancel?.()}catch{}}function Que(n,t){return!Array.isArray(t)||t.some(o=>typeof o=="string"&&(n.hostname===o||o.startsWith(".")&&(n.hostname===o.slice(1)||n.hostname.endsWith(o))))}async function xp(n,{fetchImpl:t=fetch,headers:o,signal:i,allowedHosts:e}={}){let a=new URL(n);if(a.protocol!=="https:")throw new Error("File download URL must use HTTPS");if(!Que(a,e))throw new Error("File download URL is not hosted by the messaging platform");let A=await t(a,{method:"GET",headers:o,signal:i,redirect:"manual"});if(Number.isInteger(A?.status)&&A.status>=300&&A.status<400){await x1(A);let r=new Error(`File download redirect was blocked (HTTP ${A.status})`);throw r.code="file-redirect-blocked",r}if(!A?.ok){await x1(A);let r=new Error(`File download failed with HTTP ${A?.status??"unknown"}`);throw r.code="file-http-error",r.status=A?.status,r}if(A.body?.[Symbol.asyncIterator])return{stream:A.body};if(typeof A.arrayBuffer=="function"){let r=Buffer.from(await A.arrayBuffer());return{stream:(async function*(){yield r})()}}throw new Error("File download returned no readable body")}var yue=37377,mue=5e3,Y1=Object.freeze([1e3,3e3,5e3,1e4,3e4]),Sue=0,wue=5,Due=10,Oue=11,bue=12,Mue=new Set([Due,Oue,bue]),_ue=new Set(["image/jpeg","image/png","image/webp","image/gif"]),Tue=new Map([[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".png","image/png"],[".webp","image/webp"],[".gif","image/gif"]]),q1=Object.freeze(["cdn.discordapp.com"]);function Nue(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Discord returned an insecure Gateway URL");return t.searchParams.set("v","10"),t.searchParams.set("encoding","json"),t.href}function j_(n,t,o){if(typeof n.addEventListener=="function")n.addEventListener(t,o);else if(typeof n.on=="function")n.on(t,o);else throw new TypeError("Discord WebSocket does not support events")}function Rue(n){return typeof n=="string"?n:typeof n?.data=="string"?n.data:Buffer.isBuffer(n)?n.toString("utf8"):Buffer.isBuffer(n?.data)?n.data.toString("utf8"):null}function kue(n){if(n===4004){let o=new Error(w("Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002"));return o.code="discord-401",o}if(n===4013||n===4014){let o=new Error(w("Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002"));return o.code="discord-intents",o}let t=new Error(`Discord Gateway closed (${n||"unknown"})`);return t.code="discord-gateway-closed",t}function z1(n,t){return typeof n!="string"?"":n.replace(new RegExp(`<@!?${t}>`,"g"),"").trim()}function vue(n,t){return[...z1(n?.content??"",t).replace(/\s+/g," ").trim()||"DeepSeek Harness"].slice(0,100).join("")}function z_(n){return Mue.has(Number(n?.type))}function V1(n,t){return z_(n)&&String(n?.id??"")===String(t?.id??"")&&String(n?.parent_id??"")===String(t?.channel_id??"")}function J_(n,t){return n?.id&&t?.(n),n}function UI(n,t,o,{fromSourceMessage:i=!1,fallback:e=null,notice:a=null}={}){let A=String(t?.id??n.conversationId),r=z_(t),s=r&&String(t?.owner_id??"")===String(o),g=r&&t?.parent_id?String(t.parent_id):A;return{...n,conversationId:A,addressed:n.addressed||s,requiresMention:r?!s:n.kind==="group",replyTarget:{channelId:A,...!i&&n.replyTarget?.replyToMessageId?{replyToMessageId:n.replyTarget.replyToMessageId}:{},...a?{notice:a}:{}},connectionTestTarget:{channelId:A},conversationRoute:{peerId:g,...r?{threadId:A,managed:s}:{},...e?{fallback:e}:{}}}}function Pue(n){let t=Number(n?.status);return!Number.isInteger(t)||t>=500}function j1(n){let t=new Error("Discord Thread creation result is uncertain",{cause:n});return t.code="discord-thread-create-uncertain",t}async function Gue(n,t,{signal:o,onChannel:i}={}){try{let e=J_(await n.getChannel({channelId:String(t.id),signal:o}),i);return V1(e,t)?e:null}catch(e){if(e?.status===404)return null;throw e}}async function J1(n,t,o){try{await n.createMessage({channelId:t.replyTarget.channelId,replyToMessageId:t.replyTarget.replyToMessageId,content:"Thread \u521B\u5EFA\u7ED3\u679C\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u3002\u82E5\u5DF2\u521B\u5EFA\uFF0C\u8BF7\u5728\u5BF9\u5E94 Thread \u4E2D\u91CD\u8BD5\uFF1B\u82E5\u672A\u521B\u5EFA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0 @\u673A\u5668\u4EBA\u3002",signal:o})}catch(i){if(o?.aborted)throw o.reason??i}}function W1(n){let t=typeof n?.content_type=="string"?n.content_type.split(";",1)[0].trim().toLowerCase():"";if(_ue.has(t))return t;let o=typeof n?.filename=="string"?n.filename.toLowerCase():"";for(let[i,e]of Tue)if(o.endsWith(i))return e;return null}function Z1(n){return Number.isSafeInteger(n)&&n>=0?n:void 0}function Fue(n,t){let o=W1(n);return!o||typeof n?.url!="string"?null:{name:typeof n.filename=="string"?n.filename:void 0,mediaType:o,size:Z1(n.size),load:i=>Do(n.url,{...i,fetchImpl:t,allowedHosts:q1})}}function Lue(n,t){if(W1(n)||typeof n?.url!="string"||!n.url)return null;let o=typeof n.content_type=="string"&&n.content_type?n.content_type.split(";",1)[0].trim().toLowerCase():void 0;return{name:typeof n.filename=="string"&&n.filename?n.filename:String(n.id??"discord-file"),...o?{mediaType:o}:{},size:Z1(n.size),load:({signal:i}={})=>xp(n.url,{fetchImpl:t,signal:i,allowedHosts:q1})}}function X1(n,t,{fetchImpl:o=fetch}={}){if(!n?.id||!n?.channel_id||!n?.author?.id||Number(n.type)===21)return null;let i=!n.guild_id,e=i||n.mentions?.some(a=>String(a?.id)===String(t));return{messageId:String(n.id),senderId:String(n.author.id),contextSource:()=>({senderName:[n.member?.nick,n.author.global_name,n.author.username].find(a=>typeof a=="string"&&a.trim())}),senderIsBot:n.author.bot===!0,kind:i?"direct":"group",conversationId:String(n.channel_id),content:z1(n.content??"",t),plainText:(!Array.isArray(n.attachments)||n.attachments.length===0)&&(!Array.isArray(n.sticker_items)||n.sticker_items.length===0)&&!n.poll,images:Array.isArray(n.attachments)?n.attachments.map(a=>Fue(a,o)).filter(Boolean):[],files:Array.isArray(n.attachments)?n.attachments.map(a=>Lue(a,o)).filter(Boolean):[],addressed:e,replyTarget:{channelId:String(n.channel_id),replyToMessageId:String(n.id)},reactionTarget:{channelId:String(n.channel_id),messageId:String(n.id)},connectionTestTarget:{channelId:String(n.channel_id)}}}async function Uue(n,t,{api:o,channel:i,fetchImpl:e=fetch,signal:a,onChannel:A}={}){let r=X1(n,t,{fetchImpl:e});if(!r||r.senderIsBot)return r;if(a?.throwIfAborted(),r.kind==="direct")return UI(r,{id:r.conversationId,type:1},t);if(!o||typeof o.getChannel!="function")throw new TypeError("Discord route resolution requires the Discord API");let s=J_(i??await o.getChannel({channelId:r.conversationId,signal:a}),A);if(z_(s)||!r.addressed)return UI(r,s,t);let g=Number(s?.type);if(g!==Sue&&g!==wue)return UI(r,s,t,{fallback:"unsupported-channel",notice:"\u5F53\u524D\u9891\u9053\u4E0D\u652F\u6301\u81EA\u52A8\u521B\u5EFA Thread\uFF0C\u5DF2\u76F4\u63A5\u5728\u5F53\u524D\u9891\u9053\u56DE\u590D\u3002"});a?.throwIfAborted();let c;try{if(c=J_(await o.startThreadFromMessage({channelId:r.conversationId,messageId:r.messageId,name:vue(n,t),signal:a}),A),!V1(c,n))throw new Error("Discord returned an invalid thread for the source message")}catch(I){let d;try{d=await Gue(o,n,{signal:AbortSignal.timeout(mue),onChannel:A})}catch(B){throw a?.aborted?a.reason??I:(await J1(o,r,a),j1(B))}if(d)return UI(r,d,t,{fromSourceMessage:!0});if(a?.aborted)throw a.reason??I;if(Pue(I))throw await J1(o,r,a),j1(I);return UI(r,s,t,{fallback:"thread-create-failed",notice:"\u65E0\u6CD5\u521B\u5EFA Thread\uFF0C\u5DF2\u76F4\u63A5\u5728\u5F53\u524D\u9891\u9053\u56DE\u590D\u3002"})}return UI(r,c,t,{fromSourceMessage:!0})}var q_=class{#e;#A;#t=new WeakSet;constructor({api:t,signal:o}){this.#e=t,this.#A=o}async sendText(t,o){let i=!this.#t.has(t)&&t?.notice?String(t.notice):null,e=ss(i?`${i} +${B.message}`:dt(m);if(this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a message [${m.referenceId}]:`,I),await f(T))return I.deliveryReceipt;g?.cancel?.();try{await this.#A.sendText(A,T)}catch(_){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to send the safe error reply:`,_)}return I.deliveryReceipt}finally{await Promise.allSettled([this.#G(e),this.#C.closeRoute(e)])}}async#D(t,o,i,e,a){if(this.#s?.aborted){t.statusReaction?.clear();return}let A=this.#c.get(e),r=a.claimedReplyMessageId===o;if(!A||A!==a||A.submitting)return r&&(!A||A!==a)?this.#O(t,o):this.#Q(t,o,i,e,{releaseMessageId:!1});if(this.#r.hasSeen(o))return;if(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),t.kind==="group"&&t.addressed!==!0){this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString();return}let s=t.replyTarget,g=Ii(t.content);if(!g||Tt(t)||wt(t)){try{await this.#A.sendText(s,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"))}catch(d){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to reject a non-text interaction reply:`,d)}return}let c=this.#c.get(e);if(!c||c!==a||c.submitting)return r&&(!c||c!==a)?this.#O(t,o,{alreadyRecorded:!0}):this.#Q(t,o,i,e,{releaseMessageId:!1,alreadyRecorded:!0});if(c.target=s,c.needsPresentation){let d=c.presentationTask!==null;try{await this.#T(c)}catch(f){t.statusReaction?.error(),this.#i.lastError=w("{label}\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002",{label:this.#e.label}),this.#a.error?.(`[dsh-im:${this.#e.key}] failed to retry an interaction question:`,f),c.interaction.reconnect?.();return}let B=this.#c.get(e);if(!B||B!==a||B.submitting)return r&&(!B||B!==a)?this.#O(t,o,{alreadyRecorded:!0}):this.#Q(t,o,i,e,{releaseMessageId:!1,alreadyRecorded:!0});if(!d)return}let I=c.questions[c.index];if(I){if(c.answers.push(wi(I,g)),c.index+=1,c.indexthis.#A.sendText(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=Ii(t?.interactionId)||Ii(t?.rpcId);if(!Ii(t?.rpcId)||!r||!Ii(t?.sessionId)||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#a.warn?.(`[dsh-im:${this.#e.key}] ignored an invalid Harness question interaction`);return}if(t.recovered===!0){await this.#_(t,`${this.#e.label} safely cancelled an interaction left by an earlier client.`);try{await this.#A.sendText(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"))}catch(c){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to send an interaction recovery notice:`,c)}return}let s=this.#c.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#T(s);return}if(this.#g.has(r))return;if(s){this.#a.warn?.(`[dsh-im:${this.#e.key}] cancelled a second pending Harness question`),await this.#_(t,`${this.#e.label} is already handling another user interaction.`);return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,target:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,presentationTask:null};this.#c.set(o,g),this.#g.set(r,o),await this.#T(g)}async#N(t){if(t?.kind==="approval"){await this.#C.handleResolved(t);return}let o=Ii(t?.interactionId);if(t?.kind!=="question"||!o)return;let i=this.#g.get(o);i&&this.#R(i,o)}#T(t){if(t.presentationTask)return t.presentationTask;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=(async()=>{await this.#A.sendText(t.target,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})),t.needsPresentation=!1})();return t.presentationTask=i,i.then(()=>{t.presentationTask===i&&(t.presentationTask=null)},()=>{t.presentationTask===i&&(t.presentationTask=null)}),i}async#O(t,o,{alreadyRecorded:i=!1}={}){if(!i){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}try{await this.#A.sendText(t.replyTarget,w(K1))}catch(e){this.#a.error?.(`[dsh-im:${this.#e.key}] failed to send an expired interaction notice:`,e)}}#w(t,o){let i=this.#c.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#c.delete(t),this.#g.delete(i.interactionId),i)}#R(t,o){return this.#w(t,o)!==null}async#_(t,o){try{await t.respond({ok:!1,error:{code:"cancelled",message:o,details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){if(i?.code!=="interaction-not-pending")throw i}}async#G(t){let o=this.#w(t);if(!(!o||o.kind!=="question"))try{await this.#_(o.interaction,`The ${this.#e.label} interaction ended before the user answered.`)}catch(i){this.#a.warn?.(`[dsh-im:${this.#e.key}] failed to cancel a pending Harness interaction:`,i)}}};var Y_=Object.freeze({key:"discord",label:"Discord",connectionLabel:" Gateway \u957F\u8FDE\u63A5",reactions:Object.freeze({processing:"\u{1F440}",success:"\u2705",error:"\u274C"})}),qQ=class extends ns{constructor(t){super({descriptor:Y_,...t})}};var aC=class extends xp{constructor(t){super({...t,descriptor:Y_,inspectToken:t.inspectToken??U1,deriveIdentity:v1,maskPlatformId:P1})}};var zQ=class extends ur{constructor(t){super({...t,rpcIdPrefix:"discord",logPrefix:"dsh-discord"})}};function ss(n,t){let o=typeof n=="string"?n.trim():"";if(!o)return[];let i=[],e=o;for(;e.length>t;){let a=e.lastIndexOf(` +`,t);anull,logger:r=console}){let s,g=[],c=null,I=null,d=null,B=!1,f=n,Q=()=>{B||I!==null||d||!c||(I=setTimeout(()=>{I=null;let y=c;c=null;let m=ss(y,t)[0]??n;d=Promise.resolve(m===f?void 0:e(s,m)).then(()=>{f=m}).catch(T=>r.warn?.("[dsh-im] streamed message update failed:",T)).finally(()=>{d=null,Q()})},o),I?.unref?.())};return{get messageId(){return s},get providerMessageIds(){return[...g]},async start(){return s=await i(n),(typeof s=="string"&&s.trim()||Number.isSafeInteger(s))&&g.push(String(s)),this},update(y){B||typeof y!="string"||!y.trim()||(c=y,Q())},async finish(y){if(B)throw new Error("Message stream is already closed");B=!0,I!==null&&clearTimeout(I),I=null,c=null,await d?.catch(()=>{});let m=ss(y,t),T=m[0]??w("\u5904\u7406\u5B8C\u6210\u3002");T!==f&&await e(s,T),f=T;for(let _ of m.slice(1)){let R=await a(_),K=A(R);(typeof K=="string"&&K.trim()||Number.isSafeInteger(K))&&g.push(String(K))}},cancel(){B=!0,c=null,I!==null&&clearTimeout(I),I=null}}}async function x1(n){try{await n?.body?.cancel?.()}catch{}}function Que(n,t){return!Array.isArray(t)||t.some(o=>typeof o=="string"&&(n.hostname===o||o.startsWith(".")&&(n.hostname===o.slice(1)||n.hostname.endsWith(o))))}async function Yp(n,{fetchImpl:t=fetch,headers:o,signal:i,allowedHosts:e}={}){let a=new URL(n);if(a.protocol!=="https:")throw new Error("File download URL must use HTTPS");if(!Que(a,e))throw new Error("File download URL is not hosted by the messaging platform");let A=await t(a,{method:"GET",headers:o,signal:i,redirect:"manual"});if(Number.isInteger(A?.status)&&A.status>=300&&A.status<400){await x1(A);let r=new Error(`File download redirect was blocked (HTTP ${A.status})`);throw r.code="file-redirect-blocked",r}if(!A?.ok){await x1(A);let r=new Error(`File download failed with HTTP ${A?.status??"unknown"}`);throw r.code="file-http-error",r.status=A?.status,r}if(A.body?.[Symbol.asyncIterator])return{stream:A.body};if(typeof A.arrayBuffer=="function"){let r=Buffer.from(await A.arrayBuffer());return{stream:(async function*(){yield r})()}}throw new Error("File download returned no readable body")}var yue=37377,mue=5e3,Y1=Object.freeze([1e3,3e3,5e3,1e4,3e4]),Sue=0,wue=5,Due=10,Oue=11,bue=12,Mue=new Set([Due,Oue,bue]),_ue=new Set(["image/jpeg","image/png","image/webp","image/gif"]),Tue=new Map([[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".png","image/png"],[".webp","image/webp"],[".gif","image/gif"]]),q1=Object.freeze(["cdn.discordapp.com"]);function Nue(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Discord returned an insecure Gateway URL");return t.searchParams.set("v","10"),t.searchParams.set("encoding","json"),t.href}function j_(n,t,o){if(typeof n.addEventListener=="function")n.addEventListener(t,o);else if(typeof n.on=="function")n.on(t,o);else throw new TypeError("Discord WebSocket does not support events")}function Rue(n){return typeof n=="string"?n:typeof n?.data=="string"?n.data:Buffer.isBuffer(n)?n.toString("utf8"):Buffer.isBuffer(n?.data)?n.data.toString("utf8"):null}function kue(n){if(n===4004){let o=new Error(w("Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002"));return o.code="discord-401",o}if(n===4013||n===4014){let o=new Error(w("Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002"));return o.code="discord-intents",o}let t=new Error(`Discord Gateway closed (${n||"unknown"})`);return t.code="discord-gateway-closed",t}function z1(n,t){return typeof n!="string"?"":n.replace(new RegExp(`<@!?${t}>`,"g"),"").trim()}function vue(n,t){return[...z1(n?.content??"",t).replace(/\s+/g," ").trim()||"DeepSeek Harness"].slice(0,100).join("")}function z_(n){return Mue.has(Number(n?.type))}function V1(n,t){return z_(n)&&String(n?.id??"")===String(t?.id??"")&&String(n?.parent_id??"")===String(t?.channel_id??"")}function J_(n,t){return n?.id&&t?.(n),n}function UI(n,t,o,{fromSourceMessage:i=!1,fallback:e=null,notice:a=null}={}){let A=String(t?.id??n.conversationId),r=z_(t),s=r&&String(t?.owner_id??"")===String(o),g=r&&t?.parent_id?String(t.parent_id):A;return{...n,conversationId:A,addressed:n.addressed||s,requiresMention:r?!s:n.kind==="group",replyTarget:{channelId:A,...!i&&n.replyTarget?.replyToMessageId?{replyToMessageId:n.replyTarget.replyToMessageId}:{},...a?{notice:a}:{}},connectionTestTarget:{channelId:A},conversationRoute:{peerId:g,...r?{threadId:A,managed:s}:{},...e?{fallback:e}:{}}}}function Pue(n){let t=Number(n?.status);return!Number.isInteger(t)||t>=500}function j1(n){let t=new Error("Discord Thread creation result is uncertain",{cause:n});return t.code="discord-thread-create-uncertain",t}async function Gue(n,t,{signal:o,onChannel:i}={}){try{let e=J_(await n.getChannel({channelId:String(t.id),signal:o}),i);return V1(e,t)?e:null}catch(e){if(e?.status===404)return null;throw e}}async function J1(n,t,o){try{await n.createMessage({channelId:t.replyTarget.channelId,replyToMessageId:t.replyTarget.replyToMessageId,content:"Thread \u521B\u5EFA\u7ED3\u679C\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u3002\u82E5\u5DF2\u521B\u5EFA\uFF0C\u8BF7\u5728\u5BF9\u5E94 Thread \u4E2D\u91CD\u8BD5\uFF1B\u82E5\u672A\u521B\u5EFA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0 @\u673A\u5668\u4EBA\u3002",signal:o})}catch(i){if(o?.aborted)throw o.reason??i}}function W1(n){let t=typeof n?.content_type=="string"?n.content_type.split(";",1)[0].trim().toLowerCase():"";if(_ue.has(t))return t;let o=typeof n?.filename=="string"?n.filename.toLowerCase():"";for(let[i,e]of Tue)if(o.endsWith(i))return e;return null}function Z1(n){return Number.isSafeInteger(n)&&n>=0?n:void 0}function Fue(n,t){let o=W1(n);return!o||typeof n?.url!="string"?null:{name:typeof n.filename=="string"?n.filename:void 0,mediaType:o,size:Z1(n.size),load:i=>Do(n.url,{...i,fetchImpl:t,allowedHosts:q1})}}function Lue(n,t){if(W1(n)||typeof n?.url!="string"||!n.url)return null;let o=typeof n.content_type=="string"&&n.content_type?n.content_type.split(";",1)[0].trim().toLowerCase():void 0;return{name:typeof n.filename=="string"&&n.filename?n.filename:String(n.id??"discord-file"),...o?{mediaType:o}:{},size:Z1(n.size),load:({signal:i}={})=>Yp(n.url,{fetchImpl:t,signal:i,allowedHosts:q1})}}function X1(n,t,{fetchImpl:o=fetch}={}){if(!n?.id||!n?.channel_id||!n?.author?.id||Number(n.type)===21)return null;let i=!n.guild_id,e=i||n.mentions?.some(a=>String(a?.id)===String(t));return{messageId:String(n.id),senderId:String(n.author.id),contextSource:()=>({senderName:[n.member?.nick,n.author.global_name,n.author.username].find(a=>typeof a=="string"&&a.trim())}),senderIsBot:n.author.bot===!0,kind:i?"direct":"group",conversationId:String(n.channel_id),content:z1(n.content??"",t),plainText:(!Array.isArray(n.attachments)||n.attachments.length===0)&&(!Array.isArray(n.sticker_items)||n.sticker_items.length===0)&&!n.poll,images:Array.isArray(n.attachments)?n.attachments.map(a=>Fue(a,o)).filter(Boolean):[],files:Array.isArray(n.attachments)?n.attachments.map(a=>Lue(a,o)).filter(Boolean):[],addressed:e,replyTarget:{channelId:String(n.channel_id),replyToMessageId:String(n.id)},reactionTarget:{channelId:String(n.channel_id),messageId:String(n.id)},connectionTestTarget:{channelId:String(n.channel_id)}}}async function Uue(n,t,{api:o,channel:i,fetchImpl:e=fetch,signal:a,onChannel:A}={}){let r=X1(n,t,{fetchImpl:e});if(!r||r.senderIsBot)return r;if(a?.throwIfAborted(),r.kind==="direct")return UI(r,{id:r.conversationId,type:1},t);if(!o||typeof o.getChannel!="function")throw new TypeError("Discord route resolution requires the Discord API");let s=J_(i??await o.getChannel({channelId:r.conversationId,signal:a}),A);if(z_(s)||!r.addressed)return UI(r,s,t);let g=Number(s?.type);if(g!==Sue&&g!==wue)return UI(r,s,t,{fallback:"unsupported-channel",notice:"\u5F53\u524D\u9891\u9053\u4E0D\u652F\u6301\u81EA\u52A8\u521B\u5EFA Thread\uFF0C\u5DF2\u76F4\u63A5\u5728\u5F53\u524D\u9891\u9053\u56DE\u590D\u3002"});a?.throwIfAborted();let c;try{if(c=J_(await o.startThreadFromMessage({channelId:r.conversationId,messageId:r.messageId,name:vue(n,t),signal:a}),A),!V1(c,n))throw new Error("Discord returned an invalid thread for the source message")}catch(I){let d;try{d=await Gue(o,n,{signal:AbortSignal.timeout(mue),onChannel:A})}catch(B){throw a?.aborted?a.reason??I:(await J1(o,r,a),j1(B))}if(d)return UI(r,d,t,{fromSourceMessage:!0});if(a?.aborted)throw a.reason??I;if(Pue(I))throw await J1(o,r,a),j1(I);return UI(r,s,t,{fallback:"thread-create-failed",notice:"\u65E0\u6CD5\u521B\u5EFA Thread\uFF0C\u5DF2\u76F4\u63A5\u5728\u5F53\u524D\u9891\u9053\u56DE\u590D\u3002"})}return UI(r,c,t,{fromSourceMessage:!0})}var q_=class{#e;#A;#t=new WeakSet;constructor({api:t,signal:o}){this.#e=t,this.#A=o}async sendText(t,o){let i=!this.#t.has(t)&&t?.notice?String(t.notice):null,e=ss(i?`${i} ${o}`:o,1900),a=[];for(let[A,r]of e.entries()){let s=await this.#e.createMessage({channelId:t.channelId,content:r,replyToMessageId:A===0?t.replyToMessageId:void 0,signal:this.#A});i&&A===0&&this.#t.add(t),typeof s?.id=="string"&&s.id&&a.push(s.id)}return{providerMessageIds:a}}sendTyping(t){return this.#e.sendTyping({channelId:t.channelId,signal:this.#A})}sendFile(t,o){return this.#e.createFileMessage({channelId:t.channelId,file:o,replyToMessageId:t.replyToMessageId,signal:this.#A})}addReaction(t,o,{signal:i}={}){return this.#e.addOwnReaction({channelId:t.channelId,messageId:t.messageId,emoji:o,signal:this.#r(i)})}removeReaction(t,o,{signal:i}={}){return this.#e.removeOwnReaction({channelId:t.channelId,messageId:t.messageId,emoji:o,signal:this.#r(i)})}async openStream(t){let o=!this.#t.has(t)&&t?.notice?String(t.notice):null,i=a=>o?`${o} ${a}`:a;return VQ({limit:o?1800:1900,create:async a=>{let A=await this.#e.createMessage({channelId:t.channelId,content:i(a),replyToMessageId:t.replyToMessageId,signal:this.#A});return o&&this.#t.add(t),A.id},edit:(a,A)=>this.#e.editMessage({channelId:t.channelId,messageId:a,content:i(A),signal:this.#A}),sendRemainder:a=>this.#e.createMessage({channelId:t.channelId,content:a,signal:this.#A}),messageIdForResult:a=>a?.id}).start()}#r(t){return t??this.#A}};function Hue(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...io()}}var iC=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g=Hue();#I=null;#d=null;#h=null;#C=null;#u=null;#B=null;#f=null;#Q=null;#S=null;#y=!0;#m=null;#D=0;#E=0;#N=!0;#T=null;#O=new Map;#w=new Map;constructor({config:t,token:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,createApi:c=B=>new rC(B),createWebSocket:I=B=>new WebSocket(B),random:d=Math.random}){if(!t||!o||!i||!e)throw new TypeError("DiscordRuntime requires config, token, Harness, and state");if(typeof I!="function")throw new TypeError("DiscordRuntime requires WebSocket");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=d}get status(){return structuredClone(this.#g)}async sendConnectionTest(t){if(!this.#g.ready||!this.#d){let o=new Error("Discord bot is not connected");throw o.code="test-target-unavailable",o}return this.#d.sendConnectionTest(t)}async sendProactiveText(t,o,i={}){if(!this.#g.ready||!this.#d){let a=new Error("Discord bot is not connected");throw a.code="bot-not-connected",a}let e=typeof t?.route?.channelId=="string"?t.route.channelId.trim():"";if(t?.kind!=="channel"||!e){let a=new TypeError("Invalid Discord proactive delivery target");throw a.code="invalid-target",a}return this.#d.sendProactiveText({channelId:e},o,i)}async start(){return this.#g.ready&&this.#C?this.status:this.#T?this.#T:(this.#T=this.#R().finally(()=>{this.#T=null}),this.#T)}async#R(){await this.stop(),this.#N=!1,this.#f=null,this.#B=null,this.#Q=null,this.#D=0,this.#O.clear(),this.#w.clear(),this.#g.startedAt=new Date().toISOString(),this.#g.connectionState="connecting",this.#g.lastError=null,await this.#t.ensureRunning(),this.#g.harnessReachable=!0;let t=new AbortController;this.#h=t;let o=this.#s({token:this.#A});this.#I=o;try{let[i,e]=await Promise.all([o.getCurrentUser({signal:t.signal}),o.getGatewayBot({signal:t.signal})]);if(String(i?.id??"")!==this.#e.platformId||i?.bot!==!0)throw new Error("Discord token identity does not match the saved bot");this.#u=e?.url;let a=new q_({api:o,signal:t.signal});this.#d=new qQ({bot:a,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#g,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let A;try{await Promise.race([this.#_(!1),new Promise((r,s)=>{A=setTimeout(()=>s(new Error("Discord Gateway did not become ready in time")),this.#n)})])}finally{clearTimeout(A)}return this.status}catch(i){throw this.#g.ready=!1,this.#g.connectionState="failed",this.#g.lastError=i?.message??String(i),await this.stop(),i}}#_(t){if(this.#N)return Promise.reject(new Error("Discord runtime is stopped"));let o=++this.#E,i=Nue(t&&this.#B?this.#B:this.#u),e=this.#p(i);this.#C=e;let a=!1;return new Promise((A,r)=>{let s=()=>{if(a||o!==this.#E)return;a=!0,this.#D=0;let g=Date.now();this.#g.ready=!0,this.#g.connectionState="connected",this.#g.lastCheckedAt=g,this.#g.lastConnectedAt=g,this.#g.lastError=null,A()};j_(e,"message",g=>{if(o!==this.#E||this.#N)return;let c=Rue(g);if(!c)return;let I;try{I=JSON.parse(c)}catch{this.#i.warn?.("[dsh-im:discord] ignored malformed Gateway JSON");return}if(Number.isSafeInteger(I.s)&&(this.#Q=I.s),I.op===10){this.#P(I.d?.heartbeat_interval,e,o),t&&this.#f?this.#F(e,{op:6,d:{token:this.#A,session_id:this.#f,seq:this.#Q}}):this.#F(e,{op:2,d:{token:this.#A,intents:yue,properties:{os:process.platform,browser:"dsh-im",device:"dsh-im"}}});return}if(I.op===11){this.#y=!0,this.#g.lastCheckedAt=Date.now();return}if(I.op===1){this.#H(e);return}if(I.op===7){e.close(4e3,"Reconnect requested");return}if(I.op===9){I.d!==!0&&(this.#f=null,this.#B=null,this.#Q=null),e.close(4e3,"Invalid session");return}if(I.op===0){if(I.t==="READY")this.#f=I.d?.session_id??null,this.#B=I.d?.resume_gateway_url??null,s();else if(I.t==="RESUMED")s();else if(I.t==="GUILD_CREATE")for(let d of[...I.d?.channels??[],...I.d?.threads??[]])this.#G(d);else if(I.t==="CHANNEL_CREATE"||I.t==="CHANNEL_UPDATE"||I.t==="THREAD_CREATE"||I.t==="THREAD_UPDATE")this.#G(I.d);else if(I.t==="CHANNEL_DELETE"||I.t==="THREAD_DELETE")I.d?.id&&this.#O.delete(String(I.d.id));else if(I.t==="THREAD_LIST_SYNC")for(let d of I.d?.threads??[])this.#G(d);else if(I.t==="MESSAGE_CREATE"){let d=this.#d;I.d&&d&&this.#k(I.d,d).catch(B=>{o!==this.#E||this.#N||this.#i.error?.(`[dsh-im:discord] bot ${this.#e.botId} message handling failed:`,B)})}}}),j_(e,"close",(g={})=>{if(o!==this.#E)return;if(this.#U(),this.#C===e&&(this.#C=null),this.#N){a||r(new DOMException("Stopped","AbortError"));return}let c=kue(Number(g.code)||0);if(this.#g.ready=!1,this.#g.connectionState="connecting",this.#g.lastError=c.message,a||(a=!0,r(c)),c.code==="discord-401"||c.code==="discord-intents"){this.#g.connectionState="failed";return}this.#L()}),j_(e,"error",()=>{o!==this.#E||this.#N||(this.#g.lastError="Discord Gateway WebSocket error")})})}#G(t){t?.id&&this.#O.set(String(t.id),t)}async#k(t,o){let i=String(t?.id??"");if(!i||this.#r.hasSeen(i))return;let e=X1(t,this.#e.platformId),a;if(e?.kind==="group"&&e.addressed===!0&&e.senderIsBot!==!0&&(a=Ba(this.#o,{conversationType:"group",senderIds:[e.senderId],text:e.content,hasImages:e.images.length>0,hasFiles:e.files.length>0}),!a.allowed)){await o.accept(e,{accessDecision:a});return}let A=this.#w.get(i);if(!A){let r=Aa(this.#l,t.guild_id?"group":"direct"),s=Uue(t,this.#e.platformId,{api:this.#I,channel:this.#O.get(String(t.channel_id)),signal:this.#h?.signal,onChannel:g=>this.#G(g)});A={pendingRoute:s,contextSnapshot:r},this.#w.set(i,A),s.finally(()=>{this.#w.get(i)===A&&this.#w.delete(i)}).catch(()=>{})}try{let r=await A.pendingRoute;r&&await o.accept(r,{contextSnapshot:A.contextSnapshot,...a?{accessDecision:a}:{}})}catch(r){throw r?.code==="discord-thread-create-uncertain"&&await this.#r.markSeen(i),r}}#F(t,o){t.readyState===1&&t.send(JSON.stringify(o))}#P(t,o,i){if(this.#U(),!Number.isFinite(t)||t<1e3){o.close(4e3,"Invalid heartbeat interval");return}this.#y=!0;let e=a=>{this.#S=setTimeout(()=>{if(!(this.#N||i!==this.#E||this.#C!==o)){if(!this.#y){o.close(4e3,"Heartbeat was not acknowledged");return}this.#H(o),e(t)}},a),this.#S?.unref?.()};e(Math.floor(t*this.#c()))}#H(t){this.#y=!1,this.#F(t,{op:1,d:this.#Q})}#U(){this.#S!==null&&clearTimeout(this.#S),this.#S=null,this.#y=!0}#L(){if(this.#N||this.#m!==null)return;let t=Y1[Math.min(this.#D,Y1.length-1)];this.#D+=1,this.#m=setTimeout(()=>{this.#m=null,this.#_(!!this.#f).catch(o=>{this.#N||(this.#i.warn?.("[dsh-im:discord] Gateway reconnect failed:",o),this.#L())})},t),this.#m?.unref?.()}async stop(){this.#N=!0,this.#E+=1,this.#h?.abort(),this.#h=null,this.#m!==null&&clearTimeout(this.#m),this.#m=null,this.#U();let t=this.#C,o=this.#d;this.#C=null,this.#d=null,this.#I=null,this.#w.clear();try{t&&t.readyState<2&&t.close(1e3,"Plugin stopped")}catch(i){this.#i.warn?.(`[dsh-im:discord] bot ${this.#e.botId} failed to close Gateway:`,i)}return await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(i=>setTimeout(i,2e3))]),this.#g.ready=!1,this.#g.connectionState="idle",this.status}};import{mkdir as Kue,readFile as xue,rename as Yue,unlink as jue,writeFile as Jue}from"node:fs/promises";import{dirname as que}from"node:path";var WQ=Object.freeze({version:1,sessions:{},seenMessageIds:[],cursor:null});function zue(n){if(!n||typeof n!="object")return structuredClone(WQ);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&o&&typeof i=="string"&&i&&(t[o]=i);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string"&&o).slice(-1e3):[],cursor:Number.isSafeInteger(n.cursor)&&n.cursor>=0?n.cursor:null}}var gs=class{#e;#A=structuredClone(WQ);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=zue(JSON.parse(await xue(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(WQ),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}cursor(){return this.#A.cursor}async setCursor(t){if(!Number.isSafeInteger(t)||t<0)throw new TypeError("Invalid update cursor");this.#A.cursor=t,await this.#r()}snapshot(){return structuredClone(this.#A)}async remove(){try{await jue(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(WQ)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} -`,o=this.#t.then(async()=>{await Kue(que(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await Jue(i,t,{encoding:"utf8",mode:384}),await Yue(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};var ZQ=class extends gs{};import{unlink as Wue}from"node:fs/promises";import{homedir as Zue}from"node:os";import{join as oC,resolve as HI}from"node:path";var $1=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function Vue(n){if(!Array.isArray(n)||n.length===0)return[...$1];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...$1]}var V_=class{#e;#A;#t;#r;#l;#o;#i;#a;#n=null;#s=null;#p=0;#c=!1;#g=!1;#I;#d;constructor({channel:t,controller:o,harness:i,logger:e=console,retryDelaysMs:a,healthyIntervalMs:A=15e3,setTimeoutImpl:r=setTimeout,clearTimeoutImpl:s=clearTimeout}){if(!t)throw new TypeError("TokenConnectionSupervisor requires a channel");if(!o||typeof o.initialize!="function"||typeof o.status!="function")throw new TypeError("TokenConnectionSupervisor requires a controller");if(!i||typeof i.ensureRunning!="function")throw new TypeError("TokenConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=Vue(a),this.#o=Number.isFinite(A)&&A>=0?A:15e3,this.#i=r,this.#a=s,this.#I=new Promise(g=>{this.#d=g})}get ready(){return this.#I}start(){return this.#g||this.#c?this:(this.#g=!0,this.#h(0),this)}async close(){this.#c||(this.#c=!0,this.#n!==null&&this.#a(this.#n),this.#n=null,await this.#s?.catch(()=>{}),this.#d?.(null),this.#d=null)}#h(t){this.#c||(this.#n=this.#i(()=>{this.#n=null,this.#C()},t),this.#n?.unref?.())}async#C(){if(this.#c||this.#s)return;let t=this.#u();this.#s=t;try{await t}finally{this.#s===t&&(this.#s=null)}}async#u(){try{if(await this.#t.ensureRunning(),this.#c)return;let t=await this.#A.initialize();if(this.#c)return;this.#d?.(t),this.#d=null;let{configured:o,connected:i}=t.totals;if(inr(e==="telegram"?"telegram":"discord",Re),R=typeof n.logger=="function"?n.logger(`dsh-im:${e}`):n.logger??console,K=()=>La(n),L=W_(t,e),F=await new d(L.config).load(),q=HI(t.workspace??process.cwd()),V=o.WorkspaceStore??ra,x=o.workspaces??await new V(L.workspaces,{defaultWorkspace:q}).load(),G=F.list();await x.reconcile(G.map(Re=>Re.botId)),await Promise.all(G.map(Re=>x.ensure(Re.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:_(Re)})));let J=typeof F.remove=="function"?Ha(F,{workspaces:x}):F,U=new Map,N=Re=>HI(L.bots,Re,"state.json"),k=async Re=>{let We=U.get(Re);return We||(We=await new B(N(Re)).load(),U.set(Re,We)),We},z=ja(n,o.commandExecutor),{controlExecutor:Ae,sessionMaintenanceExecutor:ie,fileIngressExecutor:we}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),se=new f({...I,workspace:q,autostart:!1,dshBin:t.dshBin??"dsh",...z?{commandExecutor:z}:{},...Ae?{controlExecutor:Ae}:{},...ie?{sessionMaintenanceExecutor:ie}:{},...we?{fileIngressExecutor:we}:{}}),Te=new Q({credentials:n.credentials,configStore:J,logger:R,...o.inspectToken?{inspectToken:o.inspectToken}:{},createRuntime:async({botId:Re,config:We,token:ve})=>{let aA=await k(Re);await x.ensure(Re,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:_(We)});let Be=Ka(se,{botId:Re,workspaces:x,state:aA,agentPresetCatalog:K});return new y({...m,config:We,token:ve,harness:Be.harness,state:Be.state,contextEnhancement:{botId:Re,getSettings:()=>x.contextEnhancementFor(Re)},accessPolicy:qa(x,Re,{channel:e,config:We}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...Ie)=>R.error?.(`[${Re}]`,...Ie),warn:(...Ie)=>R.warn?.(`[${Re}]`,...Ie),info:(...Ie)=>R.info?.(`[${Re}]`,...Ie),debug:(...Ie)=>R.debug?.(`[${Re}]`,...Ie)}})},deleteState:async({botId:Re})=>{let We=U.get(Re);if(U.delete(Re),We&&typeof We.remove=="function")await We.remove();else try{await Wue(N(Re))}catch(ve){if(ve?.code!=="ENOENT")throw ve}}}),fe=xa(Te,{workspaces:x,stateFor:k,agentPresetCatalog:K}),ke=T({channel:e,controller:fe,harness:se,logger:R,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:fe,...FQ(e)?{deliveryAdapter:Ya({channel:e,workspaces:x,coreController:Te,stateFor:k})}:{},ready:ke.ready,async close(){await ke.close(),await fe.close(),se.stopManagedProcess()}}}function Z_(n,t={},o={}){return XQ(n,t,o,{channel:"discord",ConfigStore:jQ,StateStore:ZQ,HarnessClient:zQ,Controller:aC,Runtime:iC})}var Tr=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),Xue=Object.freeze(Object.values(Tr)),$ue=new Set(["token","botToken","tokenRef","platformId","secret","secretRef"]),eBe=new Set(["telegram-transport-error","telegram-timeout","telegram-response-invalid"]);function $_(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function $Q(n,t){return $_(n)&&Object.keys(n).every(o=>t.includes(o))}function e3(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function ABe(n){return typeof n=="string"&&n.trim().length>=20&&n.length<=4096}function tBe(n,t){return $_(t)?n===Tr.status?$Q(t,[])?null:"connection.status does not accept fields.":n===Tr.bindCredentials?$Q(t,["token"])&&ABe(t.token)?null:"bot.bind-credentials requires a Bot Token.":n===Tr.reconnectBot?$Q(t,["botId","sendTest"])&&e3(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId.":n===Tr.deleteBot?$Q(t,["botId","confirm"])&&e3(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Tr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Tr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Tr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Tr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown bot endpoint.":"Payload must be an object."}function X_(n){if(Array.isArray(n))return n.map(X_);if(!$_(n))return n;let t={};for(let[o,i]of Object.entries(n))$ue.has(o)||(t[o]=X_(i));return t}function rBe(n,t){let o=Xa(t);return o||(t?.code==="webhook-configured"?{code:"webhook-configured",message:t.message}:t?.code==="telegram-401"||t?.code==="discord-401"?{code:"invalid-token",message:`${n} Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002`}:n==="Telegram"&&eBe.has(t?.code)?{code:"telegram-network-error",message:"\u65E0\u6CD5\u8BBF\u95EE Telegram Bot API\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u4EE3\u7406\u8BBE\u7F6E\uFF1BNode.js 22.21+ \u53EF\u8BBE\u7F6E NODE_USE_ENV_PROXY=1\uFF0C\u5E76\u914D\u7F6E HTTPS_PROXY\u3001HTTP_PROXY \u548C NO_PROXY\uFF0C\u7136\u540E\u91CD\u542F dsh web\u3002"}:t?.code==="discord-intents"?{code:"discord-intents",message:t.message}:{code:`${n.toLowerCase()}-operation-failed`,message:`${n} \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002`})}function ey(n,{channel:t}){for(let o of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[o]!="function")throw new TypeError(`A complete ${t} controller is required (${o})`);return async(o,i,e)=>{if(e?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!Xue.includes(o))return{ok:!1,error:{code:"bad-request",message:`Unknown ${t} endpoint.`}};let a=tBe(o,i);if(a)return{ok:!1,error:{code:"bad-request",message:a}};try{let A;if(o===Tr.status)A=await n.status();else if(o===Tr.bindCredentials)A=await n.bindCredentials(i);else if(o===Tr.reconnectBot){if(A=await n.reconnectBot(i.botId),e?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(i.sendTest===!0){let r=null;try{if(A?.bots?.find(s=>s?.botId===i.botId)?.connected!==!0){let s=new Error("Bot is not connected");throw s.code="test-target-unavailable",s}if(typeof n.sendConnectionTest!="function"){let s=new Error("Connection test is unavailable");throw s.code="test-target-unavailable",s}await n.sendConnectionTest(i.botId)}catch(s){r=s}A={...A,testMessage:or(r)}}}else if(o===Tr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");A=await n.updateWorkspace(i.botId,i.workspace)}else if(o===Tr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");A=await n.updateContextEnhancement(i.botId,i.config)}else if(o===Tr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");A=await n.updateAccessPolicy(i.botId,i.policy)}else if(o===Tr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");A=await n.updateAgentPreset(i.botId,i.agentPreset)}else A=await n.deleteBot(i.botId);return e?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:X_(A)}}catch(A){return e?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:rBe(t,A)}}}}function A3(n,t,{channel:o,rpcChannel:i,authority:e}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(i,ey(t,{channel:o}),{authority:fr(e)})}var t3="/discord",r3=Tr,aBe=Object.freeze(Object.values(r3));function Ay(n,t,o){return A3(n,t,{channel:"Discord",rpcChannel:t3,authority:o})}async function a3(n,t={}){if(t?.controller)return Ay(n,t.controller,t.rpcAuthority);let o=await Z_(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Ay(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Discord bot connections"),e}import{homedir as DBe}from"node:os";import{join as rT,resolve as aT}from"node:path";import{mkdir as iBe,readFile as oBe,rename as nBe,unlink as sBe,writeFile as gBe}from"node:fs/promises";import{dirname as cBe,isAbsolute as IBe}from"node:path";var jp="office-harness.v1",i3="/office",Jp=Object.freeze({status:"connection.status",configure:"connector.configure",reconnect:"connector.reconnect",test:"connector.test",remove:"connector.remove"}),Qn=Object.freeze({stream:"/api/harness/connector/stream",heartbeat:"/api/harness/connector/heartbeat",job:"/api/harness/connector/jobs/:id",accept:"/api/harness/connector/jobs/:id/accept",renew:"/api/harness/connector/jobs/:id/renew",progress:"/api/harness/connector/jobs/:id/progress",approval:"/api/harness/connector/jobs/:id/approval",result:"/api/harness/connector/jobs/:id/result",fail:"/api/harness/connector/jobs/:id/fail"});function nC(n){let t=new URL(typeof n=="string"?n.trim():""),o=t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname);if(t.protocol!=="https:"&&!o)throw new TypeError("AI Office URL must use HTTPS (HTTP is allowed only for loopback testing)");if(t.username||t.password||t.search||t.hash)throw new TypeError("AI Office URL must be a bare origin");return t.pathname="/",t}function ty(n){let t=nC(n);return Object.fromEntries(Object.entries(Qn).map(([o,i])=>[o,new URL(i,t).toString()]))}var lBe=/^[a-z][a-z0-9-]{1,63}$/,pBe=/^[a-z0-9][a-z0-9_-]{2,63}$/i;function qp(n){return typeof n=="string"&&n.trim()?n.trim():null}function o3(n,{kind:t}){if(!n||typeof n!="object"||Array.isArray(n))return null;let o={};for(let[i,e]of Object.entries(n)){let a=qp(i),A=qp(e);if(!a||!lBe.test(a)||!A||t==="workspace"&&!IBe(A)||t==="preset"&&A.length>8e3)return null;o[a]=A}return Object.freeze(o)}function ry(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t;try{t=nC(n.baseUrl).origin}catch{return null}let o=qp(n.deviceId),i=qp(n.deviceTokenRef),e=o3(n.workspaces??{},{kind:"workspace"}),a=o3(n.instructionPresets??{},{kind:"preset"}),A=Number(n.maxConcurrency??1),r=Number(n.heartbeatSeconds??30);return!o||!pBe.test(o)||!i||!/^DSH_OFFICE_DEVICE_TOKEN_[A-F0-9]{24}$/.test(i)||!e||!a||!Number.isInteger(A)||A<1||A>4||!Number.isInteger(r)||r<10||r>300?null:Object.freeze({version:1,protocolVersion:jp,baseUrl:t,deviceId:o,deviceTokenRef:i,maxConcurrency:A,heartbeatSeconds:r,workspaces:e,instructionPresets:a,createdAt:qp(n.createdAt)??new Date().toISOString(),updatedAt:qp(n.updatedAt)??new Date().toISOString()})}var ay=class{#e;#A=null;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=ry(JSON.parse(await oBe(this.#e,"utf8")));if(!t)throw new Error("dsh-im AI Office config is invalid");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=null}return this}get(){return this.#A?structuredClone(this.#A):null}async save(t){let o=ry(t);if(!o)throw new Error("Refusing to persist invalid AI Office configuration");let i=this.#t.then(async()=>{await iBe(cBe(this.#e),{recursive:!0,mode:448});let e=`${this.#e}.tmp`;await gBe(e,`${JSON.stringify(o,null,2)} -`,{mode:384}),await nBe(e,this.#e),this.#A=o});return this.#t=i.then(()=>{},()=>{}),await i,this.get()}async clear(){let t=this.#t.then(async()=>{try{await sBe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=null});this.#t=t.then(()=>{},()=>{}),await t}};import{createHash as SBe}from"node:crypto";import{setTimeout as yBe}from"node:timers/promises";function eT(n,t){let o=new Error(`AI Office ${n} failed: HTTP ${t.status}`);return o.code=t.status===401?"invalid-device-token":t.status===404?"office-hook-unavailable":t.status===409?"office-job-conflict":"office-transport-failed",o}function zp(n,t="office-transport-failed",o){let i=new Error(n,o===void 0?void 0:{cause:o});return i.code=t,i}function AT(n,t){return t?.aborted||n?.name==="AbortError"}function dBe(n){let t="message",o,i=[];for(let a of n.split(/\r?\n/))a.startsWith("event:")?t=a.slice(6).trim()||"message":a.startsWith("id:")?o=a.slice(3).trim()||void 0:a.startsWith("data:")&&i.push(a.slice(5).trimStart());if(i.length===0)return null;let e;try{e=JSON.parse(i.join(` -`))}catch{throw new Error("AI Office SSE returned invalid JSON")}return{id:o,type:typeof e?.type=="string"?e.type:t,data:e}}var iy=class{#e;#A;#t;#r;constructor({baseUrl:t,deviceId:o,token:i,fetchImpl:e=fetch}){this.#e=t,this.#A=o,this.#t=i,this.#r=e}hooks(){return ty(this.#e)}#l(t={}){return{authorization:`Bearer ${this.#t}`,"x-harness-device-id":this.#A,...t}}async heartbeat(t,{signal:o}={}){let i;try{i=await this.#r(new URL(Qn.heartbeat,this.#e),{method:"POST",headers:this.#l({accept:"application/json","content-type":"application/json"}),body:JSON.stringify(t),signal:o,redirect:"error"})}catch(a){throw AT(a,o)?a:zp("AI Office heartbeat request could not be completed",void 0,a)}if(!i.ok)throw eT("heartbeat",i);let e;try{e=await i.json()}catch(a){throw zp("AI Office heartbeat returned invalid JSON","office-protocol-mismatch",a)}if(!e||typeof e!="object"||e.ok!==!0||e.protocolVersion!==jp)throw zp("AI Office heartbeat protocol does not match","office-protocol-mismatch");return e}async#o(t,{method:o="POST",body:i,leaseToken:e,signal:a}={}){let A=this.#l({accept:"application/json"});i!==void 0&&(A["content-type"]="application/json"),e&&(A["x-harness-lease-token"]=e);let r;try{r=await this.#r(new URL(t,this.#e),{method:o,headers:A,...i===void 0?{}:{body:JSON.stringify(i)},signal:a,redirect:"error",cache:"no-store"})}catch(s){throw AT(s,a)?s:zp("AI Office Job request could not be completed",void 0,s)}if(!r.ok)throw eT("Job request",r);try{return await r.json()}catch(s){throw zp("AI Office Job returned invalid JSON","office-protocol-mismatch",s)}}async getJob(t,o={}){return this.#o(Qn.job.replace(":id",t),{...o,method:"GET"})}async acceptJob(t,o={}){return this.#o(Qn.accept.replace(":id",t),o)}async renewJob(t,o,i={}){return this.#o(Qn.renew.replace(":id",t),{...i,leaseToken:o})}async progressJob(t,o,i,e={}){return this.#o(Qn.progress.replace(":id",t),{...e,leaseToken:o,body:i})}async requestApproval(t,o,i,e={}){return this.#o(Qn.approval.replace(":id",t),{...e,leaseToken:o,body:i})}async completeJob(t,o,i,e={}){return this.#o(Qn.result.replace(":id",t),{...e,leaseToken:o,body:i})}async failJob(t,o,i,e={}){return this.#o(Qn.fail.replace(":id",t),{...e,leaseToken:o,body:i})}async stream({signal:t,lastEventId:o,onOpen:i,onEvent:e}){let a=this.#l({accept:"text/event-stream"});o&&(a["last-event-id"]=o);let A;try{A=await this.#r(new URL(Qn.stream,this.#e),{method:"GET",headers:a,signal:t,redirect:"error",cache:"no-store"})}catch(c){throw AT(c,t)?c:zp("AI Office SSE request could not be completed",void 0,c)}if(!A.ok)throw eT("stream",A);if(!A.headers.get("content-type")?.toLowerCase().includes("text/event-stream"))throw new Error("AI Office stream did not return text/event-stream");if(!A.body)throw new Error("AI Office stream returned no body");i?.();let r=A.body.getReader(),s=new TextDecoder,g="";for(;;){let{value:c,done:I}=await r.read();if(I)break;g=`${g}${s.decode(c,{stream:!0})}`.replaceAll(`\r +`,o=this.#t.then(async()=>{await Kue(que(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await Jue(i,t,{encoding:"utf8",mode:384}),await Yue(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};var ZQ=class extends gs{};import{unlink as Wue}from"node:fs/promises";import{homedir as Zue}from"node:os";import{join as oC,resolve as HI}from"node:path";var $1=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function Vue(n){if(!Array.isArray(n)||n.length===0)return[...$1];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...$1]}var V_=class{#e;#A;#t;#r;#l;#o;#i;#a;#n=null;#s=null;#p=0;#c=!1;#g=!1;#I;#d;constructor({channel:t,controller:o,harness:i,logger:e=console,retryDelaysMs:a,healthyIntervalMs:A=15e3,setTimeoutImpl:r=setTimeout,clearTimeoutImpl:s=clearTimeout}){if(!t)throw new TypeError("TokenConnectionSupervisor requires a channel");if(!o||typeof o.initialize!="function"||typeof o.status!="function")throw new TypeError("TokenConnectionSupervisor requires a controller");if(!i||typeof i.ensureRunning!="function")throw new TypeError("TokenConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=Vue(a),this.#o=Number.isFinite(A)&&A>=0?A:15e3,this.#i=r,this.#a=s,this.#I=new Promise(g=>{this.#d=g})}get ready(){return this.#I}start(){return this.#g||this.#c?this:(this.#g=!0,this.#h(0),this)}async close(){this.#c||(this.#c=!0,this.#n!==null&&this.#a(this.#n),this.#n=null,await this.#s?.catch(()=>{}),this.#d?.(null),this.#d=null)}#h(t){this.#c||(this.#n=this.#i(()=>{this.#n=null,this.#C()},t),this.#n?.unref?.())}async#C(){if(this.#c||this.#s)return;let t=this.#u();this.#s=t;try{await t}finally{this.#s===t&&(this.#s=null)}}async#u(){try{if(await this.#t.ensureRunning(),this.#c)return;let t=await this.#A.initialize();if(this.#c)return;this.#d?.(t),this.#d=null;let{configured:o,connected:i}=t.totals;if(inr(e==="telegram"?"telegram":"discord",Re),R=typeof n.logger=="function"?n.logger(`dsh-im:${e}`):n.logger??console,K=()=>La(n),L=W_(t,e),F=await new d(L.config).load(),q=HI(t.workspace??process.cwd()),V=o.WorkspaceStore??ra,x=o.workspaces??await new V(L.workspaces,{defaultWorkspace:q}).load(),G=F.list();await x.reconcile(G.map(Re=>Re.botId)),await Promise.all(G.map(Re=>x.ensure(Re.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:_(Re)})));let J=typeof F.remove=="function"?Ha(F,{workspaces:x}):F,U=new Map,N=Re=>HI(L.bots,Re,"state.json"),k=async Re=>{let We=U.get(Re);return We||(We=await new B(N(Re)).load(),U.set(Re,We)),We},z=ja(n,o.commandExecutor),{controlExecutor:Ae,sessionMaintenanceExecutor:ie,fileIngressExecutor:we}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),se=new f({...I,workspace:q,autostart:!1,dshBin:t.dshBin??"dsh",...z?{commandExecutor:z}:{},...Ae?{controlExecutor:Ae}:{},...ie?{sessionMaintenanceExecutor:ie}:{},...we?{fileIngressExecutor:we}:{}}),Te=new Q({credentials:n.credentials,configStore:J,logger:R,...o.inspectToken?{inspectToken:o.inspectToken}:{},createRuntime:async({botId:Re,config:We,token:ve})=>{let aA=await k(Re);await x.ensure(Re,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:_(We)});let Be=Ka(se,{botId:Re,workspaces:x,state:aA,agentPresetCatalog:K});return new y({...m,config:We,token:ve,harness:Be.harness,state:Be.state,contextEnhancement:{botId:Re,getSettings:()=>x.contextEnhancementFor(Re)},accessPolicy:qa(x,Re,{channel:e,config:We}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...Ie)=>R.error?.(`[${Re}]`,...Ie),warn:(...Ie)=>R.warn?.(`[${Re}]`,...Ie),info:(...Ie)=>R.info?.(`[${Re}]`,...Ie),debug:(...Ie)=>R.debug?.(`[${Re}]`,...Ie)}})},deleteState:async({botId:Re})=>{let We=U.get(Re);if(U.delete(Re),We&&typeof We.remove=="function")await We.remove();else try{await Wue(N(Re))}catch(ve){if(ve?.code!=="ENOENT")throw ve}}}),fe=xa(Te,{workspaces:x,stateFor:k,agentPresetCatalog:K}),ke=T({channel:e,controller:fe,harness:se,logger:R,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:fe,...FQ(e)?{deliveryAdapter:Ya({channel:e,workspaces:x,coreController:Te,stateFor:k})}:{},ready:ke.ready,async close(){await ke.close(),await fe.close(),se.stopManagedProcess()}}}function Z_(n,t={},o={}){return XQ(n,t,o,{channel:"discord",ConfigStore:jQ,StateStore:ZQ,HarnessClient:zQ,Controller:aC,Runtime:iC})}var Tr=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),Xue=Object.freeze(Object.values(Tr)),$ue=new Set(["token","botToken","tokenRef","platformId","secret","secretRef"]),eBe=new Set(["telegram-transport-error","telegram-timeout","telegram-response-invalid"]);function $_(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function $Q(n,t){return $_(n)&&Object.keys(n).every(o=>t.includes(o))}function e3(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function ABe(n){return typeof n=="string"&&n.trim().length>=20&&n.length<=4096}function tBe(n,t){return $_(t)?n===Tr.status?$Q(t,[])?null:"connection.status does not accept fields.":n===Tr.bindCredentials?$Q(t,["token"])&&ABe(t.token)?null:"bot.bind-credentials requires a Bot Token.":n===Tr.reconnectBot?$Q(t,["botId","sendTest"])&&e3(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId.":n===Tr.deleteBot?$Q(t,["botId","confirm"])&&e3(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Tr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Tr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Tr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Tr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown bot endpoint.":"Payload must be an object."}function X_(n){if(Array.isArray(n))return n.map(X_);if(!$_(n))return n;let t={};for(let[o,i]of Object.entries(n))$ue.has(o)||(t[o]=X_(i));return t}function rBe(n,t){let o=Xa(t);return o||(t?.code==="webhook-configured"?{code:"webhook-configured",message:t.message}:t?.code==="telegram-401"||t?.code==="discord-401"?{code:"invalid-token",message:`${n} Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002`}:n==="Telegram"&&eBe.has(t?.code)?{code:"telegram-network-error",message:"\u65E0\u6CD5\u8BBF\u95EE Telegram Bot API\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u4EE3\u7406\u8BBE\u7F6E\uFF1BNode.js 22.21+ \u53EF\u8BBE\u7F6E NODE_USE_ENV_PROXY=1\uFF0C\u5E76\u914D\u7F6E HTTPS_PROXY\u3001HTTP_PROXY \u548C NO_PROXY\uFF0C\u7136\u540E\u91CD\u542F dsh web\u3002"}:t?.code==="discord-intents"?{code:"discord-intents",message:t.message}:{code:`${n.toLowerCase()}-operation-failed`,message:`${n} \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002`})}function ey(n,{channel:t}){for(let o of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[o]!="function")throw new TypeError(`A complete ${t} controller is required (${o})`);return async(o,i,e)=>{if(e?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!Xue.includes(o))return{ok:!1,error:{code:"bad-request",message:`Unknown ${t} endpoint.`}};let a=tBe(o,i);if(a)return{ok:!1,error:{code:"bad-request",message:a}};try{let A;if(o===Tr.status)A=await n.status();else if(o===Tr.bindCredentials)A=await n.bindCredentials(i);else if(o===Tr.reconnectBot){if(A=await n.reconnectBot(i.botId),e?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(i.sendTest===!0){let r=null;try{if(A?.bots?.find(s=>s?.botId===i.botId)?.connected!==!0){let s=new Error("Bot is not connected");throw s.code="test-target-unavailable",s}if(typeof n.sendConnectionTest!="function"){let s=new Error("Connection test is unavailable");throw s.code="test-target-unavailable",s}await n.sendConnectionTest(i.botId)}catch(s){r=s}A={...A,testMessage:or(r)}}}else if(o===Tr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");A=await n.updateWorkspace(i.botId,i.workspace)}else if(o===Tr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");A=await n.updateContextEnhancement(i.botId,i.config)}else if(o===Tr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");A=await n.updateAccessPolicy(i.botId,i.policy)}else if(o===Tr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");A=await n.updateAgentPreset(i.botId,i.agentPreset)}else A=await n.deleteBot(i.botId);return e?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:X_(A)}}catch(A){return e?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:rBe(t,A)}}}}function A3(n,t,{channel:o,rpcChannel:i,authority:e}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(i,ey(t,{channel:o}),{authority:fr(e)})}var t3="/discord",r3=Tr,aBe=Object.freeze(Object.values(r3));function Ay(n,t,o){return A3(n,t,{channel:"Discord",rpcChannel:t3,authority:o})}async function a3(n,t={}){if(t?.controller)return Ay(n,t.controller,t.rpcAuthority);let o=await Z_(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Ay(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Discord bot connections"),e}import{homedir as DBe}from"node:os";import{join as rT,resolve as aT}from"node:path";import{mkdir as iBe,readFile as oBe,rename as nBe,unlink as sBe,writeFile as gBe}from"node:fs/promises";import{dirname as cBe,isAbsolute as IBe}from"node:path";var Jp="office-harness.v1",i3="/office",qp=Object.freeze({status:"connection.status",configure:"connector.configure",reconnect:"connector.reconnect",test:"connector.test",remove:"connector.remove"}),Qn=Object.freeze({stream:"/api/harness/connector/stream",heartbeat:"/api/harness/connector/heartbeat",job:"/api/harness/connector/jobs/:id",accept:"/api/harness/connector/jobs/:id/accept",renew:"/api/harness/connector/jobs/:id/renew",progress:"/api/harness/connector/jobs/:id/progress",approval:"/api/harness/connector/jobs/:id/approval",result:"/api/harness/connector/jobs/:id/result",fail:"/api/harness/connector/jobs/:id/fail"});function nC(n){let t=new URL(typeof n=="string"?n.trim():""),o=t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname);if(t.protocol!=="https:"&&!o)throw new TypeError("AI Office URL must use HTTPS (HTTP is allowed only for loopback testing)");if(t.username||t.password||t.search||t.hash)throw new TypeError("AI Office URL must be a bare origin");return t.pathname="/",t}function ty(n){let t=nC(n);return Object.fromEntries(Object.entries(Qn).map(([o,i])=>[o,new URL(i,t).toString()]))}var lBe=/^[a-z][a-z0-9-]{1,63}$/,pBe=/^[a-z0-9][a-z0-9_-]{2,63}$/i;function zp(n){return typeof n=="string"&&n.trim()?n.trim():null}function o3(n,{kind:t}){if(!n||typeof n!="object"||Array.isArray(n))return null;let o={};for(let[i,e]of Object.entries(n)){let a=zp(i),A=zp(e);if(!a||!lBe.test(a)||!A||t==="workspace"&&!IBe(A)||t==="preset"&&A.length>8e3)return null;o[a]=A}return Object.freeze(o)}function ry(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t;try{t=nC(n.baseUrl).origin}catch{return null}let o=zp(n.deviceId),i=zp(n.deviceTokenRef),e=o3(n.workspaces??{},{kind:"workspace"}),a=o3(n.instructionPresets??{},{kind:"preset"}),A=Number(n.maxConcurrency??1),r=Number(n.heartbeatSeconds??30);return!o||!pBe.test(o)||!i||!/^DSH_OFFICE_DEVICE_TOKEN_[A-F0-9]{24}$/.test(i)||!e||!a||!Number.isInteger(A)||A<1||A>4||!Number.isInteger(r)||r<10||r>300?null:Object.freeze({version:1,protocolVersion:Jp,baseUrl:t,deviceId:o,deviceTokenRef:i,maxConcurrency:A,heartbeatSeconds:r,workspaces:e,instructionPresets:a,createdAt:zp(n.createdAt)??new Date().toISOString(),updatedAt:zp(n.updatedAt)??new Date().toISOString()})}var ay=class{#e;#A=null;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=ry(JSON.parse(await oBe(this.#e,"utf8")));if(!t)throw new Error("dsh-im AI Office config is invalid");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=null}return this}get(){return this.#A?structuredClone(this.#A):null}async save(t){let o=ry(t);if(!o)throw new Error("Refusing to persist invalid AI Office configuration");let i=this.#t.then(async()=>{await iBe(cBe(this.#e),{recursive:!0,mode:448});let e=`${this.#e}.tmp`;await gBe(e,`${JSON.stringify(o,null,2)} +`,{mode:384}),await nBe(e,this.#e),this.#A=o});return this.#t=i.then(()=>{},()=>{}),await i,this.get()}async clear(){let t=this.#t.then(async()=>{try{await sBe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=null});this.#t=t.then(()=>{},()=>{}),await t}};import{createHash as SBe}from"node:crypto";import{setTimeout as yBe}from"node:timers/promises";function eT(n,t){let o=new Error(`AI Office ${n} failed: HTTP ${t.status}`);return o.code=t.status===401?"invalid-device-token":t.status===404?"office-hook-unavailable":t.status===409?"office-job-conflict":"office-transport-failed",o}function Vp(n,t="office-transport-failed",o){let i=new Error(n,o===void 0?void 0:{cause:o});return i.code=t,i}function AT(n,t){return t?.aborted||n?.name==="AbortError"}function dBe(n){let t="message",o,i=[];for(let a of n.split(/\r?\n/))a.startsWith("event:")?t=a.slice(6).trim()||"message":a.startsWith("id:")?o=a.slice(3).trim()||void 0:a.startsWith("data:")&&i.push(a.slice(5).trimStart());if(i.length===0)return null;let e;try{e=JSON.parse(i.join(` +`))}catch{throw new Error("AI Office SSE returned invalid JSON")}return{id:o,type:typeof e?.type=="string"?e.type:t,data:e}}var iy=class{#e;#A;#t;#r;constructor({baseUrl:t,deviceId:o,token:i,fetchImpl:e=fetch}){this.#e=t,this.#A=o,this.#t=i,this.#r=e}hooks(){return ty(this.#e)}#l(t={}){return{authorization:`Bearer ${this.#t}`,"x-harness-device-id":this.#A,...t}}async heartbeat(t,{signal:o}={}){let i;try{i=await this.#r(new URL(Qn.heartbeat,this.#e),{method:"POST",headers:this.#l({accept:"application/json","content-type":"application/json"}),body:JSON.stringify(t),signal:o,redirect:"error"})}catch(a){throw AT(a,o)?a:Vp("AI Office heartbeat request could not be completed",void 0,a)}if(!i.ok)throw eT("heartbeat",i);let e;try{e=await i.json()}catch(a){throw Vp("AI Office heartbeat returned invalid JSON","office-protocol-mismatch",a)}if(!e||typeof e!="object"||e.ok!==!0||e.protocolVersion!==Jp)throw Vp("AI Office heartbeat protocol does not match","office-protocol-mismatch");return e}async#o(t,{method:o="POST",body:i,leaseToken:e,signal:a}={}){let A=this.#l({accept:"application/json"});i!==void 0&&(A["content-type"]="application/json"),e&&(A["x-harness-lease-token"]=e);let r;try{r=await this.#r(new URL(t,this.#e),{method:o,headers:A,...i===void 0?{}:{body:JSON.stringify(i)},signal:a,redirect:"error",cache:"no-store"})}catch(s){throw AT(s,a)?s:Vp("AI Office Job request could not be completed",void 0,s)}if(!r.ok)throw eT("Job request",r);try{return await r.json()}catch(s){throw Vp("AI Office Job returned invalid JSON","office-protocol-mismatch",s)}}async getJob(t,o={}){return this.#o(Qn.job.replace(":id",t),{...o,method:"GET"})}async acceptJob(t,o={}){return this.#o(Qn.accept.replace(":id",t),o)}async renewJob(t,o,i={}){return this.#o(Qn.renew.replace(":id",t),{...i,leaseToken:o})}async progressJob(t,o,i,e={}){return this.#o(Qn.progress.replace(":id",t),{...e,leaseToken:o,body:i})}async requestApproval(t,o,i,e={}){return this.#o(Qn.approval.replace(":id",t),{...e,leaseToken:o,body:i})}async completeJob(t,o,i,e={}){return this.#o(Qn.result.replace(":id",t),{...e,leaseToken:o,body:i})}async failJob(t,o,i,e={}){return this.#o(Qn.fail.replace(":id",t),{...e,leaseToken:o,body:i})}async stream({signal:t,lastEventId:o,onOpen:i,onEvent:e}){let a=this.#l({accept:"text/event-stream"});o&&(a["last-event-id"]=o);let A;try{A=await this.#r(new URL(Qn.stream,this.#e),{method:"GET",headers:a,signal:t,redirect:"error",cache:"no-store"})}catch(c){throw AT(c,t)?c:Vp("AI Office SSE request could not be completed",void 0,c)}if(!A.ok)throw eT("stream",A);if(!A.headers.get("content-type")?.toLowerCase().includes("text/event-stream"))throw new Error("AI Office stream did not return text/event-stream");if(!A.body)throw new Error("AI Office stream returned no body");i?.();let r=A.body.getReader(),s=new TextDecoder,g="";for(;;){let{value:c,done:I}=await r.read();if(I)break;g=`${g}${s.decode(c,{stream:!0})}`.replaceAll(`\r `,` `);let d;for(;(d=g.indexOf(` -`))!==-1;){let B=g.slice(0,d);g=g.slice(d+2);let f=dBe(B);f&&await e?.(f)}}throw new Error("AI Office SSE stream ended")}};import{setTimeout as hBe}from"node:timers/promises";var n3=/^job-[a-f0-9]{32}$/,EBe=3e4,CBe=2048;function Vp(){return new DOMException("Office Job was cancelled","AbortError")}function Ai(n,t=8e3){return typeof n=="string"?n.trim().slice(0,t):""}function uBe(n){return n?.code==="office-job-alias-invalid"?n.message:n?.code==="turn-stopped"?w("\u672C\u673A Harness \u5DF2\u505C\u6B62\u8FD9\u6B21\u6267\u884C\u3002"):n?.code==="office-job-conflict"?w("Office Job \u5DF2\u88AB\u9886\u53D6\u3001\u53D6\u6D88\u6216\u7ED3\u675F\u3002"):w("\u672C\u673A Harness \u672A\u80FD\u5B8C\u6210\u4EFB\u52A1\uFF1B\u8BF7\u68C0\u67E5 Harness \u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002")}function BBe(n,t){return["# AI Office Handoff","",w("\u4F60\u6B63\u5728\u672C\u673A DeepSeek Harness \u4E2D\u7EE7\u7EED\u4E00\u4E2A\u6765\u81EA AI Office \u7684\u4EFB\u52A1\u3002"),w("\u53EA\u5728\u5F53\u524D Workspace \u5185\u884C\u52A8\u3002\u5B8C\u6210\u540E\u5FC5\u987B\u8FD4\u56DE\uFF1A\u7ED3\u679C\u6458\u8981\u3001\u6539\u52A8\u6587\u4EF6\u3001\u9A8C\u8BC1\u8BC1\u636E\u3001\u672A\u89E3\u51B3\u98CE\u9669\u3002"),"",w("## \u672C\u673A Instruction Preset"),t,"",...Ai(n.instruction)?[w("## \u672C\u8F6E\u8865\u5145\u6307\u4EE4"),Ai(n.instruction),""]:[],w("## Office \u65F6\u95F4\u7EBF"),Ai(n.markdown,2e5)].join(` +`))!==-1;){let B=g.slice(0,d);g=g.slice(d+2);let f=dBe(B);f&&await e?.(f)}}throw new Error("AI Office SSE stream ended")}};import{setTimeout as hBe}from"node:timers/promises";var n3=/^job-[a-f0-9]{32}$/,EBe=3e4,CBe=2048;function Wp(){return new DOMException("Office Job was cancelled","AbortError")}function Ai(n,t=8e3){return typeof n=="string"?n.trim().slice(0,t):""}function uBe(n){return n?.code==="office-job-alias-invalid"?n.message:n?.code==="turn-stopped"?w("\u672C\u673A Harness \u5DF2\u505C\u6B62\u8FD9\u6B21\u6267\u884C\u3002"):n?.code==="office-job-conflict"?w("Office Job \u5DF2\u88AB\u9886\u53D6\u3001\u53D6\u6D88\u6216\u7ED3\u675F\u3002"):w("\u672C\u673A Harness \u672A\u80FD\u5B8C\u6210\u4EFB\u52A1\uFF1B\u8BF7\u68C0\u67E5 Harness \u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002")}function BBe(n,t){return["# AI Office Handoff","",w("\u4F60\u6B63\u5728\u672C\u673A DeepSeek Harness \u4E2D\u7EE7\u7EED\u4E00\u4E2A\u6765\u81EA AI Office \u7684\u4EFB\u52A1\u3002"),w("\u53EA\u5728\u5F53\u524D Workspace \u5185\u884C\u52A8\u3002\u5B8C\u6210\u540E\u5FC5\u987B\u8FD4\u56DE\uFF1A\u7ED3\u679C\u6458\u8981\u3001\u6539\u52A8\u6587\u4EF6\u3001\u9A8C\u8BC1\u8BC1\u636E\u3001\u672A\u89E3\u51B3\u98CE\u9669\u3002"),"",w("## \u672C\u673A Instruction Preset"),t,"",...Ai(n.instruction)?[w("## \u672C\u8F6E\u8865\u5145\u6307\u4EE4"),Ai(n.instruction),""]:[],w("## Office \u65F6\u95F4\u7EBF"),Ai(n.markdown,2e5)].join(` `)}function fBe(n){let t=Ai(n?.interactionId||n?.rpcId,180);if(!t||typeof n?.respond!="function")return null;if(n.kind==="approval"){let i=XM(n.payload,{toolCall:n.toolCall,maxArgumentsLength:1e4});return i?{id:t,kind:"approval",title:w("\u6279\u51C6 {tool}",{tool:Ai(n.payload?.toolName,120)||w("Harness \u5DE5\u5177")}),prompt:i,toolName:Ai(n.payload?.toolName,120)}:null}if(n.kind!=="question")return null;let o=n.payload?.questions;return!Array.isArray(o)||o.length===0||o.some(i=>!mi(i))?null:{id:t,kind:"question",title:o.length>1?w("Harness \u9700\u8981 {count} \u9879\u8865\u5145\u4FE1\u606F",{count:o.length}):Ai(o[0].header||o[0].question,160),prompt:o.map((i,e)=>Si(i,e,o.length)).join(` --- -`),questions:o}}function QBe(n,t){return new Promise((o,i)=>{if(n.controller.signal.aborted)return i(n.controller.signal.reason??Vp());let e=()=>{n.approvals.delete(t),i(n.controller.signal.reason??Vp())};n.controller.signal.addEventListener("abort",e,{once:!0}),n.approvals.set(t,{resolve(a){n.controller.signal.removeEventListener("abort",e),n.approvals.delete(t),o(a)}})})}var oy=class{#e;#A;#t;#r;#l;#o=new Map;#i=new Set;#a=new Set;#n=!1;#s={running:0,completed:0,failed:0,lastJobId:null,lastJobAt:null};constructor({config:t,transport:o,createHarness:i,logger:e=console,sleepImpl:a=hBe}){if(!t||!o||typeof i!="function")throw new TypeError("OfficeJobExecutor requires config, transport, and createHarness");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a}get status(){return structuredClone(this.#s)}offer(t){return this.#n||!n3.test(t)||this.#o.has(t)||this.#i.has(t)||this.#a.has(t)?!1:(this.#i.add(t),this.#p(),!0)}handleEvent(t){let o=Ai(t?.data?.jobId,80);if(!n3.test(o))return!1;if(t.type==="job.available")return this.offer(o);if(t.type==="job.cancel")return this.cancel(o);if(t.type==="approval.reply"){let i=this.#o.get(o),e=Ai(t.data?.approvalId,180),a=i?.approvals.get(e);return a?(a.resolve({decision:t.data?.decision==="approved"?"approved":"rejected",answer:Ai(t.data?.answer)}),!0):!1}return!1}cancel(t){this.#i.delete(t);let o=this.#o.get(t);return o?(o.cancelled=!0,o.controller.abort(Vp()),o.sessionId&&o.harness&&o.harness.rpc("session.cancel",{sessionId:o.sessionId,keepInbox:!0},1e4).catch(()=>{}),!0):!1}async close(){this.#n=!0,this.#i.clear();for(let t of this.#o.values())t.controller.abort(Vp());await Promise.allSettled([...this.#o.values()].map(t=>t.task))}#p(){for(;!this.#n&&this.#o.size0;){let t=this.#i.values().next().value;this.#i.delete(t);let o={controller:new AbortController,approvals:new Map,harness:null,sessionId:null,leaseToken:null,cancelled:!1,lastProgressAt:0,lastProgress:"",task:null};o.task=this.#c(t,o).finally(()=>{this.#o.delete(t),this.#s.running=this.#o.size,this.#p()}),this.#o.set(t,o),this.#s.running=this.#o.size,o.task.catch(i=>this.#r.warn?.("[dsh-im:office] Job task ended:",i.message))}}async#c(t,o){let i=o.controller.signal,e=null;try{let A=(await this.#A.getJob(t,{signal:i}))?.job;if(!A||A.id!==t)throw new Error("Office returned an invalid Job payload");let r=await this.#A.acceptJob(t,{signal:i});if(!Ai(r?.leaseToken,200))throw new Error("Office returned an invalid Job lease");o.leaseToken=r.leaseToken,e=this.#g(t,o);let s=this.#e.workspaces[A.workspaceAlias],g=this.#e.instructionPresets[A.instructionPreset];if(!s||!g){let I=new Error(w("Office Job \u5F15\u7528\u4E86\u672C\u673A\u672A\u914D\u7F6E\u7684 Workspace/Preset alias\u3002"));throw I.code="office-job-alias-invalid",I}o.harness=this.#t({workspace:s}),await this.#d(t,o,{kind:"status",message:w("\u5DF2\u9886\u53D6 Job\uFF0C\u51C6\u5907 Workspace alias\uFF1A{alias}",{alias:A.workspaceAlias})},!0),o.sessionId=await o.harness.createSession({signal:i,workspace:s}),await this.#d(t,o,{kind:"status",message:w("Harness Session \u5DF2\u521B\u5EFA\u3002"),sessionId:o.sessionId},!0);let c=await o.harness.ask(o.sessionId,BBe(A,g),{timeoutMs:30*6e4,signal:i,onUpdate:I=>this.#I(t,o,I),onInteraction:I=>this.#h(t,o,I),onInteractionResolved:I=>{let d=Ai(I?.interactionId,180);o.approvals.get(d)?.resolve({decision:"rejected",answer:""})}});if(i.aborted)throw i.reason??Vp();await this.#A.completeJob(t,o.leaseToken,{resultMarkdown:c,sessionId:o.sessionId},{signal:i}),this.#s.completed+=1,this.#C(t)}catch(a){if(!o.cancelled&&o.leaseToken&&(await this.#A.failJob(t,o.leaseToken,{error:uBe(a),...o.sessionId?{sessionId:o.sessionId}:{}}).catch(()=>{}),this.#s.failed+=1),a?.code==="office-job-conflict"||a?.code==="office-hook-unavailable"){this.#C(t);return}!o.cancelled&&!i.aborted&&this.#r.warn?.(`[dsh-im:office] Job ${t} failed:`,a.message)}finally{o.controller.abort(Vp()),await e?.catch(()=>{}),this.#s.lastJobId=t,this.#s.lastJobAt=new Date().toISOString()}}async#g(t,o){for(;!o.controller.signal.aborted;){try{await this.#l(EBe,void 0,{signal:o.controller.signal})}catch{return}try{await this.#A.renewJob(t,o.leaseToken,{signal:o.controller.signal})}catch(i){if(o.controller.signal.aborted)return;o.cancelled=!0,o.controller.abort(i),o.sessionId&&o.harness&&o.harness.rpc("session.cancel",{sessionId:o.sessionId,keepInbox:!0},1e4).catch(()=>{});return}try{let e=(await this.#A.getJob(t,{signal:o.controller.signal}))?.job?.approval;e&&(e.status==="approved"||e.status==="rejected")&&o.approvals.get(e.id)?.resolve({decision:e.status,answer:Ai(e.answer)})}catch(i){if(o.controller.signal.aborted)return;this.#r.warn?.(`[dsh-im:office] Job ${t} approval poll failed; will retry after the next renewal:`,i.message)}}}async#I(t,o,i){let e=i?.type==="tool"?w("\u6B63\u5728\u4F7F\u7528 {tool}\u2026",{tool:Ai(i.name,160)||w("Harness \u5DE5\u5177")}):Ai(i?.text,4e3);if(!e)return;let a=`${i.type}:${e}`;if(a===o.lastProgress)return;let A=Date.now();i.type==="text"&&A-o.lastProgressAt<1e3||(o.lastProgress=a,o.lastProgressAt=A,await this.#d(t,o,{kind:i.type==="tool"?"tool":i.type==="text"?"text":"status",message:e,...o.sessionId?{sessionId:o.sessionId}:{}}))}#d(t,o,i,e=!1){let a=this.#A.progressJob(t,o.leaseToken,i,{signal:o.controller.signal});return e?a:a.catch(A=>{this.#r.debug?.("[dsh-im:office] ignored a progress delivery failure:",A.message)})}async#h(t,o,i){let e=fBe(i);if(!e){i?.kind==="approval"&&typeof i.respond=="function"&&await i.respond({ok:!0,value:{sessionId:i.sessionId,approvalId:i.payload?.approvalId,outcome:"rejected"}});return}let a=QBe(o,e.id);try{await this.#A.requestApproval(t,o.leaseToken,e,{signal:o.controller.signal});let A=await a;if(e.kind==="approval"){await i.respond({ok:!0,value:{sessionId:i.sessionId,approvalId:i.payload.approvalId,outcome:A.decision==="approved"?"allowed-once":"rejected"}});return}if(A.decision!=="approved"){await i.respond({ok:!1,error:{code:"cancelled",message:"The AI Office user rejected this question.",details:{}}});return}let r=Ai(A.answer).split(/\r?\n/);await i.respond({ok:!0,value:{sessionId:i.sessionId,answer:{answers:e.questions.map((s,g)=>wi(s,r[g]||r[0]||""))}}})}catch(A){throw o.approvals.delete(e.id),A}}#C(t){this.#a.add(t),!(this.#a.size<=CBe)&&this.#a.delete(this.#a.values().next().value)}};var s3=Object.freeze([1e3,3e3,1e4,3e4]);function mBe(n){let t=typeof n?.code=="string"?n.code:"office-connection-failed",o={"invalid-device-token":w("AI Office \u62D2\u7EDD\u4E86 Device Token\u3002"),"office-hook-unavailable":w("AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002"),"office-protocol-mismatch":w("AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002"),"office-transport-failed":w("\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002")};return{code:t,message:o[t]??w("AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002")}}var Wp=class{#e;#A;#t;#r;#l;#o=null;#i=null;#a;#n;constructor({config:t,token:o,logger:i=console,transport:e,createHarness:a,jobExecutor:A,sleepImpl:r=yBe}){this.#e=t,this.#A=o,this.#t=i,this.#l=r,this.#r=e??new iy({baseUrl:t.baseUrl,deviceId:t.deviceId,token:o}),this.#a={state:"idle",connected:!1,startedAt:null,lastHeartbeatAt:null,lastEventAt:null,lastEventId:null,lastEventType:null,reconnects:0,jobsOffered:0,error:null},this.#n=A??(a?new oy({config:t,transport:this.#r,createHarness:a,logger:i}):null)}get status(){return structuredClone({...this.#a,...this.#n?{jobs:this.#n.status}:{}})}capabilities(){return{protocolVersion:jp,deviceId:this.#e.deviceId,workspaces:Object.keys(this.#e.workspaces),instructionPresets:Object.keys(this.#e.instructionPresets),maxConcurrency:this.#e.maxConcurrency}}async testConnection(t){return await this.#r.heartbeat({...this.capabilities(),probe:!0},{signal:t}),{ok:!0}}start(){return this.#i?this.status:(this.#o=new AbortController,this.#a.startedAt=new Date().toISOString(),this.#a.state="connecting",this.#i=this.#s(this.#o.signal).finally(()=>{this.#i=null}),this.#i.catch(t=>{this.#o?.signal.aborted||this.#t.error?.("[dsh-im:office] connector stopped:",t)}),this.status)}async#s(t){let o=0;for(;!t.aborted;){let i=new AbortController,e=AbortSignal.any([t,i.signal]);try{let a=await this.#r.heartbeat(this.capabilities(),{signal:e});this.#c(a?.jobs),this.#a.lastHeartbeatAt=new Date().toISOString();let A=!1,r=this.#p(e,()=>{A&&!e.aborted&&(o=0)}),s=this.#r.stream({signal:e,lastEventId:this.#a.lastEventId,onOpen:()=>{this.#a.connected=!0,this.#a.state="connected",this.#a.error=null,A=!0},onEvent:async g=>{this.#a.lastEventAt=new Date().toISOString(),this.#a.lastEventId=g.id??this.#a.lastEventId,this.#a.lastEventType=g.type,g.type==="job.available"&&(this.#a.jobsOffered+=1),this.#n?.handleEvent(g)}});await Promise.race([s,r])}catch(a){if(t.aborted)break;i.abort(),this.#a.connected=!1,this.#a.state="reconnecting",this.#a.error=mBe(a),this.#a.reconnects+=1;let A=s3[Math.min(o,s3.length-1)];o+=1;try{await this.#l(A,void 0,{signal:t})}catch{break}}finally{i.abort()}}this.#a.connected=!1,this.#a.state="idle"}async#p(t,o){for(;!t.aborted;){await this.#l(this.#e.heartbeatSeconds*1e3,void 0,{signal:t});let i=await this.#r.heartbeat(this.capabilities(),{signal:t});this.#c(i?.jobs),this.#a.lastHeartbeatAt=new Date().toISOString(),o?.()}}#c(t){if(Array.isArray(t))for(let o of t)typeof o?.id=="string"&&this.#n?.offer(o.id)&&(this.#a.jobsOffered+=1)}async stop(){let t=this.#i;return this.#o?.abort(),this.#o=null,t&&await t.catch(()=>{}),await this.#n?.close(),this.#a.connected=!1,this.#a.state="idle",this.status}};function tT(n){return typeof n=="string"&&n.trim()?n.trim():null}function wBe(n,t){return`DSH_OFFICE_DEVICE_TOKEN_${SBe("sha256").update(`${n} -${t}`).digest("hex").slice(0,24).toUpperCase()}`}var ny=class{#e;#A;#t;#r;#l=null;#o=Promise.resolve();constructor({credentials:t,configStore:o,logger:i=console,createRuntime:e}){if(!t?.resolve||!t?.set||!t?.unset)throw new TypeError("AI Office requires the Harness credential provider");if(!o?.get||!o?.save||!o?.clear)throw new TypeError("AI Office requires a config store");this.#e=t,this.#A=o,this.#t=i,this.#r=e??(a=>new Wp(a))}async initialize(){let t=this.#A.get();if(t){let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{});o?.value&&await this.#a(t,o.value)}return this.status()}async configure(t={}){return this.#s(async()=>{let o=this.#A.get(),i=tT(t.baseUrl),e=tT(t.deviceId);if(!i||!e)throw new TypeError("Office URL and Device ID are required");let a=nC(i).origin,A=wBe(a,e),r=tT(t.deviceToken),s=await this.#e.resolve(A).catch(()=>{}),g=r??s?.value;if(!g||g.length<32)throw new TypeError("Device Token must contain at least 32 characters");let c=new Date().toISOString(),I=ry({version:1,baseUrl:a,deviceId:e,deviceTokenRef:A,maxConcurrency:t.maxConcurrency,heartbeatSeconds:t.heartbeatSeconds,workspaces:t.workspaces,instructionPresets:t.instructionPresets,createdAt:o?.createdAt??c,updatedAt:c});if(!I)throw new TypeError("AI Office connector configuration is invalid");await this.#e.set(A,g);try{await this.#A.save(I)}catch(d){throw s?.value?await this.#e.set(A,s.value).catch(()=>{}):await this.#e.unset(A).catch(()=>{}),d}return o?.deviceTokenRef&&o.deviceTokenRef!==A&&await this.#e.unset(o.deviceTokenRef).catch(()=>{}),await this.#a(I,g),this.status()})}async reconnect(){return this.#s(async()=>{let t=this.#A.get();if(!t)throw new Error("AI Office connector is not configured");return await this.#a(t),this.status()})}async test(){let t=this.#A.get();if(!t)throw new Error("AI Office connector is not configured");let o=await this.#i(t),i=this.#r({config:t,token:o,logger:this.#t});try{await i.testConnection(AbortSignal.timeout(1e4))}finally{await i.stop().catch(()=>{})}return{tested:!0,snapshot:await this.status()}}async remove(){return this.#s(async()=>{let t=this.#A.get();return await this.#n(),t?.deviceTokenRef&&await this.#e.unset(t.deviceTokenRef).catch(()=>{}),await this.#A.clear(),this.status()})}async status(){let t=this.#A.get();if(!t)return{schemaVersion:1,configured:!1,connected:!1,state:"unconfigured"};let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{}),i=this.#l?.status??null;return{schemaVersion:1,configured:!0,connected:i?.connected===!0,state:i?.state??(o?.value?"idle":"missing-token"),config:{protocolVersion:t.protocolVersion,baseUrl:t.baseUrl,deviceId:t.deviceId,maxConcurrency:t.maxConcurrency,heartbeatSeconds:t.heartbeatSeconds,workspaces:t.workspaces,instructionPresets:t.instructionPresets,hooks:ty(t.baseUrl)},health:i,tokenConfigured:!!o?.value}}async close(){await this.#o.catch(()=>{}),await this.#n()}async#i(t){let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{});if(!o?.value)throw new Error("AI Office Device Token is missing");return o.value}async#a(t,o){await this.#n();let i=o??await this.#i(t),e=this.#r({config:t,token:i,logger:this.#t});this.#l=e,e.start()}async#n(){let t=this.#l;this.#l=null,t&&await t.stop()}#s(t){let o=this.#o.then(t,t);return this.#o=o.then(()=>{},()=>{}),o}};function OBe(n={}){let t=aT(n.dshHome??process.env.DSH_HOME??rT(DBe(),".dsh")),o=aT(n.dataDir??rT(t,"integrations","dsh-office"));return{root:o,config:aT(n.configPath??rT(o,"config.json"))}}async function g3(n,t={},o={}){let i=aa(n,t),e=o.ConfigStore??ay,a=o.Controller??ny,A=o.Runtime??Wp,r=o.HarnessClient??ur,s=OBe(t),g=await new e(s.config).load(),c=typeof n.logger=="function"?n.logger("dsh-im:office"):n.logger??console,I=o.createHarness??(({workspace:B})=>new r({...i,workspace:B,autostart:!1,dshBin:t.dshBin??"dsh",rpcIdPrefix:"office",logPrefix:"dsh-im:office"})),d=new a({credentials:n.credentials,configStore:g,logger:c,createRuntime:B=>new A({...B,createHarness:I,...o.transport?{transport:o.transport}:{}})});return await d.initialize(),{controller:d,close:()=>d.close(),paths:s}}function iT(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function sC(n,t){return iT(n)&&Object.keys(n).every(o=>t.includes(o))}function bBe(n){return sC(n,["baseUrl","deviceId","deviceToken","maxConcurrency","heartbeatSeconds","workspaces","instructionPresets"])&&typeof n.baseUrl=="string"&&typeof n.deviceId=="string"&&(n.deviceToken===void 0||typeof n.deviceToken=="string")&&iT(n.workspaces)&&iT(n.instructionPresets)}function MBe(n){for(let t of["status","configure","reconnect","test","remove"])if(typeof n?.[t]!="function")throw new TypeError(`AI Office controller requires ${t}()`);return async(t,o,i)=>{if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};try{let e;if(t===Jp.status&&sC(o,[]))e=await n.status();else if(t===Jp.configure&&bBe(o))e=await n.configure(o);else if(t===Jp.reconnect&&sC(o,[]))e=await n.reconnect();else if(t===Jp.test&&sC(o,[]))e=await n.test();else if(t===Jp.remove&&sC(o,["confirm"])&&o.confirm===!0)e=await n.remove();else return{ok:!1,error:{code:"bad-request",message:"Invalid AI Office connector request."}};return{ok:!0,value:e}}catch(e){let a=e?.code==="invalid-device-token"?"invalid-device-token":e?.code==="office-hook-unavailable"?"office-hook-unavailable":"office-operation-failed",A=a==="invalid-device-token"?"AI Office Device Token \u65E0\u6548\u3002":a==="office-hook-unavailable"?"AI Office Hook \u5C1A\u672A\u4E0A\u7EBF\u6216\u5730\u5740\u4E0D\u6B63\u786E\u3002":e instanceof TypeError?e.message:"AI Office \u8FDE\u63A5\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";return{ok:!1,error:{code:a,message:A}}}}}function oT(n,t,o){return n.connection.rpc.handle(i3,MBe(t),{authority:fr(o)})}async function c3(n,t={}){if(t.controller)return oT(n,t.controller,t.rpcAuthority);let o=await g3(n,t,t.internals??{}),i=oT(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>o.close(),"dsh-im: close AI Office connector"),i}var _Be=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]);function TBe(n){let t=n?.client_id??n?.appId,o=n?.client_secret??n?.appSecret;if(typeof t!="string"||t.length===0||typeof o!="string"||o.length===0)throw new TypeError("Feishu registration returned invalid credentials");return{appId:t,appSecret:o,userInfo:n?.user_info??n?.userInfo}}async function NBe(n){return typeof n.status!="function"?{}:await n.status()}function RBe(n){return n?.connected===!0?!0:n?.ready===!0&&n?.feishuLongConnectionState==="connected"&&n?.harnessReachable===!0}var sy=class{#e;#A;#t;#r;#l=!1;#o=null;constructor({createProvisioningManager:t,credentialStore:o,connectionManager:i,registrationOptions:e={}}={}){if(typeof t!="function")throw new TypeError("createProvisioningManager is required");if(!o||typeof o.save!="function"||typeof o.clear!="function")throw new TypeError("credentialStore.save/clear are required");if(!i||typeof i.connect!="function"||typeof i.disconnect!="function")throw new TypeError("connectionManager.connect/disconnect are required");if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("registrationOptions must be an object");if(this.#e=o,this.#A=i,this.#t=structuredClone(e),this.#r=t({onCredentials:a=>this.#i(a)}),!this.#r||typeof this.#r.start!="function"||typeof this.#r.status!="function"||typeof this.#r.cancel!="function")throw new TypeError("The provisioning manager must implement start/status/cancel")}async startRegistration(){return this.#o=null,await this.#r.start(structuredClone(this.#t)),this.status()}async cancelRegistration(){return await this.#r.cancel(),this.status()}async disconnect(){await this.#r.cancel(),await this.#A.disconnect();try{await this.#e.clear(),this.#l=!1,this.#o=null}catch{this.#o={code:"credential_removal_failed",message:"Unable to remove the Feishu credentials."}}return this.status()}async status(){let t=await this.#r.status(),o=await NBe(this.#A),i=RBe(o),e=this.#l;if(typeof this.#e.configured=="function")try{e=await this.#e.configured()}catch{e=this.#l}let a="unconfigured";return i?a="connected":_Be.has(t?.state)?a="registering":t?.state==="saving"?a="connecting":this.#o||t?.state==="error"?a="error":e&&(a="disconnected"),{phase:a,connected:i,configured:e,registration:t,connection:o,error:this.#o??t?.error??null}}async close(){await this.#r.cancel(),await this.#A.disconnect()}async#i(t){let o=TBe(t);try{await this.#e.save(o),this.#l=!0,await this.#A.connect(o),this.#o=null}catch{throw this.#o={code:"connection_failed",message:"The bot was created, but its connection could not be started."},new Error("Unable to activate the Feishu connection.")}}};function nT(n){return new sy(n)}import{homedir as ove}from"node:os";import{join as Yd,resolve as kc}from"node:path";import{unlink as nve}from"node:fs/promises";var rP={};Fr(rP,{AESCipher:()=>fu,AccessTokenError:()=>Gd,Aily:()=>Rv,AppType:()=>us,CAppTicket:()=>Bu,CTenantAccessToken:()=>du,CardActionHandler:()=>Mv,Client:()=>Ym,ClientAssertionError:()=>ri,DefaultCache:()=>Hm,Domain:()=>Bs,EventDispatcher:()=>Jm,LarkChannel:()=>Xm,LarkChannelError:()=>Ft,LoggerLevel:()=>co,LoggerProxy:()=>Tc,WSClient:()=>zm,adaptDefault:()=>mNe,adaptExpress:()=>SNe,adaptKoa:()=>wNe,adaptKoaRouter:()=>DNe,createLarkChannel:()=>cRe,defaultHttpInstance:()=>Fd,defaultLogger:()=>Mg,generateChallenge:()=>yu,internalCache:()=>Qu,messageCard:()=>bNe,normalize:()=>ZW,normalizeBotAdded:()=>VW,normalizeCardAction:()=>zW,normalizeComment:()=>WW,normalizeReaction:()=>Jv,registerApp:()=>LNe,withAll:()=>CNe,withHelpDeskCredential:()=>BNe,withTenantKey:()=>uNe,withTenantToken:()=>fNe,withUserAccessToken:()=>QNe});function gC(n,t){return function(){return n.apply(t,arguments)}}var{toString:kBe}=Object.prototype,{getPrototypeOf:Zp}=Object,{iterator:IC,toStringTag:p3}=Symbol,cy=(({hasOwnProperty:n})=>(t,o)=>n.call(t,o))(Object.prototype),cC=(n,t)=>{let o=n,i=[];for(;o!=null&&o!==Object.prototype;){if(i.indexOf(o)!==-1)return!1;if(i.push(o),cy(o,t))return!0;o=Zp(o)}return!1},vBe=(n,t)=>n!=null&&cC(n,t)?n[t]:void 0,gT=(n=>t=>{let o=kBe.call(t);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Po=n=>(n=n.toLowerCase(),t=>gT(t)===n),Iy=n=>t=>typeof t===n,{isArray:xI}=Array,YI=Iy("undefined");function Xp(n){return n!==null&&!YI(n)&&n.constructor!==null&&!YI(n.constructor)&&Gi(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var d3=Po("ArrayBuffer");function PBe(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&d3(n.buffer),t}var GBe=Iy("string"),Gi=Iy("function"),h3=Iy("number"),$p=n=>n!==null&&typeof n=="object",FBe=n=>n===!0||n===!1,gy=n=>{if(!$p(n))return!1;let t=Zp(n);return(t===null||t===Object.prototype||Zp(t)===null)&&!cC(n,p3)&&!cC(n,IC)},LBe=n=>{if(!$p(n)||Xp(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},UBe=Po("Date"),HBe=Po("File"),KBe=n=>!!(n&&typeof n.uri<"u"),xBe=n=>n&&typeof n.getParts<"u",YBe=Po("Blob"),jBe=Po("FileList"),JBe=Po("Set"),qBe=n=>$p(n)&&Gi(n.pipe);function zBe(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var I3=zBe(),l3=typeof I3.FormData<"u"?I3.FormData:void 0,VBe=n=>{if(!n)return!1;if(l3&&n instanceof l3)return!0;let t=Zp(n);if(!t||t===Object.prototype||!Gi(n.append))return!1;let o=gT(n);return o==="formdata"||o==="object"&&Gi(n.toString)&&n.toString()==="[object FormData]"},WBe=Po("URLSearchParams"),[ZBe,XBe,$Be,efe]=["ReadableStream","Request","Response","Headers"].map(Po),Afe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lC(n,t,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let i,e;if(typeof n!="object"&&(n=[n]),xI(n))for(i=0,e=n.length;i0;)if(e=o[i],t===e.toLowerCase())return e;return null}var KI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,C3=n=>!YI(n)&&n!==KI;function sT(...n){let{caseless:t,skipUndefined:o}=C3(this)&&this||{},i={},e=(a,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")return;let r=t&&typeof A=="string"&&E3(i,A)||A,s=cy(i,r)?i[r]:void 0;gy(s)&&gy(a)?i[r]=sT(s,a):gy(a)?i[r]=sT({},a):xI(a)?i[r]=a.slice():(!o||!YI(a))&&(i[r]=a)};for(let a=0,A=n.length;a(lC(t,(e,a)=>{o&&Gi(e)?Object.defineProperty(n,a,{__proto__:null,value:gC(e,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,a,{__proto__:null,value:e,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),n),rfe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),afe=(n,t,o,i)=>{n.prototype=Object.create(t.prototype,i),Object.defineProperty(n.prototype,"constructor",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(n.prototype,o)},ife=(n,t,o,i)=>{let e,a,A,r={};if(t=t||{},n==null)return t;do{for(e=Object.getOwnPropertyNames(n),a=e.length;a-- >0;)A=e[a],(!i||i(A,n,t))&&!r[A]&&(t[A]=n[A],r[A]=!0);n=o!==!1&&Zp(n)}while(n&&(!o||o(n,t))&&n!==Object.prototype);return t},ofe=(n,t,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=t.length;let i=n.indexOf(t,o);return i!==-1&&i===o},nfe=n=>{if(!n)return null;if(xI(n))return n;let t=n.length;if(!h3(t))return null;let o=new Array(t);for(;t-- >0;)o[t]=n[t];return o},sfe=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Zp(Uint8Array)),gfe=(n,t)=>{let i=(n&&n[IC]).call(n),e;for(;(e=i.next())&&!e.done;){let a=e.value;t.call(n,a[0],a[1])}},cfe=(n,t)=>{let o,i=[];for(;(o=n.exec(t))!==null;)i.push(o);return i},Ife=Po("HTMLFormElement"),lfe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,i,e){return i.toUpperCase()+e}),{propertyIsEnumerable:pfe}=Object.prototype,dfe=Po("RegExp"),u3=(n,t)=>{let o=Object.getOwnPropertyDescriptors(n),i={};lC(o,(e,a)=>{let A;(A=t(e,a,n))!==!1&&(i[a]=A||e)}),Object.defineProperties(n,i)},hfe=n=>{u3(n,(t,o)=>{if(Gi(n)&&["arguments","caller","callee"].includes(o))return!1;let i=n[o];if(Gi(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},Efe=(n,t)=>{let o={},i=e=>{e.forEach(a=>{o[a]=!0})};return xI(n)?i(n):i(String(n).split(t)),o},Cfe=()=>{},ufe=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Bfe(n){return!!(n&&Gi(n.append)&&n[p3]==="FormData"&&n[IC])}var ffe=n=>{let t=new WeakSet,o=i=>{if($p(i)){if(t.has(i))return;if(Xp(i))return i;if(!("toJSON"in i)){t.add(i);let e;if(JBe(i)){e=[];for(let a of i){let A=o(a);!YI(A)&&e.push(A)}}else e=xI(i)?[]:{},lC(i,(a,A)=>{let r=o(a);!YI(r)&&(e[A]=r)});return t.delete(i),e}}return i};return o(n)},Qfe=Po("AsyncFunction"),yfe=n=>n&&($p(n)||Gi(n))&&Gi(n.then)&&Gi(n.catch),B3=((n,t)=>n?setImmediate:t?((o,i)=>(KI.addEventListener("message",({source:e,data:a})=>{e===KI&&a===o&&i.length&&i.shift()()},!1),e=>{i.push(e),KI.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",Gi(KI.postMessage)),mfe=typeof queueMicrotask<"u"?queueMicrotask.bind(KI):typeof process<"u"&&process.nextTick||B3,f3=n=>n!=null&&Gi(n[IC]),Sfe=n=>n!=null&&cC(n,IC)&&f3(n),Z={isArray:xI,isArrayBuffer:d3,isBuffer:Xp,isFormData:VBe,isArrayBufferView:PBe,isString:GBe,isNumber:h3,isBoolean:FBe,isObject:$p,isPlainObject:gy,isEmptyObject:LBe,isReadableStream:ZBe,isRequest:XBe,isResponse:$Be,isHeaders:efe,isUndefined:YI,isDate:UBe,isFile:HBe,isReactNativeBlob:KBe,isReactNative:xBe,isBlob:YBe,isRegExp:dfe,isFunction:Gi,isStream:qBe,isURLSearchParams:WBe,isTypedArray:sfe,isFileList:jBe,forEach:lC,merge:sT,extend:tfe,trim:Afe,stripBOM:rfe,inherits:afe,toFlatObject:ife,kindOf:gT,kindOfTest:Po,endsWith:ofe,toArray:nfe,forEachEntry:gfe,matchAll:cfe,isHTMLForm:Ife,hasOwnProperty:cy,hasOwnProp:cy,hasOwnInPrototypeChain:cC,getSafeProp:vBe,reduceDescriptors:u3,freezeMethods:hfe,toObjectSet:Efe,toCamelCase:lfe,noop:Cfe,toFiniteNumber:ufe,findKey:E3,global:KI,isContextDefined:C3,isSpecCompliantForm:Bfe,toJSONObject:ffe,isAsyncFn:Qfe,isThenable:yfe,setImmediate:B3,asap:mfe,isIterable:f3,isSafeIterable:Sfe};var wfe=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Q3=n=>{let t={},o,i,e;return n&&n.split(` -`).forEach(function(A){e=A.indexOf(":"),o=A.substring(0,e).trim().toLowerCase(),i=A.substring(e+1).trim();let r=Z.hasOwnProp(t,o);!o||r&&Z.hasOwnProp(wfe,o)||(o==="set-cookie"?r?t[o].push(i):t[o]=[i]:t[o]=r?t[o]+", "+i:i)}),t};function Dfe(n){let t=0,o=n.length;for(;tt;){let i=n.charCodeAt(o-1);if(i!==9&&i!==32)break;o-=1}return t===0&&o===n.length?n:n.slice(t,o)}var Ofe=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),bfe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function cT(n,t){return Z.isArray(n)?n.map(o=>cT(o,t)):Dfe(String(n).replace(t,""))}var y3=n=>cT(n,Ofe),Mfe=n=>cT(n,bfe);function ed(n){let t=Object.create(null);return Z.forEach(n.toJSON(),(o,i)=>{t[i]=Mfe(o)}),t}var m3=Symbol("internals");function pC(n){return n&&String(n).trim().toLowerCase()}function ly(n){return n===!1||n==null?n:Z.isArray(n)?n.map(ly):y3(String(n))}function _fe(n){let t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=o.exec(n);)t[i[1]]=i[2];return t}var Tfe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function IT(n){let t=0,o=n.length;for(;tt;){let i=n.charCodeAt(o-1);if(i!==9&&i!==32)break;o-=1}return t===0&&o===n.length?n:n.slice(t,o)}function Nfe(n){let t=n.length-1;if(t<1||n.charCodeAt(0)!==34||n.charCodeAt(t)!==34)return n;let o="";for(let i=1;i=t))return n;o+=n[i]}return o}function Rfe(n){let t=Object.create(null),o=String(n),i=0,e=!1,a=!1;function A(r){let s=IT(o.slice(i,r)),g=s.indexOf("=");if(g<1)return;let c=IT(s.slice(0,g));if(!Tfe.test(c))return;let I=c.toLowerCase();if(I==="__proto__"||I==="constructor"||I==="prototype")return;let d=IT(s.slice(g+1));t[I]=Nfe(d)}for(let r=0;r/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function lT(n,t,o,i,e){if(Z.isFunction(i))return i.call(this,t,o);if(e&&(t=o),!!Z.isString(t)){if(Z.isString(i))return t.indexOf(i)!==-1;if(Z.isRegExp(i))return i.test(t)}}function vfe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,o,i)=>o.toUpperCase()+i)}function Pfe(n,t){let o=Z.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+o,{__proto__:null,value:function(e,a,A){return this[i].call(this,t,e,a,A)},configurable:!0})})}var Ad=class{constructor(t){t&&this.set(t)}set(t,o,i){let e=this;function a(r,s,g){let c=pC(s);if(!c)return;let I=Z.findKey(e,c);(!I||e[I]===void 0||g===!0||g===void 0&&e[I]!==!1)&&(e[I||s]=ly(r))}let A=(r,s)=>Z.forEach(r,(g,c)=>a(g,c,s));if(Z.isPlainObject(t)||t instanceof this.constructor)A(t,o);else if(Z.isString(t)&&(t=t.trim())&&!kfe(t))A(Q3(t),o);else if(Z.isObject(t)&&Z.isSafeIterable(t)){let r=Object.create(null),s,g;for(let c of t){if(!Z.isArray(c))throw new TypeError("Object iterator must return a key-value pair");g=c[0],Z.hasOwnProp(r,g)?(s=r[g],r[g]=Z.isArray(s)?[...s,c[1]]:[s,c[1]]):r[g]=c[1]}A(r,o)}else t!=null&&a(o,t,i);return this}get(t,o){if(t=pC(t),t){let i=Z.findKey(this,t);if(i){let e=this[i];if(!o)return e;if(o===!0)return _fe(e);if(Z.isFunction(o))return o.call(this,e,i);if(Z.isRegExp(o))return o.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,o){if(t=pC(t),t){let i=Z.findKey(this,t);return!!(i&&this[i]!==void 0&&(!o||lT(this,this[i],i,o)))}return!1}delete(t,o){let i=this,e=!1;function a(A){if(A=pC(A),A){let r=Z.findKey(i,A);r&&(!o||lT(i,i[r],r,o))&&(delete i[r],e=!0)}}return Z.isArray(t)?t.forEach(a):a(t),e}clear(t){let o=Object.keys(this),i=o.length,e=!1;for(;i--;){let a=o[i];(!t||lT(this,this[a],a,t,!0))&&(delete this[a],e=!0)}return e}normalize(t){let o=this,i={};return Z.forEach(this,(e,a)=>{let A=Z.findKey(i,a);if(A){o[A]=ly(e),delete o[a];return}let r=t?vfe(a):String(a).trim();r!==a&&delete o[a],o[r]=ly(e),i[r]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let o=Object.create(null);return Z.forEach(this,(i,e)=>{i!=null&&i!==!1&&(o[e]=t&&Z.isArray(i)?i.join(", "):i)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,o])=>t+": "+o).join(` -`)}getSetCookie(){let t=this.get("set-cookie");return Z.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Rfe(t)}static concat(t,...o){let i=new this(t);return o.forEach(e=>i.set(e)),i}static accessor(t){let i=(this[m3]=this[m3]={accessors:{}}).accessors,e=this.prototype;function a(A){let r=pC(A);i[r]||(Pfe(e,A),i[r]=!0)}return Z.isArray(t)?t.forEach(a):a(t),this}};Ad.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Z.reduceDescriptors(Ad.prototype,({value:n},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(i){this[o]=i}}});Z.freezeMethods(Ad);var Ht=Ad;var dC="[REDACTED ****]";function Gfe(n){if(Z.hasOwnProp(n,"toJSON"))return!0;let t=Object.getPrototypeOf(n);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Ffe(n,t){let o=new Set(t.map(a=>String(a).toLowerCase())),i=[],e=a=>{if(a===null||typeof a!="object"||Z.isBuffer(a))return a;if(i.indexOf(a)!==-1)return;a instanceof Ht&&(a=a.toJSON()),i.push(a);let A;if(Z.isArray(a))A=[],a.forEach((r,s)=>{let g=e(r);Z.isUndefined(g)||(A[s]=g)});else{if(!Z.isPlainObject(a)&&Gfe(a))return i.pop(),a;A=Object.create(null);for(let[r,s]of Object.entries(a)){let g=o.has(r.toLowerCase())?dC:e(s);Z.isUndefined(g)||(A[r]=g)}}return i.pop(),A};return e(n)}function S3(n){try{return String(n)}catch{return""}}function Lfe(n){return n.errors.map(o=>{try{return o&&o.message?S3(o.message):S3(o)}catch{return""}}).filter(Boolean).join("; ")||n.name||"AggregateError"}var fa=class n extends Error{static from(t,o,i,e,a,A){let r=t.message;!r&&Z.isArray(t.errors)&&t.errors.length&&(r=Lfe(t));let s=new n(r,o||t.code,i,e,a);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),A&&Object.assign(s,A),s}constructor(t,o,i,e,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),i&&(this.config=i),e&&(this.request=e),a&&(this.response=a,this.status=a.status)}toJSON(){let t=this.config,o=t&&Z.hasOwnProp(t,"redact")?t.redact:void 0,i=Z.isArray(o)&&o.length>0?Ffe(t,o):Z.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}};fa.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";fa.ERR_BAD_OPTION="ERR_BAD_OPTION";fa.ECONNABORTED="ECONNABORTED";fa.ETIMEDOUT="ETIMEDOUT";fa.ECONNREFUSED="ECONNREFUSED";fa.ERR_NETWORK="ERR_NETWORK";fa.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";fa.ERR_DEPRECATED="ERR_DEPRECATED";fa.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";fa.ERR_BAD_REQUEST="ERR_BAD_REQUEST";fa.ERR_CANCELED="ERR_CANCELED";fa.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";fa.ERR_INVALID_URL="ERR_INVALID_URL";fa.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var De=fa;var DJ=qe(wJ(),1),yy=DJ.default;var my={isBufferAvailable(){return typeof Buffer<"u"},from(n){return Buffer.from(n)}};var PT=100;function vT(n){return Z.isPlainObject(n)||Z.isArray(n)}function OJ(n){return Z.endsWith(n,"[]")?n.slice(0,-2):n}function kT(n,t,o){return n?n.concat(t).map(function(e,a){return e=OJ(e),!o&&a?"["+e+"]":e}).join(o?".":""):t}function Sye(n){return Z.isArray(n)&&!n.some(vT)}var wye=Z.toFlatObject(Z,{},null,function(t){return/^is[A-Z]/.test(t)});function Dye(n,t,o){if(!Z.isObject(n))throw new TypeError("target must be an object");t=t||new(yy||FormData),o=Z.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,_){return!Z.isUndefined(_[T])});let i=o.metaTokens,e=o.visitor||f,a=o.dots,A=o.indexes,r=o.Blob||typeof Blob<"u"&&Blob,s=o.maxDepth===void 0?PT:o.maxDepth,g=r&&Z.isSpecCompliantForm(t),c=[];if(!Z.isFunction(e))throw new TypeError("visitor must be a function");function I(m){if(m===null)return"";if(Z.isDate(m))return m.toISOString();if(Z.isBoolean(m))return m.toString();if(!g&&Z.isBlob(m))throw new De("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(m)||Z.isTypedArray(m)){if(g&&typeof r=="function")return new r([m]);if(my&&my.isBufferAvailable())return my.from(m);throw new De("Blob is not supported. Use a Buffer instead.",De.ERR_NOT_SUPPORT)}return m}function d(m){if(m>s)throw new De("Object is too deeply nested ("+m+" levels). Max depth: "+s,De.ERR_FORM_DATA_DEPTH_EXCEEDED)}function B(m,T){if(s===1/0)return JSON.stringify(m);let _=[];return JSON.stringify(m,function(K,L){if(!Z.isObject(L))return L;for(;_.length&&_[_.length-1]!==this;)_.pop();return _.push(L),d(T+_.length-1),L})}function f(m,T,_){let R=m;if(Z.isReactNative(t)&&Z.isReactNativeBlob(m))return t.append(kT(_,T,a),I(m)),!1;if(m&&!_&&typeof m=="object"){if(Z.endsWith(T,"{}"))T=i?T:T.slice(0,-2),m=B(m,1);else if(Z.isArray(m)&&Sye(m)||(Z.isFileList(m)||Z.endsWith(T,"[]"))&&(R=Z.toArray(m)))return T=OJ(T),R.forEach(function(L,F){!(Z.isUndefined(L)||L===null)&&t.append(A===!0?kT([T],F,a):A===null?T:T+"[]",I(L))}),!1}return vT(m)?!0:(t.append(kT(_,T,a),I(m)),!1)}let Q=Object.assign(wye,{defaultVisitor:f,convertValue:I,isVisitable:vT});function y(m,T,_=0){if(!Z.isUndefined(m)){if(d(_),c.indexOf(m)!==-1)throw new Error("Circular reference detected in "+T.join("."));c.push(m),Z.forEach(m,function(K,L){(!(Z.isUndefined(K)||K===null)&&e.call(t,K,Z.isString(L)?L.trim():L,T,Q))===!0&&y(K,T?T.concat(L):[L],_+1)}),c.pop()}}if(!Z.isObject(n))throw new TypeError("data must be an object");return y(n),t}var uc=Dye;function bJ(n){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(n).replace(/[!'()~]|%20/g,function(i){return t[i]})}function MJ(n,t){this._pairs=[],n&&uc(n,this,t)}var _J=MJ.prototype;_J.append=function(t,o){this._pairs.push([t,o])};_J.toString=function(t){let o=t?i=>t.call(this,i,bJ):bJ;return this._pairs.map(function(e){return o(e[0])+"="+o(e[1])},"").join("&")};var TJ=MJ;function Oye(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function JI(n,t,o){if(!t)return n;n=n||"";let i=Z.isFunction(o)?{serialize:o}:o,e=Z.getSafeProp(i,"encode")||Oye,a=Z.getSafeProp(i,"serialize"),A;if(a?A=a(t,i):A=Z.isURLSearchParams(t)?t.toString():new TJ(t,i).toString(e),A){let r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+A}return n}var GT=class{constructor(){this.handlers=[]}use(t,o,i){return this.handlers.push({fulfilled:t,rejected:o,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,function(i){i!==null&&t(i)})}},FT=GT;var Bc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0};import Mye from"crypto";import bye from"url";var NJ=bye.URLSearchParams;var LT="abcdefghijklmnopqrstuvwxyz",RJ="0123456789",kJ={DIGIT:RJ,ALPHA:LT,ALPHA_DIGIT:LT+LT.toUpperCase()+RJ},_ye=(n=16,t=kJ.ALPHA_DIGIT)=>{let o="",{length:i}=t,e=new Uint32Array(n);Mye.randomFillSync(e);for(let a=0;aHT,hasStandardBrowserEnv:()=>Tye,hasStandardBrowserWebWorkerEnv:()=>Nye,navigator:()=>UT,origin:()=>Rye});var HT=typeof window<"u"&&typeof document<"u",UT=typeof navigator=="object"&&navigator||void 0,Tye=HT&&(!UT||["ReactNative","NativeScript","NS"].indexOf(UT.product)<0),Nye=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Rye=HT&&window.location.href||"http://localhost";var Bt={...KT,...vJ};function xT(n,t){return uc(n,new Bt.classes.URLSearchParams,{visitor:function(o,i,e,a){return Bt.isNode&&Z.isBuffer(o)?(this.append(i,o.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}var PJ=PT;function GJ(n){if(n>PJ)throw new De("FormData field is too deeply nested ("+n+" levels). Max depth: "+PJ,De.ERR_FORM_DATA_DEPTH_EXCEEDED)}function kye(n){let t=[],o=/[^.[\]]+|\[([^.[\]]*)]/g,i;for(;(i=o.exec(n))!==null;)GJ(t.length),t.push(i[0]==="[]"?"":i[1]||i[0]);return t}function vye(n){let t={},o=Object.keys(n),i,e=o.length,a;for(i=0;i=o.length;return A=!A&&Z.isArray(e)?e.length:A,s?(Z.hasOwnProp(e,A)?e[A]=Z.isArray(e[A])?e[A].concat(i):[e[A],i]:e[A]=i,!r):((!Z.hasOwnProp(e,A)||!Z.isObject(e[A]))&&(e[A]=[]),t(o,i,e[A],a)&&Z.isArray(e[A])&&(e[A]=vye(e[A])),!r)}if(Z.isFormData(n)&&Z.isFunction(n.entries)){let o={};return Z.forEachEntry(n,(i,e)=>{t(kye(i),e,o,0)}),o}return null}var Sy=Pye;var od=(n,t)=>n!=null&&Z.hasOwnProp(n,t)?n[t]:void 0;function Gye(n,t,o){if(Z.isString(n))try{return(t||JSON.parse)(n),Z.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(o||JSON.stringify)(n)}var YT={transitional:Bc,adapter:["xhr","http","fetch"],transformRequest:[function(t,o){let i=o.getContentType()||"",e=i.indexOf("application/json")>-1,a=Z.isObject(t);if(a&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return e?JSON.stringify(Sy(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(a){let s=od(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return xT(t,s).toString();if((r=Z.isFileList(t))||i.indexOf("multipart/form-data")>-1){let g=od(this,"env"),c=g&&g.FormData;return uc(r?{"files[]":t}:t,c&&new c,s)}}return a||e?(o.setContentType("application/json",!1),Gye(t)):t}],transformResponse:[function(t){let o=od(this,"transitional")||YT.transitional,i=o&&o.forcedJSONParsing,e=od(this,"responseType"),a=e==="json";if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(i&&!e||a)){let r=!(o&&o.silentJSONParsing)&&a;try{return JSON.parse(t,od(this,"parseReviver"))}catch(s){if(r)throw s.name==="SyntaxError"?De.from(s,De.ERR_BAD_RESPONSE,this,null,od(this,"response")):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bt.classes.FormData,Blob:Bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],n=>{YT.headers[n]={}});var nd=YT;function fC(n,t){let o=this||nd,i=t||o,e=Ht.from(i.headers),a=i.data;return Z.forEach(n,function(r){a=r.call(o,a,e.normalize(),t?t.status:void 0)}),e.normalize(),a}function QC(n){return!!(n&&n.__CANCEL__)}var jT=class extends De{constructor(t,o,i){super(t??"canceled",De.ERR_CANCELED,o,i),this.name="CanceledError",this.__CANCEL__=!0}},oo=jT;function cs(n,t,o){let i=o.config.validateStatus;!o.status||!i||i(o.status)?n(o):t(new De("Request failed with status code "+o.status,o.status>=400&&o.status<500?De.ERR_BAD_REQUEST:De.ERR_BAD_RESPONSE,o.config,o.request,o))}function JT(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function qT(n,t){if(!t)return n;let o=n.length;for(;o>0&&n.charCodeAt(o-1)===47;)o--;return n.slice(0,o)+"/"+t.replace(/^\/+/,"")}var Fye=/^https?:(?!\/\/)/i,Lye=/[\t\n\r]/g;function Uye(n){let t=0;for(;t`${o}${i}${dC}`)}function xye(n){let t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${dC}@`),o=t.indexOf("#"),e=(o===-1?t:t.slice(0,o)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${dC}`);return o===-1?e:`${e}#${Kye(t.slice(o+1))}`}function FJ(n,t){if(typeof n=="string"){let o=Hye(n);if(Fye.test(o))throw new De(`Invalid URL ${JSON.stringify(xye(o))}: missing "//" after protocol`,De.ERR_INVALID_URL,t)}}function qI(n,t,o,i){FJ(t,i);let e=!JT(t);return n&&(e||o===!1)?(FJ(n,i),qT(n,t)):t}var Yye={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function jye(n){try{return new URL(n)}catch{return null}}function LJ(n){var t=(typeof n=="string"?jye(n):n)||{},o=t.protocol,i=t.host,e=t.port;if(typeof i!="string"||!i||typeof o!="string"||(o=o.split(":",1)[0],i=i.replace(/:\d*$/,""),e=parseInt(e)||Yye[o]||0,!Jye(i,e)))return"";var a=zT(o+"_proxy")||zT("all_proxy");return a&&a.indexOf("://")===-1&&(a=o+"://"+a),a}function Jye(n,t){var o=zT("no_proxy").toLowerCase();return o?o==="*"?!1:o.split(/[,\s]/).every(function(i){if(!i)return!0;var e=i.match(/^(.+):(\d+)$/),a=e?e[1]:i,A=e?parseInt(e[2]):0;return A&&A!==t?!0:/^[.*]/.test(a)?(a.charAt(0)==="*"&&(a=a.slice(1)),!n.endsWith(a)):n!==a}):!0}function zT(n){return process.env[n.toLowerCase()]||process.env[n.toUpperCase()]||""}var bN=qe(aN(),1),Pq=qe(nq(),1);import kq from"http";import vq from"https";import QSe from"http2";import ySe from"util";import{resolve as Sq}from"path";import Go from"zlib";var Eg="1.19.0";function _C(n){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n);return t&&t[1]||""}var Jme=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function CN(n,t,o){let i=o&&o.Blob||Bt.classes.Blob,e=_C(n);if(t===void 0&&i&&(t=!0),e==="data"){n=e.length?n.slice(e.length+1):n;let a=Jme.exec(n);if(!a)throw new De("Invalid URL",De.ERR_INVALID_URL);let A=a[1],r=a[2],s=a[3]?"base64":"utf8",g=a[4],c="";A?c=r?A+r:A:r&&(c="text/plain"+r);let I=s==="base64"?Buffer.from(g,"base64"):Buffer.from(decodeURIComponent(g),s);if(t){if(!i)throw new De("Blob is not supported",De.ERR_NOT_SUPPORT);return new i([I],{type:c})}return I}throw new De("Unsupported protocol "+e,De.ERR_NOT_SUPPORT)}import mn from"stream";var qme=["content-type","content-length"];function TC(n,t,o){if(o!=="content-only"){n.set(t);return}Object.entries(t||{}).forEach(([i,e])=>{qme.includes(i.toLowerCase())&&n.set(i,e)})}import zme from"stream";var uN=Symbol("internals"),BN=class extends zme.Transform{constructor(t){t=Z.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,e)=>!Z.isUndefined(e[i])),super({readableHighWaterMark:t.chunkSize});let o=this[uN]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(o.isCaptured||(o.isCaptured=!0))})}_read(t){let o=this[uN];return o.onReadCallback&&o.onReadCallback(),super._read(t)}_transform(t,o,i){let e=this[uN],a=e.maxRate,A=this.readableHighWaterMark,r=e.timeWindow,s=1e3/r,g=a/s,c=e.minChunkSize!==!1?Math.max(e.minChunkSize,g*.01):0,I=(B,f)=>{let Q=Buffer.byteLength(B);e.bytesSeen+=Q,e.bytes+=Q,e.isCaptured&&this.emit("progress",e.bytesSeen),this.push(B)?process.nextTick(f):e.onReadCallback=()=>{e.onReadCallback=null,process.nextTick(f)}},d=(B,f)=>{let Q=Buffer.byteLength(B),y=null,m=A,T,_=0;if(a){let R=Date.now();(!e.ts||(_=R-e.ts)>=r)&&(e.ts=R,T=g-e.bytes,e.bytes=T<0?-T:0,_=0),T=g-e.bytes}if(a){if(T<=0)return setTimeout(()=>{f(null,B)},r-_);Tm&&Q-m>c&&(y=B.subarray(m),B=B.subarray(0,m)),I(B,y?()=>{process.nextTick(f,null,y)}:f)};d(t,function B(f,Q){if(f)return i(f);Q?d(Q,B):i(null)})}},fN=BN;import{EventEmitter as mSe}from"events";import Wme from"util";import{Readable as Zme}from"stream";var{asyncIterator:sq}=Symbol,Vme=async function*(n){n.stream?yield*n.stream():n.arrayBuffer?yield await n.arrayBuffer():n[sq]?yield*n[sq]():yield n},_y=Vme;var Xme=Bt.ALPHABET.ALPHA_DIGIT+"-_",NC=typeof TextEncoder=="function"?new TextEncoder:new Wme.TextEncoder,XI=`\r -`,$me=NC.encode(XI),eSe=2,QN=class{constructor(t,o){let{escapeName:i}=this.constructor,e=Z.isString(o),a=`Content-Disposition: form-data; name="${i(t)}"${!e&&o.name?`; filename="${i(o.name)}"`:""}${XI}`;if(e)o=NC.encode(String(o).replace(/\r?\n|\r\n?/g,XI));else{let A=String(o.type||"application/octet-stream").replace(/[\r\n]/g,"");a+=`Content-Type: ${A}${XI}`}this.headers=NC.encode(a+XI),this.contentLength=e?o.byteLength:o.size,this.size=this.headers.byteLength+this.contentLength+eSe,this.name=t,this.value=o}async*encode(){yield this.headers;let{value:t}=this;Z.isTypedArray(t)?yield t:yield*_y(t),yield $me}static escapeName(t){return String(t).replace(/[\r\n"]/g,o=>({"\r":"%0D","\n":"%0A",'"':"%22"})[o])}},ASe=(n,t,o)=>{let{tag:i="form-data-boundary",size:e=25,boundary:a=i+"-"+Bt.generateString(e,Xme)}=o||{};if(!Z.isFormData(n))throw new TypeError("FormData instance required");if(a.length<1||a.length>70)throw new Error("boundary must be 1-70 characters long");let A=NC.encode("--"+a+XI),r=NC.encode("--"+a+"--"+XI),s=r.byteLength,g=Array.from(n.entries()).map(([I,d])=>{let B=new QN(I,d);return s+=B.size,B});s+=A.byteLength*g.length,s=Z.toFiniteNumber(s);let c={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(s)&&(c["Content-Length"]=s),t&&t(c),Zme.from((async function*(){for(let I of g)yield A,yield*I.encode();yield r})())},gq=ASe;import tSe from"stream";var yN=class extends tSe.Transform{__transform(t,o,i){this.push(t),i()}_transform(t,o,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,o)}this.__transform(t,o,i)}},cq=yN;import rSe from"http2";import aSe from"util";var mN=class{constructor(){this.sessions=Object.create(null)}getSession(t,o){o=Object.assign({sessionTimeout:1e3},o);let i=this.sessions[t];if(i){let I=i.length;for(let d=0;d{if(a)return;a=!0,A&&(clearTimeout(A),A=null);let I=i,d=I.length,B=d;for(;B--;)if(I[B][0]===e){d===1?delete this.sessions[t]:I.splice(B,1),e.closed||e.close();return}},s=e.request,{sessionTimeout:g}=o;if(g!=null){let I=0;e.request=function(){let d=s.apply(this,arguments);return I++,A&&(clearTimeout(A),A=null),d.once("close",()=>{--I||(A=setTimeout(()=>{A=null,r()},g))}),d}}e.once("close",r);let c=[e,o];return i?i.push(c):i=this.sessions[t]=[c],e}},Iq=mN;var iSe=(n,t)=>Z.isAsyncFn(n)?function(...o){let i=o.pop();n.apply(this,o).then(e=>{try{t?i(null,...t(e)):i(null,e)}catch(a){i(a)}},i)}:n,lq=iSe;var oSe=new Set(["localhost","0.0.0.0"]),hq=n=>{let t=n.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(o=>/^\d+$/.test(o)&&Number(o)>=0&&Number(o)<=255)},SN=n=>{if(/^0[xX][0-9a-fA-F]+$/.test(n)){let t=parseInt(n.slice(2),16);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-7]+$/.test(n)){let t=parseInt(n,8);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-9]+$/.test(n))return null;if(/^[0-9]+$/.test(n)){let t=parseInt(n,10);return Number.isFinite(t)?t:null}return null},nSe=n=>{if(typeof n!="string"||!n||n.indexOf(":")!==-1)return n;let t=n;if(t.charAt(0)==="["&&t.charAt(t.length-1)==="]"&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return n;let o=t.split(".");if(o.some(c=>c===""))return n;if(o.length===4){let c=o.map(SN);return c.some(I=>I===null||I<0||I>255)?n:c.join(".")}if(o.length>4||o.length===1)return n;let i=o.slice(0,-1),e=o[o.length-1],a=4-i.length,A=SN(e);if(A===null)return n;let r=(1<<8*a)-1;if(A<0||A>r)return n;let s=new Array(a).fill(0);for(let c=a-1,I=A;c>=0;c--,I>>=8)s[c]=I&255;let g=i.map(SN);return g.some(c=>c===null||c<0||c>255)?n:[...g,...s].join(".")},wN=n=>/^0{1,4}$/.test(n),sSe=n=>{if(n==="::")return!0;let t=n.indexOf("::");if(t!==-1){if(t!==n.lastIndexOf("::"))return!1;let i=n.slice(0,t),e=n.slice(t+2),a=i?i.split(":"):[],A=e?e.split(":"):[];return a.length+A.length<8&&a.every(wN)&&A.every(wN)}let o=n.split(":");return o.length===8&&o.every(wN)},gSe=n=>{if(n==="::1")return!0;let t=n.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return hq(t[1]);let o=n.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(o){let e=parseInt(o[1],16);return e>=32512&&e<=32767}let i=n.split(":");if(i.length===8){for(let e=0;e<7;e++)if(!/^0+$/.test(i[e]))return!1;return/^0*1$/.test(i[7])}return!1},pq=n=>n?oSe.has(n)||hq(n)||sSe(n)?!0:gSe(n):!1,cSe={http:80,https:443,ws:80,wss:443,ftp:21},ISe=n=>{let t=n,o=0;if(t.charAt(0)==="["){let a=t.indexOf("]");if(a!==-1){let A=t.slice(1,a),r=t.slice(a+1);return r.charAt(0)===":"&&/^\d+$/.test(r.slice(1))&&(o=Number.parseInt(r.slice(1),10)),[A,o]}}let i=t.indexOf(":"),e=t.lastIndexOf(":");return i!==-1&&i===e&&/^\d+$/.test(t.slice(e+1))&&(o=Number.parseInt(t.slice(e+1),10),t=t.slice(0,e)),[t,o]},lSe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,pSe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,dSe=n=>{if(typeof n!="string"||n.indexOf(":")===-1)return n;let t=n.match(lSe);if(t)return t[1];let o=n.match(pSe);if(o){let i=parseInt(o[1],16),e=parseInt(o[2],16);return`${i>>8}.${i&255}.${e>>8}.${e&255}`}return n},dq=n=>{if(!n)return n;n.charAt(0)==="["&&n.charAt(n.length-1)==="]"&&(n=n.slice(1,-1));let t=n.replace(/\.+$/,""),o=nSe(t);return o!==t?o:dSe(t)};function DN(n){let t;try{t=new URL(n)}catch{return!1}let o=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!o)return!1;if(o==="*")return!0;let i=Number.parseInt(t.port,10)||cSe[t.protocol.split(":",1)[0]]||0,e=dq(t.hostname.toLowerCase());return o.split(/[\s,]+/).some(a=>{if(!a)return!1;if(a==="*")return!0;let[A,r]=ISe(a);return A=dq(A),!A||r&&r!==i?!1:(A.charAt(0)==="*"&&(A=A.slice(1)),A.charAt(0)==="."?e.endsWith(A):e===A||pq(e)&&pq(A))})}function hSe(n,t){n=n||10;let o=new Array(n),i=new Array(n),e=0,a=0,A;return t=t!==void 0?t:1e3,function(s){let g=Date.now(),c=i[a];A||(A=g),o[e]=s,i[e]=g;let I=a,d=0;for(;I!==e;)d+=o[I++],I=I%n;if(e=(e+1)%n,e===a&&(a=(a+1)%n),g-A{o=c,e=null,a&&(clearTimeout(a),a=null),n(...g)};return[(...g)=>{let c=Date.now(),I=c-o;I>=i?A(g,c):(e=g,a||(a=setTimeout(()=>{a=null,A(e)},i-I)))},()=>e&&A(e)]}var Cq=ESe;var Cg=(n,t,o=3)=>{let i=0,e=Eq(50,250);return Cq(a=>{if(!a||typeof a.loaded!="number")return;let A=a.loaded,r=a.lengthComputable?a.total:void 0,s=Math.max(0,r!=null?Math.min(A,r):A),g=Math.max(0,s-i),c=e(g);i=Math.max(i,s);let I={loaded:s,total:r,progress:r?s/r:void 0,bytes:g,rate:c||void 0,estimated:c&&r?(r-s)/c:void 0,event:a,lengthComputable:r!=null,[t?"download":"upload"]:!0};n(I)},o)},ld=(n,t)=>{let o=n!=null;return[i=>t[0]({lengthComputable:o,total:n,loaded:i}),t[1]]},pd=(n,t=Z.asap)=>(...o)=>t(()=>n(...o));var uq=n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102,fq=(n,t,o)=>t+2n<=57?n-48:(n&223)-55,CSe=n=>n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===43||n===47||n===45||n===95,uSe=n=>n===9||n===10||n===12||n===13||n===32,BSe=n=>{let t=Math.floor(n/4),o=n%4;return t*3+(o===2?1:o===3?2:0)},Qq=n=>{let t=n.length,o=0;return t>0&&n.charCodeAt(t-1)===61&&(o++,t>1&&n.charCodeAt(t-2)===61&&o++),Math.floor((t-o)*3/4)},fSe=n=>{let t=n.length,o=0,i=0,e=!1;for(let a=0;a0){e=!0;continue}o++}}return e||i>2||i>0&&(o+i)%4!==0||o%4===1?Qq(n):BSe(o)},yq=(n,t)=>{if(!n||typeof n!="string"||!n.startsWith("data:"))return 0;let o=n.indexOf(",");if(o<0)return 0;let i=n.slice(5,o),e=n.slice(o+1);if(/;base64/i.test(i))return t(e);let A=0;for(let r=0,s=e.length;r=55296&&g<=56319&&r+1=56320&&c<=57343?(A+=4,r++):A+=3}else A+=3}return A};function ON(n){let t=typeof n=="string"?n.indexOf("#"):-1;return yq(t===-1?n:n.slice(0,t),fSe)}function mq(n){return yq(n,Qq)}var wq={flush:Go.constants.Z_SYNC_FLUSH,finishFlush:Go.constants.Z_SYNC_FLUSH},SSe={flush:Go.constants.BROTLI_OPERATION_FLUSH,finishFlush:Go.constants.BROTLI_OPERATION_FLUSH},wSe={flush:Go.constants.ZSTD_e_flush,finishFlush:Go.constants.ZSTD_e_flush},Gq=Z.isFunction(Go.createBrotliDecompress),Fq=Z.isFunction(Go.createZstdDecompress),Lq="gzip, compress, deflate"+(Gq?", br":""),DSe=Lq+(Fq?", zstd":""),Dq=typeof process<"u"&&process.nextTick?process.nextTick.bind(process):Z.asap,{http:OSe,https:bSe}=Pq.default,MN=/https:?/,Oq=Symbol("axios.http.socketListener"),Ty=Symbol("axios.http.currentReq"),Uq=Symbol("axios.http.installedTunnel"),MSe=new Map,bq=new WeakMap,Mq={22:21,24:5};function _Se(n=process.versions&&process.versions.node){if(!n)return!1;let[t,o]=n.split(".").map(i=>Number(i));return!Number.isInteger(t)||!Number.isInteger(o)?!1:t>24?!0:Mq[t]!=null&&o>=Mq[t]}function TSe(n,t=process.versions&&process.versions.node){if(!_Se(t))return!1;let o=n&&n.options;return!!(o&&Z.hasOwnProp(o,"proxyEnv")&&o.proxyEnv!=null)}function NSe(n,t,o){return MN.test(n.protocol)?o||vq.globalAgent:t||kq.globalAgent}function RSe(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||"")+"#"+(n.auth||""),i=t?bq.get(t)||bq.set(t,new Map).get(t):MSe,e=i.get(o);if(e)return e;let a=t&&t.options?{...t.options,...n}:n;if(e=new bN.default(a),t&&t.options){let A={...t.options},r=e.callback;e.callback=function(g,c){return r.call(this,g,{...A,...c})}}return e[Uq]=!0,i.set(o,e),e}var _q=Bt.protocols.map(n=>n+":"),Tq=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},Nq=(n,[t,o])=>(n.on("end",o).on("error",o),t),kSe=new Iq;function vSe(n,t,o){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.auth&&n.beforeRedirects.auth(n),n.beforeRedirects.sensitiveHeaders&&n.beforeRedirects.sensitiveHeaders(n,o),n.beforeRedirects.config&&n.beforeRedirects.config(n,t,o)}function PSe(n,t){n&&Object.keys(n).forEach(o=>{t.has(o.toLowerCase())&&delete n[o]})}function GSe(n,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(n.href).origin}catch{return!1}}function Hq(n,t,o,i,e,a){let A=t,r=NSe(n,a,e);if(!A&&A!==!1&&!TSe(r)){let s=LJ(o);s&&(DN(o)||(A=new URL(s)))}if(i&&n.headers)for(let s of Object.keys(n.headers))s.toLowerCase()==="proxy-authorization"&&delete n.headers[s];if(i&&n.agent&&n.agent[Uq]&&(n.agent=void 0),A){let s=A instanceof URL,g=f=>s||Z.hasOwnProp(A,f)?A[f]:void 0,c=g("username"),I=g("password"),d=Z.hasOwnProp(A,"auth")?A.auth:void 0;if(c&&(d=(c||"")+":"+(I||"")),d){let f=typeof d=="object",Q=f&&Z.hasOwnProp(d,"username")?d.username:void 0,y=f&&Z.hasOwnProp(d,"password")?d.password:void 0;if(!!(Q||y))d=(Q||"")+":"+(y||"");else if(f)throw new De("Invalid proxy authorization",De.ERR_BAD_OPTION,{proxy:A})}if(MN.test(n.protocol)){if(!(e instanceof bN.default)){let f=g("hostname")||g("host"),Q=g("port"),y=g("protocol"),m=y?y.includes(":")?y:`${y}:`:"http:",T=f&&f.includes(":")&&!f.startsWith("[")?`[${f}]`:f,_=new URL(`${m}//${T}${Q?":"+Q:""}`),R={protocol:_.protocol,hostname:_.hostname.replace(/^\[|\]$/g,""),port:_.port,auth:d&&typeof d=="string"?d:void 0};_.protocol==="https:"&&(R.ALPNProtocols=["http/1.1"]);let K=RSe(R,e);n.agent=K,n.agents&&(n.agents.https=K)}}else{if(d){let m=Buffer.from(d,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+m}let f=!1;for(let m of Object.keys(n.headers))if(m.toLowerCase()==="host"){f=!0;break}f||(n.headers.host=n.hostname+(n.port?":"+n.port:""));let Q=g("hostname")||g("host");n.hostname=Q,n.host=Q,n.port=g("port"),n.path=o;let y=g("protocol");y&&(n.protocol=y.includes(":")?y:`${y}:`)}}n.beforeRedirects.proxy=function(g){Hq(g,t,g.href,!0,e,a)}}var FSe=typeof process<"u"&&Z.kindOf(process)==="process",LSe=n=>new Promise((t,o)=>{let i,e,a=(s,g)=>{e||(e=!0,i&&i(s,g))},A=s=>{a(s),t(s)},r=s=>{a(s,!0),o(s)};n(A,r,s=>i=s).catch(r)}),USe=({address:n,family:t})=>{if(!Z.isString(n))throw TypeError("address must be a string");return{address:n,family:t||(n.indexOf(".")<0?6:4)}},Rq=(n,t)=>USe(Z.isObject(n)?n:{address:n,family:t}),HSe={request(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||(n.protocol==="https:"?443:80)),{http2Options:i,headers:e}=n,a=kSe.getSession(o,i),{HTTP2_HEADER_SCHEME:A,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:s,HTTP2_HEADER_STATUS:g}=QSe.constants,c={[A]:n.protocol.replace(":",""),[r]:n.method,[s]:n.path};Z.forEach(e,(d,B)=>{B.charAt(0)!==":"&&(c[B]=d)});let I=a.request(c);return I.once("response",d=>{let B=I;d=Object.assign({},d);let f=d[g];delete d[g],B.headers=d,B.statusCode=+f,t(B)}),I}},Kq=FSe&&function(t){return LSe(async function(i,e,a){let A=ue=>Z.getSafeProp(t,ue),r=A("transitional")||Bc,s=A("data"),g=A("lookup"),c=A("family"),I=A("httpVersion");I===void 0&&(I=1);let d=A("http2Options"),B=A("httpAgent"),f=A("httpsAgent"),Q=A("proxy"),y=A("responseType"),m=A("responseEncoding"),T=A("socketPath"),_=A("method").toUpperCase(),R=A("maxRedirects"),K=A("maxBodyLength"),L=A("maxContentLength"),F=A("decompress"),q,V=!1,x,G;if(I=+I,Number.isNaN(I))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(I!==1&&I!==2)throw TypeError(`Unsupported protocol version '${I}'`);let J=I===2;if(g){let ue=lq(g,Ne=>Z.isArray(Ne)?Ne:[Ne]);g=(Ne,Ue,MA)=>{ue(Ne,Ue,(Ke,_A,at)=>{if(Ke)return MA(Ke);let wA=Z.isArray(_A)?_A.map(lt=>Rq(lt)):[Rq(_A,at)];Ue.all?MA(Ke,wA):MA(Ke,wA[0].address,wA[0].family)})}}let U=new mSe;function N(ue){try{U.emit("abort",!ue||ue.type?new oo(null,t,x):ue)}catch{}}function k(){G&&(clearTimeout(G),G=null)}function z(){let ue=A("timeout"),Ne=ue?"timeout of "+ue+"ms exceeded":"timeout exceeded",Ue=A("timeoutErrorMessage");return Ue&&(Ne=Ue),new De(Ne,r.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,x)}U.once("abort",e);let Ae=()=>{k(),t.cancelToken&&t.cancelToken.unsubscribe(N),t.signal&&t.signal.removeEventListener("abort",N),U.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(N),t.signal&&(t.signal.aborted?N():t.signal.addEventListener("abort",N))),a((ue,Ne)=>{if(q=!0,k(),Ne){V=!0,Ae();return}let{data:Ue}=ue;if(Ue instanceof mn.Readable||Ue instanceof mn.Duplex){let MA=mn.finished(Ue,()=>{MA(),Ae()})}else Ae()});let ie=qI(A("baseURL"),A("url"),A("allowAbsoluteUrls"),t),we=T?"http://localhost":Bt.hasBrowserEnv?Bt.origin:void 0,se=new URL(ie,we),Te=se.protocol||_q[0];if(Te==="data:"){if(L>-1){let Ne=String(A("url")||ie||"");if(mq(Ne)>L)return e(new De("maxContentLength size of "+L+" exceeded",De.ERR_BAD_RESPONSE,t))}let ue;if(_!=="GET")return cs(i,e,{status:405,statusText:"method not allowed",headers:{},config:t});try{ue=CN(A("url"),y==="blob",{Blob:t.env&&t.env.Blob})}catch(Ne){throw De.from(Ne,De.ERR_BAD_REQUEST,t)}return y==="text"?(ue=ue.toString(m),(!m||m==="utf8")&&(ue=Z.stripBOM(ue))):y==="stream"&&(ue=mn.Readable.from(ue)),cs(i,e,{data:ue,status:200,statusText:"OK",headers:new Ht,config:t})}if(_q.indexOf(Te)===-1)return e(new De("Unsupported protocol "+Te,De.ERR_BAD_REQUEST,t));let fe=Ht.from(t.headers).normalize();fe.set("User-Agent","axios/"+Eg,!1);let{onUploadProgress:ke,onDownloadProgress:Re}=t,We=t.maxRate,ve,aA;if(Z.isSpecCompliantForm(s)){let ue=fe.getContentType(/boundary=([-_\w\d]{10,70})/i);s=gq(s,Ne=>{fe.set(Ne)},{tag:`axios-${Eg}-boundary`,boundary:ue&&ue[1]||void 0})}else if(Z.isFormData(s)&&Z.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(TC(fe,s.getHeaders(),A("formDataHeaderPolicy")),!fe.hasContentLength())try{let ue=await ySe.promisify(s.getLength).call(s);Number.isFinite(ue)&&ue>=0&&fe.setContentLength(ue)}catch{}}else if(Z.isBlob(s)||Z.isFile(s))s.size&&fe.setContentType(s.type||"application/octet-stream"),fe.setContentLength(s.size||0),s=mn.Readable.from(_y(s));else if(s&&!Z.isStream(s)){if(!Buffer.isBuffer(s))if(Z.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(Z.isString(s))s=Buffer.from(s,"utf-8");else return e(new De("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",De.ERR_BAD_REQUEST,t));if(fe.setContentLength(s.length,!1),K>-1&&s.length>K)return e(new De("Request body larger than maxBodyLength limit",De.ERR_BAD_REQUEST,t))}let Be=Z.toFiniteNumber(fe.getContentLength());Z.isArray(We)?(ve=We[0],aA=We[1]):ve=aA=We,s&&(ke||ve)&&(Z.isStream(s)||(s=mn.Readable.from(s,{objectMode:!1})),s=mn.pipeline([s,new fN({maxRate:Z.toFiniteNumber(ve)})],Z.noop),ke&&s.on("progress",Nq(s,ld(Be,Cg(pd(ke,Dq),!1,3)))));let Ie,Xe=A("auth");if(Xe){let ue=Z.getSafeProp(Xe,"username")||"",Ne=Z.getSafeProp(Xe,"password")||"";Ie=ue+":"+Ne}if(!Ie&&(se.username||se.password)){let ue=Tq(se.username),Ne=Tq(se.password);Ie=ue+":"+Ne}Ie&&fe.delete("authorization");let je;try{je=JI(se.pathname+se.search,A("params"),A("paramsSerializer")).replace(/^\?/,"")}catch(ue){return e(De.from(ue,De.ERR_BAD_REQUEST,t,null,null,{url:A("url"),exists:!0}))}fe.set("Accept-Encoding",Z.hasOwnProp(r,"advertiseZstdAcceptEncoding")&&r.advertiseZstdAcceptEncoding===!0?DSe:Lq,!1);let Oe=Object.assign(Object.create(null),{path:je,method:_,headers:ed(fe),agents:{http:B,https:f},auth:Ie,protocol:Te,family:c,beforeRedirect:vSe,beforeRedirects:Object.create(null),http2Options:d});if(!Z.isUndefined(g)&&(Oe.lookup=g),T){if(typeof T!="string")return e(new De("socketPath must be a string",De.ERR_BAD_OPTION_VALUE,t));let ue=A("allowedSocketPaths");if(ue!=null){let Ne=Array.isArray(ue)?ue:[ue],Ue=Sq(T);if(!Ne.some(Ke=>typeof Ke=="string"&&Sq(Ke)===Ue))return e(new De(`socketPath "${T}" is not permitted by allowedSocketPaths`,De.ERR_BAD_OPTION_VALUE,t))}Oe.socketPath=T}else Oe.hostname=se.hostname.startsWith("[")?se.hostname.slice(1,-1):se.hostname,Oe.port=se.port,Hq(Oe,Q,Te+"//"+se.hostname+(se.port?":"+se.port:"")+Oe.path,!1,f,B);let EA,hA=!1,iA=!1,Ze=MN.test(Oe.protocol);if(Oe.agent==null&&(Oe.agent=Ze?f:B),J)EA=HSe;else{let ue=A("transport");if(ue)EA=ue;else if(R===0)EA=Ze?vq:kq,hA=!0;else{iA=!0,Oe.sensitiveHeaders=[],R&&(Oe.maxRedirects=R);let Ne=A("beforeRedirect");if(Ne&&(Oe.beforeRedirects.config=Ne),Ie){let MA=se.origin,Ke=Ie;Oe.beforeRedirects.auth=function(at){try{new URL(at.href).origin===MA&&(at.auth=Ke)}catch{}}}let Ue=A("sensitiveHeaders");if(Ue!=null){if(!Z.isArray(Ue))return e(new De("sensitiveHeaders must be an array of strings",De.ERR_BAD_OPTION_VALUE,t));let MA=new Set;for(let Ke of Ue){if(!Z.isString(Ke))return e(new De("sensitiveHeaders must be an array of strings",De.ERR_BAD_OPTION_VALUE,t));MA.add(Ke.toLowerCase())}MA.size&&(Oe.sensitiveHeaders=Array.from(MA),Oe.beforeRedirects.sensitiveHeaders=function(_A,at){GSe(_A,at)||PSe(_A.headers,MA)})}EA=Ze?bSe:OSe}}K>-1?Oe.maxBodyLength=K:Oe.maxBodyLength=1/0,Oe.insecureHTTPParser=!!A("insecureHTTPParser"),x=EA.request(Oe,function(Ne){if(k(),x.destroyed)return;let Ue=[Ne],MA=Z.toFiniteNumber(Ne.headers["content-length"]);if(Re||aA){let wA=new fN({maxRate:Z.toFiniteNumber(aA)});Re&&wA.on("progress",Nq(wA,ld(MA,Cg(pd(Re,Dq),!0,3)))),Ue.push(wA)}let Ke=Ne,_A=Ne.req||x;if(F!==!1&&Ne.headers["content-encoding"])switch((_==="HEAD"||Ne.statusCode===204)&&delete Ne.headers["content-encoding"],(Ne.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ue.push(Go.createUnzip(wq)),delete Ne.headers["content-encoding"];break;case"deflate":Ue.push(new cq),Ue.push(Go.createUnzip(wq)),delete Ne.headers["content-encoding"];break;case"br":Gq&&(Ue.push(Go.createBrotliDecompress(SSe)),delete Ne.headers["content-encoding"]);break;case"zstd":Fq&&(Ue.push(Go.createZstdDecompress(wSe)),delete Ne.headers["content-encoding"]);break}Ke=Ue.length>1?mn.pipeline(Ue,Z.noop):Ue[0];let at={status:Ne.statusCode,statusText:Ne.statusMessage,headers:new Ht(Ne.headers),config:t,request:_A};if(y==="stream"){if(L>-1){let wA=L,lt=Ke;async function*Er(){let UA=0;for await(let pe of lt){if(UA+=pe.length,UA>wA)throw new De("maxContentLength size of "+wA+" exceeded",De.ERR_BAD_RESPONSE,t,_A);yield pe}}Ke=mn.Readable.from(Er(),{objectMode:!1})}at.data=Ke,cs(i,e,at)}else{let wA=[],lt=0;Ke.on("data",function(UA){wA.push(UA),lt+=UA.length,L>-1&<>L&&(V=!0,Ke.destroy(),N(new De("maxContentLength size of "+L+" exceeded",De.ERR_BAD_RESPONSE,t,_A)))}),Ke.on("aborted",function(){if(V)return;let UA=new De("stream has been aborted",De.ERR_BAD_RESPONSE,t,_A,at);Ke.destroy(UA),e(UA)}),Ke.on("error",function(UA){V||e(De.from(UA,null,t,_A,at))}),Ke.on("end",function(){try{let UA=wA.length===1?wA[0]:Buffer.concat(wA);y!=="arraybuffer"&&(UA=UA.toString(m),(!m||m==="utf8")&&(UA=Z.stripBOM(UA))),at.data=UA}catch(UA){return e(De.from(UA,null,t,at.request,at))}cs(i,e,at)})}U.once("abort",wA=>{Ke.destroyed||(Ke.emit("error",wA),Ke.destroy())})}),U.once("abort",ue=>{x.close?x.close():x.destroy(ue)}),x.on("error",function(Ne){e(De.from(Ne,null,t,x))});let bA=new Set;if(x.on("socket",function(Ne){typeof Ne.setKeepAlive=="function"&&Ne.setKeepAlive(!0,1e3*60),Ne[Oq]||(Ne.on("error",function(MA){let Ke=Ne[Ty];Ke&&!Ke.destroyed&&Ke.destroy(MA)}),Ne[Oq]=!0),Ne[Ty]=x,bA.add(Ne)}),x.once("close",function(){k();for(let Ne of bA)Ne[Ty]===x&&(Ne[Ty]=null);bA.clear()}),A("timeout")){let ue=parseInt(A("timeout"),10);if(Number.isNaN(ue)){N(new De("error trying to parse `config.timeout` to int",De.ERR_BAD_OPTION_VALUE,t,x));return}let Ne=function(){q||N(z())};hA&&ue>0&&(G=setTimeout(Ne,ue)),x.setTimeout(ue,Ne)}else x.setTimeout(0);if(Z.isStream(s)){let ue=!1,Ne=!1;s.on("end",()=>{ue=!0}),s.once("error",MA=>{Ne=!0,x.destroy(MA)}),s.on("close",()=>{!ue&&!Ne&&N(new oo("Request stream has been aborted",t,x))});let Ue=s;if(K>-1&&!iA){let MA=K,Ke=0;Ue=mn.pipeline([s,new mn.Transform({transform(_A,at,wA){if(Ke+=_A.length,Ke>MA)return wA(new De("Request body larger than maxBodyLength limit",De.ERR_BAD_REQUEST,t,x));wA(null,_A)}})],Z.noop),Ue.on("error",_A=>{x.destroyed||x.destroy(_A)})}Ue.pipe(x)}else s&&x.write(s),x.end()})};var xq=Bt.hasStandardBrowserEnv?((n,t)=>o=>(o=new URL(o,Bt.origin),n.protocol===o.protocol&&n.host===o.host&&(t||n.port===o.port)))(new URL(Bt.origin),Bt.navigator&&/(msie|trident)/i.test(Bt.navigator.userAgent)):()=>!0;var Yq=Bt.hasStandardBrowserEnv?{write(n,t,o,i,e,a,A){if(typeof document>"u")return;let r=[`${n}=${encodeURIComponent(t)}`];Z.isNumber(o)&&r.push(`expires=${new Date(o).toUTCString()}`),Z.isString(i)&&r.push(`path=${i}`),Z.isString(e)&&r.push(`domain=${e}`),a===!0&&r.push("secure"),Z.isString(A)&&r.push(`SameSite=${A}`),document.cookie=r.join("; ")},read(n){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let o=0;on instanceof Ht?{...n}:n,KSe=n=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(t=>Object.getOwnPropertyDescriptor(n,t).enumerable)):Object.keys(n);function Sn(n,t){n=n||{},t=t||{};let o=Object.create(null);Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,I,d,B){return Z.isPlainObject(c)&&Z.isPlainObject(I)?Z.merge.call({caseless:B},c,I):Z.isPlainObject(I)?Z.merge({},I):Z.isArray(I)?I.slice():I}function e(c,I,d,B){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return i(void 0,c,d,B)}else return i(c,I,d,B)}function a(c,I){if(!Z.isUndefined(I))return i(void 0,I)}function A(c,I){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return i(void 0,c)}else return i(void 0,I)}function r(c){let I=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(I))if(Z.isPlainObject(I)){if(Z.hasOwnProp(I,c))return I[c]}else return;let d=Z.hasOwnProp(n,"transitional")?n.transitional:void 0;if(Z.isPlainObject(d)&&Z.hasOwnProp(d,c))return d[c]}function s(c,I,d){if(Z.hasOwnProp(t,d))return i(c,I);if(Z.hasOwnProp(n,d))return i(void 0,c)}let g={url:a,method:a,data:a,baseURL:A,transformRequest:A,transformResponse:A,paramsSerializer:A,timeout:A,timeoutMessage:A,withCredentials:A,withXSRFToken:A,adapter:A,responseType:A,xsrfCookieName:A,xsrfHeaderName:A,onUploadProgress:A,onDownloadProgress:A,decompress:A,maxContentLength:A,maxBodyLength:A,beforeRedirect:A,transport:A,httpAgent:A,httpsAgent:A,cancelToken:A,socketPath:A,allowedSocketPaths:A,responseEncoding:A,validateStatus:s,headers:(c,I,d)=>e(jq(c),jq(I),d,!0)};return Z.forEach(KSe({...n,...t}),function(I){if(I==="__proto__"||I==="constructor"||I==="prototype")return;let d=Z.hasOwnProp(g,I)?g[I]:e,B=Z.hasOwnProp(n,I)?n[I]:void 0,f=Z.hasOwnProp(t,I)?t[I]:void 0,Q=d(B,f,I);Z.isUndefined(Q)&&d!==s||(o[I]=Q)}),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&r("validateStatusUndefinedResolves")===!1&&(Z.hasOwnProp(n,"validateStatus")?o.validateStatus=i(void 0,n.validateStatus):delete o.validateStatus),o}var xSe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16)));function YSe(n){let t=Sn({},n),o=d=>Z.hasOwnProp(t,d)?t[d]:void 0,i=o("data"),e=o("withXSRFToken"),a=o("xsrfHeaderName"),A=o("xsrfCookieName"),r=o("headers"),s=o("auth"),g=o("baseURL"),c=o("allowAbsoluteUrls"),I=o("url");if(t.headers=r=Ht.from(r),t.url=JI(qI(g,I,c,t),o("params"),o("paramsSerializer")),s){let d=Z.getSafeProp(s,"username")||"",B=Z.getSafeProp(s,"password")||"";try{r.set("Authorization","Basic "+btoa(d+":"+(B?xSe(B):"")))}catch(f){throw De.from(f,De.ERR_BAD_OPTION_VALUE,n)}}if(Z.isFormData(i)&&(Bt.hasStandardBrowserEnv||Bt.hasStandardBrowserWebWorkerEnv||Z.isReactNative(i)?r.setContentType(void 0):Z.isFunction(i.getHeaders)&&TC(r,i.getHeaders(),o("formDataHeaderPolicy"))),Bt.hasStandardBrowserEnv&&(Z.isFunction(e)&&(e=e(t)),e===!0||e==null&&xq(t.url))){let B=a&&A&&Yq.read(A);B&&r.set(a,B)}return t}var Ny=YSe;var jSe=typeof XMLHttpRequest<"u",Jq=jSe&&function(n){return new Promise(function(o,i){let e=Ny(n),a=e.data,A=Ht.from(e.headers).normalize(),{responseType:r,onUploadProgress:s,onDownloadProgress:g}=e,c,I,d,B,f;function Q(){B&&B(),f&&f(),e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(e.method.toUpperCase(),e.url,!0),y.timeout=e.timeout;function m(){if(!y)return;let _=Ht.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),K={data:!r||r==="text"||r==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:n,request:y};cs(function(F){o(F),Q()},function(F){i(F),Q()},K),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(i(new De("Request aborted",De.ECONNABORTED,n,y)),Q(),y=null)},y.onerror=function(R){let K=R&&R.message?R.message:"Network Error",L=new De(K,De.ERR_NETWORK,n,y);L.event=R||null,i(L),Q(),y=null},y.ontimeout=function(){let R=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",K=e.transitional||Bc;e.timeoutErrorMessage&&(R=e.timeoutErrorMessage),i(new De(R,K.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,n,y)),Q(),y=null},a===void 0&&A.setContentType(null),"setRequestHeader"in y&&Z.forEach(ed(A),function(R,K){y.setRequestHeader(K,R)}),Z.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),r&&r!=="json"&&(y.responseType=e.responseType),g&&([d,f]=Cg(g,!0),y.addEventListener("progress",d)),s&&y.upload&&([I,B]=Cg(s),y.upload.addEventListener("progress",I),y.upload.addEventListener("loadend",B)),(e.cancelToken||e.signal)&&(c=_=>{y&&(i(!_||_.type?new oo(null,n,y):_),y.abort(),Q(),y=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));let T=_C(e.url);if(T&&!Bt.protocols.includes(T)){i(new De("Unsupported protocol "+T+":",De.ERR_BAD_REQUEST,n)),Q();return}y.send(a||null)})};var JSe=(n,t)=>{if(n=n?n.filter(Boolean):[],!t&&!n.length)return;let o=new AbortController,i=!1,e=function(s){if(!i){i=!0,A();let g=s instanceof Error?s:this.reason;o.abort(g instanceof De?g:new oo(g instanceof Error?g.message:g))}},a=t&&setTimeout(()=>{a=null,e(new De(`timeout of ${t}ms exceeded`,De.ETIMEDOUT))},t),A=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(s=>{s.unsubscribe?s.unsubscribe(e):s.removeEventListener("abort",e)}),n=null)};n.forEach(s=>{if(!i){if(s.aborted){e.call(s);return}s.addEventListener("abort",e,{once:!0})}});let{signal:r}=o;return r.unsubscribe=()=>Z.asap(A),r},qq=JSe;var qSe=function*(n,t){let o=n.byteLength;if(!t||o{let e=zSe(n,t),a=0,A,r=s=>{A||(A=!0,i&&i(s))};return new ReadableStream({async pull(s){try{let{done:g,value:c}=await e.next();if(g){r(),s.close();return}let I=c.byteLength;if(o){let d=a+=I;o(d)}s.enqueue(new Uint8Array(c))}catch(g){throw r(g),g}},cancel(s){return r(s),e.return()}},{highWaterMark:2})};var zq=64*1024,{isFunction:Ry}=Z,WSe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16))),Vq=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},Wq=(n,...t)=>{try{return!!n(...t)}catch{return!1}},ZSe=n=>{let t=n.indexOf("://"),o=n;return t!==-1&&(o=o.slice(t+3)),o.includes("@")||o.includes(":")},XSe=n=>{let t=Z.global!==void 0&&Z.global!==null?Z.global:globalThis,{ReadableStream:o,TextEncoder:i}=t;n=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},n);let{fetch:e,Request:a,Response:A}=n,r=e?Ry(e):typeof fetch=="function",s=Ry(a),g=Ry(A);if(!r)return!1;let c=r&&Ry(o),I=r&&(typeof i=="function"?(m=>T=>m.encode(T))(new i):async m=>new Uint8Array(await new a(m).arrayBuffer())),d=s&&c&&Wq(()=>{let m=!1,T=new a(Bt.origin,{body:new o,method:"POST",get duplex(){return m=!0,"half"}}),_=T.headers.has("Content-Type");return T.body!=null&&T.body.cancel(),m&&!_}),B=g&&c&&Wq(()=>Z.isReadableStream(new A("").body)),f={stream:B&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(T,_)=>{let R=T&&T[m];if(R)return R.call(T);throw new De(`Response type '${m}' is not supported`,De.ERR_NOT_SUPPORT,_)})});let Q=async m=>{if(m==null)return 0;if(Z.isBlob(m))return m.size;if(Z.isSpecCompliantForm(m))return(await new a(Bt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(Z.isArrayBufferView(m)||Z.isArrayBuffer(m))return m.byteLength;if(Z.isURLSearchParams(m)&&(m=m+""),Z.isString(m))return(await I(m)).byteLength},y=async(m,T)=>{let _=Z.toFiniteNumber(m.getContentLength());return _??Q(T)};return async m=>{let{url:T,method:_,data:R,signal:K,cancelToken:L,timeout:F,onDownloadProgress:q,onUploadProgress:V,responseType:x,headers:G,withCredentials:J="same-origin",fetchOptions:U,maxContentLength:N,maxBodyLength:k}=Ny(m),z=Z.isNumber(N)&&N>-1,Ae=Z.isNumber(k)&&k>-1,ie=ve=>Z.hasOwnProp(m,ve)?m[ve]:void 0,we=e||fetch;x=x?(x+"").toLowerCase():"text";let se=qq([K,L&&L.toAbortSignal()],F),Te=null,fe=se&&se.unsubscribe&&(()=>{se.unsubscribe()}),ke,Re=null,We=()=>new De("Request body larger than maxBodyLength limit",De.ERR_BAD_REQUEST,m,Te);try{let ve,aA=ie("auth");if(aA){let Ze=Z.getSafeProp(aA,"username")||"",bA=Z.getSafeProp(aA,"password")||"";ve={username:Ze,password:bA}}if(ZSe(T)){let Ze=new URL(T,Bt.origin);if(!ve&&(Ze.username||Ze.password)){let bA=Vq(Ze.username),ue=Vq(Ze.password);ve={username:bA,password:ue}}(Ze.username||Ze.password)&&(Ze.username="",Ze.password="",T=Ze.href)}if(ve&&(G.delete("authorization"),G.set("Authorization","Basic "+btoa(WSe((ve.username||"")+":"+(ve.password||""))))),z&&typeof T=="string"&&T.startsWith("data:")&&ON(T)>N)throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te);if(Ae&&_!=="get"&&_!=="head"){let Ze=await Q(R);if(typeof Ze=="number"&&isFinite(Ze)&&(ke=Ze,Ze>k))throw We()}let Be=Ae&&(Z.isReadableStream(R)||Z.isStream(R)),Ie=(Ze,bA,ue)=>_N(Ze,zq,Ne=>{if(Ae&&Ne>k)throw Re=We();bA&&bA(Ne)},ue);if(d&&_!=="get"&&_!=="head"&&(V||Be)){if(ke=ke??await y(G,R),ke!==0||Be){let Ze=new a(T,{method:"POST",body:R,duplex:"half"}),bA;if(Z.isFormData(R)&&(bA=Ze.headers.get("content-type"))&&G.setContentType(bA),Ze.body){let[ue,Ne]=V&&ld(ke,Cg(pd(V)))||[];R=Ie(Ze.body,ue,Ne)}}}else if(Be&&!s&&c&&_!=="get"&&_!=="head")R=Ie(R);else if(Be&&s&&!d&&_!=="get"&&_!=="head")throw new De("Stream request bodies are not supported by the current fetch implementation",De.ERR_NOT_SUPPORT,m,Te);Z.isString(J)||(J=J?"include":"omit");let Xe=s&&"credentials"in a.prototype;if(Z.isFormData(R)){let Ze=G.getContentType();Ze&&/^multipart\/form-data/i.test(Ze)&&!/boundary=/i.test(Ze)&&G.delete("content-type")}G.set("User-Agent","axios/"+Eg,!1);let je={...U,signal:se,method:_.toUpperCase(),headers:ed(G.normalize()),body:R,duplex:"half",credentials:Xe?J:void 0};Te=s&&new a(T,je);let Oe=await(s?we(Te,U):we(T,je)),EA=Ht.from(Oe.headers);if(z){let Ze=Z.toFiniteNumber(EA.getContentLength());if(Ze!=null&&Ze>N)throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te)}let hA=B&&(x==="stream"||x==="response");if(B&&Oe.body&&(q||z||hA&&fe)){let Ze={};["status","statusText","headers"].forEach(Ke=>{Ze[Ke]=Oe[Ke]});let bA=Z.toFiniteNumber(EA.getContentLength()),[ue,Ne]=q&&ld(bA,Cg(pd(q),!0))||[],Ue=0,MA=Ke=>{if(z&&(Ue=Ke,Ue>N))throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te);ue&&ue(Ke)};Oe=new A(_N(Oe.body,zq,MA,()=>{Ne&&Ne(),fe&&fe()}),Ze)}x=x||"text";let iA=await f[Z.findKey(f,x)||"text"](Oe,m);if(z&&!B&&!hA){let Ze;if(iA!=null&&(typeof iA.byteLength=="number"?Ze=iA.byteLength:typeof iA.size=="number"?Ze=iA.size:typeof iA=="string"&&(Ze=typeof i=="function"?new i().encode(iA).byteLength:iA.length)),typeof Ze=="number"&&Ze>N)throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te)}return!hA&&fe&&fe(),await new Promise((Ze,bA)=>{cs(Ze,bA,{data:iA,headers:Ht.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:m,request:Te})})}catch(ve){if(fe&&fe(),se&&se.aborted&&se.reason instanceof De){let aA=se.reason;throw aA.config=m,Te&&(aA.request=Te),ve!==aA&&Object.defineProperty(aA,"cause",{__proto__:null,value:ve,writable:!0,enumerable:!1,configurable:!0}),aA}if(Re)throw Te&&!Re.request&&(Re.request=Te),Re;if(ve instanceof De)throw Te&&!ve.request&&(ve.request=Te),ve;if(ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)){let aA=new De("Network Error",De.ERR_NETWORK,m,Te,ve&&ve.response);throw Object.defineProperty(aA,"cause",{__proto__:null,value:ve.cause||ve,writable:!0,enumerable:!1,configurable:!0}),aA}throw De.from(ve,ve&&ve.code,m,Te,ve&&ve.response)}}},$Se=new Map,TN=n=>{let t=n&&n.env||{},{fetch:o,Request:i,Response:e}=t,a=[i,e,o],A=a.length,r=A,s,g,c=$Se;for(;r--;)s=a[r],g=c.get(s),g===void 0&&c.set(s,g=r?new Map:XSe(t)),c=g;return g},tsA=TN();var NN={http:Kq,xhr:Jq,fetch:{get:TN}};Z.forEach(NN,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(n,"adapterName",{__proto__:null,value:t})}});var Zq=n=>`- ${n}`,Awe=n=>Z.isFunction(n)||n===null||n===!1;function twe(n,t){n=Z.isArray(n)?n:[n];let{length:o}=n,i,e,a={};for(let A=0;A`adapter ${s} `+(g===!1?"is not supported by the environment":"is not available in the build")),r=o?A.length>1?`since : +`),questions:o}}function QBe(n,t){return new Promise((o,i)=>{if(n.controller.signal.aborted)return i(n.controller.signal.reason??Wp());let e=()=>{n.approvals.delete(t),i(n.controller.signal.reason??Wp())};n.controller.signal.addEventListener("abort",e,{once:!0}),n.approvals.set(t,{resolve(a){n.controller.signal.removeEventListener("abort",e),n.approvals.delete(t),o(a)}})})}var oy=class{#e;#A;#t;#r;#l;#o=new Map;#i=new Set;#a=new Set;#n=!1;#s={running:0,completed:0,failed:0,lastJobId:null,lastJobAt:null};constructor({config:t,transport:o,createHarness:i,logger:e=console,sleepImpl:a=hBe}){if(!t||!o||typeof i!="function")throw new TypeError("OfficeJobExecutor requires config, transport, and createHarness");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a}get status(){return structuredClone(this.#s)}offer(t){return this.#n||!n3.test(t)||this.#o.has(t)||this.#i.has(t)||this.#a.has(t)?!1:(this.#i.add(t),this.#p(),!0)}handleEvent(t){let o=Ai(t?.data?.jobId,80);if(!n3.test(o))return!1;if(t.type==="job.available")return this.offer(o);if(t.type==="job.cancel")return this.cancel(o);if(t.type==="approval.reply"){let i=this.#o.get(o),e=Ai(t.data?.approvalId,180),a=i?.approvals.get(e);return a?(a.resolve({decision:t.data?.decision==="approved"?"approved":"rejected",answer:Ai(t.data?.answer)}),!0):!1}return!1}cancel(t){this.#i.delete(t);let o=this.#o.get(t);return o?(o.cancelled=!0,o.controller.abort(Wp()),o.sessionId&&o.harness&&o.harness.rpc("session.cancel",{sessionId:o.sessionId,keepInbox:!0},1e4).catch(()=>{}),!0):!1}async close(){this.#n=!0,this.#i.clear();for(let t of this.#o.values())t.controller.abort(Wp());await Promise.allSettled([...this.#o.values()].map(t=>t.task))}#p(){for(;!this.#n&&this.#o.size0;){let t=this.#i.values().next().value;this.#i.delete(t);let o={controller:new AbortController,approvals:new Map,harness:null,sessionId:null,leaseToken:null,cancelled:!1,lastProgressAt:0,lastProgress:"",task:null};o.task=this.#c(t,o).finally(()=>{this.#o.delete(t),this.#s.running=this.#o.size,this.#p()}),this.#o.set(t,o),this.#s.running=this.#o.size,o.task.catch(i=>this.#r.warn?.("[dsh-im:office] Job task ended:",i.message))}}async#c(t,o){let i=o.controller.signal,e=null;try{let A=(await this.#A.getJob(t,{signal:i}))?.job;if(!A||A.id!==t)throw new Error("Office returned an invalid Job payload");let r=await this.#A.acceptJob(t,{signal:i});if(!Ai(r?.leaseToken,200))throw new Error("Office returned an invalid Job lease");o.leaseToken=r.leaseToken,e=this.#g(t,o);let s=this.#e.workspaces[A.workspaceAlias],g=this.#e.instructionPresets[A.instructionPreset];if(!s||!g){let I=new Error(w("Office Job \u5F15\u7528\u4E86\u672C\u673A\u672A\u914D\u7F6E\u7684 Workspace/Preset alias\u3002"));throw I.code="office-job-alias-invalid",I}o.harness=this.#t({workspace:s}),await this.#d(t,o,{kind:"status",message:w("\u5DF2\u9886\u53D6 Job\uFF0C\u51C6\u5907 Workspace alias\uFF1A{alias}",{alias:A.workspaceAlias})},!0),o.sessionId=await o.harness.createSession({signal:i,workspace:s}),await this.#d(t,o,{kind:"status",message:w("Harness Session \u5DF2\u521B\u5EFA\u3002"),sessionId:o.sessionId},!0);let c=await o.harness.ask(o.sessionId,BBe(A,g),{timeoutMs:30*6e4,signal:i,onUpdate:I=>this.#I(t,o,I),onInteraction:I=>this.#h(t,o,I),onInteractionResolved:I=>{let d=Ai(I?.interactionId,180);o.approvals.get(d)?.resolve({decision:"rejected",answer:""})}});if(i.aborted)throw i.reason??Wp();await this.#A.completeJob(t,o.leaseToken,{resultMarkdown:c,sessionId:o.sessionId},{signal:i}),this.#s.completed+=1,this.#C(t)}catch(a){if(!o.cancelled&&o.leaseToken&&(await this.#A.failJob(t,o.leaseToken,{error:uBe(a),...o.sessionId?{sessionId:o.sessionId}:{}}).catch(()=>{}),this.#s.failed+=1),a?.code==="office-job-conflict"||a?.code==="office-hook-unavailable"){this.#C(t);return}!o.cancelled&&!i.aborted&&this.#r.warn?.(`[dsh-im:office] Job ${t} failed:`,a.message)}finally{o.controller.abort(Wp()),await e?.catch(()=>{}),this.#s.lastJobId=t,this.#s.lastJobAt=new Date().toISOString()}}async#g(t,o){for(;!o.controller.signal.aborted;){try{await this.#l(EBe,void 0,{signal:o.controller.signal})}catch{return}try{await this.#A.renewJob(t,o.leaseToken,{signal:o.controller.signal})}catch(i){if(o.controller.signal.aborted)return;o.cancelled=!0,o.controller.abort(i),o.sessionId&&o.harness&&o.harness.rpc("session.cancel",{sessionId:o.sessionId,keepInbox:!0},1e4).catch(()=>{});return}try{let e=(await this.#A.getJob(t,{signal:o.controller.signal}))?.job?.approval;e&&(e.status==="approved"||e.status==="rejected")&&o.approvals.get(e.id)?.resolve({decision:e.status,answer:Ai(e.answer)})}catch(i){if(o.controller.signal.aborted)return;this.#r.warn?.(`[dsh-im:office] Job ${t} approval poll failed; will retry after the next renewal:`,i.message)}}}async#I(t,o,i){let e=i?.type==="tool"?w("\u6B63\u5728\u4F7F\u7528 {tool}\u2026",{tool:Ai(i.name,160)||w("Harness \u5DE5\u5177")}):Ai(i?.text,4e3);if(!e)return;let a=`${i.type}:${e}`;if(a===o.lastProgress)return;let A=Date.now();i.type==="text"&&A-o.lastProgressAt<1e3||(o.lastProgress=a,o.lastProgressAt=A,await this.#d(t,o,{kind:i.type==="tool"?"tool":i.type==="text"?"text":"status",message:e,...o.sessionId?{sessionId:o.sessionId}:{}}))}#d(t,o,i,e=!1){let a=this.#A.progressJob(t,o.leaseToken,i,{signal:o.controller.signal});return e?a:a.catch(A=>{this.#r.debug?.("[dsh-im:office] ignored a progress delivery failure:",A.message)})}async#h(t,o,i){let e=fBe(i);if(!e){i?.kind==="approval"&&typeof i.respond=="function"&&await i.respond({ok:!0,value:{sessionId:i.sessionId,approvalId:i.payload?.approvalId,outcome:"rejected"}});return}let a=QBe(o,e.id);try{await this.#A.requestApproval(t,o.leaseToken,e,{signal:o.controller.signal});let A=await a;if(e.kind==="approval"){await i.respond({ok:!0,value:{sessionId:i.sessionId,approvalId:i.payload.approvalId,outcome:A.decision==="approved"?"allowed-once":"rejected"}});return}if(A.decision!=="approved"){await i.respond({ok:!1,error:{code:"cancelled",message:"The AI Office user rejected this question.",details:{}}});return}let r=Ai(A.answer).split(/\r?\n/);await i.respond({ok:!0,value:{sessionId:i.sessionId,answer:{answers:e.questions.map((s,g)=>wi(s,r[g]||r[0]||""))}}})}catch(A){throw o.approvals.delete(e.id),A}}#C(t){this.#a.add(t),!(this.#a.size<=CBe)&&this.#a.delete(this.#a.values().next().value)}};var s3=Object.freeze([1e3,3e3,1e4,3e4]);function mBe(n){let t=typeof n?.code=="string"?n.code:"office-connection-failed",o={"invalid-device-token":w("AI Office \u62D2\u7EDD\u4E86 Device Token\u3002"),"office-hook-unavailable":w("AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002"),"office-protocol-mismatch":w("AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002"),"office-transport-failed":w("\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002")};return{code:t,message:o[t]??w("AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002")}}var Zp=class{#e;#A;#t;#r;#l;#o=null;#i=null;#a;#n;constructor({config:t,token:o,logger:i=console,transport:e,createHarness:a,jobExecutor:A,sleepImpl:r=yBe}){this.#e=t,this.#A=o,this.#t=i,this.#l=r,this.#r=e??new iy({baseUrl:t.baseUrl,deviceId:t.deviceId,token:o}),this.#a={state:"idle",connected:!1,startedAt:null,lastHeartbeatAt:null,lastEventAt:null,lastEventId:null,lastEventType:null,reconnects:0,jobsOffered:0,error:null},this.#n=A??(a?new oy({config:t,transport:this.#r,createHarness:a,logger:i}):null)}get status(){return structuredClone({...this.#a,...this.#n?{jobs:this.#n.status}:{}})}capabilities(){return{protocolVersion:Jp,deviceId:this.#e.deviceId,workspaces:Object.keys(this.#e.workspaces),instructionPresets:Object.keys(this.#e.instructionPresets),maxConcurrency:this.#e.maxConcurrency}}async testConnection(t){return await this.#r.heartbeat({...this.capabilities(),probe:!0},{signal:t}),{ok:!0}}start(){return this.#i?this.status:(this.#o=new AbortController,this.#a.startedAt=new Date().toISOString(),this.#a.state="connecting",this.#i=this.#s(this.#o.signal).finally(()=>{this.#i=null}),this.#i.catch(t=>{this.#o?.signal.aborted||this.#t.error?.("[dsh-im:office] connector stopped:",t)}),this.status)}async#s(t){let o=0;for(;!t.aborted;){let i=new AbortController,e=AbortSignal.any([t,i.signal]);try{let a=await this.#r.heartbeat(this.capabilities(),{signal:e});this.#c(a?.jobs),this.#a.lastHeartbeatAt=new Date().toISOString();let A=!1,r=this.#p(e,()=>{A&&!e.aborted&&(o=0)}),s=this.#r.stream({signal:e,lastEventId:this.#a.lastEventId,onOpen:()=>{this.#a.connected=!0,this.#a.state="connected",this.#a.error=null,A=!0},onEvent:async g=>{this.#a.lastEventAt=new Date().toISOString(),this.#a.lastEventId=g.id??this.#a.lastEventId,this.#a.lastEventType=g.type,g.type==="job.available"&&(this.#a.jobsOffered+=1),this.#n?.handleEvent(g)}});await Promise.race([s,r])}catch(a){if(t.aborted)break;i.abort(),this.#a.connected=!1,this.#a.state="reconnecting",this.#a.error=mBe(a),this.#a.reconnects+=1;let A=s3[Math.min(o,s3.length-1)];o+=1;try{await this.#l(A,void 0,{signal:t})}catch{break}}finally{i.abort()}}this.#a.connected=!1,this.#a.state="idle"}async#p(t,o){for(;!t.aborted;){await this.#l(this.#e.heartbeatSeconds*1e3,void 0,{signal:t});let i=await this.#r.heartbeat(this.capabilities(),{signal:t});this.#c(i?.jobs),this.#a.lastHeartbeatAt=new Date().toISOString(),o?.()}}#c(t){if(Array.isArray(t))for(let o of t)typeof o?.id=="string"&&this.#n?.offer(o.id)&&(this.#a.jobsOffered+=1)}async stop(){let t=this.#i;return this.#o?.abort(),this.#o=null,t&&await t.catch(()=>{}),await this.#n?.close(),this.#a.connected=!1,this.#a.state="idle",this.status}};function tT(n){return typeof n=="string"&&n.trim()?n.trim():null}function wBe(n,t){return`DSH_OFFICE_DEVICE_TOKEN_${SBe("sha256").update(`${n} +${t}`).digest("hex").slice(0,24).toUpperCase()}`}var ny=class{#e;#A;#t;#r;#l=null;#o=Promise.resolve();constructor({credentials:t,configStore:o,logger:i=console,createRuntime:e}){if(!t?.resolve||!t?.set||!t?.unset)throw new TypeError("AI Office requires the Harness credential provider");if(!o?.get||!o?.save||!o?.clear)throw new TypeError("AI Office requires a config store");this.#e=t,this.#A=o,this.#t=i,this.#r=e??(a=>new Zp(a))}async initialize(){let t=this.#A.get();if(t){let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{});o?.value&&await this.#a(t,o.value)}return this.status()}async configure(t={}){return this.#s(async()=>{let o=this.#A.get(),i=tT(t.baseUrl),e=tT(t.deviceId);if(!i||!e)throw new TypeError("Office URL and Device ID are required");let a=nC(i).origin,A=wBe(a,e),r=tT(t.deviceToken),s=await this.#e.resolve(A).catch(()=>{}),g=r??s?.value;if(!g||g.length<32)throw new TypeError("Device Token must contain at least 32 characters");let c=new Date().toISOString(),I=ry({version:1,baseUrl:a,deviceId:e,deviceTokenRef:A,maxConcurrency:t.maxConcurrency,heartbeatSeconds:t.heartbeatSeconds,workspaces:t.workspaces,instructionPresets:t.instructionPresets,createdAt:o?.createdAt??c,updatedAt:c});if(!I)throw new TypeError("AI Office connector configuration is invalid");await this.#e.set(A,g);try{await this.#A.save(I)}catch(d){throw s?.value?await this.#e.set(A,s.value).catch(()=>{}):await this.#e.unset(A).catch(()=>{}),d}return o?.deviceTokenRef&&o.deviceTokenRef!==A&&await this.#e.unset(o.deviceTokenRef).catch(()=>{}),await this.#a(I,g),this.status()})}async reconnect(){return this.#s(async()=>{let t=this.#A.get();if(!t)throw new Error("AI Office connector is not configured");return await this.#a(t),this.status()})}async test(){let t=this.#A.get();if(!t)throw new Error("AI Office connector is not configured");let o=await this.#i(t),i=this.#r({config:t,token:o,logger:this.#t});try{await i.testConnection(AbortSignal.timeout(1e4))}finally{await i.stop().catch(()=>{})}return{tested:!0,snapshot:await this.status()}}async remove(){return this.#s(async()=>{let t=this.#A.get();return await this.#n(),t?.deviceTokenRef&&await this.#e.unset(t.deviceTokenRef).catch(()=>{}),await this.#A.clear(),this.status()})}async status(){let t=this.#A.get();if(!t)return{schemaVersion:1,configured:!1,connected:!1,state:"unconfigured"};let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{}),i=this.#l?.status??null;return{schemaVersion:1,configured:!0,connected:i?.connected===!0,state:i?.state??(o?.value?"idle":"missing-token"),config:{protocolVersion:t.protocolVersion,baseUrl:t.baseUrl,deviceId:t.deviceId,maxConcurrency:t.maxConcurrency,heartbeatSeconds:t.heartbeatSeconds,workspaces:t.workspaces,instructionPresets:t.instructionPresets,hooks:ty(t.baseUrl)},health:i,tokenConfigured:!!o?.value}}async close(){await this.#o.catch(()=>{}),await this.#n()}async#i(t){let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{});if(!o?.value)throw new Error("AI Office Device Token is missing");return o.value}async#a(t,o){await this.#n();let i=o??await this.#i(t),e=this.#r({config:t,token:i,logger:this.#t});this.#l=e,e.start()}async#n(){let t=this.#l;this.#l=null,t&&await t.stop()}#s(t){let o=this.#o.then(t,t);return this.#o=o.then(()=>{},()=>{}),o}};function OBe(n={}){let t=aT(n.dshHome??process.env.DSH_HOME??rT(DBe(),".dsh")),o=aT(n.dataDir??rT(t,"integrations","dsh-office"));return{root:o,config:aT(n.configPath??rT(o,"config.json"))}}async function g3(n,t={},o={}){let i=aa(n,t),e=o.ConfigStore??ay,a=o.Controller??ny,A=o.Runtime??Zp,r=o.HarnessClient??ur,s=OBe(t),g=await new e(s.config).load(),c=typeof n.logger=="function"?n.logger("dsh-im:office"):n.logger??console,I=o.createHarness??(({workspace:B})=>new r({...i,workspace:B,autostart:!1,dshBin:t.dshBin??"dsh",rpcIdPrefix:"office",logPrefix:"dsh-im:office"})),d=new a({credentials:n.credentials,configStore:g,logger:c,createRuntime:B=>new A({...B,createHarness:I,...o.transport?{transport:o.transport}:{}})});return await d.initialize(),{controller:d,close:()=>d.close(),paths:s}}function iT(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function sC(n,t){return iT(n)&&Object.keys(n).every(o=>t.includes(o))}function bBe(n){return sC(n,["baseUrl","deviceId","deviceToken","maxConcurrency","heartbeatSeconds","workspaces","instructionPresets"])&&typeof n.baseUrl=="string"&&typeof n.deviceId=="string"&&(n.deviceToken===void 0||typeof n.deviceToken=="string")&&iT(n.workspaces)&&iT(n.instructionPresets)}function MBe(n){for(let t of["status","configure","reconnect","test","remove"])if(typeof n?.[t]!="function")throw new TypeError(`AI Office controller requires ${t}()`);return async(t,o,i)=>{if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};try{let e;if(t===qp.status&&sC(o,[]))e=await n.status();else if(t===qp.configure&&bBe(o))e=await n.configure(o);else if(t===qp.reconnect&&sC(o,[]))e=await n.reconnect();else if(t===qp.test&&sC(o,[]))e=await n.test();else if(t===qp.remove&&sC(o,["confirm"])&&o.confirm===!0)e=await n.remove();else return{ok:!1,error:{code:"bad-request",message:"Invalid AI Office connector request."}};return{ok:!0,value:e}}catch(e){let a=e?.code==="invalid-device-token"?"invalid-device-token":e?.code==="office-hook-unavailable"?"office-hook-unavailable":"office-operation-failed",A=a==="invalid-device-token"?"AI Office Device Token \u65E0\u6548\u3002":a==="office-hook-unavailable"?"AI Office Hook \u5C1A\u672A\u4E0A\u7EBF\u6216\u5730\u5740\u4E0D\u6B63\u786E\u3002":e instanceof TypeError?e.message:"AI Office \u8FDE\u63A5\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";return{ok:!1,error:{code:a,message:A}}}}}function oT(n,t,o){return n.connection.rpc.handle(i3,MBe(t),{authority:fr(o)})}async function c3(n,t={}){if(t.controller)return oT(n,t.controller,t.rpcAuthority);let o=await g3(n,t,t.internals??{}),i=oT(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>o.close(),"dsh-im: close AI Office connector"),i}var _Be=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]);function TBe(n){let t=n?.client_id??n?.appId,o=n?.client_secret??n?.appSecret;if(typeof t!="string"||t.length===0||typeof o!="string"||o.length===0)throw new TypeError("Feishu registration returned invalid credentials");return{appId:t,appSecret:o,userInfo:n?.user_info??n?.userInfo}}async function NBe(n){return typeof n.status!="function"?{}:await n.status()}function RBe(n){return n?.connected===!0?!0:n?.ready===!0&&n?.feishuLongConnectionState==="connected"&&n?.harnessReachable===!0}var sy=class{#e;#A;#t;#r;#l=!1;#o=null;constructor({createProvisioningManager:t,credentialStore:o,connectionManager:i,registrationOptions:e={}}={}){if(typeof t!="function")throw new TypeError("createProvisioningManager is required");if(!o||typeof o.save!="function"||typeof o.clear!="function")throw new TypeError("credentialStore.save/clear are required");if(!i||typeof i.connect!="function"||typeof i.disconnect!="function")throw new TypeError("connectionManager.connect/disconnect are required");if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("registrationOptions must be an object");if(this.#e=o,this.#A=i,this.#t=structuredClone(e),this.#r=t({onCredentials:a=>this.#i(a)}),!this.#r||typeof this.#r.start!="function"||typeof this.#r.status!="function"||typeof this.#r.cancel!="function")throw new TypeError("The provisioning manager must implement start/status/cancel")}async startRegistration(){return this.#o=null,await this.#r.start(structuredClone(this.#t)),this.status()}async cancelRegistration(){return await this.#r.cancel(),this.status()}async disconnect(){await this.#r.cancel(),await this.#A.disconnect();try{await this.#e.clear(),this.#l=!1,this.#o=null}catch{this.#o={code:"credential_removal_failed",message:"Unable to remove the Feishu credentials."}}return this.status()}async status(){let t=await this.#r.status(),o=await NBe(this.#A),i=RBe(o),e=this.#l;if(typeof this.#e.configured=="function")try{e=await this.#e.configured()}catch{e=this.#l}let a="unconfigured";return i?a="connected":_Be.has(t?.state)?a="registering":t?.state==="saving"?a="connecting":this.#o||t?.state==="error"?a="error":e&&(a="disconnected"),{phase:a,connected:i,configured:e,registration:t,connection:o,error:this.#o??t?.error??null}}async close(){await this.#r.cancel(),await this.#A.disconnect()}async#i(t){let o=TBe(t);try{await this.#e.save(o),this.#l=!0,await this.#A.connect(o),this.#o=null}catch{throw this.#o={code:"connection_failed",message:"The bot was created, but its connection could not be started."},new Error("Unable to activate the Feishu connection.")}}};function nT(n){return new sy(n)}import{homedir as ove}from"node:os";import{join as jd,resolve as kc}from"node:path";import{unlink as nve}from"node:fs/promises";var rP={};Fr(rP,{AESCipher:()=>fu,AccessTokenError:()=>Fd,Aily:()=>Rv,AppType:()=>us,CAppTicket:()=>Bu,CTenantAccessToken:()=>du,CardActionHandler:()=>Mv,Client:()=>Ym,ClientAssertionError:()=>ri,DefaultCache:()=>Hm,Domain:()=>Bs,EventDispatcher:()=>Jm,LarkChannel:()=>Xm,LarkChannelError:()=>Lt,LoggerLevel:()=>co,LoggerProxy:()=>Tc,WSClient:()=>zm,adaptDefault:()=>mNe,adaptExpress:()=>SNe,adaptKoa:()=>wNe,adaptKoaRouter:()=>DNe,createLarkChannel:()=>cRe,defaultHttpInstance:()=>Ld,defaultLogger:()=>Mg,generateChallenge:()=>yu,internalCache:()=>Qu,messageCard:()=>bNe,normalize:()=>ZW,normalizeBotAdded:()=>VW,normalizeCardAction:()=>zW,normalizeComment:()=>WW,normalizeReaction:()=>Jv,registerApp:()=>LNe,withAll:()=>CNe,withHelpDeskCredential:()=>BNe,withTenantKey:()=>uNe,withTenantToken:()=>fNe,withUserAccessToken:()=>QNe});function gC(n,t){return function(){return n.apply(t,arguments)}}var{toString:kBe}=Object.prototype,{getPrototypeOf:Xp}=Object,{iterator:IC,toStringTag:p3}=Symbol,cy=(({hasOwnProperty:n})=>(t,o)=>n.call(t,o))(Object.prototype),cC=(n,t)=>{let o=n,i=[];for(;o!=null&&o!==Object.prototype;){if(i.indexOf(o)!==-1)return!1;if(i.push(o),cy(o,t))return!0;o=Xp(o)}return!1},vBe=(n,t)=>n!=null&&cC(n,t)?n[t]:void 0,gT=(n=>t=>{let o=kBe.call(t);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Po=n=>(n=n.toLowerCase(),t=>gT(t)===n),Iy=n=>t=>typeof t===n,{isArray:xI}=Array,YI=Iy("undefined");function $p(n){return n!==null&&!YI(n)&&n.constructor!==null&&!YI(n.constructor)&&Gi(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var d3=Po("ArrayBuffer");function PBe(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&d3(n.buffer),t}var GBe=Iy("string"),Gi=Iy("function"),h3=Iy("number"),ed=n=>n!==null&&typeof n=="object",FBe=n=>n===!0||n===!1,gy=n=>{if(!ed(n))return!1;let t=Xp(n);return(t===null||t===Object.prototype||Xp(t)===null)&&!cC(n,p3)&&!cC(n,IC)},LBe=n=>{if(!ed(n)||$p(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},UBe=Po("Date"),HBe=Po("File"),KBe=n=>!!(n&&typeof n.uri<"u"),xBe=n=>n&&typeof n.getParts<"u",YBe=Po("Blob"),jBe=Po("FileList"),JBe=Po("Set"),qBe=n=>ed(n)&&Gi(n.pipe);function zBe(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var I3=zBe(),l3=typeof I3.FormData<"u"?I3.FormData:void 0,VBe=n=>{if(!n)return!1;if(l3&&n instanceof l3)return!0;let t=Xp(n);if(!t||t===Object.prototype||!Gi(n.append))return!1;let o=gT(n);return o==="formdata"||o==="object"&&Gi(n.toString)&&n.toString()==="[object FormData]"},WBe=Po("URLSearchParams"),[ZBe,XBe,$Be,efe]=["ReadableStream","Request","Response","Headers"].map(Po),Afe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lC(n,t,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let i,e;if(typeof n!="object"&&(n=[n]),xI(n))for(i=0,e=n.length;i0;)if(e=o[i],t===e.toLowerCase())return e;return null}var KI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,C3=n=>!YI(n)&&n!==KI;function sT(...n){let{caseless:t,skipUndefined:o}=C3(this)&&this||{},i={},e=(a,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")return;let r=t&&typeof A=="string"&&E3(i,A)||A,s=cy(i,r)?i[r]:void 0;gy(s)&&gy(a)?i[r]=sT(s,a):gy(a)?i[r]=sT({},a):xI(a)?i[r]=a.slice():(!o||!YI(a))&&(i[r]=a)};for(let a=0,A=n.length;a(lC(t,(e,a)=>{o&&Gi(e)?Object.defineProperty(n,a,{__proto__:null,value:gC(e,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,a,{__proto__:null,value:e,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),n),rfe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),afe=(n,t,o,i)=>{n.prototype=Object.create(t.prototype,i),Object.defineProperty(n.prototype,"constructor",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(n.prototype,o)},ife=(n,t,o,i)=>{let e,a,A,r={};if(t=t||{},n==null)return t;do{for(e=Object.getOwnPropertyNames(n),a=e.length;a-- >0;)A=e[a],(!i||i(A,n,t))&&!r[A]&&(t[A]=n[A],r[A]=!0);n=o!==!1&&Xp(n)}while(n&&(!o||o(n,t))&&n!==Object.prototype);return t},ofe=(n,t,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=t.length;let i=n.indexOf(t,o);return i!==-1&&i===o},nfe=n=>{if(!n)return null;if(xI(n))return n;let t=n.length;if(!h3(t))return null;let o=new Array(t);for(;t-- >0;)o[t]=n[t];return o},sfe=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Xp(Uint8Array)),gfe=(n,t)=>{let i=(n&&n[IC]).call(n),e;for(;(e=i.next())&&!e.done;){let a=e.value;t.call(n,a[0],a[1])}},cfe=(n,t)=>{let o,i=[];for(;(o=n.exec(t))!==null;)i.push(o);return i},Ife=Po("HTMLFormElement"),lfe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,i,e){return i.toUpperCase()+e}),{propertyIsEnumerable:pfe}=Object.prototype,dfe=Po("RegExp"),u3=(n,t)=>{let o=Object.getOwnPropertyDescriptors(n),i={};lC(o,(e,a)=>{let A;(A=t(e,a,n))!==!1&&(i[a]=A||e)}),Object.defineProperties(n,i)},hfe=n=>{u3(n,(t,o)=>{if(Gi(n)&&["arguments","caller","callee"].includes(o))return!1;let i=n[o];if(Gi(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},Efe=(n,t)=>{let o={},i=e=>{e.forEach(a=>{o[a]=!0})};return xI(n)?i(n):i(String(n).split(t)),o},Cfe=()=>{},ufe=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Bfe(n){return!!(n&&Gi(n.append)&&n[p3]==="FormData"&&n[IC])}var ffe=n=>{let t=new WeakSet,o=i=>{if(ed(i)){if(t.has(i))return;if($p(i))return i;if(!("toJSON"in i)){t.add(i);let e;if(JBe(i)){e=[];for(let a of i){let A=o(a);!YI(A)&&e.push(A)}}else e=xI(i)?[]:{},lC(i,(a,A)=>{let r=o(a);!YI(r)&&(e[A]=r)});return t.delete(i),e}}return i};return o(n)},Qfe=Po("AsyncFunction"),yfe=n=>n&&(ed(n)||Gi(n))&&Gi(n.then)&&Gi(n.catch),B3=((n,t)=>n?setImmediate:t?((o,i)=>(KI.addEventListener("message",({source:e,data:a})=>{e===KI&&a===o&&i.length&&i.shift()()},!1),e=>{i.push(e),KI.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",Gi(KI.postMessage)),mfe=typeof queueMicrotask<"u"?queueMicrotask.bind(KI):typeof process<"u"&&process.nextTick||B3,f3=n=>n!=null&&Gi(n[IC]),Sfe=n=>n!=null&&cC(n,IC)&&f3(n),Z={isArray:xI,isArrayBuffer:d3,isBuffer:$p,isFormData:VBe,isArrayBufferView:PBe,isString:GBe,isNumber:h3,isBoolean:FBe,isObject:ed,isPlainObject:gy,isEmptyObject:LBe,isReadableStream:ZBe,isRequest:XBe,isResponse:$Be,isHeaders:efe,isUndefined:YI,isDate:UBe,isFile:HBe,isReactNativeBlob:KBe,isReactNative:xBe,isBlob:YBe,isRegExp:dfe,isFunction:Gi,isStream:qBe,isURLSearchParams:WBe,isTypedArray:sfe,isFileList:jBe,forEach:lC,merge:sT,extend:tfe,trim:Afe,stripBOM:rfe,inherits:afe,toFlatObject:ife,kindOf:gT,kindOfTest:Po,endsWith:ofe,toArray:nfe,forEachEntry:gfe,matchAll:cfe,isHTMLForm:Ife,hasOwnProperty:cy,hasOwnProp:cy,hasOwnInPrototypeChain:cC,getSafeProp:vBe,reduceDescriptors:u3,freezeMethods:hfe,toObjectSet:Efe,toCamelCase:lfe,noop:Cfe,toFiniteNumber:ufe,findKey:E3,global:KI,isContextDefined:C3,isSpecCompliantForm:Bfe,toJSONObject:ffe,isAsyncFn:Qfe,isThenable:yfe,setImmediate:B3,asap:mfe,isIterable:f3,isSafeIterable:Sfe};var wfe=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Q3=n=>{let t={},o,i,e;return n&&n.split(` +`).forEach(function(A){e=A.indexOf(":"),o=A.substring(0,e).trim().toLowerCase(),i=A.substring(e+1).trim();let r=Z.hasOwnProp(t,o);!o||r&&Z.hasOwnProp(wfe,o)||(o==="set-cookie"?r?t[o].push(i):t[o]=[i]:t[o]=r?t[o]+", "+i:i)}),t};function Dfe(n){let t=0,o=n.length;for(;tt;){let i=n.charCodeAt(o-1);if(i!==9&&i!==32)break;o-=1}return t===0&&o===n.length?n:n.slice(t,o)}var Ofe=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),bfe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function cT(n,t){return Z.isArray(n)?n.map(o=>cT(o,t)):Dfe(String(n).replace(t,""))}var y3=n=>cT(n,Ofe),Mfe=n=>cT(n,bfe);function Ad(n){let t=Object.create(null);return Z.forEach(n.toJSON(),(o,i)=>{t[i]=Mfe(o)}),t}var m3=Symbol("internals");function pC(n){return n&&String(n).trim().toLowerCase()}function ly(n){return n===!1||n==null?n:Z.isArray(n)?n.map(ly):y3(String(n))}function _fe(n){let t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=o.exec(n);)t[i[1]]=i[2];return t}var Tfe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function IT(n){let t=0,o=n.length;for(;tt;){let i=n.charCodeAt(o-1);if(i!==9&&i!==32)break;o-=1}return t===0&&o===n.length?n:n.slice(t,o)}function Nfe(n){let t=n.length-1;if(t<1||n.charCodeAt(0)!==34||n.charCodeAt(t)!==34)return n;let o="";for(let i=1;i=t))return n;o+=n[i]}return o}function Rfe(n){let t=Object.create(null),o=String(n),i=0,e=!1,a=!1;function A(r){let s=IT(o.slice(i,r)),g=s.indexOf("=");if(g<1)return;let c=IT(s.slice(0,g));if(!Tfe.test(c))return;let I=c.toLowerCase();if(I==="__proto__"||I==="constructor"||I==="prototype")return;let d=IT(s.slice(g+1));t[I]=Nfe(d)}for(let r=0;r/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function lT(n,t,o,i,e){if(Z.isFunction(i))return i.call(this,t,o);if(e&&(t=o),!!Z.isString(t)){if(Z.isString(i))return t.indexOf(i)!==-1;if(Z.isRegExp(i))return i.test(t)}}function vfe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,o,i)=>o.toUpperCase()+i)}function Pfe(n,t){let o=Z.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+o,{__proto__:null,value:function(e,a,A){return this[i].call(this,t,e,a,A)},configurable:!0})})}var td=class{constructor(t){t&&this.set(t)}set(t,o,i){let e=this;function a(r,s,g){let c=pC(s);if(!c)return;let I=Z.findKey(e,c);(!I||e[I]===void 0||g===!0||g===void 0&&e[I]!==!1)&&(e[I||s]=ly(r))}let A=(r,s)=>Z.forEach(r,(g,c)=>a(g,c,s));if(Z.isPlainObject(t)||t instanceof this.constructor)A(t,o);else if(Z.isString(t)&&(t=t.trim())&&!kfe(t))A(Q3(t),o);else if(Z.isObject(t)&&Z.isSafeIterable(t)){let r=Object.create(null),s,g;for(let c of t){if(!Z.isArray(c))throw new TypeError("Object iterator must return a key-value pair");g=c[0],Z.hasOwnProp(r,g)?(s=r[g],r[g]=Z.isArray(s)?[...s,c[1]]:[s,c[1]]):r[g]=c[1]}A(r,o)}else t!=null&&a(o,t,i);return this}get(t,o){if(t=pC(t),t){let i=Z.findKey(this,t);if(i){let e=this[i];if(!o)return e;if(o===!0)return _fe(e);if(Z.isFunction(o))return o.call(this,e,i);if(Z.isRegExp(o))return o.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,o){if(t=pC(t),t){let i=Z.findKey(this,t);return!!(i&&this[i]!==void 0&&(!o||lT(this,this[i],i,o)))}return!1}delete(t,o){let i=this,e=!1;function a(A){if(A=pC(A),A){let r=Z.findKey(i,A);r&&(!o||lT(i,i[r],r,o))&&(delete i[r],e=!0)}}return Z.isArray(t)?t.forEach(a):a(t),e}clear(t){let o=Object.keys(this),i=o.length,e=!1;for(;i--;){let a=o[i];(!t||lT(this,this[a],a,t,!0))&&(delete this[a],e=!0)}return e}normalize(t){let o=this,i={};return Z.forEach(this,(e,a)=>{let A=Z.findKey(i,a);if(A){o[A]=ly(e),delete o[a];return}let r=t?vfe(a):String(a).trim();r!==a&&delete o[a],o[r]=ly(e),i[r]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let o=Object.create(null);return Z.forEach(this,(i,e)=>{i!=null&&i!==!1&&(o[e]=t&&Z.isArray(i)?i.join(", "):i)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,o])=>t+": "+o).join(` +`)}getSetCookie(){let t=this.get("set-cookie");return Z.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Rfe(t)}static concat(t,...o){let i=new this(t);return o.forEach(e=>i.set(e)),i}static accessor(t){let i=(this[m3]=this[m3]={accessors:{}}).accessors,e=this.prototype;function a(A){let r=pC(A);i[r]||(Pfe(e,A),i[r]=!0)}return Z.isArray(t)?t.forEach(a):a(t),this}};td.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Z.reduceDescriptors(td.prototype,({value:n},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(i){this[o]=i}}});Z.freezeMethods(td);var Ht=td;var dC="[REDACTED ****]";function Gfe(n){if(Z.hasOwnProp(n,"toJSON"))return!0;let t=Object.getPrototypeOf(n);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Ffe(n,t){let o=new Set(t.map(a=>String(a).toLowerCase())),i=[],e=a=>{if(a===null||typeof a!="object"||Z.isBuffer(a))return a;if(i.indexOf(a)!==-1)return;a instanceof Ht&&(a=a.toJSON()),i.push(a);let A;if(Z.isArray(a))A=[],a.forEach((r,s)=>{let g=e(r);Z.isUndefined(g)||(A[s]=g)});else{if(!Z.isPlainObject(a)&&Gfe(a))return i.pop(),a;A=Object.create(null);for(let[r,s]of Object.entries(a)){let g=o.has(r.toLowerCase())?dC:e(s);Z.isUndefined(g)||(A[r]=g)}}return i.pop(),A};return e(n)}function S3(n){try{return String(n)}catch{return""}}function Lfe(n){return n.errors.map(o=>{try{return o&&o.message?S3(o.message):S3(o)}catch{return""}}).filter(Boolean).join("; ")||n.name||"AggregateError"}var fa=class n extends Error{static from(t,o,i,e,a,A){let r=t.message;!r&&Z.isArray(t.errors)&&t.errors.length&&(r=Lfe(t));let s=new n(r,o||t.code,i,e,a);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),A&&Object.assign(s,A),s}constructor(t,o,i,e,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),i&&(this.config=i),e&&(this.request=e),a&&(this.response=a,this.status=a.status)}toJSON(){let t=this.config,o=t&&Z.hasOwnProp(t,"redact")?t.redact:void 0,i=Z.isArray(o)&&o.length>0?Ffe(t,o):Z.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}};fa.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";fa.ERR_BAD_OPTION="ERR_BAD_OPTION";fa.ECONNABORTED="ECONNABORTED";fa.ETIMEDOUT="ETIMEDOUT";fa.ECONNREFUSED="ECONNREFUSED";fa.ERR_NETWORK="ERR_NETWORK";fa.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";fa.ERR_DEPRECATED="ERR_DEPRECATED";fa.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";fa.ERR_BAD_REQUEST="ERR_BAD_REQUEST";fa.ERR_CANCELED="ERR_CANCELED";fa.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";fa.ERR_INVALID_URL="ERR_INVALID_URL";fa.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var De=fa;var DJ=qe(wJ(),1),yy=DJ.default;var my={isBufferAvailable(){return typeof Buffer<"u"},from(n){return Buffer.from(n)}};var PT=100;function vT(n){return Z.isPlainObject(n)||Z.isArray(n)}function OJ(n){return Z.endsWith(n,"[]")?n.slice(0,-2):n}function kT(n,t,o){return n?n.concat(t).map(function(e,a){return e=OJ(e),!o&&a?"["+e+"]":e}).join(o?".":""):t}function Sye(n){return Z.isArray(n)&&!n.some(vT)}var wye=Z.toFlatObject(Z,{},null,function(t){return/^is[A-Z]/.test(t)});function Dye(n,t,o){if(!Z.isObject(n))throw new TypeError("target must be an object");t=t||new(yy||FormData),o=Z.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,_){return!Z.isUndefined(_[T])});let i=o.metaTokens,e=o.visitor||f,a=o.dots,A=o.indexes,r=o.Blob||typeof Blob<"u"&&Blob,s=o.maxDepth===void 0?PT:o.maxDepth,g=r&&Z.isSpecCompliantForm(t),c=[];if(!Z.isFunction(e))throw new TypeError("visitor must be a function");function I(m){if(m===null)return"";if(Z.isDate(m))return m.toISOString();if(Z.isBoolean(m))return m.toString();if(!g&&Z.isBlob(m))throw new De("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(m)||Z.isTypedArray(m)){if(g&&typeof r=="function")return new r([m]);if(my&&my.isBufferAvailable())return my.from(m);throw new De("Blob is not supported. Use a Buffer instead.",De.ERR_NOT_SUPPORT)}return m}function d(m){if(m>s)throw new De("Object is too deeply nested ("+m+" levels). Max depth: "+s,De.ERR_FORM_DATA_DEPTH_EXCEEDED)}function B(m,T){if(s===1/0)return JSON.stringify(m);let _=[];return JSON.stringify(m,function(K,L){if(!Z.isObject(L))return L;for(;_.length&&_[_.length-1]!==this;)_.pop();return _.push(L),d(T+_.length-1),L})}function f(m,T,_){let R=m;if(Z.isReactNative(t)&&Z.isReactNativeBlob(m))return t.append(kT(_,T,a),I(m)),!1;if(m&&!_&&typeof m=="object"){if(Z.endsWith(T,"{}"))T=i?T:T.slice(0,-2),m=B(m,1);else if(Z.isArray(m)&&Sye(m)||(Z.isFileList(m)||Z.endsWith(T,"[]"))&&(R=Z.toArray(m)))return T=OJ(T),R.forEach(function(L,F){!(Z.isUndefined(L)||L===null)&&t.append(A===!0?kT([T],F,a):A===null?T:T+"[]",I(L))}),!1}return vT(m)?!0:(t.append(kT(_,T,a),I(m)),!1)}let Q=Object.assign(wye,{defaultVisitor:f,convertValue:I,isVisitable:vT});function y(m,T,_=0){if(!Z.isUndefined(m)){if(d(_),c.indexOf(m)!==-1)throw new Error("Circular reference detected in "+T.join("."));c.push(m),Z.forEach(m,function(K,L){(!(Z.isUndefined(K)||K===null)&&e.call(t,K,Z.isString(L)?L.trim():L,T,Q))===!0&&y(K,T?T.concat(L):[L],_+1)}),c.pop()}}if(!Z.isObject(n))throw new TypeError("data must be an object");return y(n),t}var uc=Dye;function bJ(n){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(n).replace(/[!'()~]|%20/g,function(i){return t[i]})}function MJ(n,t){this._pairs=[],n&&uc(n,this,t)}var _J=MJ.prototype;_J.append=function(t,o){this._pairs.push([t,o])};_J.toString=function(t){let o=t?i=>t.call(this,i,bJ):bJ;return this._pairs.map(function(e){return o(e[0])+"="+o(e[1])},"").join("&")};var TJ=MJ;function Oye(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function JI(n,t,o){if(!t)return n;n=n||"";let i=Z.isFunction(o)?{serialize:o}:o,e=Z.getSafeProp(i,"encode")||Oye,a=Z.getSafeProp(i,"serialize"),A;if(a?A=a(t,i):A=Z.isURLSearchParams(t)?t.toString():new TJ(t,i).toString(e),A){let r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+A}return n}var GT=class{constructor(){this.handlers=[]}use(t,o,i){return this.handlers.push({fulfilled:t,rejected:o,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,function(i){i!==null&&t(i)})}},FT=GT;var Bc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0};import Mye from"crypto";import bye from"url";var NJ=bye.URLSearchParams;var LT="abcdefghijklmnopqrstuvwxyz",RJ="0123456789",kJ={DIGIT:RJ,ALPHA:LT,ALPHA_DIGIT:LT+LT.toUpperCase()+RJ},_ye=(n=16,t=kJ.ALPHA_DIGIT)=>{let o="",{length:i}=t,e=new Uint32Array(n);Mye.randomFillSync(e);for(let a=0;aHT,hasStandardBrowserEnv:()=>Tye,hasStandardBrowserWebWorkerEnv:()=>Nye,navigator:()=>UT,origin:()=>Rye});var HT=typeof window<"u"&&typeof document<"u",UT=typeof navigator=="object"&&navigator||void 0,Tye=HT&&(!UT||["ReactNative","NativeScript","NS"].indexOf(UT.product)<0),Nye=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Rye=HT&&window.location.href||"http://localhost";var Bt={...KT,...vJ};function xT(n,t){return uc(n,new Bt.classes.URLSearchParams,{visitor:function(o,i,e,a){return Bt.isNode&&Z.isBuffer(o)?(this.append(i,o.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}var PJ=PT;function GJ(n){if(n>PJ)throw new De("FormData field is too deeply nested ("+n+" levels). Max depth: "+PJ,De.ERR_FORM_DATA_DEPTH_EXCEEDED)}function kye(n){let t=[],o=/[^.[\]]+|\[([^.[\]]*)]/g,i;for(;(i=o.exec(n))!==null;)GJ(t.length),t.push(i[0]==="[]"?"":i[1]||i[0]);return t}function vye(n){let t={},o=Object.keys(n),i,e=o.length,a;for(i=0;i=o.length;return A=!A&&Z.isArray(e)?e.length:A,s?(Z.hasOwnProp(e,A)?e[A]=Z.isArray(e[A])?e[A].concat(i):[e[A],i]:e[A]=i,!r):((!Z.hasOwnProp(e,A)||!Z.isObject(e[A]))&&(e[A]=[]),t(o,i,e[A],a)&&Z.isArray(e[A])&&(e[A]=vye(e[A])),!r)}if(Z.isFormData(n)&&Z.isFunction(n.entries)){let o={};return Z.forEachEntry(n,(i,e)=>{t(kye(i),e,o,0)}),o}return null}var Sy=Pye;var nd=(n,t)=>n!=null&&Z.hasOwnProp(n,t)?n[t]:void 0;function Gye(n,t,o){if(Z.isString(n))try{return(t||JSON.parse)(n),Z.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(o||JSON.stringify)(n)}var YT={transitional:Bc,adapter:["xhr","http","fetch"],transformRequest:[function(t,o){let i=o.getContentType()||"",e=i.indexOf("application/json")>-1,a=Z.isObject(t);if(a&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return e?JSON.stringify(Sy(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(a){let s=nd(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return xT(t,s).toString();if((r=Z.isFileList(t))||i.indexOf("multipart/form-data")>-1){let g=nd(this,"env"),c=g&&g.FormData;return uc(r?{"files[]":t}:t,c&&new c,s)}}return a||e?(o.setContentType("application/json",!1),Gye(t)):t}],transformResponse:[function(t){let o=nd(this,"transitional")||YT.transitional,i=o&&o.forcedJSONParsing,e=nd(this,"responseType"),a=e==="json";if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(i&&!e||a)){let r=!(o&&o.silentJSONParsing)&&a;try{return JSON.parse(t,nd(this,"parseReviver"))}catch(s){if(r)throw s.name==="SyntaxError"?De.from(s,De.ERR_BAD_RESPONSE,this,null,nd(this,"response")):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bt.classes.FormData,Blob:Bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],n=>{YT.headers[n]={}});var sd=YT;function fC(n,t){let o=this||sd,i=t||o,e=Ht.from(i.headers),a=i.data;return Z.forEach(n,function(r){a=r.call(o,a,e.normalize(),t?t.status:void 0)}),e.normalize(),a}function QC(n){return!!(n&&n.__CANCEL__)}var jT=class extends De{constructor(t,o,i){super(t??"canceled",De.ERR_CANCELED,o,i),this.name="CanceledError",this.__CANCEL__=!0}},oo=jT;function cs(n,t,o){let i=o.config.validateStatus;!o.status||!i||i(o.status)?n(o):t(new De("Request failed with status code "+o.status,o.status>=400&&o.status<500?De.ERR_BAD_REQUEST:De.ERR_BAD_RESPONSE,o.config,o.request,o))}function JT(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function qT(n,t){if(!t)return n;let o=n.length;for(;o>0&&n.charCodeAt(o-1)===47;)o--;return n.slice(0,o)+"/"+t.replace(/^\/+/,"")}var Fye=/^https?:(?!\/\/)/i,Lye=/[\t\n\r]/g;function Uye(n){let t=0;for(;t`${o}${i}${dC}`)}function xye(n){let t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${dC}@`),o=t.indexOf("#"),e=(o===-1?t:t.slice(0,o)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${dC}`);return o===-1?e:`${e}#${Kye(t.slice(o+1))}`}function FJ(n,t){if(typeof n=="string"){let o=Hye(n);if(Fye.test(o))throw new De(`Invalid URL ${JSON.stringify(xye(o))}: missing "//" after protocol`,De.ERR_INVALID_URL,t)}}function qI(n,t,o,i){FJ(t,i);let e=!JT(t);return n&&(e||o===!1)?(FJ(n,i),qT(n,t)):t}var Yye={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function jye(n){try{return new URL(n)}catch{return null}}function LJ(n){var t=(typeof n=="string"?jye(n):n)||{},o=t.protocol,i=t.host,e=t.port;if(typeof i!="string"||!i||typeof o!="string"||(o=o.split(":",1)[0],i=i.replace(/:\d*$/,""),e=parseInt(e)||Yye[o]||0,!Jye(i,e)))return"";var a=zT(o+"_proxy")||zT("all_proxy");return a&&a.indexOf("://")===-1&&(a=o+"://"+a),a}function Jye(n,t){var o=zT("no_proxy").toLowerCase();return o?o==="*"?!1:o.split(/[,\s]/).every(function(i){if(!i)return!0;var e=i.match(/^(.+):(\d+)$/),a=e?e[1]:i,A=e?parseInt(e[2]):0;return A&&A!==t?!0:/^[.*]/.test(a)?(a.charAt(0)==="*"&&(a=a.slice(1)),!n.endsWith(a)):n!==a}):!0}function zT(n){return process.env[n.toLowerCase()]||process.env[n.toUpperCase()]||""}var bN=qe(aN(),1),Pq=qe(nq(),1);import kq from"http";import vq from"https";import QSe from"http2";import ySe from"util";import{resolve as Sq}from"path";import Go from"zlib";var Eg="1.19.0";function _C(n){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n);return t&&t[1]||""}var Jme=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function CN(n,t,o){let i=o&&o.Blob||Bt.classes.Blob,e=_C(n);if(t===void 0&&i&&(t=!0),e==="data"){n=e.length?n.slice(e.length+1):n;let a=Jme.exec(n);if(!a)throw new De("Invalid URL",De.ERR_INVALID_URL);let A=a[1],r=a[2],s=a[3]?"base64":"utf8",g=a[4],c="";A?c=r?A+r:A:r&&(c="text/plain"+r);let I=s==="base64"?Buffer.from(g,"base64"):Buffer.from(decodeURIComponent(g),s);if(t){if(!i)throw new De("Blob is not supported",De.ERR_NOT_SUPPORT);return new i([I],{type:c})}return I}throw new De("Unsupported protocol "+e,De.ERR_NOT_SUPPORT)}import mn from"stream";var qme=["content-type","content-length"];function TC(n,t,o){if(o!=="content-only"){n.set(t);return}Object.entries(t||{}).forEach(([i,e])=>{qme.includes(i.toLowerCase())&&n.set(i,e)})}import zme from"stream";var uN=Symbol("internals"),BN=class extends zme.Transform{constructor(t){t=Z.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,e)=>!Z.isUndefined(e[i])),super({readableHighWaterMark:t.chunkSize});let o=this[uN]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(o.isCaptured||(o.isCaptured=!0))})}_read(t){let o=this[uN];return o.onReadCallback&&o.onReadCallback(),super._read(t)}_transform(t,o,i){let e=this[uN],a=e.maxRate,A=this.readableHighWaterMark,r=e.timeWindow,s=1e3/r,g=a/s,c=e.minChunkSize!==!1?Math.max(e.minChunkSize,g*.01):0,I=(B,f)=>{let Q=Buffer.byteLength(B);e.bytesSeen+=Q,e.bytes+=Q,e.isCaptured&&this.emit("progress",e.bytesSeen),this.push(B)?process.nextTick(f):e.onReadCallback=()=>{e.onReadCallback=null,process.nextTick(f)}},d=(B,f)=>{let Q=Buffer.byteLength(B),y=null,m=A,T,_=0;if(a){let R=Date.now();(!e.ts||(_=R-e.ts)>=r)&&(e.ts=R,T=g-e.bytes,e.bytes=T<0?-T:0,_=0),T=g-e.bytes}if(a){if(T<=0)return setTimeout(()=>{f(null,B)},r-_);Tm&&Q-m>c&&(y=B.subarray(m),B=B.subarray(0,m)),I(B,y?()=>{process.nextTick(f,null,y)}:f)};d(t,function B(f,Q){if(f)return i(f);Q?d(Q,B):i(null)})}},fN=BN;import{EventEmitter as mSe}from"events";import Wme from"util";import{Readable as Zme}from"stream";var{asyncIterator:sq}=Symbol,Vme=async function*(n){n.stream?yield*n.stream():n.arrayBuffer?yield await n.arrayBuffer():n[sq]?yield*n[sq]():yield n},_y=Vme;var Xme=Bt.ALPHABET.ALPHA_DIGIT+"-_",NC=typeof TextEncoder=="function"?new TextEncoder:new Wme.TextEncoder,XI=`\r +`,$me=NC.encode(XI),eSe=2,QN=class{constructor(t,o){let{escapeName:i}=this.constructor,e=Z.isString(o),a=`Content-Disposition: form-data; name="${i(t)}"${!e&&o.name?`; filename="${i(o.name)}"`:""}${XI}`;if(e)o=NC.encode(String(o).replace(/\r?\n|\r\n?/g,XI));else{let A=String(o.type||"application/octet-stream").replace(/[\r\n]/g,"");a+=`Content-Type: ${A}${XI}`}this.headers=NC.encode(a+XI),this.contentLength=e?o.byteLength:o.size,this.size=this.headers.byteLength+this.contentLength+eSe,this.name=t,this.value=o}async*encode(){yield this.headers;let{value:t}=this;Z.isTypedArray(t)?yield t:yield*_y(t),yield $me}static escapeName(t){return String(t).replace(/[\r\n"]/g,o=>({"\r":"%0D","\n":"%0A",'"':"%22"})[o])}},ASe=(n,t,o)=>{let{tag:i="form-data-boundary",size:e=25,boundary:a=i+"-"+Bt.generateString(e,Xme)}=o||{};if(!Z.isFormData(n))throw new TypeError("FormData instance required");if(a.length<1||a.length>70)throw new Error("boundary must be 1-70 characters long");let A=NC.encode("--"+a+XI),r=NC.encode("--"+a+"--"+XI),s=r.byteLength,g=Array.from(n.entries()).map(([I,d])=>{let B=new QN(I,d);return s+=B.size,B});s+=A.byteLength*g.length,s=Z.toFiniteNumber(s);let c={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(s)&&(c["Content-Length"]=s),t&&t(c),Zme.from((async function*(){for(let I of g)yield A,yield*I.encode();yield r})())},gq=ASe;import tSe from"stream";var yN=class extends tSe.Transform{__transform(t,o,i){this.push(t),i()}_transform(t,o,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,o)}this.__transform(t,o,i)}},cq=yN;import rSe from"http2";import aSe from"util";var mN=class{constructor(){this.sessions=Object.create(null)}getSession(t,o){o=Object.assign({sessionTimeout:1e3},o);let i=this.sessions[t];if(i){let I=i.length;for(let d=0;d{if(a)return;a=!0,A&&(clearTimeout(A),A=null);let I=i,d=I.length,B=d;for(;B--;)if(I[B][0]===e){d===1?delete this.sessions[t]:I.splice(B,1),e.closed||e.close();return}},s=e.request,{sessionTimeout:g}=o;if(g!=null){let I=0;e.request=function(){let d=s.apply(this,arguments);return I++,A&&(clearTimeout(A),A=null),d.once("close",()=>{--I||(A=setTimeout(()=>{A=null,r()},g))}),d}}e.once("close",r);let c=[e,o];return i?i.push(c):i=this.sessions[t]=[c],e}},Iq=mN;var iSe=(n,t)=>Z.isAsyncFn(n)?function(...o){let i=o.pop();n.apply(this,o).then(e=>{try{t?i(null,...t(e)):i(null,e)}catch(a){i(a)}},i)}:n,lq=iSe;var oSe=new Set(["localhost","0.0.0.0"]),hq=n=>{let t=n.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(o=>/^\d+$/.test(o)&&Number(o)>=0&&Number(o)<=255)},SN=n=>{if(/^0[xX][0-9a-fA-F]+$/.test(n)){let t=parseInt(n.slice(2),16);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-7]+$/.test(n)){let t=parseInt(n,8);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-9]+$/.test(n))return null;if(/^[0-9]+$/.test(n)){let t=parseInt(n,10);return Number.isFinite(t)?t:null}return null},nSe=n=>{if(typeof n!="string"||!n||n.indexOf(":")!==-1)return n;let t=n;if(t.charAt(0)==="["&&t.charAt(t.length-1)==="]"&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return n;let o=t.split(".");if(o.some(c=>c===""))return n;if(o.length===4){let c=o.map(SN);return c.some(I=>I===null||I<0||I>255)?n:c.join(".")}if(o.length>4||o.length===1)return n;let i=o.slice(0,-1),e=o[o.length-1],a=4-i.length,A=SN(e);if(A===null)return n;let r=(1<<8*a)-1;if(A<0||A>r)return n;let s=new Array(a).fill(0);for(let c=a-1,I=A;c>=0;c--,I>>=8)s[c]=I&255;let g=i.map(SN);return g.some(c=>c===null||c<0||c>255)?n:[...g,...s].join(".")},wN=n=>/^0{1,4}$/.test(n),sSe=n=>{if(n==="::")return!0;let t=n.indexOf("::");if(t!==-1){if(t!==n.lastIndexOf("::"))return!1;let i=n.slice(0,t),e=n.slice(t+2),a=i?i.split(":"):[],A=e?e.split(":"):[];return a.length+A.length<8&&a.every(wN)&&A.every(wN)}let o=n.split(":");return o.length===8&&o.every(wN)},gSe=n=>{if(n==="::1")return!0;let t=n.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return hq(t[1]);let o=n.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(o){let e=parseInt(o[1],16);return e>=32512&&e<=32767}let i=n.split(":");if(i.length===8){for(let e=0;e<7;e++)if(!/^0+$/.test(i[e]))return!1;return/^0*1$/.test(i[7])}return!1},pq=n=>n?oSe.has(n)||hq(n)||sSe(n)?!0:gSe(n):!1,cSe={http:80,https:443,ws:80,wss:443,ftp:21},ISe=n=>{let t=n,o=0;if(t.charAt(0)==="["){let a=t.indexOf("]");if(a!==-1){let A=t.slice(1,a),r=t.slice(a+1);return r.charAt(0)===":"&&/^\d+$/.test(r.slice(1))&&(o=Number.parseInt(r.slice(1),10)),[A,o]}}let i=t.indexOf(":"),e=t.lastIndexOf(":");return i!==-1&&i===e&&/^\d+$/.test(t.slice(e+1))&&(o=Number.parseInt(t.slice(e+1),10),t=t.slice(0,e)),[t,o]},lSe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,pSe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,dSe=n=>{if(typeof n!="string"||n.indexOf(":")===-1)return n;let t=n.match(lSe);if(t)return t[1];let o=n.match(pSe);if(o){let i=parseInt(o[1],16),e=parseInt(o[2],16);return`${i>>8}.${i&255}.${e>>8}.${e&255}`}return n},dq=n=>{if(!n)return n;n.charAt(0)==="["&&n.charAt(n.length-1)==="]"&&(n=n.slice(1,-1));let t=n.replace(/\.+$/,""),o=nSe(t);return o!==t?o:dSe(t)};function DN(n){let t;try{t=new URL(n)}catch{return!1}let o=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!o)return!1;if(o==="*")return!0;let i=Number.parseInt(t.port,10)||cSe[t.protocol.split(":",1)[0]]||0,e=dq(t.hostname.toLowerCase());return o.split(/[\s,]+/).some(a=>{if(!a)return!1;if(a==="*")return!0;let[A,r]=ISe(a);return A=dq(A),!A||r&&r!==i?!1:(A.charAt(0)==="*"&&(A=A.slice(1)),A.charAt(0)==="."?e.endsWith(A):e===A||pq(e)&&pq(A))})}function hSe(n,t){n=n||10;let o=new Array(n),i=new Array(n),e=0,a=0,A;return t=t!==void 0?t:1e3,function(s){let g=Date.now(),c=i[a];A||(A=g),o[e]=s,i[e]=g;let I=a,d=0;for(;I!==e;)d+=o[I++],I=I%n;if(e=(e+1)%n,e===a&&(a=(a+1)%n),g-A{o=c,e=null,a&&(clearTimeout(a),a=null),n(...g)};return[(...g)=>{let c=Date.now(),I=c-o;I>=i?A(g,c):(e=g,a||(a=setTimeout(()=>{a=null,A(e)},i-I)))},()=>e&&A(e)]}var Cq=ESe;var Cg=(n,t,o=3)=>{let i=0,e=Eq(50,250);return Cq(a=>{if(!a||typeof a.loaded!="number")return;let A=a.loaded,r=a.lengthComputable?a.total:void 0,s=Math.max(0,r!=null?Math.min(A,r):A),g=Math.max(0,s-i),c=e(g);i=Math.max(i,s);let I={loaded:s,total:r,progress:r?s/r:void 0,bytes:g,rate:c||void 0,estimated:c&&r?(r-s)/c:void 0,event:a,lengthComputable:r!=null,[t?"download":"upload"]:!0};n(I)},o)},pd=(n,t)=>{let o=n!=null;return[i=>t[0]({lengthComputable:o,total:n,loaded:i}),t[1]]},dd=(n,t=Z.asap)=>(...o)=>t(()=>n(...o));var uq=n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102,fq=(n,t,o)=>t+2n<=57?n-48:(n&223)-55,CSe=n=>n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===43||n===47||n===45||n===95,uSe=n=>n===9||n===10||n===12||n===13||n===32,BSe=n=>{let t=Math.floor(n/4),o=n%4;return t*3+(o===2?1:o===3?2:0)},Qq=n=>{let t=n.length,o=0;return t>0&&n.charCodeAt(t-1)===61&&(o++,t>1&&n.charCodeAt(t-2)===61&&o++),Math.floor((t-o)*3/4)},fSe=n=>{let t=n.length,o=0,i=0,e=!1;for(let a=0;a0){e=!0;continue}o++}}return e||i>2||i>0&&(o+i)%4!==0||o%4===1?Qq(n):BSe(o)},yq=(n,t)=>{if(!n||typeof n!="string"||!n.startsWith("data:"))return 0;let o=n.indexOf(",");if(o<0)return 0;let i=n.slice(5,o),e=n.slice(o+1);if(/;base64/i.test(i))return t(e);let A=0;for(let r=0,s=e.length;r=55296&&g<=56319&&r+1=56320&&c<=57343?(A+=4,r++):A+=3}else A+=3}return A};function ON(n){let t=typeof n=="string"?n.indexOf("#"):-1;return yq(t===-1?n:n.slice(0,t),fSe)}function mq(n){return yq(n,Qq)}var wq={flush:Go.constants.Z_SYNC_FLUSH,finishFlush:Go.constants.Z_SYNC_FLUSH},SSe={flush:Go.constants.BROTLI_OPERATION_FLUSH,finishFlush:Go.constants.BROTLI_OPERATION_FLUSH},wSe={flush:Go.constants.ZSTD_e_flush,finishFlush:Go.constants.ZSTD_e_flush},Gq=Z.isFunction(Go.createBrotliDecompress),Fq=Z.isFunction(Go.createZstdDecompress),Lq="gzip, compress, deflate"+(Gq?", br":""),DSe=Lq+(Fq?", zstd":""),Dq=typeof process<"u"&&process.nextTick?process.nextTick.bind(process):Z.asap,{http:OSe,https:bSe}=Pq.default,MN=/https:?/,Oq=Symbol("axios.http.socketListener"),Ty=Symbol("axios.http.currentReq"),Uq=Symbol("axios.http.installedTunnel"),MSe=new Map,bq=new WeakMap,Mq={22:21,24:5};function _Se(n=process.versions&&process.versions.node){if(!n)return!1;let[t,o]=n.split(".").map(i=>Number(i));return!Number.isInteger(t)||!Number.isInteger(o)?!1:t>24?!0:Mq[t]!=null&&o>=Mq[t]}function TSe(n,t=process.versions&&process.versions.node){if(!_Se(t))return!1;let o=n&&n.options;return!!(o&&Z.hasOwnProp(o,"proxyEnv")&&o.proxyEnv!=null)}function NSe(n,t,o){return MN.test(n.protocol)?o||vq.globalAgent:t||kq.globalAgent}function RSe(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||"")+"#"+(n.auth||""),i=t?bq.get(t)||bq.set(t,new Map).get(t):MSe,e=i.get(o);if(e)return e;let a=t&&t.options?{...t.options,...n}:n;if(e=new bN.default(a),t&&t.options){let A={...t.options},r=e.callback;e.callback=function(g,c){return r.call(this,g,{...A,...c})}}return e[Uq]=!0,i.set(o,e),e}var _q=Bt.protocols.map(n=>n+":"),Tq=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},Nq=(n,[t,o])=>(n.on("end",o).on("error",o),t),kSe=new Iq;function vSe(n,t,o){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.auth&&n.beforeRedirects.auth(n),n.beforeRedirects.sensitiveHeaders&&n.beforeRedirects.sensitiveHeaders(n,o),n.beforeRedirects.config&&n.beforeRedirects.config(n,t,o)}function PSe(n,t){n&&Object.keys(n).forEach(o=>{t.has(o.toLowerCase())&&delete n[o]})}function GSe(n,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(n.href).origin}catch{return!1}}function Hq(n,t,o,i,e,a){let A=t,r=NSe(n,a,e);if(!A&&A!==!1&&!TSe(r)){let s=LJ(o);s&&(DN(o)||(A=new URL(s)))}if(i&&n.headers)for(let s of Object.keys(n.headers))s.toLowerCase()==="proxy-authorization"&&delete n.headers[s];if(i&&n.agent&&n.agent[Uq]&&(n.agent=void 0),A){let s=A instanceof URL,g=f=>s||Z.hasOwnProp(A,f)?A[f]:void 0,c=g("username"),I=g("password"),d=Z.hasOwnProp(A,"auth")?A.auth:void 0;if(c&&(d=(c||"")+":"+(I||"")),d){let f=typeof d=="object",Q=f&&Z.hasOwnProp(d,"username")?d.username:void 0,y=f&&Z.hasOwnProp(d,"password")?d.password:void 0;if(!!(Q||y))d=(Q||"")+":"+(y||"");else if(f)throw new De("Invalid proxy authorization",De.ERR_BAD_OPTION,{proxy:A})}if(MN.test(n.protocol)){if(!(e instanceof bN.default)){let f=g("hostname")||g("host"),Q=g("port"),y=g("protocol"),m=y?y.includes(":")?y:`${y}:`:"http:",T=f&&f.includes(":")&&!f.startsWith("[")?`[${f}]`:f,_=new URL(`${m}//${T}${Q?":"+Q:""}`),R={protocol:_.protocol,hostname:_.hostname.replace(/^\[|\]$/g,""),port:_.port,auth:d&&typeof d=="string"?d:void 0};_.protocol==="https:"&&(R.ALPNProtocols=["http/1.1"]);let K=RSe(R,e);n.agent=K,n.agents&&(n.agents.https=K)}}else{if(d){let m=Buffer.from(d,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+m}let f=!1;for(let m of Object.keys(n.headers))if(m.toLowerCase()==="host"){f=!0;break}f||(n.headers.host=n.hostname+(n.port?":"+n.port:""));let Q=g("hostname")||g("host");n.hostname=Q,n.host=Q,n.port=g("port"),n.path=o;let y=g("protocol");y&&(n.protocol=y.includes(":")?y:`${y}:`)}}n.beforeRedirects.proxy=function(g){Hq(g,t,g.href,!0,e,a)}}var FSe=typeof process<"u"&&Z.kindOf(process)==="process",LSe=n=>new Promise((t,o)=>{let i,e,a=(s,g)=>{e||(e=!0,i&&i(s,g))},A=s=>{a(s),t(s)},r=s=>{a(s,!0),o(s)};n(A,r,s=>i=s).catch(r)}),USe=({address:n,family:t})=>{if(!Z.isString(n))throw TypeError("address must be a string");return{address:n,family:t||(n.indexOf(".")<0?6:4)}},Rq=(n,t)=>USe(Z.isObject(n)?n:{address:n,family:t}),HSe={request(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||(n.protocol==="https:"?443:80)),{http2Options:i,headers:e}=n,a=kSe.getSession(o,i),{HTTP2_HEADER_SCHEME:A,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:s,HTTP2_HEADER_STATUS:g}=QSe.constants,c={[A]:n.protocol.replace(":",""),[r]:n.method,[s]:n.path};Z.forEach(e,(d,B)=>{B.charAt(0)!==":"&&(c[B]=d)});let I=a.request(c);return I.once("response",d=>{let B=I;d=Object.assign({},d);let f=d[g];delete d[g],B.headers=d,B.statusCode=+f,t(B)}),I}},Kq=FSe&&function(t){return LSe(async function(i,e,a){let A=ue=>Z.getSafeProp(t,ue),r=A("transitional")||Bc,s=A("data"),g=A("lookup"),c=A("family"),I=A("httpVersion");I===void 0&&(I=1);let d=A("http2Options"),B=A("httpAgent"),f=A("httpsAgent"),Q=A("proxy"),y=A("responseType"),m=A("responseEncoding"),T=A("socketPath"),_=A("method").toUpperCase(),R=A("maxRedirects"),K=A("maxBodyLength"),L=A("maxContentLength"),F=A("decompress"),q,V=!1,x,G;if(I=+I,Number.isNaN(I))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(I!==1&&I!==2)throw TypeError(`Unsupported protocol version '${I}'`);let J=I===2;if(g){let ue=lq(g,Ne=>Z.isArray(Ne)?Ne:[Ne]);g=(Ne,Ue,MA)=>{ue(Ne,Ue,(Ke,_A,at)=>{if(Ke)return MA(Ke);let wA=Z.isArray(_A)?_A.map(lt=>Rq(lt)):[Rq(_A,at)];Ue.all?MA(Ke,wA):MA(Ke,wA[0].address,wA[0].family)})}}let U=new mSe;function N(ue){try{U.emit("abort",!ue||ue.type?new oo(null,t,x):ue)}catch{}}function k(){G&&(clearTimeout(G),G=null)}function z(){let ue=A("timeout"),Ne=ue?"timeout of "+ue+"ms exceeded":"timeout exceeded",Ue=A("timeoutErrorMessage");return Ue&&(Ne=Ue),new De(Ne,r.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,x)}U.once("abort",e);let Ae=()=>{k(),t.cancelToken&&t.cancelToken.unsubscribe(N),t.signal&&t.signal.removeEventListener("abort",N),U.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(N),t.signal&&(t.signal.aborted?N():t.signal.addEventListener("abort",N))),a((ue,Ne)=>{if(q=!0,k(),Ne){V=!0,Ae();return}let{data:Ue}=ue;if(Ue instanceof mn.Readable||Ue instanceof mn.Duplex){let MA=mn.finished(Ue,()=>{MA(),Ae()})}else Ae()});let ie=qI(A("baseURL"),A("url"),A("allowAbsoluteUrls"),t),we=T?"http://localhost":Bt.hasBrowserEnv?Bt.origin:void 0,se=new URL(ie,we),Te=se.protocol||_q[0];if(Te==="data:"){if(L>-1){let Ne=String(A("url")||ie||"");if(mq(Ne)>L)return e(new De("maxContentLength size of "+L+" exceeded",De.ERR_BAD_RESPONSE,t))}let ue;if(_!=="GET")return cs(i,e,{status:405,statusText:"method not allowed",headers:{},config:t});try{ue=CN(A("url"),y==="blob",{Blob:t.env&&t.env.Blob})}catch(Ne){throw De.from(Ne,De.ERR_BAD_REQUEST,t)}return y==="text"?(ue=ue.toString(m),(!m||m==="utf8")&&(ue=Z.stripBOM(ue))):y==="stream"&&(ue=mn.Readable.from(ue)),cs(i,e,{data:ue,status:200,statusText:"OK",headers:new Ht,config:t})}if(_q.indexOf(Te)===-1)return e(new De("Unsupported protocol "+Te,De.ERR_BAD_REQUEST,t));let fe=Ht.from(t.headers).normalize();fe.set("User-Agent","axios/"+Eg,!1);let{onUploadProgress:ke,onDownloadProgress:Re}=t,We=t.maxRate,ve,aA;if(Z.isSpecCompliantForm(s)){let ue=fe.getContentType(/boundary=([-_\w\d]{10,70})/i);s=gq(s,Ne=>{fe.set(Ne)},{tag:`axios-${Eg}-boundary`,boundary:ue&&ue[1]||void 0})}else if(Z.isFormData(s)&&Z.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(TC(fe,s.getHeaders(),A("formDataHeaderPolicy")),!fe.hasContentLength())try{let ue=await ySe.promisify(s.getLength).call(s);Number.isFinite(ue)&&ue>=0&&fe.setContentLength(ue)}catch{}}else if(Z.isBlob(s)||Z.isFile(s))s.size&&fe.setContentType(s.type||"application/octet-stream"),fe.setContentLength(s.size||0),s=mn.Readable.from(_y(s));else if(s&&!Z.isStream(s)){if(!Buffer.isBuffer(s))if(Z.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(Z.isString(s))s=Buffer.from(s,"utf-8");else return e(new De("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",De.ERR_BAD_REQUEST,t));if(fe.setContentLength(s.length,!1),K>-1&&s.length>K)return e(new De("Request body larger than maxBodyLength limit",De.ERR_BAD_REQUEST,t))}let Be=Z.toFiniteNumber(fe.getContentLength());Z.isArray(We)?(ve=We[0],aA=We[1]):ve=aA=We,s&&(ke||ve)&&(Z.isStream(s)||(s=mn.Readable.from(s,{objectMode:!1})),s=mn.pipeline([s,new fN({maxRate:Z.toFiniteNumber(ve)})],Z.noop),ke&&s.on("progress",Nq(s,pd(Be,Cg(dd(ke,Dq),!1,3)))));let Ie,Xe=A("auth");if(Xe){let ue=Z.getSafeProp(Xe,"username")||"",Ne=Z.getSafeProp(Xe,"password")||"";Ie=ue+":"+Ne}if(!Ie&&(se.username||se.password)){let ue=Tq(se.username),Ne=Tq(se.password);Ie=ue+":"+Ne}Ie&&fe.delete("authorization");let je;try{je=JI(se.pathname+se.search,A("params"),A("paramsSerializer")).replace(/^\?/,"")}catch(ue){return e(De.from(ue,De.ERR_BAD_REQUEST,t,null,null,{url:A("url"),exists:!0}))}fe.set("Accept-Encoding",Z.hasOwnProp(r,"advertiseZstdAcceptEncoding")&&r.advertiseZstdAcceptEncoding===!0?DSe:Lq,!1);let Oe=Object.assign(Object.create(null),{path:je,method:_,headers:Ad(fe),agents:{http:B,https:f},auth:Ie,protocol:Te,family:c,beforeRedirect:vSe,beforeRedirects:Object.create(null),http2Options:d});if(!Z.isUndefined(g)&&(Oe.lookup=g),T){if(typeof T!="string")return e(new De("socketPath must be a string",De.ERR_BAD_OPTION_VALUE,t));let ue=A("allowedSocketPaths");if(ue!=null){let Ne=Array.isArray(ue)?ue:[ue],Ue=Sq(T);if(!Ne.some(Ke=>typeof Ke=="string"&&Sq(Ke)===Ue))return e(new De(`socketPath "${T}" is not permitted by allowedSocketPaths`,De.ERR_BAD_OPTION_VALUE,t))}Oe.socketPath=T}else Oe.hostname=se.hostname.startsWith("[")?se.hostname.slice(1,-1):se.hostname,Oe.port=se.port,Hq(Oe,Q,Te+"//"+se.hostname+(se.port?":"+se.port:"")+Oe.path,!1,f,B);let EA,hA=!1,iA=!1,Ze=MN.test(Oe.protocol);if(Oe.agent==null&&(Oe.agent=Ze?f:B),J)EA=HSe;else{let ue=A("transport");if(ue)EA=ue;else if(R===0)EA=Ze?vq:kq,hA=!0;else{iA=!0,Oe.sensitiveHeaders=[],R&&(Oe.maxRedirects=R);let Ne=A("beforeRedirect");if(Ne&&(Oe.beforeRedirects.config=Ne),Ie){let MA=se.origin,Ke=Ie;Oe.beforeRedirects.auth=function(at){try{new URL(at.href).origin===MA&&(at.auth=Ke)}catch{}}}let Ue=A("sensitiveHeaders");if(Ue!=null){if(!Z.isArray(Ue))return e(new De("sensitiveHeaders must be an array of strings",De.ERR_BAD_OPTION_VALUE,t));let MA=new Set;for(let Ke of Ue){if(!Z.isString(Ke))return e(new De("sensitiveHeaders must be an array of strings",De.ERR_BAD_OPTION_VALUE,t));MA.add(Ke.toLowerCase())}MA.size&&(Oe.sensitiveHeaders=Array.from(MA),Oe.beforeRedirects.sensitiveHeaders=function(_A,at){GSe(_A,at)||PSe(_A.headers,MA)})}EA=Ze?bSe:OSe}}K>-1?Oe.maxBodyLength=K:Oe.maxBodyLength=1/0,Oe.insecureHTTPParser=!!A("insecureHTTPParser"),x=EA.request(Oe,function(Ne){if(k(),x.destroyed)return;let Ue=[Ne],MA=Z.toFiniteNumber(Ne.headers["content-length"]);if(Re||aA){let wA=new fN({maxRate:Z.toFiniteNumber(aA)});Re&&wA.on("progress",Nq(wA,pd(MA,Cg(dd(Re,Dq),!0,3)))),Ue.push(wA)}let Ke=Ne,_A=Ne.req||x;if(F!==!1&&Ne.headers["content-encoding"])switch((_==="HEAD"||Ne.statusCode===204)&&delete Ne.headers["content-encoding"],(Ne.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ue.push(Go.createUnzip(wq)),delete Ne.headers["content-encoding"];break;case"deflate":Ue.push(new cq),Ue.push(Go.createUnzip(wq)),delete Ne.headers["content-encoding"];break;case"br":Gq&&(Ue.push(Go.createBrotliDecompress(SSe)),delete Ne.headers["content-encoding"]);break;case"zstd":Fq&&(Ue.push(Go.createZstdDecompress(wSe)),delete Ne.headers["content-encoding"]);break}Ke=Ue.length>1?mn.pipeline(Ue,Z.noop):Ue[0];let at={status:Ne.statusCode,statusText:Ne.statusMessage,headers:new Ht(Ne.headers),config:t,request:_A};if(y==="stream"){if(L>-1){let wA=L,lt=Ke;async function*Er(){let UA=0;for await(let pe of lt){if(UA+=pe.length,UA>wA)throw new De("maxContentLength size of "+wA+" exceeded",De.ERR_BAD_RESPONSE,t,_A);yield pe}}Ke=mn.Readable.from(Er(),{objectMode:!1})}at.data=Ke,cs(i,e,at)}else{let wA=[],lt=0;Ke.on("data",function(UA){wA.push(UA),lt+=UA.length,L>-1&<>L&&(V=!0,Ke.destroy(),N(new De("maxContentLength size of "+L+" exceeded",De.ERR_BAD_RESPONSE,t,_A)))}),Ke.on("aborted",function(){if(V)return;let UA=new De("stream has been aborted",De.ERR_BAD_RESPONSE,t,_A,at);Ke.destroy(UA),e(UA)}),Ke.on("error",function(UA){V||e(De.from(UA,null,t,_A,at))}),Ke.on("end",function(){try{let UA=wA.length===1?wA[0]:Buffer.concat(wA);y!=="arraybuffer"&&(UA=UA.toString(m),(!m||m==="utf8")&&(UA=Z.stripBOM(UA))),at.data=UA}catch(UA){return e(De.from(UA,null,t,at.request,at))}cs(i,e,at)})}U.once("abort",wA=>{Ke.destroyed||(Ke.emit("error",wA),Ke.destroy())})}),U.once("abort",ue=>{x.close?x.close():x.destroy(ue)}),x.on("error",function(Ne){e(De.from(Ne,null,t,x))});let bA=new Set;if(x.on("socket",function(Ne){typeof Ne.setKeepAlive=="function"&&Ne.setKeepAlive(!0,1e3*60),Ne[Oq]||(Ne.on("error",function(MA){let Ke=Ne[Ty];Ke&&!Ke.destroyed&&Ke.destroy(MA)}),Ne[Oq]=!0),Ne[Ty]=x,bA.add(Ne)}),x.once("close",function(){k();for(let Ne of bA)Ne[Ty]===x&&(Ne[Ty]=null);bA.clear()}),A("timeout")){let ue=parseInt(A("timeout"),10);if(Number.isNaN(ue)){N(new De("error trying to parse `config.timeout` to int",De.ERR_BAD_OPTION_VALUE,t,x));return}let Ne=function(){q||N(z())};hA&&ue>0&&(G=setTimeout(Ne,ue)),x.setTimeout(ue,Ne)}else x.setTimeout(0);if(Z.isStream(s)){let ue=!1,Ne=!1;s.on("end",()=>{ue=!0}),s.once("error",MA=>{Ne=!0,x.destroy(MA)}),s.on("close",()=>{!ue&&!Ne&&N(new oo("Request stream has been aborted",t,x))});let Ue=s;if(K>-1&&!iA){let MA=K,Ke=0;Ue=mn.pipeline([s,new mn.Transform({transform(_A,at,wA){if(Ke+=_A.length,Ke>MA)return wA(new De("Request body larger than maxBodyLength limit",De.ERR_BAD_REQUEST,t,x));wA(null,_A)}})],Z.noop),Ue.on("error",_A=>{x.destroyed||x.destroy(_A)})}Ue.pipe(x)}else s&&x.write(s),x.end()})};var xq=Bt.hasStandardBrowserEnv?((n,t)=>o=>(o=new URL(o,Bt.origin),n.protocol===o.protocol&&n.host===o.host&&(t||n.port===o.port)))(new URL(Bt.origin),Bt.navigator&&/(msie|trident)/i.test(Bt.navigator.userAgent)):()=>!0;var Yq=Bt.hasStandardBrowserEnv?{write(n,t,o,i,e,a,A){if(typeof document>"u")return;let r=[`${n}=${encodeURIComponent(t)}`];Z.isNumber(o)&&r.push(`expires=${new Date(o).toUTCString()}`),Z.isString(i)&&r.push(`path=${i}`),Z.isString(e)&&r.push(`domain=${e}`),a===!0&&r.push("secure"),Z.isString(A)&&r.push(`SameSite=${A}`),document.cookie=r.join("; ")},read(n){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let o=0;on instanceof Ht?{...n}:n,KSe=n=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(t=>Object.getOwnPropertyDescriptor(n,t).enumerable)):Object.keys(n);function Sn(n,t){n=n||{},t=t||{};let o=Object.create(null);Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,I,d,B){return Z.isPlainObject(c)&&Z.isPlainObject(I)?Z.merge.call({caseless:B},c,I):Z.isPlainObject(I)?Z.merge({},I):Z.isArray(I)?I.slice():I}function e(c,I,d,B){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return i(void 0,c,d,B)}else return i(c,I,d,B)}function a(c,I){if(!Z.isUndefined(I))return i(void 0,I)}function A(c,I){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return i(void 0,c)}else return i(void 0,I)}function r(c){let I=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(I))if(Z.isPlainObject(I)){if(Z.hasOwnProp(I,c))return I[c]}else return;let d=Z.hasOwnProp(n,"transitional")?n.transitional:void 0;if(Z.isPlainObject(d)&&Z.hasOwnProp(d,c))return d[c]}function s(c,I,d){if(Z.hasOwnProp(t,d))return i(c,I);if(Z.hasOwnProp(n,d))return i(void 0,c)}let g={url:a,method:a,data:a,baseURL:A,transformRequest:A,transformResponse:A,paramsSerializer:A,timeout:A,timeoutMessage:A,withCredentials:A,withXSRFToken:A,adapter:A,responseType:A,xsrfCookieName:A,xsrfHeaderName:A,onUploadProgress:A,onDownloadProgress:A,decompress:A,maxContentLength:A,maxBodyLength:A,beforeRedirect:A,transport:A,httpAgent:A,httpsAgent:A,cancelToken:A,socketPath:A,allowedSocketPaths:A,responseEncoding:A,validateStatus:s,headers:(c,I,d)=>e(jq(c),jq(I),d,!0)};return Z.forEach(KSe({...n,...t}),function(I){if(I==="__proto__"||I==="constructor"||I==="prototype")return;let d=Z.hasOwnProp(g,I)?g[I]:e,B=Z.hasOwnProp(n,I)?n[I]:void 0,f=Z.hasOwnProp(t,I)?t[I]:void 0,Q=d(B,f,I);Z.isUndefined(Q)&&d!==s||(o[I]=Q)}),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&r("validateStatusUndefinedResolves")===!1&&(Z.hasOwnProp(n,"validateStatus")?o.validateStatus=i(void 0,n.validateStatus):delete o.validateStatus),o}var xSe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16)));function YSe(n){let t=Sn({},n),o=d=>Z.hasOwnProp(t,d)?t[d]:void 0,i=o("data"),e=o("withXSRFToken"),a=o("xsrfHeaderName"),A=o("xsrfCookieName"),r=o("headers"),s=o("auth"),g=o("baseURL"),c=o("allowAbsoluteUrls"),I=o("url");if(t.headers=r=Ht.from(r),t.url=JI(qI(g,I,c,t),o("params"),o("paramsSerializer")),s){let d=Z.getSafeProp(s,"username")||"",B=Z.getSafeProp(s,"password")||"";try{r.set("Authorization","Basic "+btoa(d+":"+(B?xSe(B):"")))}catch(f){throw De.from(f,De.ERR_BAD_OPTION_VALUE,n)}}if(Z.isFormData(i)&&(Bt.hasStandardBrowserEnv||Bt.hasStandardBrowserWebWorkerEnv||Z.isReactNative(i)?r.setContentType(void 0):Z.isFunction(i.getHeaders)&&TC(r,i.getHeaders(),o("formDataHeaderPolicy"))),Bt.hasStandardBrowserEnv&&(Z.isFunction(e)&&(e=e(t)),e===!0||e==null&&xq(t.url))){let B=a&&A&&Yq.read(A);B&&r.set(a,B)}return t}var Ny=YSe;var jSe=typeof XMLHttpRequest<"u",Jq=jSe&&function(n){return new Promise(function(o,i){let e=Ny(n),a=e.data,A=Ht.from(e.headers).normalize(),{responseType:r,onUploadProgress:s,onDownloadProgress:g}=e,c,I,d,B,f;function Q(){B&&B(),f&&f(),e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(e.method.toUpperCase(),e.url,!0),y.timeout=e.timeout;function m(){if(!y)return;let _=Ht.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),K={data:!r||r==="text"||r==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:n,request:y};cs(function(F){o(F),Q()},function(F){i(F),Q()},K),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(i(new De("Request aborted",De.ECONNABORTED,n,y)),Q(),y=null)},y.onerror=function(R){let K=R&&R.message?R.message:"Network Error",L=new De(K,De.ERR_NETWORK,n,y);L.event=R||null,i(L),Q(),y=null},y.ontimeout=function(){let R=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",K=e.transitional||Bc;e.timeoutErrorMessage&&(R=e.timeoutErrorMessage),i(new De(R,K.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,n,y)),Q(),y=null},a===void 0&&A.setContentType(null),"setRequestHeader"in y&&Z.forEach(Ad(A),function(R,K){y.setRequestHeader(K,R)}),Z.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),r&&r!=="json"&&(y.responseType=e.responseType),g&&([d,f]=Cg(g,!0),y.addEventListener("progress",d)),s&&y.upload&&([I,B]=Cg(s),y.upload.addEventListener("progress",I),y.upload.addEventListener("loadend",B)),(e.cancelToken||e.signal)&&(c=_=>{y&&(i(!_||_.type?new oo(null,n,y):_),y.abort(),Q(),y=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));let T=_C(e.url);if(T&&!Bt.protocols.includes(T)){i(new De("Unsupported protocol "+T+":",De.ERR_BAD_REQUEST,n)),Q();return}y.send(a||null)})};var JSe=(n,t)=>{if(n=n?n.filter(Boolean):[],!t&&!n.length)return;let o=new AbortController,i=!1,e=function(s){if(!i){i=!0,A();let g=s instanceof Error?s:this.reason;o.abort(g instanceof De?g:new oo(g instanceof Error?g.message:g))}},a=t&&setTimeout(()=>{a=null,e(new De(`timeout of ${t}ms exceeded`,De.ETIMEDOUT))},t),A=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(s=>{s.unsubscribe?s.unsubscribe(e):s.removeEventListener("abort",e)}),n=null)};n.forEach(s=>{if(!i){if(s.aborted){e.call(s);return}s.addEventListener("abort",e,{once:!0})}});let{signal:r}=o;return r.unsubscribe=()=>Z.asap(A),r},qq=JSe;var qSe=function*(n,t){let o=n.byteLength;if(!t||o{let e=zSe(n,t),a=0,A,r=s=>{A||(A=!0,i&&i(s))};return new ReadableStream({async pull(s){try{let{done:g,value:c}=await e.next();if(g){r(),s.close();return}let I=c.byteLength;if(o){let d=a+=I;o(d)}s.enqueue(new Uint8Array(c))}catch(g){throw r(g),g}},cancel(s){return r(s),e.return()}},{highWaterMark:2})};var zq=64*1024,{isFunction:Ry}=Z,WSe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16))),Vq=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},Wq=(n,...t)=>{try{return!!n(...t)}catch{return!1}},ZSe=n=>{let t=n.indexOf("://"),o=n;return t!==-1&&(o=o.slice(t+3)),o.includes("@")||o.includes(":")},XSe=n=>{let t=Z.global!==void 0&&Z.global!==null?Z.global:globalThis,{ReadableStream:o,TextEncoder:i}=t;n=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},n);let{fetch:e,Request:a,Response:A}=n,r=e?Ry(e):typeof fetch=="function",s=Ry(a),g=Ry(A);if(!r)return!1;let c=r&&Ry(o),I=r&&(typeof i=="function"?(m=>T=>m.encode(T))(new i):async m=>new Uint8Array(await new a(m).arrayBuffer())),d=s&&c&&Wq(()=>{let m=!1,T=new a(Bt.origin,{body:new o,method:"POST",get duplex(){return m=!0,"half"}}),_=T.headers.has("Content-Type");return T.body!=null&&T.body.cancel(),m&&!_}),B=g&&c&&Wq(()=>Z.isReadableStream(new A("").body)),f={stream:B&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(T,_)=>{let R=T&&T[m];if(R)return R.call(T);throw new De(`Response type '${m}' is not supported`,De.ERR_NOT_SUPPORT,_)})});let Q=async m=>{if(m==null)return 0;if(Z.isBlob(m))return m.size;if(Z.isSpecCompliantForm(m))return(await new a(Bt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(Z.isArrayBufferView(m)||Z.isArrayBuffer(m))return m.byteLength;if(Z.isURLSearchParams(m)&&(m=m+""),Z.isString(m))return(await I(m)).byteLength},y=async(m,T)=>{let _=Z.toFiniteNumber(m.getContentLength());return _??Q(T)};return async m=>{let{url:T,method:_,data:R,signal:K,cancelToken:L,timeout:F,onDownloadProgress:q,onUploadProgress:V,responseType:x,headers:G,withCredentials:J="same-origin",fetchOptions:U,maxContentLength:N,maxBodyLength:k}=Ny(m),z=Z.isNumber(N)&&N>-1,Ae=Z.isNumber(k)&&k>-1,ie=ve=>Z.hasOwnProp(m,ve)?m[ve]:void 0,we=e||fetch;x=x?(x+"").toLowerCase():"text";let se=qq([K,L&&L.toAbortSignal()],F),Te=null,fe=se&&se.unsubscribe&&(()=>{se.unsubscribe()}),ke,Re=null,We=()=>new De("Request body larger than maxBodyLength limit",De.ERR_BAD_REQUEST,m,Te);try{let ve,aA=ie("auth");if(aA){let Ze=Z.getSafeProp(aA,"username")||"",bA=Z.getSafeProp(aA,"password")||"";ve={username:Ze,password:bA}}if(ZSe(T)){let Ze=new URL(T,Bt.origin);if(!ve&&(Ze.username||Ze.password)){let bA=Vq(Ze.username),ue=Vq(Ze.password);ve={username:bA,password:ue}}(Ze.username||Ze.password)&&(Ze.username="",Ze.password="",T=Ze.href)}if(ve&&(G.delete("authorization"),G.set("Authorization","Basic "+btoa(WSe((ve.username||"")+":"+(ve.password||""))))),z&&typeof T=="string"&&T.startsWith("data:")&&ON(T)>N)throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te);if(Ae&&_!=="get"&&_!=="head"){let Ze=await Q(R);if(typeof Ze=="number"&&isFinite(Ze)&&(ke=Ze,Ze>k))throw We()}let Be=Ae&&(Z.isReadableStream(R)||Z.isStream(R)),Ie=(Ze,bA,ue)=>_N(Ze,zq,Ne=>{if(Ae&&Ne>k)throw Re=We();bA&&bA(Ne)},ue);if(d&&_!=="get"&&_!=="head"&&(V||Be)){if(ke=ke??await y(G,R),ke!==0||Be){let Ze=new a(T,{method:"POST",body:R,duplex:"half"}),bA;if(Z.isFormData(R)&&(bA=Ze.headers.get("content-type"))&&G.setContentType(bA),Ze.body){let[ue,Ne]=V&&pd(ke,Cg(dd(V)))||[];R=Ie(Ze.body,ue,Ne)}}}else if(Be&&!s&&c&&_!=="get"&&_!=="head")R=Ie(R);else if(Be&&s&&!d&&_!=="get"&&_!=="head")throw new De("Stream request bodies are not supported by the current fetch implementation",De.ERR_NOT_SUPPORT,m,Te);Z.isString(J)||(J=J?"include":"omit");let Xe=s&&"credentials"in a.prototype;if(Z.isFormData(R)){let Ze=G.getContentType();Ze&&/^multipart\/form-data/i.test(Ze)&&!/boundary=/i.test(Ze)&&G.delete("content-type")}G.set("User-Agent","axios/"+Eg,!1);let je={...U,signal:se,method:_.toUpperCase(),headers:Ad(G.normalize()),body:R,duplex:"half",credentials:Xe?J:void 0};Te=s&&new a(T,je);let Oe=await(s?we(Te,U):we(T,je)),EA=Ht.from(Oe.headers);if(z){let Ze=Z.toFiniteNumber(EA.getContentLength());if(Ze!=null&&Ze>N)throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te)}let hA=B&&(x==="stream"||x==="response");if(B&&Oe.body&&(q||z||hA&&fe)){let Ze={};["status","statusText","headers"].forEach(Ke=>{Ze[Ke]=Oe[Ke]});let bA=Z.toFiniteNumber(EA.getContentLength()),[ue,Ne]=q&&pd(bA,Cg(dd(q),!0))||[],Ue=0,MA=Ke=>{if(z&&(Ue=Ke,Ue>N))throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te);ue&&ue(Ke)};Oe=new A(_N(Oe.body,zq,MA,()=>{Ne&&Ne(),fe&&fe()}),Ze)}x=x||"text";let iA=await f[Z.findKey(f,x)||"text"](Oe,m);if(z&&!B&&!hA){let Ze;if(iA!=null&&(typeof iA.byteLength=="number"?Ze=iA.byteLength:typeof iA.size=="number"?Ze=iA.size:typeof iA=="string"&&(Ze=typeof i=="function"?new i().encode(iA).byteLength:iA.length)),typeof Ze=="number"&&Ze>N)throw new De("maxContentLength size of "+N+" exceeded",De.ERR_BAD_RESPONSE,m,Te)}return!hA&&fe&&fe(),await new Promise((Ze,bA)=>{cs(Ze,bA,{data:iA,headers:Ht.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:m,request:Te})})}catch(ve){if(fe&&fe(),se&&se.aborted&&se.reason instanceof De){let aA=se.reason;throw aA.config=m,Te&&(aA.request=Te),ve!==aA&&Object.defineProperty(aA,"cause",{__proto__:null,value:ve,writable:!0,enumerable:!1,configurable:!0}),aA}if(Re)throw Te&&!Re.request&&(Re.request=Te),Re;if(ve instanceof De)throw Te&&!ve.request&&(ve.request=Te),ve;if(ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)){let aA=new De("Network Error",De.ERR_NETWORK,m,Te,ve&&ve.response);throw Object.defineProperty(aA,"cause",{__proto__:null,value:ve.cause||ve,writable:!0,enumerable:!1,configurable:!0}),aA}throw De.from(ve,ve&&ve.code,m,Te,ve&&ve.response)}}},$Se=new Map,TN=n=>{let t=n&&n.env||{},{fetch:o,Request:i,Response:e}=t,a=[i,e,o],A=a.length,r=A,s,g,c=$Se;for(;r--;)s=a[r],g=c.get(s),g===void 0&&c.set(s,g=r?new Map:XSe(t)),c=g;return g},tsA=TN();var NN={http:Kq,xhr:Jq,fetch:{get:TN}};Z.forEach(NN,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(n,"adapterName",{__proto__:null,value:t})}});var Zq=n=>`- ${n}`,Awe=n=>Z.isFunction(n)||n===null||n===!1;function twe(n,t){n=Z.isArray(n)?n:[n];let{length:o}=n,i,e,a={};for(let A=0;A`adapter ${s} `+(g===!1?"is not supported by the environment":"is not available in the build")),r=o?A.length>1?`since : `+A.map(Zq).join(` -`):" "+Zq(A[0]):"as no adapter specified";throw new De("There is no suitable adapter to dispatch the request "+r,De.ERR_NOT_SUPPORT)}return e}var ky={getAdapter:twe,adapters:NN};function RN(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new oo(null,n)}function RC(n){return RN(n),n.headers=Ht.from(n.headers),n.data=fC.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),ky.getAdapter(n.adapter||nd.adapter,n)(n).then(function(i){RN(n),n.response=i;try{i.data=fC.call(n,n.transformResponse,i)}finally{delete n.response}return i.headers=Ht.from(i.headers),i},function(i){if(!QC(i)&&(RN(n),i&&i.response)){n.response=i.response;try{i.response.data=fC.call(n,n.transformResponse,i.response)}finally{delete n.response}i.response.headers=Ht.from(i.response.headers)}return Promise.reject(i)})}var vy={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{vy[n]=function(i){return typeof i===n||"a"+(t<1?"n ":" ")+n}});var Xq={};vy.transitional=function(t,o,i){function e(a,A){return"[Axios v"+Eg+"] Transitional option '"+a+"'"+A+(i?". "+i:"")}return(a,A,r)=>{if(t===!1)throw new De(e(A," has been removed"+(o?" in "+o:"")),De.ERR_DEPRECATED);return o&&!Xq[A]&&(Xq[A]=!0,console.warn(e(A," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(a,A,r):!0}};vy.spelling=function(t){return(o,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function rwe(n,t,o){if(typeof n!="object"||n===null)throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);let i=Object.keys(n),e=i.length;for(;e-- >0;){let a=i[e],A=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(A){let r=n[a],s=r===void 0||A(r,a,n);if(s!==!0)throw new De("option "+a+" must be "+s,De.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new De("Unknown option "+a,De.ERR_BAD_OPTION)}}var kC={assertOptions:rwe,validators:vy};var ti=kC.validators,dd=class{constructor(t){this.defaults=t||{},this.interceptors={request:new FT,response:new FT}}async request(t,o){try{return await this._request(t,o)}catch(i){if(i instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;let a=(()=>{if(!e.stack)return"";let A=e.stack.indexOf(` +`):" "+Zq(A[0]):"as no adapter specified";throw new De("There is no suitable adapter to dispatch the request "+r,De.ERR_NOT_SUPPORT)}return e}var ky={getAdapter:twe,adapters:NN};function RN(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new oo(null,n)}function RC(n){return RN(n),n.headers=Ht.from(n.headers),n.data=fC.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),ky.getAdapter(n.adapter||sd.adapter,n)(n).then(function(i){RN(n),n.response=i;try{i.data=fC.call(n,n.transformResponse,i)}finally{delete n.response}return i.headers=Ht.from(i.headers),i},function(i){if(!QC(i)&&(RN(n),i&&i.response)){n.response=i.response;try{i.response.data=fC.call(n,n.transformResponse,i.response)}finally{delete n.response}i.response.headers=Ht.from(i.response.headers)}return Promise.reject(i)})}var vy={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{vy[n]=function(i){return typeof i===n||"a"+(t<1?"n ":" ")+n}});var Xq={};vy.transitional=function(t,o,i){function e(a,A){return"[Axios v"+Eg+"] Transitional option '"+a+"'"+A+(i?". "+i:"")}return(a,A,r)=>{if(t===!1)throw new De(e(A," has been removed"+(o?" in "+o:"")),De.ERR_DEPRECATED);return o&&!Xq[A]&&(Xq[A]=!0,console.warn(e(A," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(a,A,r):!0}};vy.spelling=function(t){return(o,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function rwe(n,t,o){if(typeof n!="object"||n===null)throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);let i=Object.keys(n),e=i.length;for(;e-- >0;){let a=i[e],A=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(A){let r=n[a],s=r===void 0||A(r,a,n);if(s!==!0)throw new De("option "+a+" must be "+s,De.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new De("Unknown option "+a,De.ERR_BAD_OPTION)}}var kC={assertOptions:rwe,validators:vy};var ti=kC.validators,hd=class{constructor(t){this.defaults=t||{},this.interceptors={request:new FT,response:new FT}}async request(t,o){try{return await this._request(t,o)}catch(i){if(i instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;let a=(()=>{if(!e.stack)return"";let A=e.stack.indexOf(` `);return A===-1?"":e.stack.slice(A+1)})();try{if(!i.stack)i.stack=a;else if(a){let A=a.indexOf(` `),r=A===-1?-1:a.indexOf(` `,A+1),s=r===-1?"":a.slice(r+1);String(i.stack).endsWith(s)||(i.stack+=` -`+a)}}catch{}}throw i}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=Sn(this.defaults,o);let{transitional:i,paramsSerializer:e,headers:a}=o;i!==void 0&&kC.assertOptions(i,{silentJSONParsing:ti.transitional(ti.boolean),forcedJSONParsing:ti.transitional(ti.boolean),clarifyTimeoutError:ti.transitional(ti.boolean),legacyInterceptorReqResOrdering:ti.transitional(ti.boolean),advertiseZstdAcceptEncoding:ti.transitional(ti.boolean),validateStatusUndefinedResolves:ti.transitional(ti.boolean)},!1),e!=null&&(Z.isFunction(e)?o.paramsSerializer={serialize:e}:kC.assertOptions(e,{encode:ti.function,serialize:ti.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),kC.assertOptions(o,{baseUrl:ti.spelling("baseURL"),withXsrfToken:ti.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let A=a&&Z.merge(a.common,a[o.method]);a&&Z.forEach(["delete","get","head","post","put","patch","query","common"],f=>{delete a[f]}),o.headers=Ht.concat(A,a);let r=[],s=!0;this.interceptors.request.forEach(function(Q){if(typeof Q.runWhen=="function"&&Q.runWhen(o)===!1)return;s=s&&Q.synchronous;let y=o.transitional||Bc;y&&y.legacyInterceptorReqResOrdering?r.unshift(Q.fulfilled,Q.rejected):r.push(Q.fulfilled,Q.rejected)});let g=[];this.interceptors.response.forEach(function(Q){g.push(Q.fulfilled,Q.rejected)});let c,I=0,d;if(!s){let f=[RC.bind(this),void 0];for(f.unshift(...r),f.push(...g),d=f.length,c=Promise.resolve(o);IRC.call(this,B)))}catch(m){c=Promise.reject(m)}break}}if(!c)try{c=RC.call(this,B)}catch(f){c=Promise.reject(f)}for(I=0,d=g.length;I{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](e);i._listeners=null}),this.promise.then=e=>{let a,A=new Promise(r=>{i.subscribe(r),a=r}).then(e);return A.cancel=function(){i.unsubscribe(a)},A},t(function(a,A,r){i.reason||(i.reason=new oo(a,A,r),o(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){let t=new AbortController,o=i=>{t.abort(i)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new n(function(e){t=e}),cancel:t}}},$q=kN;function vN(n){return function(o){return n.apply(null,o)}}function PN(n){return Z.isObject(n)&&n.isAxiosError===!0}var GN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(GN).forEach(([n,t])=>{GN[t]=n});var e4=GN;function A4(n){let t=new vC(n),o=gC(vC.prototype.request,t);return Z.extend(o,vC.prototype,t,{allOwnKeys:!0}),Z.extend(o,t,null,{allOwnKeys:!0}),o.create=function(e){return A4(Sn(n,e))},o}var Nr=A4(nd);Nr.Axios=vC;Nr.CanceledError=oo;Nr.CancelToken=$q;Nr.isCancel=QC;Nr.VERSION=Eg;Nr.toFormData=uc;Nr.AxiosError=De;Nr.Cancel=Nr.CanceledError;Nr.all=function(t){return Promise.all(t)};Nr.spread=vN;Nr.isAxiosError=PN;Nr.mergeConfig=Sn;Nr.AxiosHeaders=Ht;Nr.formToJSON=n=>Sy(Z.isHTMLForm(n)?new FormData(n):n);Nr.getAdapter=ky.getAdapter;Nr.HttpStatusCode=e4;Nr.default=Nr;var Py=Nr;var{Axios:$sA,AxiosError:FN,CanceledError:egA,isCancel:AgA,CancelToken:tgA,VERSION:rgA,all:agA,Cancel:igA,isAxiosError:ogA,spread:ngA,toFormData:sgA,AxiosHeaders:ggA,HttpStatusCode:cgA,formToJSON:IgA,getAdapter:lgA,mergeConfig:pgA,create:dgA}=Py;var E=qe(z4()),b=qe(W4()),M=qe(R8()),_W=qe(sz());import tt from"fs";import hu from"path";import Fm from"crypto";import ANe from"querystring";var LTe=qe(rV(),1),UTe=qe(mm(),1),HTe=qe(bd(),1),KTe=qe(j0(),1),xTe=qe(z0(),1),YTe=qe(eR(),1),lV=qe(Om(),1),jTe=qe(IV(),1);var Uo=lV.default;import{gzipSync as tNe}from"zlib";import rNe from"http";import aNe from"https";import{promises as iNe}from"dns";import{isIP as TW}from"net";function Y(n,t){var o={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(o[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,i=Object.getOwnPropertySymbols(n);e=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(n){return this instanceof S?(this.v=n,this):new S(n)}function j(n,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=o.apply(n,t||[]),e,a=[];return e={},A("next"),A("throw"),A("return"),e[Symbol.asyncIterator]=function(){return this},e;function A(d){i[d]&&(e[d]=function(B){return new Promise(function(f,Q){a.push([d,B,f,Q])>1||r(d,B)})})}function r(d,B){try{s(i[d](B))}catch(f){I(a[0][3],f)}}function s(d){d.value instanceof S?Promise.resolve(d.value.v).then(g,c):I(a[0][2],d)}function g(d){r("next",d)}function c(d){r("throw",d)}function I(d,B){d(B),a.shift(),a.length&&r(a[0][0],a[0][1])}}function IW(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],o;return t?t.call(n):(n=typeof cW=="function"?cW(n):n[Symbol.iterator](),o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o);function i(a){o[a]=n[a]&&function(A){return new Promise(function(r,s){A=n[a](A),e(r,s,A.done,A.value)})}}function e(a,A,r,s){Promise.resolve(s).then(function(g){a({value:g,done:r})},A)}}var km;function oNe(){if(km!==void 0)return km;let n=[hu.resolve(__dirname,"..","package.json"),hu.resolve(__dirname,"..","..","package.json")];for(let t of n)try{let o=JSON.parse(tt.readFileSync(t,"utf-8"));if(o.name==="@larksuiteoapi/node-sdk"&&typeof o.version=="string")return km=o.version,o.version}catch{}return km="unknown","unknown"}function lW(n){return n.replace(/[^a-zA-Z0-9._-]/g,"_").slice(0,64)}function qv(n,t){let o=`oapi-node-sdk/${oNe()}`;if(n){let i=lW(n);i&&(o+=` source/${i}`)}if(t?.extraTags)for(let i of t.extraTags){let e=lW(i);e&&(o+=` ${e}`)}return o}var Fd=Py.create(),nNe=qv();Fd.interceptors.request.use(n=>(n.headers&&!n.headers["User-Agent"]&&(n.headers["User-Agent"]=nNe),n),void 0,{synchronous:!0});Fd.interceptors.response.use(n=>n.config.$return_headers?{data:n.data,headers:n.headers}:n.data);var us;(function(n){n[n.SelfBuild=0]="SelfBuild",n[n.ISV=1]="ISV"})(us||(us={}));var Bs;(function(n){n[n.Feishu=0]="Feishu",n[n.Lark=1]="Lark"})(Bs||(Bs={}));var co;(function(n){n[n.fatal=0]="fatal",n[n.error=1]="error",n[n.warn=2]="warn",n[n.info=3]="info",n[n.debug=4]="debug",n[n.trace=5]="trace"})(co||(co={}));var Lm=Symbol("event-type"),Um=Symbol("tenant-key"),Bu=Symbol("app-ticket"),du=Symbol("tenant-access-token"),NW=Symbol("with-helpdesk-authorization"),RW=Symbol("with-user-access-token"),sNe=Symbol("user-access-token"),pW=Symbol("aily-session-record"),gNe=n=>Buffer.from(n).toString("base64"),Hm=class{constructor(){this.values=new Map}getCacheKey(t,o){return o?`${o}/${t.toString()}`:t}get(t,o){return h(this,void 0,void 0,function*(){let i=this.getCacheKey(t,o?.namespace),e=this.values.get(i);if(e){let{value:a,expiredTime:A}=e;if(!A||A-new Date().getTime()>0)return a}})}set(t,o,i,e){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,e?.namespace);return this.values.set(a,{value:o,expiredTime:i}),!0})}},Qu=new Hm,fu=class{constructor(t){let o=Fm.createHash("sha256");o.update(t),this.key=o.digest()}decrypt(t){let o=Buffer.from(t,"base64"),i=Fm.createDecipheriv("aes-256-cbc",this.key,o.slice(0,16)),e=i.update(o.slice(16).toString("hex"),"hex","utf8");return e+=i.final("utf8"),e}},kW=n=>{switch(n){case Bs.Feishu:return"https://open.feishu.cn";case Bs.Lark:return"https://open.larksuite.com";default:return n}},C=(n,t={})=>n.replace(/:([^/]+)/g,(o,i)=>{if(t[i]!==void 0)return t[i];throw new Error(`request miss ${i} path argument`)}),Km=(n,t)=>h(void 0,void 0,void 0,function*(){(typeof n=="function"?n():n)&&(yield t())}),cNe=n=>n?n.replace(/^\//,""):"",vm=(n,t=[])=>{let o={};return n&&t.forEach(i=>{Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=n[i])}),o},u=n=>{var t;if(n instanceof FN){let{message:o,response:i,request:e,config:a}=vm(n,["message","response","request","config"]),r=[{message:o,config:vm(a,["data","url","params","method"]),request:vm(e,["protocol","host","path","method"]),response:vm(i,["data","status","statusText"])}],s=(t=n?.response)===null||t===void 0?void 0:t.data;return s&&(typeof s=="object"?r.push(Object.assign(Object.assign({},s),s.error?s.error:{})):r.push(s)),r}return[n]},uR=class{constructor(){this.acs={accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},BR=class extends uR{constructor(){super(...arguments),this.admin={badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},fR=class extends BR{constructor(){super(...arguments),this.aily_rag={}}},QR=class extends fR{constructor(){super(...arguments),this.aily={v1:{ailySession:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDataAssetTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appSkill:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id/start`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appKnowledge:{ask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/knowledges/ask`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDataAsset:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadFile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},ailySessionRun:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ailySessionAilyMessage:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages/:aily_message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentVisibility:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/agent_visibility/check`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentAttachment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/attachments`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},tenantAppStat:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentChat:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats/:agent_chat_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentChatSession:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentArtifact:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/artifacts/:agent_artifact_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},yR=class extends QR{constructor(){super(...arguments),this.apaas={v1:{approvalTask:{addAssignee:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/add_assignee`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),agree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/agree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/transfer`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationObjectRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationObject:{oqlQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/oql_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFunction:{invoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/functions/:function_api_name/invoke`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationRoleMember:{batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_remove_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_create_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationRecordPermissionMember:{batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_create_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_remove_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationEnvironmentVariable:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/:environment_variable_api_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTask:{expediting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/expediting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),chatGroup:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/chat_group`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollbackPoints:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback_points`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_task/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFlow:{execute:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalInstance:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_instances/:approval_instance_id/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAuditLog:{auditLogList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/audit_log_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),dataChangeLogsList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_logs_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),dataChangeLogDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_log_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},seatAssignment:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},seatActivity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspaceTable:{recordsBatchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsPatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsPost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tableGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspace:{sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/sql_commands`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspaceView:{viewsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/views/:view_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspaceEnum:{enumGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums/:enum_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantAppMetrics:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/tenant_app_metrics/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},mR=class extends yR{constructor(){super(...arguments),this.application={applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v5:{application:{favouriteWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),favourite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recommendWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),recommend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v6:{applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v7:{applicationBase:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/base`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationPublish:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/publish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appAvatarUpload:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/app_avatar/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},applicationConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/config`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAbility:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/ability`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},SR=class extends mR{constructor(){super(...arguments),this.approval={instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v4:{instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},wR=class extends SR{constructor(){super(...arguments),this.attendance_machine={}}},DR=class extends wR{constructor(){super(...arguments),this.attendance={file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},OR=class extends DR{constructor(){super(...arguments),this.audio_video_ai={}}},bR=class extends OR{constructor(){super(...arguments),this.auth={appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v3:{appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},MR=class extends bR{constructor(){super(...arguments),this.authen={userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},_R=class extends MR{constructor(){super(...arguments),this.authz={}}},TR=class extends _R{constructor(){super(...arguments),this.aweme_ecosystem={}}},NR=class extends TR{constructor(){super(...arguments),this.baike={entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},RR=class extends NR{constructor(){super(...arguments),this.base={v2:{appRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},kR=class extends RR{constructor(){super(...arguments),this.bitable={appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},vR=class extends kR{constructor(){super(...arguments),this.block={entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v2:{entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},PR=class extends vR{constructor(){super(...arguments),this.board={v1:{whiteboardNode:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createPlantuml:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/plantuml`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},whiteboard:{downloadAsImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/download_as_image`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),theme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/theme`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateTheme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/update_theme`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},GR=class extends PR{constructor(){super(...arguments),this.bot={v4:{bot:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},FR=class extends GR{constructor(){super(...arguments),this.c360={}}},LR=class extends FR{constructor(){super(...arguments),this.calendar={exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v4:{exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},UR=class extends LR{constructor(){super(...arguments),this.cardkit={v1:{card:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),settings:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/settings`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/id_convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},cardElement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),content:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id/content`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},HR=class extends UR{constructor(){super(...arguments),this.ccm_unified_resource={}}},KR=class extends HR{constructor(){super(...arguments),this.collab_plugins={}}},xR=class extends KR{constructor(){super(...arguments),this.comment_sdk={}}},YR=class extends xR{constructor(){super(...arguments),this.compensation={v1:{indicator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialPlan:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_plans/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},item:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},plan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialInsurance:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_insurances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},itemCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},changeReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},archive:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/archives`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/archives/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},recurringPayment:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialArchive:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_archive/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialArchiveAdjustRecord:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_archive_adjust_record/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},lumpSumPayment:{batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryDetailWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},jR=class extends YR{constructor(){super(...arguments),this.contact={group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v3:{group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},JR=class extends jR{constructor(){super(...arguments),this.content_check={}}},qR=class extends JR{constructor(){super(...arguments),this.contract={}}},zR=class extends qR{constructor(){super(...arguments),this.corehr={contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{costCenter:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCountryRegionSubdivision:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},probation:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/submit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/withdraw`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),enableDisableAssessment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/enable_disable_assessment`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/edit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},probationAssessment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/assessments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customOrg:{deleteOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateRule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},preHire:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transitTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/transit_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdrawOnboarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/withdraw_onboarding`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),restoreFlowInstance:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/restore_flow_instance`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transformOnboardingTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/transform_onboarding_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobGrade:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},position:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/del_position`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/:position_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesBp:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/bps/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},bp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/bps/get_by_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesAdditionalJob:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoNationality:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCountryRegion:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCity:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoDistrict:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoBank:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCurrency:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeCustomOrg:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/create_emp_custom_org`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),editEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/edit_emp_custom_org`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),employmentCustomOrgRecord:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/employment_custom_org_record`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),querybyid:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/querybyid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureFile:{listByBizId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/list_by_biz_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/:signature_file_id/download`,A),method:"POST",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/terminate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureNode:{listByFileId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_nodes/list_by_file_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},company:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryOperationLogsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryOperationLogs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),parents:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/parents`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},draft:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/drafts/:draft_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalGroups:{openQueryPositionChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_position_change_list_by_ids`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/:process_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),openQueryJobChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_job_change_list_by_ids`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),openQueryDepartmentChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_department_change_list_by_ids`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},locationAddress:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoLanguage:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoTimeZone:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reportDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchDelete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchSave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workforcePlanDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchDelete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchSave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offboarding:{submitV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/offboardings/submit_v2`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/offboardings/edit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/offboardings/revoke`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoBankBranch:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},enum:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/enums/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},process:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),flowVariableData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/flow_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processApprover:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/approvers/:approver_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processWithdraw:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/process_withdraw/:process_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approver:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processTransfer:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/transfer`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processExtra:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/extra`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_levels/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesInternationalAssignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/form_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},pathway:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processStart:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/process_start`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocation:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/update_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/create_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/remove_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costCenterVersion:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processQueryFlowDataTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/query_flow_data_template`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},defaultCostCenter:{createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processRevoke:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/process_revoke/:process_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureTemplateInfoWithThumbnail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobChange:{revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes/:job_change_id/revoke`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},contract:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workforcePlanDetail:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch_v2`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employee:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureTemplate:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_templates/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesJobData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/job_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/job_datas/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},person:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/persons/:person_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/persons`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workforcePlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},VR=class extends zR{constructor(){super(...arguments),this.data_cube={}}},WR=class extends VR{constructor(){super(...arguments),this.device={}}},ZR=class extends WR{constructor(){super(...arguments),this.directory={v1:{employee:{resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),regular:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),toBeResigned:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationTenant:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationRule:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collborationShareEntity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},XR=class extends ZR{constructor(){super(...arguments),this.docs_ai={}}},$R=class extends XR{constructor(){super(...arguments),this.docs_tool={}}},ek=class extends $R{constructor(){super(...arguments),this.docs={v1:{content:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docs/v1/content`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ak=class extends ek{constructor(){super(...arguments),this.document_ai={v1:{businessCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/business_card/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},contract:{fieldExtraction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/contract/field_extraction`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},businessLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/business_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},drivingLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/driving_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},vehicleLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/vehicle_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},foodManageLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/food_manage_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},foodProduceLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/food_produce_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},hkmMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},chinesePassport:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/chinese_passport/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},twMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},healthCertificate:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/health_certificate/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},vehicleInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/vehicle_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},resume:{parse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/resume/parse`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},bankCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/bank_card/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},trainInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/train_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},taxiInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/taxi_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},vatInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/vat_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},idCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/id_card/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})}}}}},tk=class extends Ak{constructor(){super(...arguments),this.docx={document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},rk=class extends tk{constructor(){super(...arguments),this.drive={file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{fileLike:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commentReaction:{updateReaction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/files/:file_token/comments/reaction`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublic:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},ak=class extends rk{constructor(){super(...arguments),this.ea_symphony={}}},ik=class extends ak{constructor(){super(...arguments),this.edu={}}},ok=class extends ik{constructor(){super(...arguments),this.ehr={attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},nk=class extends ok{constructor(){super(...arguments),this.elearning={}}},sk=class extends nk{constructor(){super(...arguments),this.event={outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},gk=class extends sk{constructor(){super(...arguments),this.exam={}}},ck=class extends gk{constructor(){super(...arguments),this.face_detection={}}},Ik=class extends ck{constructor(){super(...arguments),this.financial_access_platform={}}},lk=class extends Ik{constructor(){super(...arguments),this.grounding={}}},pk=class extends lk{constructor(){super(...arguments),this.gtm_ai={}}},dk=class extends pk{constructor(){super(...arguments),this.helpdesk={agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},hk=class extends dk{constructor(){super(...arguments),this.hire={websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{talent:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/talents/:talent_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/interview_records/:interview_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ek=class extends hk{constructor(){super(...arguments),this.human_authentication={identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ck=class extends Ek{constructor(){super(...arguments),this.im={message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{bizEntityTagRelation:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},urlPreview:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/url_previews/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appFeedCardBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},feedCard:{botTimeSentive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/feed_cards/bot_time_sentive`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/feed_cards/:feed_card_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tag:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/tags`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/tags/:tag_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatButton:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/chat_button`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appFeedCard:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/app_feed_card`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chat:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},uk=class extends Ck{constructor(){super(...arguments),this.inline_platform={}}},Bk=class extends uk{constructor(){super(...arguments),this.laps={}}},fk=class extends Bk{constructor(){super(...arguments),this.lingo={v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/match`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/highlight`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},repo:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/repos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Qk=class extends fk{constructor(){super(...arguments),this.llpp={}}},yk=class extends Qk{constructor(){super(...arguments),this.mail={mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},mk=class extends yk{constructor(){super(...arguments),this.mcp={}}},Sk=class extends mk{constructor(){super(...arguments),this.mdm={userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v3:{countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v3/country_regions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},batchCountryRegion:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v3/batch_country_region`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},wk=class extends Sk{constructor(){super(...arguments),this.meeting_room={}}},Dk=class extends wk{constructor(){super(...arguments),this.mindnote={}}},Ok=class extends Dk{constructor(){super(...arguments),this.minutes={v1:{minuteTranscript:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/transcript`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},minuteStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/statistics`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minuteMedia:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/media`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minute:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),artifacts:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/artifacts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},bk=class extends Ok{constructor(){super(...arguments),this.moments={post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Mk=class extends bk{constructor(){super(...arguments),this.myai_ai_extension={}}},_k=class extends Mk{constructor(){super(...arguments),this.myai_assistant={}}},Tk=class extends _k{constructor(){super(...arguments),this.myai_base_ai={}}},Nk=class extends Tk{constructor(){super(...arguments),this.myai_ccm_extension={}}},Rk=class extends Nk{constructor(){super(...arguments),this.myai_data={}}},kk=class extends Rk{constructor(){super(...arguments),this.myai_im_extension={}}},vk=class extends kk{constructor(){super(...arguments),this.myai_mail={}}},Pk=class extends vk{constructor(){super(...arguments),this.myai_memory_reflection={}}},Gk=class extends Pk{constructor(){super(...arguments),this.myai_scenario_summary={}}},Fk=class extends Gk{constructor(){super(...arguments),this.myai_slides={}}},Lk=class extends Fk{constructor(){super(...arguments),this.myai_url_extension={}}},Uk=class extends Lk{constructor(){super(...arguments),this.myai={}}},Hk=class extends Uk{constructor(){super(...arguments),this.okr={review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},v1:{review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})}},v2:{okrAlignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjective:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),keyResultsPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_position`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),keyResultsWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_weight`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrKeyResult:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveAlignment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrCycle:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),objectivesWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_weight`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),objectivesPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_position`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveKeyResult:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrKeyResultIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/indicators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/indicators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrCycleObjective:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrIndicator:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/indicators/:indicator_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrKeyResultProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Kk=class extends Hk{constructor(){super(...arguments),this.optical_char_recognition={image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},xk=class extends Kk{constructor(){super(...arguments),this.partner_ai={}}},Yk=class extends xk{constructor(){super(...arguments),this.passport={session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},jk=class extends Yk{constructor(){super(...arguments),this.payroll={v1:{datasourceRecord:{save:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasource_records/save`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paymentDetail:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_detail/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paymentActivity:{archive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activitys/archive`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocationPlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paymentActivityDetail:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activity_details`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},datasource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocationDetail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocationReport:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paygroup:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},acctItem:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Jk=class extends jk{constructor(){super(...arguments),this.people_admin={}}},qk=class extends Jk{constructor(){super(...arguments),this.people_ai={}}},zk=class extends qk{constructor(){super(...arguments),this.people_bytedance={}}},Vk=class extends zk{constructor(){super(...arguments),this.performance={v1:{reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/review_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},stageTask:{findByUserList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_user_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),findByPage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_page`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},semester:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/semesters`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{reviewee:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/reviewees/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},additionalInformationsBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/batch`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricDetail:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_details/import`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_details/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},question:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},indicator:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},activity:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/activity/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_fields/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricLib:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_libs/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/review_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricTemplate:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_templates/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/user_info/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reviewTemplate:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userGroupUserRel:{write:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/user_group_user_rels/write`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},additionalInformation:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/import`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Wk=class extends Vk{constructor(){super(...arguments),this.personal_settings={systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Zk=class extends Wk{constructor(){super(...arguments),this.profile={}}},Xk=class extends Zk{constructor(){super(...arguments),this.report={rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},$k=class extends Xk{constructor(){super(...arguments),this.rule_engine={}}},ev=class extends $k{constructor(){super(...arguments),this.saasbi={}}},Av=class extends ev{constructor(){super(...arguments),this.scim={}}},tv=class extends Av{constructor(){super(...arguments),this.search_in_app={}}},rv=class extends tv{constructor(){super(...arguments),this.search={dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v2:{dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},av=class extends rv{constructor(){super(...arguments),this.security_and_compliance={openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{deviceApplyRecord:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_apply_records/:device_apply_record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},deviceRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mine:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/mine`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},iv=class extends av{constructor(){super(...arguments),this.security_plugin={}}},ov=class extends iv{constructor(){super(...arguments),this.sheet_ai={}}},nv=class extends ov{constructor(){super(...arguments),this.sheets={spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v3:{spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},sv=class extends nv{constructor(){super(...arguments),this.slides_ai={}}},gv=class extends sv{constructor(){super(...arguments),this.slides={}}},cv=class extends gv{constructor(){super(...arguments),this.spark={v1:{appTable:{deleteTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),postTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patchTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdateTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTableDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTableList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTableRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appEnum:{getEnumDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums/:enum_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getEnumList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appView:{getViewRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/views/:view_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appStorage:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage`,A),method:"GET",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadInitialize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/initialize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadComplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{icon:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/icon`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadHtmlCodeAndRelease:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/upload_and_release_html_code`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),getAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/sql_commands`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},directoryUser:{idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/directory/user/id_convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Iv=class extends cv{constructor(){super(...arguments),this.speech_to_text={speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},lv=class extends Iv{constructor(){super(...arguments),this.subscriptions={}}},pv=class extends lv{constructor(){super(...arguments),this.task={task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{task:{tasklists:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/tasklists`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_dependencies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_dependencies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setAncestorTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/set_ancestor_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_tasklist`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_tasklist`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},comment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},section:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tasksWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tasklist:{tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/add_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/remove_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customField:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tasklistActivitySubscription:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customFieldOption:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskV2:{taskSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/task_v2/task_subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listRelatedTaskWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listRelatedTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskSubtask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},dv=class extends pv{constructor(){super(...arguments),this.tenant={tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v2:{tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},hv=class extends dv{constructor(){super(...arguments),this.translation={text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ev=class extends hv{constructor(){super(...arguments),this.trust_layer={}}},Cv=class extends Ev{constructor(){super(...arguments),this.trust_party={v1:{collaborationTenantCollaborationUser:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_users/:target_user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationTenantCollaborationDepartment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_departments/:target_department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),visibleOrganization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/visible_organization`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},uv=class extends Cv{constructor(){super(...arguments),this.unified_kms_log={}}},Bv=class extends uv{constructor(){super(...arguments),this.unified_kms={}}},fv=class extends Bv{constructor(){super(...arguments),this.vault={}}},Qv=class extends fv{constructor(){super(...arguments),this.vc={material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},yv=class extends Qv{constructor(){super(...arguments),this.verification={v1:{verification:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/verification/v1/verification`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},mv=class extends yv{constructor(){super(...arguments),this.wiki={spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{node:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Sv=class extends mv{constructor(){super(...arguments),this.workplace={workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Mg={error:(...n)=>{console.log("[error]:",...n)},warn:(...n)=>{console.warn("[warn]:",...n)},info:(...n)=>{console.info("[info]:",...n)},debug:(...n)=>{console.debug("[debug]:",...n)},trace:(...n)=>{console.trace("[trace]:",...n)}},Tc=class{constructor(t,o){this.level=t,this.logger=o}error(...t){this.level>=co.error&&this.logger.error(t)}warn(...t){this.level>=co.warn&&this.logger.warn(t)}info(...t){this.level>=co.info&&this.logger.info(t)}debug(...t){this.level>=co.debug&&this.logger.debug(t)}trace(...t){this.level>=co.trace&&this.logger.trace(t)}},wv=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.logger.debug("app ticket manager is ready"),this.checkAppTicket()}checkAppTicket(){var t;return h(this,void 0,void 0,function*(){this.appType===us.ISV&&((yield(t=this.cache)===null||t===void 0?void 0:t.get(Bu,{namespace:this.appId}))||this.requestAppTicket())})}requestAppTicket(){return h(this,void 0,void 0,function*(){this.logger.debug("request app ticket"),yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,{app_id:this.appId,app_secret:this.appSecret}).catch(t=>{this.logger.error(t)})})}getAppTicket(){var t;return h(this,void 0,void 0,function*(){let o=yield(t=this.cache)===null||t===void 0?void 0:t.get(Bu,{namespace:this.appId});if(o)return this.logger.debug("use cache app ticket"),o;yield this.requestAppTicket()})}},xm="/oauth/v3/token",INe="urn:ietf:params:oauth:grant-type:jwt-bearer",vW="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",lNe="authorization_code",pNe="refresh_token",zv="X-Target-Service",PW=7100,Vv=7101,GW=7102,Wv=7104,dNe=Object.freeze({"open.feishu.cn":"https://accounts.feishu.cn","open.larksuite.com":"https://accounts.larksuite.com"}),ri=class extends Error{constructor(t,o){super(o),this.name="ClientAssertionError",this.code=t,this.msg=o}},Gd=class extends Error{constructor(t,o,i,e){super(e||i||"access token request failed"),this.name="AccessTokenError",this.statusCode=t,this.code=o,this.error=i,this.errorDescription=e}},Zv=n=>n.includes("://")?n:`https://${n}`;function Xv(n){let t=new URL(Zv(n));if(!t.host)throw new Error(`invalid url: ${n}`);return t.host}function $v(n){if(n.oauthBaseUrl)return Zv(n.oauthBaseUrl).replace(/\/+$/,"");let t=Xv(n.domain),o=dNe[t];if(o)return o;throw new Error("oauthBaseUrl is not configured. When domain is a non-default value (neither open.feishu.cn nor open.larksuite.com), set oauthBaseUrl explicitly.")}function FW(n){return Xv($v(n))}function eP(n,t){let o=new URL(Zv(n.targetService));if(o.protocol!=="https:")throw new Error("targetService must use https");if(o.username||o.password)throw new Error("targetService must not contain userinfo");let e=`${n.targetPrefix||""}${t}`.replace(/\/{2,}/g,"/");if(/(^|\/)\.\.(\/|$)/.test(e))throw new Error("targetPrefix must not contain path traversal");return`${o.protocol}//${o.host}${e}`}function hNe(n,t){var o,i;let e=(o=t?.code)!==null&&o!==void 0?o:"unknown",a=(i=t?.msg)!==null&&i!==void 0?i:"no message";return`failed to get ${n}, code: ${e}, msg: ${a}`}var Dv=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.appTicketManager=new wv({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance}),this.logger.debug("token manager is ready")}requestToken(t,o,i){return h(this,void 0,void 0,function*(){let e=yield this.httpInstance.post(t,o).catch(a=>{throw this.logger.error(a),a});if(!e||!e[i])throw new Error(hNe(i,e));return e})}getCustomTenantAccessToken(){var t,o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)return this.getTenantTokenByClientAssertion();let i=yield(t=this.cache)===null||t===void 0?void 0:t.get(du,{namespace:this.appId});if(i)return this.logger.debug("use cache token"),i;this.logger.debug("request token");let{tenant_access_token:e,expire:a}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,{app_id:this.appId,app_secret:this.appSecret},"tenant_access_token");return yield(o=this.cache)===null||o===void 0?void 0:o.set(du,e,new Date().getTime()+a*1e3-180*1e3,{namespace:this.appId}),e})}getTenantTokenByClientAssertion(){var t,o,i,e,a,A,r,s;return h(this,void 0,void 0,function*(){let g=$v({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),c=FW({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),I=yield(t=this.cache)===null||t===void 0?void 0:t.get(du,{namespace:this.appId});if(I)return this.logger.debug("use cache token"),I;let d;try{d=yield this.clientAssertionProvider.retrieveToken(c)}catch(T){throw new ri(GW,T?.message||"client assertion provider failed")}if(!d||!d.value)throw new ri(Vv,"client assertion token is empty");let B=`${g}${xm}`,f={};d.targetInfo&&(B=eP(d.targetInfo,xm),f[zv]=c),this.logger.debug("request token (client assertion)");let Q;try{Q=yield this.httpInstance.request({method:"post",url:B,headers:f,data:{grant_type:INe,client_assertion_type:vW,client_assertion:d.value,client_id:this.appId}})}catch(T){throw this.logger.error(T),new ri(((i=(o=T?.response)===null||o===void 0?void 0:o.data)===null||i===void 0?void 0:i.code)||0,((a=(e=T?.response)===null||e===void 0?void 0:e.data)===null||a===void 0?void 0:a.error_description)||((r=(A=T?.response)===null||A===void 0?void 0:A.data)===null||r===void 0?void 0:r.error)||"client assertion token exchange failed")}let y=Q?.access_token;if(!y)throw new ri(Q?.code||0,Q?.error_description||Q?.error||"oauth token response missing access token");let m=Number(Q?.expires_in)||0;return yield(s=this.cache)===null||s===void 0?void 0:s.set(du,y,new Date().getTime()+Math.max(m-180,0)*1e3,{namespace:this.appId}),y})}getMarketTenantAccessToken(t){var o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)throw new ri(PW,"ClientAssertion mode is not supported for ISV apps");if(!t){this.logger.error("market app request need tenant key");return}let i=yield(o=this.cache)===null||o===void 0?void 0:o.get(`larkMarketAccessToken${t}`,{namespace:this.appId});if(i)return this.logger.debug("use cache token"),i;this.logger.debug("get app ticket");let e=yield this.appTicketManager.getAppTicket();if(!e){this.logger.warn("no app ticket");return}this.logger.debug("get app access token");let{app_access_token:a}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/app_access_token`,{app_id:this.appId,app_secret:this.appSecret,app_ticket:e},"app_access_token");this.logger.debug("get tenant access token");let{tenant_access_token:A,expire:r}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token`,{app_access_token:a,tenant_key:t},"tenant_access_token");return yield this.cache.set(`larkMarketAccessToken${t}`,A,new Date().getTime()+r*1e3-180*1e3,{namespace:this.appId}),A})}getTenantAccessToken(t){return h(this,void 0,void 0,function*(){return Km(this.appType===us.SelfBuild,()=>h(this,void 0,void 0,function*(){this.logger.debug("get custom app token")})),Km(this.appType===us.ISV,()=>h(this,void 0,void 0,function*(){this.logger.debug("get market app token ")})),this.appType===us.SelfBuild?yield this.getCustomTenantAccessToken():yield this.getMarketTenantAccessToken(t?.[Um])})}},LW=(n,t)=>{let o=Object.assign({},n);for(let[i,e]of Object.entries(t))e!==void 0&&(o[i]=e);return o},Ov=class{constructor(t){this.client=t.client}getCacheKey(t,o){return`${o?.namespace||this.client.appId}/${sNe.toString()}/${t}`}calibrateTime(t){return new Date().getTime()+(t||0)*1e3-180*1e3}initWithCode(t,o){return h(this,void 0,void 0,function*(){let i={};for(let[e,a]of Object.entries(t)){let A=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:a}});if(A.code!==0){this.client.logger.error("init user access token error",e,A.msg||A.message);continue}if(!A.data){this.client.logger.error("user access code expired",e,a);continue}i[e]={code:a,token:A.data.access_token,refreshToken:A.data.refresh_token,expiredTime:this.calibrateTime(A.data.expires_in)}}return yield this.update(i,{namespace:o?.namespace}),i})}update(t,o){return h(this,void 0,void 0,function*(){for(let[i,e]of Object.entries(t)){let a=this.getCacheKey(i,{namespace:o?.namespace}),A=(yield this.client.cache.get(a))||{},{code:r,token:s,refreshToken:g,expiredTime:c}=e,I=LW(A,{code:r,token:s,refreshToken:g,expiredTime:c});yield this.client.cache.set(a,I,1/0)}})}get(t,o){return h(this,void 0,void 0,function*(){let i=this.getCacheKey(t,{namespace:o?.namespace}),e=yield this.client.cache.get(i);if(!e){this.client.logger.error("user access token needs to be initialized or updated first");return}let{token:a,code:A,refreshToken:r,expiredTime:s}=e;if(a&&s&&s-new Date().getTime()>0)return a;if(r){let g=yield this.client.authen.oidcRefreshAccessToken.create({data:{grant_type:"refresh_token",refresh_token:r}});if(g.code===0&&g.data)return yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}),g.data.access_token;this.client.logger.error("get user access token by refresh token failed.",g.msg);return}if(A){let g=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:A}});g.code===0&&g.data?yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}):this.client.logger.error("get user access token by code failed.",g.msg)}})}},vd=n=>n===""||n===0||n===null||n===void 0?void 0:n,ENe=n=>{if(!n||n.error)return!0;let{code:t}=n;return t!==void 0&&t!==0&&t!=="0"&&t!==""},bv=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.domain=t.domain,this.httpInstance=t.httpInstance,this.logger=t.logger}retrieveByAuthorizationCode(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:lNe,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,scope:t.scope},t.headers)})}refresh(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:pNe,refresh_token:t.refreshToken,scope:t.scope},t.headers)})}doRequest(t,o){return h(this,void 0,void 0,function*(){let i=$v({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),e=FW({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),a={client_id:this.appId};for(let[I,d]of Object.entries(t))d!=null&&(a[I]=d);let A=`${i}${xm}`,r=Object.assign({},o||{});if(this.clientAssertionProvider){let I;try{I=yield this.clientAssertionProvider.retrieveToken(e)}catch(d){throw new ri(GW,d?.message||"client assertion provider failed")}if(!I||!I.value)throw new ri(Vv,"client assertion token is empty");a.client_assertion_type=vW,a.client_assertion=I.value,I.targetInfo&&(A=eP(I.targetInfo,xm),r[zv]=e)}else if(this.appSecret)a.client_secret=this.appSecret;else throw new ri(Wv,"appSecret and clientAssertionProvider cannot both be empty for accessToken APIs");let s=200,g;try{g=yield this.httpInstance.request({method:"post",url:A,headers:r,data:a})}catch(I){if(this.logger.error(I),I?.response)s=I.response.status,g=I.response.data;else throw new Gd(0,0,"",I?.message||"oauth token request failed")}if(s!==200||ENe(g))throw new Gd(s,g?.code||0,g?.error||"",g?.error_description||g?.msg||"");let c=vd(g?.access_token);if(!c)throw new Gd(s,g?.code||0,g?.error||"",g?.error_description||"oauth token response missing access_token");return{accessToken:c,tokenType:vd(g.token_type),expiresIn:vd(g.expires_in),refreshToken:vd(g.refresh_token),refreshTokenExpiresIn:vd(g.refresh_token_expires_in),scope:vd(g.scope)}})}},Ym=class extends Sv{constructor(t){if(super(),this.appId="",this.appSecret="",this.helpDeskId="",this.helpDeskToken="",this.appType=us.SelfBuild,this.logger=new Tc(t.loggerLevel||co.info,t.logger||Mg),this.appId=t.appId,this.appSecret=t.appSecret||"",this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.disableTokenCache=t.disableTokenCache,this.userAgent=qv(t.source,{extraTags:t.extraUaTags}),Km(!this.appId,()=>this.logger.error("appId is needed")),this.helpDeskId=t.helpDeskId,this.helpDeskToken=t.helpDeskToken,this.appType=t?.appType||us.SelfBuild,!this.appSecret&&!this.clientAssertionProvider)throw new ri(Wv,"appSecret or clientAssertionProvider is required");if(this.clientAssertionProvider&&this.appType===us.ISV)throw new ri(PW,"ClientAssertion mode is not supported for ISV apps");this.domain=kW(t.domain||Bs.Feishu),this.logger.debug(`use domain url: ${this.domain}`),this.cache=t.cache||Qu,this.httpInstance=t.httpInstance||Fd,this.tokenManager=new Dv({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl}),this.userAccessToken=new Ov({client:this}),this.accessToken=new bv({appId:this.appId,appSecret:this.appSecret,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl,domain:this.domain,httpInstance:this.httpInstance,logger:this.logger}),this.logger.info("client ready")}formatPayload(t,o){var i,e,a;return h(this,void 0,void 0,function*(){let A=["lark","params","data","headers","path"].reduce((g,c)=>(g[c]=o?.[c]||{},g),{}),r=(i=A?.lark)===null||i===void 0?void 0:i[RW];if(r)this.logger.debug("use passed token"),A.headers.Authorization=`Bearer ${r}`;else if(!this.disableTokenCache){let g=yield this.tokenManager.getTenantAccessToken({[Um]:(e=A?.lark)===null||e===void 0?void 0:e[Um]});g?A.headers.Authorization=`Bearer ${g}`:this.logger.warn("failed to obtain token")}if((a=A?.lark)===null||a===void 0?void 0:a[NW]){this.logger.debug("generate help desk credential");let g=gNe(`${this.helpDeskId}:${this.helpDeskToken}`);A.headers["X-Lark-Helpdesk-Authorization"]=`Bearer ${g}`}return{params:Object.assign(Object.assign({},t?.params||{}),A.params),headers:Object.assign(Object.assign({"User-Agent":this.userAgent},t?.headers||{}),A.headers),data:Object.assign(Object.assign({},t?.data||{}),A.data),path:Object.assign(Object.assign({},t?.path||{}),A.path)}})}request(t,o){var i;return h(this,void 0,void 0,function*(){let{data:e,params:a,headers:A,url:r}=t,s=Y(t,["data","params","headers","url"]),g=yield this.formatPayload({data:e,params:a,headers:A},o),c=((i=t.method)===null||i===void 0?void 0:i.toLowerCase())==="get"&&Object.keys(g.data).length===0?void 0:g.data;return this.logger.trace(`send request [${t.method}]: ${t.url}`),yield this.httpInstance.request(Object.assign(Object.assign({},s),{url:/^http/.test(r)?r:`${this.domain}/${cNe(r)}`,headers:g.headers,data:c,params:g.params})).catch(d=>{throw this.logger.error(d),d})})}},CNe=n=>n.reduce((t,o)=>(0,_W.default)(t,o),{}),uNe=n=>({lark:{[Um]:n}}),BNe=()=>({lark:{[NW]:!0}}),fNe=n=>({headers:{Authorization:`Bearer ${n}`}}),QNe=n=>({lark:{[RW]:n}}),jm=class{constructor(t){let{encryptKey:o,verificationToken:i,logger:e}=t;this.verificationToken=i,this.encryptKey=o,this.logger=e,o&&(this.aesCipher=new fu(o))}parse(t){var o,i;let e=(()=>{var r;let s=t||{},{encrypt:g}=s,c=Y(s,["encrypt"]);if(g)try{return Object.assign(Object.assign({},JSON.parse((r=this.aesCipher)===null||r===void 0?void 0:r.decrypt(g))),c)}catch{return this.logger.error("parse encrypt data failed"),{}}return c})();if("schema"in e){let{header:r,event:s}=e,g=Y(e,["header","event"]);return Object.assign(Object.assign(Object.assign({[Lm]:(o=e?.header)===null||o===void 0?void 0:o.event_type},g),r),s)}let{event:a}=e,A=Y(e,["event"]);return Object.assign(Object.assign({[Lm]:(i=e?.event)===null||i===void 0?void 0:i.type},a),A)}checkIsCardEventValidated(t){if("encrypt"in t||"schema"in t)return this.checkIsEventValidated(t);let{"x-lark-request-timestamp":o,"x-lark-request-nonce":i,"x-lark-signature":e}=t.headers;return this.verificationToken?Fm.createHash("sha1").update(o+i+this.verificationToken+JSON.stringify(t)).digest("hex")===e:!0}checkIsEventValidated(t){if(!this.encryptKey)return!0;let{"x-lark-request-timestamp":o,"x-lark-request-nonce":i,"x-lark-signature":e}=t.headers,a=o+i+this.encryptKey+JSON.stringify(t);return Fm.createHash("sha256").update(a).digest("hex")===e}},yNe="app_ticket",Jm=class{constructor(t){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{encryptKey:o,verificationToken:i}=t;this.encryptKey=o||"",this.verificationToken=i||"",this.logger=new Tc(t.loggerLevel||co.info,t.logger||Mg),this.requestHandle=new jm({encryptKey:o,verificationToken:i,logger:this.logger}),this.cache=t.cache||Qu,this.registerAppTicketHandle(),this.logger.info("event-dispatch is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:i}=t;o?(yield this.cache.set(Bu,o,void 0,{namespace:i}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.has(o)&&o!==yNe&&this.logger.error(`this ${o} handle is registered`),this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t,o){var i,e;return h(this,void 0,void 0,function*(){if(o?.needCheck!==!1&&!(!((i=this.requestHandle)===null||i===void 0)&&i.checkIsEventValidated(t))){this.logger.warn("verification failed event");return}let A=(e=this.requestHandle)===null||e===void 0?void 0:e.parse(t),r=A[Lm];if(this.handles.has(r)){let s=yield this.handles.get(r)(A);return this.logger.debug(`execute ${r} handle`),s}return this.logger.warn(`no ${r} handle`),`no ${r} event handle`})}},Mv=class{constructor(t,o){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{verificationToken:i,encryptKey:e}=t;this.encryptKey=e||"",this.verificationToken=i||"",this.cardHandler=o,this.logger=new Tc(t.loggerLevel||co.info,t.logger||Mg),this.requestHandle=new jm({encryptKey:e,verificationToken:i,logger:this.logger}),this.cache=t.cache||Qu,this.registerAppTicketHandle(),this.logger.info("card-action-handle is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:i}=t;o?(yield this.cache.set(Bu,o,void 0,{namespace:i}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t){var o,i;return h(this,void 0,void 0,function*(){if(!(!((o=this.requestHandle)===null||o===void 0)&&o.checkIsCardEventValidated(t))){this.logger.warn("verification failed event");return}let e=(i=this.requestHandle)===null||i===void 0?void 0:i.parse(t),a=e[Lm];if(this.handles.has(a))try{return yield this.handles.get(a)(e)}catch(A){this.logger.error(A);return}try{let A=yield this.cardHandler(e);return this.logger.debug("execute card handle"),A}catch(A){this.logger.error(A)}})}},$m=n=>new Promise(t=>{let o="";n.on("data",i=>{o+=i}),n.on("end",()=>{try{let i=JSON.parse(o);t(i)}catch{t("")}})}),yu=(n,t)=>{if("encrypt"in n&&!t.encryptKey)throw new Error("auto-challenge need encryptKey, please check for missing in dispatcher");let o="encrypt"in n?JSON.parse(new fu(t.encryptKey).decrypt(n.encrypt)):n;return{isChallenge:o.type==="url_verification",challenge:{challenge:o.challenge}}},mNe=(n,t,o)=>(i,e)=>h(void 0,void 0,void 0,function*(){if(i.url!==n)return;let a=Object.assign(Object.create({headers:i.headers}),yield $m(i));if(o?.autoChallenge||!1){let{isChallenge:s,challenge:g}=yu(a,{encryptKey:t.encryptKey});if(s){e.end(JSON.stringify(g));return}}let r=yield t.invoke(a);e.end(JSON.stringify(r))}),SNe=(n,t)=>(o,i)=>h(void 0,void 0,void 0,function*(){let e=yield h(void 0,void 0,void 0,function*(){return o.body?o.body:o.complete?((t?.logger||Mg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield $m(o)}),a=Object.assign(Object.create({headers:o.headers}),e);if(t?.autoChallenge||!1){let{isChallenge:s,challenge:g}=yu(a,{encryptKey:n.encryptKey});if(s){i.json(g);return}}let r=yield n.invoke(a);i.json(r)}),wNe=(n,t,o)=>(i,e)=>h(void 0,void 0,void 0,function*(){let{originalUrl:a,req:A,request:r}=i;if(a===n){let s=yield h(void 0,void 0,void 0,function*(){return r.body?r.body:A.complete?((o?.logger||Mg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield $m(A)}),g=Object.assign(Object.create({headers:A.headers}),s);if(o?.autoChallenge||!1){let{isChallenge:d,challenge:B}=yu(g,{encryptKey:t.encryptKey});if(d){i.body=B,yield e();return}}let I=yield t.invoke(g);i.body=JSON.stringify(I)}yield e()}),DNe=(n,t)=>(o,i)=>h(void 0,void 0,void 0,function*(){let{req:e,request:a}=o,A=yield h(void 0,void 0,void 0,function*(){return a.body?a.body:e.complete?((t?.logger||Mg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield $m(e)}),r=Object.assign(Object.create({headers:e.headers}),A);if(t?.autoChallenge||!1){let{isChallenge:c,challenge:I}=yu(r,{encryptKey:n.encryptKey});if(c){o.body=I,yield i();return}}let g=yield n.invoke(r);o.body=JSON.stringify(g),yield i()}),ONe=n=>{let{title:t,content:o}=n;return JSON.stringify({config:{wide_screen_mode:!0},elements:[{tag:"markdown",content:o}],header:{template:"blue",title:{content:t,tag:"plain_text"}}})},bNe=Object.freeze({__proto__:null,defaultCard:ONe}),bg=Rm();bg.util.Long=void 0;bg.configure();var _c=bg.Reader,dW=bg.Writer,HA=bg.util,xo=bg.roots.default||(bg.roots.default={}),UW=xo.pbbp2=(()=>{let n={};return n.Header=(function(){function t(o){if(o)for(let i=Object.keys(o),e=0;e>>3){case 1:{A.key=i.string();break}case 2:{A.value=i.string();break}default:i.skipType(r&7);break}}if(!A.hasOwnProperty("key"))throw HA.ProtocolError("missing required 'key'",{instance:A});if(!A.hasOwnProperty("value"))throw HA.ProtocolError("missing required 'value'",{instance:A});return A},t.decodeDelimited=function(i){return i instanceof _c||(i=new _c(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":HA.isString(i.key)?HA.isString(i.value)?null:"value: string expected":"key: string expected"},t.fromObject=function(i){if(i instanceof xo.pbbp2.Header)return i;let e=new xo.pbbp2.Header;return i.key!=null&&(e.key=String(i.key)),i.value!=null&&(e.value=String(i.value)),e},t.toObject=function(i,e){e||(e={});let a={};return e.defaults&&(a.key="",a.value=""),i.key!=null&&i.hasOwnProperty("key")&&(a.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(a.value=i.value),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,bg.util.toJSONOptions)},t.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/pbbp2.Header"},t})(),n.Frame=(function(){function t(o){if(this.headers=[],o)for(let i=Object.keys(o),e=0;e>>3){case 1:{A.SeqID=i.uint64();break}case 2:{A.LogID=i.uint64();break}case 3:{A.service=i.int32();break}case 4:{A.method=i.int32();break}case 5:{A.headers&&A.headers.length||(A.headers=[]),A.headers.push(xo.pbbp2.Header.decode(i,i.uint32()));break}case 6:{A.payloadEncoding=i.string();break}case 7:{A.payloadType=i.string();break}case 8:{A.payload=i.bytes();break}case 9:{A.LogIDNew=i.string();break}default:i.skipType(r&7);break}}if(!A.hasOwnProperty("SeqID"))throw HA.ProtocolError("missing required 'SeqID'",{instance:A});if(!A.hasOwnProperty("LogID"))throw HA.ProtocolError("missing required 'LogID'",{instance:A});if(!A.hasOwnProperty("service"))throw HA.ProtocolError("missing required 'service'",{instance:A});if(!A.hasOwnProperty("method"))throw HA.ProtocolError("missing required 'method'",{instance:A});return A},t.decodeDelimited=function(i){return i instanceof _c||(i=new _c(i)),this.decode(i,i.uint32())},t.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(!HA.isInteger(i.SeqID)&&!(i.SeqID&&HA.isInteger(i.SeqID.low)&&HA.isInteger(i.SeqID.high)))return"SeqID: integer|Long expected";if(!HA.isInteger(i.LogID)&&!(i.LogID&&HA.isInteger(i.LogID.low)&&HA.isInteger(i.LogID.high)))return"LogID: integer|Long expected";if(!HA.isInteger(i.service))return"service: integer expected";if(!HA.isInteger(i.method))return"method: integer expected";if(i.headers!=null&&i.hasOwnProperty("headers")){if(!Array.isArray(i.headers))return"headers: array expected";for(let e=0;e>>0,i.SeqID.high>>>0).toNumber(!0))),i.LogID!=null&&(HA.Long?(e.LogID=HA.Long.fromValue(i.LogID)).unsigned=!0:typeof i.LogID=="string"?e.LogID=parseInt(i.LogID,10):typeof i.LogID=="number"?e.LogID=i.LogID:typeof i.LogID=="object"&&(e.LogID=new HA.LongBits(i.LogID.low>>>0,i.LogID.high>>>0).toNumber(!0))),i.service!=null&&(e.service=i.service|0),i.method!=null&&(e.method=i.method|0),i.headers){if(!Array.isArray(i.headers))throw TypeError(".pbbp2.Frame.headers: array expected");e.headers=[];for(let a=0;a=0&&(e.payload=i.payload)),i.LogIDNew!=null&&(e.LogIDNew=String(i.LogIDNew)),e},t.toObject=function(i,e){e||(e={});let a={};if((e.arrays||e.defaults)&&(a.headers=[]),e.defaults){if(HA.Long){let A=new HA.Long(0,0,!0);a.SeqID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else a.SeqID=e.longs===String?"0":0;if(HA.Long){let A=new HA.Long(0,0,!0);a.LogID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else a.LogID=e.longs===String?"0":0;a.service=0,a.method=0,a.payloadEncoding="",a.payloadType="",e.bytes===String?a.payload="":(a.payload=[],e.bytes!==Array&&(a.payload=HA.newBuffer(a.payload))),a.LogIDNew=""}if(i.SeqID!=null&&i.hasOwnProperty("SeqID")&&(typeof i.SeqID=="number"?a.SeqID=e.longs===String?String(i.SeqID):i.SeqID:a.SeqID=e.longs===String?HA.Long.prototype.toString.call(i.SeqID):e.longs===Number?new HA.LongBits(i.SeqID.low>>>0,i.SeqID.high>>>0).toNumber(!0):i.SeqID),i.LogID!=null&&i.hasOwnProperty("LogID")&&(typeof i.LogID=="number"?a.LogID=e.longs===String?String(i.LogID):i.LogID:a.LogID=e.longs===String?HA.Long.prototype.toString.call(i.LogID):e.longs===Number?new HA.LongBits(i.LogID.low>>>0,i.LogID.high>>>0).toNumber(!0):i.LogID),i.service!=null&&i.hasOwnProperty("service")&&(a.service=i.service),i.method!=null&&i.hasOwnProperty("method")&&(a.method=i.method),i.headers&&i.headers.length){a.headers=[];for(let A=0;AUW.Frame.decode(n),_v=class{constructor(){this.client={appId:"",appSecret:"",domain:Bs.Feishu},this.ws={connectUrl:"",pingInterval:120*1e3,reconnectCount:-1,reconnectInterval:120*1e3,reconnectNonce:30*1e3,deviceId:"",serviceId:"",autoReconnect:!0},this.wsInstance=null}updateClient(t){Object.assign(this.client,t)}updateWs(t){Object.assign(this.ws,t)}getClient(t){return t===void 0?this.client:this.client[t]}getWS(t){return t===void 0?this.ws:this.ws[t]}get wsConfigUrl(){return`${this.getClient("domain")}/callback/ws/endpoint`}setWSInstance(t){this.wsInstance=t}getWSInstance(){return this.wsInstance}},Tv=class{constructor(t){this.cache=new Map,this.logger=t.logger,this.clearAtInterval()}mergeData(t){let{message_id:o,sum:i,seq:e,trace_id:a,data:A}=t,r=this.cache.get(o);if(r)r.buffer[e]=A;else{let g=new Array(i).fill(void 0);g[e]=A,this.cache.set(o,{buffer:g,trace_id:a,message_id:o,create_time:Date.now()})}let s=this.cache.get(o);if(s?.buffer.every(g=>!!g)){let g=s.buffer.reduce((d,B)=>{let f=new Uint8Array(d.byteLength+B.byteLength);return f.set(d,0),f.set(B,d.length),f},new Uint8Array([])),c=new TextDecoder("utf-8").decode(g),I=JSON.parse(c);return this.deleteCache(o),I}return null}deleteCache(t){this.cache.delete(t)}clearAtInterval(){if(this.timer)return;let t=1e4;this.timer=setInterval(()=>{let o=Date.now();this.cache.forEach((i,e)=>{var a;let{create_time:A,trace_id:r,message_id:s}=i;o-A>t&&((a=this.logger)===null||a===void 0||a.debug(`${s} event data is deleted as expired, trace_id: ${r}`),this.deleteCache(e))})},t),typeof this.timer.unref=="function"&&this.timer.unref()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=void 0),this.cache.clear()}},Eu;(function(n){n[n.ok=0]="ok",n[n.system_busy=1]="system_busy",n[n.forbidden=403]="forbidden",n[n.auth_failed=514]="auth_failed",n[n.internal_error=1000040343]="internal_error",n[n.exceed_conn_limit=1000040350]="exceed_conn_limit"})(Eu||(Eu={}));var Cu;(function(n){n[n.control=0]="control",n[n.data=1]="data"})(Cu||(Cu={}));var uu;(function(n){n.type="type",n.message_id="message_id",n.sum="sum",n.seq="seq",n.trace_id="trace_id",n.biz_rt="biz_rt",n.handshake_status="handshake-status",n.handshake_msg="handshake-msg",n.handshake_autherrcode="handshake-autherrcode"})(uu||(uu={}));var Pd;(function(n){n.event="event",n.card="card",n.ping="ping",n.pong="pong"})(Pd||(Pd={}));var qm;(function(n){n[n.ok=200]="ok",n[n.internal_server_error=500]="internal_server_error"})(qm||(qm={}));var zm=class{constructor(t){var o;this.wsConfig=new _v,this.reconnectGeneration=0,this.pendingWsInstance=null,this.isConnecting=!1,this.reconnectInfo={lastConnectTime:0,nextConnectTime:0},this.hasEverConnected=!1,this.terminalError=!1,this.currentReconnectAttempts=0;let{appId:i,appSecret:e,clientAssertionProvider:a,agent:A,domain:r=Bs.Feishu,httpInstance:s=Fd,loggerLevel:g=co.info,logger:c=Mg,autoReconnect:I=!0,source:d,extraUaTags:B,onReady:f,onError:Q,onReconnecting:y,onReconnected:m,handshakeTimeoutMs:T,wsConfig:_}=t;if(this.userAgent=qv(d,{extraTags:B}),this.logger=new Tc(g,c),Km(!i,()=>this.logger.error("appId is needed")),!e&&!a)throw new ri(Wv,"appSecret or clientAssertionProvider is required");this.agent=A,this.dataCache=new Tv({logger:this.logger}),this.httpInstance=s,this.wsConfig.updateClient({appId:i,appSecret:e||"",clientAssertionProvider:a,domain:kW(r)}),this.wsConfig.updateWs({autoReconnect:I}),this.onReady=f,this.onError=Q,this.onReconnecting=y,this.onReconnected=m,this.handshakeTimeoutMs=T,this.pingTimeoutSec=(o=_?.pingTimeout)!==null&&o!==void 0?o:0}armLiveness(){this.pingTimeoutSec&&(this.livenessTimer&&clearTimeout(this.livenessTimer),this.livenessTimer=setTimeout(()=>{var t;this.livenessTimer=void 0,this.logger.warn("[ws]",`no pong/inbound within ${this.pingTimeoutSec}s of last ping, terminating to trigger reconnect`);try{(t=this.wsConfig.getWSInstance())===null||t===void 0||t.terminate()}catch{}},this.pingTimeoutSec*1e3))}clearLiveness(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=void 0)}safeInvoke(t,o,...i){if(o)try{o(...i)}catch(e){this.logger.error(`[ws] ${t} callback threw`,e)}}pullConnectConfig(){return h(this,void 0,void 0,function*(){let{appId:t,appSecret:o,clientAssertionProvider:i,domain:e}=this.wsConfig.getClient(),a="/callback/ws/endpoint",A=this.wsConfig.wsConfigUrl,r={locale:"zh","User-Agent":this.userAgent},s={AppID:t};try{if(i){let Q=Xv(e),y=yield i.retrieveToken(Q);if(!y||!y.value)throw new ri(Vv,"client assertion token is empty");s.AppSecret="",s.ClientAssertion=y.value,y.targetInfo&&(A=eP(y.targetInfo,a),r[zv]=Q)}else s.AppSecret=o;let{code:g,data:{URL:c,ClientConfig:I},msg:d}=yield this.httpInstance.request({method:"post",url:A,data:s,headers:r,timeout:15e3});if(g!==Eu.ok){let Q=g===Eu.system_busy?"system busy":d;return this.logger.error("[ws]",`code: ${g}, ${Q}`),g===Eu.internal_error?{ok:!1,retryable:!0}:{ok:!1,retryable:!1,error:`pullConnectConfig failed: code=${g}, msg=${Q}`}}let{device_id:B,service_id:f}=ANe.parse(c);return this.wsConfig.updateWs({connectUrl:c,deviceId:B,serviceId:f,pingInterval:I.PingInterval*1e3,reconnectCount:I.ReconnectCount,reconnectInterval:I.ReconnectInterval*1e3,reconnectNonce:I.ReconnectNonce*1e3}),this.logger.debug("[ws]",`get connect config success, ws url: ${c}`),{ok:!0}}catch(g){return this.logger.error("[ws]",g?.message||"system busy"),g instanceof ri?{ok:!1,retryable:!1,error:g.message}:{ok:!1,retryable:!0}}})}connect(){let t=this.wsConfig.getWS("connectUrl"),o;try{let{agent:i}=this;o=new Uo(t,{agent:i})}catch{this.logger.error("[ws]","new WebSocket error")}return o?(this.pendingWsInstance=o,new Promise(i=>{let e=!1,a,A=r=>{e||(e=!0,a&&clearTimeout(a),this.pendingWsInstance===o&&(this.pendingWsInstance=null),i(r))};this.handshakeTimeoutMs&&this.handshakeTimeoutMs>0&&(a=setTimeout(()=>{this.logger.error("[ws]",`handshake timeout after ${this.handshakeTimeoutMs}ms`),o.removeAllListeners("open");try{o.terminate()}catch{}A(!1)},this.handshakeTimeoutMs)),o.on("open",()=>{this.logger.debug("[ws]","ws connect success"),this.wsConfig.setWSInstance(o),this.pingLoop(),A(!0)}),o.on("error",()=>{this.logger.error("[ws]","ws connect failed"),A(!1)})})):Promise.resolve(!1)}reConnect(t=!1){return h(this,void 0,void 0,function*(){if(this.isConnecting&&!t){this.logger.debug("[ws]","repeat connection");return}this.isConnecting=!0;let o=++this.reconnectGeneration,i=()=>h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};this.reconnectInfo.lastConnectTime=Date.now();let c=yield this.pullConnectConfig();if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};if(!c.ok)return c;let I=yield this.connect();return o!==this.reconnectGeneration?{ok:!1,retryable:!1,cancelled:!0}:I?(this.communicate(),{ok:!0}):{ok:!1,retryable:!0}});this.pingInterval&&clearTimeout(this.pingInterval),this.reconnectInterval&&clearTimeout(this.reconnectInterval);let e=this.wsConfig.getWSInstance();if(t){e&&e?.terminate();let c={ok:!1,retryable:!0};try{c=yield i()}finally{o===this.reconnectGeneration&&(this.isConnecting=!1)}if(o!==this.reconnectGeneration||c.cancelled)return;if(c.ok)this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady);else if(c.retryable)this.logger.error("[ws]","connect failed"),yield this.reConnect();else{this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(c.error));return}this.logger.info("[ws]","ws client ready");return}let{autoReconnect:a,reconnectNonce:A,reconnectCount:r,reconnectInterval:s}=this.wsConfig.getWS();if(!a){this.hasEverConnected||(this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error("WebSocket connect failed and autoReconnect is disabled")));return}this.logger.info("[ws]","reconnect"),this.hasEverConnected&&this.safeInvoke("onReconnecting",this.onReconnecting),e&&e?.terminate(),this.wsConfig.setWSInstance(null);let g=A?A*Math.random():0;this.reconnectInterval=setTimeout(()=>h(this,void 0,void 0,function*(){(function c(I){return h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return;I++,this.currentReconnectAttempts=I;let d=yield i();if(o===this.reconnectGeneration){if(d.ok){this.logger.debug("[ws]","reconnect success"),this.currentReconnectAttempts=0,this.hasEverConnected?this.safeInvoke("onReconnected",this.onReconnected):(this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady)),this.isConnecting=!1;return}if(!d.retryable){this.isConnecting=!1,this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(d.error));return}if(this.logger.info("ws",`unable to connect to the server after trying ${I} times")`),r>=0&&I>=r){this.isConnecting=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(`WebSocket reconnect exhausted after ${I} attempts`));return}this.reconnectInterval=setTimeout(()=>{c.bind(this)(I)},s),this.reconnectInfo.nextConnectTime=Date.now()+s}})}).bind(this)(0)}),g),this.reconnectInfo.nextConnectTime=Date.now()+g})}pingLoop(){let{serviceId:t,pingInterval:o}=this.wsConfig.getWS(),i=this.wsConfig.getWSInstance();if(i?.readyState===Uo.OPEN){let e={headers:[{key:uu.type,value:Pd.ping}],service:Number(t),method:Cu.control,SeqID:0,LogID:0};this.sendMessage(e),this.armLiveness(),this.logger.trace("[ws]","ping success")}this.pingInterval=setTimeout(this.pingLoop.bind(this),o)}communicate(){let t=this.wsConfig.getWSInstance();t?.on("message",o=>h(this,void 0,void 0,function*(){this.clearLiveness();let i=MNe(o),{method:e}=i;e===Cu.control&&(yield this.handleControlData(i)),e===Cu.data&&(yield this.handleEventData(i))})),t?.on("error",o=>{this.logger.error("[ws]","ws error")}),t?.on("close",()=>{this.logger.debug("[ws]","client closed"),this.clearLiveness(),this.reConnect()})}handleControlData(t){var o;return h(this,void 0,void 0,function*(){let i=(o=t.headers.find(a=>a.key===uu.type))===null||o===void 0?void 0:o.value,e=t.payload;if(i!==Pd.ping&&i===Pd.pong&&e){this.logger.trace("[ws]","receive pong");let a=new TextDecoder("utf-8").decode(e),{PingInterval:A,ReconnectCount:r,ReconnectInterval:s,ReconnectNonce:g}=JSON.parse(a);this.wsConfig.updateWs({pingInterval:A*1e3,reconnectCount:r,reconnectInterval:s*1e3,reconnectNonce:g*1e3}),this.logger.trace("[ws]","update wsConfig with pong data")}})}handleEventData(t){var o;return h(this,void 0,void 0,function*(){let i=t.headers.reduce((f,Q)=>(f[Q.key]=Q.value,f),{}),{message_id:e,sum:a,seq:A,type:r,trace_id:s}=i,g=t.payload;if(r!==Pd.event)return;let c=this.dataCache.mergeData({message_id:e,sum:Number(a),seq:Number(A),trace_id:s,data:g});if(!c)return;this.logger.debug("[ws]",`receive message, message_type: ${r}; message_id: ${e}; trace_id: ${s}; data: ${c.data}`);let I={code:qm.ok},d=Date.now();try{let f=yield(o=this.eventDispatcher)===null||o===void 0?void 0:o.invoke(c,{needCheck:!1});f&&(I.data=Buffer.from(JSON.stringify(f)).toString("base64"))}catch(f){I.code=qm.internal_server_error,this.logger.error("[ws]",`invoke event failed, message_type: ${r}; message_id: ${e}; trace_id: ${s}; error: ${f}`)}let B=Date.now();this.sendMessage(Object.assign(Object.assign({},t),{headers:[...t.headers,{key:uu.biz_rt,value:String(d-B)}],payload:new TextEncoder().encode(JSON.stringify(I))}))})}sendMessage(t){var o;let i=this.wsConfig.getWSInstance();if(i?.readyState===Uo.OPEN){let e=UW.Frame.encode(t).finish();(o=this.wsConfig.getWSInstance())===null||o===void 0||o.send(e,a=>{a&&this.logger.error("[ws]","send data failed")})}}getReconnectInfo(){return this.reconnectInfo}getConnectionStatus(){return{state:this.computeState(),lastConnectTime:this.reconnectInfo.lastConnectTime||void 0,nextConnectTime:this.reconnectInfo.nextConnectTime||void 0,reconnectAttempts:this.currentReconnectAttempts}}computeState(){var t;return this.terminalError?"failed":this.isConnecting&&!this.hasEverConnected?"connecting":this.isConnecting&&this.hasEverConnected?"reconnecting":((t=this.wsConfig.getWSInstance())===null||t===void 0?void 0:t.readyState)===Uo.OPEN?"connected":"idle"}close(t={}){let{force:o=!1}=t;this.reconnectGeneration++,this.pingInterval&&(clearTimeout(this.pingInterval),this.pingInterval=void 0),this.reconnectInterval&&(clearTimeout(this.reconnectInterval),this.reconnectInterval=void 0),this.clearLiveness(),this.dataCache.destroy(),this.isConnecting=!1,this.currentReconnectAttempts=0;let i=this.pendingWsInstance;if(i){this.pendingWsInstance=null,i.removeAllListeners("open");try{o?i.terminate():i.close()}catch{}}let e=this.wsConfig.getWSInstance();e&&(e.removeAllListeners(),o?e.terminate():e.close(),this.wsConfig.setWSInstance(null)),this.logger.info("[ws]",`ws client closed manually${o?" (force)":""}`)}start(t){return h(this,void 0,void 0,function*(){let{appId:o}=this.wsConfig.getClient();if(!/^cli_[0-9a-fA-F]{16}$/.test(o)){this.logger.error("[ws]",`invalid appId: ${o}`);return}let{eventDispatcher:i}=t;if(!i){this.logger.warn("[ws]","client need to start with a eventDispatcher");return}let e=this.wsConfig.getWSInstance();if(this.terminalError&&(this.isConnecting=!1),this.isConnecting||e&&e.readyState!==Uo.CLOSED){this.logger.debug("[ws]","start ignored because client is already connecting or connected");return}this.terminalError=!1,this.currentReconnectAttempts=0,this.dataCache.clearAtInterval(),this.logger.info("[ws]",`receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in: +`+a)}}catch{}}throw i}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=Sn(this.defaults,o);let{transitional:i,paramsSerializer:e,headers:a}=o;i!==void 0&&kC.assertOptions(i,{silentJSONParsing:ti.transitional(ti.boolean),forcedJSONParsing:ti.transitional(ti.boolean),clarifyTimeoutError:ti.transitional(ti.boolean),legacyInterceptorReqResOrdering:ti.transitional(ti.boolean),advertiseZstdAcceptEncoding:ti.transitional(ti.boolean),validateStatusUndefinedResolves:ti.transitional(ti.boolean)},!1),e!=null&&(Z.isFunction(e)?o.paramsSerializer={serialize:e}:kC.assertOptions(e,{encode:ti.function,serialize:ti.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),kC.assertOptions(o,{baseUrl:ti.spelling("baseURL"),withXsrfToken:ti.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let A=a&&Z.merge(a.common,a[o.method]);a&&Z.forEach(["delete","get","head","post","put","patch","query","common"],f=>{delete a[f]}),o.headers=Ht.concat(A,a);let r=[],s=!0;this.interceptors.request.forEach(function(Q){if(typeof Q.runWhen=="function"&&Q.runWhen(o)===!1)return;s=s&&Q.synchronous;let y=o.transitional||Bc;y&&y.legacyInterceptorReqResOrdering?r.unshift(Q.fulfilled,Q.rejected):r.push(Q.fulfilled,Q.rejected)});let g=[];this.interceptors.response.forEach(function(Q){g.push(Q.fulfilled,Q.rejected)});let c,I=0,d;if(!s){let f=[RC.bind(this),void 0];for(f.unshift(...r),f.push(...g),d=f.length,c=Promise.resolve(o);IRC.call(this,B)))}catch(m){c=Promise.reject(m)}break}}if(!c)try{c=RC.call(this,B)}catch(f){c=Promise.reject(f)}for(I=0,d=g.length;I{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](e);i._listeners=null}),this.promise.then=e=>{let a,A=new Promise(r=>{i.subscribe(r),a=r}).then(e);return A.cancel=function(){i.unsubscribe(a)},A},t(function(a,A,r){i.reason||(i.reason=new oo(a,A,r),o(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){let t=new AbortController,o=i=>{t.abort(i)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new n(function(e){t=e}),cancel:t}}},$q=kN;function vN(n){return function(o){return n.apply(null,o)}}function PN(n){return Z.isObject(n)&&n.isAxiosError===!0}var GN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(GN).forEach(([n,t])=>{GN[t]=n});var e4=GN;function A4(n){let t=new vC(n),o=gC(vC.prototype.request,t);return Z.extend(o,vC.prototype,t,{allOwnKeys:!0}),Z.extend(o,t,null,{allOwnKeys:!0}),o.create=function(e){return A4(Sn(n,e))},o}var Nr=A4(sd);Nr.Axios=vC;Nr.CanceledError=oo;Nr.CancelToken=$q;Nr.isCancel=QC;Nr.VERSION=Eg;Nr.toFormData=uc;Nr.AxiosError=De;Nr.Cancel=Nr.CanceledError;Nr.all=function(t){return Promise.all(t)};Nr.spread=vN;Nr.isAxiosError=PN;Nr.mergeConfig=Sn;Nr.AxiosHeaders=Ht;Nr.formToJSON=n=>Sy(Z.isHTMLForm(n)?new FormData(n):n);Nr.getAdapter=ky.getAdapter;Nr.HttpStatusCode=e4;Nr.default=Nr;var Py=Nr;var{Axios:$sA,AxiosError:FN,CanceledError:egA,isCancel:AgA,CancelToken:tgA,VERSION:rgA,all:agA,Cancel:igA,isAxiosError:ogA,spread:ngA,toFormData:sgA,AxiosHeaders:ggA,HttpStatusCode:cgA,formToJSON:IgA,getAdapter:lgA,mergeConfig:pgA,create:dgA}=Py;var E=qe(z4()),b=qe(W4()),M=qe(R8()),_W=qe(sz());import tt from"fs";import hu from"path";import Fm from"crypto";import ANe from"querystring";var LTe=qe(rV(),1),UTe=qe(mm(),1),HTe=qe(Md(),1),KTe=qe(j0(),1),xTe=qe(z0(),1),YTe=qe(eR(),1),lV=qe(Om(),1),jTe=qe(IV(),1);var Uo=lV.default;import{gzipSync as tNe}from"zlib";import rNe from"http";import aNe from"https";import{promises as iNe}from"dns";import{isIP as TW}from"net";function Y(n,t){var o={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(o[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,i=Object.getOwnPropertySymbols(n);e=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(n){return this instanceof S?(this.v=n,this):new S(n)}function j(n,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=o.apply(n,t||[]),e,a=[];return e={},A("next"),A("throw"),A("return"),e[Symbol.asyncIterator]=function(){return this},e;function A(d){i[d]&&(e[d]=function(B){return new Promise(function(f,Q){a.push([d,B,f,Q])>1||r(d,B)})})}function r(d,B){try{s(i[d](B))}catch(f){I(a[0][3],f)}}function s(d){d.value instanceof S?Promise.resolve(d.value.v).then(g,c):I(a[0][2],d)}function g(d){r("next",d)}function c(d){r("throw",d)}function I(d,B){d(B),a.shift(),a.length&&r(a[0][0],a[0][1])}}function IW(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],o;return t?t.call(n):(n=typeof cW=="function"?cW(n):n[Symbol.iterator](),o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o);function i(a){o[a]=n[a]&&function(A){return new Promise(function(r,s){A=n[a](A),e(r,s,A.done,A.value)})}}function e(a,A,r,s){Promise.resolve(s).then(function(g){a({value:g,done:r})},A)}}var km;function oNe(){if(km!==void 0)return km;let n=[hu.resolve(__dirname,"..","package.json"),hu.resolve(__dirname,"..","..","package.json")];for(let t of n)try{let o=JSON.parse(tt.readFileSync(t,"utf-8"));if(o.name==="@larksuiteoapi/node-sdk"&&typeof o.version=="string")return km=o.version,o.version}catch{}return km="unknown","unknown"}function lW(n){return n.replace(/[^a-zA-Z0-9._-]/g,"_").slice(0,64)}function qv(n,t){let o=`oapi-node-sdk/${oNe()}`;if(n){let i=lW(n);i&&(o+=` source/${i}`)}if(t?.extraTags)for(let i of t.extraTags){let e=lW(i);e&&(o+=` ${e}`)}return o}var Ld=Py.create(),nNe=qv();Ld.interceptors.request.use(n=>(n.headers&&!n.headers["User-Agent"]&&(n.headers["User-Agent"]=nNe),n),void 0,{synchronous:!0});Ld.interceptors.response.use(n=>n.config.$return_headers?{data:n.data,headers:n.headers}:n.data);var us;(function(n){n[n.SelfBuild=0]="SelfBuild",n[n.ISV=1]="ISV"})(us||(us={}));var Bs;(function(n){n[n.Feishu=0]="Feishu",n[n.Lark=1]="Lark"})(Bs||(Bs={}));var co;(function(n){n[n.fatal=0]="fatal",n[n.error=1]="error",n[n.warn=2]="warn",n[n.info=3]="info",n[n.debug=4]="debug",n[n.trace=5]="trace"})(co||(co={}));var Lm=Symbol("event-type"),Um=Symbol("tenant-key"),Bu=Symbol("app-ticket"),du=Symbol("tenant-access-token"),NW=Symbol("with-helpdesk-authorization"),RW=Symbol("with-user-access-token"),sNe=Symbol("user-access-token"),pW=Symbol("aily-session-record"),gNe=n=>Buffer.from(n).toString("base64"),Hm=class{constructor(){this.values=new Map}getCacheKey(t,o){return o?`${o}/${t.toString()}`:t}get(t,o){return h(this,void 0,void 0,function*(){let i=this.getCacheKey(t,o?.namespace),e=this.values.get(i);if(e){let{value:a,expiredTime:A}=e;if(!A||A-new Date().getTime()>0)return a}})}set(t,o,i,e){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,e?.namespace);return this.values.set(a,{value:o,expiredTime:i}),!0})}},Qu=new Hm,fu=class{constructor(t){let o=Fm.createHash("sha256");o.update(t),this.key=o.digest()}decrypt(t){let o=Buffer.from(t,"base64"),i=Fm.createDecipheriv("aes-256-cbc",this.key,o.slice(0,16)),e=i.update(o.slice(16).toString("hex"),"hex","utf8");return e+=i.final("utf8"),e}},kW=n=>{switch(n){case Bs.Feishu:return"https://open.feishu.cn";case Bs.Lark:return"https://open.larksuite.com";default:return n}},C=(n,t={})=>n.replace(/:([^/]+)/g,(o,i)=>{if(t[i]!==void 0)return t[i];throw new Error(`request miss ${i} path argument`)}),Km=(n,t)=>h(void 0,void 0,void 0,function*(){(typeof n=="function"?n():n)&&(yield t())}),cNe=n=>n?n.replace(/^\//,""):"",vm=(n,t=[])=>{let o={};return n&&t.forEach(i=>{Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=n[i])}),o},u=n=>{var t;if(n instanceof FN){let{message:o,response:i,request:e,config:a}=vm(n,["message","response","request","config"]),r=[{message:o,config:vm(a,["data","url","params","method"]),request:vm(e,["protocol","host","path","method"]),response:vm(i,["data","status","statusText"])}],s=(t=n?.response)===null||t===void 0?void 0:t.data;return s&&(typeof s=="object"?r.push(Object.assign(Object.assign({},s),s.error?s.error:{})):r.push(s)),r}return[n]},uR=class{constructor(){this.acs={accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},BR=class extends uR{constructor(){super(...arguments),this.admin={badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},fR=class extends BR{constructor(){super(...arguments),this.aily_rag={}}},QR=class extends fR{constructor(){super(...arguments),this.aily={v1:{ailySession:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDataAssetTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appSkill:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id/start`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appKnowledge:{ask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/knowledges/ask`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDataAsset:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadFile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},ailySessionRun:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ailySessionAilyMessage:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages/:aily_message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentVisibility:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/agent_visibility/check`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentAttachment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/attachments`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},tenantAppStat:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentChat:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats/:agent_chat_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentChatSession:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentAgentArtifact:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/aily/v1/agents/:agent_id/artifacts/:agent_artifact_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},yR=class extends QR{constructor(){super(...arguments),this.apaas={v1:{approvalTask:{addAssignee:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/add_assignee`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),agree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/agree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/transfer`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationObjectRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationObject:{oqlQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/oql_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFunction:{invoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/functions/:function_api_name/invoke`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationRoleMember:{batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_remove_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_create_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationRecordPermissionMember:{batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_create_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_remove_authorization`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationEnvironmentVariable:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/:environment_variable_api_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTask:{expediting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/expediting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),chatGroup:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/chat_group`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollbackPoints:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback_points`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/user_task/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFlow:{execute:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalInstance:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/approval_instances/:approval_instance_id/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAuditLog:{auditLogList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/audit_log_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),dataChangeLogsList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_logs_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),dataChangeLogDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_log_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},seatAssignment:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},seatActivity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspaceTable:{recordsBatchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsPatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recordsPost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tableGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspace:{sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/sql_commands`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspaceView:{viewsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/views/:view_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workspaceEnum:{enumGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums/:enum_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantAppMetrics:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/apaas/v1/tenant_app_metrics/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},mR=class extends yR{constructor(){super(...arguments),this.application={applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v5:{application:{favouriteWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),favourite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recommendWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),recommend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v6:{applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v7:{applicationBase:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/base`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationPublish:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/publish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appAvatarUpload:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/app_avatar/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},applicationConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/config`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},applicationAbility:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/application/v7/applications/:app_id/ability`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},SR=class extends mR{constructor(){super(...arguments),this.approval={instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v4:{instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},wR=class extends SR{constructor(){super(...arguments),this.attendance_machine={}}},DR=class extends wR{constructor(){super(...arguments),this.attendance={file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},OR=class extends DR{constructor(){super(...arguments),this.audio_video_ai={}}},bR=class extends OR{constructor(){super(...arguments),this.auth={appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v3:{appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},MR=class extends bR{constructor(){super(...arguments),this.authen={userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},_R=class extends MR{constructor(){super(...arguments),this.authz={}}},TR=class extends _R{constructor(){super(...arguments),this.aweme_ecosystem={}}},NR=class extends TR{constructor(){super(...arguments),this.baike={entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},RR=class extends NR{constructor(){super(...arguments),this.base={v2:{appRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},kR=class extends RR{constructor(){super(...arguments),this.bitable={appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},vR=class extends kR{constructor(){super(...arguments),this.block={entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v2:{entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},PR=class extends vR{constructor(){super(...arguments),this.board={v1:{whiteboardNode:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createPlantuml:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/plantuml`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},whiteboard:{downloadAsImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/download_as_image`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),theme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/theme`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateTheme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/update_theme`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},GR=class extends PR{constructor(){super(...arguments),this.bot={v4:{bot:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},FR=class extends GR{constructor(){super(...arguments),this.c360={}}},LR=class extends FR{constructor(){super(...arguments),this.calendar={exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v4:{exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},UR=class extends LR{constructor(){super(...arguments),this.cardkit={v1:{card:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),settings:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/settings`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/id_convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},cardElement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),content:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id/content`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},HR=class extends UR{constructor(){super(...arguments),this.ccm_unified_resource={}}},KR=class extends HR{constructor(){super(...arguments),this.collab_plugins={}}},xR=class extends KR{constructor(){super(...arguments),this.comment_sdk={}}},YR=class extends xR{constructor(){super(...arguments),this.compensation={v1:{indicator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialPlan:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_plans/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},item:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},plan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialInsurance:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_insurances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},itemCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},changeReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},archive:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/archives`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/archives/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},recurringPayment:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialArchive:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_archive/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},socialArchiveAdjustRecord:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/social_archive_adjust_record/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},lumpSumPayment:{batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryDetailWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},jR=class extends YR{constructor(){super(...arguments),this.contact={group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v3:{group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},JR=class extends jR{constructor(){super(...arguments),this.content_check={}}},qR=class extends JR{constructor(){super(...arguments),this.contract={}}},zR=class extends qR{constructor(){super(...arguments),this.corehr={contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{costCenter:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCountryRegionSubdivision:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},probation:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/submit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/withdraw`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),enableDisableAssessment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/enable_disable_assessment`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/edit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},probationAssessment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/probation/assessments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customOrg:{deleteOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateRule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},preHire:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transitTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/transit_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdrawOnboarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/withdraw_onboarding`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),restoreFlowInstance:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/restore_flow_instance`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transformOnboardingTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/transform_onboarding_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobGrade:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},position:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/del_position`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/positions/:position_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesBp:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/bps/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},bp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/bps/get_by_department`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesAdditionalJob:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoNationality:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCountryRegion:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCity:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoDistrict:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoBank:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoCurrency:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeeCustomOrg:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/create_emp_custom_org`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),editEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/edit_emp_custom_org`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),employmentCustomOrgRecord:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/employment_custom_org_record`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),querybyid:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/custom_org/querybyid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureFile:{listByBizId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/list_by_biz_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/:signature_file_id/download`,A),method:"POST",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/terminate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureNode:{listByFileId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_nodes/list_by_file_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},company:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/companies/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryOperationLogsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryOperationLogs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),parents:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/parents`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/departments/tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},draft:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/drafts/:draft_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approvalGroups:{openQueryPositionChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_position_change_list_by_ids`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/:process_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),openQueryJobChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_job_change_list_by_ids`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),openQueryDepartmentChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_department_change_list_by_ids`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},locationAddress:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoLanguage:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoTimeZone:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reportDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchDelete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchSave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workforcePlanDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchDelete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchSave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offboarding:{submitV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/offboardings/submit_v2`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/offboardings/edit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/offboardings/revoke`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},basicInfoBankBranch:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},enum:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/enums/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},process:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),flowVariableData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/flow_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processApprover:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/approvers/:approver_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processWithdraw:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/process_withdraw/:process_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},approver:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processTransfer:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/transfer`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processExtra:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/extra`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobLevel:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_levels/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFamily:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_families/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/query_multi_timeline`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/jobs/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesInternationalAssignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/processes/:process_id/form_variable_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},pathway:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/active`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/pathways/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processStart:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/process_start`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocation:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/update_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/create_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_allocations/remove_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costCenterVersion:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processQueryFlowDataTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/query_flow_data_template`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},defaultCostCenter:{createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},processRevoke:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/process_revoke/:process_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureTemplateInfoWithThumbnail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobChange:{revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes/:job_change_id/revoke`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},contract:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workforcePlanDetail:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch_v2`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employee:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},signatureTemplate:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/signature_templates/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employeesJobData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/job_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/employees/job_datas/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},person:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/persons/:person_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/persons`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workforcePlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},VR=class extends zR{constructor(){super(...arguments),this.data_cube={}}},WR=class extends VR{constructor(){super(...arguments),this.device={}}},ZR=class extends WR{constructor(){super(...arguments),this.directory={v1:{employee:{resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),regular:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),toBeResigned:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/employees/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationTenant:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationRule:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collborationShareEntity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},department:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/directory/v1/departments/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},XR=class extends ZR{constructor(){super(...arguments),this.docs_ai={}}},$R=class extends XR{constructor(){super(...arguments),this.docs_tool={}}},ek=class extends $R{constructor(){super(...arguments),this.docs={v1:{content:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docs/v1/content`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ak=class extends ek{constructor(){super(...arguments),this.document_ai={v1:{businessCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/business_card/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},contract:{fieldExtraction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/contract/field_extraction`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},businessLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/business_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},drivingLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/driving_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},vehicleLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/vehicle_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},foodManageLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/food_manage_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},foodProduceLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/food_produce_license/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},hkmMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},chinesePassport:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/chinese_passport/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},twMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},healthCertificate:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/health_certificate/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},vehicleInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/vehicle_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},resume:{parse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/resume/parse`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},bankCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/bank_card/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},trainInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/train_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},taxiInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/taxi_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},vatInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/vat_invoice/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},idCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/document_ai/v1/id_card/recognize`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})}}}}},tk=class extends Ak{constructor(){super(...arguments),this.docx={document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},rk=class extends tk{constructor(){super(...arguments),this.drive={file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{fileLike:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},commentReaction:{updateReaction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/files/:file_token/comments/reaction`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},permissionPublic:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},ak=class extends rk{constructor(){super(...arguments),this.ea_symphony={}}},ik=class extends ak{constructor(){super(...arguments),this.edu={}}},ok=class extends ik{constructor(){super(...arguments),this.ehr={attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},nk=class extends ok{constructor(){super(...arguments),this.elearning={}}},sk=class extends nk{constructor(){super(...arguments),this.event={outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},gk=class extends sk{constructor(){super(...arguments),this.exam={}}},ck=class extends gk{constructor(){super(...arguments),this.face_detection={}}},Ik=class extends ck{constructor(){super(...arguments),this.financial_access_platform={}}},lk=class extends Ik{constructor(){super(...arguments),this.grounding={}}},pk=class extends lk{constructor(){super(...arguments),this.gtm_ai={}}},dk=class extends pk{constructor(){super(...arguments),this.helpdesk={agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},hk=class extends dk{constructor(){super(...arguments),this.hire={websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{talent:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/talents/:talent_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},interviewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/hire/v2/interview_records/:interview_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ek=class extends hk{constructor(){super(...arguments),this.human_authentication={identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ck=class extends Ek{constructor(){super(...arguments),this.im={message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=a,g=Y(a,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(u(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{bizEntityTagRelation:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},urlPreview:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/url_previews/batch_update`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appFeedCardBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},feedCard:{botTimeSentive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/feed_cards/bot_time_sentive`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/feed_cards/:feed_card_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tag:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/tags`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/tags/:tag_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chatButton:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/chat_button`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appFeedCard:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/app_feed_card`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},chat:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},uk=class extends Ck{constructor(){super(...arguments),this.inline_platform={}}},Bk=class extends uk{constructor(){super(...arguments),this.laps={}}},fk=class extends Bk{constructor(){super(...arguments),this.lingo={v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/files/:file_token/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/files/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/match`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/highlight`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},repo:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/repos`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/lingo/v1/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Qk=class extends fk{constructor(){super(...arguments),this.llpp={}}},yk=class extends Qk{constructor(){super(...arguments),this.mail={mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},mk=class extends yk{constructor(){super(...arguments),this.mcp={}}},Sk=class extends mk{constructor(){super(...arguments),this.mdm={userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v3:{countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v3/country_regions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},batchCountryRegion:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/mdm/v3/batch_country_region`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},wk=class extends Sk{constructor(){super(...arguments),this.meeting_room={}}},Dk=class extends wk{constructor(){super(...arguments),this.mindnote={}}},Ok=class extends Dk{constructor(){super(...arguments),this.minutes={v1:{minuteTranscript:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/transcript`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},minuteStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/statistics`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minuteMedia:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/media`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},minute:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),artifacts:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/artifacts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},bk=class extends Ok{constructor(){super(...arguments),this.moments={post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Mk=class extends bk{constructor(){super(...arguments),this.myai_ai_extension={}}},_k=class extends Mk{constructor(){super(...arguments),this.myai_assistant={}}},Tk=class extends _k{constructor(){super(...arguments),this.myai_base_ai={}}},Nk=class extends Tk{constructor(){super(...arguments),this.myai_ccm_extension={}}},Rk=class extends Nk{constructor(){super(...arguments),this.myai_data={}}},kk=class extends Rk{constructor(){super(...arguments),this.myai_im_extension={}}},vk=class extends kk{constructor(){super(...arguments),this.myai_mail={}}},Pk=class extends vk{constructor(){super(...arguments),this.myai_memory_reflection={}}},Gk=class extends Pk{constructor(){super(...arguments),this.myai_scenario_summary={}}},Fk=class extends Gk{constructor(){super(...arguments),this.myai_slides={}}},Lk=class extends Fk{constructor(){super(...arguments),this.myai_url_extension={}}},Uk=class extends Lk{constructor(){super(...arguments),this.myai={}}},Hk=class extends Uk{constructor(){super(...arguments),this.okr={review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})},v1:{review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null})}},v2:{okrAlignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjective:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),keyResultsPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_position`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),keyResultsWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_weight`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrKeyResult:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveAlignment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrCycle:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),objectivesWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_weight`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),objectivesPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_position`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveKeyResult:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrKeyResultIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/indicators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/indicators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrCycleObjective:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrIndicator:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/indicators/:indicator_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrObjectiveProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},okrKeyResultProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Kk=class extends Hk{constructor(){super(...arguments),this.optical_char_recognition={image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},xk=class extends Kk{constructor(){super(...arguments),this.partner_ai={}}},Yk=class extends xk{constructor(){super(...arguments),this.passport={session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},jk=class extends Yk{constructor(){super(...arguments),this.payroll={v1:{datasourceRecord:{save:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasource_records/save`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paymentDetail:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_detail/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paymentActivity:{archive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activitys/archive`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocationPlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paymentActivityDetail:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/payment_activity_details`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},datasource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocationDetail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},costAllocationReport:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},paygroup:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},acctItem:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Jk=class extends jk{constructor(){super(...arguments),this.people_admin={}}},qk=class extends Jk{constructor(){super(...arguments),this.people_ai={}}},zk=class extends qk{constructor(){super(...arguments),this.people_bytedance={}}},Vk=class extends zk{constructor(){super(...arguments),this.performance={v1:{reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/review_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},stageTask:{findByUserList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_user_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),findByPage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_page`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},semester:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v1/semesters`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{reviewee:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/reviewees/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},additionalInformationsBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/batch`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricDetail:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_details/import`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_details/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},question:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},indicator:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},activity:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/activity/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_fields/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricLib:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_libs/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/review_datas/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},metricTemplate:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/metric_templates/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/user_info/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reviewTemplate:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userGroupUserRel:{write:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/user_group_user_rels/write`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},additionalInformation:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/import`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Wk=class extends Vk{constructor(){super(...arguments),this.personal_settings={systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Zk=class extends Wk{constructor(){super(...arguments),this.profile={}}},Xk=class extends Zk{constructor(){super(...arguments),this.report={rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},$k=class extends Xk{constructor(){super(...arguments),this.rule_engine={}}},ev=class extends $k{constructor(){super(...arguments),this.saasbi={}}},Av=class extends ev{constructor(){super(...arguments),this.scim={}}},tv=class extends Av{constructor(){super(...arguments),this.search_in_app={}}},rv=class extends tv{constructor(){super(...arguments),this.search={dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v2:{dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},av=class extends rv{constructor(){super(...arguments),this.security_and_compliance={openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{deviceApplyRecord:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_apply_records/:device_apply_record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},deviceRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mine:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/mine`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},iv=class extends av{constructor(){super(...arguments),this.security_plugin={}}},ov=class extends iv{constructor(){super(...arguments),this.sheet_ai={}}},nv=class extends ov{constructor(){super(...arguments),this.sheets={spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v3:{spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},sv=class extends nv{constructor(){super(...arguments),this.slides_ai={}}},gv=class extends sv{constructor(){super(...arguments),this.slides={}}},cv=class extends gv{constructor(){super(...arguments),this.spark={v1:{appTable:{deleteTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),postTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patchTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchUpdateTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTableDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTableList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTableRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appEnum:{getEnumDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums/:enum_name`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getEnumList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appView:{getViewRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/views/:view_name/records`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},appStorage:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage`,A),method:"GET",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadInitialize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/initialize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/part`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadComplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},app:{icon:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/icon`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),uploadHtmlCodeAndRelease:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/upload_and_release_html_code`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),getAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),updateAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id/sql_commands`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps/:app_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/apps`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},directoryUser:{idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/spark/v1/directory/user/id_convert`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Iv=class extends cv{constructor(){super(...arguments),this.speech_to_text={speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},lv=class extends Iv{constructor(){super(...arguments),this.subscriptions={}}},pv=class extends lv{constructor(){super(...arguments),this.task={task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{task:{tasklists:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/tasklists`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_dependencies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_dependencies`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setAncestorTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/set_ancestor_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_reminders`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_tasklist`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_tasklist`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},comment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/comments`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},section:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),tasksWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/sections`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tasklist:{tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/tasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/add_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/remove_members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customField:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/add`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tasklistActivitySubscription:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments/upload`,A),method:"POST",data:a,params:e,headers:Object.assign(Object.assign({},i),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(u(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customFieldOption:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskV2:{taskSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/task_v2/task_subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listRelatedTaskWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listRelatedTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},taskSubtask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},dv=class extends pv{constructor(){super(...arguments),this.tenant={tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v2:{tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},hv=class extends dv{constructor(){super(...arguments),this.translation={text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Ev=class extends hv{constructor(){super(...arguments),this.trust_layer={}}},Cv=class extends Ev{constructor(){super(...arguments),this.trust_party={v1:{collaborationTenantCollaborationUser:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_users/:target_user_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationTenantCollaborationDepartment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_departments/:target_department_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},collaborationTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),visibleOrganization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/visible_organization`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},uv=class extends Cv{constructor(){super(...arguments),this.unified_kms_log={}}},Bv=class extends uv{constructor(){super(...arguments),this.unified_kms={}}},fv=class extends Bv{constructor(){super(...arguments),this.vault={}}},Qv=class extends fv{constructor(){super(...arguments),this.vc={material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:i,data:a,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(u(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let d=tt.createWriteStream(g);d.on("finish",()=>{c(g)}),d.on("error",B=>{I(B)}),r.data.pipe(d)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},yv=class extends Qv{constructor(){super(...arguments),this.verification={v1:{verification:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/verification/v1/verification`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},mv=class extends yv{constructor(){super(...arguments),this.wiki={spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{node:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}},v2:{spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(u(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let d=yield S(r({headers:i,params:Object.assign(Object.assign({},e),{page_token:I}),data:a})),B=d?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Sv=class extends mv{constructor(){super(...arguments),this.workplace={workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},v1:{workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:i,params:e,data:a,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:C(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:a,params:e,headers:i,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(u(r)),r})})}}}}},Mg={error:(...n)=>{console.log("[error]:",...n)},warn:(...n)=>{console.warn("[warn]:",...n)},info:(...n)=>{console.info("[info]:",...n)},debug:(...n)=>{console.debug("[debug]:",...n)},trace:(...n)=>{console.trace("[trace]:",...n)}},Tc=class{constructor(t,o){this.level=t,this.logger=o}error(...t){this.level>=co.error&&this.logger.error(t)}warn(...t){this.level>=co.warn&&this.logger.warn(t)}info(...t){this.level>=co.info&&this.logger.info(t)}debug(...t){this.level>=co.debug&&this.logger.debug(t)}trace(...t){this.level>=co.trace&&this.logger.trace(t)}},wv=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.logger.debug("app ticket manager is ready"),this.checkAppTicket()}checkAppTicket(){var t;return h(this,void 0,void 0,function*(){this.appType===us.ISV&&((yield(t=this.cache)===null||t===void 0?void 0:t.get(Bu,{namespace:this.appId}))||this.requestAppTicket())})}requestAppTicket(){return h(this,void 0,void 0,function*(){this.logger.debug("request app ticket"),yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,{app_id:this.appId,app_secret:this.appSecret}).catch(t=>{this.logger.error(t)})})}getAppTicket(){var t;return h(this,void 0,void 0,function*(){let o=yield(t=this.cache)===null||t===void 0?void 0:t.get(Bu,{namespace:this.appId});if(o)return this.logger.debug("use cache app ticket"),o;yield this.requestAppTicket()})}},xm="/oauth/v3/token",INe="urn:ietf:params:oauth:grant-type:jwt-bearer",vW="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",lNe="authorization_code",pNe="refresh_token",zv="X-Target-Service",PW=7100,Vv=7101,GW=7102,Wv=7104,dNe=Object.freeze({"open.feishu.cn":"https://accounts.feishu.cn","open.larksuite.com":"https://accounts.larksuite.com"}),ri=class extends Error{constructor(t,o){super(o),this.name="ClientAssertionError",this.code=t,this.msg=o}},Fd=class extends Error{constructor(t,o,i,e){super(e||i||"access token request failed"),this.name="AccessTokenError",this.statusCode=t,this.code=o,this.error=i,this.errorDescription=e}},Zv=n=>n.includes("://")?n:`https://${n}`;function Xv(n){let t=new URL(Zv(n));if(!t.host)throw new Error(`invalid url: ${n}`);return t.host}function $v(n){if(n.oauthBaseUrl)return Zv(n.oauthBaseUrl).replace(/\/+$/,"");let t=Xv(n.domain),o=dNe[t];if(o)return o;throw new Error("oauthBaseUrl is not configured. When domain is a non-default value (neither open.feishu.cn nor open.larksuite.com), set oauthBaseUrl explicitly.")}function FW(n){return Xv($v(n))}function eP(n,t){let o=new URL(Zv(n.targetService));if(o.protocol!=="https:")throw new Error("targetService must use https");if(o.username||o.password)throw new Error("targetService must not contain userinfo");let e=`${n.targetPrefix||""}${t}`.replace(/\/{2,}/g,"/");if(/(^|\/)\.\.(\/|$)/.test(e))throw new Error("targetPrefix must not contain path traversal");return`${o.protocol}//${o.host}${e}`}function hNe(n,t){var o,i;let e=(o=t?.code)!==null&&o!==void 0?o:"unknown",a=(i=t?.msg)!==null&&i!==void 0?i:"no message";return`failed to get ${n}, code: ${e}, msg: ${a}`}var Dv=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.appTicketManager=new wv({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance}),this.logger.debug("token manager is ready")}requestToken(t,o,i){return h(this,void 0,void 0,function*(){let e=yield this.httpInstance.post(t,o).catch(a=>{throw this.logger.error(a),a});if(!e||!e[i])throw new Error(hNe(i,e));return e})}getCustomTenantAccessToken(){var t,o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)return this.getTenantTokenByClientAssertion();let i=yield(t=this.cache)===null||t===void 0?void 0:t.get(du,{namespace:this.appId});if(i)return this.logger.debug("use cache token"),i;this.logger.debug("request token");let{tenant_access_token:e,expire:a}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,{app_id:this.appId,app_secret:this.appSecret},"tenant_access_token");return yield(o=this.cache)===null||o===void 0?void 0:o.set(du,e,new Date().getTime()+a*1e3-180*1e3,{namespace:this.appId}),e})}getTenantTokenByClientAssertion(){var t,o,i,e,a,A,r,s;return h(this,void 0,void 0,function*(){let g=$v({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),c=FW({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),I=yield(t=this.cache)===null||t===void 0?void 0:t.get(du,{namespace:this.appId});if(I)return this.logger.debug("use cache token"),I;let d;try{d=yield this.clientAssertionProvider.retrieveToken(c)}catch(T){throw new ri(GW,T?.message||"client assertion provider failed")}if(!d||!d.value)throw new ri(Vv,"client assertion token is empty");let B=`${g}${xm}`,f={};d.targetInfo&&(B=eP(d.targetInfo,xm),f[zv]=c),this.logger.debug("request token (client assertion)");let Q;try{Q=yield this.httpInstance.request({method:"post",url:B,headers:f,data:{grant_type:INe,client_assertion_type:vW,client_assertion:d.value,client_id:this.appId}})}catch(T){throw this.logger.error(T),new ri(((i=(o=T?.response)===null||o===void 0?void 0:o.data)===null||i===void 0?void 0:i.code)||0,((a=(e=T?.response)===null||e===void 0?void 0:e.data)===null||a===void 0?void 0:a.error_description)||((r=(A=T?.response)===null||A===void 0?void 0:A.data)===null||r===void 0?void 0:r.error)||"client assertion token exchange failed")}let y=Q?.access_token;if(!y)throw new ri(Q?.code||0,Q?.error_description||Q?.error||"oauth token response missing access token");let m=Number(Q?.expires_in)||0;return yield(s=this.cache)===null||s===void 0?void 0:s.set(du,y,new Date().getTime()+Math.max(m-180,0)*1e3,{namespace:this.appId}),y})}getMarketTenantAccessToken(t){var o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)throw new ri(PW,"ClientAssertion mode is not supported for ISV apps");if(!t){this.logger.error("market app request need tenant key");return}let i=yield(o=this.cache)===null||o===void 0?void 0:o.get(`larkMarketAccessToken${t}`,{namespace:this.appId});if(i)return this.logger.debug("use cache token"),i;this.logger.debug("get app ticket");let e=yield this.appTicketManager.getAppTicket();if(!e){this.logger.warn("no app ticket");return}this.logger.debug("get app access token");let{app_access_token:a}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/app_access_token`,{app_id:this.appId,app_secret:this.appSecret,app_ticket:e},"app_access_token");this.logger.debug("get tenant access token");let{tenant_access_token:A,expire:r}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token`,{app_access_token:a,tenant_key:t},"tenant_access_token");return yield this.cache.set(`larkMarketAccessToken${t}`,A,new Date().getTime()+r*1e3-180*1e3,{namespace:this.appId}),A})}getTenantAccessToken(t){return h(this,void 0,void 0,function*(){return Km(this.appType===us.SelfBuild,()=>h(this,void 0,void 0,function*(){this.logger.debug("get custom app token")})),Km(this.appType===us.ISV,()=>h(this,void 0,void 0,function*(){this.logger.debug("get market app token ")})),this.appType===us.SelfBuild?yield this.getCustomTenantAccessToken():yield this.getMarketTenantAccessToken(t?.[Um])})}},LW=(n,t)=>{let o=Object.assign({},n);for(let[i,e]of Object.entries(t))e!==void 0&&(o[i]=e);return o},Ov=class{constructor(t){this.client=t.client}getCacheKey(t,o){return`${o?.namespace||this.client.appId}/${sNe.toString()}/${t}`}calibrateTime(t){return new Date().getTime()+(t||0)*1e3-180*1e3}initWithCode(t,o){return h(this,void 0,void 0,function*(){let i={};for(let[e,a]of Object.entries(t)){let A=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:a}});if(A.code!==0){this.client.logger.error("init user access token error",e,A.msg||A.message);continue}if(!A.data){this.client.logger.error("user access code expired",e,a);continue}i[e]={code:a,token:A.data.access_token,refreshToken:A.data.refresh_token,expiredTime:this.calibrateTime(A.data.expires_in)}}return yield this.update(i,{namespace:o?.namespace}),i})}update(t,o){return h(this,void 0,void 0,function*(){for(let[i,e]of Object.entries(t)){let a=this.getCacheKey(i,{namespace:o?.namespace}),A=(yield this.client.cache.get(a))||{},{code:r,token:s,refreshToken:g,expiredTime:c}=e,I=LW(A,{code:r,token:s,refreshToken:g,expiredTime:c});yield this.client.cache.set(a,I,1/0)}})}get(t,o){return h(this,void 0,void 0,function*(){let i=this.getCacheKey(t,{namespace:o?.namespace}),e=yield this.client.cache.get(i);if(!e){this.client.logger.error("user access token needs to be initialized or updated first");return}let{token:a,code:A,refreshToken:r,expiredTime:s}=e;if(a&&s&&s-new Date().getTime()>0)return a;if(r){let g=yield this.client.authen.oidcRefreshAccessToken.create({data:{grant_type:"refresh_token",refresh_token:r}});if(g.code===0&&g.data)return yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}),g.data.access_token;this.client.logger.error("get user access token by refresh token failed.",g.msg);return}if(A){let g=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:A}});g.code===0&&g.data?yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}):this.client.logger.error("get user access token by code failed.",g.msg)}})}},Pd=n=>n===""||n===0||n===null||n===void 0?void 0:n,ENe=n=>{if(!n||n.error)return!0;let{code:t}=n;return t!==void 0&&t!==0&&t!=="0"&&t!==""},bv=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.domain=t.domain,this.httpInstance=t.httpInstance,this.logger=t.logger}retrieveByAuthorizationCode(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:lNe,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,scope:t.scope},t.headers)})}refresh(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:pNe,refresh_token:t.refreshToken,scope:t.scope},t.headers)})}doRequest(t,o){return h(this,void 0,void 0,function*(){let i=$v({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),e=FW({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),a={client_id:this.appId};for(let[I,d]of Object.entries(t))d!=null&&(a[I]=d);let A=`${i}${xm}`,r=Object.assign({},o||{});if(this.clientAssertionProvider){let I;try{I=yield this.clientAssertionProvider.retrieveToken(e)}catch(d){throw new ri(GW,d?.message||"client assertion provider failed")}if(!I||!I.value)throw new ri(Vv,"client assertion token is empty");a.client_assertion_type=vW,a.client_assertion=I.value,I.targetInfo&&(A=eP(I.targetInfo,xm),r[zv]=e)}else if(this.appSecret)a.client_secret=this.appSecret;else throw new ri(Wv,"appSecret and clientAssertionProvider cannot both be empty for accessToken APIs");let s=200,g;try{g=yield this.httpInstance.request({method:"post",url:A,headers:r,data:a})}catch(I){if(this.logger.error(I),I?.response)s=I.response.status,g=I.response.data;else throw new Fd(0,0,"",I?.message||"oauth token request failed")}if(s!==200||ENe(g))throw new Fd(s,g?.code||0,g?.error||"",g?.error_description||g?.msg||"");let c=Pd(g?.access_token);if(!c)throw new Fd(s,g?.code||0,g?.error||"",g?.error_description||"oauth token response missing access_token");return{accessToken:c,tokenType:Pd(g.token_type),expiresIn:Pd(g.expires_in),refreshToken:Pd(g.refresh_token),refreshTokenExpiresIn:Pd(g.refresh_token_expires_in),scope:Pd(g.scope)}})}},Ym=class extends Sv{constructor(t){if(super(),this.appId="",this.appSecret="",this.helpDeskId="",this.helpDeskToken="",this.appType=us.SelfBuild,this.logger=new Tc(t.loggerLevel||co.info,t.logger||Mg),this.appId=t.appId,this.appSecret=t.appSecret||"",this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.disableTokenCache=t.disableTokenCache,this.userAgent=qv(t.source,{extraTags:t.extraUaTags}),Km(!this.appId,()=>this.logger.error("appId is needed")),this.helpDeskId=t.helpDeskId,this.helpDeskToken=t.helpDeskToken,this.appType=t?.appType||us.SelfBuild,!this.appSecret&&!this.clientAssertionProvider)throw new ri(Wv,"appSecret or clientAssertionProvider is required");if(this.clientAssertionProvider&&this.appType===us.ISV)throw new ri(PW,"ClientAssertion mode is not supported for ISV apps");this.domain=kW(t.domain||Bs.Feishu),this.logger.debug(`use domain url: ${this.domain}`),this.cache=t.cache||Qu,this.httpInstance=t.httpInstance||Ld,this.tokenManager=new Dv({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl}),this.userAccessToken=new Ov({client:this}),this.accessToken=new bv({appId:this.appId,appSecret:this.appSecret,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl,domain:this.domain,httpInstance:this.httpInstance,logger:this.logger}),this.logger.info("client ready")}formatPayload(t,o){var i,e,a;return h(this,void 0,void 0,function*(){let A=["lark","params","data","headers","path"].reduce((g,c)=>(g[c]=o?.[c]||{},g),{}),r=(i=A?.lark)===null||i===void 0?void 0:i[RW];if(r)this.logger.debug("use passed token"),A.headers.Authorization=`Bearer ${r}`;else if(!this.disableTokenCache){let g=yield this.tokenManager.getTenantAccessToken({[Um]:(e=A?.lark)===null||e===void 0?void 0:e[Um]});g?A.headers.Authorization=`Bearer ${g}`:this.logger.warn("failed to obtain token")}if((a=A?.lark)===null||a===void 0?void 0:a[NW]){this.logger.debug("generate help desk credential");let g=gNe(`${this.helpDeskId}:${this.helpDeskToken}`);A.headers["X-Lark-Helpdesk-Authorization"]=`Bearer ${g}`}return{params:Object.assign(Object.assign({},t?.params||{}),A.params),headers:Object.assign(Object.assign({"User-Agent":this.userAgent},t?.headers||{}),A.headers),data:Object.assign(Object.assign({},t?.data||{}),A.data),path:Object.assign(Object.assign({},t?.path||{}),A.path)}})}request(t,o){var i;return h(this,void 0,void 0,function*(){let{data:e,params:a,headers:A,url:r}=t,s=Y(t,["data","params","headers","url"]),g=yield this.formatPayload({data:e,params:a,headers:A},o),c=((i=t.method)===null||i===void 0?void 0:i.toLowerCase())==="get"&&Object.keys(g.data).length===0?void 0:g.data;return this.logger.trace(`send request [${t.method}]: ${t.url}`),yield this.httpInstance.request(Object.assign(Object.assign({},s),{url:/^http/.test(r)?r:`${this.domain}/${cNe(r)}`,headers:g.headers,data:c,params:g.params})).catch(d=>{throw this.logger.error(d),d})})}},CNe=n=>n.reduce((t,o)=>(0,_W.default)(t,o),{}),uNe=n=>({lark:{[Um]:n}}),BNe=()=>({lark:{[NW]:!0}}),fNe=n=>({headers:{Authorization:`Bearer ${n}`}}),QNe=n=>({lark:{[RW]:n}}),jm=class{constructor(t){let{encryptKey:o,verificationToken:i,logger:e}=t;this.verificationToken=i,this.encryptKey=o,this.logger=e,o&&(this.aesCipher=new fu(o))}parse(t){var o,i;let e=(()=>{var r;let s=t||{},{encrypt:g}=s,c=Y(s,["encrypt"]);if(g)try{return Object.assign(Object.assign({},JSON.parse((r=this.aesCipher)===null||r===void 0?void 0:r.decrypt(g))),c)}catch{return this.logger.error("parse encrypt data failed"),{}}return c})();if("schema"in e){let{header:r,event:s}=e,g=Y(e,["header","event"]);return Object.assign(Object.assign(Object.assign({[Lm]:(o=e?.header)===null||o===void 0?void 0:o.event_type},g),r),s)}let{event:a}=e,A=Y(e,["event"]);return Object.assign(Object.assign({[Lm]:(i=e?.event)===null||i===void 0?void 0:i.type},a),A)}checkIsCardEventValidated(t){if("encrypt"in t||"schema"in t)return this.checkIsEventValidated(t);let{"x-lark-request-timestamp":o,"x-lark-request-nonce":i,"x-lark-signature":e}=t.headers;return this.verificationToken?Fm.createHash("sha1").update(o+i+this.verificationToken+JSON.stringify(t)).digest("hex")===e:!0}checkIsEventValidated(t){if(!this.encryptKey)return!0;let{"x-lark-request-timestamp":o,"x-lark-request-nonce":i,"x-lark-signature":e}=t.headers,a=o+i+this.encryptKey+JSON.stringify(t);return Fm.createHash("sha256").update(a).digest("hex")===e}},yNe="app_ticket",Jm=class{constructor(t){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{encryptKey:o,verificationToken:i}=t;this.encryptKey=o||"",this.verificationToken=i||"",this.logger=new Tc(t.loggerLevel||co.info,t.logger||Mg),this.requestHandle=new jm({encryptKey:o,verificationToken:i,logger:this.logger}),this.cache=t.cache||Qu,this.registerAppTicketHandle(),this.logger.info("event-dispatch is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:i}=t;o?(yield this.cache.set(Bu,o,void 0,{namespace:i}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.has(o)&&o!==yNe&&this.logger.error(`this ${o} handle is registered`),this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t,o){var i,e;return h(this,void 0,void 0,function*(){if(o?.needCheck!==!1&&!(!((i=this.requestHandle)===null||i===void 0)&&i.checkIsEventValidated(t))){this.logger.warn("verification failed event");return}let A=(e=this.requestHandle)===null||e===void 0?void 0:e.parse(t),r=A[Lm];if(this.handles.has(r)){let s=yield this.handles.get(r)(A);return this.logger.debug(`execute ${r} handle`),s}return this.logger.warn(`no ${r} handle`),`no ${r} event handle`})}},Mv=class{constructor(t,o){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{verificationToken:i,encryptKey:e}=t;this.encryptKey=e||"",this.verificationToken=i||"",this.cardHandler=o,this.logger=new Tc(t.loggerLevel||co.info,t.logger||Mg),this.requestHandle=new jm({encryptKey:e,verificationToken:i,logger:this.logger}),this.cache=t.cache||Qu,this.registerAppTicketHandle(),this.logger.info("card-action-handle is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:i}=t;o?(yield this.cache.set(Bu,o,void 0,{namespace:i}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t){var o,i;return h(this,void 0,void 0,function*(){if(!(!((o=this.requestHandle)===null||o===void 0)&&o.checkIsCardEventValidated(t))){this.logger.warn("verification failed event");return}let e=(i=this.requestHandle)===null||i===void 0?void 0:i.parse(t),a=e[Lm];if(this.handles.has(a))try{return yield this.handles.get(a)(e)}catch(A){this.logger.error(A);return}try{let A=yield this.cardHandler(e);return this.logger.debug("execute card handle"),A}catch(A){this.logger.error(A)}})}},$m=n=>new Promise(t=>{let o="";n.on("data",i=>{o+=i}),n.on("end",()=>{try{let i=JSON.parse(o);t(i)}catch{t("")}})}),yu=(n,t)=>{if("encrypt"in n&&!t.encryptKey)throw new Error("auto-challenge need encryptKey, please check for missing in dispatcher");let o="encrypt"in n?JSON.parse(new fu(t.encryptKey).decrypt(n.encrypt)):n;return{isChallenge:o.type==="url_verification",challenge:{challenge:o.challenge}}},mNe=(n,t,o)=>(i,e)=>h(void 0,void 0,void 0,function*(){if(i.url!==n)return;let a=Object.assign(Object.create({headers:i.headers}),yield $m(i));if(o?.autoChallenge||!1){let{isChallenge:s,challenge:g}=yu(a,{encryptKey:t.encryptKey});if(s){e.end(JSON.stringify(g));return}}let r=yield t.invoke(a);e.end(JSON.stringify(r))}),SNe=(n,t)=>(o,i)=>h(void 0,void 0,void 0,function*(){let e=yield h(void 0,void 0,void 0,function*(){return o.body?o.body:o.complete?((t?.logger||Mg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield $m(o)}),a=Object.assign(Object.create({headers:o.headers}),e);if(t?.autoChallenge||!1){let{isChallenge:s,challenge:g}=yu(a,{encryptKey:n.encryptKey});if(s){i.json(g);return}}let r=yield n.invoke(a);i.json(r)}),wNe=(n,t,o)=>(i,e)=>h(void 0,void 0,void 0,function*(){let{originalUrl:a,req:A,request:r}=i;if(a===n){let s=yield h(void 0,void 0,void 0,function*(){return r.body?r.body:A.complete?((o?.logger||Mg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield $m(A)}),g=Object.assign(Object.create({headers:A.headers}),s);if(o?.autoChallenge||!1){let{isChallenge:d,challenge:B}=yu(g,{encryptKey:t.encryptKey});if(d){i.body=B,yield e();return}}let I=yield t.invoke(g);i.body=JSON.stringify(I)}yield e()}),DNe=(n,t)=>(o,i)=>h(void 0,void 0,void 0,function*(){let{req:e,request:a}=o,A=yield h(void 0,void 0,void 0,function*(){return a.body?a.body:e.complete?((t?.logger||Mg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield $m(e)}),r=Object.assign(Object.create({headers:e.headers}),A);if(t?.autoChallenge||!1){let{isChallenge:c,challenge:I}=yu(r,{encryptKey:n.encryptKey});if(c){o.body=I,yield i();return}}let g=yield n.invoke(r);o.body=JSON.stringify(g),yield i()}),ONe=n=>{let{title:t,content:o}=n;return JSON.stringify({config:{wide_screen_mode:!0},elements:[{tag:"markdown",content:o}],header:{template:"blue",title:{content:t,tag:"plain_text"}}})},bNe=Object.freeze({__proto__:null,defaultCard:ONe}),bg=Rm();bg.util.Long=void 0;bg.configure();var _c=bg.Reader,dW=bg.Writer,HA=bg.util,xo=bg.roots.default||(bg.roots.default={}),UW=xo.pbbp2=(()=>{let n={};return n.Header=(function(){function t(o){if(o)for(let i=Object.keys(o),e=0;e>>3){case 1:{A.key=i.string();break}case 2:{A.value=i.string();break}default:i.skipType(r&7);break}}if(!A.hasOwnProperty("key"))throw HA.ProtocolError("missing required 'key'",{instance:A});if(!A.hasOwnProperty("value"))throw HA.ProtocolError("missing required 'value'",{instance:A});return A},t.decodeDelimited=function(i){return i instanceof _c||(i=new _c(i)),this.decode(i,i.uint32())},t.verify=function(i){return typeof i!="object"||i===null?"object expected":HA.isString(i.key)?HA.isString(i.value)?null:"value: string expected":"key: string expected"},t.fromObject=function(i){if(i instanceof xo.pbbp2.Header)return i;let e=new xo.pbbp2.Header;return i.key!=null&&(e.key=String(i.key)),i.value!=null&&(e.value=String(i.value)),e},t.toObject=function(i,e){e||(e={});let a={};return e.defaults&&(a.key="",a.value=""),i.key!=null&&i.hasOwnProperty("key")&&(a.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(a.value=i.value),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,bg.util.toJSONOptions)},t.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/pbbp2.Header"},t})(),n.Frame=(function(){function t(o){if(this.headers=[],o)for(let i=Object.keys(o),e=0;e>>3){case 1:{A.SeqID=i.uint64();break}case 2:{A.LogID=i.uint64();break}case 3:{A.service=i.int32();break}case 4:{A.method=i.int32();break}case 5:{A.headers&&A.headers.length||(A.headers=[]),A.headers.push(xo.pbbp2.Header.decode(i,i.uint32()));break}case 6:{A.payloadEncoding=i.string();break}case 7:{A.payloadType=i.string();break}case 8:{A.payload=i.bytes();break}case 9:{A.LogIDNew=i.string();break}default:i.skipType(r&7);break}}if(!A.hasOwnProperty("SeqID"))throw HA.ProtocolError("missing required 'SeqID'",{instance:A});if(!A.hasOwnProperty("LogID"))throw HA.ProtocolError("missing required 'LogID'",{instance:A});if(!A.hasOwnProperty("service"))throw HA.ProtocolError("missing required 'service'",{instance:A});if(!A.hasOwnProperty("method"))throw HA.ProtocolError("missing required 'method'",{instance:A});return A},t.decodeDelimited=function(i){return i instanceof _c||(i=new _c(i)),this.decode(i,i.uint32())},t.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(!HA.isInteger(i.SeqID)&&!(i.SeqID&&HA.isInteger(i.SeqID.low)&&HA.isInteger(i.SeqID.high)))return"SeqID: integer|Long expected";if(!HA.isInteger(i.LogID)&&!(i.LogID&&HA.isInteger(i.LogID.low)&&HA.isInteger(i.LogID.high)))return"LogID: integer|Long expected";if(!HA.isInteger(i.service))return"service: integer expected";if(!HA.isInteger(i.method))return"method: integer expected";if(i.headers!=null&&i.hasOwnProperty("headers")){if(!Array.isArray(i.headers))return"headers: array expected";for(let e=0;e>>0,i.SeqID.high>>>0).toNumber(!0))),i.LogID!=null&&(HA.Long?(e.LogID=HA.Long.fromValue(i.LogID)).unsigned=!0:typeof i.LogID=="string"?e.LogID=parseInt(i.LogID,10):typeof i.LogID=="number"?e.LogID=i.LogID:typeof i.LogID=="object"&&(e.LogID=new HA.LongBits(i.LogID.low>>>0,i.LogID.high>>>0).toNumber(!0))),i.service!=null&&(e.service=i.service|0),i.method!=null&&(e.method=i.method|0),i.headers){if(!Array.isArray(i.headers))throw TypeError(".pbbp2.Frame.headers: array expected");e.headers=[];for(let a=0;a=0&&(e.payload=i.payload)),i.LogIDNew!=null&&(e.LogIDNew=String(i.LogIDNew)),e},t.toObject=function(i,e){e||(e={});let a={};if((e.arrays||e.defaults)&&(a.headers=[]),e.defaults){if(HA.Long){let A=new HA.Long(0,0,!0);a.SeqID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else a.SeqID=e.longs===String?"0":0;if(HA.Long){let A=new HA.Long(0,0,!0);a.LogID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else a.LogID=e.longs===String?"0":0;a.service=0,a.method=0,a.payloadEncoding="",a.payloadType="",e.bytes===String?a.payload="":(a.payload=[],e.bytes!==Array&&(a.payload=HA.newBuffer(a.payload))),a.LogIDNew=""}if(i.SeqID!=null&&i.hasOwnProperty("SeqID")&&(typeof i.SeqID=="number"?a.SeqID=e.longs===String?String(i.SeqID):i.SeqID:a.SeqID=e.longs===String?HA.Long.prototype.toString.call(i.SeqID):e.longs===Number?new HA.LongBits(i.SeqID.low>>>0,i.SeqID.high>>>0).toNumber(!0):i.SeqID),i.LogID!=null&&i.hasOwnProperty("LogID")&&(typeof i.LogID=="number"?a.LogID=e.longs===String?String(i.LogID):i.LogID:a.LogID=e.longs===String?HA.Long.prototype.toString.call(i.LogID):e.longs===Number?new HA.LongBits(i.LogID.low>>>0,i.LogID.high>>>0).toNumber(!0):i.LogID),i.service!=null&&i.hasOwnProperty("service")&&(a.service=i.service),i.method!=null&&i.hasOwnProperty("method")&&(a.method=i.method),i.headers&&i.headers.length){a.headers=[];for(let A=0;AUW.Frame.decode(n),_v=class{constructor(){this.client={appId:"",appSecret:"",domain:Bs.Feishu},this.ws={connectUrl:"",pingInterval:120*1e3,reconnectCount:-1,reconnectInterval:120*1e3,reconnectNonce:30*1e3,deviceId:"",serviceId:"",autoReconnect:!0},this.wsInstance=null}updateClient(t){Object.assign(this.client,t)}updateWs(t){Object.assign(this.ws,t)}getClient(t){return t===void 0?this.client:this.client[t]}getWS(t){return t===void 0?this.ws:this.ws[t]}get wsConfigUrl(){return`${this.getClient("domain")}/callback/ws/endpoint`}setWSInstance(t){this.wsInstance=t}getWSInstance(){return this.wsInstance}},Tv=class{constructor(t){this.cache=new Map,this.logger=t.logger,this.clearAtInterval()}mergeData(t){let{message_id:o,sum:i,seq:e,trace_id:a,data:A}=t,r=this.cache.get(o);if(r)r.buffer[e]=A;else{let g=new Array(i).fill(void 0);g[e]=A,this.cache.set(o,{buffer:g,trace_id:a,message_id:o,create_time:Date.now()})}let s=this.cache.get(o);if(s?.buffer.every(g=>!!g)){let g=s.buffer.reduce((d,B)=>{let f=new Uint8Array(d.byteLength+B.byteLength);return f.set(d,0),f.set(B,d.length),f},new Uint8Array([])),c=new TextDecoder("utf-8").decode(g),I=JSON.parse(c);return this.deleteCache(o),I}return null}deleteCache(t){this.cache.delete(t)}clearAtInterval(){if(this.timer)return;let t=1e4;this.timer=setInterval(()=>{let o=Date.now();this.cache.forEach((i,e)=>{var a;let{create_time:A,trace_id:r,message_id:s}=i;o-A>t&&((a=this.logger)===null||a===void 0||a.debug(`${s} event data is deleted as expired, trace_id: ${r}`),this.deleteCache(e))})},t),typeof this.timer.unref=="function"&&this.timer.unref()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=void 0),this.cache.clear()}},Eu;(function(n){n[n.ok=0]="ok",n[n.system_busy=1]="system_busy",n[n.forbidden=403]="forbidden",n[n.auth_failed=514]="auth_failed",n[n.internal_error=1000040343]="internal_error",n[n.exceed_conn_limit=1000040350]="exceed_conn_limit"})(Eu||(Eu={}));var Cu;(function(n){n[n.control=0]="control",n[n.data=1]="data"})(Cu||(Cu={}));var uu;(function(n){n.type="type",n.message_id="message_id",n.sum="sum",n.seq="seq",n.trace_id="trace_id",n.biz_rt="biz_rt",n.handshake_status="handshake-status",n.handshake_msg="handshake-msg",n.handshake_autherrcode="handshake-autherrcode"})(uu||(uu={}));var Gd;(function(n){n.event="event",n.card="card",n.ping="ping",n.pong="pong"})(Gd||(Gd={}));var qm;(function(n){n[n.ok=200]="ok",n[n.internal_server_error=500]="internal_server_error"})(qm||(qm={}));var zm=class{constructor(t){var o;this.wsConfig=new _v,this.reconnectGeneration=0,this.pendingWsInstance=null,this.isConnecting=!1,this.reconnectInfo={lastConnectTime:0,nextConnectTime:0},this.hasEverConnected=!1,this.terminalError=!1,this.currentReconnectAttempts=0;let{appId:i,appSecret:e,clientAssertionProvider:a,agent:A,domain:r=Bs.Feishu,httpInstance:s=Ld,loggerLevel:g=co.info,logger:c=Mg,autoReconnect:I=!0,source:d,extraUaTags:B,onReady:f,onError:Q,onReconnecting:y,onReconnected:m,handshakeTimeoutMs:T,wsConfig:_}=t;if(this.userAgent=qv(d,{extraTags:B}),this.logger=new Tc(g,c),Km(!i,()=>this.logger.error("appId is needed")),!e&&!a)throw new ri(Wv,"appSecret or clientAssertionProvider is required");this.agent=A,this.dataCache=new Tv({logger:this.logger}),this.httpInstance=s,this.wsConfig.updateClient({appId:i,appSecret:e||"",clientAssertionProvider:a,domain:kW(r)}),this.wsConfig.updateWs({autoReconnect:I}),this.onReady=f,this.onError=Q,this.onReconnecting=y,this.onReconnected=m,this.handshakeTimeoutMs=T,this.pingTimeoutSec=(o=_?.pingTimeout)!==null&&o!==void 0?o:0}armLiveness(){this.pingTimeoutSec&&(this.livenessTimer&&clearTimeout(this.livenessTimer),this.livenessTimer=setTimeout(()=>{var t;this.livenessTimer=void 0,this.logger.warn("[ws]",`no pong/inbound within ${this.pingTimeoutSec}s of last ping, terminating to trigger reconnect`);try{(t=this.wsConfig.getWSInstance())===null||t===void 0||t.terminate()}catch{}},this.pingTimeoutSec*1e3))}clearLiveness(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=void 0)}safeInvoke(t,o,...i){if(o)try{o(...i)}catch(e){this.logger.error(`[ws] ${t} callback threw`,e)}}pullConnectConfig(){return h(this,void 0,void 0,function*(){let{appId:t,appSecret:o,clientAssertionProvider:i,domain:e}=this.wsConfig.getClient(),a="/callback/ws/endpoint",A=this.wsConfig.wsConfigUrl,r={locale:"zh","User-Agent":this.userAgent},s={AppID:t};try{if(i){let Q=Xv(e),y=yield i.retrieveToken(Q);if(!y||!y.value)throw new ri(Vv,"client assertion token is empty");s.AppSecret="",s.ClientAssertion=y.value,y.targetInfo&&(A=eP(y.targetInfo,a),r[zv]=Q)}else s.AppSecret=o;let{code:g,data:{URL:c,ClientConfig:I},msg:d}=yield this.httpInstance.request({method:"post",url:A,data:s,headers:r,timeout:15e3});if(g!==Eu.ok){let Q=g===Eu.system_busy?"system busy":d;return this.logger.error("[ws]",`code: ${g}, ${Q}`),g===Eu.internal_error?{ok:!1,retryable:!0}:{ok:!1,retryable:!1,error:`pullConnectConfig failed: code=${g}, msg=${Q}`}}let{device_id:B,service_id:f}=ANe.parse(c);return this.wsConfig.updateWs({connectUrl:c,deviceId:B,serviceId:f,pingInterval:I.PingInterval*1e3,reconnectCount:I.ReconnectCount,reconnectInterval:I.ReconnectInterval*1e3,reconnectNonce:I.ReconnectNonce*1e3}),this.logger.debug("[ws]",`get connect config success, ws url: ${c}`),{ok:!0}}catch(g){return this.logger.error("[ws]",g?.message||"system busy"),g instanceof ri?{ok:!1,retryable:!1,error:g.message}:{ok:!1,retryable:!0}}})}connect(){let t=this.wsConfig.getWS("connectUrl"),o;try{let{agent:i}=this;o=new Uo(t,{agent:i})}catch{this.logger.error("[ws]","new WebSocket error")}return o?(this.pendingWsInstance=o,new Promise(i=>{let e=!1,a,A=r=>{e||(e=!0,a&&clearTimeout(a),this.pendingWsInstance===o&&(this.pendingWsInstance=null),i(r))};this.handshakeTimeoutMs&&this.handshakeTimeoutMs>0&&(a=setTimeout(()=>{this.logger.error("[ws]",`handshake timeout after ${this.handshakeTimeoutMs}ms`),o.removeAllListeners("open");try{o.terminate()}catch{}A(!1)},this.handshakeTimeoutMs)),o.on("open",()=>{this.logger.debug("[ws]","ws connect success"),this.wsConfig.setWSInstance(o),this.pingLoop(),A(!0)}),o.on("error",()=>{this.logger.error("[ws]","ws connect failed"),A(!1)})})):Promise.resolve(!1)}reConnect(t=!1){return h(this,void 0,void 0,function*(){if(this.isConnecting&&!t){this.logger.debug("[ws]","repeat connection");return}this.isConnecting=!0;let o=++this.reconnectGeneration,i=()=>h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};this.reconnectInfo.lastConnectTime=Date.now();let c=yield this.pullConnectConfig();if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};if(!c.ok)return c;let I=yield this.connect();return o!==this.reconnectGeneration?{ok:!1,retryable:!1,cancelled:!0}:I?(this.communicate(),{ok:!0}):{ok:!1,retryable:!0}});this.pingInterval&&clearTimeout(this.pingInterval),this.reconnectInterval&&clearTimeout(this.reconnectInterval);let e=this.wsConfig.getWSInstance();if(t){e&&e?.terminate();let c={ok:!1,retryable:!0};try{c=yield i()}finally{o===this.reconnectGeneration&&(this.isConnecting=!1)}if(o!==this.reconnectGeneration||c.cancelled)return;if(c.ok)this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady);else if(c.retryable)this.logger.error("[ws]","connect failed"),yield this.reConnect();else{this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(c.error));return}this.logger.info("[ws]","ws client ready");return}let{autoReconnect:a,reconnectNonce:A,reconnectCount:r,reconnectInterval:s}=this.wsConfig.getWS();if(!a){this.hasEverConnected||(this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error("WebSocket connect failed and autoReconnect is disabled")));return}this.logger.info("[ws]","reconnect"),this.hasEverConnected&&this.safeInvoke("onReconnecting",this.onReconnecting),e&&e?.terminate(),this.wsConfig.setWSInstance(null);let g=A?A*Math.random():0;this.reconnectInterval=setTimeout(()=>h(this,void 0,void 0,function*(){(function c(I){return h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return;I++,this.currentReconnectAttempts=I;let d=yield i();if(o===this.reconnectGeneration){if(d.ok){this.logger.debug("[ws]","reconnect success"),this.currentReconnectAttempts=0,this.hasEverConnected?this.safeInvoke("onReconnected",this.onReconnected):(this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady)),this.isConnecting=!1;return}if(!d.retryable){this.isConnecting=!1,this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(d.error));return}if(this.logger.info("ws",`unable to connect to the server after trying ${I} times")`),r>=0&&I>=r){this.isConnecting=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(`WebSocket reconnect exhausted after ${I} attempts`));return}this.reconnectInterval=setTimeout(()=>{c.bind(this)(I)},s),this.reconnectInfo.nextConnectTime=Date.now()+s}})}).bind(this)(0)}),g),this.reconnectInfo.nextConnectTime=Date.now()+g})}pingLoop(){let{serviceId:t,pingInterval:o}=this.wsConfig.getWS(),i=this.wsConfig.getWSInstance();if(i?.readyState===Uo.OPEN){let e={headers:[{key:uu.type,value:Gd.ping}],service:Number(t),method:Cu.control,SeqID:0,LogID:0};this.sendMessage(e),this.armLiveness(),this.logger.trace("[ws]","ping success")}this.pingInterval=setTimeout(this.pingLoop.bind(this),o)}communicate(){let t=this.wsConfig.getWSInstance();t?.on("message",o=>h(this,void 0,void 0,function*(){this.clearLiveness();let i=MNe(o),{method:e}=i;e===Cu.control&&(yield this.handleControlData(i)),e===Cu.data&&(yield this.handleEventData(i))})),t?.on("error",o=>{this.logger.error("[ws]","ws error")}),t?.on("close",()=>{this.logger.debug("[ws]","client closed"),this.clearLiveness(),this.reConnect()})}handleControlData(t){var o;return h(this,void 0,void 0,function*(){let i=(o=t.headers.find(a=>a.key===uu.type))===null||o===void 0?void 0:o.value,e=t.payload;if(i!==Gd.ping&&i===Gd.pong&&e){this.logger.trace("[ws]","receive pong");let a=new TextDecoder("utf-8").decode(e),{PingInterval:A,ReconnectCount:r,ReconnectInterval:s,ReconnectNonce:g}=JSON.parse(a);this.wsConfig.updateWs({pingInterval:A*1e3,reconnectCount:r,reconnectInterval:s*1e3,reconnectNonce:g*1e3}),this.logger.trace("[ws]","update wsConfig with pong data")}})}handleEventData(t){var o;return h(this,void 0,void 0,function*(){let i=t.headers.reduce((f,Q)=>(f[Q.key]=Q.value,f),{}),{message_id:e,sum:a,seq:A,type:r,trace_id:s}=i,g=t.payload;if(r!==Gd.event)return;let c=this.dataCache.mergeData({message_id:e,sum:Number(a),seq:Number(A),trace_id:s,data:g});if(!c)return;this.logger.debug("[ws]",`receive message, message_type: ${r}; message_id: ${e}; trace_id: ${s}; data: ${c.data}`);let I={code:qm.ok},d=Date.now();try{let f=yield(o=this.eventDispatcher)===null||o===void 0?void 0:o.invoke(c,{needCheck:!1});f&&(I.data=Buffer.from(JSON.stringify(f)).toString("base64"))}catch(f){I.code=qm.internal_server_error,this.logger.error("[ws]",`invoke event failed, message_type: ${r}; message_id: ${e}; trace_id: ${s}; error: ${f}`)}let B=Date.now();this.sendMessage(Object.assign(Object.assign({},t),{headers:[...t.headers,{key:uu.biz_rt,value:String(d-B)}],payload:new TextEncoder().encode(JSON.stringify(I))}))})}sendMessage(t){var o;let i=this.wsConfig.getWSInstance();if(i?.readyState===Uo.OPEN){let e=UW.Frame.encode(t).finish();(o=this.wsConfig.getWSInstance())===null||o===void 0||o.send(e,a=>{a&&this.logger.error("[ws]","send data failed")})}}getReconnectInfo(){return this.reconnectInfo}getConnectionStatus(){return{state:this.computeState(),lastConnectTime:this.reconnectInfo.lastConnectTime||void 0,nextConnectTime:this.reconnectInfo.nextConnectTime||void 0,reconnectAttempts:this.currentReconnectAttempts}}computeState(){var t;return this.terminalError?"failed":this.isConnecting&&!this.hasEverConnected?"connecting":this.isConnecting&&this.hasEverConnected?"reconnecting":((t=this.wsConfig.getWSInstance())===null||t===void 0?void 0:t.readyState)===Uo.OPEN?"connected":"idle"}close(t={}){let{force:o=!1}=t;this.reconnectGeneration++,this.pingInterval&&(clearTimeout(this.pingInterval),this.pingInterval=void 0),this.reconnectInterval&&(clearTimeout(this.reconnectInterval),this.reconnectInterval=void 0),this.clearLiveness(),this.dataCache.destroy(),this.isConnecting=!1,this.currentReconnectAttempts=0;let i=this.pendingWsInstance;if(i){this.pendingWsInstance=null,i.removeAllListeners("open");try{o?i.terminate():i.close()}catch{}}let e=this.wsConfig.getWSInstance();e&&(e.removeAllListeners(),o?e.terminate():e.close(),this.wsConfig.setWSInstance(null)),this.logger.info("[ws]",`ws client closed manually${o?" (force)":""}`)}start(t){return h(this,void 0,void 0,function*(){let{appId:o}=this.wsConfig.getClient();if(!/^cli_[0-9a-fA-F]{16}$/.test(o)){this.logger.error("[ws]",`invalid appId: ${o}`);return}let{eventDispatcher:i}=t;if(!i){this.logger.warn("[ws]","client need to start with a eventDispatcher");return}let e=this.wsConfig.getWSInstance();if(this.terminalError&&(this.isConnecting=!1),this.isConnecting||e&&e.readyState!==Uo.CLOSED){this.logger.debug("[ws]","start ignored because client is already connecting or connected");return}this.terminalError=!1,this.currentReconnectAttempts=0,this.dataCache.clearAtInterval(),this.logger.info("[ws]",`receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in: Developer Console(\u5F00\u53D1\u8005\u540E\u53F0) -> Events and Callbacks(\u4E8B\u4EF6\u4E0E\u56DE\u8C03) -> Mode of event/callback subscription(\u8BA2\u9605\u65B9\u5F0F) -> - Receive events/callbacks through persistent connection(\u4F7F\u7528 \u957F\u8FDE\u63A5 \u63A5\u6536\u4E8B\u4EF6/\u56DE\u8C03)`),this.eventDispatcher=i,this.reConnect(!0)})}},Nv=class{constructor(){this.sessions=new Map}set(t,o){return h(this,void 0,void 0,function*(){let i=this.sessions.get(t.toString())||{},e=LW(i,o);return this.sessions.set(t.toString(),e),!0})}get(t){return h(this,void 0,void 0,function*(){return this.sessions.get(t.toString())})}},go;(function(n){n[n.ERROR=-1]="ERROR",n[n.SUCCESS=0]="SUCCESS",n[n.EXPIRED=1]="EXPIRED",n[n.CANCELLED=2]="CANCELLED",n[n.FAILED=3]="FAILED",n[n.OTHER=4]="OTHER"})(go||(go={}));var Rv=class{constructor(t){this.completions={create:this.create.bind(this),createWithStream:this.createWithStream.bind(this),sessionRecords:{get:this.getRecords.bind(this),update:this.updateRecords.bind(this)}},this.client=t.client,this.logger=t.client.logger,this.cache=t.cache||new Nv}getSessionId(t){var o;return h(this,void 0,void 0,function*(){let{sessionId:i,payload:e,options:a}=t,A=yield this.getRecords();if(i&&i in A)return A[i];let r=yield this.client.aily.v1.ailySession.create({data:e},a);if(r.code===0&&r.data){let s=(o=r.data.session)===null||o===void 0?void 0:o.id;return i&&(yield this.updateRecords({[i]:s})),s}else{this.logger.error("get aily session id error",r.msg);return}})}waitReply(t,o){var i,e;return h(this,void 0,void 0,function*(){let{sessionId:a,ailyAppId:A,message:r,sessionInfo:s,messageInfo:g,runInfo:c,skillId:I}=t,d=yield this.getSessionId({sessionId:a,payload:s,options:o});if(!d)throw go.ERROR;let B=yield this.client.aily.v1.ailySessionAilyMessage.create({path:{aily_session_id:d},data:Object.assign(Object.assign({},g),{content:r,idempotent_id:`${Date.now()}`,content_type:"MDX"})},o);if(!(B.code===0&&B.data))throw this.logger.error("create aily message error",B.msg),go.ERROR;let f=(i=B.data.message)===null||i===void 0?void 0:i.id,Q=yield this.client.aily.v1.ailySessionRun.create({path:{aily_session_id:d},data:Object.assign({app_id:A,skill_id:I},c)},o);if(!(Q.code===0&&Q.data))throw this.logger.error("create aily session run error",Q.msg),go.ERROR;let y=(e=Q.data.run)===null||e===void 0?void 0:e.id;if(!y)throw this.logger.error("run id is empty"),go.ERROR;let m=()=>h(this,void 0,void 0,function*(){return new Promise(_=>{setTimeout(()=>h(this,void 0,void 0,function*(){var R,K;let L=yield this.client.aily.v1.ailySessionRun.get({path:{aily_session_id:d,run_id:y}},o);if(!(L.code===0&&L.data)){_(3);return}switch((K=(R=L.data)===null||R===void 0?void 0:R.run)===null||K===void 0?void 0:K.status){case"QUEUED":case"IN_PROGRESS":yield h(this,void 0,void 0,function*(){let q=yield m();_(q)});case"COMPLETED":_(go.SUCCESS);case"EXPIRED":_(go.EXPIRED);case"CANCELLED":_(go.CANCELLED);case"FAILED":_(go.FAILED);default:_(go.OTHER)}}),500)})}),T=yield m();if(T!==go.SUCCESS)throw this.logger.error("aily run error"),T;return{ailySessionId:d,runId:y,messageId:f}})}create(t,o){var i,e,a,A,r;return h(this,void 0,void 0,function*(){let{ailySessionId:s,runId:g}=yield this.waitReply(t,o),c;try{for(var I=!0,d=IW(yield this.client.aily.v1.ailySessionAilyMessage.listWithIterator({path:{aily_session_id:s},params:{run_id:g,with_partial_message:!1}},o)),B;B=yield d.next(),i=B.done,!i;){A=B.value,I=!1;try{let f=A;if(!f)continue;(r=f?.messages)===null||r===void 0||r.forEach(Q=>{var y;((y=Q.sender)===null||y===void 0?void 0:y.sender_type)==="ASSISTANT"&&(c=Q)})}finally{I=!0}}}catch(f){e={error:f}}finally{try{!I&&!i&&(a=d.return)&&(yield a.call(d))}finally{if(e)throw e.error}}if(!c)throw this.logger.error("no aily reply"),go.ERROR;return c})}createWithStream(t,o){return h(this,void 0,void 0,function*(){let{ailySessionId:i,runId:e,messageId:a}=yield this.waitReply(t,o),A=()=>this.client.aily.v1.ailySessionAilyMessage.listWithIterator({path:{aily_session_id:i},params:{run_id:e,with_partial_message:!0}},o),r=!1;return{[Symbol.asyncIterator](){return j(this,arguments,function*(){var c,I,d,B;try{for(var f=!0,Q=IW(yield S(A())),y;y=yield S(Q.next()),c=y.done,!c;){B=y.value,f=!1;try{let m=B;if(!m)continue;for(let T of m.messages||[])if(r){if(yield yield S(T),T.status==="COMPLETED")return yield S(void 0)}else T.id===a&&T.status==="COMPLETED"&&(r=!0)}finally{f=!0}}}catch(m){I={error:m}}finally{try{!f&&!c&&(d=Q.return)&&(yield S(d.call(Q)))}finally{if(I)throw I.error}}})}}})}getRecords(){return h(this,void 0,void 0,function*(){return(yield this.cache.get(pW))||{}})}updateRecords(t){return h(this,void 0,void 0,function*(){yield this.cache.set(pW,t)})}};function cu(n,t){if(typeof n!="object"||n===null||Array.isArray(n))throw new Error(`${t} must be an object`)}function Iu(n,t,o){for(let i of Object.keys(n))if(!t.includes(i))throw new Error(`${o}.${i} is not allowed; allowed keys: ${t.join(", ")}`)}function _Ne(n,t){if(n!==void 0){if(!Array.isArray(n))throw new Error(`${t} must be an array of strings`);return n.forEach((o,i)=>{if(typeof o!="string"||o==="")throw new Error(`${t}[${i}] must be a non-empty string`)}),n}}function TNe(n){cu(n,"addons"),Iu(n,["preset","scopes","events","callbacks"],"addons");let t=0,o=(e,a)=>{var A;let r=_Ne(e,a);return t+=(A=r?.length)!==null&&A!==void 0?A:0,r},i={};if(n.preset!==void 0){if(typeof n.preset!="boolean")throw new Error("addons.preset must be a boolean");i.preset=n.preset}if(n.scopes!==void 0&&(cu(n.scopes,"addons.scopes"),Iu(n.scopes,["tenant","user"],"addons.scopes"),i.scopes={tenant:o(n.scopes.tenant,"addons.scopes.tenant"),user:o(n.scopes.user,"addons.scopes.user")}),n.events!==void 0&&(cu(n.events,"addons.events"),Iu(n.events,["items"],"addons.events"),n.events.items!==void 0&&(cu(n.events.items,"addons.events.items"),Iu(n.events.items,["tenant","user"],"addons.events.items"),i.events={items:{tenant:o(n.events.items.tenant,"addons.events.items.tenant"),user:o(n.events.items.user,"addons.events.items.user")}})),n.callbacks!==void 0&&(cu(n.callbacks,"addons.callbacks"),Iu(n.callbacks,["items"],"addons.callbacks"),i.callbacks={items:o(n.callbacks.items,"addons.callbacks.items")}),t===0&&n.preset!==!1)throw new Error("addons must contain at least one scope, event or callback");return i}function NNe(n){let t=JSON.stringify(TNe(n));return tNe(Buffer.from(t,"utf8")).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function lu(n,t){return{code:n,description:t}}var hW="node-sdk",RNe="accounts.feishu.cn",kNe="accounts.larksuite.com",vNe="/oauth/v1/app/registration",EW=6;function PNe(n,t){let{avatar:o,name:i,desc:e}=t;if(o!==void 0){let a=Array.isArray(o)?o:[o];if(a.length===0)throw new Error("appPreset.avatar must contain at least 1 URL");if(a.length>EW)throw new Error(`appPreset.avatar supports at most ${EW} URLs, got ${a.length}`);a.forEach((A,r)=>{if(typeof A!="string"||A==="")throw new Error(`appPreset.avatar[${r}] must be a non-empty string`);n.searchParams.append("avatar",A)})}i!==void 0&&n.searchParams.set("name",i),e!==void 0&&n.searchParams.set("desc",e)}function HW(n,t){var o;return h(this,void 0,void 0,function*(){try{return yield Fd.post(`${n}${vNe}`,new URLSearchParams(t).toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(i){if(i instanceof FN&&(!((o=i.response)===null||o===void 0)&&o.data))return i.response.data;throw i}})}function GNe(n){return HW(n,{action:"begin",archetype:"PersonalAgent",auth_method:"client_secret",request_user_info:"open_id"})}function FNe(n){return new Promise((t,o)=>{var i,e;let{baseUrl:a,interval:A}=n,r=!1,s=null,g=null,c=()=>{var B;s!==null&&(clearTimeout(s),s=null),g!==null&&(clearTimeout(g),g=null),(B=n.signal)===null||B===void 0||B.removeEventListener("abort",I)},I=()=>{c(),o(lu("abort","Registration was aborted"))};if(!((i=n.signal)===null||i===void 0)&&i.aborted)return o(lu("abort","Registration was aborted"));(e=n.signal)===null||e===void 0||e.addEventListener("abort",I,{once:!0}),g=setTimeout(()=>{c(),o(lu("expired_token","Polling timed out"))},n.expireIn);let d=()=>h(this,void 0,void 0,function*(){var B,f,Q,y,m,T;try{let _=yield HW(a,{action:"poll",device_code:n.deviceCode});if(((B=_.user_info)===null||B===void 0?void 0:B.tenant_brand)==="lark"&&!r){a=n.larkBaseUrl,r=!0,(f=n.onStatusChange)===null||f===void 0||f.call(n,{status:"domain_switched"}),d();return}if(_.client_id&&_.client_secret){c(),t({client_id:_.client_id,client_secret:_.client_secret,user_info:_.user_info});return}switch(_.error){case"authorization_pending":(Q=n.onStatusChange)===null||Q===void 0||Q.call(n,{status:"polling"});break;case"slow_down":A+=5e3,(y=n.onStatusChange)===null||y===void 0||y.call(n,{status:"slow_down",interval:A/1e3});break;case"access_denied":case"expired_token":c(),o(lu(_.error,(m=_.error_description)!==null&&m!==void 0?m:"Unknown error"));return;default:if(_.error){c(),o(lu(_.error,(T=_.error_description)!==null&&T!==void 0?T:"Unknown error"));return}break}s=setTimeout(d,A)}catch(_){c(),o(_)}});d()})}function LNe(n){var t,o,i,e;return h(this,void 0,void 0,function*(){let{domain:a,source:A,signal:r,onQRCodeReady:s,onStatusChange:g,appPreset:c,addons:I,createOnly:d,appId:B}=n;if(B!==void 0&&(typeof B!="string"||B===""))throw new Error("appId must be a non-empty string");let f=`https://${a??RNe}`,Q=yield GNe(f),y=new URL(Q.verification_uri_complete);return y.searchParams.set("from","sdk"),y.searchParams.set("source",A?`${hW}/${A}`:hW),y.searchParams.set("tp","sdk"),c&&PNe(y,c),I&&y.searchParams.set("addons",NNe(I)),d===!0&&y.searchParams.set("createOnly","true"),B&&y.searchParams.set("clientID",B),s({url:y.toString(),expireIn:(t=Q.expires_in)!==null&&t!==void 0?t:600}),FNe({baseUrl:f,deviceCode:Q.device_code,interval:((o=Q.interval)!==null&&o!==void 0?o:5)*1e3,expireIn:((i=Q.expires_in)!==null&&i!==void 0?i:600)*1e3,larkBaseUrl:`https://${(e=n.larkDomain)!==null&&e!==void 0?e:kNe}`,signal:r,onStatusChange:g})})}var Ft=class extends Error{constructor(t,o,i){super(o),this.name="LarkChannelError",this.code=t,this.cause=i?.cause,this.context=i?.context}},Vm=class{constructor(t,o){this.opts=t,this.fire=o,this.pendingChars=0,this.lastFireAt=0}note(t){if(this.pendingChars+=t,this.pendingChars>=this.opts.chars){this.fireSoon(0);return}if(!this.timer){let o=Date.now()-this.lastFireAt,i=Math.max(0,this.opts.ms-o);this.fireSoon(i)}}fireSoon(t){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=void 0,this.doFire()},t)}flushNow(){return h(this,void 0,void 0,function*(){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this.inFlight&&(yield this.inFlight),yield this.doFire()})}doFire(){return h(this,void 0,void 0,function*(){if(this.inFlight){this.fireSoon(this.opts.ms);return}let t=h(this,void 0,void 0,function*(){this.pendingChars=0,this.lastFireAt=Date.now(),yield this.fire()});this.inFlight=t;try{yield t}finally{this.inFlight=void 0}})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}},Wm=class{constructor(){this.tail=Promise.resolve()}enqueue(t){let o=this.tail.then(t,t);return this.tail=o.then(()=>{},()=>{}),o}drain(){return this.tail}};function UNe(n,t){if(!n)return t;if(!t)return n;if(t.startsWith(n))return t;if(n.startsWith(t))return n;let o=Math.min(n.length,t.length);for(let i=o;i>0;i--)if(n.endsWith(t.substring(0,i)))return n+t.substring(i);return n+t}function KW(n,t){if(n.length<=t)return[n];let o=n.split(` + Receive events/callbacks through persistent connection(\u4F7F\u7528 \u957F\u8FDE\u63A5 \u63A5\u6536\u4E8B\u4EF6/\u56DE\u8C03)`),this.eventDispatcher=i,this.reConnect(!0)})}},Nv=class{constructor(){this.sessions=new Map}set(t,o){return h(this,void 0,void 0,function*(){let i=this.sessions.get(t.toString())||{},e=LW(i,o);return this.sessions.set(t.toString(),e),!0})}get(t){return h(this,void 0,void 0,function*(){return this.sessions.get(t.toString())})}},go;(function(n){n[n.ERROR=-1]="ERROR",n[n.SUCCESS=0]="SUCCESS",n[n.EXPIRED=1]="EXPIRED",n[n.CANCELLED=2]="CANCELLED",n[n.FAILED=3]="FAILED",n[n.OTHER=4]="OTHER"})(go||(go={}));var Rv=class{constructor(t){this.completions={create:this.create.bind(this),createWithStream:this.createWithStream.bind(this),sessionRecords:{get:this.getRecords.bind(this),update:this.updateRecords.bind(this)}},this.client=t.client,this.logger=t.client.logger,this.cache=t.cache||new Nv}getSessionId(t){var o;return h(this,void 0,void 0,function*(){let{sessionId:i,payload:e,options:a}=t,A=yield this.getRecords();if(i&&i in A)return A[i];let r=yield this.client.aily.v1.ailySession.create({data:e},a);if(r.code===0&&r.data){let s=(o=r.data.session)===null||o===void 0?void 0:o.id;return i&&(yield this.updateRecords({[i]:s})),s}else{this.logger.error("get aily session id error",r.msg);return}})}waitReply(t,o){var i,e;return h(this,void 0,void 0,function*(){let{sessionId:a,ailyAppId:A,message:r,sessionInfo:s,messageInfo:g,runInfo:c,skillId:I}=t,d=yield this.getSessionId({sessionId:a,payload:s,options:o});if(!d)throw go.ERROR;let B=yield this.client.aily.v1.ailySessionAilyMessage.create({path:{aily_session_id:d},data:Object.assign(Object.assign({},g),{content:r,idempotent_id:`${Date.now()}`,content_type:"MDX"})},o);if(!(B.code===0&&B.data))throw this.logger.error("create aily message error",B.msg),go.ERROR;let f=(i=B.data.message)===null||i===void 0?void 0:i.id,Q=yield this.client.aily.v1.ailySessionRun.create({path:{aily_session_id:d},data:Object.assign({app_id:A,skill_id:I},c)},o);if(!(Q.code===0&&Q.data))throw this.logger.error("create aily session run error",Q.msg),go.ERROR;let y=(e=Q.data.run)===null||e===void 0?void 0:e.id;if(!y)throw this.logger.error("run id is empty"),go.ERROR;let m=()=>h(this,void 0,void 0,function*(){return new Promise(_=>{setTimeout(()=>h(this,void 0,void 0,function*(){var R,K;let L=yield this.client.aily.v1.ailySessionRun.get({path:{aily_session_id:d,run_id:y}},o);if(!(L.code===0&&L.data)){_(3);return}switch((K=(R=L.data)===null||R===void 0?void 0:R.run)===null||K===void 0?void 0:K.status){case"QUEUED":case"IN_PROGRESS":yield h(this,void 0,void 0,function*(){let q=yield m();_(q)});case"COMPLETED":_(go.SUCCESS);case"EXPIRED":_(go.EXPIRED);case"CANCELLED":_(go.CANCELLED);case"FAILED":_(go.FAILED);default:_(go.OTHER)}}),500)})}),T=yield m();if(T!==go.SUCCESS)throw this.logger.error("aily run error"),T;return{ailySessionId:d,runId:y,messageId:f}})}create(t,o){var i,e,a,A,r;return h(this,void 0,void 0,function*(){let{ailySessionId:s,runId:g}=yield this.waitReply(t,o),c;try{for(var I=!0,d=IW(yield this.client.aily.v1.ailySessionAilyMessage.listWithIterator({path:{aily_session_id:s},params:{run_id:g,with_partial_message:!1}},o)),B;B=yield d.next(),i=B.done,!i;){A=B.value,I=!1;try{let f=A;if(!f)continue;(r=f?.messages)===null||r===void 0||r.forEach(Q=>{var y;((y=Q.sender)===null||y===void 0?void 0:y.sender_type)==="ASSISTANT"&&(c=Q)})}finally{I=!0}}}catch(f){e={error:f}}finally{try{!I&&!i&&(a=d.return)&&(yield a.call(d))}finally{if(e)throw e.error}}if(!c)throw this.logger.error("no aily reply"),go.ERROR;return c})}createWithStream(t,o){return h(this,void 0,void 0,function*(){let{ailySessionId:i,runId:e,messageId:a}=yield this.waitReply(t,o),A=()=>this.client.aily.v1.ailySessionAilyMessage.listWithIterator({path:{aily_session_id:i},params:{run_id:e,with_partial_message:!0}},o),r=!1;return{[Symbol.asyncIterator](){return j(this,arguments,function*(){var c,I,d,B;try{for(var f=!0,Q=IW(yield S(A())),y;y=yield S(Q.next()),c=y.done,!c;){B=y.value,f=!1;try{let m=B;if(!m)continue;for(let T of m.messages||[])if(r){if(yield yield S(T),T.status==="COMPLETED")return yield S(void 0)}else T.id===a&&T.status==="COMPLETED"&&(r=!0)}finally{f=!0}}}catch(m){I={error:m}}finally{try{!f&&!c&&(d=Q.return)&&(yield S(d.call(Q)))}finally{if(I)throw I.error}}})}}})}getRecords(){return h(this,void 0,void 0,function*(){return(yield this.cache.get(pW))||{}})}updateRecords(t){return h(this,void 0,void 0,function*(){yield this.cache.set(pW,t)})}};function cu(n,t){if(typeof n!="object"||n===null||Array.isArray(n))throw new Error(`${t} must be an object`)}function Iu(n,t,o){for(let i of Object.keys(n))if(!t.includes(i))throw new Error(`${o}.${i} is not allowed; allowed keys: ${t.join(", ")}`)}function _Ne(n,t){if(n!==void 0){if(!Array.isArray(n))throw new Error(`${t} must be an array of strings`);return n.forEach((o,i)=>{if(typeof o!="string"||o==="")throw new Error(`${t}[${i}] must be a non-empty string`)}),n}}function TNe(n){cu(n,"addons"),Iu(n,["preset","scopes","events","callbacks"],"addons");let t=0,o=(e,a)=>{var A;let r=_Ne(e,a);return t+=(A=r?.length)!==null&&A!==void 0?A:0,r},i={};if(n.preset!==void 0){if(typeof n.preset!="boolean")throw new Error("addons.preset must be a boolean");i.preset=n.preset}if(n.scopes!==void 0&&(cu(n.scopes,"addons.scopes"),Iu(n.scopes,["tenant","user"],"addons.scopes"),i.scopes={tenant:o(n.scopes.tenant,"addons.scopes.tenant"),user:o(n.scopes.user,"addons.scopes.user")}),n.events!==void 0&&(cu(n.events,"addons.events"),Iu(n.events,["items"],"addons.events"),n.events.items!==void 0&&(cu(n.events.items,"addons.events.items"),Iu(n.events.items,["tenant","user"],"addons.events.items"),i.events={items:{tenant:o(n.events.items.tenant,"addons.events.items.tenant"),user:o(n.events.items.user,"addons.events.items.user")}})),n.callbacks!==void 0&&(cu(n.callbacks,"addons.callbacks"),Iu(n.callbacks,["items"],"addons.callbacks"),i.callbacks={items:o(n.callbacks.items,"addons.callbacks.items")}),t===0&&n.preset!==!1)throw new Error("addons must contain at least one scope, event or callback");return i}function NNe(n){let t=JSON.stringify(TNe(n));return tNe(Buffer.from(t,"utf8")).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function lu(n,t){return{code:n,description:t}}var hW="node-sdk",RNe="accounts.feishu.cn",kNe="accounts.larksuite.com",vNe="/oauth/v1/app/registration",EW=6;function PNe(n,t){let{avatar:o,name:i,desc:e}=t;if(o!==void 0){let a=Array.isArray(o)?o:[o];if(a.length===0)throw new Error("appPreset.avatar must contain at least 1 URL");if(a.length>EW)throw new Error(`appPreset.avatar supports at most ${EW} URLs, got ${a.length}`);a.forEach((A,r)=>{if(typeof A!="string"||A==="")throw new Error(`appPreset.avatar[${r}] must be a non-empty string`);n.searchParams.append("avatar",A)})}i!==void 0&&n.searchParams.set("name",i),e!==void 0&&n.searchParams.set("desc",e)}function HW(n,t){var o;return h(this,void 0,void 0,function*(){try{return yield Ld.post(`${n}${vNe}`,new URLSearchParams(t).toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(i){if(i instanceof FN&&(!((o=i.response)===null||o===void 0)&&o.data))return i.response.data;throw i}})}function GNe(n){return HW(n,{action:"begin",archetype:"PersonalAgent",auth_method:"client_secret",request_user_info:"open_id"})}function FNe(n){return new Promise((t,o)=>{var i,e;let{baseUrl:a,interval:A}=n,r=!1,s=null,g=null,c=()=>{var B;s!==null&&(clearTimeout(s),s=null),g!==null&&(clearTimeout(g),g=null),(B=n.signal)===null||B===void 0||B.removeEventListener("abort",I)},I=()=>{c(),o(lu("abort","Registration was aborted"))};if(!((i=n.signal)===null||i===void 0)&&i.aborted)return o(lu("abort","Registration was aborted"));(e=n.signal)===null||e===void 0||e.addEventListener("abort",I,{once:!0}),g=setTimeout(()=>{c(),o(lu("expired_token","Polling timed out"))},n.expireIn);let d=()=>h(this,void 0,void 0,function*(){var B,f,Q,y,m,T;try{let _=yield HW(a,{action:"poll",device_code:n.deviceCode});if(((B=_.user_info)===null||B===void 0?void 0:B.tenant_brand)==="lark"&&!r){a=n.larkBaseUrl,r=!0,(f=n.onStatusChange)===null||f===void 0||f.call(n,{status:"domain_switched"}),d();return}if(_.client_id&&_.client_secret){c(),t({client_id:_.client_id,client_secret:_.client_secret,user_info:_.user_info});return}switch(_.error){case"authorization_pending":(Q=n.onStatusChange)===null||Q===void 0||Q.call(n,{status:"polling"});break;case"slow_down":A+=5e3,(y=n.onStatusChange)===null||y===void 0||y.call(n,{status:"slow_down",interval:A/1e3});break;case"access_denied":case"expired_token":c(),o(lu(_.error,(m=_.error_description)!==null&&m!==void 0?m:"Unknown error"));return;default:if(_.error){c(),o(lu(_.error,(T=_.error_description)!==null&&T!==void 0?T:"Unknown error"));return}break}s=setTimeout(d,A)}catch(_){c(),o(_)}});d()})}function LNe(n){var t,o,i,e;return h(this,void 0,void 0,function*(){let{domain:a,source:A,signal:r,onQRCodeReady:s,onStatusChange:g,appPreset:c,addons:I,createOnly:d,appId:B}=n;if(B!==void 0&&(typeof B!="string"||B===""))throw new Error("appId must be a non-empty string");let f=`https://${a??RNe}`,Q=yield GNe(f),y=new URL(Q.verification_uri_complete);return y.searchParams.set("from","sdk"),y.searchParams.set("source",A?`${hW}/${A}`:hW),y.searchParams.set("tp","sdk"),c&&PNe(y,c),I&&y.searchParams.set("addons",NNe(I)),d===!0&&y.searchParams.set("createOnly","true"),B&&y.searchParams.set("clientID",B),s({url:y.toString(),expireIn:(t=Q.expires_in)!==null&&t!==void 0?t:600}),FNe({baseUrl:f,deviceCode:Q.device_code,interval:((o=Q.interval)!==null&&o!==void 0?o:5)*1e3,expireIn:((i=Q.expires_in)!==null&&i!==void 0?i:600)*1e3,larkBaseUrl:`https://${(e=n.larkDomain)!==null&&e!==void 0?e:kNe}`,signal:r,onStatusChange:g})})}var Lt=class extends Error{constructor(t,o,i){super(o),this.name="LarkChannelError",this.code=t,this.cause=i?.cause,this.context=i?.context}},Vm=class{constructor(t,o){this.opts=t,this.fire=o,this.pendingChars=0,this.lastFireAt=0}note(t){if(this.pendingChars+=t,this.pendingChars>=this.opts.chars){this.fireSoon(0);return}if(!this.timer){let o=Date.now()-this.lastFireAt,i=Math.max(0,this.opts.ms-o);this.fireSoon(i)}}fireSoon(t){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=void 0,this.doFire()},t)}flushNow(){return h(this,void 0,void 0,function*(){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this.inFlight&&(yield this.inFlight),yield this.doFire()})}doFire(){return h(this,void 0,void 0,function*(){if(this.inFlight){this.fireSoon(this.opts.ms);return}let t=h(this,void 0,void 0,function*(){this.pendingChars=0,this.lastFireAt=Date.now(),yield this.fire()});this.inFlight=t;try{yield t}finally{this.inFlight=void 0}})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}},Wm=class{constructor(){this.tail=Promise.resolve()}enqueue(t){let o=this.tail.then(t,t);return this.tail=o.then(()=>{},()=>{}),o}drain(){return this.tail}};function UNe(n,t){if(!n)return t;if(!t)return n;if(t.startsWith(n))return t;if(n.startsWith(t))return n;let o=Math.min(n.length,t.length);for(let i=o;i>0;i--)if(n.endsWith(t.substring(0,i)))return n+t.substring(i);return n+t}function KW(n,t){if(n.length<=t)return[n];let o=n.split(` `),i=[],e=[],a=0,A=null,r=()=>{if(e.length===0)return;let s=e.join(` `);A!==null&&(s+="\n```"),i.push(s),e=[],a=0,A!==null&&(e.push("```"+A),a=e[0].length)};for(let s of o){let g=s.match(/^```(\w*)$/),c=s.length+(e.length>0?1:0),I=/^#{1,6}\s/.test(s),d=a>t*.75;(a+c>t||I&&d&&e.length>0)&&r(),e.push(s),a+=c,g&&(A=A===null?g[1]||"":null)}return r(),i}var HNe=100,KNe=50,xNe="Thinking...",CW="(no content)",YNe="[Generating...]",jNe=50,JNe=` \u2014 _(Generation interrupted)_`,qNe=3e4,Gm="stream_md";function CR(n,t=jNe){if(!n)return"";let o=n.replace(/\s+/g," ").trim();return o.length<=t?o:o.slice(0,t-1)+"\u2026"}function uW(n){return{schema:"2.0",config:{streaming_mode:!0,summary:{content:YNe},streaming_config:{print_frequency_ms:{default:70},print_step:{default:1},print_strategy:"fast"}},body:{elements:[{tag:"markdown",element_id:Gm,content:n}]}}}var kv=class{constructor(t,o,i,e){var a,A,r;this.sender=t,this.to=o,this.idType=i,this.opts=e,this.content="",this.fullAccumulated="",this._messageId="",this.cardId="",this.sequence=0,this.queue=new Wm,this.started=!1,this.streamingFailed=!1,this.rolloverMessageIds=[];let s=this.sender.config;this.throttle=new Vm({ms:(a=s.streamThrottleMs)!==null&&a!==void 0?a:HNe,chars:(A=s.streamThrottleChars)!==null&&A!==void 0?A:KNe},()=>this.pushContent()),this.maxChars=(r=s.streamMaxElementChars)!==null&&r!==void 0?r:qNe}get messageId(){return this._messageId}append(t){return h(this,void 0,void 0,function*(){if(!t)return;yield this.ensureStarted();let o=UNe(this.fullAccumulated,t),i=o.slice(this.fullAccumulated.length);this.fullAccumulated=o,this.content+=i,this.throttle.note(t.length)})}setContent(t){return h(this,void 0,void 0,function*(){yield this.ensureStarted(),this.fullAccumulated=t??"",this.content=t??"",this.throttle.note(Number.MAX_SAFE_INTEGER)})}run(t){return h(this,void 0,void 0,function*(){yield this.ensureStarted();try{yield t(this)}catch(o){throw yield this.failTerminal(o),o}return yield this.completeTerminal(),{messageId:this._messageId}})}ensureStarted(){var t;return h(this,void 0,void 0,function*(){if(this.started)return;this.started=!0;let o=(t=this.sender.config.streamInitialText)!==null&&t!==void 0?t:xNe,i=uW(o||"...");this.cardId=yield this.sender.createCardInstance(i),this._messageId=yield this.sender.sendCardByReference(this.to,this.idType,this.cardId,this.opts)})}pushContent(){return h(this,void 0,void 0,function*(){!this.cardId||this.streamingFailed||(yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){var t,o;if(!this.streamingFailed)try{yield this.pushSnapshot()}catch(i){this.streamingFailed=!0,(o=(t=this.sender.logger).warn)===null||o===void 0||o.call(t,"[stream] update failed",i)}})))})}pushSnapshot(){return h(this,void 0,void 0,function*(){for(;this.content.length>this.maxChars;)yield this.rollover();let t=this.content||"...";yield this.sender.updateCardElementContent(this.cardId,Gm,t,++this.sequence)})}rollover(){return h(this,void 0,void 0,function*(){let t=KW(this.content,this.maxChars);if(t.length<2)throw new Error("rollover: content not splittable below limit");let o=t[0],i=t.slice(1).join(` -`);yield this.sender.updateCardElementContent(this.cardId,Gm,o,++this.sequence);try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,CR(o))}catch{}let e=uW(i||"..."),a=yield this.sender.createCardInstance(e),A=yield this.sender.sendCardByReference(this.to,this.idType,a,this.opts);this.cardId=a,this.content=i,this.sequence=0,this.rolloverMessageIds.push(A)})}completeTerminal(){var t,o;return h(this,void 0,void 0,function*(){if(yield this.throttle.flushNow(),yield this.queue.drain(),!!this.cardId){!this.content&&!this.streamingFailed&&(yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.sender.updateCardElementContent(this.cardId,Gm,CW,++this.sequence)}catch{}})),yield this.queue.drain());try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,CR(this.content||CW))}catch(i){(o=(t=this.sender.logger).warn)===null||o===void 0||o.call(t,"[stream] finishStreamingCard failed",i)}}})}failTerminal(t){return h(this,void 0,void 0,function*(){if(this.throttle.dispose(),!!this.cardId){this.content=(this.content||"")+JNe,yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.pushSnapshot()}catch{}})),yield this.queue.drain();try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,CR(this.content))}catch{}}})}},vv=class{constructor(t,o,i,e){this.impl=new kv(t,o,i,e)}run(t){return this.impl.run(t)}},zNe=100,VNe=50,Pv=class{constructor(t,o,i,e,a){var A,r;this.sender=t,this.to=o,this.idType=i,this.opts=e,this._messageId="",this.queue=new Wm,this._current=a;let s=t.config;this.throttle=new Vm({ms:(A=s.streamThrottleMs)!==null&&A!==void 0?A:zNe,chars:(r=s.streamThrottleChars)!==null&&r!==void 0?r:VNe},()=>this.patch())}get messageId(){return this._messageId}get current(){return this._current}update(t){return h(this,void 0,void 0,function*(){let o=typeof t=="function"?t(this._current):t;this._current=o,this.throttle.note(JSON.stringify(o).length)})}run(t){return h(this,void 0,void 0,function*(){yield this.sendInitial();try{yield t(this)}catch(o){throw yield this.failTerminal(o),o}return yield this.completeTerminal(),{messageId:this._messageId}})}sendInitial(){return h(this,void 0,void 0,function*(){let t=yield this.sender.sendOneWithFallback({to:this.to,idType:this.idType,msgType:"interactive",content:this._current,replyTo:this.opts.replyTo,replyInThread:this.opts.replyInThread});this._messageId=t})}patch(){return h(this,void 0,void 0,function*(){if(!this._messageId)return;let t=this._current;yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){yield this.sender.patchCard(this._messageId,t)}))})}completeTerminal(){return h(this,void 0,void 0,function*(){yield this.throttle.flushNow(),yield this.queue.drain()})}failTerminal(t){return h(this,void 0,void 0,function*(){this.throttle.dispose();let o=WNe(this._current);yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.sender.patchCard(this._messageId,o)}catch{}})),yield this.queue.drain()})}};function WNe(n){let t=n,o=Array.isArray(t?.elements)?[...t.elements]:[];return o.push({tag:"note",elements:[{tag:"plain_text",content:"\u26A0\uFE0F \u751F\u6210\u4E2D\u65AD"}]}),Object.assign(Object.assign({},n),{elements:o})}var Gv=class{constructor(t,o,i,e,a){this.impl=new Pv(t,o,i,e,a)}run(t){return this.impl.run(t)}};function ZNe(n){if(!(!n||n.length<27)){for(let t=n.length-27;t>=0;t--)if(n[t]===79&&n[t+1]===103&&n[t+2]===103&&n[t+3]===83){let o=n.readBigInt64LE(t+6);if(on.length)return;let e=n.readUInt8(i),a=i+4,A,r;if(e===1){if(a+28>n.length)return;A=n.readUInt32BE(a+16),r=Number(n.readBigUInt64BE(a+20))}else{if(a+16>n.length)return;A=n.readUInt32BE(a+8),r=n.readUInt32BE(a+12)}if(!(!A||!Number.isFinite(A)||!Number.isFinite(r)))return Math.round(r/A*1e3)}function BW(n,t,o,i){let e=t;for(;e+8<=o&&e+8<=n.length;){let a=n.readUInt32BE(e),A=n.slice(e+4,e+8).toString("ascii"),r=a===1?e+Number(n.readBigUInt64BE(e+8)):a===0?o:e+a;if(r<=e||r>o)return;if(A===i)return{start:a===1?e+16:e+8,end:r};e=r}}var $Ne=[[0,8],[167772160,8],[2130706432,8],[2851995648,16],[2886729728,12],[3232235520,16],[1681915904,10],[3221225472,24],[3221225984,24],[3323068416,15],[3325256704,24],[3405803776,24],[3758096384,4],[4026531840,4]];function e0e(n,t={}){var o,i;return h(this,void 0,void 0,function*(){let e=new URL(n);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`ssrf_blocked: protocol ${e.protocol}`);let a=e.hostname,A=a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a,r=(i=(o=t.allowlist)===null||o===void 0?void 0:o.includes(A))!==null&&i!==void 0?i:!1,s;if(TW(A))s=A,r||fW(s);else{let g=yield iNe.lookup(A,{all:!0});if(g.length===0)throw new Error(`ssrf_blocked: no DNS records for ${A}`);if(!r)for(let c of g)fW(c.address);s=g[0].address}return{resolvedIp:s,originalHost:A}})}function fW(n){let t=TW(n);if(t===4&&xW(n))throw new Error(`ssrf_blocked: ${n}`);if(t===6&&n0e(n))throw new Error(`ssrf_blocked: ${n}`);if(t===0)throw new Error(`ssrf_blocked: not a valid IP: ${n}`)}function xW(n){let t=n.split(".").map(Number);if(t.length!==4||t.some(i=>i<0||i>255))return!0;let o=(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0;return $Ne.some(([i,e])=>{let a=e===0?0:-1<<32-e>>>0;return(o&a)===(i&a)})}var A0e=[[BigInt("0xfe800000000000000000000000000000"),10],[BigInt("0xfc000000000000000000000000000000"),7],[BigInt("0xff000000000000000000000000000000"),8],[BigInt("0x01000000000000000000000000000000"),64],[BigInt("0x20010db8000000000000000000000000"),32],[BigInt("0x20010000000000000000000000000000"),32]],t0e=BigInt("0xffffffffffffffffffffffff00000000"),r0e=BigInt("0x00000000000000000000ffff00000000"),a0e=BigInt(0),i0e=BigInt("0x0064ff9b000000000000000000000000"),o0e=BigInt("0xffffffff");function n0e(n){let t;try{t=s0e(n)}catch{return!0}let o=t&t0e;if(o===r0e||o===i0e||o===a0e){let i=Number(t&o0e),e=[i>>>24&255,i>>>16&255,i>>>8&255,i&255].join(".");return xW(e)}return A0e.some(([i,e])=>{let a=BigInt(128-e),r=(BigInt(1)<>a<!Number.isFinite(g)||g<0||g>255))throw new Error("bad v4 suffix");let r=(A[0]<<8|A[1]).toString(16),s=(A[2]<<8|A[3]).toString(16);t=t.slice(0,t.length-o[1].length)+`${r}:${s}`}let i=t.split("::");if(i.length>2)throw new Error('multiple "::"');let e;if(i.length===2){let A=i[0]?i[0].split(":"):[],r=i[1]?i[1].split(":"):[],s=8-A.length-r.length;if(s<0)throw new Error("too many groups");e=[...A,...Array(s).fill("0"),...r]}else e=t.split(":");if(e.length!==8)throw new Error("wrong group count");let a=BigInt(0);for(let A of e){if(!/^[0-9a-f]{0,4}$/.test(A))throw new Error("bad group");a=a<0&&!(yield Promise.all(r.map(d=>h(this,void 0,void 0,function*(){let B=hu.resolve(d);try{return yield tt.promises.realpath(B)}catch{return B}})))).some(d=>g===d||g.startsWith(d+hu.sep)))throw new Ft("upload_failed",`file path is outside allowed directories: ${g}`);return yield tt.promises.readFile(g)}catch(g){throw g instanceof Ft?g:new Ft("upload_failed",`source is neither an http(s) URL nor a readable local file: ${t}`,{cause:g})}}let e=(i=this.config)===null||i===void 0?void 0:i.ssrfGuard,a=e!==!1,A;if(a){let r=typeof e=="object"&&e?{allowlist:e.allowlist}:{};try{({resolvedIp:A}=yield e0e(t,r))}catch(s){throw new Ft("ssrf_blocked",`URL blocked: ${String(s)}`,{cause:s})}}try{let r={url:t,method:"GET",responseType:"arraybuffer",timeout:15e3,maxContentLength:QW,maxBodyLength:QW};if(A){let g=c0e(t,A);r.httpAgent=g,r.httpsAgent=g}let s=yield this.client.httpInstance.request(r);return Buffer.from(s)}catch(r){throw new Ft("upload_failed","fetch source URL failed",{cause:r})}})}assertNotOnPosixBlocklist(t){if(process.platform!=="win32"&&g0e.some(o=>t===o.slice(0,-1)||t.startsWith(o)))throw new Ft("upload_failed",`file path is not allowed: ${t}`)}resolveDuration(t,o){if(t.duration!=null&&t.duration>0)return t.duration;let i=t.kind==="audio"?ZNe(o):t.kind==="video"?XNe(o):void 0;if(i!=null)return i;throw new Ft("upload_failed",`duration could not be determined for ${t.kind}; pass it explicitly`)}uploadImage(t){var o,i;return h(this,void 0,void 0,function*(){try{let e=yield this.client.im.v1.image.create({data:{image_type:"message",image:t}}),a=(o=e?.image_key)!==null&&o!==void 0?o:(i=e?.data)===null||i===void 0?void 0:i.image_key;if(!a)throw new Error("image_key missing in upload response");return{kind:"image",fileKey:a}}catch(e){throw new Ft("upload_failed","image upload failed",{cause:e})}})}uploadFile(t,o,i,e){var a,A;return h(this,void 0,void 0,function*(){try{let r={file_type:o,file_name:i,file:t};e!=null&&(r.duration=e);let s=yield this.client.im.v1.file.create({data:r}),g=(a=s?.file_key)!==null&&a!==void 0?a:(A=s?.data)===null||A===void 0?void 0:A.file_key;if(!g)throw new Error("file_key missing in upload response");return{kind:o==="opus"?"audio":o==="mp4"?"video":"file",fileKey:g,durationMs:e}}catch(r){throw r instanceof Ft?r:new Ft("upload_failed","file upload failed",{cause:r})}})}};function c0e(n,t){let o=n.startsWith("https:")?aNe.Agent:rNe.Agent,i=new o,e=t.includes(":")?6:4,a=(r,s,g)=>{g(null,t,e)},A=i.createConnection.bind(i);return i.createConnection=(r,s)=>A(Object.assign(Object.assign({},r),{lookup:a}),s),i}function YW(n){var t;if(!n?.length)return"";let o=[];for(let i of n){if(!i.openId)continue;let e=(t=i.name)!==null&&t!==void 0?t:"";o.push(`${e}`)}return o.length>0?o.join(" ")+" ":""}function I0e(n,t=1){try{return l0e(n,t)}catch{return n}}function l0e(n,t){let o="___CB_",i=[],e=n.replace(/(^|\n)(`{3,})([^\n]*)\n[\s\S]*?\n\2(?=\n|$)/g,(A,r="")=>{let s=A.slice(String(r).length);return`${r}${o}${i.push(s)-1}___`});return/^#{1,3} /m.test(n)&&(e=e.replace(/^#{2,6} (.+)$/gm,"##### $1"),e=e.replace(/^# (.+)$/gm,"#### $1")),t>=2?(e=e.replace(/^(#{4,5} .+)\n{1,2}(#{4,5} )/gm,`$1 +`);yield this.sender.updateCardElementContent(this.cardId,Gm,o,++this.sequence);try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,CR(o))}catch{}let e=uW(i||"..."),a=yield this.sender.createCardInstance(e),A=yield this.sender.sendCardByReference(this.to,this.idType,a,this.opts);this.cardId=a,this.content=i,this.sequence=0,this.rolloverMessageIds.push(A)})}completeTerminal(){var t,o;return h(this,void 0,void 0,function*(){if(yield this.throttle.flushNow(),yield this.queue.drain(),!!this.cardId){!this.content&&!this.streamingFailed&&(yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.sender.updateCardElementContent(this.cardId,Gm,CW,++this.sequence)}catch{}})),yield this.queue.drain());try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,CR(this.content||CW))}catch(i){(o=(t=this.sender.logger).warn)===null||o===void 0||o.call(t,"[stream] finishStreamingCard failed",i)}}})}failTerminal(t){return h(this,void 0,void 0,function*(){if(this.throttle.dispose(),!!this.cardId){this.content=(this.content||"")+JNe,yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.pushSnapshot()}catch{}})),yield this.queue.drain();try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,CR(this.content))}catch{}}})}},vv=class{constructor(t,o,i,e){this.impl=new kv(t,o,i,e)}run(t){return this.impl.run(t)}},zNe=100,VNe=50,Pv=class{constructor(t,o,i,e,a){var A,r;this.sender=t,this.to=o,this.idType=i,this.opts=e,this._messageId="",this.queue=new Wm,this._current=a;let s=t.config;this.throttle=new Vm({ms:(A=s.streamThrottleMs)!==null&&A!==void 0?A:zNe,chars:(r=s.streamThrottleChars)!==null&&r!==void 0?r:VNe},()=>this.patch())}get messageId(){return this._messageId}get current(){return this._current}update(t){return h(this,void 0,void 0,function*(){let o=typeof t=="function"?t(this._current):t;this._current=o,this.throttle.note(JSON.stringify(o).length)})}run(t){return h(this,void 0,void 0,function*(){yield this.sendInitial();try{yield t(this)}catch(o){throw yield this.failTerminal(o),o}return yield this.completeTerminal(),{messageId:this._messageId}})}sendInitial(){return h(this,void 0,void 0,function*(){let t=yield this.sender.sendOneWithFallback({to:this.to,idType:this.idType,msgType:"interactive",content:this._current,replyTo:this.opts.replyTo,replyInThread:this.opts.replyInThread});this._messageId=t})}patch(){return h(this,void 0,void 0,function*(){if(!this._messageId)return;let t=this._current;yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){yield this.sender.patchCard(this._messageId,t)}))})}completeTerminal(){return h(this,void 0,void 0,function*(){yield this.throttle.flushNow(),yield this.queue.drain()})}failTerminal(t){return h(this,void 0,void 0,function*(){this.throttle.dispose();let o=WNe(this._current);yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.sender.patchCard(this._messageId,o)}catch{}})),yield this.queue.drain()})}};function WNe(n){let t=n,o=Array.isArray(t?.elements)?[...t.elements]:[];return o.push({tag:"note",elements:[{tag:"plain_text",content:"\u26A0\uFE0F \u751F\u6210\u4E2D\u65AD"}]}),Object.assign(Object.assign({},n),{elements:o})}var Gv=class{constructor(t,o,i,e,a){this.impl=new Pv(t,o,i,e,a)}run(t){return this.impl.run(t)}};function ZNe(n){if(!(!n||n.length<27)){for(let t=n.length-27;t>=0;t--)if(n[t]===79&&n[t+1]===103&&n[t+2]===103&&n[t+3]===83){let o=n.readBigInt64LE(t+6);if(on.length)return;let e=n.readUInt8(i),a=i+4,A,r;if(e===1){if(a+28>n.length)return;A=n.readUInt32BE(a+16),r=Number(n.readBigUInt64BE(a+20))}else{if(a+16>n.length)return;A=n.readUInt32BE(a+8),r=n.readUInt32BE(a+12)}if(!(!A||!Number.isFinite(A)||!Number.isFinite(r)))return Math.round(r/A*1e3)}function BW(n,t,o,i){let e=t;for(;e+8<=o&&e+8<=n.length;){let a=n.readUInt32BE(e),A=n.slice(e+4,e+8).toString("ascii"),r=a===1?e+Number(n.readBigUInt64BE(e+8)):a===0?o:e+a;if(r<=e||r>o)return;if(A===i)return{start:a===1?e+16:e+8,end:r};e=r}}var $Ne=[[0,8],[167772160,8],[2130706432,8],[2851995648,16],[2886729728,12],[3232235520,16],[1681915904,10],[3221225472,24],[3221225984,24],[3323068416,15],[3325256704,24],[3405803776,24],[3758096384,4],[4026531840,4]];function e0e(n,t={}){var o,i;return h(this,void 0,void 0,function*(){let e=new URL(n);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`ssrf_blocked: protocol ${e.protocol}`);let a=e.hostname,A=a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a,r=(i=(o=t.allowlist)===null||o===void 0?void 0:o.includes(A))!==null&&i!==void 0?i:!1,s;if(TW(A))s=A,r||fW(s);else{let g=yield iNe.lookup(A,{all:!0});if(g.length===0)throw new Error(`ssrf_blocked: no DNS records for ${A}`);if(!r)for(let c of g)fW(c.address);s=g[0].address}return{resolvedIp:s,originalHost:A}})}function fW(n){let t=TW(n);if(t===4&&xW(n))throw new Error(`ssrf_blocked: ${n}`);if(t===6&&n0e(n))throw new Error(`ssrf_blocked: ${n}`);if(t===0)throw new Error(`ssrf_blocked: not a valid IP: ${n}`)}function xW(n){let t=n.split(".").map(Number);if(t.length!==4||t.some(i=>i<0||i>255))return!0;let o=(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0;return $Ne.some(([i,e])=>{let a=e===0?0:-1<<32-e>>>0;return(o&a)===(i&a)})}var A0e=[[BigInt("0xfe800000000000000000000000000000"),10],[BigInt("0xfc000000000000000000000000000000"),7],[BigInt("0xff000000000000000000000000000000"),8],[BigInt("0x01000000000000000000000000000000"),64],[BigInt("0x20010db8000000000000000000000000"),32],[BigInt("0x20010000000000000000000000000000"),32]],t0e=BigInt("0xffffffffffffffffffffffff00000000"),r0e=BigInt("0x00000000000000000000ffff00000000"),a0e=BigInt(0),i0e=BigInt("0x0064ff9b000000000000000000000000"),o0e=BigInt("0xffffffff");function n0e(n){let t;try{t=s0e(n)}catch{return!0}let o=t&t0e;if(o===r0e||o===i0e||o===a0e){let i=Number(t&o0e),e=[i>>>24&255,i>>>16&255,i>>>8&255,i&255].join(".");return xW(e)}return A0e.some(([i,e])=>{let a=BigInt(128-e),r=(BigInt(1)<>a<!Number.isFinite(g)||g<0||g>255))throw new Error("bad v4 suffix");let r=(A[0]<<8|A[1]).toString(16),s=(A[2]<<8|A[3]).toString(16);t=t.slice(0,t.length-o[1].length)+`${r}:${s}`}let i=t.split("::");if(i.length>2)throw new Error('multiple "::"');let e;if(i.length===2){let A=i[0]?i[0].split(":"):[],r=i[1]?i[1].split(":"):[],s=8-A.length-r.length;if(s<0)throw new Error("too many groups");e=[...A,...Array(s).fill("0"),...r]}else e=t.split(":");if(e.length!==8)throw new Error("wrong group count");let a=BigInt(0);for(let A of e){if(!/^[0-9a-f]{0,4}$/.test(A))throw new Error("bad group");a=a<0&&!(yield Promise.all(r.map(d=>h(this,void 0,void 0,function*(){let B=hu.resolve(d);try{return yield tt.promises.realpath(B)}catch{return B}})))).some(d=>g===d||g.startsWith(d+hu.sep)))throw new Lt("upload_failed",`file path is outside allowed directories: ${g}`);return yield tt.promises.readFile(g)}catch(g){throw g instanceof Lt?g:new Lt("upload_failed",`source is neither an http(s) URL nor a readable local file: ${t}`,{cause:g})}}let e=(i=this.config)===null||i===void 0?void 0:i.ssrfGuard,a=e!==!1,A;if(a){let r=typeof e=="object"&&e?{allowlist:e.allowlist}:{};try{({resolvedIp:A}=yield e0e(t,r))}catch(s){throw new Lt("ssrf_blocked",`URL blocked: ${String(s)}`,{cause:s})}}try{let r={url:t,method:"GET",responseType:"arraybuffer",timeout:15e3,maxContentLength:QW,maxBodyLength:QW};if(A){let g=c0e(t,A);r.httpAgent=g,r.httpsAgent=g}let s=yield this.client.httpInstance.request(r);return Buffer.from(s)}catch(r){throw new Lt("upload_failed","fetch source URL failed",{cause:r})}})}assertNotOnPosixBlocklist(t){if(process.platform!=="win32"&&g0e.some(o=>t===o.slice(0,-1)||t.startsWith(o)))throw new Lt("upload_failed",`file path is not allowed: ${t}`)}resolveDuration(t,o){if(t.duration!=null&&t.duration>0)return t.duration;let i=t.kind==="audio"?ZNe(o):t.kind==="video"?XNe(o):void 0;if(i!=null)return i;throw new Lt("upload_failed",`duration could not be determined for ${t.kind}; pass it explicitly`)}uploadImage(t){var o,i;return h(this,void 0,void 0,function*(){try{let e=yield this.client.im.v1.image.create({data:{image_type:"message",image:t}}),a=(o=e?.image_key)!==null&&o!==void 0?o:(i=e?.data)===null||i===void 0?void 0:i.image_key;if(!a)throw new Error("image_key missing in upload response");return{kind:"image",fileKey:a}}catch(e){throw new Lt("upload_failed","image upload failed",{cause:e})}})}uploadFile(t,o,i,e){var a,A;return h(this,void 0,void 0,function*(){try{let r={file_type:o,file_name:i,file:t};e!=null&&(r.duration=e);let s=yield this.client.im.v1.file.create({data:r}),g=(a=s?.file_key)!==null&&a!==void 0?a:(A=s?.data)===null||A===void 0?void 0:A.file_key;if(!g)throw new Error("file_key missing in upload response");return{kind:o==="opus"?"audio":o==="mp4"?"video":"file",fileKey:g,durationMs:e}}catch(r){throw r instanceof Lt?r:new Lt("upload_failed","file upload failed",{cause:r})}})}};function c0e(n,t){let o=n.startsWith("https:")?aNe.Agent:rNe.Agent,i=new o,e=t.includes(":")?6:4,a=(r,s,g)=>{g(null,t,e)},A=i.createConnection.bind(i);return i.createConnection=(r,s)=>A(Object.assign(Object.assign({},r),{lookup:a}),s),i}function YW(n){var t;if(!n?.length)return"";let o=[];for(let i of n){if(!i.openId)continue;let e=(t=i.name)!==null&&t!==void 0?t:"";o.push(`${e}`)}return o.length>0?o.join(" ")+" ":""}function I0e(n,t=1){try{return l0e(n,t)}catch{return n}}function l0e(n,t){let o="___CB_",i=[],e=n.replace(/(^|\n)(`{3,})([^\n]*)\n[\s\S]*?\n\2(?=\n|$)/g,(A,r="")=>{let s=A.slice(String(r).length);return`${r}${o}${i.push(s)-1}___`});return/^#{1,3} /m.test(n)&&(e=e.replace(/^#{2,6} (.+)$/gm,"##### $1"),e=e.replace(/^# (.+)$/gm,"#### $1")),t>=2?(e=e.replace(/^(#{4,5} .+)\n{1,2}(#{4,5} )/gm,`$1
$2`),e=e.replace(/^([^|\n].*)\n(\|.+\|)/gm,`$1 @@ -289,7 +289,7 @@ ${A} `)})):i.forEach((A,r)=>{e=e.replace(`${o}${r}___`,A)}),e=e.replace(/\n{3,}/g,` `),e}function p0e(n,t){var o,i;let e=YW((o=t?.mentions)!==null&&o!==void 0?o:[]),a=I0e(e+n,1);return{zh_cn:{title:(i=t?.title)!==null&&i!==void 0?i:"",content:[[{tag:"md",text:a}]]}}}function d0e(n){var t;let o=n?.zh_cn;if(!o?.content)return"";let i=[];for(let e of o.content){if(!Array.isArray(e))continue;let a=[];for(let A of e)switch(A.tag){case"md":case"text":case"a":a.push((t=A.text)!==null&&t!==void 0?t:"");break;case"at":a.push(A.user_name?`@${A.user_name}`:"");break;case"img":a.push(A.image_key?"[image]":"");break}i.push(a.join(""))}return i.join(` -`).trim()}function yW(n){if(!n)throw new Error("empty receive_id");return n.startsWith("oc_")?"chat_id":n.startsWith("ou_")?"open_id":n.startsWith("on_")?"union_id":n.includes("@")?"email":"user_id"}function AP(n,t){if(n instanceof Ft)return n;let o=h0e(n),i=E0e(n);return new Ft(o,i,{cause:n,context:t})}function h0e(n){var t,o,i,e,a,A,r,s;let g=n,c=(o=(t=g?.response)===null||t===void 0?void 0:t.status)!==null&&o!==void 0?o:g?.status,I=(r=(a=(e=(i=g?.response)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.code)!==null&&a!==void 0?a:(A=g?.data)===null||A===void 0?void 0:A.code)!==null&&r!==void 0?r:g?.code,d=String((s=g?.message)!==null&&s!==void 0?s:"").toLowerCase();if(typeof I=="number"){if(I===230020||I===230017)return"target_revoked";if(I===99991400||I===99991401)return"permission_denied";if(I===230002||I===230001)return"format_error"}return c===429?"rate_limited":c===401||c===403?"permission_denied":c===400?"format_error":c===404?"target_revoked":d.startsWith("ssrf_blocked")?"ssrf_blocked":d.includes("timeout")||g?.code==="ETIMEDOUT"||g?.code==="ECONNABORTED"?"send_timeout":"unknown"}function E0e(n){var t,o,i,e;let a=n;return((o=(t=a?.response)===null||t===void 0?void 0:t.data)===null||o===void 0?void 0:o.msg)||((e=(i=a?.response)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.message)||a?.message||String(n)}function C0e(n){return n.code==="rate_limited"||n.code==="unknown"}function u0e(n){return n.code==="format_error"}function B0e(n){return n.code==="target_revoked"}function f0e(n,t={}){var o,i;return h(this,void 0,void 0,function*(){let e=(o=t.maxAttempts)!==null&&o!==void 0?o:3,a=(i=t.baseDelayMs)!==null&&i!==void 0?i:500,A;for(let r=1;r<=e;r++)try{return yield n(r)}catch(s){let g=AP(s,{attempt:r});if(A=g,r>=e||!C0e(g))throw g;let c=a*Math.pow(3,r-1);yield Q0e(c)}throw A})}function Q0e(n){return new Promise(t=>setTimeout(t,n))}var y0e=3500,Lv=class{constructor(t,o,i){var e;this.client=t,this.config=o,this.logger=i,this.uploader=new Fv(t,o),this.chunkLimit=(e=o.textChunkLimit)!==null&&e!==void 0?e:y0e}send(t,o,i={}){return h(this,void 0,void 0,function*(){let e=yW(t);if("markdown"in o)return this.sendMarkdown(t,e,o.markdown,i);if("text"in o)return this.sendText(t,e,o.text,i);if("post"in o)return this.sendPost(t,e,o.post,i);if("image"in o)return this.sendImage(t,e,o.image,i);if("file"in o)return this.sendFile(t,e,o.file,i);if("audio"in o)return this.sendAudio(t,e,o.audio,i);if("video"in o)return this.sendVideo(t,e,o.video,i);if("card"in o)return this.sendCard(t,e,o.card,i);if("shareChat"in o)return this.sendShareChat(t,e,o.shareChat.chatId,i);if("shareUser"in o)return this.sendShareUser(t,e,o.shareUser.userId,i);if("sticker"in o)return this.sendSticker(t,e,o.sticker.fileKey,i);throw new Ft("format_error","unrecognized SendInput shape")})}stream(t,o,i={}){return h(this,void 0,void 0,function*(){let e=yW(t);if("markdown"in o)return new vv(this,t,e,i).run(o.markdown);if("card"in o)return new Gv(this,t,e,i,o.card.initial).run(o.card.producer);throw new Ft("format_error","unrecognized StreamInput shape")})}sendMarkdown(t,o,i,e){return h(this,void 0,void 0,function*(){let a=KW(i,this.chunkLimit),A=[];for(let r=0;rthis.rawSend(t),this.config.retry)})}rawSend(t){var o,i;return h(this,void 0,void 0,function*(){let e={receive_id:t.to,msg_type:t.msgType,content:JSON.stringify(t.content)};if(t.replyTo){let s=(o=(yield this.client.im.v1.message.reply({path:{message_id:t.replyTo},data:{content:e.content,msg_type:t.msgType,reply_in_thread:t.replyInThread}})).data)===null||o===void 0?void 0:o.message_id;if(!s)throw new Ft("unknown","message_id missing from reply response");return s}let A=(i=(yield this.client.im.v1.message.create({params:{receive_id_type:t.idType},data:e})).data)===null||i===void 0?void 0:i.message_id;if(!A)throw new Ft("unknown","message_id missing from create response");return A})}patchCard(t,o){return h(this,void 0,void 0,function*(){yield this.client.im.v1.message.patch({path:{message_id:t},data:{content:JSON.stringify(o)}})})}createCardInstance(t){var o;return h(this,void 0,void 0,function*(){let e=(o=(yield this.client.cardkit.v1.card.create({data:{type:"card_json",data:JSON.stringify(t)}})).data)===null||o===void 0?void 0:o.card_id;if(!e)throw new Ft("unknown","cardkit.card.create returned no card_id");return e})}sendCardByReference(t,o,i,e){return h(this,void 0,void 0,function*(){return this.rawSendWithRetry({to:t,idType:o,msgType:"interactive",content:{type:"card",data:{card_id:i}},replyTo:e.replyTo,replyInThread:e.replyInThread})})}updateCardElementContent(t,o,i,e){return h(this,void 0,void 0,function*(){yield this.client.cardkit.v1.cardElement.content({path:{card_id:t,element_id:o},data:{content:i,sequence:e,uuid:`c_${t}_${e}`}})})}finishStreamingCard(t,o,i){return h(this,void 0,void 0,function*(){let e={streaming_mode:!1};i!==void 0&&(e.summary={content:i}),yield this.client.cardkit.v1.card.settings({path:{card_id:t},data:{settings:JSON.stringify({config:e}),sequence:o,uuid:`s_${t}_${o}`}})})}makeResult(t){return{messageId:t[0],chunkIds:t.length>1?t:void 0}}};function m0e(n,t){if(n.length<=t)return[n];let o=[];for(let i=0;i=this.config.maxMessages||this.bufferChars>=this.config.maxChars){this.clearTimer(),this.enqueueFlush();return}if(this.config.delayMs<=0||this.serialOnly){this.clearTimer(),this.enqueueFlush();return}this.clearTimer();let e=this.bufferChars>=this.config.longThresholdChars?this.config.longDelayMs:this.config.delayMs;this.timer=setTimeout(()=>{this.timer=void 0,this.enqueueFlush()},e)}run(t){this.buffer.length>0&&(this.clearTimer(),this.enqueueFlush());let o=this.tail.then(t,t);return this.tail=o.then(()=>{},()=>{}),o}flushNow(){return h(this,void 0,void 0,function*(){this.buffer.length>0&&(this.clearTimer(),this.enqueueFlush()),yield this.tail})}isIdle(){return this.buffer.length===0&&!this.timer}dispose(){this.clearTimer(),this.buffer=[],this.pendingHandler=void 0}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}enqueueFlush(){if(this.buffer.length===0)return;let t=this.buffer,o=this.pendingHandler;if(this.buffer=[],this.bufferChars=0,this.pendingHandler=void 0,!o)return;let i={message:S0e(t),sourceIds:t.map(A=>A.messageId)},e=()=>o(i),a=this.tail.then(e,e);this.tail=a.then(()=>{},()=>{})}},Hv=class{constructor(t){this.config=t,this.pipelines=new Map}push(t,o,i){this.getOrCreate(t,!1).push(o,i)}run(t,o){return this.getOrCreate(t,!0).run(o)}getOrCreate(t,o){let i=this.pipelines.get(t);return i||(i=new Uv(this.config,o),this.pipelines.set(t,i)),i}flushAll(){return h(this,void 0,void 0,function*(){yield Promise.all([...this.pipelines.values()].map(t=>t.flushNow()))})}dispose(){return h(this,void 0,void 0,function*(){yield this.flushAll();for(let t of this.pipelines.values())t.dispose();this.pipelines.clear()})}};function S0e(n){if(n.length===1)return n[0];let t=n[n.length-1],o=n.map(a=>a.content).filter(a=>a&&a.length>0).join(` +`).trim()}function yW(n){if(!n)throw new Error("empty receive_id");return n.startsWith("oc_")?"chat_id":n.startsWith("ou_")?"open_id":n.startsWith("on_")?"union_id":n.includes("@")?"email":"user_id"}function AP(n,t){if(n instanceof Lt)return n;let o=h0e(n),i=E0e(n);return new Lt(o,i,{cause:n,context:t})}function h0e(n){var t,o,i,e,a,A,r,s;let g=n,c=(o=(t=g?.response)===null||t===void 0?void 0:t.status)!==null&&o!==void 0?o:g?.status,I=(r=(a=(e=(i=g?.response)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.code)!==null&&a!==void 0?a:(A=g?.data)===null||A===void 0?void 0:A.code)!==null&&r!==void 0?r:g?.code,d=String((s=g?.message)!==null&&s!==void 0?s:"").toLowerCase();if(typeof I=="number"){if(I===230020||I===230017)return"target_revoked";if(I===99991400||I===99991401)return"permission_denied";if(I===230002||I===230001)return"format_error"}return c===429?"rate_limited":c===401||c===403?"permission_denied":c===400?"format_error":c===404?"target_revoked":d.startsWith("ssrf_blocked")?"ssrf_blocked":d.includes("timeout")||g?.code==="ETIMEDOUT"||g?.code==="ECONNABORTED"?"send_timeout":"unknown"}function E0e(n){var t,o,i,e;let a=n;return((o=(t=a?.response)===null||t===void 0?void 0:t.data)===null||o===void 0?void 0:o.msg)||((e=(i=a?.response)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.message)||a?.message||String(n)}function C0e(n){return n.code==="rate_limited"||n.code==="unknown"}function u0e(n){return n.code==="format_error"}function B0e(n){return n.code==="target_revoked"}function f0e(n,t={}){var o,i;return h(this,void 0,void 0,function*(){let e=(o=t.maxAttempts)!==null&&o!==void 0?o:3,a=(i=t.baseDelayMs)!==null&&i!==void 0?i:500,A;for(let r=1;r<=e;r++)try{return yield n(r)}catch(s){let g=AP(s,{attempt:r});if(A=g,r>=e||!C0e(g))throw g;let c=a*Math.pow(3,r-1);yield Q0e(c)}throw A})}function Q0e(n){return new Promise(t=>setTimeout(t,n))}var y0e=3500,Lv=class{constructor(t,o,i){var e;this.client=t,this.config=o,this.logger=i,this.uploader=new Fv(t,o),this.chunkLimit=(e=o.textChunkLimit)!==null&&e!==void 0?e:y0e}send(t,o,i={}){return h(this,void 0,void 0,function*(){let e=yW(t);if("markdown"in o)return this.sendMarkdown(t,e,o.markdown,i);if("text"in o)return this.sendText(t,e,o.text,i);if("post"in o)return this.sendPost(t,e,o.post,i);if("image"in o)return this.sendImage(t,e,o.image,i);if("file"in o)return this.sendFile(t,e,o.file,i);if("audio"in o)return this.sendAudio(t,e,o.audio,i);if("video"in o)return this.sendVideo(t,e,o.video,i);if("card"in o)return this.sendCard(t,e,o.card,i);if("shareChat"in o)return this.sendShareChat(t,e,o.shareChat.chatId,i);if("shareUser"in o)return this.sendShareUser(t,e,o.shareUser.userId,i);if("sticker"in o)return this.sendSticker(t,e,o.sticker.fileKey,i);throw new Lt("format_error","unrecognized SendInput shape")})}stream(t,o,i={}){return h(this,void 0,void 0,function*(){let e=yW(t);if("markdown"in o)return new vv(this,t,e,i).run(o.markdown);if("card"in o)return new Gv(this,t,e,i,o.card.initial).run(o.card.producer);throw new Lt("format_error","unrecognized StreamInput shape")})}sendMarkdown(t,o,i,e){return h(this,void 0,void 0,function*(){let a=KW(i,this.chunkLimit),A=[];for(let r=0;rthis.rawSend(t),this.config.retry)})}rawSend(t){var o,i;return h(this,void 0,void 0,function*(){let e={receive_id:t.to,msg_type:t.msgType,content:JSON.stringify(t.content)};if(t.replyTo){let s=(o=(yield this.client.im.v1.message.reply({path:{message_id:t.replyTo},data:{content:e.content,msg_type:t.msgType,reply_in_thread:t.replyInThread}})).data)===null||o===void 0?void 0:o.message_id;if(!s)throw new Lt("unknown","message_id missing from reply response");return s}let A=(i=(yield this.client.im.v1.message.create({params:{receive_id_type:t.idType},data:e})).data)===null||i===void 0?void 0:i.message_id;if(!A)throw new Lt("unknown","message_id missing from create response");return A})}patchCard(t,o){return h(this,void 0,void 0,function*(){yield this.client.im.v1.message.patch({path:{message_id:t},data:{content:JSON.stringify(o)}})})}createCardInstance(t){var o;return h(this,void 0,void 0,function*(){let e=(o=(yield this.client.cardkit.v1.card.create({data:{type:"card_json",data:JSON.stringify(t)}})).data)===null||o===void 0?void 0:o.card_id;if(!e)throw new Lt("unknown","cardkit.card.create returned no card_id");return e})}sendCardByReference(t,o,i,e){return h(this,void 0,void 0,function*(){return this.rawSendWithRetry({to:t,idType:o,msgType:"interactive",content:{type:"card",data:{card_id:i}},replyTo:e.replyTo,replyInThread:e.replyInThread})})}updateCardElementContent(t,o,i,e){return h(this,void 0,void 0,function*(){yield this.client.cardkit.v1.cardElement.content({path:{card_id:t,element_id:o},data:{content:i,sequence:e,uuid:`c_${t}_${e}`}})})}finishStreamingCard(t,o,i){return h(this,void 0,void 0,function*(){let e={streaming_mode:!1};i!==void 0&&(e.summary={content:i}),yield this.client.cardkit.v1.card.settings({path:{card_id:t},data:{settings:JSON.stringify({config:e}),sequence:o,uuid:`s_${t}_${o}`}})})}makeResult(t){return{messageId:t[0],chunkIds:t.length>1?t:void 0}}};function m0e(n,t){if(n.length<=t)return[n];let o=[];for(let i=0;i=this.config.maxMessages||this.bufferChars>=this.config.maxChars){this.clearTimer(),this.enqueueFlush();return}if(this.config.delayMs<=0||this.serialOnly){this.clearTimer(),this.enqueueFlush();return}this.clearTimer();let e=this.bufferChars>=this.config.longThresholdChars?this.config.longDelayMs:this.config.delayMs;this.timer=setTimeout(()=>{this.timer=void 0,this.enqueueFlush()},e)}run(t){this.buffer.length>0&&(this.clearTimer(),this.enqueueFlush());let o=this.tail.then(t,t);return this.tail=o.then(()=>{},()=>{}),o}flushNow(){return h(this,void 0,void 0,function*(){this.buffer.length>0&&(this.clearTimer(),this.enqueueFlush()),yield this.tail})}isIdle(){return this.buffer.length===0&&!this.timer}dispose(){this.clearTimer(),this.buffer=[],this.pendingHandler=void 0}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}enqueueFlush(){if(this.buffer.length===0)return;let t=this.buffer,o=this.pendingHandler;if(this.buffer=[],this.bufferChars=0,this.pendingHandler=void 0,!o)return;let i={message:S0e(t),sourceIds:t.map(A=>A.messageId)},e=()=>o(i),a=this.tail.then(e,e);this.tail=a.then(()=>{},()=>{})}},Hv=class{constructor(t){this.config=t,this.pipelines=new Map}push(t,o,i){this.getOrCreate(t,!1).push(o,i)}run(t,o){return this.getOrCreate(t,!0).run(o)}getOrCreate(t,o){let i=this.pipelines.get(t);return i||(i=new Uv(this.config,o),this.pipelines.set(t,i)),i}flushAll(){return h(this,void 0,void 0,function*(){yield Promise.all([...this.pipelines.values()].map(t=>t.flushNow()))})}dispose(){return h(this,void 0,void 0,function*(){yield this.flushAll();for(let t of this.pipelines.values())t.dispose();this.pipelines.clear()})}};function S0e(n){if(n.length===1)return n[0];let t=n[n.length-1],o=n.map(a=>a.content).filter(a=>a&&a.length>0).join(` `),i=mW(n.flatMap(a=>a.resources),a=>a.fileKey),e=mW(n.flatMap(a=>a.mentions),a=>{var A;return(A=a.openId)!==null&&A!==void 0?A:a.key});return Object.assign(Object.assign({},t),{content:o,resources:i,mentions:e,mentionAll:n.some(a=>a.mentionAll),mentionedBot:n.some(a=>a.mentionedBot)})}function mW(n,t){let o=new Set,i=[];for(let e of n){let a=t(e);if(a==null){i.push(e);continue}o.has(a)||(o.add(a),i.push(e))}return i}var pu={delayMs:600,longThresholdChars:1e3,longDelayMs:2e3,maxMessages:8,maxChars:4e3},Pm={ttl:12*36e5,maxEntries:5e3,sweepIntervalMs:5*6e4,namespace:"channel:seen"},jW=30*6e4,w0e=5*6e4;function D0e(n){var t,o,i,e,a,A,r;let s=(o=(t=n?.batch)===null||t===void 0?void 0:t.text)!==null&&o!==void 0?o:{};return{delayMs:(i=s.delayMs)!==null&&i!==void 0?i:pu.delayMs,longThresholdChars:(e=s.longThresholdChars)!==null&&e!==void 0?e:pu.longThresholdChars,longDelayMs:(a=s.longDelayMs)!==null&&a!==void 0?a:pu.longDelayMs,maxMessages:(A=s.maxMessages)!==null&&A!==void 0?A:pu.maxMessages,maxChars:(r=s.maxChars)!==null&&r!==void 0?r:pu.maxChars}}var Kv=class{constructor(t,o={}){var i,e,a,A,r,s;this.cache=t,this.memory=new Map,this.ttlMs=(i=o.ttlMs)!==null&&i!==void 0?i:Pm.ttl,this.maxMem=(e=o.maxMemEntries)!==null&&e!==void 0?e:Pm.maxEntries,this.ns=(a=o.namespace)!==null&&a!==void 0?a:Pm.namespace;let g=(A=o.sweepMs)!==null&&A!==void 0?A:Pm.sweepIntervalMs;this.sweeper=setInterval(()=>this.sweep(),g),(s=(r=this.sweeper).unref)===null||s===void 0||s.call(r)}has(t){return h(this,void 0,void 0,function*(){let o=Date.now(),i=this.memory.get(t);return i&&i>o?(this.memory.delete(t),this.memory.set(t,i),!0):(yield this.cache.get(t,{namespace:this.ns}))?(this.memory.set(t,o+this.ttlMs),this.evictIfNeeded(),!0):!1})}add(t){return h(this,void 0,void 0,function*(){let o=Date.now()+this.ttlMs;this.memory.set(t,o),this.evictIfNeeded();try{yield this.cache.set(t,"1",o,{namespace:this.ns})}catch{}})}evictIfNeeded(){for(;this.memory.size>this.maxMem;){let t=this.memory.keys().next().value;if(t===void 0)break;this.memory.delete(t)}}sweep(){let t=Date.now();for(let[o,i]of this.memory)i<=t&&this.memory.delete(o)}dispose(){clearInterval(this.sweeper),this.memory.clear()}},xv=class{constructor(t,o){this.cfg=Object.assign({},t??{}),this.bot=o}evaluate(t){return t.chatType==="group"?this.evaluateGroup(t):this.evaluateDm(t)}evaluateGroup(t){var o,i;let e=this.cfg.groupAllowlist;return e&&e.length>0&&!e.includes(t.chatId)?{allowed:!1,reason:"group_not_allowed"}:((o=this.cfg.requireMention)!==null&&o!==void 0?o:!0)&&!t.mentionedBot?{allowed:!1,reason:"no_mention"}:t.mentionAll&&!((i=this.cfg.respondToMentionAll)!==null&&i!==void 0&&i)?{allowed:!1,reason:"mention_all_blocked"}:{allowed:!0}}evaluateDm(t){var o,i;let e=(o=this.cfg.dmMode)!==null&&o!==void 0?o:"open";return e==="disabled"?{allowed:!1,reason:"dm_disabled"}:e==="allowlist"&&!((i=this.cfg.dmAllowlist)!==null&&i!==void 0?i:[]).includes(t.senderId)?{allowed:!1,reason:"sender_not_allowed"}:{allowed:!0}}updateConfig(t){this.cfg=Object.assign(Object.assign({},this.cfg),t)}getConfig(){return this.cfg}setBotIdentity(t){this.bot=t}getBotIdentity(){return this.bot}},Yv=class{constructor(t=w0e,o=6e4){var i,e;this.ttlMs=t,this.locks=new Map,this.sweeper=setInterval(()=>this.sweep(),o),(e=(i=this.sweeper).unref)===null||e===void 0||e.call(i)}acquire(t){let o=Date.now(),i=this.locks.get(t);return i&&i>o?!1:(this.locks.set(t,o+this.ttlMs),!0)}release(t){this.locks.delete(t)}sweep(){let t=Date.now();for(let[o,i]of this.locks)i<=t&&this.locks.delete(o)}dispose(){clearInterval(this.sweeper),this.locks.clear()}};function O0e(n,t=jW){return!n||!Number.isFinite(n)?!1:Date.now()-n>t}var jv=class{constructor(t){var o,i,e,a,A,r,s,g,c,I,d;this.logger=t.logger,this.onReject=t.onReject,this.onMessage=t.onMessage,this.staleWindow=(i=(o=t.config)===null||o===void 0?void 0:o.staleMessageWindowMs)!==null&&i!==void 0?i:jW,this.queueEnabled=(A=(a=(e=t.config)===null||e===void 0?void 0:e.chatQueue)===null||a===void 0?void 0:a.enabled)!==null&&A!==void 0?A:!0,this.seenCache=new Kv(t.cache,{ttlMs:(s=(r=t.config)===null||r===void 0?void 0:r.dedup)===null||s===void 0?void 0:s.ttl,maxMemEntries:(c=(g=t.config)===null||g===void 0?void 0:g.dedup)===null||c===void 0?void 0:c.maxEntries,sweepMs:(d=(I=t.config)===null||I===void 0?void 0:I.dedup)===null||d===void 0?void 0:d.sweepIntervalMs}),this.lock=new Yv,this.policy=new xv(t.policy,t.botIdentity),this.manager=new Hv(D0e(t.config))}pushMessage(t){var o,i,e,a,A,r,s;return h(this,void 0,void 0,function*(){if(O0e(t.createTime,this.staleWindow)){(i=(o=this.logger).debug)===null||i===void 0||i.call(o,`safety: drop stale message ${t.messageId}`);return}if(yield this.seenCache.has(t.messageId)){(a=(e=this.logger).debug)===null||a===void 0||a.call(e,`safety: drop duplicate message ${t.messageId}`);return}let g=this.policy.evaluate(t);if(!g.allowed){this.onReject({messageId:t.messageId,chatId:t.chatId,senderId:t.senderId,reason:(A=g.reason)!==null&&A!==void 0?A:"group_not_allowed"});return}if(!this.lock.acquire(t.messageId)){(s=(r=this.logger).debug)===null||s===void 0||s.call(r,`safety: drop in-flight message ${t.messageId}`);return}let c=I=>h(this,void 0,void 0,function*(){var d,B;try{yield this.onMessage(I.message)}catch(f){(B=(d=this.logger).error)===null||B===void 0||B.call(d,"safety: message handler threw",f)}finally{for(let f of I.sourceIds){try{yield this.seenCache.add(f)}catch{}this.lock.release(f)}}});this.queueEnabled?this.manager.push(t.chatId,t,c):c({message:t,sourceIds:[t.messageId]})})}pushAction(t,o,i){var e,a,A,r;return h(this,void 0,void 0,function*(){if(yield this.seenCache.has(t)){(a=(e=this.logger).debug)===null||a===void 0||a.call(e,`safety: drop duplicate action ${t}`);return}if(!this.lock.acquire(t)){(r=(A=this.logger).debug)===null||r===void 0||r.call(A,`safety: drop in-flight action ${t}`);return}let s=()=>h(this,void 0,void 0,function*(){var g,c;try{yield i()}catch(I){(c=(g=this.logger).error)===null||c===void 0||c.call(g,"safety: action handler threw",I)}finally{try{yield this.seenCache.add(t)}catch{}this.lock.release(t)}});this.queueEnabled?yield this.manager.run(o,s):yield s()})}pushLight(t,o){var i,e;return h(this,void 0,void 0,function*(){if(!(yield this.seenCache.has(t))){yield this.seenCache.add(t);try{yield o()}catch(a){(e=(i=this.logger).warn)===null||e===void 0||e.call(i,"safety: light handler threw",a)}}})}updatePolicy(t){this.policy.updateConfig(t)}getPolicy(){return this.policy.getConfig()}setBotIdentity(t){this.policy.setBotIdentity(t)}dispose(){return h(this,void 0,void 0,function*(){yield this.manager.dispose(),this.seenCache.dispose(),this.lock.dispose()})}};function b0e(n){return n.key==="@_all"}function M0e(n,t){var o,i,e;let a=new Map,A=new Map,r=[],s=!1,g=!1;for(let c of n??[]){if(b0e(c)){s=!0,a.set(c.key,{key:c.key,name:c.name,isBot:!1});continue}let I=(i=(o=c.id)===null||o===void 0?void 0:o.open_id)!==null&&i!==void 0?i:"",d=(e=c.id)===null||e===void 0?void 0:e.user_id,B=!!(t&&I===t);B&&(g=!0);let f={key:c.key,openId:I||void 0,userId:d,name:c.name,isBot:B};a.set(c.key,f),I&&A.set(I,f),r.push(f)}return{mentions:a,mentionsByOpenId:A,mentionList:r,mentionAll:s,mentionedBot:g}}function _0e(n,t){if(!n||t.mentions.size===0)return n;let o=n;for(let[i,e]of t.mentions){if(e.isBot&&t.stripBotMentions){let A=new RegExp(`\\s?${T0e(i)}\\s?`,"g");o=o.replace(A," ");continue}let a=e.name?`@${e.name}`:i;o=o.split(i).join(a)}return o.replace(/[ \t]{2,}/g," ").trim()}function T0e(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hr(n){if(n)try{return JSON.parse(n)}catch{return}}function N0e(n,t){if(!t||t.length===0)return n;let o=n;return t.includes("bold")&&(o=`**${o}**`),t.includes("italic")&&(o=`*${o}*`),t.includes("underline")&&(o=`${o}`),(t.includes("lineThrough")||t.includes("strikethrough"))&&(o=`~~${o}~~`),(t.includes("codeInline")||t.includes("code"))&&(o=`\`${o}\``),o}var R0e=["zh_cn","en_us","ja_jp"];function k0e(n){if("title"in n||"content"in n)return n;for(let o of R0e){let i=n[o];if(i!=null&&typeof i=="object")return i}let t=Object.keys(n)[0];if(t){let o=n[t];if(o!=null&&typeof o=="object")return o}}function JW(n){if(!(n==null||!Number.isFinite(n)||n<0))return n<1e3?`${Math.round(n)}ms`:n%1e3===0?`${n/1e3}s`:`${(n/1e3).toFixed(1)}s`}function Zm(n){if(n==null)return;let t=typeof n=="string"?parseInt(n,10):n;if(!Number.isFinite(t)||t<=0)return;let o=new Date(t+8*36e5),i=o.getUTCFullYear(),e=String(o.getUTCMonth()+1).padStart(2,"0"),a=String(o.getUTCDate()).padStart(2,"0"),A=String(o.getUTCHours()).padStart(2,"0"),r=String(o.getUTCMinutes()).padStart(2,"0");return`${i}-${e}-${a} ${A}:${r}`}function v0e(n){let t=new Date(n+288e5),o=t.getUTCFullYear(),i=String(t.getUTCMonth()+1).padStart(2,"0"),e=String(t.getUTCDate()).padStart(2,"0"),a=String(t.getUTCHours()).padStart(2,"0"),A=String(t.getUTCMinutes()).padStart(2,"0"),r=String(t.getUTCSeconds()).padStart(2,"0");return`${o}-${i}-${e}T${a}:${A}:${r}+08:00`}function P0e(n,t){return n.split(` `).map(o=>`${t}${o}`).join(` @@ -331,15 +331,15 @@ ${i.length>0?i.join(` `,resources:[]};let a=[];e.topic&&a.push(e.topic);for(let A of(i=e.options)!==null&&i!==void 0?i:[])a.push(`\u2022 ${A}`);return{content:` ${a.join(` `)} -`,resources:[]}}),sRe=new Map([["text",rRe],["post",Z0e],["image",Y0e],["file",H0e],["audio",G0e],["video",DW],["media",DW],["sticker",ARe],["interactive",J0e],["merge_forward",z0e],["share_chat",$0e],["share_user",eRe],["location",q0e],["system",tRe],["vote",nRe],["todo",aRe],["calendar",F0e],["general_calendar",L0e],["share_calendar_event",U0e],["folder",K0e],["hongbao",x0e],["video_chat",oRe]]);function OW(n,t,o){var i;return h(this,void 0,void 0,function*(){let e=(i=sRe.get(t))!==null&&i!==void 0?i:wW;try{return yield e(n,o)}catch{return wW(n)}})}function zW(n,t){var o,i,e,a,A,r,s,g,c,I,d,B;let f=(i=(o=n.context)===null||o===void 0?void 0:o.open_message_id)!==null&&i!==void 0?i:n.open_message_id,Q=(a=(e=n.context)===null||e===void 0?void 0:e.open_chat_id)!==null&&a!==void 0?a:n.open_chat_id,y=(A=n.operator)===null||A===void 0?void 0:A.open_id;return!f||!Q||!y?null:{messageId:f,chatId:Q,operator:{openId:y,userId:(r=n.operator)===null||r===void 0?void 0:r.user_id,name:(s=n.operator)===null||s===void 0?void 0:s.name},action:{value:(g=n.action)===null||g===void 0?void 0:g.value,tag:(I=(c=n.action)===null||c===void 0?void 0:c.tag)!==null&&I!==void 0?I:"unknown",name:(d=n.action)===null||d===void 0?void 0:d.name,option:(B=n.action)===null||B===void 0?void 0:B.option},raw:t?.includeRaw?n:void 0}}function Jv(n,t,o){var i,e,a,A;let r=n.message_id,s=(i=n.reaction_type)===null||i===void 0?void 0:i.emoji_type,g=(e=n.user_id)===null||e===void 0?void 0:e.open_id;if(!r||!s||!g)return null;let c=n.action_time,I=c?parseInt(c,10):void 0;return{messageId:r,operator:{openId:g,userId:(A=(a=n.user_id)===null||a===void 0?void 0:a.user_id)!==null&&A!==void 0?A:void 0},emojiType:s,action:t,actionTime:I!=null&&Number.isFinite(I)?I:void 0,raw:o?.includeRaw?n:void 0}}function VW(n,t){var o,i,e,a,A,r,s,g,c;let I=n.chat_id,d=(o=n.operator_id)===null||o===void 0?void 0:o.open_id;if(!I||!d)return null;let B=(r=(a=(i=n.name)!==null&&i!==void 0?i:(e=n.i18n_names)===null||e===void 0?void 0:e.zh_cn)!==null&&a!==void 0?a:(A=n.i18n_names)===null||A===void 0?void 0:A.en_us)!==null&&r!==void 0?r:(s=n.i18n_names)===null||s===void 0?void 0:s.ja_jp;return{chatId:I,operator:{openId:d,userId:(c=(g=n.operator_id)===null||g===void 0?void 0:g.user_id)!==null&&c!==void 0?c:void 0},botName:B,external:n.external,raw:t?.includeRaw?n:void 0}}function WW(n,t){var o,i,e,a,A,r,s,g,c,I,d,B,f;let Q=(o=n.file_token)!==null&&o!==void 0?o:(i=n.notice_meta)===null||i===void 0?void 0:i.file_token,y=(e=n.file_type)!==null&&e!==void 0?e:(a=n.notice_meta)===null||a===void 0?void 0:a.file_type,m=n.comment_id,T=(r=(A=n.notice_meta)===null||A===void 0?void 0:A.from_user_id)!==null&&r!==void 0?r:n.user_id,_=T?.open_id;if(!Q||!y||!m||!_)return null;let R=(c=(s=n.create_time)!==null&&s!==void 0?s:(g=n.notice_meta)===null||g===void 0?void 0:g.timestamp)!==null&&c!==void 0?c:n.action_time,K=R?parseInt(R,10):Date.now();return{fileToken:Q,fileType:y,commentId:m,replyId:n.reply_id,operator:{openId:_,userId:(I=T?.user_id)!==null&&I!==void 0?I:void 0,unionId:T?.union_id},mentionedBot:!!((f=(d=n.is_mentioned)!==null&&d!==void 0?d:(B=n.notice_meta)===null||B===void 0?void 0:B.is_mentioned)!==null&&f!==void 0?f:n.is_mention),timestamp:Number.isFinite(K)?K:Date.now(),raw:t?.includeRaw?n:void 0}}function ZW(n,t){var o,i,e,a,A;return h(this,void 0,void 0,function*(){let r=n.message,s=(o=t.botIdentity)===null||o===void 0?void 0:o.openId,{mentions:g,mentionsByOpenId:c,mentionList:I,mentionAll:d,mentionedBot:B}=M0e(r.mentions,s),f=d||gRe(r.content),Q={messageId:r.message_id,botOpenId:s,mentions:g,mentionsByOpenId:c,stripBotMentions:(i=t.stripBotMentions)!==null&&i!==void 0?i:!0,fetchSubMessages:t.fetchSubMessages,resolveUserName:t.resolveUserName,batchResolveNames:t.batchResolveNames,dispatch:OW},{content:y,resources:m}=yield OW(r.content,r.message_type,Q),T=_0e(y,Q),_=n.sender.sender_id.open_id,R=(a=(e=n.sender.sender_id.user_id)!==null&&e!==void 0?e:n.sender.sender_id.union_id)!==null&&a!==void 0?a:"",K=_??R,L=_?(A=t.resolveSenderName)===null||A===void 0?void 0:A.call(t,_):void 0,F=r.create_time?parseInt(r.create_time,10):0;return{messageId:r.message_id,chatId:r.chat_id,chatType:r.chat_type,senderId:K,senderName:L,content:T,rawContentType:r.message_type,resources:m,mentions:I,mentionAll:f,mentionedBot:B,rootId:r.root_id,threadId:r.thread_id,replyToMessageId:r.parent_id,createTime:Number.isFinite(F)?F:0,raw:t.includeRaw?n:void 0}})}function gRe(n){return n?/@_all\b/.test(n):!1}var Xm=class{constructor(t){var o,i,e,a,A,r,s;this.handlers={},this.connected=!1,this.opts=t,this.logger=new Tc((o=t.loggerLevel)!==null&&o!==void 0?o:co.info,(i=t.logger)!==null&&i!==void 0?i:Mg),this.rawClient=new Ym({appId:t.appId,appSecret:t.appSecret,domain:(e=t.domain)!==null&&e!==void 0?e:Bs.Feishu,cache:t.cache,httpInstance:t.httpInstance,logger:t.logger,loggerLevel:t.loggerLevel,source:t.source,extraUaTags:["channel"]}),this.dispatcher=new Jm({verificationToken:(a=t.webhook)===null||a===void 0?void 0:a.verificationToken,encryptKey:(A=t.webhook)===null||A===void 0?void 0:A.encryptKey,cache:t.cache,logger:t.logger,loggerLevel:t.loggerLevel}),this.sender=new Lv(this.rawClient,(r=t.outbound)!==null&&r!==void 0?r:{},this.logger),this.safety=new jv({config:t.safety,policy:t.policy,cache:(s=t.cache)!==null&&s!==void 0?s:Qu,logger:this.logger,onReject:g=>{var c,I;(I=(c=this.handlers).reject)===null||I===void 0||I.call(c,g)},onMessage:g=>h(this,void 0,void 0,function*(){let c=this.handlers.message;c&&(yield c(g))})})}connect(){return h(this,void 0,void 0,function*(){return this.connectPromise?this.connectPromise:(this.connectPromise=this.doConnect().catch(t=>{throw this.connectPromise=void 0,t}),this.connectPromise)})}doConnect(){var t;return h(this,void 0,void 0,function*(){this.botIdentity=yield this.fetchBotIdentity(),this.safety.setBotIdentity(this.botIdentity),this.registerDispatcherHandlers(),((t=this.opts.transport)!==null&&t!==void 0?t:"websocket")==="websocket"&&(yield this.connectWebSocket(15e3)),this.connected=!0})}connectWebSocket(t){return new Promise((o,i)=>{var e;let a=!1,A=setTimeout(()=>{a||(a=!0,i(new Ft("not_connected",`WebSocket handshake did not complete within ${t}ms`)))},t);this.rawWsClient=new zm({appId:this.opts.appId,appSecret:this.opts.appSecret,domain:(e=this.opts.domain)!==null&&e!==void 0?e:Bs.Feishu,logger:this.opts.logger,loggerLevel:this.opts.loggerLevel,httpInstance:this.opts.httpInstance,autoReconnect:!0,source:this.opts.source,extraUaTags:["channel"],agent:this.opts.agent,wsConfig:this.opts.wsConfig,handshakeTimeoutMs:this.opts.handshakeTimeoutMs,onReady:()=>{a||(a=!0,clearTimeout(A),o())},onError:r=>{a||(a=!0,clearTimeout(A),i(new Ft("not_connected",`WebSocket connect failed: ${r.message}`,{cause:r})))},onReconnecting:()=>{var r,s;return(s=(r=this.handlers).reconnecting)===null||s===void 0?void 0:s.call(r)},onReconnected:()=>{var r,s;return(s=(r=this.handlers).reconnected)===null||s===void 0?void 0:s.call(r)}}),this.rawWsClient.start({eventDispatcher:this.dispatcher})})}disconnect(){var t;return h(this,void 0,void 0,function*(){if(this.connected){try{(t=this.rawWsClient)===null||t===void 0||t.close({})}catch{}try{yield this.safety.dispose()}catch{}this.connected=!1,this.connectPromise=void 0}})}getConnectionStatus(){var t;return(t=this.rawWsClient)===null||t===void 0?void 0:t.getConnectionStatus()}on(t,o){if(typeof t=="string")return this.attachSingle(t,o);let i=[];return Object.keys(t).forEach(e=>{let a=t[e];a&&i.push(this.attachSingle(e,a))}),()=>i.forEach(e=>e())}attachSingle(t,o){return this.handlers[t]&&this.logger.warn(`channel: handler for "${t}" is being overwritten`),this.handlers[t]=o,()=>{this.handlers[t]===o&&delete this.handlers[t]}}send(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.send(t,o,i)})}stream(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.stream(t,o,i)})}updateCard(t,o){return h(this,void 0,void 0,function*(){yield this.sender.patchCard(t,o)})}editMessage(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.update({path:{message_id:t},data:{msg_type:"text",content:JSON.stringify({text:o})}})})}recallMessage(t){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.delete({path:{message_id:t}})})}addReaction(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.create({path:{message_id:t},data:{reaction_type:{emoji_type:o}}}),A=(e=(i=a?.data)===null||i===void 0?void 0:i.reaction_id)!==null&&e!==void 0?e:a?.reaction_id;if(!A)throw new Ft("unknown","messageReaction.create returned no reaction_id");return A})}removeReaction(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.messageReaction.delete({path:{message_id:t,reaction_id:o}})})}removeReactionByEmoji(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.list({path:{message_id:t},params:{reaction_type:o,page_size:50}}),r=((e=(i=a?.data)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).find(s=>{var g;return((g=s.operator)===null||g===void 0?void 0:g.operator_type)==="app"});return r?.reaction_id?(yield this.removeReaction(t,r.reaction_id),!0):!1})}downloadResource(t,o){return h(this,void 0,void 0,function*(){if(o==="image"){let e=yield this.rawClient.im.v1.image.get({path:{image_key:t}});return yield bW(e)}let i=yield this.rawClient.im.v1.file.get({path:{file_key:t}});return yield bW(i)})}getChatInfo(t){var o,i;return h(this,void 0,void 0,function*(){let a=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)!==null&&o!==void 0?o:{};return{chatId:t,name:a.name,description:a.description,chatType:(i=a.chat_mode)!==null&&i!==void 0?i:"group",ownerId:a.owner_id,memberCount:a.user_count}})}getChatMode(t){var o;return h(this,void 0,void 0,function*(){let e=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)===null||o===void 0?void 0:o.chat_mode;return e==="p2p"?"p2p":e==="topic"?"topic":"group"})}updatePolicy(t){this.safety.updatePolicy(t)}getPolicy(){return this.safety.getPolicy()}fetchBotIdentity(){var t;return h(this,void 0,void 0,function*(){let o;try{let a=yield this.rawClient.request({url:"/open-apis/bot/v3/info",method:"GET"}),A=a.bot;if(A?.open_id)return{openId:A.open_id,name:(t=A.app_name)!==null&&t!==void 0?t:"bot"};o=new Error(`bot/v3/info response missing open_id: ${JSON.stringify(a).slice(0,200)}`)}catch(a){o=a}let i=AP(o),e=i.code==="unknown"?"not_connected":i.code;throw new Ft(e,"could not resolve bot identity via /open-apis/bot/v3/info \u2014 required for channel to function",{cause:o})})}registerDispatcherHandlers(){var t,o;let i=A=>h(this,void 0,void 0,function*(){var r,s,g,c;try{return(s=(r=(yield this.rawClient.im.v1.message.get({path:{message_id:A}})).data)===null||r===void 0?void 0:r.items)!==null&&s!==void 0?s:[]}catch(I){return(c=(g=this.logger).warn)===null||c===void 0||c.call(g,"channel: fetchSubMessages failed",I),[]}}),e=(o=(t=this.opts.includeRawEvent)!==null&&t!==void 0?t:this.opts.includeRawInMessage)!==null&&o!==void 0?o:!1,a={botIdentity:this.botIdentity,stripBotMentions:!0,includeRaw:e,fetchSubMessages:i};this.dispatcher.register({"im.message.receive_v1":A=>h(this,void 0,void 0,function*(){try{let r=yield ZW(A,a);yield this.safety.pushMessage(r)}catch(r){this.emitError(r)}}),"card.action.trigger":A=>h(this,void 0,void 0,function*(){let r=zW(A,{includeRaw:e});if(!r)return;let s=lRe(r.action);yield this.safety.pushAction(`card:${r.messageId}:${r.operator.openId}:${s}`,r.chatId,()=>h(this,void 0,void 0,function*(){let g=this.handlers.cardAction;g&&(yield g(r))}))}),"im.message.reaction.created_v1":A=>h(this,void 0,void 0,function*(){let r=Jv(A,"added",{includeRaw:e});if(!r)return;let s=MW(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.message.reaction.deleted_v1":A=>h(this,void 0,void 0,function*(){let r=Jv(A,"removed",{includeRaw:e});if(!r)return;let s=MW(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.chat.member.bot.added_v1":A=>{var r,s;let g=VW(A,{includeRaw:e});if(g)try{(s=(r=this.handlers).botAdded)===null||s===void 0||s.call(r,g)}catch(c){this.emitError(c)}},"drive.notice.comment_add_v1":A=>h(this,void 0,void 0,function*(){var r;let s=WW(A,{includeRaw:e});s&&(yield this.safety.pushAction(`comment:${s.fileToken}:${s.commentId}:${(r=s.replyId)!==null&&r!==void 0?r:""}`,s.fileToken,()=>h(this,void 0,void 0,function*(){let g=this.handlers.comment;g&&(yield g(s))})))})})}emitError(t){var o,i,e;let a=t instanceof Ft?t:new Ft("unknown",String((o=t?.message)!==null&&o!==void 0?o:t),{cause:t}),A=this.handlers.error;A?A(a):(e=(i=this.logger).error)===null||e===void 0||e.call(i,"channel: unhandled error",a)}};function cRe(n){return new Xm(n)}function bW(n){return h(this,void 0,void 0,function*(){if(Buffer.isBuffer(n))return n;if(n instanceof Uint8Array)return Buffer.from(n);if(typeof n=="object"&&n!==null){let t=n;if(typeof t.getReadableStream=="function")return yield IRe(t.getReadableStream());if(Buffer.isBuffer(t.data))return t.data;if(t.data instanceof Uint8Array)return Buffer.from(t.data)}throw new Ft("unknown","unexpected download response type")})}function IRe(n){return new Promise((t,o)=>{let i=[];n.on("data",e=>{i.push(Buffer.isBuffer(e)?e:Buffer.from(e))}),n.on("end",()=>t(Buffer.concat(i))),n.on("error",o)})}function MW(n){var t;return`rx:${n.messageId}:${n.operator.openId}:${n.emojiType}:${n.action}:${(t=n.actionTime)!==null&&t!==void 0?t:0}`}function lRe(n){var t,o,i;let e=typeof n.value=="string"?n.value:JSON.stringify((t=n.value)!==null&&t!==void 0?t:""),a=e.length>128?e.slice(0,128):e;return`${n.tag}|${(o=n.name)!==null&&o!==void 0?o:""}|${(i=n.option)!==null&&i!==void 0?i:""}|${a}`}var V6=qe(aN(),1);var XW=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function $W(n,t){return Number.isFinite(n)&&n>=0?n:t}function pRe(n){if(!Array.isArray(n)||n.length===0)return[...XW];let t=n.map(o=>$W(o,-1)).filter(o=>o>=0);return t.length>0?t:[...XW]}function dRe(n){let t=Number.isInteger(n?.totals?.configured)?n.totals.configured:Array.isArray(n?.bots)?n.bots.length:0,o=Number.isInteger(n?.totals?.connected)?n.totals.connected:Array.isArray(n?.bots)?n.bots.filter(i=>i?.connected===!0).length:0;return{configured:t,connected:o}}var eS=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=pRe(e),this.#l=$W(a,15e3),this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#p||this.#c?this:(this.#p=!0,this.#d(0),this)}async close(){this.#c||(this.#c=!0,this.#a!==null&&(this.#i(this.#a),this.#a=null),await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#c||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#c||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{await this.#A.ensureRunning()}catch(t){if(this.#c)return;this.#u("Harness Host is not ready",t);return}if(!this.#c)try{if(await this.#e.initialize(),this.#c)return;let t=await this.#e.status();this.#I?.(t),this.#I=null;let o=dRe(t);if(o.connected=0?o:null}async function QRe(n,{signal:t,maxBytes:o}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu image download returned no readable stream");t?.throwIfAborted();let i=()=>n.destroy?.(t.reason??new DOMException("Feishu image download aborted","AbortError"));t?.addEventListener("abort",i,{once:!0});let e=[],a=0;try{for await(let A of n){t?.throwIfAborted();let r=Buffer.from(A);if(a+=r.length,a>o)throw n.destroy?.(),new ut("image-too-large",`Feishu image exceeds ${o} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));e.push(r)}return t?.throwIfAborted(),Buffer.concat(e,a)}finally{t?.removeEventListener("abort",i)}}async function yRe(n,{signal:t}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu file download returned no readable stream");t?.throwIfAborted();let o=()=>n.destroy?.(t.reason??new DOMException("Feishu file download aborted","AbortError"));t?.addEventListener("abort",o,{once:!0});let i=[],e=0;try{for await(let a of n){t?.throwIfAborted();let A=Buffer.from(a);e+=A.length,i.push(A)}return t?.throwIfAborted(),Buffer.concat(i,e)}finally{t?.removeEventListener("abort",o)}}function iP(n){if(!n||typeof n!="object")return null;let t=n.code??n.error?.code;return Number.isSafeInteger(Number(t))?Number(t):null}async function mRe(n,t){if(!n||typeof n[Symbol.asyncIterator]!="function")return null;t?.throwIfAborted();let o=AbortSignal.timeout(ERe),i=t?AbortSignal.any([t,o]):o,e=()=>n.destroy?.(i.reason);i.addEventListener("abort",e,{once:!0});let a=[],A=0;try{for await(let r of n){let s=Buffer.from(r);if(A+=s.length,A>hRe)return n.destroy?.(),null;a.push(s)}return Buffer.concat(a,A).toString("utf8")}catch{return t?.throwIfAborted(),null}finally{i.removeEventListener("abort",e)}}async function SRe(n,t){let o=[n],i=new Set;for(;o.length>0&&i.size<8;){let e=o.shift();if(!e||typeof e!="object"&&typeof e!="function"||i.has(e))continue;i.add(e);let a=iP(e),A=e.response?.data??e.data;if(a===AS)return A?.destroy?.(),a;if(A&&typeof A[Symbol.asyncIterator]=="function"){let r=await mRe(A,t);try{let s=iP(JSON.parse(r));if(s===AS)return s}catch{}}else{let r=iP(A);if(r===AS)return r}o.push(e.cause)}return null}async function wRe(n,t){return await SRe(n,t)!==AS?n:new ut("feishu-image-permission-required","Feishu image download requires the im:message:readonly tenant scope",w(CRe),{cause:n})}function DRe(n,t,o){return{async load({signal:i,maxBytes:e}){i?.throwIfAborted();let a;try{a=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:o},params:{type:"image"}})}catch(r){throw await wRe(r,i)}i?.throwIfAborted();let A=fRe(a?.headers);if(A!==null&&A>e)throw a?.getReadableStream?.().destroy?.(),new ut("image-too-large",`Feishu image declares ${A} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return QRe(a?.getReadableStream?.(),{signal:i,maxBytes:e})}}}function ORe(n,t,o){let i=Ld(o?.file_key);return i?{name:Ld(o?.file_name)??"file",async load({signal:e}={}){e?.throwIfAborted();let a=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:i},params:{type:"file"}});return e?.throwIfAborted(),yRe(a?.getReadableStream?.(),{signal:e})}}:null}function sP(n,t){let o=n?.message?.message_type,i=nP(n),e=uRe(n,i),a=o==="image"?Ld(i?.image_key):null,A=a?[a]:e?.imageKeys??[],r=o==="file"?ORe(n,t,i):null;return{content:o==="text"?Ud(n)??"":e?.text??"",images:A.map(s=>DRe(n,t,s)),files:r?[r]:[]}}function a6(n,t=9e3){if(n.length<=t)return[n];let o=[],i=n;for(;i.length>t;){let e=i.lastIndexOf(` -`,t);ei.value===t);return o>=0?o+1:0}function Su(n){return String(n??"").replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu," ").replace(/\s+/gu," ").trim()||w("\u6682\u65E0\u6807\u9898")}function Yo(n,t){return JSON.stringify({schema:"2.0",header:{title:aS(n),template:"blue"},body:{elements:t}})}function El(){return fs(w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")}function n6(n){let{workspaces:t=[],currentWorkspace:o=null,currentSession:i=null,sessions:e=[],archiveVisible:a=!1,presetCatalog:A=null,modelCatalog:r=null}=n||{},s=i?.id??null,g=i?.title??n?.currentSessionTitle??null,c=(Array.isArray(e)?e:[]).slice(0,20),I=c.length>0,d=Array.isArray(t)&&t.length>0,B=[];B.push({tag:"div",text:Ct(w("**\u8BBE\u7F6E**"))});let f=null;if(I){let k=c.map(z=>({text:{tag:"plain_text",content:`${z.id===s?"\u2713 ":""}${Su(z.title)}`},value:z.id}));f={tag:"select_static",name:"session_pick",placeholder:{tag:"plain_text",content:s?w("\u5207\u6362\u4F1A\u8BDD"):w("\u9009\u62E9\u4F1A\u8BDD\uFF08\u5F53\u524D\u672A\u7ED1\u5B9A\uFF09")},initial_index:Hd(k,s),options:k,behaviors:[{type:"callback",value:{action:"session_pick"}}]}}let Q=null;if(d){let k=t.slice(0,20).map(z=>({text:{tag:"plain_text",content:`${z===o?"\u2713 ":""}${z}`},value:z}));Q={tag:"select_static",name:"workspace_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u5DE5\u4F5C\u533A")},initial_index:Hd(k,o),options:k,behaviors:[{type:"callback",value:{action:"workspace_pick"}}]}}let y=Array.isArray(A?.items)?A.items:[],m=A?._currentId??null,T=m===null,_=null;if(y.length>=1){let k=y.slice(0,30).map(Ae=>({text:{tag:"plain_text",content:`${Ae.id===m?"\u2713 ":""}${Ae.label}`},value:Ae.id})),z=T?tS:m;k.unshift({text:{tag:"plain_text",content:`${T?"\u2713 ":""}${w("\u8DDF\u968F\u9ED8\u8BA4")}`},value:tS}),_={tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u9884\u8BBE")},initial_index:Hd(k,z),options:k,behaviors:[{type:"callback",value:{action:"preset_pick"}}]}}let R=Array.isArray(r?.groups)?r.groups:[],K=r?.current,L=K?`${K.provider}/${K.model}`:null,F=[];for(let k of R)for(let z of k.models||[])F.push({id:`${k.id}/${z.id}`,name:`${k.name} - ${z.name}`});let q=null;if(F.length>1){let k=F.slice(0,30).map(z=>({text:{tag:"plain_text",content:`${z.id===L?"\u2713 ":""}${z.name}`},value:z.id}));q={tag:"select_static",name:"model_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u6A21\u578B")},initial_index:Hd(k,L),options:k,behaviors:[{type:"callback",value:{action:"model_pick"}}]}}function V(k){return{tag:"column",width:"weighted",weight:.1,vertical_align:"center",elements:[{tag:"div",text:{tag:"plain_text",content:k}}]}}function x(k){return{tag:"column",width:"weighted",weight:1,elements:[k]}}let G=[];f&&G.push(f),Q&&G.push(Q),G.length===2?B.push({tag:"column_set",flex_mode:"none",columns:[V("\u{1F4AC}"),x(G[0]),V("\u{1F4C2}"),x(G[1])]}):G[0]&&B.push(G[0]),I||B.push({tag:"div",text:Ct(w("\u5F53\u524D\u5DE5\u4F5C\u533A\u6682\u65E0\u53EF\u7528\u4F1A\u8BDD\u3002"))});let J=[],U=fs(w("\u{1F916} \u5207\u6362\u9884\u8BBE"),"presets"),N=fs(w("\u{1F9E0} \u5207\u6362\u6A21\u578B"),"models");return _?J.push(_):J.push(U),q?J.push(q):J.push(N),B.push({tag:"column_set",flex_mode:"none",columns:[V("\u{1F916}"),x(J[0]),V("\u{1F9E0}"),x(J[1])]}),B.push(hl(w("\u{1F195} \u65B0\u4F1A\u8BDD"),"new",w("\u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8"),"sessions")),!I&&!d&&B.push(fs(w("\u{1F5C2} \u5DE5\u4F5C\u533A\u5217\u8868"),"workspaces")),B.push({tag:"hr"}),B.push({tag:"div",text:Ct(w("**\u4EFB\u52A1\u63A7\u5236**"))}),B.push(hl(w("\u23F9 \u505C\u6B62"),"stop",w("\u{1F4D0} \u538B\u7F29"),"compact")),B.push({tag:"hr"}),B.push({tag:"column_set",flex_mode:"none",columns:[{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:Ct(w("**\u8865\u5145\u6307\u4EE4**"))},{tag:"select_static",name:"steer_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u8865\u5145\u6307\u4EE4")},initial_index:0,options:[...u6.map(k=>({text:{tag:"plain_text",content:w(k)},value:w(k)})),{text:{tag:"plain_text",content:w("\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026")},value:"custom"}],behaviors:[{type:"callback",value:{action:"steer_pick"}}]}]},{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:Ct(w("\u{1F5C4} \u5F52\u6863\uFF1A{state}",{state:a?w("\u5DF2\u663E\u793A"):w("\u5DF2\u9690\u85CF")}))},fs(w("\u5207\u6362\u5F52\u6863\u663E\u793A"),"archive_toggle")]}]}),B.push({tag:"hr"}),B.push(hl(w("\u{1F4CA} \u72B6\u6001"),"status",w("\u{1F4D6} \u5E2E\u52A9"),"help")),B.push({tag:"div",text:Ct(w(`**\u6570\u5B57\u515C\u5E95** +`,resources:[]}}),sRe=new Map([["text",rRe],["post",Z0e],["image",Y0e],["file",H0e],["audio",G0e],["video",DW],["media",DW],["sticker",ARe],["interactive",J0e],["merge_forward",z0e],["share_chat",$0e],["share_user",eRe],["location",q0e],["system",tRe],["vote",nRe],["todo",aRe],["calendar",F0e],["general_calendar",L0e],["share_calendar_event",U0e],["folder",K0e],["hongbao",x0e],["video_chat",oRe]]);function OW(n,t,o){var i;return h(this,void 0,void 0,function*(){let e=(i=sRe.get(t))!==null&&i!==void 0?i:wW;try{return yield e(n,o)}catch{return wW(n)}})}function zW(n,t){var o,i,e,a,A,r,s,g,c,I,d,B;let f=(i=(o=n.context)===null||o===void 0?void 0:o.open_message_id)!==null&&i!==void 0?i:n.open_message_id,Q=(a=(e=n.context)===null||e===void 0?void 0:e.open_chat_id)!==null&&a!==void 0?a:n.open_chat_id,y=(A=n.operator)===null||A===void 0?void 0:A.open_id;return!f||!Q||!y?null:{messageId:f,chatId:Q,operator:{openId:y,userId:(r=n.operator)===null||r===void 0?void 0:r.user_id,name:(s=n.operator)===null||s===void 0?void 0:s.name},action:{value:(g=n.action)===null||g===void 0?void 0:g.value,tag:(I=(c=n.action)===null||c===void 0?void 0:c.tag)!==null&&I!==void 0?I:"unknown",name:(d=n.action)===null||d===void 0?void 0:d.name,option:(B=n.action)===null||B===void 0?void 0:B.option},raw:t?.includeRaw?n:void 0}}function Jv(n,t,o){var i,e,a,A;let r=n.message_id,s=(i=n.reaction_type)===null||i===void 0?void 0:i.emoji_type,g=(e=n.user_id)===null||e===void 0?void 0:e.open_id;if(!r||!s||!g)return null;let c=n.action_time,I=c?parseInt(c,10):void 0;return{messageId:r,operator:{openId:g,userId:(A=(a=n.user_id)===null||a===void 0?void 0:a.user_id)!==null&&A!==void 0?A:void 0},emojiType:s,action:t,actionTime:I!=null&&Number.isFinite(I)?I:void 0,raw:o?.includeRaw?n:void 0}}function VW(n,t){var o,i,e,a,A,r,s,g,c;let I=n.chat_id,d=(o=n.operator_id)===null||o===void 0?void 0:o.open_id;if(!I||!d)return null;let B=(r=(a=(i=n.name)!==null&&i!==void 0?i:(e=n.i18n_names)===null||e===void 0?void 0:e.zh_cn)!==null&&a!==void 0?a:(A=n.i18n_names)===null||A===void 0?void 0:A.en_us)!==null&&r!==void 0?r:(s=n.i18n_names)===null||s===void 0?void 0:s.ja_jp;return{chatId:I,operator:{openId:d,userId:(c=(g=n.operator_id)===null||g===void 0?void 0:g.user_id)!==null&&c!==void 0?c:void 0},botName:B,external:n.external,raw:t?.includeRaw?n:void 0}}function WW(n,t){var o,i,e,a,A,r,s,g,c,I,d,B,f;let Q=(o=n.file_token)!==null&&o!==void 0?o:(i=n.notice_meta)===null||i===void 0?void 0:i.file_token,y=(e=n.file_type)!==null&&e!==void 0?e:(a=n.notice_meta)===null||a===void 0?void 0:a.file_type,m=n.comment_id,T=(r=(A=n.notice_meta)===null||A===void 0?void 0:A.from_user_id)!==null&&r!==void 0?r:n.user_id,_=T?.open_id;if(!Q||!y||!m||!_)return null;let R=(c=(s=n.create_time)!==null&&s!==void 0?s:(g=n.notice_meta)===null||g===void 0?void 0:g.timestamp)!==null&&c!==void 0?c:n.action_time,K=R?parseInt(R,10):Date.now();return{fileToken:Q,fileType:y,commentId:m,replyId:n.reply_id,operator:{openId:_,userId:(I=T?.user_id)!==null&&I!==void 0?I:void 0,unionId:T?.union_id},mentionedBot:!!((f=(d=n.is_mentioned)!==null&&d!==void 0?d:(B=n.notice_meta)===null||B===void 0?void 0:B.is_mentioned)!==null&&f!==void 0?f:n.is_mention),timestamp:Number.isFinite(K)?K:Date.now(),raw:t?.includeRaw?n:void 0}}function ZW(n,t){var o,i,e,a,A;return h(this,void 0,void 0,function*(){let r=n.message,s=(o=t.botIdentity)===null||o===void 0?void 0:o.openId,{mentions:g,mentionsByOpenId:c,mentionList:I,mentionAll:d,mentionedBot:B}=M0e(r.mentions,s),f=d||gRe(r.content),Q={messageId:r.message_id,botOpenId:s,mentions:g,mentionsByOpenId:c,stripBotMentions:(i=t.stripBotMentions)!==null&&i!==void 0?i:!0,fetchSubMessages:t.fetchSubMessages,resolveUserName:t.resolveUserName,batchResolveNames:t.batchResolveNames,dispatch:OW},{content:y,resources:m}=yield OW(r.content,r.message_type,Q),T=_0e(y,Q),_=n.sender.sender_id.open_id,R=(a=(e=n.sender.sender_id.user_id)!==null&&e!==void 0?e:n.sender.sender_id.union_id)!==null&&a!==void 0?a:"",K=_??R,L=_?(A=t.resolveSenderName)===null||A===void 0?void 0:A.call(t,_):void 0,F=r.create_time?parseInt(r.create_time,10):0;return{messageId:r.message_id,chatId:r.chat_id,chatType:r.chat_type,senderId:K,senderName:L,content:T,rawContentType:r.message_type,resources:m,mentions:I,mentionAll:f,mentionedBot:B,rootId:r.root_id,threadId:r.thread_id,replyToMessageId:r.parent_id,createTime:Number.isFinite(F)?F:0,raw:t.includeRaw?n:void 0}})}function gRe(n){return n?/@_all\b/.test(n):!1}var Xm=class{constructor(t){var o,i,e,a,A,r,s;this.handlers={},this.connected=!1,this.opts=t,this.logger=new Tc((o=t.loggerLevel)!==null&&o!==void 0?o:co.info,(i=t.logger)!==null&&i!==void 0?i:Mg),this.rawClient=new Ym({appId:t.appId,appSecret:t.appSecret,domain:(e=t.domain)!==null&&e!==void 0?e:Bs.Feishu,cache:t.cache,httpInstance:t.httpInstance,logger:t.logger,loggerLevel:t.loggerLevel,source:t.source,extraUaTags:["channel"]}),this.dispatcher=new Jm({verificationToken:(a=t.webhook)===null||a===void 0?void 0:a.verificationToken,encryptKey:(A=t.webhook)===null||A===void 0?void 0:A.encryptKey,cache:t.cache,logger:t.logger,loggerLevel:t.loggerLevel}),this.sender=new Lv(this.rawClient,(r=t.outbound)!==null&&r!==void 0?r:{},this.logger),this.safety=new jv({config:t.safety,policy:t.policy,cache:(s=t.cache)!==null&&s!==void 0?s:Qu,logger:this.logger,onReject:g=>{var c,I;(I=(c=this.handlers).reject)===null||I===void 0||I.call(c,g)},onMessage:g=>h(this,void 0,void 0,function*(){let c=this.handlers.message;c&&(yield c(g))})})}connect(){return h(this,void 0,void 0,function*(){return this.connectPromise?this.connectPromise:(this.connectPromise=this.doConnect().catch(t=>{throw this.connectPromise=void 0,t}),this.connectPromise)})}doConnect(){var t;return h(this,void 0,void 0,function*(){this.botIdentity=yield this.fetchBotIdentity(),this.safety.setBotIdentity(this.botIdentity),this.registerDispatcherHandlers(),((t=this.opts.transport)!==null&&t!==void 0?t:"websocket")==="websocket"&&(yield this.connectWebSocket(15e3)),this.connected=!0})}connectWebSocket(t){return new Promise((o,i)=>{var e;let a=!1,A=setTimeout(()=>{a||(a=!0,i(new Lt("not_connected",`WebSocket handshake did not complete within ${t}ms`)))},t);this.rawWsClient=new zm({appId:this.opts.appId,appSecret:this.opts.appSecret,domain:(e=this.opts.domain)!==null&&e!==void 0?e:Bs.Feishu,logger:this.opts.logger,loggerLevel:this.opts.loggerLevel,httpInstance:this.opts.httpInstance,autoReconnect:!0,source:this.opts.source,extraUaTags:["channel"],agent:this.opts.agent,wsConfig:this.opts.wsConfig,handshakeTimeoutMs:this.opts.handshakeTimeoutMs,onReady:()=>{a||(a=!0,clearTimeout(A),o())},onError:r=>{a||(a=!0,clearTimeout(A),i(new Lt("not_connected",`WebSocket connect failed: ${r.message}`,{cause:r})))},onReconnecting:()=>{var r,s;return(s=(r=this.handlers).reconnecting)===null||s===void 0?void 0:s.call(r)},onReconnected:()=>{var r,s;return(s=(r=this.handlers).reconnected)===null||s===void 0?void 0:s.call(r)}}),this.rawWsClient.start({eventDispatcher:this.dispatcher})})}disconnect(){var t;return h(this,void 0,void 0,function*(){if(this.connected){try{(t=this.rawWsClient)===null||t===void 0||t.close({})}catch{}try{yield this.safety.dispose()}catch{}this.connected=!1,this.connectPromise=void 0}})}getConnectionStatus(){var t;return(t=this.rawWsClient)===null||t===void 0?void 0:t.getConnectionStatus()}on(t,o){if(typeof t=="string")return this.attachSingle(t,o);let i=[];return Object.keys(t).forEach(e=>{let a=t[e];a&&i.push(this.attachSingle(e,a))}),()=>i.forEach(e=>e())}attachSingle(t,o){return this.handlers[t]&&this.logger.warn(`channel: handler for "${t}" is being overwritten`),this.handlers[t]=o,()=>{this.handlers[t]===o&&delete this.handlers[t]}}send(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.send(t,o,i)})}stream(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.stream(t,o,i)})}updateCard(t,o){return h(this,void 0,void 0,function*(){yield this.sender.patchCard(t,o)})}editMessage(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.update({path:{message_id:t},data:{msg_type:"text",content:JSON.stringify({text:o})}})})}recallMessage(t){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.delete({path:{message_id:t}})})}addReaction(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.create({path:{message_id:t},data:{reaction_type:{emoji_type:o}}}),A=(e=(i=a?.data)===null||i===void 0?void 0:i.reaction_id)!==null&&e!==void 0?e:a?.reaction_id;if(!A)throw new Lt("unknown","messageReaction.create returned no reaction_id");return A})}removeReaction(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.messageReaction.delete({path:{message_id:t,reaction_id:o}})})}removeReactionByEmoji(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.list({path:{message_id:t},params:{reaction_type:o,page_size:50}}),r=((e=(i=a?.data)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).find(s=>{var g;return((g=s.operator)===null||g===void 0?void 0:g.operator_type)==="app"});return r?.reaction_id?(yield this.removeReaction(t,r.reaction_id),!0):!1})}downloadResource(t,o){return h(this,void 0,void 0,function*(){if(o==="image"){let e=yield this.rawClient.im.v1.image.get({path:{image_key:t}});return yield bW(e)}let i=yield this.rawClient.im.v1.file.get({path:{file_key:t}});return yield bW(i)})}getChatInfo(t){var o,i;return h(this,void 0,void 0,function*(){let a=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)!==null&&o!==void 0?o:{};return{chatId:t,name:a.name,description:a.description,chatType:(i=a.chat_mode)!==null&&i!==void 0?i:"group",ownerId:a.owner_id,memberCount:a.user_count}})}getChatMode(t){var o;return h(this,void 0,void 0,function*(){let e=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)===null||o===void 0?void 0:o.chat_mode;return e==="p2p"?"p2p":e==="topic"?"topic":"group"})}updatePolicy(t){this.safety.updatePolicy(t)}getPolicy(){return this.safety.getPolicy()}fetchBotIdentity(){var t;return h(this,void 0,void 0,function*(){let o;try{let a=yield this.rawClient.request({url:"/open-apis/bot/v3/info",method:"GET"}),A=a.bot;if(A?.open_id)return{openId:A.open_id,name:(t=A.app_name)!==null&&t!==void 0?t:"bot"};o=new Error(`bot/v3/info response missing open_id: ${JSON.stringify(a).slice(0,200)}`)}catch(a){o=a}let i=AP(o),e=i.code==="unknown"?"not_connected":i.code;throw new Lt(e,"could not resolve bot identity via /open-apis/bot/v3/info \u2014 required for channel to function",{cause:o})})}registerDispatcherHandlers(){var t,o;let i=A=>h(this,void 0,void 0,function*(){var r,s,g,c;try{return(s=(r=(yield this.rawClient.im.v1.message.get({path:{message_id:A}})).data)===null||r===void 0?void 0:r.items)!==null&&s!==void 0?s:[]}catch(I){return(c=(g=this.logger).warn)===null||c===void 0||c.call(g,"channel: fetchSubMessages failed",I),[]}}),e=(o=(t=this.opts.includeRawEvent)!==null&&t!==void 0?t:this.opts.includeRawInMessage)!==null&&o!==void 0?o:!1,a={botIdentity:this.botIdentity,stripBotMentions:!0,includeRaw:e,fetchSubMessages:i};this.dispatcher.register({"im.message.receive_v1":A=>h(this,void 0,void 0,function*(){try{let r=yield ZW(A,a);yield this.safety.pushMessage(r)}catch(r){this.emitError(r)}}),"card.action.trigger":A=>h(this,void 0,void 0,function*(){let r=zW(A,{includeRaw:e});if(!r)return;let s=lRe(r.action);yield this.safety.pushAction(`card:${r.messageId}:${r.operator.openId}:${s}`,r.chatId,()=>h(this,void 0,void 0,function*(){let g=this.handlers.cardAction;g&&(yield g(r))}))}),"im.message.reaction.created_v1":A=>h(this,void 0,void 0,function*(){let r=Jv(A,"added",{includeRaw:e});if(!r)return;let s=MW(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.message.reaction.deleted_v1":A=>h(this,void 0,void 0,function*(){let r=Jv(A,"removed",{includeRaw:e});if(!r)return;let s=MW(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.chat.member.bot.added_v1":A=>{var r,s;let g=VW(A,{includeRaw:e});if(g)try{(s=(r=this.handlers).botAdded)===null||s===void 0||s.call(r,g)}catch(c){this.emitError(c)}},"drive.notice.comment_add_v1":A=>h(this,void 0,void 0,function*(){var r;let s=WW(A,{includeRaw:e});s&&(yield this.safety.pushAction(`comment:${s.fileToken}:${s.commentId}:${(r=s.replyId)!==null&&r!==void 0?r:""}`,s.fileToken,()=>h(this,void 0,void 0,function*(){let g=this.handlers.comment;g&&(yield g(s))})))})})}emitError(t){var o,i,e;let a=t instanceof Lt?t:new Lt("unknown",String((o=t?.message)!==null&&o!==void 0?o:t),{cause:t}),A=this.handlers.error;A?A(a):(e=(i=this.logger).error)===null||e===void 0||e.call(i,"channel: unhandled error",a)}};function cRe(n){return new Xm(n)}function bW(n){return h(this,void 0,void 0,function*(){if(Buffer.isBuffer(n))return n;if(n instanceof Uint8Array)return Buffer.from(n);if(typeof n=="object"&&n!==null){let t=n;if(typeof t.getReadableStream=="function")return yield IRe(t.getReadableStream());if(Buffer.isBuffer(t.data))return t.data;if(t.data instanceof Uint8Array)return Buffer.from(t.data)}throw new Lt("unknown","unexpected download response type")})}function IRe(n){return new Promise((t,o)=>{let i=[];n.on("data",e=>{i.push(Buffer.isBuffer(e)?e:Buffer.from(e))}),n.on("end",()=>t(Buffer.concat(i))),n.on("error",o)})}function MW(n){var t;return`rx:${n.messageId}:${n.operator.openId}:${n.emojiType}:${n.action}:${(t=n.actionTime)!==null&&t!==void 0?t:0}`}function lRe(n){var t,o,i;let e=typeof n.value=="string"?n.value:JSON.stringify((t=n.value)!==null&&t!==void 0?t:""),a=e.length>128?e.slice(0,128):e;return`${n.tag}|${(o=n.name)!==null&&o!==void 0?o:""}|${(i=n.option)!==null&&i!==void 0?i:""}|${a}`}var V6=qe(aN(),1);var XW=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function $W(n,t){return Number.isFinite(n)&&n>=0?n:t}function pRe(n){if(!Array.isArray(n)||n.length===0)return[...XW];let t=n.map(o=>$W(o,-1)).filter(o=>o>=0);return t.length>0?t:[...XW]}function dRe(n){let t=Number.isInteger(n?.totals?.configured)?n.totals.configured:Array.isArray(n?.bots)?n.bots.length:0,o=Number.isInteger(n?.totals?.connected)?n.totals.connected:Array.isArray(n?.bots)?n.bots.filter(i=>i?.connected===!0).length:0;return{configured:t,connected:o}}var eS=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=pRe(e),this.#l=$W(a,15e3),this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#p||this.#c?this:(this.#p=!0,this.#d(0),this)}async close(){this.#c||(this.#c=!0,this.#a!==null&&(this.#i(this.#a),this.#a=null),await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#c||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#c||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{await this.#A.ensureRunning()}catch(t){if(this.#c)return;this.#u("Harness Host is not ready",t);return}if(!this.#c)try{if(await this.#e.initialize(),this.#c)return;let t=await this.#e.status();this.#I?.(t),this.#I=null;let o=dRe(t);if(o.connected=0?o:null}async function QRe(n,{signal:t,maxBytes:o}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu image download returned no readable stream");t?.throwIfAborted();let i=()=>n.destroy?.(t.reason??new DOMException("Feishu image download aborted","AbortError"));t?.addEventListener("abort",i,{once:!0});let e=[],a=0;try{for await(let A of n){t?.throwIfAborted();let r=Buffer.from(A);if(a+=r.length,a>o)throw n.destroy?.(),new ut("image-too-large",`Feishu image exceeds ${o} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));e.push(r)}return t?.throwIfAborted(),Buffer.concat(e,a)}finally{t?.removeEventListener("abort",i)}}async function yRe(n,{signal:t}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu file download returned no readable stream");t?.throwIfAborted();let o=()=>n.destroy?.(t.reason??new DOMException("Feishu file download aborted","AbortError"));t?.addEventListener("abort",o,{once:!0});let i=[],e=0;try{for await(let a of n){t?.throwIfAborted();let A=Buffer.from(a);e+=A.length,i.push(A)}return t?.throwIfAborted(),Buffer.concat(i,e)}finally{t?.removeEventListener("abort",o)}}function iP(n){if(!n||typeof n!="object")return null;let t=n.code??n.error?.code;return Number.isSafeInteger(Number(t))?Number(t):null}async function mRe(n,t){if(!n||typeof n[Symbol.asyncIterator]!="function")return null;t?.throwIfAborted();let o=AbortSignal.timeout(ERe),i=t?AbortSignal.any([t,o]):o,e=()=>n.destroy?.(i.reason);i.addEventListener("abort",e,{once:!0});let a=[],A=0;try{for await(let r of n){let s=Buffer.from(r);if(A+=s.length,A>hRe)return n.destroy?.(),null;a.push(s)}return Buffer.concat(a,A).toString("utf8")}catch{return t?.throwIfAborted(),null}finally{i.removeEventListener("abort",e)}}async function SRe(n,t){let o=[n],i=new Set;for(;o.length>0&&i.size<8;){let e=o.shift();if(!e||typeof e!="object"&&typeof e!="function"||i.has(e))continue;i.add(e);let a=iP(e),A=e.response?.data??e.data;if(a===AS)return A?.destroy?.(),a;if(A&&typeof A[Symbol.asyncIterator]=="function"){let r=await mRe(A,t);try{let s=iP(JSON.parse(r));if(s===AS)return s}catch{}}else{let r=iP(A);if(r===AS)return r}o.push(e.cause)}return null}async function wRe(n,t){return await SRe(n,t)!==AS?n:new ut("feishu-image-permission-required","Feishu image download requires the im:message:readonly tenant scope",w(CRe),{cause:n})}function DRe(n,t,o){return{async load({signal:i,maxBytes:e}){i?.throwIfAborted();let a;try{a=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:o},params:{type:"image"}})}catch(r){throw await wRe(r,i)}i?.throwIfAborted();let A=fRe(a?.headers);if(A!==null&&A>e)throw a?.getReadableStream?.().destroy?.(),new ut("image-too-large",`Feishu image declares ${A} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return QRe(a?.getReadableStream?.(),{signal:i,maxBytes:e})}}}function ORe(n,t,o){let i=Ud(o?.file_key);return i?{name:Ud(o?.file_name)??"file",async load({signal:e}={}){e?.throwIfAborted();let a=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:i},params:{type:"file"}});return e?.throwIfAborted(),yRe(a?.getReadableStream?.(),{signal:e})}}:null}function sP(n,t){let o=n?.message?.message_type,i=nP(n),e=uRe(n,i),a=o==="image"?Ud(i?.image_key):null,A=a?[a]:e?.imageKeys??[],r=o==="file"?ORe(n,t,i):null;return{content:o==="text"?Hd(n)??"":e?.text??"",images:A.map(s=>DRe(n,t,s)),files:r?[r]:[]}}function a6(n,t=9e3){if(n.length<=t)return[n];let o=[],i=n;for(;i.length>t;){let e=i.lastIndexOf(` +`,t);ei.value===t);return o>=0?o+1:0}function Su(n){return String(n??"").replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu," ").replace(/\s+/gu," ").trim()||w("\u6682\u65E0\u6807\u9898")}function Yo(n,t){return JSON.stringify({schema:"2.0",header:{title:aS(n),template:"blue"},body:{elements:t}})}function El(){return fs(w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")}function n6(n){let{workspaces:t=[],currentWorkspace:o=null,currentSession:i=null,sessions:e=[],archiveVisible:a=!1,presetCatalog:A=null,modelCatalog:r=null}=n||{},s=i?.id??null,g=i?.title??n?.currentSessionTitle??null,c=(Array.isArray(e)?e:[]).slice(0,20),I=c.length>0,d=Array.isArray(t)&&t.length>0,B=[];B.push({tag:"div",text:Ct(w("**\u8BBE\u7F6E**"))});let f=null;if(I){let k=c.map(z=>({text:{tag:"plain_text",content:`${z.id===s?"\u2713 ":""}${Su(z.title)}`},value:z.id}));f={tag:"select_static",name:"session_pick",placeholder:{tag:"plain_text",content:s?w("\u5207\u6362\u4F1A\u8BDD"):w("\u9009\u62E9\u4F1A\u8BDD\uFF08\u5F53\u524D\u672A\u7ED1\u5B9A\uFF09")},initial_index:Kd(k,s),options:k,behaviors:[{type:"callback",value:{action:"session_pick"}}]}}let Q=null;if(d){let k=t.slice(0,20).map(z=>({text:{tag:"plain_text",content:`${z===o?"\u2713 ":""}${z}`},value:z}));Q={tag:"select_static",name:"workspace_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u5DE5\u4F5C\u533A")},initial_index:Kd(k,o),options:k,behaviors:[{type:"callback",value:{action:"workspace_pick"}}]}}let y=Array.isArray(A?.items)?A.items:[],m=A?._currentId??null,T=m===null,_=null;if(y.length>=1){let k=y.slice(0,30).map(Ae=>({text:{tag:"plain_text",content:`${Ae.id===m?"\u2713 ":""}${Ae.label}`},value:Ae.id})),z=T?tS:m;k.unshift({text:{tag:"plain_text",content:`${T?"\u2713 ":""}${w("\u8DDF\u968F\u9ED8\u8BA4")}`},value:tS}),_={tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u9884\u8BBE")},initial_index:Kd(k,z),options:k,behaviors:[{type:"callback",value:{action:"preset_pick"}}]}}let R=Array.isArray(r?.groups)?r.groups:[],K=r?.current,L=K?`${K.provider}/${K.model}`:null,F=[];for(let k of R)for(let z of k.models||[])F.push({id:`${k.id}/${z.id}`,name:`${k.name} - ${z.name}`});let q=null;if(F.length>1){let k=F.slice(0,30).map(z=>({text:{tag:"plain_text",content:`${z.id===L?"\u2713 ":""}${z.name}`},value:z.id}));q={tag:"select_static",name:"model_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u6A21\u578B")},initial_index:Kd(k,L),options:k,behaviors:[{type:"callback",value:{action:"model_pick"}}]}}function V(k){return{tag:"column",width:"weighted",weight:.1,vertical_align:"center",elements:[{tag:"div",text:{tag:"plain_text",content:k}}]}}function x(k){return{tag:"column",width:"weighted",weight:1,elements:[k]}}let G=[];f&&G.push(f),Q&&G.push(Q),G.length===2?B.push({tag:"column_set",flex_mode:"none",columns:[V("\u{1F4AC}"),x(G[0]),V("\u{1F4C2}"),x(G[1])]}):G[0]&&B.push(G[0]),I||B.push({tag:"div",text:Ct(w("\u5F53\u524D\u5DE5\u4F5C\u533A\u6682\u65E0\u53EF\u7528\u4F1A\u8BDD\u3002"))});let J=[],U=fs(w("\u{1F916} \u5207\u6362\u9884\u8BBE"),"presets"),N=fs(w("\u{1F9E0} \u5207\u6362\u6A21\u578B"),"models");return _?J.push(_):J.push(U),q?J.push(q):J.push(N),B.push({tag:"column_set",flex_mode:"none",columns:[V("\u{1F916}"),x(J[0]),V("\u{1F9E0}"),x(J[1])]}),B.push(hl(w("\u{1F195} \u65B0\u4F1A\u8BDD"),"new",w("\u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8"),"sessions")),!I&&!d&&B.push(fs(w("\u{1F5C2} \u5DE5\u4F5C\u533A\u5217\u8868"),"workspaces")),B.push({tag:"hr"}),B.push({tag:"div",text:Ct(w("**\u4EFB\u52A1\u63A7\u5236**"))}),B.push(hl(w("\u23F9 \u505C\u6B62"),"stop",w("\u{1F4D0} \u538B\u7F29"),"compact")),B.push({tag:"hr"}),B.push({tag:"column_set",flex_mode:"none",columns:[{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:Ct(w("**\u8865\u5145\u6307\u4EE4**"))},{tag:"select_static",name:"steer_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u8865\u5145\u6307\u4EE4")},initial_index:0,options:[...u6.map(k=>({text:{tag:"plain_text",content:w(k)},value:w(k)})),{text:{tag:"plain_text",content:w("\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026")},value:"custom"}],behaviors:[{type:"callback",value:{action:"steer_pick"}}]}]},{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:Ct(w("\u{1F5C4} \u5F52\u6863\uFF1A{state}",{state:a?w("\u5DF2\u663E\u793A"):w("\u5DF2\u9690\u85CF")}))},fs(w("\u5207\u6362\u5F52\u6863\u663E\u793A"),"archive_toggle")]}]}),B.push({tag:"hr"}),B.push(hl(w("\u{1F4CA} \u72B6\u6001"),"status",w("\u{1F4D6} \u5E2E\u52A9"),"help")),B.push({tag:"div",text:Ct(w(`**\u6570\u5B57\u515C\u5E95** **1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD\u5217\u8868 \xB7 **4**\u72B6\u6001 -**5**\u{1F527}\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9`))}),Yo(w("\u{1F916} \u52A9\u624B\u4E2D\u5FC3"),B)}function s6(n){let{items:t,defaultId:o}=n,i=n._currentId,e=t.find(s=>s.id===i),a=t.find(s=>s.id===o),A=i===null?w("\u8DDF\u968F Host \u9ED8\u8BA4{default}",{default:a?`\uFF08${a.label}\uFF09`:""}):e?`${e.label}\uFF08${e.id}\uFF09`:w("{id}\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09",{id:i}),r=[{tag:"div",text:Ct(w("**\u5F53\u524D**\uFF1A{value}",{value:A}))},{tag:"div",text:Ct(w("**Host \u9ED8\u8BA4**\uFF1A{value}",{value:a?`${a.label}\uFF08${a.id}\uFF09`:w("\u672A\u8BBE\u7F6E")}))},{tag:"hr"}];if(t.length>=1){let s=t.map(g=>({text:{tag:"plain_text",content:`${g.label}\uFF08${g.id}\uFF09${g.id===i?" \u2713":""}`},value:g.id}));r.push({tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u9884\u8BBE")},initial_index:i===null?0:Hd(s,i),options:s,behaviors:[{type:"callback",value:{action:"preset_pick"}}]},{tag:"hr"},hl(w("\u{1F504} \u8DDF\u968F\u9ED8\u8BA4"),"preset_default",w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu"))}else r.push({tag:"div",text:Ct(w("\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u9884\u8BBE\u3002"))},El());return Yo(w("\u{1F916} \u9884\u8BBE\u5217\u8868"),r)}function g6(n){let{groups:t,current:o}=n,i=o?`${o.provider}/${o.model}`:null,e=[{tag:"div",text:Ct(w("**\u5F53\u524D\u6A21\u578B**\uFF1A{model}",{model:i||w("\u672A\u8BBE\u7F6E")}))},{tag:"hr"}],a=0;for(let A of t)a+=A.models.length;if(a===0)e.push({tag:"div",text:Ct(w("\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u6A21\u578B\u3002"))},El());else{for(let r of t){let s=r.models.map(g=>{let c=`${r.id}/${g.id}`;return`${c}${c===i?" \u2713":""}`});e.push({tag:"div",text:Ct(`**${r.name}** +**5**\u{1F527}\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9`))}),Yo(w("\u{1F916} \u52A9\u624B\u4E2D\u5FC3"),B)}function s6(n){let{items:t,defaultId:o}=n,i=n._currentId,e=t.find(s=>s.id===i),a=t.find(s=>s.id===o),A=i===null?w("\u8DDF\u968F Host \u9ED8\u8BA4{default}",{default:a?`\uFF08${a.label}\uFF09`:""}):e?`${e.label}\uFF08${e.id}\uFF09`:w("{id}\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09",{id:i}),r=[{tag:"div",text:Ct(w("**\u5F53\u524D**\uFF1A{value}",{value:A}))},{tag:"div",text:Ct(w("**Host \u9ED8\u8BA4**\uFF1A{value}",{value:a?`${a.label}\uFF08${a.id}\uFF09`:w("\u672A\u8BBE\u7F6E")}))},{tag:"hr"}];if(t.length>=1){let s=t.map(g=>({text:{tag:"plain_text",content:`${g.label}\uFF08${g.id}\uFF09${g.id===i?" \u2713":""}`},value:g.id}));r.push({tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u9884\u8BBE")},initial_index:i===null?0:Kd(s,i),options:s,behaviors:[{type:"callback",value:{action:"preset_pick"}}]},{tag:"hr"},hl(w("\u{1F504} \u8DDF\u968F\u9ED8\u8BA4"),"preset_default",w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu"))}else r.push({tag:"div",text:Ct(w("\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u9884\u8BBE\u3002"))},El());return Yo(w("\u{1F916} \u9884\u8BBE\u5217\u8868"),r)}function g6(n){let{groups:t,current:o}=n,i=o?`${o.provider}/${o.model}`:null,e=[{tag:"div",text:Ct(w("**\u5F53\u524D\u6A21\u578B**\uFF1A{model}",{model:i||w("\u672A\u8BBE\u7F6E")}))},{tag:"hr"}],a=0;for(let A of t)a+=A.models.length;if(a===0)e.push({tag:"div",text:Ct(w("\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u6A21\u578B\u3002"))},El());else{for(let r of t){let s=r.models.map(g=>{let c=`${r.id}/${g.id}`;return`${c}${c===i?" \u2713":""}`});e.push({tag:"div",text:Ct(`**${r.name}** ${s.join(` -`)}`)})}let A=[];for(let r of t)for(let s of r.models)A.push({value:`${r.id}/${s.id}`,text:{tag:"plain_text",content:`${r.name} - ${s.name}`}});e.push({tag:"hr"},{tag:"select_static",name:"model_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u6A21\u578B")},initial_index:i===null?0:Hd(A,i),options:A.map(r=>({text:{tag:"plain_text",content:`${r.text.content}${r.value===i?" \u2713":""}`},value:r.value})),behaviors:[{type:"callback",value:{action:"model_pick"}}]},{tag:"hr"},El())}return Yo(w("\u{1F9E0} \u6A21\u578B\u5217\u8868"),e)}function c6(n){let t=[{tag:"div",text:Ct(w("{icon} \u98DE\u4E66\u673A\u5668\u4EBA{state}",{icon:n.connected?"\u2705":"\u274C",state:n.connected?w("\u5DF2\u8FDE\u63A5"):w("\u672A\u8FDE\u63A5")}))},{tag:"div",text:Ct(w("\u{1F4C2} \u5DE5\u4F5C\u533A\uFF1A`{workspace}`",{workspace:n.workspace||w("\u672A\u8BBE\u7F6E")}))},{tag:"div",text:Ct(w("\u{1F916} \u9884\u8BBE\uFF1A{preset}",{preset:n.preset||w("\u672A\u8BBE\u7F6E")}))},{tag:"div",text:Ct(w("\u{1F9E0} \u6A21\u578B\uFF1A{model}",{model:n.model||w("\u672A\u8BBE\u7F6E")}))},{tag:"div",text:Ct(w("\u{1F4AC} \u4F1A\u8BDD\uFF1A{count} \u4E2A",{count:n.sessionCount}))},{tag:"hr"},El()];return Yo(w("\u{1F4CA} \u7CFB\u7EDF\u72B6\u6001"),t)}function I6(){return["\u{1F916} \u52A9\u624B\u83DC\u5355\uFF08\u56DE\u590D\u6570\u5B57\u5373\u53EF\uFF0C\u65E0\u9700\u8BB0\u547D\u4EE4\uFF09","","\u{1F4CB} \u4F1A\u8BDD / \u5DE5\u4F5C\u533A","/sessionlist \u6216 /sessions \u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD","/session ID \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A","/workspace \u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A","/new \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD","","\u{1F4CA} \u72B6\u6001 / \u538B\u7F29","/status \u8FDE\u63A5\u72B6\u6001","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587","/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09","/archived on/off \u4F1A\u8BDD\u5217\u8868\u663E\u793A/\u9690\u85CF\u5F52\u6863","","\u{1F441} \u5173\u6CE8","/watch ID \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09","/watchlist \u5173\u6CE8\u5217\u8868","/unwatch ID \u53D6\u6D88\u5173\u6CE8","","\u{1F916} \u9884\u8BBE / \u6A21\u578B","/presetlist \u6216 /presets \u5217\u51FA\u53EF\u7528 Agent Preset","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4","/models \u5217\u51FA\u6A21\u578B","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B","","\u{1F4E6} \u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09","/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09","/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21","/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21","","\u{1F3AE} \u4EFB\u52A1\u63A7\u5236","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","/steer \u6307\u4EE4 \u7ED9 Agent \u8865\u5145\u6307\u4EE4","/repair \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03"].map(n=>w(n)).join(` +`)}`)})}let A=[];for(let r of t)for(let s of r.models)A.push({value:`${r.id}/${s.id}`,text:{tag:"plain_text",content:`${r.name} - ${s.name}`}});e.push({tag:"hr"},{tag:"select_static",name:"model_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u6A21\u578B")},initial_index:i===null?0:Kd(A,i),options:A.map(r=>({text:{tag:"plain_text",content:`${r.text.content}${r.value===i?" \u2713":""}`},value:r.value})),behaviors:[{type:"callback",value:{action:"model_pick"}}]},{tag:"hr"},El())}return Yo(w("\u{1F9E0} \u6A21\u578B\u5217\u8868"),e)}function c6(n){let t=[{tag:"div",text:Ct(w("{icon} \u98DE\u4E66\u673A\u5668\u4EBA{state}",{icon:n.connected?"\u2705":"\u274C",state:n.connected?w("\u5DF2\u8FDE\u63A5"):w("\u672A\u8FDE\u63A5")}))},{tag:"div",text:Ct(w("\u{1F4C2} \u5DE5\u4F5C\u533A\uFF1A`{workspace}`",{workspace:n.workspace||w("\u672A\u8BBE\u7F6E")}))},{tag:"div",text:Ct(w("\u{1F916} \u9884\u8BBE\uFF1A{preset}",{preset:n.preset||w("\u672A\u8BBE\u7F6E")}))},{tag:"div",text:Ct(w("\u{1F9E0} \u6A21\u578B\uFF1A{model}",{model:n.model||w("\u672A\u8BBE\u7F6E")}))},{tag:"div",text:Ct(w("\u{1F4AC} \u4F1A\u8BDD\uFF1A{count} \u4E2A",{count:n.sessionCount}))},{tag:"hr"},El()];return Yo(w("\u{1F4CA} \u7CFB\u7EDF\u72B6\u6001"),t)}function I6(){return["\u{1F916} \u52A9\u624B\u83DC\u5355\uFF08\u56DE\u590D\u6570\u5B57\u5373\u53EF\uFF0C\u65E0\u9700\u8BB0\u547D\u4EE4\uFF09","","\u{1F4CB} \u4F1A\u8BDD / \u5DE5\u4F5C\u533A","/sessionlist \u6216 /sessions \u5217\u51FA\u5DE5\u4F5C\u533A\u4F1A\u8BDD","/session ID \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A","/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A","/new \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD","","\u{1F4CA} \u72B6\u6001 / \u538B\u7F29","/status \u8FDE\u63A5\u72B6\u6001","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587","/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09","/archived on/off \u4F1A\u8BDD\u5217\u8868\u663E\u793A/\u9690\u85CF\u5F52\u6863","","\u{1F441} \u5173\u6CE8","/watch ID \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09","/watchlist \u5173\u6CE8\u5217\u8868","/unwatch ID \u53D6\u6D88\u5173\u6CE8","","\u{1F916} \u9884\u8BBE / \u6A21\u578B","/presetlist \u6216 /presets \u5217\u51FA\u53EF\u7528 Agent Preset","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4","/models \u5217\u51FA\u6A21\u578B","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B","","\u{1F4E6} \u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09","/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09","/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21","/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21","","\u{1F3AE} \u4EFB\u52A1\u63A7\u5236","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","/steer \u6307\u4EE4 \u7ED9 Agent \u8865\u5145\u6307\u4EE4","/repair \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03"].map(n=>w(n)).join(` `)}var bRe=["**\u{1F4CB} \u5361\u7247\u529F\u80FD**","","1. \u4F1A\u8BDD\u4E0B\u62C9 \u2014 \u5207\u6362\u5F53\u524D\u7ED1\u5B9A\u4F1A\u8BDD","2. \u5DE5\u4F5C\u533A\u4E0B\u62C9 \u2014 \u5207\u6362\u5DE5\u4F5C\u533A","3. \u{1F916} \u9884\u8BBE\u4E0B\u62C9 \u2014 \u5207\u6362 Agent \u9884\u8BBE","4. \u{1F9E0} \u6A21\u578B\u4E0B\u62C9 \u2014 \u5207\u6362\u6A21\u578B","5. \u{1F195} \u65B0\u4F1A\u8BDD \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD","6. \u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8 \u2014 \u67E5\u770B/\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u7BA1\u7406\u5173\u6CE8","7. \u23F9 \u505C\u6B62 \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","8. \u{1F4D0} \u538B\u7F29 \u2014 \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587","9. \u8865\u5145\u6307\u4EE4 \u2014 \u7ED9 Agent \u53D1\u9001\u6307\u4EE4","10. \u{1F5C4} \u5F52\u6863\u5207\u6362 \u2014 \u663E\u793A/\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD","11. \u{1F4CA} \u72B6\u6001 \u2014 \u67E5\u770B\u7CFB\u7EDF\u8FDE\u63A5\u72B6\u6001","12. \u{1F4D6} \u5E2E\u52A9 \u2014 \u67E5\u770B\u672C\u5E2E\u52A9"].join(` -`),MRe=["**\u2328\uFE0F \u6587\u672C\u547D\u4EE4**","","`/m` \u2014 \u6253\u5F00\u83DC\u5355\u5361\u7247","`/new` \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD","`/session ID` \u2014 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD","`/sessionlist [\u5DE5\u4F5C\u533A]` \u6216 `/sessions [\u5DE5\u4F5C\u533A]` \u2014 \u5217\u51FA\u4F1A\u8BDD","`/workspace \u8DEF\u5F84` \u2014 \u5207\u6362\u5DE5\u4F5C\u533A","`/workspacelist` \u2014 \u5217\u51FA\u5DE5\u4F5C\u533A","`/status` \u2014 \u67E5\u770B\u8FDE\u63A5\u72B6\u6001","`/compact` \u2014 \u538B\u7F29\u4E0A\u4E0B\u6587","`/stop` \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","`/steer \u6307\u4EE4` \u2014 \u8865\u5145\u6307\u4EE4","`/watch ID` \u2014 \u5173\u6CE8\u4F1A\u8BDD","`/watchlist` \u2014 \u5173\u6CE8\u5217\u8868","`/unwatch ID` \u2014 \u53D6\u6D88\u5173\u6CE8","`/archived on/off` \u2014 \u5F52\u6863\u663E\u9690","`/presetlist` \u6216 `/presets` \u2014 \u5217\u51FA\u9884\u8BBE","`/preset [\u5E8F\u53F7/ID]` \u2014 \u5207\u6362\u9884\u8BBE","`/preset --default` \u2014 \u8DDF\u968F\u9ED8\u8BA4","`/models` \u2014 \u5217\u51FA\u6A21\u578B","`/reasoninglist` \u6216 `/reasonings` \u2014 \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7","`/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7","`/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B","`/batch` \u2014 \u5F00\u542F\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09","`/send` \u2014 \u63D0\u4EA4\u5F53\u524D\u6279\u6B21","`/cancel` \u2014 \u53D6\u6D88\u5F53\u524D\u6279\u6B21","`/repair` \u2014 \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03"].join(` +`),MRe=["**\u2328\uFE0F \u6587\u672C\u547D\u4EE4**","","`/m` \u2014 \u6253\u5F00\u83DC\u5355\u5361\u7247","`/new` \u2014 \u5F00\u542F\u5168\u65B0\u4F1A\u8BDD","`/session ID` \u2014 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD","`/sessionlist [\u5DE5\u4F5C\u533A]` \u6216 `/sessions [\u5DE5\u4F5C\u533A]` \u2014 \u5217\u51FA\u4F1A\u8BDD","`/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84` \u2014 \u5207\u6362\u5DE5\u4F5C\u533A","`/workspacelist` \u2014 \u5217\u51FA\u5DE5\u4F5C\u533A","`/status` \u2014 \u67E5\u770B\u8FDE\u63A5\u72B6\u6001","`/compact` \u2014 \u538B\u7F29\u4E0A\u4E0B\u6587","`/stop` \u2014 \u505C\u6B62\u5F53\u524D\u4EFB\u52A1","`/steer \u6307\u4EE4` \u2014 \u8865\u5145\u6307\u4EE4","`/watch ID` \u2014 \u5173\u6CE8\u4F1A\u8BDD","`/watchlist` \u2014 \u5173\u6CE8\u5217\u8868","`/unwatch ID` \u2014 \u53D6\u6D88\u5173\u6CE8","`/archived on/off` \u2014 \u5F52\u6863\u663E\u9690","`/presetlist` \u6216 `/presets` \u2014 \u5217\u51FA\u9884\u8BBE","`/preset [\u5E8F\u53F7/ID]` \u2014 \u5207\u6362\u9884\u8BBE","`/preset --default` \u2014 \u8DDF\u968F\u9ED8\u8BA4","`/models` \u2014 \u5217\u51FA\u6A21\u578B","`/reasoninglist` \u6216 `/reasonings` \u2014 \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7","`/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7","`/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID]` \u2014 \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B","`/batch` \u2014 \u5F00\u542F\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09","`/send` \u2014 \u63D0\u4EA4\u5F53\u524D\u6279\u6B21","`/cancel` \u2014 \u53D6\u6D88\u5F53\u524D\u6279\u6B21","`/repair` \u2014 \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03"].join(` `),_Re=["**\u{1F4A1} \u6570\u5B57\u515C\u5E95**","\u56DE\u590D\u6570\u5B57\u5FEB\u901F\u64CD\u4F5C\uFF1A","**1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD/\u5173\u6CE8","**4**\u72B6\u6001 \xB7 **5**\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9"].join(` `);function l6(n=[]){let t=Array.isArray(n)&&n.length>0?` `+n.join(` @@ -347,25 +347,25 @@ ${s.join(` `)+t)},{tag:"hr"},{tag:"div",text:Ct(w(_Re))},{tag:"hr"},El()];return Yo(w("\u{1F4D6} \u5E2E\u52A9"),o)}function p6(n){if(typeof n!="string"||!/^[A-Za-z0-9_-]{16,128}$/.test(n))throw new TypeError("A safe card-action probe nonce is required");return Yo(w("\u{1F9EA} \u9A8C\u8BC1\u5361\u7247\u6309\u94AE"),[{tag:"div",text:Ct(w("\u6388\u6743\u5DF2\u63D0\u4EA4\u3002\u8BF7\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\uFF1B\u673A\u5668\u4EBA\u771F\u5B9E\u6536\u5230\u56DE\u8C03\u540E\u624D\u4F1A\u5224\u5B9A\u4FEE\u590D\u6210\u529F\u3002"))},{tag:"column_set",flex_mode:"none",columns:[{tag:"column",width:"weighted",weight:1,elements:[{tag:"button",text:aS(w("\u5B8C\u6210\u9A8C\u8BC1")),type:"primary",width:"fill",behaviors:[{type:"callback",value:{action:"repair_verify",nonce:n}}]}]}]}])}function d6(n,t,o,i,e=new Set){let a=o*Nc,A=t.slice(a,a+Nc),r=Math.max(1,Math.ceil(i/Nc)),s=I=>typeof e?.has=="function"&&e.has(I),g=(I,d)=>({tag:"column_set",flex_mode:"none",horizontal_spacing:"default",columns:[{tag:"column",width:"90px",vertical_align:"center",elements:[I]},{tag:"column",width:"weighted",weight:1,vertical_align:"center",elements:[d]}]}),c=[{tag:"div",text:Ct(w(`**\u5DE5\u4F5C\u533A**\uFF1A{workspace} \u5171 **{total}** \u4E2A\u4F1A\u8BDD{paging}`,{workspace:`\`${n}\``,total:i,paging:i>Nc?w("\uFF08\u7B2C {page}/{pageCount} \u9875\uFF09",{page:o+1,pageCount:r}):""}))},...A.map((I,d)=>{let B=`${d+1}. ${Su(I.title)}${I.archived===!0?w("\uFF08\u5DF2\u5F52\u6863\uFF09"):""}`,f=s(I.sessionId);return g(rS(f?w("\u2B50 \u53D6\u6D88\u5173\u6CE8"):w("\u2606 \u5173\u6CE8"),f?`unwatch:${I.sessionId}`:`watch:${I.sessionId}`),rS(B,`use:${I.sessionId}`))})];return o>0&&c.push(fs(w("\u25C0 \u4E0A\u4E00\u9875"),`sessions:${o-1}`)),o+1fs(`${e+1}. ${i}${i===t?w("\uFF08\u5F53\u524D\uFF09"):""}`,`workspace:${i}`)),{tag:"hr"},El()];return Yo(w("\u{1F5C2} \u5DE5\u4F5C\u533A"),o)}function TRe(n,t){let o=new Set(n.map(e=>e.sessionId)),i=(Array.isArray(t)?t:[]).filter(e=>e?.sessionId&&!o.has(e.sessionId)).slice(0,30).map(e=>({text:{tag:"plain_text",content:Su(e.title??e.sessionId)},value:e.sessionId}));return i.length===0?null:{tag:"multi_select_static",name:"watch_add",placeholder:{tag:"plain_text",content:w("\u52FE\u9009\u8981\u5173\u6CE8\u7684\u4F1A\u8BDD")},options:i,behaviors:[{type:"callback",value:{action:"watch_add",kind:"multi"}}]}}function NRe(n){let t=n.slice(0,30).map(o=>({text:{tag:"plain_text",content:Su(o.title)},value:o.sessionId}));return t.length===0?null:{tag:"multi_select_static",name:"watch_remove",placeholder:{tag:"plain_text",content:w("\u52FE\u9009\u8981\u53D6\u6D88\u5173\u6CE8\u7684\u4F1A\u8BDD")},options:t,behaviors:[{type:"callback",value:{action:"watch_remove",kind:"multi"}}]}}function E6(n,t){let o=Array.isArray(n)?n:[],i=TRe(o,t),e=NRe(o),a=[];return o.length===0?a.push({tag:"div",text:Ct(w("\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u7ED3\u679C\u3002"))}):a.push({tag:"div",text:Ct(w("\u5F53\u524D\u5173\u6CE8 **{count}** \u4E2A\u4F1A\u8BDD\uFF1A",{count:o.length}))}),i&&a.push({tag:"hr"},{tag:"div",text:Ct(w("**\u2795 \u6DFB\u52A0\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09"))},i),e&&a.push({tag:"hr"},{tag:"div",text:Ct(w("**\u2796 \u53D6\u6D88\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09"))},e),a.push({tag:"hr"},hl(w("\u{1F4CB} \u4F1A\u8BDD\u5217\u8868"),"sessions",w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")),Yo(w("\u{1F441} \u5173\u6CE8\u5217\u8868"),a)}function C6(n,t,o){let i=o==="completed"?w("\u5DF2\u5B8C\u6210"):o==="stopped"?w("\u5DF2\u505C\u6B62"):o==="aborted"?w("\u5DF2\u4E2D\u6B62"):o==="cancelled"?w("\u5DF2\u53D6\u6D88"):w("\u5DF2\u7ED3\u675F");return Yo(w("\u2705 \u4EFB\u52A1\u5B8C\u6210"),[{tag:"div",text:Ct(`**${Su(t)}** \`${n}\``)},{tag:"div",text:Ct(w("**\u72B6\u6001**\uFF1A{reason}",{reason:i}))},{tag:"hr"},hl(w("\u{1F4CB} \u4F1A\u8BDD\u5217\u8868"),"sessions",w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu"),{tag:"div",text:Ct(w("\u7ED1\u5B9A\u8BE5\u4F1A\u8BDD\u540E\u53EF\u7EE7\u7EED\u8FFD\u95EE\uFF0C\u8F93\u5165\u6587\u5B57\u5373\u53EF\u3002"))}])}var u6=["\u7EE7\u7EED","\u52A0\u901F\u8FD0\u884C","\u603B\u7ED3\u5F53\u524D\u8FDB\u5C55","\u66F4\u7B80\u6D01\u4E9B","\u66F4\u8BE6\u7EC6\u4E9B"],wu="__steer_custom__";function B6({hasSession:n}){let t=n?w("\u4ECE\u4E0B\u65B9\u4E0B\u62C9\u9009\u62E9\u8865\u5145\u6307\u4EE4\uFF1B\u6700\u540E\u4E00\u9879\u53EF\u81EA\u5B9A\u4E49\u8F93\u5165\u3002"):w("\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u518D\u8865\u5145\u6307\u4EE4\u3002"),o=u6.map(e=>({text:{tag:"plain_text",content:w(e)},value:w(e)}));o.push({text:{tag:"plain_text",content:w("\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026")},value:wu});let i=[{tag:"div",text:Ct(t)},{tag:"hr"},{tag:"select_static",name:"steer_quick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u8865\u5145\u6307\u4EE4")},initial_index:0,options:o,behaviors:[{type:"callback",value:{action:"steer",source:"quick"}}]},{tag:"hr"},fs(w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")];return Yo(w("\u2795 \u8865\u5145\u6307\u4EE4"),i)}function gP(){let n=[{tag:"div",text:Ct(w("\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u70B9\u300C\u63D0\u4EA4\u300D\uFF0C\u53D1\u9001\u7ED9\u5F53\u524D\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"))},{tag:"hr"},{tag:"form",name:"steer_form",elements:[{tag:"input",name:"steer_text",placeholder:{tag:"plain_text",content:w("\u8F93\u5165\u4F60\u7684\u8865\u5145\u6307\u4EE4")}},{tag:"button",name:"steer_submit",text:{tag:"plain_text",content:w("\u63D0\u4EA4")},type:"primary",width:"fill",form_action_type:"submit",behaviors:[{type:"callback",value:{action:"steer",source:"form"}}]}]},{tag:"hr"},fs(w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")];return Yo(w("\u2795 \u81EA\u5B9A\u4E49\u6307\u4EE4"),n)}import{mkdir as RRe,readFile as kRe,rename as vRe,writeFile as PRe}from"node:fs/promises";import{dirname as GRe}from"node:path";var FRe=Object.freeze({version:1,sessions:{},seenMessageIds:[],watches:{},includeArchivedSessions:!1}),oS=20;function cP(n){return n&&typeof n=="object"&&typeof n.sessionId=="string"&&n.sessionId.length>0&&typeof n.chatId=="string"&&n.chatId.length>0}var iS=class{#e;#A=structuredClone(FRe);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=JSON.parse(await kRe(this.#e,"utf8"));this.#A={version:1,sessions:t.sessions&&typeof t.sessions=="object"?t.sessions:{},seenMessageIds:Array.isArray(t.seenMessageIds)?t.seenMessageIds.slice(-1e3):[],watches:t.watches&&typeof t.watches=="object"?t.watches:{},includeArchivedSessions:typeof t.includeArchivedSessions=="boolean"?t.includeArchivedSessions:!1}}catch(t){if(t?.code!=="ENOENT")throw t;await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}watchEntries(t){let o=this.#A.watches[t];return Array.isArray(o)?o.filter(cP):[]}watchEntry(t,o){return this.watchEntries(t).find(i=>i.sessionId===o)??null}async setWatch(t,o){let i=this.#A.watches[t]??[],e=i.findIndex(a=>a.sessionId===o.sessionId);e===-1?(i.length>=oS&&i.shift(),i.push(o)):i[e]=o,this.#A.watches[t]=i,await this.#r()}async removeWatch(t,o){let i=this.#A.watches[t]??[];this.#A.watches[t]=i.filter(e=>e.sessionId!==o),await this.#r()}async clearWatches(t){delete this.#A.watches[t],await this.#r()}keysWatching(t){return Object.entries(this.#A.watches).filter(([,o])=>Array.isArray(o)&&o.some(i=>cP(i)&&i.sessionId===t)).map(([o])=>o)}watchedSessionIds(){let t=new Set;for(let o of Object.values(this.#A.watches))if(Array.isArray(o))for(let i of o)cP(i)&&t.add(i.sessionId);return[...t]}includesArchivedSessions(){return this.#A.includeArchivedSessions===!0}async setIncludeArchivedSessions(t){this.#A.includeArchivedSessions=t===!0,await this.#r()}async#r(){let t=JSON.stringify(this.#A,null,2)+` -`;this.#t=this.#t.then(async()=>{await RRe(GRe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await PRe(o,t,{encoding:"utf8",mode:384}),await vRe(o,this.#e)}),await this.#t}};var Rc=Object.freeze({MENTION:"mention",ALL:"all"});function Io(n){return n===Rc.ALL?Rc.ALL:Rc.MENTION}function nS(n){return n===Rc.MENTION||n===Rc.ALL}var sS=()=>w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),URe=30*6e4,w6=/^\/m(?:enu)?$/i,D6=/^\/repair(?:\s|$)/i,HRe=/^\/repair(?:\s+(qr|status|cancel|verify))?\s*$/i,lP=/^\/watch(?:\s+([^\s]+))?$/i,pP=/^\/unwatch(?:\s+([^\s]+))?$/i,O6=/^\/watchlist$/i,KRe=/^\/(?:sessionlist|sessions)(?:\s|$)/i,xRe=/^\/workspacelist$/i,f6=/^\d{1,2}$/,YRe=10*6e4,jRe=50,JRe=8,qRe=8,zRe=10*6e4,Q6=400,VRe=10*6e4,WRe=100,ZRe=50,XRe=500,$Re=5e3,eke=5e3,Ake=15e3,tke=1e3,b6=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]),IP=new Set([...b6,"saving"]),gS=new Set(["succeeded","expired","cancelled","error"]),rke=new Set(["accounts.feishu.cn","open.feishu.cn","accounts.larksuite.com","open.larksuite.com"]),dP=/^\/archived(?:\s+(on|off))?$/i,ake=/^\/(?:m(?:enu)?|new|help|status|compact|(?:sessionlist|sessions)(?:\s|$)|workspacelist|watchlist|archived(?:\s+(on|off))?)$/i;function ike(n,{hasImages:t=!1,hasFiles:o=!1}={}){if(t||o||typeof n!="string")return!1;let i=n.trim();return w6.test(i)||D6.test(i)||lP.test(i)||pP.test(i)||O6.test(i)||dP.test(i)}var oke=["/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"];function Du(n){switch(n?.code){case"workspace-not-absolute":return w("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");case"workspace-not-found":return w("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002");case"workspace-not-directory":return w("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");case"workspace-bot-not-found":return w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u64CD\u4F5C\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002");default:return w("\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}}function nke(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11\u98DE\u4E66\u6587\u4EF6\u4E0A\u4F20\u6743\u9650 im:resource\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u5B8C\u6210\u98DE\u4E66\u8981\u6C42\u7684\u53D1\u5E03\u5BA1\u6279\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u98DE\u4E66 30 MB \u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u98DE\u4E66\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u98DE\u4E66\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function cS(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):n}function lA(n){return typeof n=="string"&&n.trim()?n.trim():null}function y6(n){if(n&&typeof n=="object"&&!Array.isArray(n))return n;if(typeof n!="string"||!n.trim())return{};try{let t=JSON.parse(n);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function bu(n){if(n==null)return null;if(Array.isArray(n)){for(let o of n){let i=bu(o);if(i!==null)return i}return null}if(n&&typeof n=="object")return"value"in n?bu(n.value):"option"in n?bu(n.option):null;if(typeof n!="string")return null;let t=n.trim();if(!t)return null;if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return bu(o)}catch{}return t}function _g(n){if(n==null)return[];if(Array.isArray(n))return n.flatMap(o=>_g(o));if(n&&typeof n=="object")return"value"in n?_g(n.value):"option"in n?_g(n.option):[];if(typeof n!="string")return[];let t=n.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return _g(o)}catch{}return t.split(",").map(o=>o.trim()).filter(Boolean)}function bn(n){return Number.isSafeInteger(n)&&n>=-1}function Mu(n){return Number.isSafeInteger(n)&&n>=0}function lS(n){return Number.isSafeInteger(n?.watchStartedAt)&&n.watchStartedAt>=0?n.watchStartedAt:null}function IS(n){return n&&(lS(n)!==null||!bn(n.lastSeq))}function ske(n){return(Array.isArray(n?.events)?n.events:[]).map(t=>t?.event??t).filter(t=>t&&typeof t=="object"&&Mu(t.seq)).sort((t,o)=>t.seq-o.seq)}function Kd(n){return lA(n?.sender?.sender_id?.open_id)??lA(n?.sender?.sender_id?.user_id)}function gke(n){return lA(n?.sender?.sender_id?.open_id)}function m6(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(a,n);e.unref?.();function a(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))}t?.addEventListener("abort",A,{once:!0})})}function Ou(n,{botId:t}={}){let o=n&&typeof n=="object"?n:{},i=o.registration&&typeof o.registration=="object"?o.registration:o,e=lA(i.operation)??lA(o.operation);if(e&&e!=="callback_repair")throw new Error("The active Feishu operation is not a callback repair");let a=lA(i.botId)??lA(o.botId);if(t&&a&&a!==t)throw new Error("The Feishu repair belongs to another bot");let A=lA(i.state),r=i.attemptId??i.attempt,s=typeof r=="string"||Number.isFinite(r)?String(r):null;if(!A||!s)throw new Error("Feishu returned an invalid repair status");let g=lA(i.verificationUrl)??lA(i.qrCodeUrl),c=Number(i.expiresAt),I=Number(i.remainingSeconds),d=Number(i.pollIntervalMs)||Number(i.pollIntervalSeconds)*1e3;return{state:A,attemptId:s,botId:a,verificationUrl:g,expiresAt:Number.isFinite(c)?c:null,remainingSeconds:Number.isFinite(I)?I:null,pollIntervalMs:Number.isFinite(d)&&d>0?d:null,error:i.error&&typeof i.error=="object"?{code:lA(i.error.code),message:lA(i.error.message)}:null}}function S6(n,t){let o=new URL(n);if(o.protocol!=="https:"||!rke.has(o.hostname))throw new Error("Feishu returned an untrusted repair URL");if(o.searchParams.get("tp")!=="sdk"||o.searchParams.get("clientID")!==t||o.searchParams.has("createOnly"))throw new Error("Feishu returned an invalid existing-app repair URL");if(o.toString().includes("{{client_id}}")||o.toString().includes("%7B%7Bclient_id%7D%7D"))throw new Error("Feishu returned an unresolved client id placeholder");return o.toString()}function cke(n,t){return t.needsPresentation!==!0&&t.questions[t.index]&&Kd(n)===t.actor&&n?.message?.message_type==="text"&&lA(Ud(n))}function Ike(n){for(let t of["messagesReceived","messagesReplied","messagesRejected"])n[t]??=0;n.lastMessageAt??=null,n.lastReplyAt??=null,n.lastRejectedAt??=null,n.lastError??=null,n.lastMessageError??=null}var pS=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Ti;#n=new Map;#s=new Map;#p=new Map;#c=new Map;#g=new Set;#I=new Set;#d=new Set;#h=new Map;#C=new Map;#u=new Map;#B=new Map;#f=new Map;#Q=new Map;#S=new Map;#y=new Map;#m=new Map;#D;#E;#N;#T;#O;#w;#R;#_;#G;#k;#F;#P=null;#H=0;#U;#L;#v=new Map;#K=new Map;#q=null;#W=new Map;#z=new Map;#M=new Map;#j=new Map;#ee;constructor({client:t,channel:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,status:r,allowedSenderOpenIds:s=new Set,botId:g,appId:c,botOpenId:I,groupResponseMode:d=Rc.ALL,repair:B,repairPollIntervalMs:f=tke,repairLinkWaitMs:Q=Ake,cardDataTimeoutMs:y=eke,replyTimeoutMs:m=6e5,logger:T=console,signal:_}){if(!t||!i||!e||!r)throw new TypeError("Feishu bridge dependencies are required");if(B!=null){if(!B||typeof B.start!="function"||typeof B.status!="function"||typeof B.cancel!="function")throw new TypeError("Feishu repair capability requires start/status/cancel");if(!lA(g)||!lA(c))throw new TypeError("Feishu repair capability requires botId and appId")}if(!Number.isFinite(f)||f<=0||!Number.isFinite(Q)||Q<=0||!Number.isFinite(y)||y<=0)throw new TypeError("Feishu timing values must be positive numbers");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#E=r,this.#N=s,this.#R=lA(g),this.#_=lA(c),this.#G=lA(I),this.#k=Io(d),this.#F=B??null,this.#U=f,this.#L=Q,this.#ee=y,this.#T=m,this.#O=T,this.#D=new Di({label:"Feishu",logger:T}),this.#w=_,Ike(this.#E),typeof this.#t?.watchHarnessEvents=="function"&&queueMicrotask(()=>this.#ke())}setGroupResponseMode(t){this.#k=Io(t)}#ie(t){if(t?.message?.chat_type==="p2p")return!0;let o=Array.isArray(t?.message?.mentions)?t.message.mentions:[];return this.#G?o.some(i=>i?.id?.open_id===this.#G||i?.open_id===this.#G):o.length>0}accept(t){if(this.#w?.aborted)return Promise.resolve();let o=lA(t?.message?.message_id);if(!o||i6(t))return Promise.resolve();if(!this.#o&&!o6(t,this.#N))return this.#E.messagesRejected+=1,this.#E.lastRejectedAt=new Date().toISOString(),this.#O.warn?.("[dsh-feishu] ignored a message from a sender outside the legacy allowlist"),Promise.resolve();let i=this.#ie(t);if(t?.message?.chat_type!=="p2p"&&this.#k===Rc.MENTION&&!i||this.#r.hasSeen(o)||this.#c.has(o))return Promise.resolve();let e;try{e=r6(t)}catch{return this.#E.messagesRejected+=1,this.#E.lastRejectedAt=new Date().toISOString(),Promise.resolve()}let a=sP(t,this.#e),A=lA(a.content)??"",r=Tt(a),s=wt(a),g=t.message.chat_type==="p2p"?"direct":t.message.chat_type==="group"?"group":null,c=Ba(this.#o,{conversationType:g,senderIds:Kd(t),text:A,hasImages:r,hasFiles:s,isCommand:MQ(A,{hasImages:r,hasFiles:s})||ike(A,{hasImages:r,hasFiles:s})||!r&&!s&&f6.test(A)&&this.#v.has(e)});if(!c.allowed)return this.#c.set(o,null),this.#te(t,o,c);if(t.message.chat_type==="p2p"){let T=lA(t.message.chat_id);T&&So(this.#r,{chatId:T})}this.#c.set(o,Aa(this.#l,g));let I=this.#BA(o),d=t.message.message_type==="text"?lA(Ud(t))??"":"",B=t.message.message_type==="text"&&Ni(d),f=this.#n.get(e),Q=this.#a.status(e);if(B&&t.message.chat_type!=="p2p")return this.#Z(t,o,I,{message:es()});if(t.message.chat_type==="p2p"&&(B||Q.phase==="collecting")){let _=/^\/batch$/iu.test(d)&&Q.phase==="idle"&&(this.#i.has(e)||f||this.#D.hasPending(e))?{handled:!0,kind:"busy",message:No()}:this.#a.handle(e,d,{plainText:t.message.message_type==="text"&&!!d});if(_.handled){if(_.kind==="submit"){let R={...t,batchSubmission:{token:_.token},message:{...t.message,message_type:"text",content:JSON.stringify({text:_.prompt}),mentions:[]}};return this.#Y(R,o,e,I)}return this.#Z(t,o,I,_)}}if(ake.test(A))return Promise.resolve().then(()=>this.#be(t,e,{alreadyRecorded:!1})).then(()=>this.#Ae(o,I,"DONE")).catch(_=>this.#re(t,o,I,_)).finally(()=>this.#c.delete(o));let y=Fa(A)?Ao:wt(a)?null:ni(A)?Mi:si(A)?to:gi(A)?_i:null;if(y&&(i||y===Ao)){let T=this.#He(t,o,e,a,y),_;return _=T.then(()=>this.#Ae(o,I,"DONE")).catch(R=>this.#re(t,o,I,R)).finally(()=>{this.#c.delete(o),this.#I.delete(_)}),this.#I.add(_),_}if(this.#Se(t,e))return Promise.resolve().then(()=>this.#we(t,o)).then(()=>this.#Ae(o,I,"DONE")).catch(_=>this.#re(t,o,I,_)).finally(()=>this.#c.delete(o));let m=this.#D.claimReply({key:e,actor:Kd(t),messageId:o,text:Ud(t)??"",addressed:i,hasPendingQuestion:!!f,questionCompletion:f?.submitting||f?.claimedReplyMessageId?f.queue:null,isQuestionPending:()=>this.#n.has(e),send:T=>this.#b(t.message.chat_id,T,{replyTo:t.message.message_id})});if(m){let T=m.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,!0)),_;return _=T.then(()=>this.#Ae(o,I,"DONE")).catch(R=>this.#re(t,o,I,R)).finally(()=>{this.#c.delete(o),this.#g.delete(_)}),this.#g.add(_),_}if(f&&Kd(t)!==f.actor)return this.#Y(t,o,e,I);if(f?.submitting||f?.claimedReplyMessageId)return this.#Y(t,o,e,I);if(f){cke(t,f)&&(f.claimedReplyMessageId=o);let _=(f.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#hA(t,o,e,f,I));f.queue=_;let R=()=>{f.claimedReplyMessageId===o&&(f.claimedReplyMessageId=null),f.queue===_&&(f.queue=null)},K;return K=_.then(()=>(R(),this.#Ae(o,I,"DONE")),L=>(R(),this.#re(t,o,I,L))).finally(()=>{R(),this.#c.delete(o),this.#g.delete(K)}),this.#g.add(K),K}return this.#Y(t,o,e,I)}#Z(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,e?.message&&await this.#b(t.message.chat_id,e.message,{replyTo:t.message.message_id}),this.#E.lastError=null)}).then(()=>this.#Ae(o,i,"DONE")).catch(A=>this.#re(t,o,i,A)).finally(()=>{this.#c.delete(o),this.#I.delete(a)}),this.#I.add(a),a}#te(t,o,i){let e;return e=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),i.reason==="command-not-allowed"?(this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,await this.#b(t.message.chat_id,w(ao),{replyTo:t.message.message_id}),this.#E.messagesReplied+=1,this.#E.lastReplyAt=new Date().toISOString()):(this.#E.messagesRejected+=1,this.#E.lastRejectedAt=new Date().toISOString()),this.#E.lastError=null)}).catch(a=>{this.#w?.aborted||(this.#E.lastError=a?.message??String(a),this.#O.warn?.("[dsh-feishu] failed to apply inbound access policy"))}).finally(()=>{this.#c.delete(o),this.#I.delete(e)}),this.#I.add(e),e}#Y(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1,finalize:r=!0}={}){let g=(this.#i.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#be(t,i,{alreadyRecorded:A})),c=r?g.then(async d=>(await this.#Ae(o,e,"DONE"),d)).catch(d=>this.#re(t,o,e,d)):g,I;return I=c.finally(()=>{a&&this.#c.delete(o),this.#i.get(i)===I&&this.#i.delete(i)}),this.#i.set(i,I),I}#J(t,{logLabel:o="operation",logLevel:i="warn",userMessage:e,reason:a}={}){this.#E.lastError=t?.message??String(t);let A=At(this.#E,t,{userMessage:e,reason:a});return this.#O?.[i]?.(`[dsh-feishu] ${o} failed [${A.referenceId}]:`,t?.message??String(t)),A}async#x(t,o,i={}){let e=this.#J(o,i),a=i.appendMessage?`${dt(e)} +`;this.#t=this.#t.then(async()=>{await RRe(GRe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await PRe(o,t,{encoding:"utf8",mode:384}),await vRe(o,this.#e)}),await this.#t}};var Rc=Object.freeze({MENTION:"mention",ALL:"all"});function Io(n){return n===Rc.ALL?Rc.ALL:Rc.MENTION}function nS(n){return n===Rc.MENTION||n===Rc.ALL}var sS=()=>w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),URe=30*6e4,w6=/^\/m(?:enu)?$/i,D6=/^\/repair(?:\s|$)/i,HRe=/^\/repair(?:\s+(qr|status|cancel|verify))?\s*$/i,lP=/^\/watch(?:\s+([^\s]+))?$/i,pP=/^\/unwatch(?:\s+([^\s]+))?$/i,O6=/^\/watchlist$/i,KRe=/^\/(?:sessionlist|sessions)(?:\s|$)/i,xRe=/^\/workspacelist$/i,f6=/^\d{1,2}$/,YRe=10*6e4,jRe=50,JRe=8,qRe=8,zRe=10*6e4,Q6=400,VRe=10*6e4,WRe=100,ZRe=50,XRe=500,$Re=5e3,eke=5e3,Ake=15e3,tke=1e3,b6=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]),IP=new Set([...b6,"saving"]),gS=new Set(["succeeded","expired","cancelled","error"]),rke=new Set(["accounts.feishu.cn","open.feishu.cn","accounts.larksuite.com","open.larksuite.com"]),dP=/^\/archived(?:\s+(on|off))?$/i,ake=/^\/(?:m(?:enu)?|new|help|status|compact|(?:sessionlist|sessions)(?:\s|$)|workspacelist|watchlist|archived(?:\s+(on|off))?)$/i;function ike(n,{hasImages:t=!1,hasFiles:o=!1}={}){if(t||o||typeof n!="string")return!1;let i=n.trim();return w6.test(i)||D6.test(i)||lP.test(i)||pP.test(i)||O6.test(i)||dP.test(i)}var oke=["/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A","/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"];function Du(n){switch(n?.code){case"workspace-not-absolute":return w("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");case"workspace-not-found":return w("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002");case"workspace-not-directory":return w("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");case"workspace-bot-not-found":return w("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u64CD\u4F5C\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002");default:return w("\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}}function nke(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11\u98DE\u4E66\u6587\u4EF6\u4E0A\u4F20\u6743\u9650 im:resource\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u5B8C\u6210\u98DE\u4E66\u8981\u6C42\u7684\u53D1\u5E03\u5BA1\u6279\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u98DE\u4E66 30 MB \u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u98DE\u4E66\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u98DE\u4E66\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function cS(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):n}function lA(n){return typeof n=="string"&&n.trim()?n.trim():null}function y6(n){if(n&&typeof n=="object"&&!Array.isArray(n))return n;if(typeof n!="string"||!n.trim())return{};try{let t=JSON.parse(n);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function bu(n){if(n==null)return null;if(Array.isArray(n)){for(let o of n){let i=bu(o);if(i!==null)return i}return null}if(n&&typeof n=="object")return"value"in n?bu(n.value):"option"in n?bu(n.option):null;if(typeof n!="string")return null;let t=n.trim();if(!t)return null;if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return bu(o)}catch{}return t}function _g(n){if(n==null)return[];if(Array.isArray(n))return n.flatMap(o=>_g(o));if(n&&typeof n=="object")return"value"in n?_g(n.value):"option"in n?_g(n.option):[];if(typeof n!="string")return[];let t=n.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return _g(o)}catch{}return t.split(",").map(o=>o.trim()).filter(Boolean)}function bn(n){return Number.isSafeInteger(n)&&n>=-1}function Mu(n){return Number.isSafeInteger(n)&&n>=0}function lS(n){return Number.isSafeInteger(n?.watchStartedAt)&&n.watchStartedAt>=0?n.watchStartedAt:null}function IS(n){return n&&(lS(n)!==null||!bn(n.lastSeq))}function ske(n){return(Array.isArray(n?.events)?n.events:[]).map(t=>t?.event??t).filter(t=>t&&typeof t=="object"&&Mu(t.seq)).sort((t,o)=>t.seq-o.seq)}function xd(n){return lA(n?.sender?.sender_id?.open_id)??lA(n?.sender?.sender_id?.user_id)}function gke(n){return lA(n?.sender?.sender_id?.open_id)}function m6(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(a,n);e.unref?.();function a(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))}t?.addEventListener("abort",A,{once:!0})})}function Ou(n,{botId:t}={}){let o=n&&typeof n=="object"?n:{},i=o.registration&&typeof o.registration=="object"?o.registration:o,e=lA(i.operation)??lA(o.operation);if(e&&e!=="callback_repair")throw new Error("The active Feishu operation is not a callback repair");let a=lA(i.botId)??lA(o.botId);if(t&&a&&a!==t)throw new Error("The Feishu repair belongs to another bot");let A=lA(i.state),r=i.attemptId??i.attempt,s=typeof r=="string"||Number.isFinite(r)?String(r):null;if(!A||!s)throw new Error("Feishu returned an invalid repair status");let g=lA(i.verificationUrl)??lA(i.qrCodeUrl),c=Number(i.expiresAt),I=Number(i.remainingSeconds),d=Number(i.pollIntervalMs)||Number(i.pollIntervalSeconds)*1e3;return{state:A,attemptId:s,botId:a,verificationUrl:g,expiresAt:Number.isFinite(c)?c:null,remainingSeconds:Number.isFinite(I)?I:null,pollIntervalMs:Number.isFinite(d)&&d>0?d:null,error:i.error&&typeof i.error=="object"?{code:lA(i.error.code),message:lA(i.error.message)}:null}}function S6(n,t){let o=new URL(n);if(o.protocol!=="https:"||!rke.has(o.hostname))throw new Error("Feishu returned an untrusted repair URL");if(o.searchParams.get("tp")!=="sdk"||o.searchParams.get("clientID")!==t||o.searchParams.has("createOnly"))throw new Error("Feishu returned an invalid existing-app repair URL");if(o.toString().includes("{{client_id}}")||o.toString().includes("%7B%7Bclient_id%7D%7D"))throw new Error("Feishu returned an unresolved client id placeholder");return o.toString()}function cke(n,t){return t.needsPresentation!==!0&&t.questions[t.index]&&xd(n)===t.actor&&n?.message?.message_type==="text"&&lA(Hd(n))}function Ike(n){for(let t of["messagesReceived","messagesReplied","messagesRejected"])n[t]??=0;n.lastMessageAt??=null,n.lastReplyAt??=null,n.lastRejectedAt??=null,n.lastError??=null,n.lastMessageError??=null}var pS=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Ti;#n=new Map;#s=new Map;#p=new Map;#c=new Map;#g=new Set;#I=new Set;#d=new Set;#h=new Map;#C=new Map;#u=new Map;#B=new Map;#f=new Map;#Q=new Map;#S=new Map;#y=new Map;#m=new Map;#D;#E;#N;#T;#O;#w;#R;#_;#G;#k;#F;#P=null;#H=0;#U;#L;#v=new Map;#K=new Map;#q=null;#W=new Map;#z=new Map;#M=new Map;#j=new Map;#ee;constructor({client:t,channel:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,status:r,allowedSenderOpenIds:s=new Set,botId:g,appId:c,botOpenId:I,groupResponseMode:d=Rc.ALL,repair:B,repairPollIntervalMs:f=tke,repairLinkWaitMs:Q=Ake,cardDataTimeoutMs:y=eke,replyTimeoutMs:m=6e5,logger:T=console,signal:_}){if(!t||!i||!e||!r)throw new TypeError("Feishu bridge dependencies are required");if(B!=null){if(!B||typeof B.start!="function"||typeof B.status!="function"||typeof B.cancel!="function")throw new TypeError("Feishu repair capability requires start/status/cancel");if(!lA(g)||!lA(c))throw new TypeError("Feishu repair capability requires botId and appId")}if(!Number.isFinite(f)||f<=0||!Number.isFinite(Q)||Q<=0||!Number.isFinite(y)||y<=0)throw new TypeError("Feishu timing values must be positive numbers");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#E=r,this.#N=s,this.#R=lA(g),this.#_=lA(c),this.#G=lA(I),this.#k=Io(d),this.#F=B??null,this.#U=f,this.#L=Q,this.#ee=y,this.#T=m,this.#O=T,this.#D=new Di({label:"Feishu",logger:T}),this.#w=_,Ike(this.#E),typeof this.#t?.watchHarnessEvents=="function"&&queueMicrotask(()=>this.#ke())}setGroupResponseMode(t){this.#k=Io(t)}#ie(t){if(t?.message?.chat_type==="p2p")return!0;let o=Array.isArray(t?.message?.mentions)?t.message.mentions:[];return this.#G?o.some(i=>i?.id?.open_id===this.#G||i?.open_id===this.#G):o.length>0}accept(t){if(this.#w?.aborted)return Promise.resolve();let o=lA(t?.message?.message_id);if(!o||i6(t))return Promise.resolve();if(!this.#o&&!o6(t,this.#N))return this.#E.messagesRejected+=1,this.#E.lastRejectedAt=new Date().toISOString(),this.#O.warn?.("[dsh-feishu] ignored a message from a sender outside the legacy allowlist"),Promise.resolve();let i=this.#ie(t);if(t?.message?.chat_type!=="p2p"&&this.#k===Rc.MENTION&&!i||this.#r.hasSeen(o)||this.#c.has(o))return Promise.resolve();let e;try{e=r6(t)}catch{return this.#E.messagesRejected+=1,this.#E.lastRejectedAt=new Date().toISOString(),Promise.resolve()}let a=sP(t,this.#e),A=lA(a.content)??"",r=Tt(a),s=wt(a),g=t.message.chat_type==="p2p"?"direct":t.message.chat_type==="group"?"group":null,c=Ba(this.#o,{conversationType:g,senderIds:xd(t),text:A,hasImages:r,hasFiles:s,isCommand:MQ(A,{hasImages:r,hasFiles:s})||ike(A,{hasImages:r,hasFiles:s})||!r&&!s&&f6.test(A)&&this.#v.has(e)});if(!c.allowed)return this.#c.set(o,null),this.#te(t,o,c);if(t.message.chat_type==="p2p"){let T=lA(t.message.chat_id);T&&So(this.#r,{chatId:T})}this.#c.set(o,Aa(this.#l,g));let I=this.#BA(o),d=t.message.message_type==="text"?lA(Hd(t))??"":"",B=t.message.message_type==="text"&&Ni(d),f=this.#n.get(e),Q=this.#a.status(e);if(B&&t.message.chat_type!=="p2p")return this.#Z(t,o,I,{message:es()});if(t.message.chat_type==="p2p"&&(B||Q.phase==="collecting")){let _=/^\/batch$/iu.test(d)&&Q.phase==="idle"&&(this.#i.has(e)||f||this.#D.hasPending(e))?{handled:!0,kind:"busy",message:No()}:this.#a.handle(e,d,{plainText:t.message.message_type==="text"&&!!d});if(_.handled){if(_.kind==="submit"){let R={...t,batchSubmission:{token:_.token},message:{...t.message,message_type:"text",content:JSON.stringify({text:_.prompt}),mentions:[]}};return this.#Y(R,o,e,I)}return this.#Z(t,o,I,_)}}if(ake.test(A))return Promise.resolve().then(()=>this.#be(t,e,{alreadyRecorded:!1})).then(()=>this.#Ae(o,I,"DONE")).catch(_=>this.#re(t,o,I,_)).finally(()=>this.#c.delete(o));let y=Fa(A)?Ao:wt(a)?null:ni(A)?Mi:si(A)?to:gi(A)?_i:null;if(y&&(i||y===Ao)){let T=this.#He(t,o,e,a,y),_;return _=T.then(()=>this.#Ae(o,I,"DONE")).catch(R=>this.#re(t,o,I,R)).finally(()=>{this.#c.delete(o),this.#I.delete(_)}),this.#I.add(_),_}if(this.#Se(t,e))return Promise.resolve().then(()=>this.#we(t,o)).then(()=>this.#Ae(o,I,"DONE")).catch(_=>this.#re(t,o,I,_)).finally(()=>this.#c.delete(o));let m=this.#D.claimReply({key:e,actor:xd(t),messageId:o,text:Hd(t)??"",addressed:i,hasPendingQuestion:!!f,questionCompletion:f?.submitting||f?.claimedReplyMessageId?f.queue:null,isQuestionPending:()=>this.#n.has(e),send:T=>this.#b(t.message.chat_id,T,{replyTo:t.message.message_id})});if(m){let T=m.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,!0)),_;return _=T.then(()=>this.#Ae(o,I,"DONE")).catch(R=>this.#re(t,o,I,R)).finally(()=>{this.#c.delete(o),this.#g.delete(_)}),this.#g.add(_),_}if(f&&xd(t)!==f.actor)return this.#Y(t,o,e,I);if(f?.submitting||f?.claimedReplyMessageId)return this.#Y(t,o,e,I);if(f){cke(t,f)&&(f.claimedReplyMessageId=o);let _=(f.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#hA(t,o,e,f,I));f.queue=_;let R=()=>{f.claimedReplyMessageId===o&&(f.claimedReplyMessageId=null),f.queue===_&&(f.queue=null)},K;return K=_.then(()=>(R(),this.#Ae(o,I,"DONE")),L=>(R(),this.#re(t,o,I,L))).finally(()=>{R(),this.#c.delete(o),this.#g.delete(K)}),this.#g.add(K),K}return this.#Y(t,o,e,I)}#Z(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,e?.message&&await this.#b(t.message.chat_id,e.message,{replyTo:t.message.message_id}),this.#E.lastError=null)}).then(()=>this.#Ae(o,i,"DONE")).catch(A=>this.#re(t,o,i,A)).finally(()=>{this.#c.delete(o),this.#I.delete(a)}),this.#I.add(a),a}#te(t,o,i){let e;return e=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),i.reason==="command-not-allowed"?(this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,await this.#b(t.message.chat_id,w(ao),{replyTo:t.message.message_id}),this.#E.messagesReplied+=1,this.#E.lastReplyAt=new Date().toISOString()):(this.#E.messagesRejected+=1,this.#E.lastRejectedAt=new Date().toISOString()),this.#E.lastError=null)}).catch(a=>{this.#w?.aborted||(this.#E.lastError=a?.message??String(a),this.#O.warn?.("[dsh-feishu] failed to apply inbound access policy"))}).finally(()=>{this.#c.delete(o),this.#I.delete(e)}),this.#I.add(e),e}#Y(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1,finalize:r=!0}={}){let g=(this.#i.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#be(t,i,{alreadyRecorded:A})),c=r?g.then(async d=>(await this.#Ae(o,e,"DONE"),d)).catch(d=>this.#re(t,o,e,d)):g,I;return I=c.finally(()=>{a&&this.#c.delete(o),this.#i.get(i)===I&&this.#i.delete(i)}),this.#i.set(i,I),I}#J(t,{logLabel:o="operation",logLevel:i="warn",userMessage:e,reason:a}={}){this.#E.lastError=t?.message??String(t);let A=At(this.#E,t,{userMessage:e,reason:a});return this.#O?.[i]?.(`[dsh-feishu] ${o} failed [${A.referenceId}]:`,t?.message??String(t)),A}async#x(t,o,i={}){let e=this.#J(o,i),a=i.appendMessage?`${dt(e)} ${i.appendMessage}`:dt(e);return await this.#b(t,a,{replyTo:i.replyTo}).catch(()=>{}),e}async#re(t,o,i,e){if(e?.code==="turn-stopped"){await this.#Ue(o,i),e?.batchInputMessage&&await this.#b(t.message.chat_id,e.batchInputMessage,{replyTo:t.message.message_id}).catch(()=>{});return}if(this.#w?.aborted){await this.#Ue(o,i);return}let a=ko(e)??bo(e),A=this.#J(e,{logLabel:"message handling",logLevel:"error",userMessage:a,reason:eo(e)?.reason});await this.#Ae(o,i,"ERROR");let r=e?.batchInputMessage?`${dt(A)} ${e.batchInputMessage}`:dt(A);await this.#b(t.message.chat_id,r,{replyTo:t.message.message_id}).catch(()=>{})}async waitForIdle(){for(;;){let t=[...this.#i.values(),...[...this.#n.values()].flatMap(o=>o.queue?[o.queue]:[]),...this.#g,...this.#I,...this.#d,...this.#W.values(),...[...this.#z.values()].map(o=>o.promise)];if(t.length===0||(await Promise.allSettled(t),this.#i.size===0&&this.#g.size===0&&this.#I.size===0&&this.#d.size===0&&this.#W.size===0&&this.#z.size===0&&![...this.#n.values()].some(o=>o.queue)))return}}#$(){let t=AbortSignal.timeout(this.#ee);return this.#w?AbortSignal.any([this.#w,t]):t}#oe(t){return this.#n.has(t)||this.#D.hasPending(t)}async#He(t,o,i,e,a){if(this.#w?.throwIfAborted(),this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1;let A=await a(lA(e.content)??"",this.#t,this.#r,i,{signal:this.#w,isDirect:t.message.chat_type==="p2p",hasImages:Tt(e),hasFiles:wt(e),pendingInteraction:this.#oe(i),control:{owner:this,key:i}});A?.stopped&&await Promise.allSettled([this.#Oe(i),this.#D.closeRoute(i)]);for(let r of A?.messages??[A?.message])r&&await this.#b(t.message.chat_id,r,{replyTo:t.message.message_id});this.#E.lastError=null}async#be(t,o,{alreadyRecorded:i=!1}={}){this.#w?.throwIfAborted();let e=t.message.message_id;if(!i){if(this.#r.hasSeen(e))return;await this.#r.markSeen(e),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1}let a=sP(t,this.#e),A=a.content,r=Tt(a),s=wt(a),g=!r&&!s&&A?A.trim():null;if(!A&&!r&&!s){await this.#b(t.message.chat_id,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002"),{replyTo:t.message.message_id});return}if(g!==null&&D6.test(g)){await this.#Me(t,g);return}if(g==="/help"){await this.#b(t.message.chat_id,I6(),{replyTo:t.message.message_id});return}if(w6.test(g)){await this.#X(o,t.message.chat_id,{replyTo:t.message.message_id});return}if(g==="/new"){if(this.#i.has(o)||this.#oe(o)){await this.#b(t.message.chat_id,w("\u5F53\u524D\u4EFB\u52A1\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u5148\u505C\u6B62\u4EFB\u52A1\u6216\u7B49\u5F85\u4EFB\u52A1\u5B8C\u6210\u540E\u518D\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002"),{replyTo:t.message.message_id});return}await this.#r.clearSession(o),await this.#b(t.message.chat_id,w("\u5DF2\u5F00\u542F\u5168\u65B0 Harness \u4F1A\u8BDD\u3002"),{replyTo:t.message.message_id}),await this.#X(o,t.message.chat_id,{replyTo:t.message.message_id});return}if(g==="/status"){await this.#AA(o,t.message.chat_id,t.message.message_id);return}if(g==="/compact"){let f=await bi(g,this.#t,this.#r,o,{signal:this.#w});f&&await this.#b(t.message.chat_id,f.message,{replyTo:t.message.message_id});return}if(KRe.test(g)){let f=g.replace(/^\/(?:sessionlist|sessions)/i,"").trim()||null;await this.#le({chatId:t.message.chat_id,key:o,replyTo:t.message.message_id},f,0);return}if(xRe.test(g)){await this.#Ne({chatId:t.message.chat_id,key:o,replyTo:t.message.message_id});return}if(lP.test(g)){let f=(lP.exec(g)?.[1]??"").trim()||null;await this.#Be(o,t.message.chat_id,f,{replyTo:t.message.message_id});return}if(pP.test(g)){let f=(pP.exec(g)?.[1]??"").trim()||null;await this.#fe(o,t.message.chat_id,f,{replyTo:t.message.message_id});return}if(O6.test(g)){await this.#Qe(o,t.message.chat_id,{replyTo:t.message.message_id});return}if(dP.test(g)){let Q=dP.exec(g)[1]?.toLowerCase();if(Q!=="on"&&Q!=="off"){await this.#b(t.message.chat_id,w("\u7528\u6CD5\uFF1A/archived on\uFF08\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\uFF09\u6216 /archived off\uFF08\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\uFF09"),{replyTo:t.message.message_id});return}typeof this.#r?.setIncludeArchivedSessions=="function"&&await this.#r.setIncludeArchivedSessions(Q==="on"),await this.#b(t.message.chat_id,Q==="on"?w("\u5DF2\u5F00\u542F\uFF1A\u4F1A\u8BDD\u5217\u8868\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\u3002"):w("\u5DF2\u5173\u95ED\uFF1A\u4F1A\u8BDD\u5217\u8868\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\u3002"),{replyTo:t.message.message_id});return}if(f6.test(g)){let f=this.#Ve(o);if(f){await this.#We(f,Number(g),{chatId:t.message.chat_id,key:o,event:t});return}}let c=g===null?null:await Mo(A,this.#t,o);if(c){for(let f of c.messages??[c.message])await this.#b(t.message.chat_id,f,{replyTo:t.message.message_id});return}let I=g===null?null:await bi(g,this.#t,this.#r,o,{signal:this.#w});if(I){await this.#b(t.message.chat_id,I.message,{replyTo:t.message.message_id});return}this.#O.info?.(`[dsh-feishu] processing ${t.message.chat_type} message ${e}`);let d=t.batchSubmission??null,B=!1;try{let{receipt:f,artifactSendErrors:Q,textDeliveryErrors:y=0}=await this.#dA(t,o,a,{onAskComplete:d?()=>{B=this.#a.complete(o,d.token).completed}:void 0});return this.#E.messagesReplied+=1,this.#E.lastReplyAt=new Date().toISOString(),this.#E.lastError=null,y===0&&Q===0&&wo(this.#E),f}catch(f){if(d&&!B){if(f?.code==="turn-stopped")throw this.#a.complete(o,d.token),f;let Q=this.#a.fail(o,d.token);if(Q.retained){let y=new Error(f?.message??String(f),{cause:f});throw y.code=f?.code,y.providerCode=f?.providerCode,y.method=f?.method,Number.isInteger(f?.status)&&(y.status=f.status),y.batchInputMessage=Q.message,y}}throw f}finally{await this.#Oe(o),await this.#D.closeRoute(o)}}async#Me(t,o){if(t?.message?.chat_type!=="p2p"){await this.#b(t.message.chat_id,w("\u4E3A\u907F\u514D\u6388\u6743\u94FE\u63A5\u66B4\u9732\uFF0C\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u53D1\u9001 /repair\u3002"));return}let i=gke(t);if(!i){await this.#b(t.message.chat_id,w("\u65E0\u6CD5\u8BC6\u522B\u5F53\u524D\u53D1\u9001\u8005\uFF0C\u672A\u53D1\u8D77\u4FEE\u590D\u3002"));return}if(!this.#F){await this.#b(t.message.chat_id,w("\u5F53\u524D Host \u7248\u672C\u6682\u4E0D\u652F\u6301\u804A\u5929\u5185\u4FEE\u590D\uFF0C\u8BF7\u5148\u66F4\u65B0\u63D2\u4EF6\u3002"));return}let e=HRe.exec(o);if(!e){await this.#b(t.message.chat_id,w("\u7528\u6CD5\uFF1A/repair\u3001/repair qr\u3001/repair status\u3001/repair cancel \u6216 /repair verify"));return}let a=e[1]?.toLowerCase()??"start",A=t.message.chat_id;if(a==="start"){await this.#Ke({actorOpenId:i,chatId:A});return}let r=this.#P;if(!r){await this.#b(A,w("\u5F53\u524D Runtime \u6CA1\u6709\u53EF\u6062\u590D\u7684\u4FEE\u590D\u4EFB\u52A1\u8BB0\u5F55\uFF08\u673A\u5668\u4EBA\u53EF\u80FD\u521A\u5B8C\u6210\u5BC6\u94A5\u66F4\u65B0\u5E76\u91CD\u542F\uFF09\u3002\u672C\u547D\u4EE4\u4E0D\u4F1A\u542F\u52A8\u65B0\u7684\u6388\u6743\uFF1B\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u53D1\u9001\u7684\u9A8C\u8BC1\u7ED3\u679C\uFF0C\u786E\u8BA4\u4E0A\u4E00\u6B21\u4EFB\u52A1\u5DF2\u7ED3\u675F\u540E\u518D\u53D1\u9001 /repair\u3002"));return}if(r.actorOpenId!==i){await this.#b(A,w("\u53E6\u4E00\u4F4D\u7528\u6237\u6B63\u5728\u4FEE\u590D\u8BE5\u673A\u5668\u4EBA\uFF0C\u672C\u6B21\u4E0D\u4F1A\u663E\u793A\u5176\u6388\u6743\u4FE1\u606F\u3002"));return}if(a==="cancel"){let g;try{let c=await this.#F.cancel(this.#Ie(r));g=Ou(c,{botId:this.#R}),r.snapshot=g}catch{await this.#b(A,w("\u6682\u65F6\u65E0\u6CD5\u53D6\u6D88\u4FEE\u590D\u4EFB\u52A1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"));return}g.state==="cancelled"&&(r.stopped=!0,this.#H+=1),await this.#b(A,this.#ae(g));return}let s;try{s=await this.#he(r)}catch{await this.#b(A,w("\u6682\u65F6\u65E0\u6CD5\u67E5\u8BE2\u4FEE\u590D\u72B6\u6001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"));return}if(a==="qr"){if(!IP.has(s.state)||!r.verificationUrl){await this.#b(A,this.#ae(s,{verificationFocused:!0}));return}await this.#Je(A,r.verificationUrl,s);return}await this.#b(A,this.#ae(s,{verificationFocused:a==="verify"}))}#Ie(t){return{botId:this.#R,attemptId:t.attemptId,actorOpenId:t.actorOpenId,chatId:t.chatId}}async#Ke({actorOpenId:t,chatId:o}){let i=this.#P,e=!1;if(i&&IP.has(i.snapshot.state)){if(i.actorOpenId!==t){await this.#b(o,w("\u53E6\u4E00\u4F4D\u7528\u6237\u6B63\u5728\u4FEE\u590D\u8BE5\u673A\u5668\u4EBA\uFF0C\u672C\u6B21\u4E0D\u4F1A\u663E\u793A\u5176\u6388\u6743\u4FE1\u606F\u3002"));return}let r;try{r=await this.#he(i)}catch{await this.#b(o,w("\u6682\u65F6\u65E0\u6CD5\u67E5\u8BE2\u4FEE\u590D\u72B6\u6001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"));return}if(r.state==="saving"){await this.#b(o,this.#ae(r));return}if(b6.has(r.state)){let s;try{s=Ou(await this.#F.cancel(this.#Ie(i)),{botId:this.#R}),i.snapshot=s}catch{await this.#b(o,w("\u6682\u65F6\u65E0\u6CD5\u53D6\u6D88\u65E7\u4FEE\u590D\u4EFB\u52A1\uFF0C\u672A\u751F\u6210\u65B0\u94FE\u63A5\uFF1B\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"));return}if(!gS.has(s.state)){await this.#b(o,this.#ae(s));return}i.stopped=!0,this.#H+=1,e=s.state==="cancelled"}else gS.has(r.state)&&(i.stopped=!0,this.#H+=1)}let a;try{a=Ou(await this.#F.start({botId:this.#R,actorOpenId:t,chatId:o}),{botId:this.#R}),a=await this.#xe(a,{actorOpenId:t,chatId:o})}catch{await this.#b(o,w("\u4FEE\u590D\u6D41\u7A0B\u6682\u65F6\u5931\u8D25\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u8BF7\u7A0D\u540E\u53D1\u9001 /repair \u91CD\u8BD5\u3002"));return}let A={attemptId:a.attemptId,actorOpenId:t,chatId:o,snapshot:a,verificationUrl:null,stopped:!1,announcedSaving:!1,announcedTerminal:!1};if(this.#P=A,a.verificationUrl)try{A.verificationUrl=S6(a.verificationUrl,this.#_)}catch{A.stopped=!0,await this.#F.cancel(this.#Ie(A)).catch(()=>{}),await this.#b(o,w("\u98DE\u4E66\u8FD4\u56DE\u4E86\u65E0\u6CD5\u5B89\u5168\u9A8C\u8BC1\u7684\u6388\u6743\u94FE\u63A5\uFF0C\u5DF2\u4E2D\u6B62\u672C\u6B21\u4FEE\u590D\u3002"));return}if(gS.has(a.state)){A.announcedTerminal=!0,a.state!=="succeeded"&&await this.#b(o,this.#ae(a));return}if(!A.verificationUrl){A.stopped=!0,await this.#b(o,w("\u98DE\u4E66\u672A\u8FD4\u56DE\u6388\u6743\u94FE\u63A5\uFF0C\u5DF2\u4E2D\u6B62\u672C\u6B21\u4FEE\u590D\u3002"));return}await this.#je(o,A.verificationUrl,a,{restarted:e}),this.#Ye(A)}async#xe(t,o){let i=t,e=Date.now()+this.#L;for(;!i.verificationUrl&&IP.has(i.state);){if(Date.now()>=e)throw new Error("Feishu repair link timed out");await m6(Math.min(100,this.#U),this.#w),i=Ou(await this.#F.status({botId:this.#R,attemptId:i.attemptId,actorOpenId:o.actorOpenId,chatId:o.chatId}),{botId:this.#R})}return i}async#he(t){let o=Ou(await this.#F.status(this.#Ie(t)),{botId:this.#R});if(o.attemptId!==t.attemptId)throw new Error("Feishu repair attempt changed unexpectedly");return t.snapshot=o,o.verificationUrl&&(t.verificationUrl=S6(o.verificationUrl,this.#_)),o}#Ye(t){let o=++this.#H;(async()=>{for(;!t.stopped&&this.#P===t&&this.#H===o&&!this.#w?.aborted;){let i=Math.max(250,Math.min(1e4,t.snapshot.pollIntervalMs??this.#U));if(await m6(i,this.#w),t.stopped||this.#P!==t||this.#H!==o)return;let e=await this.#he(t);if(e.state==="saving"&&!t.announcedSaving&&(t.announcedSaving=!0,await this.#b(t.chatId,w("\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u53D1\u9001\u5E76\u7B49\u5F85\u6D4B\u8BD5\u6309\u94AE\u56DE\u8C03\uFF1B\u6536\u5230\u771F\u5B9E\u56DE\u8C03\u540E\u624D\u4F1A\u5B8C\u6210\u3002"))),gS.has(e.state)){t.stopped=!0,e.state!=="succeeded"&&!t.announcedTerminal&&(t.announcedTerminal=!0,await this.#b(t.chatId,this.#ae(e)));return}}})().catch(async()=>{this.#w?.aborted||t.stopped||this.#P!==t||(t.stopped=!0,this.#O.warn?.("[dsh-feishu] callback repair status monitoring failed"),await this.#b(t.chatId,w("\u4FEE\u590D\u72B6\u6001\u67E5\u8BE2\u4E2D\u65AD\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u53D1\u9001 /repair status \u91CD\u8BD5\u67E5\u8BE2\u3002")).catch(()=>{}))})}async#je(t,o,i,{restarted:e=!1}={}){let a=i.remainingSeconds??(i.expiresAt?Math.max(0,Math.ceil((i.expiresAt-Date.now())/1e3)):null),A=a===null?w("\u94FE\u63A5\u4E3A\u77ED\u671F\u6709\u6548"):w("\u94FE\u63A5\u7EA6 {minutes} \u5206\u949F\u540E\u8FC7\u671F",{minutes:Math.max(1,Math.ceil(a/60))});await this.#b(t,[e?w("\u65E7\u6388\u6743\u94FE\u63A5\u5DF2\u4F5C\u5E9F\uFF0C\u5DF2\u751F\u6210\u65B0\u7684\u4FEE\u590D\u94FE\u63A5\u3002"):w("\u{1F527} \u51C6\u5907\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002"),w("\u672C\u6B21\u4F1A\u589E\u91CF\u6DFB\u52A0\u5F53\u524D\u7F3A\u5C11\u9879\uFF1A\u5361\u7247\u56DE\u8C03 card.action.trigger\uFF1B\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\u7684\u79DF\u6237\u6743\u9650 im:message:readonly\uFF08\u7528\u4E8E\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u4E2D\u7684\u56FE\u7247\u6216\u6587\u4EF6\uFF09\uFF1Bim:resource\uFF08\u7528\u4E8E\u4E0A\u4F20\u673A\u5668\u4EBA\u53D1\u9001\u7684\u56FE\u7247\u6216\u6587\u4EF6\uFF09\uFF1B\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\u3002\u786E\u8BA4\u9875\u53EA\u4F1A\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u7684\u9879\uFF1B\u82E5\u51FA\u73B0\u4E0A\u8FF0\u8303\u56F4\u4E4B\u5916\u7684\u914D\u7F6E\uFF0C\u8BF7\u53D6\u6D88\u3002"),"",w("\u5F53\u524D\u8BBE\u5907\u76F4\u63A5\u6253\u5F00\uFF1A"),o,"",w("\u82E5\u8981\u7528\u53E6\u4E00\u53F0\u8BBE\u5907\u626B\u7801\uFF0C\u53D1\u9001 /repair qr\u3002{expiry}\u3002",{expiry:A})].join(` `))}async#Je(t,o,i){try{let e=await LRe.toBuffer(o,{errorCorrectionLevel:"M",margin:1,width:480,type:"png"}),a=await this.#e.im.v1.image.create({data:{image_type:"message",image:e}}),A=lA(a?.image_key)??lA(a?.data?.image_key);if(!A)throw new Error("Feishu QR upload returned no image key");let r=i.remainingSeconds??(i.expiresAt?Math.max(0,Math.ceil((i.expiresAt-Date.now())/1e3)):null),s=r===null?"":w("\uFF08\u5269\u4F59\u7EA6 {minutes} \u5206\u949F\uFF09",{minutes:Math.max(1,Math.ceil(r/60))});await this.#b(t,w("\u8BF7\u7528\u53E6\u4E00\u53F0\u8BBE\u5907\u626B\u7801\u5B8C\u6210\u6388\u6743{remaining}\u3002",{remaining:s}));let g=await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"image",content:JSON.stringify({image_key:A})}});if(g?.code&&g.code!==0)throw new Error("Feishu QR message send failed")}catch{await this.#b(t,w(`\u4E8C\u7EF4\u7801\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\uFF0C\u8BF7\u76F4\u63A5\u6253\u5F00\u6388\u6743\u94FE\u63A5\uFF1A {url}`,{url:o}))}}#ae(t,{verificationFocused:o=!1}={}){if(t.state==="succeeded")return w("\u2705 \u4FEE\u590D\u5B8C\u6210\uFF1A\u5DF2\u5B9E\u6D4B\u6536\u5230 card.action.trigger\uFF0C\u83DC\u5355\u6309\u94AE\u73B0\u5728\u53EF\u7528\u3002");if(t.state==="expired"||t.error?.code==="expired_token")return w("\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF1B\u5E73\u53F0\u672A\u8FD4\u56DE\u6210\u529F\u7ED3\u679C\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5DF2\u4FEE\u590D\u3002\u53D1\u9001 /repair \u751F\u6210\u65B0\u94FE\u63A5\u3002");if(t.state==="cancelled"||t.error?.code==="abort")return w("\u5DF2\u53D6\u6D88\u672C\u6B21\u4FEE\u590D\u6388\u6743\uFF0C\u672A\u786E\u8BA4\u5B8C\u6210\u4FEE\u590D\u3002");if(t.error?.code==="access_denied")return w("\u4F60\u5DF2\u53D6\u6D88\u6216\u62D2\u7EDD\u6388\u6743\uFF0C\u6CA1\u6709\u786E\u8BA4\u4FEE\u590D\uFF1B\u53D1\u9001 /repair \u53EF\u91CD\u8BD5\u3002");if(t.error?.code==="card_action_probe_timeout"||t.error?.code==="card-action-probe-timeout")return w("\u6388\u6743\u5DF2\u63D0\u4EA4\uFF0C\u4F46\u672A\u6536\u5230\u6D4B\u8BD5\u6309\u94AE\u56DE\u8C03\u3002\u53EF\u80FD\u5C1A\u672A\u70B9\u51FB\u6216\u914D\u7F6E\u4ECD\u5728\u4F20\u64AD\uFF1B\u7A0D\u540E\u53D1\u9001 /repair verify \u67E5\u8BE2\uFF0C\u4E0D\u8981\u76F2\u76EE\u91CD\u590D\u6388\u6743\u3002");if(t.state==="error")return w("\u4FEE\u590D\u6D41\u7A0B\u6682\u65F6\u5931\u8D25\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u53D1\u9001 /repair \u53EF\u91CD\u8BD5\u3002");if(t.state==="saving")return w("\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u7B49\u5F85\u4E13\u7528\u6D4B\u8BD5\u6309\u94AE\u7684\u771F\u5B9E\u56DE\u8C03\uFF1B\u56DE\u8C03\u5230\u8FBE\u524D\u4E0D\u4F1A\u5BA3\u544A\u6210\u529F\u3002");if(o)return w("\u6388\u6743\u5C1A\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u4E0D\u80FD\u9A8C\u8BC1\u5361\u7247\u6309\u94AE\u3002\u8BF7\u5148\u6253\u5F00\u6388\u6743\u94FE\u63A5\u5E76\u786E\u8BA4\u3002");let i=t.remainingSeconds===null?"":w("\uFF0C\u5269\u4F59\u7EA6 {minutes} \u5206\u949F",{minutes:Math.max(1,Math.ceil(t.remainingSeconds/60))});return w("\u4FEE\u590D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u6388\u6743{remaining}\u3002\u53D1\u9001 /repair qr \u53EF\u83B7\u53D6\u4E8C\u7EF4\u7801\uFF0C/repair cancel \u53EF\u53D6\u6D88\u3002",{remaining:i})}onCardAction(t){let o=lA(t?.operator?.open_id)??lA(t?.operator?.user_id)??lA(t?.operator?.operator_id?.open_id)??lA(t?.operator?.operator_id?.user_id)??lA(t?.open_id)??lA(t?.user_id);if(!o)return Promise.resolve();if(!this.#o&&!this.#N.has("*")&&!this.#N.has(o))return this.#O.warn?.("[dsh-feishu] ignoring card action from an unallowed legacy sender"),Promise.resolve();let i=y6(t?.action?.value),e=y6(t?.action?.form_value),a=lA(i.action)??lA(t?.action?.action);if(!a)return Promise.resolve();let A=bu(t?.action?.option)??(a.endsWith("_pick")?_g(t?.action?.options)[0]:null),r=[...new Set([..._g(i.options),..._g(t?.action?.options),..._g(e[a]),...a==="watch_add"||a==="watch_remove"?_g(t?.action?.option):[]])],s=a==="workspace_pick"&&typeof A=="string"?`workspace:${A}`:a==="session_pick"&&typeof A=="string"?`use:${A}`:a==="preset_pick"&&typeof A=="string"?`preset:select:${A}`:a==="model_pick"&&typeof A=="string"?`model:select:${A}`:a==="archive_pick"&&typeof A=="string"?`archive:${A}`:a==="steer_pick"&&typeof A=="string"?`steer:${A}`:a,g=lA(t?.context?.open_message_id)??lA(t?.open_message_id)??lA(t?.message_id),c=g?this.#K.get(g):null;if(!c){if(this.#o)return Promise.resolve();let L=lA(t?.context?.open_chat_id)??lA(t?.open_chat_id)??lA(t?.chat_id);return L&&this.#b(L,w("\u8FD9\u4E2A\u83DC\u5355\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u56DE\u590D /m \u91CD\u65B0\u6253\u5F00\u3002"),{replyTo:g}).catch(()=>{}),Promise.resolve()}let I=c.key.startsWith("p2p:")?"direct":c.key.startsWith("group:")?"group":null,d=Ba(this.#o,{conversationType:I,senderIds:o,isCommand:!0});if(!d.allowed)return d.reason==="command-not-allowed"?this.#b(c.chatId,w(ao)).catch(()=>{}):(this.#O.warn?.("[dsh-feishu] ignoring card action blocked by access policy"),Promise.resolve());this.#K.delete(g),this.#K.set(g,c);let B={...c,messageId:g,selections:r,operatorOpenId:o},f=lA(i.source),Q=lA(e.steer_text),y=lA(t?.event_id)??lA(t?.header?.event_id)??lA(t?.uuid)??lA(t?.header?.uuid),m=JSON.stringify({messageId:g,resolvedAction:s,option:A,multiValues:r,source:f,formText:Q}),T=s==="stop",_=s.startsWith("steer:")?s.slice(6):null,K=a==="steer"&&f==="quick"&&A!==null&&A!==wu||a==="steer"&&f==="form"&&Q!==null||_!==null&&_!==""&&!(_==="custom"||_===wu);return this.#ze(B,m,async()=>{if(a==="steer"){if(f==="quick"&&A){if(A===wu){await this.#V(B.chatId,gP(),{key:B.key,updateMessageId:B.messageId});return}await this.#Ce(B,A);return}if(f==="form"){if(Q){await this.#Ce(B,Q);return}await this.#b(B.chatId,w("\u8BF7\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u518D\u63D0\u4EA4\u3002"),{replyTo:B.messageId??null});return}}await this.#ne(s,B)},{lane:T||K?"control":"regular",coalesceStop:T,eventId:y,operatorOpenId:o})}#_e(t=Date.now()){for(let[o,i]of this.#y)i<=t&&this.#y.delete(o);for(;this.#y.size>Q6;){let o=this.#y.keys().next().value;if(o===void 0)break;this.#y.delete(o)}}#Te(t,o=Date.now()){t&&(this.#y.delete(t),this.#y.set(t,o+zRe),this.#_e(o))}#qe(t){let o=t.key,i=Date.now(),e=this.#m.get(o);if(e?.task||e&&i-e.at<$Re)return e?.task??Promise.resolve();this.#O.warn?.("[dsh-feishu] card action queue is full; dropping callbacks");let a;for(a=this.#b(t.chatId,w("\u64CD\u4F5C\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002"),{replyTo:t.messageId??null}).catch(()=>{}).finally(()=>{this.#d.delete(a);let A=this.#m.get(o);A?.task===a&&this.#m.set(o,{at:A.at,task:null})}),this.#m.delete(o),this.#m.set(o,{at:i,task:a}),this.#d.add(a);this.#m.size>200;){let A=this.#m.keys().next().value;if(A===void 0)break;this.#m.delete(A)}return a}#ze(t,o,i,{lane:e="regular",coalesceStop:a=!1,eventId:A=null,operatorOpenId:r=null}={}){let s=t.key,g=A?`${s}\0${r??""}\0event:${A}`:null,c=g??`${s}\0${r??""}\0action:${o}`,I=Date.now();if(this.#_e(I),g&&(this.#y.get(g)??0)>I)return Promise.resolve();let d=this.#f.get(c);if(d)return d;if(a){let L=this.#Q.get(s);if(L){if(g)for(this.#S.delete(g),this.#S.set(g,L);this.#S.size>Q6;){let F=this.#S.keys().next().value;if(F===void 0)break;this.#S.delete(F)}return L}}let B=e==="control",f=B?this.#C:this.#h,Q=B?this.#B:this.#u,y=B?qRe:JRe,m=Q.get(s)??0,T=a?y+1:y;if(m>=T)return this.#qe(t);let _=f.get(s)??Promise.resolve();Q.set(s,m+1);let R,K=!1;return R=_.catch(()=>{}).then(async()=>{this.#w?.throwIfAborted(),K=!0,await i()}).catch(async L=>{this.#w?.aborted||await this.#x(t.chatId,L,{logLabel:"card action",replyTo:t.messageId})}).finally(()=>{if(this.#f.get(c)===R&&this.#f.delete(c),K&&g&&this.#Te(g),a&&this.#Q.get(s)===R&&this.#Q.delete(s),a){let F=Date.now();for(let[q,V]of this.#S)V===R&&(this.#S.delete(q),this.#Te(q,F))}f.get(s)===R&&f.delete(s);let L=(Q.get(s)??1)-1;L>0?Q.set(s,L):Q.delete(s),this.#d.delete(R)}),this.#f.set(c,R),a&&this.#Q.set(s,R),this.#d.add(R),f.set(s,R),R}async#ne(t,{chatId:o,key:i,messageId:e=null,sessionWorkspace:a=null,sessionPage:A=0,selections:r=[]}){let s=g=>this.#b(o,g,{replyTo:e});if(t==="sessions"||/^sessions:\d+$/.test(t)){let g=t==="sessions"?0:Number(t.slice(9));await this.#le({chatId:o,key:i,replyTo:e},a,g,{updateMessageId:e});return}if(t==="workspaces"){await this.#Ne({chatId:o,key:i,replyTo:e},{updateMessageId:e});return}if(t==="watchlist"){await this.#Qe(i,o,{updateMessageId:e,replyTo:e});return}if(t==="watch_add"||t==="watch_remove"){if(r.length===0){await s(w("\u8BF7\u5148\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u4F1A\u8BDD\u3002"));return}let g=0,c=0;if(t==="watch_add"){let d=new Map;try{d=await this.#IA(a)}catch(B){this.#O.warn?.("[dsh-feishu] batch watch validation failed:",B.message)}for(let B of r){let f=d.get(B);if(!f){c+=1;continue}let Q=await this.#Be(i,o,B,{notify:!1,validatedTarget:f,replyTo:e});Q.changed?g+=1:Q.ok||(c+=1)}}else for(let d of r){let B=await this.#fe(i,o,d,{notify:!1});B.changed?g+=1:B.ok||(c+=1)}let I=g>0&&c>0?t==="watch_add"?w("\u5DF2\u6279\u91CF\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u53E6\u6709 {failed} \u4E2A\u672A\u6210\u529F\u3002",{count:g,failed:c}):w("\u5DF2\u53D6\u6D88\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u53E6\u6709 {failed} \u4E2A\u672A\u6210\u529F\u3002",{count:g,failed:c}):g>0?t==="watch_add"?w("\u5DF2\u6279\u91CF\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:g}):w("\u5DF2\u53D6\u6D88\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:g}):c>0?w("\u6240\u9009\u4F1A\u8BDD\u5747\u672A\u5904\u7406\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="watch_add"?w("\u6240\u9009\u4F1A\u8BDD\u5DF2\u5728\u5173\u6CE8\u5217\u8868\u4E2D\u3002"):w("\u6240\u9009\u4F1A\u8BDD\u5DF2\u4E0D\u5728\u5173\u6CE8\u5217\u8868\u4E2D\u3002");try{await this.#Qe(i,o,{updateMessageId:e,replyTo:e})}catch(d){this.#O.warn?.("[dsh-feishu] watch list refresh failed:",d.message)}await s(I).catch(d=>{this.#O.warn?.("[dsh-feishu] watch batch summary failed:",d.message)});return}if(t==="new"){if(this.#i.has(i)||this.#oe(i)){await s(w("\u5F53\u524D\u4EFB\u52A1\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u5148\u505C\u6B62\u4EFB\u52A1\u6216\u7B49\u5F85\u4EFB\u52A1\u5B8C\u6210\u540E\u518D\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002"));return}await this.#r.clearSession(i),await s(w("\u5DF2\u5F00\u542F\u5168\u65B0 Harness \u4F1A\u8BDD\u3002")),await this.#X(i,o,{updateMessageId:e,replyTo:e});return}if(t==="use:current"){let g=this.#r.sessionFor(i);if(typeof g!="string"||!g){await s(w("\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u4ECE\u4F1A\u8BDD\u5217\u8868\u9009\u62E9\u3002"));return}await s(w("\u5DF2\u5C31\u7EEA\uFF0C\u76F4\u63A5\u53D1\u6D88\u606F\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"));return}if(t==="archive_toggle"||t==="archive:on"||t==="archive:off"){let g=t==="archive:on"?!0:t==="archive:off"?!1:!(this.#r?.includesArchivedSessions?.()??!1);await this.#r?.setIncludeArchivedSessions?.(g),await s(g?w("\u5DF2\u5F00\u542F\uFF1A\u4F1A\u8BDD\u5217\u8868\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\u3002"):w("\u5DF2\u5173\u95ED\uFF1A\u4F1A\u8BDD\u5217\u8868\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\u3002")),await this.#X(i,o,{updateMessageId:e,replyTo:e});return}if(t==="repair"){await s(w("\u4FEE\u590D\u9700\u5728\u79C1\u804A\u4E2D\u9A8C\u8BC1\u63A5\u5165\u8005\u8EAB\u4EFD\uFF0C\u8BF7\u76F4\u63A5\u53D1\u9001 /repair \u5F00\u59CB\u3002"));return}if(t==="compact"){await this.#aA(i,o,e);return}if(t==="stop"){await this.#iA(i,o,e);return}if(t==="steer"){await this.#oA(i,o,{updateMessageId:e});return}if(t.startsWith("steer:")){let g=t.slice(6);if(g==="custom"){await this.#V(o,gP(),{key:i,updateMessageId:e,replyTo:e});return}await this.#Ce({key:i,chatId:o,messageId:e},g);return}if(t==="presets"){await this.#$e(i,o,{updateMessageId:e});return}if(t==="models"){await this.#eA(i,o,{updateMessageId:e});return}if(t==="status"){await this.#tA(i,o,{updateMessageId:e});return}if(t==="help"){await this.#rA(i,o,{updateMessageId:e});return}if(t==="back_to_menu"){await this.#X(i,o,{updateMessageId:e,replyTo:e});return}if(t==="preset_default"){await this.#Re(i,o,{updateMessageId:e});return}if(t.startsWith("preset:select:")){let g=t.slice(14);if(g===tS){await this.#Re(i,o,{updateMessageId:e});return}await this.#nA(i,o,g,{updateMessageId:e});return}if(t.startsWith("model:select:")){let g=t.slice(13);await this.#sA(i,o,g,{updateMessageId:e});return}if(t.startsWith("use:")){await this.#Ze(i,o,t.slice(4),{updateMessageId:e,replyTo:e});return}if(t.startsWith("workspace:")){await this.#Xe(i,o,t.slice(10),{updateMessageId:e,replyTo:e});return}if(t.startsWith("unwatch:")){(await this.#fe(i,o,t.slice(8),{replyTo:e})).ok&&e&&await this.#le({chatId:o,key:i,replyTo:e},a,A,{updateMessageId:e});return}if(t.startsWith("watch:")){let g=t.slice(6);(await this.#Be(i,o,g,{workspaceHint:a,replyTo:e})).ok&&e&&await this.#le({chatId:o,key:i,replyTo:e},a,A,{updateMessageId:e})}}#se(t,o){if(this.#v.size>=jRe){let i=this.#v.keys().next().value;i!==void 0&&this.#v.delete(i)}this.#v.delete(t),this.#v.set(t,{...o,expiresAt:Date.now()+YRe})}#Ve(t){let o=this.#v.get(t);return o?o.expiresAtthis.#b(i,s,{replyTo:A});if(t.kind==="menu"){let g=["workspaces","new","sessions","status","repair","help"][o-1];if(!g){await r(w("\u83DC\u5355\u6CA1\u6709\u8FD9\u4E2A\u7F16\u53F7\uFF0C\u56DE\u590D /m \u91CD\u65B0\u6253\u5F00\u3002"));return}if(g==="repair"){await this.#Me(a,"/repair");return}await this.#ne(g,{chatId:i,key:e,messageId:A});return}if(t.kind==="sessions"){let s=t.sessions[o-1];if(!s?.sessionId){await r(w("\u672C\u9875\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /sessionlist \u91CD\u65B0\u67E5\u770B\u3002",{count:t.sessions.length}));return}await this.#ne(`use:${s.sessionId}`,{chatId:i,key:e,messageId:A});return}if(t.kind==="workspaces"){let s=t.paths[o-1];if(!s){await r(w("\u53EA\u6709 {count} \u4E2A\u5DE5\u4F5C\u533A\uFF0C\u56DE\u590D /workspacelist \u91CD\u65B0\u67E5\u770B\u3002",{count:t.paths.length}));return}await this.#ne(`workspace:${s}`,{chatId:i,key:e,messageId:A});return}if(t.kind==="watches"){let s=t.entries[o-1];if(!s?.sessionId){await r(w("\u5173\u6CE8\u5217\u8868\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:t.entries.length}));return}await this.#ne(`unwatch:${s.sessionId}`,{chatId:i,key:e,messageId:A})}}#ge(t){return this.#r?.includesArchivedSessions?.()===!1?t.filter(o=>o.archived!==!0):t}async#le({chatId:t,key:o,replyTo:i=null},e,a=0,{updateMessageId:A=null}={}){try{let r=this.#$(),s=await r_(e??"",this.#t,{signal:r});if(s.error){await this.#b(t,s.error,{replyTo:i});return}let g=await this.#t.listWorkspaceSessions(s.workspace,{signal:r}),c=this.#ge(Array.isArray(g?.sessions)?g.sessions:[]),I=g?.workspace??s.workspace;if(c.length===0){await this.#b(t,w(`\u5DE5\u4F5C\u533A\uFF1A{workspace} -\u8BE5\u5DE5\u4F5C\u533A\u6682\u65E0\u4F1A\u8BDD\u3002`,{workspace:I}),{replyTo:i});return}let d=Math.ceil(c.length/Nc),B=Number.isSafeInteger(a)&&a>0?Math.min(a,d-1):0,f=new Set((this.#r.watchEntries?.(o)??[]).map(y=>y.sessionId)),Q=c.slice(B*Nc,(B+1)*Nc);this.#se(o,{kind:"sessions",sessions:Q.map(y=>({...y,watched:f.has(y.sessionId)}))}),await this.#V(t,d6(I,c,B,c.length,f),{key:o,updateMessageId:A,replyTo:i,sessionWorkspace:s.workspace,sessionPage:B})}catch(r){await this.#x(t,r,{logLabel:"session list",replyTo:i})}}async#Ne({chatId:t,key:o,replyTo:i=null},{updateMessageId:e=null}={}){try{let{current:a,paths:A}=await UE(this.#t,{signal:this.#$()});this.#se(o,{kind:"workspaces",paths:A}),await this.#V(t,h6(A,a),{key:o,updateMessageId:e,replyTo:i})}catch(a){await this.#x(t,a,{logLabel:"workspace list",replyTo:i})}}async#Ze(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=await this.#t.bindWorkspaceSession(t,i),r=String(A?.title??"").replace(/\s+/gu," ").trim()||w("\u6682\u65E0\u6807\u9898");await this.#b(o,[w(`\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\u300C{title}\u300D +\u8BE5\u5DE5\u4F5C\u533A\u6682\u65E0\u4F1A\u8BDD\u3002`,{workspace:I}),{replyTo:i});return}let d=Math.ceil(c.length/Nc),B=Number.isSafeInteger(a)&&a>0?Math.min(a,d-1):0,f=new Set((this.#r.watchEntries?.(o)??[]).map(y=>y.sessionId)),Q=c.slice(B*Nc,(B+1)*Nc);this.#se(o,{kind:"sessions",sessions:Q.map(y=>({...y,watched:f.has(y.sessionId)}))}),await this.#V(t,d6(I,c,B,c.length,f),{key:o,updateMessageId:A,replyTo:i,sessionWorkspace:s.workspace,sessionPage:B})}catch(r){await this.#x(t,r,{logLabel:"session list",replyTo:i})}}async#Ne({chatId:t,key:o,replyTo:i=null},{updateMessageId:e=null}={}){try{let{current:a,paths:A}=await bp(this.#t,{signal:this.#$()});this.#se(o,{kind:"workspaces",paths:A}),await this.#V(t,h6(A,a),{key:o,updateMessageId:e,replyTo:i})}catch(a){await this.#x(t,a,{logLabel:"workspace list",replyTo:i})}}async#Ze(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=await this.#t.bindWorkspaceSession(t,i),r=String(A?.title??"").replace(/\s+/gu," ").trim()||w("\u6682\u65E0\u6807\u9898");await this.#b(o,[w(`\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\u300C{title}\u300D ID\uFF1A{id}`,{title:r,id:A?.sessionId??i}),w("\u53D1\u9001 /history \u67E5\u770B\u6700\u8FD1\u5BF9\u8BDD\u3002")].join(` -`),{replyTo:a}),await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"session binding",replyTo:a,userMessage:w("\u7ED1\u5B9A\u5931\u8D25\uFF1A{message}",{message:Du(A)})})}}async#Xe(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=await this.#t.switchWorkspace(i);await this.#b(o,w("\u5DE5\u4F5C\u533A\u5DF2\u5207\u6362\u4E3A\uFF1A{workspace}",{workspace:A}),{replyTo:a}),await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"workspace switch",replyTo:a,userMessage:w("\u5207\u6362\u5931\u8D25\uFF1A{message}",{message:Du(A)})})}}#Ee(t,o,i){if(!(!i.key||!t)&&(this.#K.delete(t),this.#K.set(t,{key:i.key,chatId:o,sessionWorkspace:typeof i.sessionWorkspace=="string"&&i.sessionWorkspace?i.sessionWorkspace:null,sessionPage:Number.isSafeInteger(i.sessionPage)&&i.sessionPage>=0?i.sessionPage:0}),this.#K.size>200)){let e=this.#K.keys().next().value;e!==void 0&&this.#K.delete(e)}}async#V(t,o,i={}){let e=lA(i.updateMessageId),a=lA(i.replyTo);if(e)try{let g=await this.#e.im.v1.message.patch({path:{message_id:e},data:{content:o}});if(g?.code&&g.code!==0)throw new Error(`Feishu card update failed: ${g.msg||g.code}`);return this.#Ee(e,t,i),e}catch(g){this.#O.warn?.("[dsh-feishu] card update failed:",g?.code??g?.message??g,"sending new")}let A=o;if(a)try{let g=await this.#e.im.v1.message.reply({path:{message_id:a},data:{msg_type:"interactive",content:A}});if(g?.code&&g.code!==0)throw new Error(`Feishu card reply failed: ${g.msg||g.code}`);let c=lA(g?.data?.message_id);if(c)return this.#Ee(c,t,i),c}catch(g){this.#O.warn?.("[dsh-feishu] threaded card reply failed; sending a plain card:",g?.message??String(g))}let r=await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"interactive",content:o}});if(r?.code&&r.code!==0)throw new Error(`Feishu card send failed: ${r.msg||r.code}`);let s=lA(r?.data?.message_id);return this.#Ee(s,t,i),s}async#X(t,o,{updateMessageId:i=null,replyTo:e=null}={}){let a=null,A=null;try{let L=this.#r.sessionFor(t);if(typeof L=="string"&&L){a=L;let F=this.#t.workspaceSession?.(L);A=lA(F?.title)??lA(F?.name)??lA(F?.displayName)}}catch{}let r=this.#$(),s=UE(this.#t,{signal:r}).catch(()=>{let L=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;return{current:L,paths:L?[L]:[]}}),g=(async()=>{let L=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;if(!L||typeof this.#t.listWorkspaceSessions!="function")return[];try{let F=await this.#t.listWorkspaceSessions(L,{signal:r});return this.#ge(Array.isArray(F?.sessions)?F.sessions:[])}catch{return[]}})(),c=(async()=>{try{let L=await this.#t.agentPresetSettings({signal:r});return{...L.agentPresetCatalog,_currentId:L.agentPreset}}catch{return null}})(),I=(async()=>{try{if(a){let L=this.#t.workspaceSession?.(a);if(typeof L?.models=="function")return await L.models({signal:r})}return await this.#t.listModels({signal:r})}catch{return null}})(),[d,B,f,Q]=await Promise.all([s,g,c,I]),y=Array.isArray(d.paths)?d.paths:[],m=d.current??null,T=B.find(L=>L.sessionId===a),_=a?lA(T?.title)??lA(T?.name)??A??a:null,R=B.map(L=>({id:L.sessionId,title:L.title??L.name??L.sessionId})).slice(0,20);a&&(R=R.filter(L=>L.id!==a),R.unshift({id:a,title:_??a}),R=R.slice(0,20));let K=this.#r?.includesArchivedSessions?.()??!1;this.#se(t,{kind:"menu",chatId:o}),await this.#V(o,n6({workspaces:y,currentWorkspace:m,currentSession:a?{id:a,title:_}:null,sessions:R,archiveVisible:K,presetCatalog:f,modelCatalog:Q}),{key:t,updateMessageId:i,replyTo:e})}async#fA(t,o){try{if(typeof this.#t.workspaceSession=="function"){let e=this.#t.workspaceSession(o);if(e&&typeof e=="object"){let a=lA(e.title)??lA(e.name)??lA(e.displayName);if(a)return a}}let i=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;if(i&&typeof this.#t.listWorkspaceSessions=="function"){let e=await this.#t.listWorkspaceSessions(i),a=(Array.isArray(e?.sessions)?e.sessions:[]).find(A=>A.sessionId===o);if(a){let A=lA(a.title)??lA(a.name);if(A)return A}}}catch{}return null}async#$e(t,o,{updateMessageId:i=null}={}){try{let e=await this.#t.agentPresetSettings({signal:this.#$()}),a=e.agentPresetCatalog;a._currentId=e.agentPreset,await this.#V(o,s6(a),{key:t,updateMessageId:i})}catch(e){await this.#x(o,e,{logLabel:"preset card",replyTo:i})}}async#eA(t,o,{updateMessageId:i=null}={}){try{let e=this.#$();await this.#t.ensureRunning({signal:e});let a=this.#r?.sessionFor?.(t),A;if(typeof a=="string"&&a){let r=this.#t.workspaceSession(a);r?.models&&(A=await r.models({signal:e}))}A||(A=await this.#t.listModels({signal:e})),await this.#V(o,g6(A),{key:t,updateMessageId:i})}catch(e){await this.#x(o,e,{logLabel:"model card",replyTo:i})}}async#AA(t,o,i=null){try{await this.#t.ensureRunning({signal:this.#w});let e=[w("\u8FDE\u63A5\u6B63\u5E38")],a=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;a&&e.push(w("\u5DE5\u4F5C\u533A\uFF1A{workspace}",{workspace:a}));let A=typeof this.#t.agentPresetSettings=="function"?await this.#t.agentPresetSettings({signal:this.#w}).catch(()=>null):null;if(A){let r=A.agentPresetCatalog?.items?.find(s=>s.id===A.agentPreset);e.push(w("\u9884\u8BBE\uFF1A{preset}",{preset:r?`${r.label}\uFF08${r.id}\uFF09`:A.agentPreset||w("\u8DDF\u968F\u9ED8\u8BA4")}))}await this.#b(o,e.join(` -`),{replyTo:i})}catch(e){await this.#x(o,e,{logLabel:"status text",replyTo:i})}}async#tA(t,o,{updateMessageId:i=null}={}){try{let e=this.#$();await this.#t.ensureRunning({signal:e});let a={connected:!0,workspace:null,preset:null,model:null,sessionCount:0};try{let A=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;a.workspace=A||w("\u672A\u77E5")}catch{}try{let A=await this.#t.agentPresetSettings({signal:e}),r=A.agentPresetCatalog.items.find(s=>s.id===A.agentPreset);a.preset=r?`${r.label}\uFF08${r.id}\uFF09`:A.agentPreset||w("\u8DDF\u968F\u9ED8\u8BA4")}catch{}try{let A=this.#r?.sessionFor?.(t);if(typeof A=="string"&&A){let r=this.#t.workspaceSession(A);if(r?.models){let s=await r.models({signal:e});s.current&&(a.model=`${s.current.provider}/${s.current.model}`)}}}catch{}try{let A=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;if(A){let r=await this.#t.listWorkspaceSessions(A,{signal:e});Array.isArray(r?.sessions)&&(a.sessionCount=r.sessions.length)}}catch{}await this.#V(o,c6(a),{key:t,updateMessageId:i})}catch(e){await this.#x(o,e,{logLabel:"status card",replyTo:i})}}async#rA(t,o,{updateMessageId:i=null}={}){await this.#V(o,l6(oke.map(e=>w(e))),{key:t,updateMessageId:i})}async#aA(t,o,i=null){try{let e=await bi("/compact",this.#t,this.#r,t,{signal:this.#w});await this.#b(o,e?.message||w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002"),{replyTo:i})}catch(e){await this.#x(o,e,{logLabel:"compact",replyTo:i})}}async#iA(t,o,i=null){try{let e=await Mi("/stop",this.#t,this.#r,t,{signal:this.#w,control:{owner:this,key:t}});e?.stopped&&await Promise.allSettled([this.#Oe(t),this.#D.closeRoute(t)]),await this.#b(o,e?.message||w("/stop \u6267\u884C\u5B8C\u6210\u3002"),{replyTo:i})}catch(e){await this.#x(o,e,{logLabel:"stop",replyTo:i})}}async#oA(t,o,{updateMessageId:i=null}={}){let e=!!this.#r.sessionFor?.(t);this.#se(t,{kind:"steer"}),await this.#V(o,B6({hasSession:e}),{key:t,updateMessageId:i})}async#Ce(t,o){let{key:i,chatId:e}=t,a=await Mi(`/steer ${o}`,this.#t,this.#r,i,{signal:this.#w,pendingInteraction:this.#oe(i),control:{owner:this,key:i}});await this.#b(e,a?.message||w("\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\u3002"),{replyTo:t.messageId??null})}async#Re(t,o,{updateMessageId:i=null,replyTo:e=null}={}){try{let a=await _i("/preset --default",this.#t,this.#r,t,{signal:this.#w});for(let A of a?.messages??[a?.message])A&&await this.#b(o,A,{replyTo:e})}catch(a){await this.#x(o,a,{logLabel:"preset reset",replyTo:i});return}try{await this.#X(t,o,{updateMessageId:i,replyTo:e})}catch(a){this.#O.warn?.("[dsh-feishu] menu refresh failed after preset reset:",a.message)}}async#nA(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=/^\d+$/u.test(i)?`id:${i}`:i,r=await _i(`/preset ${A}`,this.#t,this.#r,t,{signal:this.#w});for(let s of r?.messages??[r?.message])s&&await this.#b(o,s,{replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"preset selection",replyTo:e});return}try{await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){this.#O.warn?.("[dsh-feishu] menu refresh failed after preset select:",A.message)}}async#sA(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=await to(`/model ${i}`,this.#t,this.#r,t,{signal:this.#w,pendingInteraction:this.#oe(t),control:{owner:this,key:t}});for(let r of A?.messages??[A?.message])r&&await this.#b(o,r,{replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"model selection",replyTo:e});return}try{await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){this.#O.warn?.("[dsh-feishu] menu refresh failed after model select:",A.message)}}#ke(){if(this.#q||typeof this.#t?.watchHarnessEvents!="function"||this.#w?.aborted)return;let t=this.#w??new AbortController().signal;try{this.#q=this.#t.watchHarnessEvents({signal:t,onSessionEvent:o=>this.#lA(o),onReconnect:()=>{this.#pA()}}),Promise.resolve(this.#q).catch(o=>{t.aborted||this.#O.warn?.("[dsh-feishu] event watcher stopped:",o.message)})}catch(o){this.#q=null,this.#O.warn?.("[dsh-feishu] event watcher failed to start:",o.message)}}#ve(t,o){let i=this.#W.get(t)??Promise.resolve(),e;return e=i.then(o,o).catch(a=>{this.#w?.aborted||this.#O.warn?.("[dsh-feishu] completion event failed:",a.message)}).finally(()=>{this.#W.get(t)===e&&this.#W.delete(t)}),this.#W.set(t,e),e}#ue(t=Date.now()){let o=0;for(let[i,e]of this.#M){for(let[a,A]of e)(!Number.isSafeInteger(A?.arrivalAt)||A.arrivalAt<0||A.arrivalAt+VRe<=t)&&e.delete(a);for(;e.size>ZRe;){let a=e.keys().next().value;if(a===void 0)break;e.delete(a)}e.size===0?this.#M.delete(i):o+=e.size}for(;this.#M.size>WRe;){let i=this.#M.keys().next().value;if(i===void 0)break;o-=this.#M.get(i)?.size??0,this.#M.delete(i)}for(;o>XRe;){let i=this.#M.keys().next().value;if(i===void 0)break;let e=this.#M.get(i),a=e?.keys().next().value;if(a===void 0){this.#M.delete(i);continue}e.delete(a),o-=1,e.size===0&&this.#M.delete(i)}}#gA(t,o,i=Date.now()){this.#ue(i);let e=this.#M.get(t);e||(e=new Map);let a=o?.data?.reason,A=typeof a=="string"?a:typeof a?.kind=="string"?{kind:a.kind}:null;e.delete(o.seq),e.set(o.seq,{arrivalAt:i,event:{type:"turn/end",seq:o.seq,...Number.isSafeInteger(o.time)&&o.time>=0?{time:o.time}:{},data:{reason:A}}}),this.#M.delete(t),this.#M.set(t,e),this.#ue(i)}async#cA(t,{workspaceHint:o=null,signal:i=this.#w}={}){if(typeof t!="string"||t==="")return{error:w("\u7528\u6CD5\uFF1A/watch ")};let e=/^\d{1,4}$/.test(t)?Number(t):null,a=typeof this.#t?.currentWorkspace=="function"?this.#t.currentWorkspace():null,A=async s=>{let g=await this.#t.listWorkspaceSessions(s,{signal:i});return Array.isArray(g?.sessions)?g.sessions:[]};if(e!==null){if(!a)return{error:w("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\uFF0C\u65E0\u6CD5\u6309\u5E8F\u53F7\u89E3\u6790\u4F1A\u8BDD\u3002")};let s=this.#ge(await A(a)),g=s[e-1];return g?.sessionId?{sessionId:g.sessionId,title:g.title??w("\u6682\u65E0\u6807\u9898"),workspace:a,...bn(g.lastSeq)?{lastSeq:g.lastSeq}:{}}:{error:w("\u5F53\u524D\u5DE5\u4F5C\u533A\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:s.length})}}let r;if(lA(o))r=[o];else{let s=typeof this.#t?.listWorkspaces=="function"?(await this.#t.listWorkspaces({signal:i})).filter(g=>g!==a):[];r=[a,...s].filter(Boolean)}for(let s of r){let c=(await A(s)).find(I=>I.sessionId===t);if(c)return{sessionId:t,title:c.title??w("\u6682\u65E0\u6807\u9898"),workspace:s,...bn(c.lastSeq)?{lastSeq:c.lastSeq}:{}}}return{error:w("\u6CA1\u6709\u627E\u5230\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u8BF7\u7528 /sessionlist \u67E5\u770B\u53EF\u7528\u4F1A\u8BDD\u3002")}}async#IA(t){let o=lA(t)??(typeof this.#t?.currentWorkspace=="function"?lA(this.#t.currentWorkspace()):null);if(!o||typeof this.#t?.listWorkspaceSessions!="function")return new Map;let i=await this.#t.listWorkspaceSessions(o,{signal:this.#$()});return new Map(this.#ge(Array.isArray(i?.sessions)?i.sessions:[]).filter(e=>lA(e?.sessionId)).map(e=>[e.sessionId,{sessionId:e.sessionId,title:e.title??e.name??w("\u6682\u65E0\u6807\u9898"),workspace:o,...bn(e.lastSeq)?{lastSeq:e.lastSeq}:{}}]))}#Pe(t){let o=this.#z.get(t);if(o)return o.requested=!0,o.promise;let i={requested:!0,promise:null};return this.#z.set(t,i),i.promise=Promise.resolve().then(async()=>{try{do i.requested=!1,await this.#ve(t,()=>this.#Fe(t));while(i.requested&&!this.#w?.aborted)}finally{this.#z.get(t)===i&&this.#z.delete(t)}}),i.promise}async#Be(t,o,i,{notify:e=!0,validatedTarget:a=null,workspaceHint:A=null,replyTo:r=null}={}){let s=Date.now(),g=async y=>{e&&await this.#b(o,y,{replyTo:r}).catch(m=>{this.#O.warn?.("[dsh-feishu] watch notification failed:",m.message)})};if(this.#ke(),typeof this.#r?.setWatch!="function")return await g(w("\u5F53\u524D\u72B6\u6001\u5B58\u50A8\u4E0D\u652F\u6301\u5173\u6CE8\u3002")),{ok:!1,changed:!1,reason:"unsupported"};let c;try{c=a?.sessionId===i?a:await this.#cA(i,{workspaceHint:A,signal:A?this.#$():this.#w})}catch(y){return await g(w("\u65E0\u6CD5\u89E3\u6790\u4F1A\u8BDD\uFF1A{message}",{message:Du(y)})),{ok:!1,changed:!1,reason:"resolve"}}if(c.error)return await g(c.error),{ok:!1,changed:!1,reason:"not-found"};let I=this.#r.watchEntries?.(t)??[],d=I.find(y=>y.sessionId===c.sessionId);if(!d&&I.length>=oS)return await g(w("\u6BCF\u4E2A\u804A\u5929\u6700\u591A\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:oS})),{ok:!1,changed:!1,reason:"limit"};let B=bn(d?.lastSeq)?d.lastSeq:bn(c.lastSeq)?c.lastSeq:null,Q=lS(d)??(d?null:s);try{await this.#r.setWatch(t,{sessionId:c.sessionId,title:c.title,chatId:o,lastSeq:B,...Q!==null?{watchStartedAt:Q}:{},...r?{replyToMessageId:r}:d?.replyToMessageId?{replyToMessageId:d.replyToMessageId}:{}})}catch(y){return await g(w("\u5173\u6CE8\u5931\u8D25\uFF1A{message}",{message:Du(y)})),{ok:!1,changed:!1,reason:"persist"}}return(!d||Q!==null||!bn(B))&&this.#Pe(c.sessionId),await g(w("\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u300C{title}\u300D\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u63A8\u9001\u7ED3\u679C\u3002",{title:String(c.title).replace(/\s+/gu," ")})),{ok:!0,changed:!d,entry:this.#r.watchEntry?.(t,c.sessionId)}}async#fe(t,o,i,{notify:e=!0,replyTo:a=null}={}){let A=async g=>{e&&await this.#b(o,g,{replyTo:a}).catch(c=>{this.#O.warn?.("[dsh-feishu] unwatch notification failed:",c.message)})};if(typeof this.#r?.removeWatch!="function")return{ok:!1,changed:!1,reason:"unsupported"};let r=this.#r.watchEntries?.(t)??[],s=typeof i=="string"&&/^\d{1,4}$/.test(i)?r[Number(i)-1]:r.find(g=>g.sessionId===i);if(!s)return await A(w("\u5173\u6CE8\u5217\u8868\u91CC\u6CA1\u6709\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /watchlist \u67E5\u770B\u3002")),{ok:!0,changed:!1,reason:"absent"};try{await this.#r.removeWatch(t,s.sessionId),this.#j.delete(`${t}\0${s.sessionId}`)}catch(g){return await A(w("\u53D6\u6D88\u5931\u8D25\uFF1A{message}",{message:Du(g)})),{ok:!1,changed:!1,reason:"persist"}}return await A(w("\u5DF2\u53D6\u6D88\u5173\u6CE8\u300C{title}\u300D\u3002",{title:String(s.title??"").replace(/\s+/gu," ")})),{ok:!0,changed:!0,entry:s}}async#Qe(t,o,{updateMessageId:i=null,replyTo:e=null}={}){let a=this.#r.watchEntries?.(t)??[],A=[],r=null;try{if(r=typeof this.#t?.currentWorkspace=="function"?this.#t.currentWorkspace():null,r&&typeof this.#t?.listWorkspaceSessions=="function"){let s=await this.#t.listWorkspaceSessions(r,{signal:this.#$()});A=this.#ge(Array.isArray(s?.sessions)?s.sessions:[]).map(g=>({sessionId:g.sessionId,title:g.title??g.name??g.sessionId}))}}catch{}this.#se(t,{kind:"watches",entries:a}),await this.#V(o,E6(a,A),{key:t,updateMessageId:i,replyTo:e,sessionWorkspace:r})}#lA({sessionId:t,event:o}){this.#w?.aborted||!t||!o||typeof o!="object"||o.type!=="turn/end"||!Mu(o.seq)||(this.#gA(t,o),this.#ve(t,async()=>{let i=this.#r.keysWatching?.(t)??[],e=i.some(A=>IS(this.#r.watchEntry?.(A,t))),a=i.some(A=>this.#j.has(`${A}\0${t}`));(e||a)&&await this.#Fe(t),await this.#Ge(t,o)}))}async#Ge(t,o,{keys:i=null}={}){if(this.#w?.aborted||typeof this.#r?.keysWatching!="function")return;let e=o?.data?.reason?.kind??o?.data?.reason??null,a=i??this.#r.keysWatching(t);for(let A of a){if(this.#w?.aborted)return;let r=this.#r.watchEntry?.(A,t),s=`${A}\0${t}`,g=this.#j.get(s);if(Mu(g)&&bn(r?.lastSeq)&&r.lastSeq>=g&&(this.#j.delete(s),g=void 0),!(!r?.chatId||IS(r)||bn(r.lastSeq)&&r.lastSeq>=o.seq||Mu(g)&&o.seq>g))try{await this.#V(r.chatId,C6(t,r.title,e),{key:A,replyTo:r.replyToMessageId??null});let c=this.#r.watchEntry?.(A,t);if(!c||c.chatId!==r.chatId||IS(c)||bn(c.lastSeq)&&c.lastSeq>=o.seq)continue;await this.#r.setWatch(A,{...c,lastSeq:o.seq}),g===o.seq&&this.#j.delete(s)}catch(c){this.#j.set(s,Mu(g)?Math.min(g,o.seq):o.seq),this.#O.warn?.("[dsh-feishu] completion push failed:",c.message)}}}async#Fe(t){if(!(this.#w?.aborted||typeof this.#t?.rpc!="function"))try{let o=await this.#t.rpc("session.history",{sessionId:t,maxMessages:20},3e4,{signal:this.#w}),i=ske(o);this.#ue();let e=this.#M.get(t)??new Map,a=new Map(i.map(g=>[g.seq,g]));for(let[g,c]of e)a.has(g)||a.set(g,c.event);let A=[...a.values()].sort((g,c)=>g.seq-c.seq),r=A.at(-1)?.seq??-1,s=typeof this.#r?.keysWatching=="function"?this.#r.keysWatching(t):[];for(let g of s){let c=this.#r.watchEntry?.(g,t);if(!IS(c))continue;let I=lS(c),d=bn(c.lastSeq)?c.lastSeq:-1,B=I===null?null:A.find(T=>{if(T.seq<=d)return!1;let _=Number.isSafeInteger(T.time)&&T.time>=0?T.time:e.get(T.seq)?.arrivalAt;return Number.isSafeInteger(_)&&_>=I}),f=B?Math.max(d,B.seq-1):Math.max(d,r),Q=this.#r.watchEntry?.(g,t);if(!Q||Q.chatId!==c.chatId||Q.lastSeq!==c.lastSeq||lS(Q)!==I)continue;let{watchStartedAt:y,...m}=Q;await this.#r.setWatch(g,{...m,lastSeq:f})}for(let g of A)g.type==="turn/end"&&await this.#Ge(t,g,{keys:s})}catch(o){this.#w?.aborted||this.#O.warn?.(`[dsh-feishu] watch compensation failed for ${t}:`,o.message)}}async#pA(){let t=typeof this.#r?.watchedSessionIds=="function"?this.#r.watchedSessionIds():[];this.#w?.aborted||await Promise.allSettled(t.map(o=>this.#Pe(o)))}#ye(t,o,i){return{timeoutMs:this.#T,signal:this.#w,control:{owner:this,key:o},onInteraction:e=>this.#EA(e,{key:o,actor:Kd(t),chatId:t.message.chat_id,requiresMention:t.message.chat_type!=="p2p",replyToMessageId:t.message.message_id}),onInteractionResolved:e=>this.#CA(e),files:i}}async#me(t,o,{deliveryId:i,presentation:e,replyTo:a=null}){let A=[];for(let r of a6(o)){this.#w?.throwIfAborted();let s=await this.#b(t,r,{replyTo:a});s&&A.push(s)}return Zt({deliveryId:i,presentation:e,providerMessageIds:A})}async#pe(t,o,i=[],e){let a=await vo({artifacts:i,baseReceipt:e,deliveryId:e?.deliveryId??i[0]?.deliveryKey??o,aggregatePresentation:e?"feishu-text-and-files":"feishu-files",channelKey:"feishu",signal:this.#w,sendImage:typeof this.#A?.sendImage=="function"?A=>this.#A.sendImage(t,A,{replyTo:o,signal:this.#w}):void 0,sendFile:typeof this.#A?.sendFile=="function"?A=>this.#A.sendFile(t,A,{replyTo:o,signal:this.#w}):void 0,onFailure:(A,r)=>At(this.#E,r,{userMessage:nke(A?.fileName,r),reason:r?.code}),sendFailureNotice:async(A,r,s)=>({messageId:await this.#b(t,dt(s))}),logger:this.#O});return this.#E.artifactsSent=(this.#E.artifactsSent??0)+a.artifactsSent,this.#E.artifactSendErrors=(this.#E.artifactSendErrors??0)+a.artifactSendErrors,a.receipt?{receipt:a.receipt,failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}:{receipt:Zt({deliveryId:o,presentation:"feishu-files"}),failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}}async#dA(t,o,i,{onAskComplete:e}={}){let a=t.message.chat_id,A=t.message.message_id,r=i.content,s=!1,g=()=>{s||(s=!0,e?.())},c=Tt(i)?await Oo(i,{signal:this.#w}):void 0,I=this.#c.get(A);if(I&&(c=To(c??r,I,()=>({channel:"feishu",senderId:Kd(t)}))),!this.#A?.stream){let{answer:m,artifacts:T=[]}=await Oi({harness:this.#t,state:this.#r,key:o,text:r,content:c,createOptions:{signal:this.#w},existsOptions:{signal:this.#w},askOptions:this.#ye(t,o,i.files)});g();let _,R=null;try{_=await this.#me(a,cS(m,T),{deliveryId:A,presentation:"feishu-text",replyTo:A})}catch(F){R=ka(F),this.#O.warn?.("[dsh-feishu] final text delivery failed; continuing with result files:",F)}let K=await this.#pe(a,A,T,_),L=K.receipt.artifacts.some(({outcome:F})=>F==="sent"||F==="unknown");if(R&&!L&&!K.failureNoticeVisible)throw R;return R&&K.artifactSendErrors===0&&At(this.#E,R),this.#E.streamFallbacks=(this.#E.streamFallbacks??0)+1,{...K,textDeliveryErrors:R?1:0}}let d=!1,B="",f=[],Q;try{Q=await this.#A.stream(a,{markdown:async m=>{d=!0;let T={...this.#ye(t,o,i.files),onUpdate:async R=>{await m.setContent(this.#uA(R)),this.#E.streamUpdates=(this.#E.streamUpdates??0)+1}},_=await Oi({harness:this.#t,state:this.#r,key:o,text:r,content:c,createOptions:{signal:this.#w},existsOptions:{signal:this.#w},askOptions:T});g(),B=_.answer,f=_.artifacts??[],await m.setContent(cS(B,f))}},{replyTo:A})}catch(m){if(this.#E.streamErrors=(this.#E.streamErrors??0)+1,B||f.length>0){this.#O.warn?.("[dsh-feishu] native stream failed after generation; sending final text:",m.message);let q,V=null;try{q=await this.#me(a,cS(B,f),{deliveryId:A,presentation:"feishu-text-fallback",replyTo:A})}catch(J){V=ka(J),this.#O.warn?.("[dsh-feishu] fallback text delivery failed; continuing with result files:",J)}let x=await this.#pe(a,A,f,q),G=x.receipt.artifacts.some(({outcome:J})=>J==="sent"||J==="unknown");if(V&&!G&&!x.failureNoticeVisible)throw V;return V&&x.artifactSendErrors===0&&At(this.#E,V),this.#E.streamFallbacks=(this.#E.streamFallbacks??0)+1,{...x,textDeliveryErrors:V?1:0}}if(d)throw m;this.#O.warn?.("[dsh-feishu] native stream unavailable; using text fallback:",m.message);let{answer:T,artifacts:_=[]}=await Oi({harness:this.#t,state:this.#r,key:o,text:r,content:c,createOptions:{signal:this.#w},existsOptions:{signal:this.#w},askOptions:this.#ye(t,o,i.files)});g();let R,K=null;try{R=await this.#me(a,cS(T,_),{deliveryId:A,presentation:"feishu-text-fallback",replyTo:A})}catch(q){K=ka(q),this.#O.warn?.("[dsh-feishu] fallback text delivery failed; continuing with result files:",q)}let L=await this.#pe(a,A,_,R),F=L.receipt.artifacts.some(({outcome:q})=>q==="sent"||q==="unknown");if(K&&!F&&!L.failureNoticeVisible)throw K;return K&&L.artifactSendErrors===0&&At(this.#E,K),this.#E.streamFallbacks=(this.#E.streamFallbacks??0)+1,{...L,textDeliveryErrors:K?1:0}}let y=await this.#pe(a,A,f,Zt({deliveryId:A,presentation:"feishu-cardkit",providerMessageIds:Ua(Q)}));return this.#E.streamResponses=(this.#E.streamResponses??0)+1,y}async#hA(t,o,i,e,a){this.#w?.throwIfAborted();let A=this.#n.get(i),r=e.claimedReplyMessageId===o;if(!A||A!==e||A.submitting)return this.#Se(t,i)?this.#we(t,o):r&&(!A||A!==e)?this.#we(t,o):this.#Y(t,o,i,a,{releaseMessageId:!1,finalize:!1});if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1;let s=Ud(t);if(!s){await this.#b(t.message.chat_id,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"));return}let g=this.#n.get(i);if(!g||g!==e||g.submitting){if(this.#Se(t,i)){await this.#b(t.message.chat_id,sS(),{replyTo:t.message.message_id}).catch(()=>{});return}if(r&&(!g||g!==e)){await this.#b(t.message.chat_id,sS(),{replyTo:t.message.message_id});return}return this.#Y(t,o,i,a,{releaseMessageId:!1,alreadyRecorded:!0,finalize:!1})}if(g.chatId=t.message.chat_id,g.needsPresentation){try{await this.#de(g)}catch{this.#E.lastError="\u98DE\u4E66\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002",this.#O.error?.("[dsh-feishu] failed to retry an interaction question"),g.interaction.reconnect?.()}return}let c=g.questions[g.index];if(c){if(g.answers.push(wi(c,s)),g.index+=1,g.index{});return}g.submitting=!1,g.answers.pop(),g.index-=1,this.#E.lastError="\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002",this.#O.error?.("[dsh-feishu] failed to answer a Harness interaction"),await this.#b(t.message.chat_id,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#EA(t,{key:o,actor:i,chatId:e,requiresMention:a,replyToMessageId:A}){if(await this.#D.handleRequested(t,{key:o,actor:i,requiresMention:a,send:I=>this.#b(e,I,{replyTo:A})})||t?.kind!=="question")return;let r=t?.payload?.questions,s=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t.rpcId!="string"||typeof s!="string"||typeof t.sessionId!="string"||!Array.isArray(r)||r.length===0||r.some(I=>!mi(I))){this.#O.warn?.("[dsh-feishu] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Feishu safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#b(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),{replyTo:A}).catch(()=>{});return}let g=this.#n.get(o);if(g?.interactionId===s){g.interaction=t,g.needsPresentation&&await this.#de(g);return}if(this.#s.has(s))return;if(g){await t.respond({ok:!1,error:{code:"cancelled",message:"Feishu is already handling another user interaction.",details:{}}});return}let c={kind:"question",interactionId:s,sessionId:t.sessionId,interaction:t,key:o,actor:i,requiresMention:a,questions:r,answers:[],index:0,chatId:e,replyToMessageId:A,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,questionMessageIds:new Set,inactive:!1};this.#n.set(o,c),this.#s.set(c.interactionId,o),await this.#de(c)}async#CA(t){if(await this.#D.handleResolved(t))return;let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#s.get(o);if(!i)return;let e=this.#n.get(i);e&&this.#ce(i,e),this.#De(i,o)}async#de(t){let o=t.questions[t.index];if(!o)return;let i=await this.#b(t.chatId,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention}),{replyTo:t.replyToMessageId});i&&(t.questionMessageIds.add(i),t.inactive&&this.#ce(t.key,t)),t.needsPresentation=!1}#ce(t,o){let i=Date.now()+URe;for(let e of o.questionMessageIds??[])this.#p.set(e,{key:t,expiresAt:i})}#Se(t,o){let i=Date.now();for(let[e,a]of this.#p)a.expiresAt<=i&&this.#p.delete(e);for(let e of[t?.message?.parent_id,t?.message?.root_id]){let a=this.#p.get(e);if(a?.key===o&&a.expiresAt>i)return!0}return!1}async#we(t,o){this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,await this.#b(t.message.chat_id,sS(),{replyTo:t.message.message_id}).catch(()=>{}))}#Le(t,o){let i=this.#n.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#n.delete(t),this.#s.delete(i.interactionId),i.inactive=!0,i)}#De(t,o){return this.#Le(t,o)!==null}async#Oe(t){let o=this.#Le(t);if(!(!o||o.kind!=="question")){this.#ce(t,o);try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Feishu interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#O.warn?.("[dsh-feishu] failed to cancel a pending Harness interaction")}}}#uA(t){return t.type==="text"&&t.text?t.text:t.type==="tool"?t.name==="web_search"?w("_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_"):w("_\u6B63\u5728\u4F7F\u7528 {name}\u2026_",{name:t.name||w("\u5DE5\u5177")}):w("_{text}_",{text:t.text||w("\u6B63\u5728\u5904\u7406\u2026")})}#BA(t){return JQ({adapter:this.#A,target:t,reactions:{processing:"OnIt",success:"DONE",error:"ERROR"},status:this.#E,logger:this.#O,label:"feishu"})}#Ue(t,o){o.clear()}#Ae(t,o,i){i==="ERROR"?o.error():o.success()}async#b(t,o,{replyTo:i}={}){let e=JSON.stringify({text:o});if(i)try{let A=await this.#e.im.v1.message.reply({path:{message_id:i},data:{msg_type:"text",content:e}});if(A?.code&&A.code!==0)throw new Error(`Feishu reply failed: ${A.msg||A.code}`);return lA(A?.data?.message_id)}catch(A){this.#O.warn?.("[dsh-feishu] threaded reply failed; falling back to a plain message:",A?.message??String(A))}let a=await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"text",content:e}});if(a?.code&&a.code!==0)throw new Error(`Feishu send failed: ${a.msg||a.code}`);return lA(a?.data?.message_id)}};import{createHash as lke}from"node:crypto";var N6="stream_md",pke="\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026",Tu=28e3,dS=12e4,R6=new Map([[99991672,["artifact-permission-required","Feishu file delivery requires the im:resource permission."]],[234006,["artifact-too-large","The result file exceeds Feishu's size limit."]],[234010,["artifact-empty","Feishu does not accept empty files."]],[230017,["artifact-provider-rejected","Feishu rejected the uploaded file ownership."]],[230020,["artifact-rate-limited","Feishu temporarily rate-limited file delivery."]],[230049,["artifact-delivery-uncertain","Feishu could not confirm the file message result."]],[230055,["artifact-provider-rejected","Feishu rejected the file message type."]]]);function Cl(n,t){if(t?.code&&t.code!==0)throw new Error(`${n} failed: ${t.msg||t.code}`);return t}function k6(n){let t=[n],o=new Set,i;for(;t.length>0;){let e=t.shift();if(!e||o.has(e))continue;if(typeof e=="object"&&o.add(e),Array.isArray(e)){t.push(...e);continue}let a=Number(e?.code);if(Number.isFinite(a)&&a!==0){if(R6.has(a))return a;i??=a}t.push(e?.response?.data,e?.data,e?.error,e?.cause)}return i}function _u(n,t,o,{uncertain:i=!1}={}){let e=o==null?void 0:Number(o),a=Number.isFinite(e)&&e!==0?e:k6(t),A=Number.isFinite(a)?["artifact-provider-rejected",`Feishu rejected file ${n}.`]:i?["artifact-delivery-uncertain","Feishu could not confirm the file message result."]:["artifact-provider-failed",`Feishu file ${n} failed.`],[r,s]=R6.get(a)??A,g=new Error(s,{cause:t});return g.code=r,Number.isFinite(a)&&(g.providerCode=a),g}function M6(n,t){if(!Number.isInteger(n)||n<1||n>dS)throw new TypeError(`${t} must be an integer between 1 and ${dS}`);return n}function hP(n){return n?.reason??new DOMException("The operation was aborted","AbortError")}function dke(n){let t=new Error(`Feishu file ${n} timed out.`);return t.code="provider-timeout",t}function _6(n,{signal:t,timeoutMs:o,stage:i}){t?.throwIfAborted();let e=new AbortController,a=t?AbortSignal.any([t,e.signal]):e.signal;return new Promise((A,r)=>{let s=!1,g=(d,B)=>{s||(s=!0,clearTimeout(I),a.removeEventListener("abort",c),d(B))},c=()=>g(r,t?.aborted?hP(t):dke(i)),I=setTimeout(()=>e.abort(),o);a.addEventListener("abort",c,{once:!0}),Promise.resolve().then(()=>n(a)).then(d=>g(A,d),d=>g(r,d)),a.aborted&&c()})}function hke(n,t,o){let i=`${n.deliveryKey}\0${t}`;return`dshim_${lke("sha256").update(o==="file"?i:`${i}\0${o}`).digest("hex").slice(0,40)}`}function Eke(n){let t=String(n??"").replace(/\s+/g," ").trim();return t.length<=50?t:`${EP(t,49)}\u2026`}function EP(n,t){let o=Math.min(n.length,t),i=n.charCodeAt(o-1),e=n.charCodeAt(o);return i>=55296&&i<=56319&&e>=56320&&e<=57343&&(o-=1),n.slice(0,o)}function T6(n){if(n.length<=Tu)return n;let t=` +`),{replyTo:a}),await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"session binding",replyTo:a,userMessage:w("\u7ED1\u5B9A\u5931\u8D25\uFF1A{message}",{message:Du(A)})})}}async#Xe(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=await this.#t.switchWorkspace(i);await this.#b(o,w("\u5DE5\u4F5C\u533A\u5DF2\u5207\u6362\u4E3A\uFF1A{workspace}",{workspace:A}),{replyTo:a}),await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"workspace switch",replyTo:a,userMessage:w("\u5207\u6362\u5931\u8D25\uFF1A{message}",{message:Du(A)})})}}#Ee(t,o,i){if(!(!i.key||!t)&&(this.#K.delete(t),this.#K.set(t,{key:i.key,chatId:o,sessionWorkspace:typeof i.sessionWorkspace=="string"&&i.sessionWorkspace?i.sessionWorkspace:null,sessionPage:Number.isSafeInteger(i.sessionPage)&&i.sessionPage>=0?i.sessionPage:0}),this.#K.size>200)){let e=this.#K.keys().next().value;e!==void 0&&this.#K.delete(e)}}async#V(t,o,i={}){let e=lA(i.updateMessageId),a=lA(i.replyTo);if(e)try{let g=await this.#e.im.v1.message.patch({path:{message_id:e},data:{content:o}});if(g?.code&&g.code!==0)throw new Error(`Feishu card update failed: ${g.msg||g.code}`);return this.#Ee(e,t,i),e}catch(g){this.#O.warn?.("[dsh-feishu] card update failed:",g?.code??g?.message??g,"sending new")}let A=o;if(a)try{let g=await this.#e.im.v1.message.reply({path:{message_id:a},data:{msg_type:"interactive",content:A}});if(g?.code&&g.code!==0)throw new Error(`Feishu card reply failed: ${g.msg||g.code}`);let c=lA(g?.data?.message_id);if(c)return this.#Ee(c,t,i),c}catch(g){this.#O.warn?.("[dsh-feishu] threaded card reply failed; sending a plain card:",g?.message??String(g))}let r=await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"interactive",content:o}});if(r?.code&&r.code!==0)throw new Error(`Feishu card send failed: ${r.msg||r.code}`);let s=lA(r?.data?.message_id);return this.#Ee(s,t,i),s}async#X(t,o,{updateMessageId:i=null,replyTo:e=null}={}){let a=null,A=null;try{let L=this.#r.sessionFor(t);if(typeof L=="string"&&L){a=L;let F=this.#t.workspaceSession?.(L);A=lA(F?.title)??lA(F?.name)??lA(F?.displayName)}}catch{}let r=this.#$(),s=bp(this.#t,{signal:r}).catch(()=>{let L=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;return{current:L,paths:L?[L]:[]}}),g=(async()=>{let L=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;if(!L||typeof this.#t.listWorkspaceSessions!="function")return[];try{let F=await this.#t.listWorkspaceSessions(L,{signal:r});return this.#ge(Array.isArray(F?.sessions)?F.sessions:[])}catch{return[]}})(),c=(async()=>{try{let L=await this.#t.agentPresetSettings({signal:r});return{...L.agentPresetCatalog,_currentId:L.agentPreset}}catch{return null}})(),I=(async()=>{try{if(a){let L=this.#t.workspaceSession?.(a);if(typeof L?.models=="function")return await L.models({signal:r})}return await this.#t.listModels({signal:r})}catch{return null}})(),[d,B,f,Q]=await Promise.all([s,g,c,I]),y=Array.isArray(d.paths)?d.paths:[],m=d.current??null,T=B.find(L=>L.sessionId===a),_=a?lA(T?.title)??lA(T?.name)??A??a:null,R=B.map(L=>({id:L.sessionId,title:L.title??L.name??L.sessionId})).slice(0,20);a&&(R=R.filter(L=>L.id!==a),R.unshift({id:a,title:_??a}),R=R.slice(0,20));let K=this.#r?.includesArchivedSessions?.()??!1;this.#se(t,{kind:"menu",chatId:o}),await this.#V(o,n6({workspaces:y,currentWorkspace:m,currentSession:a?{id:a,title:_}:null,sessions:R,archiveVisible:K,presetCatalog:f,modelCatalog:Q}),{key:t,updateMessageId:i,replyTo:e})}async#fA(t,o){try{if(typeof this.#t.workspaceSession=="function"){let e=this.#t.workspaceSession(o);if(e&&typeof e=="object"){let a=lA(e.title)??lA(e.name)??lA(e.displayName);if(a)return a}}let i=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;if(i&&typeof this.#t.listWorkspaceSessions=="function"){let e=await this.#t.listWorkspaceSessions(i),a=(Array.isArray(e?.sessions)?e.sessions:[]).find(A=>A.sessionId===o);if(a){let A=lA(a.title)??lA(a.name);if(A)return A}}}catch{}return null}async#$e(t,o,{updateMessageId:i=null}={}){try{let e=await this.#t.agentPresetSettings({signal:this.#$()}),a=e.agentPresetCatalog;a._currentId=e.agentPreset,await this.#V(o,s6(a),{key:t,updateMessageId:i})}catch(e){await this.#x(o,e,{logLabel:"preset card",replyTo:i})}}async#eA(t,o,{updateMessageId:i=null}={}){try{let e=this.#$();await this.#t.ensureRunning({signal:e});let a=this.#r?.sessionFor?.(t),A;if(typeof a=="string"&&a){let r=this.#t.workspaceSession(a);r?.models&&(A=await r.models({signal:e}))}A||(A=await this.#t.listModels({signal:e})),await this.#V(o,g6(A),{key:t,updateMessageId:i})}catch(e){await this.#x(o,e,{logLabel:"model card",replyTo:i})}}async#AA(t,o,i=null){try{await this.#t.ensureRunning({signal:this.#w});let e=[w("\u8FDE\u63A5\u6B63\u5E38")],a=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;a&&e.push(w("\u5DE5\u4F5C\u533A\uFF1A{workspace}",{workspace:a}));let A=typeof this.#t.agentPresetSettings=="function"?await this.#t.agentPresetSettings({signal:this.#w}).catch(()=>null):null;if(A){let r=A.agentPresetCatalog?.items?.find(s=>s.id===A.agentPreset);e.push(w("\u9884\u8BBE\uFF1A{preset}",{preset:r?`${r.label}\uFF08${r.id}\uFF09`:A.agentPreset||w("\u8DDF\u968F\u9ED8\u8BA4")}))}await this.#b(o,e.join(` +`),{replyTo:i})}catch(e){await this.#x(o,e,{logLabel:"status text",replyTo:i})}}async#tA(t,o,{updateMessageId:i=null}={}){try{let e=this.#$();await this.#t.ensureRunning({signal:e});let a={connected:!0,workspace:null,preset:null,model:null,sessionCount:0};try{let A=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;a.workspace=A||w("\u672A\u77E5")}catch{}try{let A=await this.#t.agentPresetSettings({signal:e}),r=A.agentPresetCatalog.items.find(s=>s.id===A.agentPreset);a.preset=r?`${r.label}\uFF08${r.id}\uFF09`:A.agentPreset||w("\u8DDF\u968F\u9ED8\u8BA4")}catch{}try{let A=this.#r?.sessionFor?.(t);if(typeof A=="string"&&A){let r=this.#t.workspaceSession(A);if(r?.models){let s=await r.models({signal:e});s.current&&(a.model=`${s.current.provider}/${s.current.model}`)}}}catch{}try{let A=typeof this.#t.currentWorkspace=="function"?this.#t.currentWorkspace():null;if(A){let r=await this.#t.listWorkspaceSessions(A,{signal:e});Array.isArray(r?.sessions)&&(a.sessionCount=r.sessions.length)}}catch{}await this.#V(o,c6(a),{key:t,updateMessageId:i})}catch(e){await this.#x(o,e,{logLabel:"status card",replyTo:i})}}async#rA(t,o,{updateMessageId:i=null}={}){await this.#V(o,l6(oke.map(e=>w(e))),{key:t,updateMessageId:i})}async#aA(t,o,i=null){try{let e=await bi("/compact",this.#t,this.#r,t,{signal:this.#w});await this.#b(o,e?.message||w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002"),{replyTo:i})}catch(e){await this.#x(o,e,{logLabel:"compact",replyTo:i})}}async#iA(t,o,i=null){try{let e=await Mi("/stop",this.#t,this.#r,t,{signal:this.#w,control:{owner:this,key:t}});e?.stopped&&await Promise.allSettled([this.#Oe(t),this.#D.closeRoute(t)]),await this.#b(o,e?.message||w("/stop \u6267\u884C\u5B8C\u6210\u3002"),{replyTo:i})}catch(e){await this.#x(o,e,{logLabel:"stop",replyTo:i})}}async#oA(t,o,{updateMessageId:i=null}={}){let e=!!this.#r.sessionFor?.(t);this.#se(t,{kind:"steer"}),await this.#V(o,B6({hasSession:e}),{key:t,updateMessageId:i})}async#Ce(t,o){let{key:i,chatId:e}=t,a=await Mi(`/steer ${o}`,this.#t,this.#r,i,{signal:this.#w,pendingInteraction:this.#oe(i),control:{owner:this,key:i}});await this.#b(e,a?.message||w("\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\u3002"),{replyTo:t.messageId??null})}async#Re(t,o,{updateMessageId:i=null,replyTo:e=null}={}){try{let a=await _i("/preset --default",this.#t,this.#r,t,{signal:this.#w});for(let A of a?.messages??[a?.message])A&&await this.#b(o,A,{replyTo:e})}catch(a){await this.#x(o,a,{logLabel:"preset reset",replyTo:i});return}try{await this.#X(t,o,{updateMessageId:i,replyTo:e})}catch(a){this.#O.warn?.("[dsh-feishu] menu refresh failed after preset reset:",a.message)}}async#nA(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=/^\d+$/u.test(i)?`id:${i}`:i,r=await _i(`/preset ${A}`,this.#t,this.#r,t,{signal:this.#w});for(let s of r?.messages??[r?.message])s&&await this.#b(o,s,{replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"preset selection",replyTo:e});return}try{await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){this.#O.warn?.("[dsh-feishu] menu refresh failed after preset select:",A.message)}}async#sA(t,o,i,{updateMessageId:e=null,replyTo:a=null}={}){try{let A=await to(`/model ${i}`,this.#t,this.#r,t,{signal:this.#w,pendingInteraction:this.#oe(t),control:{owner:this,key:t}});for(let r of A?.messages??[A?.message])r&&await this.#b(o,r,{replyTo:a})}catch(A){await this.#x(o,A,{logLabel:"model selection",replyTo:e});return}try{await this.#X(t,o,{updateMessageId:e,replyTo:a})}catch(A){this.#O.warn?.("[dsh-feishu] menu refresh failed after model select:",A.message)}}#ke(){if(this.#q||typeof this.#t?.watchHarnessEvents!="function"||this.#w?.aborted)return;let t=this.#w??new AbortController().signal;try{this.#q=this.#t.watchHarnessEvents({signal:t,onSessionEvent:o=>this.#lA(o),onReconnect:()=>{this.#pA()}}),Promise.resolve(this.#q).catch(o=>{t.aborted||this.#O.warn?.("[dsh-feishu] event watcher stopped:",o.message)})}catch(o){this.#q=null,this.#O.warn?.("[dsh-feishu] event watcher failed to start:",o.message)}}#ve(t,o){let i=this.#W.get(t)??Promise.resolve(),e;return e=i.then(o,o).catch(a=>{this.#w?.aborted||this.#O.warn?.("[dsh-feishu] completion event failed:",a.message)}).finally(()=>{this.#W.get(t)===e&&this.#W.delete(t)}),this.#W.set(t,e),e}#ue(t=Date.now()){let o=0;for(let[i,e]of this.#M){for(let[a,A]of e)(!Number.isSafeInteger(A?.arrivalAt)||A.arrivalAt<0||A.arrivalAt+VRe<=t)&&e.delete(a);for(;e.size>ZRe;){let a=e.keys().next().value;if(a===void 0)break;e.delete(a)}e.size===0?this.#M.delete(i):o+=e.size}for(;this.#M.size>WRe;){let i=this.#M.keys().next().value;if(i===void 0)break;o-=this.#M.get(i)?.size??0,this.#M.delete(i)}for(;o>XRe;){let i=this.#M.keys().next().value;if(i===void 0)break;let e=this.#M.get(i),a=e?.keys().next().value;if(a===void 0){this.#M.delete(i);continue}e.delete(a),o-=1,e.size===0&&this.#M.delete(i)}}#gA(t,o,i=Date.now()){this.#ue(i);let e=this.#M.get(t);e||(e=new Map);let a=o?.data?.reason,A=typeof a=="string"?a:typeof a?.kind=="string"?{kind:a.kind}:null;e.delete(o.seq),e.set(o.seq,{arrivalAt:i,event:{type:"turn/end",seq:o.seq,...Number.isSafeInteger(o.time)&&o.time>=0?{time:o.time}:{},data:{reason:A}}}),this.#M.delete(t),this.#M.set(t,e),this.#ue(i)}async#cA(t,{workspaceHint:o=null,signal:i=this.#w}={}){if(typeof t!="string"||t==="")return{error:w("\u7528\u6CD5\uFF1A/watch ")};let e=/^\d{1,4}$/.test(t)?Number(t):null,a=typeof this.#t?.currentWorkspace=="function"?this.#t.currentWorkspace():null,A=async s=>{let g=await this.#t.listWorkspaceSessions(s,{signal:i});return Array.isArray(g?.sessions)?g.sessions:[]};if(e!==null){if(!a)return{error:w("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\uFF0C\u65E0\u6CD5\u6309\u5E8F\u53F7\u89E3\u6790\u4F1A\u8BDD\u3002")};let s=this.#ge(await A(a)),g=s[e-1];return g?.sessionId?{sessionId:g.sessionId,title:g.title??w("\u6682\u65E0\u6807\u9898"),workspace:a,...bn(g.lastSeq)?{lastSeq:g.lastSeq}:{}}:{error:w("\u5F53\u524D\u5DE5\u4F5C\u533A\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:s.length})}}let r;if(lA(o))r=[o];else{let s=typeof this.#t?.listWorkspaces=="function"?(await this.#t.listWorkspaces({signal:i})).filter(g=>g!==a):[];r=[a,...s].filter(Boolean)}for(let s of r){let c=(await A(s)).find(I=>I.sessionId===t);if(c)return{sessionId:t,title:c.title??w("\u6682\u65E0\u6807\u9898"),workspace:s,...bn(c.lastSeq)?{lastSeq:c.lastSeq}:{}}}return{error:w("\u6CA1\u6709\u627E\u5230\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u8BF7\u7528 /sessionlist \u67E5\u770B\u53EF\u7528\u4F1A\u8BDD\u3002")}}async#IA(t){let o=lA(t)??(typeof this.#t?.currentWorkspace=="function"?lA(this.#t.currentWorkspace()):null);if(!o||typeof this.#t?.listWorkspaceSessions!="function")return new Map;let i=await this.#t.listWorkspaceSessions(o,{signal:this.#$()});return new Map(this.#ge(Array.isArray(i?.sessions)?i.sessions:[]).filter(e=>lA(e?.sessionId)).map(e=>[e.sessionId,{sessionId:e.sessionId,title:e.title??e.name??w("\u6682\u65E0\u6807\u9898"),workspace:o,...bn(e.lastSeq)?{lastSeq:e.lastSeq}:{}}]))}#Pe(t){let o=this.#z.get(t);if(o)return o.requested=!0,o.promise;let i={requested:!0,promise:null};return this.#z.set(t,i),i.promise=Promise.resolve().then(async()=>{try{do i.requested=!1,await this.#ve(t,()=>this.#Fe(t));while(i.requested&&!this.#w?.aborted)}finally{this.#z.get(t)===i&&this.#z.delete(t)}}),i.promise}async#Be(t,o,i,{notify:e=!0,validatedTarget:a=null,workspaceHint:A=null,replyTo:r=null}={}){let s=Date.now(),g=async y=>{e&&await this.#b(o,y,{replyTo:r}).catch(m=>{this.#O.warn?.("[dsh-feishu] watch notification failed:",m.message)})};if(this.#ke(),typeof this.#r?.setWatch!="function")return await g(w("\u5F53\u524D\u72B6\u6001\u5B58\u50A8\u4E0D\u652F\u6301\u5173\u6CE8\u3002")),{ok:!1,changed:!1,reason:"unsupported"};let c;try{c=a?.sessionId===i?a:await this.#cA(i,{workspaceHint:A,signal:A?this.#$():this.#w})}catch(y){return await g(w("\u65E0\u6CD5\u89E3\u6790\u4F1A\u8BDD\uFF1A{message}",{message:Du(y)})),{ok:!1,changed:!1,reason:"resolve"}}if(c.error)return await g(c.error),{ok:!1,changed:!1,reason:"not-found"};let I=this.#r.watchEntries?.(t)??[],d=I.find(y=>y.sessionId===c.sessionId);if(!d&&I.length>=oS)return await g(w("\u6BCF\u4E2A\u804A\u5929\u6700\u591A\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002",{count:oS})),{ok:!1,changed:!1,reason:"limit"};let B=bn(d?.lastSeq)?d.lastSeq:bn(c.lastSeq)?c.lastSeq:null,Q=lS(d)??(d?null:s);try{await this.#r.setWatch(t,{sessionId:c.sessionId,title:c.title,chatId:o,lastSeq:B,...Q!==null?{watchStartedAt:Q}:{},...r?{replyToMessageId:r}:d?.replyToMessageId?{replyToMessageId:d.replyToMessageId}:{}})}catch(y){return await g(w("\u5173\u6CE8\u5931\u8D25\uFF1A{message}",{message:Du(y)})),{ok:!1,changed:!1,reason:"persist"}}return(!d||Q!==null||!bn(B))&&this.#Pe(c.sessionId),await g(w("\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u300C{title}\u300D\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u63A8\u9001\u7ED3\u679C\u3002",{title:String(c.title).replace(/\s+/gu," ")})),{ok:!0,changed:!d,entry:this.#r.watchEntry?.(t,c.sessionId)}}async#fe(t,o,i,{notify:e=!0,replyTo:a=null}={}){let A=async g=>{e&&await this.#b(o,g,{replyTo:a}).catch(c=>{this.#O.warn?.("[dsh-feishu] unwatch notification failed:",c.message)})};if(typeof this.#r?.removeWatch!="function")return{ok:!1,changed:!1,reason:"unsupported"};let r=this.#r.watchEntries?.(t)??[],s=typeof i=="string"&&/^\d{1,4}$/.test(i)?r[Number(i)-1]:r.find(g=>g.sessionId===i);if(!s)return await A(w("\u5173\u6CE8\u5217\u8868\u91CC\u6CA1\u6709\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /watchlist \u67E5\u770B\u3002")),{ok:!0,changed:!1,reason:"absent"};try{await this.#r.removeWatch(t,s.sessionId),this.#j.delete(`${t}\0${s.sessionId}`)}catch(g){return await A(w("\u53D6\u6D88\u5931\u8D25\uFF1A{message}",{message:Du(g)})),{ok:!1,changed:!1,reason:"persist"}}return await A(w("\u5DF2\u53D6\u6D88\u5173\u6CE8\u300C{title}\u300D\u3002",{title:String(s.title??"").replace(/\s+/gu," ")})),{ok:!0,changed:!0,entry:s}}async#Qe(t,o,{updateMessageId:i=null,replyTo:e=null}={}){let a=this.#r.watchEntries?.(t)??[],A=[],r=null;try{if(r=typeof this.#t?.currentWorkspace=="function"?this.#t.currentWorkspace():null,r&&typeof this.#t?.listWorkspaceSessions=="function"){let s=await this.#t.listWorkspaceSessions(r,{signal:this.#$()});A=this.#ge(Array.isArray(s?.sessions)?s.sessions:[]).map(g=>({sessionId:g.sessionId,title:g.title??g.name??g.sessionId}))}}catch{}this.#se(t,{kind:"watches",entries:a}),await this.#V(o,E6(a,A),{key:t,updateMessageId:i,replyTo:e,sessionWorkspace:r})}#lA({sessionId:t,event:o}){this.#w?.aborted||!t||!o||typeof o!="object"||o.type!=="turn/end"||!Mu(o.seq)||(this.#gA(t,o),this.#ve(t,async()=>{let i=this.#r.keysWatching?.(t)??[],e=i.some(A=>IS(this.#r.watchEntry?.(A,t))),a=i.some(A=>this.#j.has(`${A}\0${t}`));(e||a)&&await this.#Fe(t),await this.#Ge(t,o)}))}async#Ge(t,o,{keys:i=null}={}){if(this.#w?.aborted||typeof this.#r?.keysWatching!="function")return;let e=o?.data?.reason?.kind??o?.data?.reason??null,a=i??this.#r.keysWatching(t);for(let A of a){if(this.#w?.aborted)return;let r=this.#r.watchEntry?.(A,t),s=`${A}\0${t}`,g=this.#j.get(s);if(Mu(g)&&bn(r?.lastSeq)&&r.lastSeq>=g&&(this.#j.delete(s),g=void 0),!(!r?.chatId||IS(r)||bn(r.lastSeq)&&r.lastSeq>=o.seq||Mu(g)&&o.seq>g))try{await this.#V(r.chatId,C6(t,r.title,e),{key:A,replyTo:r.replyToMessageId??null});let c=this.#r.watchEntry?.(A,t);if(!c||c.chatId!==r.chatId||IS(c)||bn(c.lastSeq)&&c.lastSeq>=o.seq)continue;await this.#r.setWatch(A,{...c,lastSeq:o.seq}),g===o.seq&&this.#j.delete(s)}catch(c){this.#j.set(s,Mu(g)?Math.min(g,o.seq):o.seq),this.#O.warn?.("[dsh-feishu] completion push failed:",c.message)}}}async#Fe(t){if(!(this.#w?.aborted||typeof this.#t?.rpc!="function"))try{let o=await this.#t.rpc("session.history",{sessionId:t,maxMessages:20},3e4,{signal:this.#w}),i=ske(o);this.#ue();let e=this.#M.get(t)??new Map,a=new Map(i.map(g=>[g.seq,g]));for(let[g,c]of e)a.has(g)||a.set(g,c.event);let A=[...a.values()].sort((g,c)=>g.seq-c.seq),r=A.at(-1)?.seq??-1,s=typeof this.#r?.keysWatching=="function"?this.#r.keysWatching(t):[];for(let g of s){let c=this.#r.watchEntry?.(g,t);if(!IS(c))continue;let I=lS(c),d=bn(c.lastSeq)?c.lastSeq:-1,B=I===null?null:A.find(T=>{if(T.seq<=d)return!1;let _=Number.isSafeInteger(T.time)&&T.time>=0?T.time:e.get(T.seq)?.arrivalAt;return Number.isSafeInteger(_)&&_>=I}),f=B?Math.max(d,B.seq-1):Math.max(d,r),Q=this.#r.watchEntry?.(g,t);if(!Q||Q.chatId!==c.chatId||Q.lastSeq!==c.lastSeq||lS(Q)!==I)continue;let{watchStartedAt:y,...m}=Q;await this.#r.setWatch(g,{...m,lastSeq:f})}for(let g of A)g.type==="turn/end"&&await this.#Ge(t,g,{keys:s})}catch(o){this.#w?.aborted||this.#O.warn?.(`[dsh-feishu] watch compensation failed for ${t}:`,o.message)}}async#pA(){let t=typeof this.#r?.watchedSessionIds=="function"?this.#r.watchedSessionIds():[];this.#w?.aborted||await Promise.allSettled(t.map(o=>this.#Pe(o)))}#ye(t,o,i){return{timeoutMs:this.#T,signal:this.#w,control:{owner:this,key:o},onInteraction:e=>this.#EA(e,{key:o,actor:xd(t),chatId:t.message.chat_id,requiresMention:t.message.chat_type!=="p2p",replyToMessageId:t.message.message_id}),onInteractionResolved:e=>this.#CA(e),files:i}}async#me(t,o,{deliveryId:i,presentation:e,replyTo:a=null}){let A=[];for(let r of a6(o)){this.#w?.throwIfAborted();let s=await this.#b(t,r,{replyTo:a});s&&A.push(s)}return Zt({deliveryId:i,presentation:e,providerMessageIds:A})}async#pe(t,o,i=[],e){let a=await vo({artifacts:i,baseReceipt:e,deliveryId:e?.deliveryId??i[0]?.deliveryKey??o,aggregatePresentation:e?"feishu-text-and-files":"feishu-files",channelKey:"feishu",signal:this.#w,sendImage:typeof this.#A?.sendImage=="function"?A=>this.#A.sendImage(t,A,{replyTo:o,signal:this.#w}):void 0,sendFile:typeof this.#A?.sendFile=="function"?A=>this.#A.sendFile(t,A,{replyTo:o,signal:this.#w}):void 0,onFailure:(A,r)=>At(this.#E,r,{userMessage:nke(A?.fileName,r),reason:r?.code}),sendFailureNotice:async(A,r,s)=>({messageId:await this.#b(t,dt(s))}),logger:this.#O});return this.#E.artifactsSent=(this.#E.artifactsSent??0)+a.artifactsSent,this.#E.artifactSendErrors=(this.#E.artifactSendErrors??0)+a.artifactSendErrors,a.receipt?{receipt:a.receipt,failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}:{receipt:Zt({deliveryId:o,presentation:"feishu-files"}),failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}}async#dA(t,o,i,{onAskComplete:e}={}){let a=t.message.chat_id,A=t.message.message_id,r=i.content,s=!1,g=()=>{s||(s=!0,e?.())},c=Tt(i)?await Oo(i,{signal:this.#w}):void 0,I=this.#c.get(A);if(I&&(c=To(c??r,I,()=>({channel:"feishu",senderId:xd(t)}))),!this.#A?.stream){let{answer:m,artifacts:T=[]}=await Oi({harness:this.#t,state:this.#r,key:o,text:r,content:c,createOptions:{signal:this.#w},existsOptions:{signal:this.#w},askOptions:this.#ye(t,o,i.files)});g();let _,R=null;try{_=await this.#me(a,cS(m,T),{deliveryId:A,presentation:"feishu-text",replyTo:A})}catch(F){R=ka(F),this.#O.warn?.("[dsh-feishu] final text delivery failed; continuing with result files:",F)}let K=await this.#pe(a,A,T,_),L=K.receipt.artifacts.some(({outcome:F})=>F==="sent"||F==="unknown");if(R&&!L&&!K.failureNoticeVisible)throw R;return R&&K.artifactSendErrors===0&&At(this.#E,R),this.#E.streamFallbacks=(this.#E.streamFallbacks??0)+1,{...K,textDeliveryErrors:R?1:0}}let d=!1,B="",f=[],Q;try{Q=await this.#A.stream(a,{markdown:async m=>{d=!0;let T={...this.#ye(t,o,i.files),onUpdate:async R=>{await m.setContent(this.#uA(R)),this.#E.streamUpdates=(this.#E.streamUpdates??0)+1}},_=await Oi({harness:this.#t,state:this.#r,key:o,text:r,content:c,createOptions:{signal:this.#w},existsOptions:{signal:this.#w},askOptions:T});g(),B=_.answer,f=_.artifacts??[],await m.setContent(cS(B,f))}},{replyTo:A})}catch(m){if(this.#E.streamErrors=(this.#E.streamErrors??0)+1,B||f.length>0){this.#O.warn?.("[dsh-feishu] native stream failed after generation; sending final text:",m.message);let q,V=null;try{q=await this.#me(a,cS(B,f),{deliveryId:A,presentation:"feishu-text-fallback",replyTo:A})}catch(J){V=ka(J),this.#O.warn?.("[dsh-feishu] fallback text delivery failed; continuing with result files:",J)}let x=await this.#pe(a,A,f,q),G=x.receipt.artifacts.some(({outcome:J})=>J==="sent"||J==="unknown");if(V&&!G&&!x.failureNoticeVisible)throw V;return V&&x.artifactSendErrors===0&&At(this.#E,V),this.#E.streamFallbacks=(this.#E.streamFallbacks??0)+1,{...x,textDeliveryErrors:V?1:0}}if(d)throw m;this.#O.warn?.("[dsh-feishu] native stream unavailable; using text fallback:",m.message);let{answer:T,artifacts:_=[]}=await Oi({harness:this.#t,state:this.#r,key:o,text:r,content:c,createOptions:{signal:this.#w},existsOptions:{signal:this.#w},askOptions:this.#ye(t,o,i.files)});g();let R,K=null;try{R=await this.#me(a,cS(T,_),{deliveryId:A,presentation:"feishu-text-fallback",replyTo:A})}catch(q){K=ka(q),this.#O.warn?.("[dsh-feishu] fallback text delivery failed; continuing with result files:",q)}let L=await this.#pe(a,A,_,R),F=L.receipt.artifacts.some(({outcome:q})=>q==="sent"||q==="unknown");if(K&&!F&&!L.failureNoticeVisible)throw K;return K&&L.artifactSendErrors===0&&At(this.#E,K),this.#E.streamFallbacks=(this.#E.streamFallbacks??0)+1,{...L,textDeliveryErrors:K?1:0}}let y=await this.#pe(a,A,f,Zt({deliveryId:A,presentation:"feishu-cardkit",providerMessageIds:Ua(Q)}));return this.#E.streamResponses=(this.#E.streamResponses??0)+1,y}async#hA(t,o,i,e,a){this.#w?.throwIfAborted();let A=this.#n.get(i),r=e.claimedReplyMessageId===o;if(!A||A!==e||A.submitting)return this.#Se(t,i)?this.#we(t,o):r&&(!A||A!==e)?this.#we(t,o):this.#Y(t,o,i,a,{releaseMessageId:!1,finalize:!1});if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1;let s=Hd(t);if(!s){await this.#b(t.message.chat_id,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"));return}let g=this.#n.get(i);if(!g||g!==e||g.submitting){if(this.#Se(t,i)){await this.#b(t.message.chat_id,sS(),{replyTo:t.message.message_id}).catch(()=>{});return}if(r&&(!g||g!==e)){await this.#b(t.message.chat_id,sS(),{replyTo:t.message.message_id});return}return this.#Y(t,o,i,a,{releaseMessageId:!1,alreadyRecorded:!0,finalize:!1})}if(g.chatId=t.message.chat_id,g.needsPresentation){try{await this.#de(g)}catch{this.#E.lastError="\u98DE\u4E66\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002",this.#O.error?.("[dsh-feishu] failed to retry an interaction question"),g.interaction.reconnect?.()}return}let c=g.questions[g.index];if(c){if(g.answers.push(wi(c,s)),g.index+=1,g.index{});return}g.submitting=!1,g.answers.pop(),g.index-=1,this.#E.lastError="\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002",this.#O.error?.("[dsh-feishu] failed to answer a Harness interaction"),await this.#b(t.message.chat_id,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#EA(t,{key:o,actor:i,chatId:e,requiresMention:a,replyToMessageId:A}){if(await this.#D.handleRequested(t,{key:o,actor:i,requiresMention:a,send:I=>this.#b(e,I,{replyTo:A})})||t?.kind!=="question")return;let r=t?.payload?.questions,s=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t.rpcId!="string"||typeof s!="string"||typeof t.sessionId!="string"||!Array.isArray(r)||r.length===0||r.some(I=>!mi(I))){this.#O.warn?.("[dsh-feishu] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Feishu safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#b(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),{replyTo:A}).catch(()=>{});return}let g=this.#n.get(o);if(g?.interactionId===s){g.interaction=t,g.needsPresentation&&await this.#de(g);return}if(this.#s.has(s))return;if(g){await t.respond({ok:!1,error:{code:"cancelled",message:"Feishu is already handling another user interaction.",details:{}}});return}let c={kind:"question",interactionId:s,sessionId:t.sessionId,interaction:t,key:o,actor:i,requiresMention:a,questions:r,answers:[],index:0,chatId:e,replyToMessageId:A,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,questionMessageIds:new Set,inactive:!1};this.#n.set(o,c),this.#s.set(c.interactionId,o),await this.#de(c)}async#CA(t){if(await this.#D.handleResolved(t))return;let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#s.get(o);if(!i)return;let e=this.#n.get(i);e&&this.#ce(i,e),this.#De(i,o)}async#de(t){let o=t.questions[t.index];if(!o)return;let i=await this.#b(t.chatId,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention}),{replyTo:t.replyToMessageId});i&&(t.questionMessageIds.add(i),t.inactive&&this.#ce(t.key,t)),t.needsPresentation=!1}#ce(t,o){let i=Date.now()+URe;for(let e of o.questionMessageIds??[])this.#p.set(e,{key:t,expiresAt:i})}#Se(t,o){let i=Date.now();for(let[e,a]of this.#p)a.expiresAt<=i&&this.#p.delete(e);for(let e of[t?.message?.parent_id,t?.message?.root_id]){let a=this.#p.get(e);if(a?.key===o&&a.expiresAt>i)return!0}return!1}async#we(t,o){this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#E.lastMessageAt=new Date().toISOString(),this.#E.messagesReceived+=1,await this.#b(t.message.chat_id,sS(),{replyTo:t.message.message_id}).catch(()=>{}))}#Le(t,o){let i=this.#n.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#n.delete(t),this.#s.delete(i.interactionId),i.inactive=!0,i)}#De(t,o){return this.#Le(t,o)!==null}async#Oe(t){let o=this.#Le(t);if(!(!o||o.kind!=="question")){this.#ce(t,o);try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Feishu interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#O.warn?.("[dsh-feishu] failed to cancel a pending Harness interaction")}}}#uA(t){return t.type==="text"&&t.text?t.text:t.type==="tool"?t.name==="web_search"?w("_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_"):w("_\u6B63\u5728\u4F7F\u7528 {name}\u2026_",{name:t.name||w("\u5DE5\u5177")}):w("_{text}_",{text:t.text||w("\u6B63\u5728\u5904\u7406\u2026")})}#BA(t){return JQ({adapter:this.#A,target:t,reactions:{processing:"OnIt",success:"DONE",error:"ERROR"},status:this.#E,logger:this.#O,label:"feishu"})}#Ue(t,o){o.clear()}#Ae(t,o,i){i==="ERROR"?o.error():o.success()}async#b(t,o,{replyTo:i}={}){let e=JSON.stringify({text:o});if(i)try{let A=await this.#e.im.v1.message.reply({path:{message_id:i},data:{msg_type:"text",content:e}});if(A?.code&&A.code!==0)throw new Error(`Feishu reply failed: ${A.msg||A.code}`);return lA(A?.data?.message_id)}catch(A){this.#O.warn?.("[dsh-feishu] threaded reply failed; falling back to a plain message:",A?.message??String(A))}let a=await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"text",content:e}});if(a?.code&&a.code!==0)throw new Error(`Feishu send failed: ${a.msg||a.code}`);return lA(a?.data?.message_id)}};import{createHash as lke}from"node:crypto";var N6="stream_md",pke="\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026",Tu=28e3,dS=12e4,R6=new Map([[99991672,["artifact-permission-required","Feishu file delivery requires the im:resource permission."]],[234006,["artifact-too-large","The result file exceeds Feishu's size limit."]],[234010,["artifact-empty","Feishu does not accept empty files."]],[230017,["artifact-provider-rejected","Feishu rejected the uploaded file ownership."]],[230020,["artifact-rate-limited","Feishu temporarily rate-limited file delivery."]],[230049,["artifact-delivery-uncertain","Feishu could not confirm the file message result."]],[230055,["artifact-provider-rejected","Feishu rejected the file message type."]]]);function Cl(n,t){if(t?.code&&t.code!==0)throw new Error(`${n} failed: ${t.msg||t.code}`);return t}function k6(n){let t=[n],o=new Set,i;for(;t.length>0;){let e=t.shift();if(!e||o.has(e))continue;if(typeof e=="object"&&o.add(e),Array.isArray(e)){t.push(...e);continue}let a=Number(e?.code);if(Number.isFinite(a)&&a!==0){if(R6.has(a))return a;i??=a}t.push(e?.response?.data,e?.data,e?.error,e?.cause)}return i}function _u(n,t,o,{uncertain:i=!1}={}){let e=o==null?void 0:Number(o),a=Number.isFinite(e)&&e!==0?e:k6(t),A=Number.isFinite(a)?["artifact-provider-rejected",`Feishu rejected file ${n}.`]:i?["artifact-delivery-uncertain","Feishu could not confirm the file message result."]:["artifact-provider-failed",`Feishu file ${n} failed.`],[r,s]=R6.get(a)??A,g=new Error(s,{cause:t});return g.code=r,Number.isFinite(a)&&(g.providerCode=a),g}function M6(n,t){if(!Number.isInteger(n)||n<1||n>dS)throw new TypeError(`${t} must be an integer between 1 and ${dS}`);return n}function hP(n){return n?.reason??new DOMException("The operation was aborted","AbortError")}function dke(n){let t=new Error(`Feishu file ${n} timed out.`);return t.code="provider-timeout",t}function _6(n,{signal:t,timeoutMs:o,stage:i}){t?.throwIfAborted();let e=new AbortController,a=t?AbortSignal.any([t,e.signal]):e.signal;return new Promise((A,r)=>{let s=!1,g=(d,B)=>{s||(s=!0,clearTimeout(I),a.removeEventListener("abort",c),d(B))},c=()=>g(r,t?.aborted?hP(t):dke(i)),I=setTimeout(()=>e.abort(),o);a.addEventListener("abort",c,{once:!0}),Promise.resolve().then(()=>n(a)).then(d=>g(A,d),d=>g(r,d)),a.aborted&&c()})}function hke(n,t,o){let i=`${n.deliveryKey}\0${t}`;return`dshim_${lke("sha256").update(o==="file"?i:`${i}\0${o}`).digest("hex").slice(0,40)}`}function Eke(n){let t=String(n??"").replace(/\s+/g," ").trim();return t.length<=50?t:`${EP(t,49)}\u2026`}function EP(n,t){let o=Math.min(n.length,t),i=n.charCodeAt(o-1),e=n.charCodeAt(o);return i>=55296&&i<=56319&&e>=56320&&e<=57343&&(o-=1),n.slice(0,o)}function T6(n){if(n.length<=Tu)return n;let t=` ${w("\u5185\u5BB9\u8F83\u957F\uFF0C\u751F\u6210\u5B8C\u6210\u540E\u5C06\u5206\u6BB5\u53D1\u9001\u5B8C\u6574\u56DE\u7B54\u3002")}`;return EP(n,Tu-t.length)+t}function Cke(n){let t=[],o=n;for(;o.length>Tu;){let i=EP(o,Tu),e=i.lastIndexOf(` -`)+1;e{let c=String(g??"")||"\u2026";await this.#i(a,T6(c)),A=c}};await o.markdown(r);let s=Cke(A);for(let[g,c]of s.entries()){let I=g===0?a:await this.#o(t,i.replyTo);g>0&&e.push(I),await this.#i(I,c),await this.#a(I)}return{messageId:a.messageId,providerMessageIds:e.map(g=>g.messageId)}}catch(a){for(let A of e)await this.#s(A.messageId);throw a}}async sendFile(t,o,{replyTo:i,signal:e}={}){return this.#l(t,o,{replyTo:i,signal:e,messageType:"file",presentation:"feishu-file"})}async sendImage(t,o,{replyTo:i,signal:e}={}){return this.#l(t,o,{replyTo:i,signal:e,messageType:"image",presentation:"feishu-image"})}async#l(t,o,{replyTo:i,signal:e,messageType:a,presentation:A}){if(e?.throwIfAborted(),typeof t!="string"||!t)throw new TypeError("chatId is required");if(!o||typeof o!="object"||typeof o.artifactId!="string"||!o.artifactId||typeof o.deliveryKey!="string"||!o.deliveryKey||typeof o.fileName!="string"||!o.fileName||!Buffer.isBuffer(o.bytes))throw new TypeError("A materialized result file is required");let r;try{r=await _6(Q=>{Q.throwIfAborted();let y=a==="image"?this.#e.im.v1.image.create({data:{image_type:"message",image:o.bytes}}):this.#e.im.v1.file.create({data:{file_type:"stream",file_name:o.fileName,file:o.bytes}});return un(o,y),y},{signal:e,timeoutMs:this.#t,stage:"upload"})}catch(Q){throw e?.aborted?hP(e):_u("upload",Q)}e?.throwIfAborted();let s=a==="image"?r?.image_key??r?.data?.image_key:r?.file_key??r?.data?.file_key;if(typeof s!="string"||!s)throw _u("upload",void 0,r?.code);let g=hke(o,t,a),c=JSON.stringify(a==="image"?{image_key:s}:{file_key:s}),I=i?{path:{message_id:i},data:{msg_type:a,content:c,uuid:g}}:{params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:a,content:c,uuid:g}},d=()=>{let Q=i?this.#e.im.v1.message.reply(I):this.#e.im.v1.message.create(I);return un(o,Q),Q},B;try{B=await _6(async Q=>{Q.throwIfAborted();let y;try{y=await d()}catch(m){if(k6(m)!==230049)throw m;y={code:230049}}return Q.throwIfAborted(),Number(y?.code)===230049&&(y=await d(),Q.throwIfAborted()),y},{signal:e,timeoutMs:this.#r,stage:"message send"})}catch(Q){throw e?.aborted?hP(e):_u("message send",Q,void 0,{uncertain:!0})}if(Number.isFinite(Number(B?.code))&&Number(B.code)!==0)throw _u("message send",void 0,B.code,{uncertain:!0});let f=B?.data?.message_id;if(typeof f!="string"||!f)throw _u("message send",void 0,void 0,{uncertain:!0});return Zt({deliveryId:o.deliveryKey,presentation:A,providerMessageIds:[f],artifacts:[{artifactId:o.artifactId,outcome:"sent"}]})}async#o(t,o){let i=T6(this.#A),a=Cl("Feishu card.create",await this.#e.cardkit.v1.card.create({data:{type:"card_json",data:JSON.stringify(uke(i))}}))?.data?.card_id;if(!a)throw new Error("Feishu card.create returned no card_id");let A=await this.#n(t,a,o);return{cardId:a,messageId:A,content:i,sequence:0}}async#i(t,o){if(o===t.content)return;let i=await this.#e.cardkit.v1.cardElement.content({path:{card_id:t.cardId,element_id:N6},data:{content:o,sequence:++t.sequence,uuid:`content_${t.cardId}_${t.sequence}`}});Cl("Feishu cardElement.content",i),t.content=o}async#a(t){let o=await this.#e.cardkit.v1.card.settings({path:{card_id:t.cardId},data:{settings:JSON.stringify({config:{streaming_mode:!1,summary:{content:Eke(t.content)||w("\u56DE\u7B54\u5B8C\u6210")}}}),sequence:++t.sequence,uuid:`settings_${t.cardId}_${t.sequence}`}});Cl("Feishu card.settings",o)}async#n(t,o,i){let e=JSON.stringify({type:"card",data:{card_id:o}}),a=i?await this.#e.im.v1.message.reply({path:{message_id:i},data:{msg_type:"interactive",content:e}}):await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"interactive",content:e}});Cl("Feishu message send",a);let A=a?.data?.message_id;if(!A)throw new Error("Feishu message send returned no message_id");return A}async#s(t){try{let o=await this.#e.im.v1.message.delete({path:{message_id:t}});Cl("Feishu message delete",o)}catch(o){console.warn("[bridge] unable to recall a failed streaming card:",o.message)}}async addReaction(t,o){let e=Cl("Feishu reaction.create",await this.#e.im.v1.messageReaction.create({path:{message_id:t},data:{reaction_type:{emoji_type:o}}}))?.data?.reaction_id;if(!e)throw new Error("Feishu reaction.create returned no reaction_id");return e}async removeReaction(t,o){Cl("Feishu reaction.delete",await this.#e.im.v1.messageReaction.delete({path:{message_id:t,reaction_id:o}}))}};var P6="/open-apis/application/v7/app_slash_commands",Bke=new Set(["99991640","99991672"]),ES=Object.freeze(["application:app_slash_command:read","application:app_slash_command:write"]),G6="ai-agent_outlined",CP=Object.freeze([{command:"menu",icon:"skill_outlined",default:"\u6253\u5F00\u529F\u80FD\u83DC\u5355",en_us:"Open the feature menu"},{command:"new",icon:"ai-deepthink_outlined",default:"\u5F00\u542F\u5168\u65B0\u4F1A\u8BDD",en_us:"Start a fresh session"},{command:"help",icon:"promptword_outlined",default:"\u67E5\u770B\u5E2E\u52A9",en_us:"Show help"},{command:"status",icon:"ai-functions_outlined",default:"\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001",en_us:"Show bot status"},{command:"compact",icon:"ai-block_outlined",default:"\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587",en_us:"Compact the current session"},{command:"sessionlist",icon:"chat-ai_outlined",default:"\u5217\u51FA\u4F1A\u8BDD",en_us:"List sessions"},{command:"workspacelist",icon:"folder_outlined",default:"\u5217\u51FA\u5DE5\u4F5C\u533A",en_us:"List workspaces"},{command:"watch",icon:"flag_outlined",default:"\u5173\u6CE8\u4E00\u4E2A\u4F1A\u8BDD",en_us:"Watch a session"},{command:"unwatch",icon:"clear_outlined",default:"\u53D6\u6D88\u5173\u6CE8\u4F1A\u8BDD",en_us:"Unwatch a session"},{command:"watchlist",icon:"flag_outlined",default:"\u67E5\u770B\u5173\u6CE8\u5217\u8868",en_us:"List watched sessions"},{command:"archived",icon:"folder_outlined",default:"\u8BBE\u7F6E\u5F52\u6863\u4F1A\u8BDD\u663E\u9690\uFF08on/off\uFF09",en_us:"Show or hide archived sessions (on/off)"}]);function uP(n,t){let o=n==="lark"?"https://open.larksuite.com":"https://open.feishu.cn";return new URL(t,o)}function v6(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${t} returned a non-JSON response`);if(n.code!==0){let o=new Error(`${t} failed: ${n.msg||`code ${n.code}`}`);throw o.code=String(n.code),o.msg=n.msg,o}return n}function BP(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function fP(n,t,o){try{return v6(await n.request(t),o)}catch(i){let e=i?.response?.data;if(e&&typeof e=="object"&&!Array.isArray(e)&&Object.hasOwn(e,"code"))return v6(e,o);throw i}}async function fke({appId:n,appSecret:t,domain:o,httpInstance:i,timeoutMs:e,signal:a}){if(!n||!t)throw new Error("Feishu slash registration requires app credentials");if(!i||typeof i.request!="function")throw new TypeError("Feishu slash registration requires an HTTP instance");let A=await fP(i,{method:"POST",url:uP(o,"/open-apis/auth/v3/tenant_access_token/internal").href,headers:{"content-type":"application/json; charset=utf-8"},data:{app_id:n,app_secret:t},signal:BP(a,e),timeout:e},"Feishu authentication");if(!A.tenant_access_token)throw new Error("Feishu authentication returned no tenant access token");return A.tenant_access_token}async function Qke({tenantAccessToken:n,domain:t,httpInstance:o,timeoutMs:i,signal:e}){let a=await fP(o,{method:"GET",url:uP(t,P6).href,headers:{authorization:`Bearer ${n}`,"content-type":"application/json; charset=utf-8"},signal:BP(e,i),timeout:i},"Feishu slash command list");return Array.isArray(a.data?.items)?a.data.items:[]}async function yke({tenantAccessToken:n,domain:t,httpInstance:o,timeoutMs:i,signal:e,command:a,description:A,icon:r=G6}){let s={command:a};return A&&(A.default_value||A.i18n)?s.description=A:typeof A=="string"&&A.trim()&&(s.description={default_value:A.trim()}),r&&(s.description={...s.description??{},icon:{icon_key:r}}),(await fP(o,{method:"POST",url:uP(t,P6).href,headers:{authorization:`Bearer ${n}`,"content-type":"application/json; charset=utf-8"},data:s,signal:BP(e,i),timeout:i},`Feishu slash command create (/${a})`)).data?.command_id??null}async function F6({appId:n,appSecret:t,domain:o="feishu",httpInstance:i,timeoutMs:e=15e3,signal:a,manifest:A=CP}){let r=await fke({appId:n,appSecret:t,domain:o,httpInstance:i,timeoutMs:e,signal:a}),s=new Set((await Qke({tenantAccessToken:r,domain:o,httpInstance:i,timeoutMs:e,signal:a})).map(I=>I.command)),g=[],c=[];for(let I of A){let d=String(I.command??"").replace(/^\//,"");if(d&&!s.has(d))try{let B={default_value:I.default??I.en_us??d,i18n:{zh_cn:I.default??d,en_us:I.en_us??I.default??d}},f=await yke({tenantAccessToken:r,domain:o,httpInstance:i,timeoutMs:e,signal:a,command:d,description:B,icon:I.icon??G6});g.push({command:d,command_id:f})}catch(B){if(B?.code==="40000000"&&/already exists/i.test(B?.msg??"")){s.add(d);continue}if(Bke.has(B?.code)||/(?:lacks permission|access denied)/i.test(B?.msg??"")){c.push({command:d,error:B});break}c.push({command:d,error:B?.message??String(B)})}}return{created:g,existing:[...s].filter(I=>I!=null),failed:c}}var Ske=15e3,wke="\u2705 \u4FEE\u590D\u5B8C\u6210\uFF1A\u5DF2\u5B9E\u6D4B\u6536\u5230 card.action.trigger\uFF0C\u83DC\u5355\u6309\u94AE\u73B0\u5728\u53EF\u7528\u3002",Dke="\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u8D85\u65F6\uFF1A\u672A\u6536\u5230\u6D4B\u8BD5\u5361\u6309\u94AE\u7684 card.action.trigger\uFF0C\u4E0D\u80FD\u786E\u8BA4\u6309\u94AE\u5DF2\u4FEE\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u7684\u5361\u7247\u56DE\u8C03\u914D\u7F6E\uFF0C\u786E\u8BA4\u540E\u518D\u53D1\u9001 /repair\u3002",QP="\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u5931\u8D25\uFF1A\u65E0\u6CD5\u53D1\u9001\u4E13\u7528\u6D4B\u8BD5\u5361\uFF0C\u4E0D\u80FD\u786E\u8BA4 card.action.trigger \u5DF2\u6062\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u673A\u5668\u4EBA\u6D88\u606F\u6743\u9650\u548C\u8FDE\u63A5\u72B6\u6001\u3002",Oke="\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u4E2D\u65AD\uFF1ARuntime \u5DF2\u505C\u6B62\uFF0C\u672A\u5B8C\u6210 card.action.trigger \u5B9E\u6D4B\uFF0C\u4E0D\u80FD\u786E\u8BA4\u4FEE\u590D\u6210\u529F\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u7B49\u5F85\u673A\u5668\u4EBA\u6062\u590D\u8FDE\u63A5\u3002",bke=new Set(["connected","connecting","reconnecting"]);function Mn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Mke(n){return Mn(n?.operator?.open_id)??Mn(n?.operator?.operator_id?.open_id)}function _ke(n,t){try{let o=n?.getConnectionStatus?.()?.state;return typeof o=="string"&&o?o:t}catch{return t}}function xd(n,t){let o=new Error(t);return o.code=n,o}function Tke(n,t){if(!n||typeof n.request!="function")return;let o=i=>({...i??{},timeout:i?.timeout??t});return{request:i=>n.request(o(i)),get:(i,e)=>n.get(i,o(e)),delete:(i,e)=>n.delete(i,o(e)),head:(i,e)=>n.head(i,o(e)),options:(i,e)=>n.options(i,o(e)),post:(i,e,a)=>n.post(i,e,o(a)),put:(i,e,a)=>n.put(i,e,o(a)),patch:(i,e,a)=>n.patch(i,e,o(a))}}function Nke({allowedSenderCount:n=1}={}){return{startedAt:null,ready:!1,feishuLongConnectionState:"idle",harnessReachable:!1,messagesReceived:0,messagesReplied:0,messagesRejected:0,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0,streamResponses:0,streamUpdates:0,streamFallbacks:0,streamErrors:0,cardActionsReceived:0,cardActionProbesVerified:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastCardActionAt:null,lastError:null,agentPreset:"standard",authorizationMode:"sender-open-id-allowlist",allowedSenderCount:n,slashCommandRegistration:"idle",slashCommandsRegistered:0,slashCommandsExisting:0,slashCommandsFailed:0,slashCommandsError:null}}var CS=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d;#h;#C;#u;#B=null;#f=null;#Q=null;#S=null;#y=null;#m=null;#D=new Map;#E;#N=!0;constructor({lark:t,botId:o,appId:i,appSecret:e,domain:a="feishu",botOpenId:A,groupResponseMode:r,ownerOpenId:s,ownerOpenIds:g,harness:c,state:I,contextEnhancement:d,accessPolicy:B,repair:f,replyTimeoutMs:Q=6e5,connectTimeoutMs:y=15e3,requestTimeoutMs:m=Ske,slashCommands:T=!0,wsAgent:_,logger:R=console}){if(!t)throw new Error("FeishuRuntime requires the Feishu SDK");if(!i||!e)throw new Error("FeishuRuntime requires app credentials");let K=Array.isArray(g)?g:[s],L=[...new Set(K.filter(F=>typeof F=="string"&&F))];if(L.length===0)throw new Error("FeishuRuntime requires at least one owner open_id");if(!c)throw new Error("FeishuRuntime requires a Harness client");if(!I)throw new Error("FeishuRuntime requires a state store");if(f!=null&&!Mn(o))throw new TypeError("FeishuRuntime repair capability requires a botId");if(!Number.isFinite(m)||m<=0)throw new TypeError("FeishuRuntime requestTimeoutMs must be a positive number");this.#e=t,this.#A=Mn(o),this.#t=i,this.#r=e,this.#l=a,this.#o=Mn(A),this.#i=Io(r),this.#a=L,this.#n=c,this.#s=I,this.#p=d,this.#c=B,this.#u=f??null,this.#g=Q,this.#I=y,this.#d=m,this.#N=!!T,this.#h=_,this.#C=R,this.#E=Nke({allowedSenderCount:L.length})}get status(){return structuredClone(this.#E)}setGroupResponseMode(t){this.#i=Io(t),this.#f?.setGroupResponseMode(this.#i)}async start(){for(;;){for(;this.#y;)await this.#y;if(this.#S)return this.#S;let o=this.#Q;if(o){let i=_ke(o,this.#E.feishuLongConnectionState);if(bke.has(i))return this.status;await this.stop({preserveError:i==="failed"});continue}if(this.#B||this.#f||this.#m){await this.stop({preserveError:this.#E.feishuLongConnectionState==="failed"});continue}break}let t;return t=this.#T().finally(()=>{this.#S===t&&(this.#S=null)}),this.#S=t,t}async#T(){let t=new AbortController;this.#m=t;let{signal:o}=t,i=()=>o.reason??new DOMException("Feishu runtime stopped","AbortError"),e=()=>!o.aborted&&this.#m===t,a=()=>{if(!e())throw i()};this.#E.startedAt=new Date().toISOString(),this.#E.feishuLongConnectionState="connecting",this.#E.lastError=null;try{await this.#n.ensureRunning({signal:o}),a(),this.#E.harnessReachable=!0;let A=this.#l==="lark"?this.#e.Domain.Lark:this.#e.Domain.Feishu,r={appId:this.#t,appSecret:this.#r,domain:A},s=Tke(this.#e.defaultHttpInstance,this.#d);s&&(r.httpInstance=s);let g=new this.#e.Client(r);this.#B=g;let c=new hS({client:g,initialText:w("\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026")}),I=new pS({client:g,channel:c,harness:this.#n,state:this.#s,contextEnhancement:this.#p,accessPolicy:this.#c,status:this.#E,allowedSenderOpenIds:new Set(this.#a),botId:this.#A,appId:this.#t,botOpenId:this.#o,groupResponseMode:this.#i,repair:this.#u,replyTimeoutMs:this.#g,signal:o,logger:this.#C});this.#f=I;let d=new this.#e.EventDispatcher({}).register({"im.message.receive_v1":T=>{e()&&I.accept(T)},"im.message.reaction.created_v1":()=>{},"im.message.reaction.deleted_v1":()=>{},"card.action.trigger":T=>{e()&&(this.#E.cardActionsReceived+=1,this.#E.lastCardActionAt=new Date().toISOString(),this.#O(T)||I.onCardAction(T))}}),B,f,Q=new Promise((T,_)=>{let R=!1,K=()=>{f(i())},L=(q,V)=>{R||(R=!0,clearTimeout(F),o.removeEventListener("abort",K),q(V))},F=setTimeout(()=>{L(_,new Error(`Feishu WebSocket handshake timed out after ${this.#I}ms`))},this.#I);B=()=>{L(T)},f=q=>{L(_,q)},o.addEventListener("abort",K,{once:!0}),o.aborted&&K()});Q.catch(()=>{});let y=new this.#e.WSClient({...r,...this.#h?{agent:this.#h}:{},loggerLevel:this.#e.LoggerLevel.info,handshakeTimeoutMs:this.#I,onReady:()=>{e()&&(this.#E.feishuLongConnectionState="connected",this.#E.ready=!0,this.#E.lastError=null,B())},onError:T=>{e()&&(this.#E.feishuLongConnectionState="failed",this.#E.ready=!1,this.#E.lastError=T?.message??String(T),this.#C.error("[dsh-feishu] Feishu long connection failed:",this.#E.lastError),f(T))},onReconnecting:()=>{e()&&(this.#E.feishuLongConnectionState="reconnecting",this.#E.ready=!1)},onReconnected:()=>{e()&&(this.#E.feishuLongConnectionState="connected",this.#E.ready=!0,this.#E.lastError=null)}});this.#Q=y;let m=Promise.resolve().then(()=>y.start({eventDispatcher:d})).catch(T=>{throw f(T),T});return await Promise.all([m,Q]),a(),this.#N&&s&&this.#R(s,e,o),this.status}catch(A){throw o.aborted||(this.#E.ready=!1,this.#E.feishuLongConnectionState="failed",this.#E.lastError=A?.message??String(A),await this.#G({preserveError:!0,abortController:t})),A}}async beginCardActionProbe({expectedOperatorOpenId:t,timeoutMs:o=9e4}={}){if(!this.#E.ready||!this.#B)throw xd("card_action_probe_unavailable","\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");let i=Mn(t);if(!i||i==="*")throw new TypeError("A precise Feishu operator open_id is required");if(!Number.isFinite(o)||o<=0||o>10*6e4)throw new TypeError("Card-action probe timeout must be between 1 and 600000ms");let e=mke().replaceAll("-",""),a;try{a=await this.#B.im.v1.message.create({params:{receive_id_type:"open_id"},data:{receive_id:i,msg_type:"interactive",content:p6(e)}})}catch{throw this.#w(i,w(QP),"failure"),xd("card_action_probe_send_failed","\u65E0\u6CD5\u53D1\u9001\u98DE\u4E66\u5361\u7247\u56DE\u8C03\u6D4B\u8BD5")}if(a?.code&&a.code!==0)throw this.#w(i,w(QP),"failure"),xd("card_action_probe_send_failed","\u65E0\u6CD5\u53D1\u9001\u98DE\u4E66\u5361\u7247\u56DE\u8C03\u6D4B\u8BD5");let A=Mn(a?.data?.message_id)??Mn(a?.message_id);if(!A)throw this.#w(i,w(QP),"failure"),xd("card_action_probe_send_failed","\u98DE\u4E66\u672A\u8FD4\u56DE\u6D4B\u8BD5\u5361\u7247\u7684\u6D88\u606F ID");return new Promise((r,s)=>{let g=setTimeout(()=>{let c=this.#D.get(A);!c||c.nonce!==e||(this.#D.delete(A),this.#w(i,w(Dke),"timeout"),s(xd("card_action_probe_timeout","\u5728\u89C4\u5B9A\u65F6\u95F4\u5185\u672A\u6536\u5230\u98DE\u4E66\u5361\u7247\u6309\u94AE\u56DE\u8C03")))},o);g.unref?.(),this.#D.set(A,{messageId:A,nonce:e,expectedOperatorOpenId:i,timeout:g,resolve:r,reject:s})})}#O(t){let o=Mn(t?.context?.open_message_id);if(!o)return!1;let i=this.#D.get(o);if(!i)return!1;let e=t?.action?.value,a=Mke(t);return e?.action!=="repair_verify"||e?.nonce!==i.nonce||a!==i.expectedOperatorOpenId?!1:(clearTimeout(i.timeout),this.#D.delete(o),this.#E.cardActionProbesVerified+=1,this.#w(a,w(wke),"success").finally(()=>{i.resolve({verified:!0,messageId:o,operatorOpenId:a})}),!0)}#w(t,o,i){let e=this.#B;return e?Promise.resolve().then(async()=>{let a=await e.im.v1.message.create({params:{receive_id_type:"open_id"},data:{receive_id:t,msg_type:"text",content:JSON.stringify({text:o})}});if(a?.code&&a.code!==0)throw new Error("Feishu callback repair notice failed");return!0}).catch(()=>(this.#C.warn?.(`[dsh-feishu] unable to send the callback repair ${i} notice`),!1)):(this.#C.warn?.(`[dsh-feishu] unable to send the callback repair ${i} notice`),Promise.resolve(!1))}async sendConnectionTest(t){if(!this.#E.ready||!this.#B){let e=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw e.code="test-target-unavailable",e}if(typeof t!="string"||!t.trim())throw new TypeError("Feishu connection test text is required");let o=async(e,a,A)=>{let r=await this.#B.im.v1.message.create({params:{receive_id_type:e},data:{receive_id:a,msg_type:"text",content:JSON.stringify({text:A})}});if(r?.code&&r.code!==0)throw new Error(`Feishu connection test failed: ${r.msg||r.code}`)},i=this.#a.find(e=>e!=="*");return i?(await o("open_id",i,t),{sent:!0}):nc({state:this.#s,text:t,channelLabel:w("\u98DE\u4E66\u673A\u5668\u4EBA"),send:async(e,a)=>{let A=typeof e?.chatId=="string"?e.chatId.trim():"";if(!A)throw Cr(w("\u98DE\u4E66\u673A\u5668\u4EBA"));await o("chat_id",A,a)}})}async sendProactiveText(t,o,{signal:i}={}){if(!this.#E.ready||!this.#B){let r=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw r.code="bot-not-connected",r}let e=t?.kind==="user"?"open_id":t?.kind==="group"?"chat_id":null,a=t?.kind==="user"?Mn(t?.route?.openId):t?.kind==="group"?Mn(t?.route?.chatId):null;if(!e||!a){let r=new TypeError("Invalid Feishu proactive delivery target");throw r.code="invalid-target",r}i?.throwIfAborted();let A=await this.#B.im.v1.message.create({params:{receive_id_type:e},data:{receive_id:a,msg_type:"text",content:JSON.stringify({text:o})}});if(A?.code&&A.code!==0){let r=new Error(`Feishu proactive delivery failed: ${A.msg||A.code}`);throw r.code="target-rejected",r}return{sent:!0}}async#R(t,o,i){this.#E.slashCommandRegistration="registering",this.#E.slashCommandsError=null;try{let e=await F6({appId:this.#t,appSecret:this.#r,domain:this.#l,httpInstance:t,signal:i,manifest:CP});if(!o())return;this.#E.slashCommandRegistration="done",this.#E.slashCommandsRegistered=e.created.length,this.#E.slashCommandsExisting=e.existing.length,this.#E.slashCommandsFailed=e.failed.length,this.#E.slashCommandsError=e.failed.length>0?e.failed.map(a=>`/${a.command}: ${a.error?.message??String(a.error)}`).join("; "):null,e.created.length>0&&this.#C.info?.(`[dsh-feishu] registered ${e.created.length} slash command(s)`),e.failed.length>0&&this.#C.warn?.(`[dsh-feishu] ${e.failed.length} slash command(s) failed to register: ${this.#E.slashCommandsError}`)}catch(e){if(!o())return;this.#E.slashCommandRegistration="failed",this.#E.slashCommandsError=e?.message??String(e),this.#C.warn?.(`[dsh-feishu] slash command registration skipped: ${this.#E.slashCommandsError}`)}}stop(t={}){if(this.#y)return this.#y;let o;return o=this.#_(t).finally(()=>{this.#y===o&&(this.#y=null)}),this.#y=o,o}async#_({preserveError:t=!1}={}){let o=this.#m;this.#m===o&&(this.#m=null),o?.abort(new DOMException("Feishu runtime stopped","AbortError"));let i=this.#S;return i&&await i.catch(()=>{}),this.#G({preserveError:t,abortController:o})}async#G({preserveError:t=!1,abortController:o}={}){let i=t?this.#E.lastError:null;this.#m===o&&(this.#m=null),o?.abort(new DOMException("Feishu runtime stopped","AbortError"));for(let A of this.#D.values())clearTimeout(A.timeout),this.#w(A.expectedOperatorOpenId,w(Oke),"abort"),A.reject(xd("abort","\u98DE\u4E66\u8FD0\u884C\u65F6\u5DF2\u505C\u6B62"));this.#D.clear(),this.#E.ready=!1;let e=this.#Q;this.#Q=null,e?.close({force:!0});let a=this.#f;return this.#f=null,a&&await a.waitForIdle(),this.#B=null,this.#E.feishuLongConnectionState=t?"failed":"idle",this.#E.slashCommandRegistration="idle",this.#E.lastError=i,this.status}};var uS=class extends ur{constructor(t){super({...t,rpcIdPrefix:"feishu",logPrefix:"dsh-feishu"})}};import{createHash as Rke}from"node:crypto";import{mkdir as kke,readFile as vke,rename as Pke,unlink as Gke,writeFile as Fke}from"node:fs/promises";import{dirname as Lke}from"node:path";var QS="DSH_FEISHU_APP_SECRET";function Qs(n){return typeof n=="string"&&n.trim()?n.trim():null}function L6(n){let t=Qs(n);return t&&/^[A-Za-z0-9_-]{1,128}$/.test(t)?t:null}function U6(n){return`bot_${Rke("sha256").update(n).digest("hex").slice(0,24)}`}function Uke(n){let t=Array.isArray(n.ownerOpenIds)?n.ownerOpenIds:[n.ownerOpenId];return[...new Set(t.map(Qs).filter(Boolean))]}function BS(n,{legacy:t=!1}={}){if(!n||typeof n!="object")return null;let o=Qs(n.appId),i=Uke(n);if(!o||i.length===0)return null;let e=L6(n.id)??(t?U6(o):null),a=Qs(n.secretRef)??(t?QS:null);if(!e||!a||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(a))return null;let A=n.domain==="lark"?"lark":"feishu";return Object.freeze({id:e,appId:o,secretRef:a,ownerOpenIds:Object.freeze(i),domain:A,botName:Qs(n.botName),botOpenId:Qs(n.botOpenId),activated:n.activated??null,groupResponseMode:Io(n.groupResponseMode),groupMessagePermissionGranted:n.groupMessagePermissionGranted===!0,deletionPending:n.deletionPending===!0,connectedAt:Qs(n.connectedAt),createdAt:Qs(n.createdAt)??Qs(n.connectedAt)})}function Hke(n){if(!n||typeof n!="object")return null;if(n.version===2&&Array.isArray(n.bots)){let o=n.bots.map(A=>BS(A));if(o.some(A=>A===null))throw new Error("dsh-feishu config contains an invalid bot entry");let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.id)||e.has(A.secretRef)||a.has(A.appId))throw new Error("dsh-feishu config contains duplicate bot identities");i.add(A.id),e.add(A.secretRef),a.add(A.appId)}return{value:Object.freeze({version:2,bots:Object.freeze(o)}),migrated:!1}}let t=BS(n,{legacy:!0});return t?{value:Object.freeze({version:2,bots:Object.freeze([t])}),migrated:!0}:null}var fS=class{#e;#A=Object.freeze({version:2,bots:Object.freeze([])});#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=JSON.parse(await vke(this.#e,"utf8")),o=Hke(t);if(!o)throw new Error("dsh-feishu config is incomplete or invalid");this.#A=o.value,o.migrated&&await this.#o(this.#A)}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=Object.freeze({version:2,bots:Object.freeze([])})}return this}get(){let t=this.#A.bots[0];if(!t)return null;let o=structuredClone(t);return o.ownerOpenId=o.ownerOpenIds[0],o}list(){return structuredClone(this.#A.bots)}getBot(t){let o=this.#A.bots.find(i=>i.id===t);return o?structuredClone(o):null}async save(t){let o={...t};o.id||(o.id=U6(Qs(o.appId)??"invalid")),o.secretRef||(o.secretRef=QS);let i=BS(o);if(!i)throw new Error("Refusing to persist incomplete dsh-feishu configuration");return await this.#r([i]),this.get()}async saveBot(t){let o=BS(t);if(!o)throw new Error("Refusing to persist incomplete dsh-feishu bot configuration");return this.#l(i=>{if(i.find(r=>r.secretRef===o.secretRef&&r.id!==o.id))throw new Error("Refusing to share a credential reference between Feishu bots");if(i.find(r=>r.appId===o.appId&&r.id!==o.id))throw new Error("Refusing to persist the same Feishu app twice");let A=i.findIndex(r=>r.id===o.id);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async removeBot(t){if(!L6(t))throw new TypeError("Invalid Feishu bot id");return this.#l(o=>{let i=o.findIndex(a=>a.id===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await Gke(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=Object.freeze({version:2,bots:Object.freeze([])})});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o=Object.freeze({version:2,bots:Object.freeze([...t])}),i=this.#t.then(async()=>{await this.#o(o),this.#A=o});this.#t=i.then(()=>{},()=>{}),await i}async#l(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:2,bots:Object.freeze(e)});await this.#o(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#o(t){await kke(Lke(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await Fke(o,`${JSON.stringify(t,null,2)} -`,{encoding:"utf8",mode:384}),await Pke(o,this.#e)}};import{randomUUID as J6}from"node:crypto";var yP=new Set(["starting","qr_ready","polling","slow_down","domain_switched","saving"]),Kke=new Set(["polling","slow_down","domain_switched"]),Ki=Object.freeze({IDLE:"idle",STARTING:"starting",QR_READY:"qr_ready",POLLING:"polling",SLOW_DOWN:"slow_down",DOMAIN_SWITCHED:"domain_switched",SAVING:"saving",SUCCEEDED:"succeeded",EXPIRED:"expired",CANCELLED:"cancelled",ERROR:"error"});function H6(n){return["access_denied","expired_token","abort"].includes(n?.code)?n.code:"registration_failed"}function mP(n){let t=H6(n);return{code:t,message:{access_denied:"Registration was denied.",abort:"Registration was cancelled.",expired_token:"The registration QR code expired."}[t]??"Unable to register the Feishu app."}}function xke(n){let t=Number(n);if(!Number.isFinite(t)||t<=0)throw new TypeError("registerApp onQRCodeReady returned an invalid expireIn");return t}function Yke(n){if(n!==void 0){if(n===null||typeof n!="object"||Array.isArray(n))throw new TypeError("registerApp returned invalid user_info");return{...n}}}var Tg=class{#e;#A;#t;#r;#l;#o=0;#i=null;#a;constructor({registerApp:t,onCredentials:o,now:i=Date.now,setTimeout:e=globalThis.setTimeout,clearTimeout:a=globalThis.clearTimeout}={}){if(typeof t!="function")throw new TypeError("RegistrationManager requires a registerApp function");if(typeof o!="function")throw new TypeError("RegistrationManager requires an onCredentials function");if(typeof i!="function"||typeof e!="function"||typeof a!="function")throw new TypeError("RegistrationManager clock dependencies must be functions");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#a=this.#s(null,Ki.IDLE)}start(t={}){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError("Registration options must be an object");this.#f();let o={id:++this.#o,controller:new AbortController,qrCodeUrl:null,expiresAt:null,pollIntervalSeconds:null,expiryTimer:null};this.#i=o,this.#a=this.#s(o,Ki.STARTING);let i={...t,signal:o.controller.signal,onQRCodeReady:a=>this.#c(o,a),onStatusChange:a=>this.#g(o,a)};return Promise.resolve().then(()=>this.#e(i)).then(a=>this.#I(o,a),a=>this.#d(o,a)),this.status()}status(){this.#h();let t={...this.#a};t.error&&(t.error={...t.error});let o=this.#i;return o&&o.expiresAt!==null&&yP.has(t.state)&&(t.remainingSeconds=Math.max(0,Math.ceil((o.expiresAt-this.#t())/1e3))),t}cancel(){let t=this.#i;return t?(this.#u(t,Ki.CANCELLED,{error:{code:"abort",message:"Registration was cancelled."}}),t.controller.abort(),this.status()):this.status()}#n(t){return this.#i===t}#s(t,o,i={}){let e={state:o,attempt:t?.id??this.#o,updatedAt:this.#t(),...i};return t?.qrCodeUrl&&yP.has(o)&&(e.qrCodeUrl=t.qrCodeUrl,e.expiresAt=t.expiresAt),t?.pollIntervalSeconds!==null&&yP.has(o)&&(e.pollIntervalSeconds=t.pollIntervalSeconds),e}#p(t,o,i={}){this.#n(t)&&(this.#a=this.#s(t,o,i))}#c(t,o){if(!this.#n(t))return;if(typeof o?.url!="string"||!o.url)throw new TypeError("registerApp onQRCodeReady returned an invalid URL");let i=xke(o.expireIn);t.qrCodeUrl=o.url,t.expiresAt=this.#t()+i*1e3,this.#B(t),t.expiryTimer=this.#r(()=>this.#C(t),i*1e3),t.expiryTimer?.unref?.(),this.#p(t,Ki.QR_READY)}#g(t,o){!this.#n(t)||!Kke.has(o?.status)||(o.status===Ki.SLOW_DOWN&&Number.isFinite(Number(o.interval))&&(t.pollIntervalSeconds=Number(o.interval)),this.#p(t,o.status))}async#I(t,o){if(!this.#n(t))return;let i=o?.client_id,e=o?.client_secret;if(typeof i!="string"||!i||typeof e!="string"||!e){this.#u(t,Ki.ERROR,{error:{code:"invalid_credentials",message:"Feishu registration returned invalid credentials."}});return}let a;try{a=Yke(o.user_info)}catch{this.#u(t,Ki.ERROR,{error:{code:"invalid_credentials",message:"Feishu registration returned invalid credentials."}});return}this.#B(t),t.qrCodeUrl=null,t.expiresAt=null,t.pollIntervalSeconds=null,this.#p(t,Ki.SAVING);try{await this.#A({client_id:i,client_secret:e,user_info:a})}catch{this.#n(t)&&this.#u(t,Ki.ERROR,{error:{code:"credentials_callback_failed",message:"Unable to store the Feishu credentials."}});return}this.#n(t)&&this.#u(t,Ki.SUCCEEDED)}#d(t,o){if(!this.#n(t))return;let i=H6(o);if(i==="expired_token"){this.#u(t,Ki.EXPIRED,{error:mP(o)});return}if(i==="abort"){this.#u(t,Ki.CANCELLED,{error:mP(o)});return}this.#u(t,Ki.ERROR,{error:mP(o)})}#h(){let t=this.#i;t&&t.expiresAt!==null&&this.#t()>=t.expiresAt&&this.#C(t)}#C(t){this.#n(t)&&(this.#u(t,Ki.EXPIRED,{error:{code:"expired_token",message:"The registration QR code expired."}}),t.controller.abort())}#u(t,o,i={}){this.#n(t)&&(this.#B(t),this.#a=this.#s(t,o,i),this.#i=null)}#B(t){t.expiryTimer!==null&&(this.#l(t.expiryTimer),t.expiryTimer=null)}#f(){let t=this.#i;t&&(this.#B(t),this.#i=null,t.controller.abort())}};var jke="card.action.trigger",Jke="im:message:readonly",qke="im:resource",Nu="callback_repair";function zke(n){return n==="lark"?"accounts.larksuite.com":"accounts.feishu.cn"}function Vke(n){return n==="lark"?"open.larksuite.com":"open.feishu.cn"}function SP(n,t,o="feishu",i="Feishu app update"){let e;try{e=new URL(n)}catch{throw new Error(`${i} returned an invalid verification URL`)}let a=o==="feishu"||o==="lark",A=e.searchParams.getAll("clientID"),r=e.searchParams.getAll("tp"),s=e.searchParams.getAll("addons"),g=String(t).includes("{{")||String(t).includes("}}")||[...e.searchParams.values()].some(c=>c.includes("{{")||c.includes("}}"));if(!a||e.protocol!=="https:"||e.hostname!==Vke(o)||e.port!==""||e.username!==""||e.password!==""||r.length!==1||r[0]!=="sdk"||A.length!==1||A[0]!==t||e.searchParams.has("createOnly")||s.length!==1||!s[0]?.trim()||g)throw new Error(`${i} returned an unsafe verification URL`);return e.toString()}function Wke(n,t,o="feishu"){return SP(n,t,o,"Feishu callback repair")}var yS=class{#e;#A;#t;constructor({registerApp:t,onCredentials:o,appId:i,domain:e="feishu"}={}){if(typeof t!="function")throw new TypeError("registerApp is required");if(typeof o!="function")throw new TypeError("onCredentials is required");if(typeof i!="string"||!i.trim())throw new TypeError("appId is required");if(e!=="feishu"&&e!=="lark")throw new TypeError("domain is invalid");this.#A=i.trim(),this.#t=e,this.#e=new Tg({registerApp:a=>t({...a,onQRCodeReady:A=>{Wke(A?.url,this.#A,this.#t),a.onQRCodeReady(A)}}),onCredentials:o})}start(){return this.#e.start({source:"deepseek-harness-card-action-repair",domain:zke(this.#t),appId:this.#A,addons:{preset:!1,scopes:{tenant:[Jke,qke,...ES]},callbacks:{items:[jke]}}})}status(){return this.#e.status()}cancel(){return this.#e.cancel()}};var Zke="im:message.group_msg",SS="group_message_permission";function Xke(n){return n==="lark"?"accounts.larksuite.com":"accounts.feishu.cn"}function $ke(n,t,o="feishu"){return SP(n,t,o,"Feishu group message permission update")}var mS=class{#e;#A;#t;constructor({registerApp:t,onCredentials:o,appId:i,domain:e="feishu"}={}){if(typeof t!="function")throw new TypeError("registerApp is required");if(typeof o!="function")throw new TypeError("onCredentials is required");if(typeof i!="string"||!i.trim())throw new TypeError("appId is required");if(e!=="feishu"&&e!=="lark")throw new TypeError("domain is invalid");this.#A=i.trim(),this.#t=e,this.#e=new Tg({registerApp:a=>t({...a,onQRCodeReady:A=>{$ke(A?.url,this.#A,this.#t),a.onQRCodeReady(A)}}),onCredentials:o})}start(){return this.#e.start({source:"deepseek-harness-group-message-permission",domain:Xke(this.#t),appId:this.#A,addons:{preset:!1,scopes:{tenant:[Zke]}}})}status(){return this.#e.status()}cancel(){return this.#e.cancel()}};var K6=Object.freeze(["im:message.p2p_msg:readonly","im:message.group_at_msg:readonly","im:message:readonly","im:message:send_as_bot","im:message.reactions:write_only","im:message:recall","im:resource","cardkit:card:write",...ES]);var wP=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]),wS=new Set([...wP,"saving"]),x6=new Set([Nu,SS]),Y6="*",eve=12e4,Ave=6e5;function q6(){return{ready:!1,feishuLongConnectionState:"idle",harnessReachable:!1}}function Ru(n){return n?n.status:q6()}function ku(n){return n.ready===!0&&n.feishuLongConnectionState==="connected"&&n.harnessReachable===!0}function z6(n){return n.length>12?`${n.slice(0,8)}\u2022\u2022\u2022\u2022${n.slice(-4)}`:"cli_\u2022\u2022\u2022\u2022"}function tve(n){return{name:n.botName,appIdMasked:z6(n.appId),activated:n.activated,domain:n.domain}}function rve({connected:n,error:t,connection:o}){return n?"connected":t||o.feishuLongConnectionState==="failed"?"error":"disconnected"}function ave(){return`bot_${J6().replaceAll("-","")}`}function ive(){return`reg_${J6().replaceAll("-","")}`}function j6(n){return`DSH_FEISHU_APP_SECRET_${n.slice(4).toUpperCase()}`}function DS(n){return JSON.stringify({id:n.id,appId:n.appId,secretRef:n.secretRef,ownerOpenIds:n.ownerOpenIds,domain:n.domain,botName:n.botName,botOpenId:n.botOpenId,activated:n.activated,groupResponseMode:Io(n.groupResponseMode),groupMessagePermissionGranted:n.groupMessagePermissionGranted===!0,deletionPending:n.deletionPending===!0,connectedAt:n.connectedAt??null,createdAt:n.createdAt??null})}function OS(n){return typeof n=="string"&&n.trim()?n.trim():null}var vu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n=new Map;#s=new Map;#p=new Map;#c=new Map;#g=new Map;#I=null;#d=Promise.resolve();#h=new Map;#C=1;#u;#B=!1;constructor({registerApp:t,verifyApp:o,credentials:i,configStore:e,createRuntime:a,deleteState:A=async()=>{},createBotId:r=ave,createRegistrationId:s=ive,callbackProbeTimeoutMs:g=eve}){if(typeof t!="function")throw new Error("registerApp is required");if(typeof o!="function")throw new Error("verifyApp is required");if(!i)throw new Error("credentials service is required");if(!e||typeof e.list!="function")throw new Error("multi-bot config store is required");if(typeof a!="function")throw new Error("createRuntime is required");if(typeof A!="function")throw new Error("deleteState must be a function");if(!Number.isFinite(g)||g<=0||g>Ave)throw new TypeError("callbackProbeTimeoutMs must be between 1 and 600000ms");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#u=g}async initialize(){if(this.#B)return this.status();let t=this.#r.list(),o=!1;return await Promise.allSettled(t.map(i=>this.#k(i.id,async()=>{let e=Ru(this.#n.get(i.id));if(ku(e)||e.feishuLongConnectionState==="connecting"||e.feishuLongConnectionState==="reconnecting")return;if(o=!0,i.deletionPending){this.#s.set(i.id,{code:"deletion_pending",message:"\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002"});return}let a;try{a=await this.#t.resolve(i.secretRef)}catch{this.#s.set(i.id,{code:"missing_credentials",message:"\u65E0\u6CD5\u8BFB\u53D6\u673A\u5668\u4EBA\u51ED\u636E\uFF0C\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u3002"});return}if(!a?.value){this.#s.set(i.id,{code:"missing_credentials",message:"\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u626B\u7801\u63A5\u5165\u3002"});return}try{await this.#E(i,a.value),this.#s.delete(i.id)}catch{this.#s.set(i.id,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u98DE\u4E66\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}}))),o&&this.#P(),this.status()}startRegistration(){this.#_();let t=this.#a();if(typeof t!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(t)||this.#p.has(t))throw new Error("Registration id generator returned an invalid or duplicate id");let o={id:t,manager:null,botId:null,createdNew:!1,cancelled:!1};return o.manager=new Tg({registerApp:this.#e,onCredentials:i=>this.#G(()=>this.#D(o,i))}),this.#p.set(t,o),this.#I=t,this.#F(),o.manager.start({source:"deepseek-harness",createOnly:!0,appPreset:{name:"{user} \u7684\u5317\u6C47\u661F\u6CB3 AI \u52A9\u624B",desc:"\u8FDE\u63A5\u98DE\u4E66\u4E0E DeepSeek Harness\uFF0C\u5728\u804A\u5929\u4E2D\u4F7F\u7528\u4F01\u4E1A AI \u52A9\u624B\u3002"},addons:{preset:!1,scopes:{tenant:[...K6]},events:{items:{tenant:["im.message.receive_v1"]}},callbacks:{items:["card.action.trigger"]}}}),this.#P(),this.registrationStatus(t)}startCallbackRepair(t,{actorOpenId:o,chatId:i}={}){this.#_();let e=this.#R(t);if(e.deletionPending)throw new Error("Cannot repair a Feishu bot pending deletion");let a=this.#c.get(t),A=a?this.#p.get(a):null;if(A&&wS.has(A.manager.status().state)){if(A.operation!==Nu)throw new Error("Another Feishu app update is already active for this bot");return this.registrationStatus(A.id)}this.#c.delete(t);let r=this.#a();if(typeof r!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(r)||this.#p.has(r))throw new Error("Registration id generator returned an invalid or duplicate id");let s={id:r,operation:Nu,manager:null,botId:t,createdNew:!1,cancelled:!1,remoteCommitted:!1,processing:null,publicError:null,stage:"authorizing",target:structuredClone(e),targetFingerprint:DS(e),initiator:{actorOpenId:OS(o),chatId:OS(i)}};return s.manager=new yS({registerApp:this.#e,appId:e.appId,domain:e.domain,onCredentials:g=>{s.remoteCommitted=!0;let I=this.#y(s,g).finally(()=>{s.processing===I&&(s.processing=null)});return s.processing=I,I}}),this.#p.set(r,s),this.#c.set(t,r),this.#I=r,this.#F(),s.manager.start(),this.#P(),this.registrationStatus(r)}startGroupMessagePermission(t){this.#_();let o=this.#R(t);if(o.deletionPending)throw new Error("Cannot update permissions for a Feishu bot pending deletion");let i=this.#c.get(t),e=i?this.#p.get(i):null;if(e&&wS.has(e.manager.status().state)){if(e.operation!==SS)throw new Error("Another Feishu app update is already active for this bot");return this.registrationStatus(e.id)}this.#c.delete(t);let a=this.#a();if(typeof a!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(a)||this.#p.has(a))throw new Error("Registration id generator returned an invalid or duplicate id");let A={id:a,operation:SS,manager:null,botId:t,createdNew:!1,cancelled:!1,remoteCommitted:!1,processing:null,publicError:null,stage:"authorizing",target:structuredClone(o),targetFingerprint:DS(o),initiator:{actorOpenId:null,chatId:null}};return A.manager=new mS({registerApp:this.#e,appId:o.appId,domain:o.domain,onCredentials:r=>{A.remoteCommitted=!0;let g=this.#S(A,r).finally(()=>{A.processing===g&&(A.processing=null)});return A.processing=g,g}}),this.#p.set(a,A),this.#c.set(t,a),this.#I=a,this.#F(),A.manager.start(),this.#P(),this.registrationStatus(a)}hasRegistration(t){return this.#p.has(t)}registrationStatus(t){let o=this.#p.get(t);return o?this.#f({registration:o,selectedBotId:o.botId}):null}async cancelRegistration(t=this.#I){let o=this.#p.get(t);if(!o)return this.status();let i=o.manager.status().state;return x6.has(o.operation)&&i==="saving"?this.registrationStatus(t):wS.has(i)?(o.cancelled=!0,o.manager.cancel(),await this.#G(async()=>{o.createdNew&&o.botId&&this.#g.get(o.botId)===o.id&&this.#r.getBot(o.botId)&&await this.#k(o.botId,()=>this.#O(o.botId))}),this.#P(),this.registrationStatus(t)??this.status()):this.registrationStatus(t)}status(t){return this.#f({registration:this.#p.get(this.#I)??null,selectedBotId:t})}async bindCredentials({appId:t,appSecret:o,domain:i="feishu"}={}){this.#_();let e=typeof t=="string"?t.trim():"",a=typeof o=="string"?o.trim():"",A=i==="lark"?"lark":"feishu";if(!e||!a)throw new TypeError("Feishu App ID and App Secret are required");return this.#G(async()=>{this.#_();let r=await this.#A({appId:e,appSecret:a,domain:A});this.#_();let s=this.#r.list().find(f=>f.appId===e),g=s?.id??this.#i();if(typeof g!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(g)||!s&&this.#r.getBot(g))throw new Error("Bot id generator returned an invalid or duplicate id");let c=s?.secretRef??j6(g),I=await this.#t.resolve(c).catch(()=>{}),d={...s,id:g,appId:e,secretRef:c,ownerOpenIds:s?.ownerOpenIds?.length?s.ownerOpenIds:[Y6],domain:A,botName:r.name,botOpenId:r.openId,activated:r.activated,deletionPending:!1,connectedAt:new Date().toISOString(),createdAt:s?.createdAt??new Date().toISOString()};await this.#t.set(c,a);let B;try{B=await this.#r.saveBot(d)}catch(f){throw await this.#w(c,I),f}return await this.#k(g,async()=>{try{await this.#E(B,a),this.#s.delete(g)}catch{this.#s.set(g,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u5DF2\u7ECF\u7ED1\u5B9A\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"})}}),this.#P(),this.status(g)})}async reconnectBot(t){return this.#_(),this.#k(t,async()=>{let o=this.#R(t);if(o.deletionPending)return this.#s.set(t,{code:"deletion_pending",message:"\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002"}),this.status(t);if(ku(Ru(this.#n.get(t))))return this.status(t);let i;try{i=await this.#t.resolve(o.secretRef)}catch{i=null}if(!i?.value)return this.#s.set(t,{code:"missing_credentials",message:"\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u626B\u7801\u63A5\u5165\u3002"}),this.#P(),this.status(t);try{await this.#E(o,i.value),this.#s.delete(t)}catch{this.#s.set(t,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u98DE\u4E66\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}return this.#P(),this.status(t)})}async sendConnectionTest(t){return this.#_(),this.#k(t,async()=>{let o=this.#R(t),i=this.#n.get(t);if(!ku(Ru(i))||typeof i.sendConnectionTest!="function"){let e=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw e.code="test-target-unavailable",e}return i.sendConnectionTest(Ra(`${o.botName}\uFF08${z6(o.appId)}\uFF09`,"\u98DE\u4E66\u673A\u5668\u4EBA"))})}async sendProactiveText(t,o,i,e={}){return this.#_(),this.#k(t,async()=>{this.#R(t);let a=this.#n.get(t);if(!ku(Ru(a))||typeof a.sendProactiveText!="function"){let A=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw A.code="bot-not-connected",A}return a.sendProactiveText(o,i,e)})}async disconnectBot(t){return this.#_(),this.#k(t,async()=>(this.#R(t),await this.#T(t),this.#s.delete(t),this.#P(),this.status(t)))}async updateGroupResponseMode(t,o){if(this.#_(),!nS(o))throw new TypeError("Invalid Feishu group response mode");return this.#G(()=>this.#k(t,async()=>{let i=this.#R(t);if(o==="all"&&i.groupMessagePermissionGranted!==!0){let a=new Error("Authorize im:message.group_msg before enabling all group messages");throw a.code="group_message_permission_required",a}let e=await this.#r.saveBot({...i,groupResponseMode:o});return this.#n.get(t)?.setGroupResponseMode?.(e.groupResponseMode),this.#P(),this.status(t)}))}async deleteBot(t){return this.#_(),this.#G(()=>this.#k(t,async()=>(this.#R(t),await this.#O(t),this.#P(),this.status())))}async reconnect(){let t=this.#r.list()[0];return t?this.reconnectBot(t.id):this.status()}async disconnect(){let t=this.#r.list()[0];return t?this.deleteBot(t.id):this.status()}async close(){if(this.#B)return;this.#B=!0;let t=[];for(let o of this.#p.values()){let i=o.manager.status().state;x6.has(o.operation)&&i==="saving"?(o.manager.cancel(),o.processing&&t.push(o.processing)):wS.has(i)&&(o.cancelled=!0,o.manager.cancel())}await this.#d,await Promise.allSettled([...this.#h.values()]),await Promise.allSettled([...this.#n.keys()].map(o=>this.#T(o))),await Promise.allSettled(t),await this.#d,await Promise.allSettled([...this.#h.values()]),await Promise.allSettled([...this.#n.keys()].map(o=>this.#T(o)))}#f({registration:t,selectedBotId:o}={}){let i=this.#r.list().map(I=>{let d=Ru(this.#n.get(I.id)),B=ku(d),f=this.#s.get(I.id)??null;return{botId:I.id,phase:rve({connected:B,error:f,connection:d}),connected:B,configured:!0,groupResponseMode:Io(I.groupResponseMode),groupMessagePermissionGranted:I.groupMessagePermissionGranted===!0,bot:tve(I),connection:d,lastMessageError:Xr(d.lastMessageError),error:f}}),e=t?this.#Q(t):{state:"idle",attempt:0,updatedAt:Date.now()},a=wP.has(e.state),A=e.state==="saving",r=!!t&&(a||A),s=i.find(I=>I.botId===o)??(r?null:i[0]??null),g=i.some(I=>I.connected),c=s?.phase??"unconfigured";return a?c="registering":A?c="connecting":e.state==="error"&&!s&&(c="error"),{schemaVersion:2,revision:this.#C,phase:c,connected:s?.connected??!1,configured:i.length>0,bot:s?.bot??null,connection:s?.connection??q6(),error:s?.error??e.error??null,registration:e,bots:i,totals:{configured:i.length,connected:i.filter(I=>I.connected).length},anyConnected:g}}#Q(t){let o=t.manager.status();return{...o,attempt:t.id,...t.botId?{botId:t.botId}:{},...t.operation?{operation:t.operation}:{},...t.stage?{stage:t.stage}:{},...o.state==="error"&&t.publicError?{error:{...t.publicError}}:{}}}async#S(t,o){let i=o.client_id,e=o.client_secret,a=OS(o.user_info?.open_id),A=o.user_info?.tenant_brand,r=t.target;if(t.cancelled)throw this.#m(t,"abort","Group message permission update was cancelled before local activation.");if(i!==r.appId)throw this.#m(t,"repair_app_mismatch","Feishu returned credentials for a different app.");if(!a)throw this.#m(t,"repair_owner_missing","Feishu returned no permission operator identity.");if(A!==void 0&&A!==r.domain)throw this.#m(t,"repair_domain_mismatch","Feishu returned credentials for a different account domain.");if(!r.ownerOpenIds.includes(Y6)&&!r.ownerOpenIds.includes(a))throw this.#m(t,"repair_owner_mismatch","The Feishu permission operator is not an owner of this configured bot.");t.stage="verifying_identity";let s;try{s=await this.#A({appId:i,appSecret:e,domain:r.domain})}catch(g){throw this.#m(t,"repair_credentials_invalid","Feishu could not verify the updated app credentials.",g)}if(r.botOpenId&&s?.openId!==r.botOpenId)throw this.#m(t,"repair_bot_mismatch","The updated Feishu app belongs to a different bot identity.");await this.#G(()=>this.#k(t.botId,async()=>{let g=this.#r.getBot(t.botId);if(!g||g.deletionPending||DS(g)!==t.targetFingerprint)throw this.#m(t,"repair_target_changed","The Feishu bot changed while its permission update was in progress.");let c;try{c=await this.#t.resolve(g.secretRef)}catch(d){throw this.#m(t,"credential_update_failed","Unable to read the current Feishu credential.",d)}if(c?.value!==e){t.stage="persisting_secret";try{await this.#t.set(g.secretRef,e)}catch(B){if((await this.#t.resolve(g.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_update_failed","Unable to store the updated Feishu credential.",B)}if((await this.#t.resolve(g.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_state_unknown","The updated Feishu credential could not be confirmed after writing.")}t.stage="enabling_all_messages";let I;try{I=await this.#r.saveBot({...g,groupMessagePermissionGranted:!0,groupResponseMode:"all"})}catch(d){throw this.#m(t,"group_message_permission_save_failed","The permission was accepted, but all-message mode could not be saved.",d)}t.stage="restarting";try{await this.#E(I,e)}catch(d){throw this.#s.set(t.botId,{code:"connection_failed",message:"\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u5F00\u901A\uFF0C\u4F46\u673A\u5668\u4EBA\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"}),this.#P(),this.#m(t,"group_message_permission_connection_failed","The permission was accepted, but the Feishu runtime could not restart.",d)}this.#s.delete(t.botId),t.stage="verified",t.publicError=null,this.#P()}))}async#y(t,o){let i=o.client_id,e=o.client_secret,a=OS(o.user_info?.open_id),A=o.user_info?.tenant_brand,r=t.target;if(t.cancelled)throw this.#m(t,"abort","Callback repair was cancelled before local activation.");if(i!==r.appId)throw this.#m(t,"repair_app_mismatch","Feishu returned credentials for a different app.");if(!a)throw this.#m(t,"repair_owner_missing","Feishu returned no repair operator identity.");if(A!==void 0&&A!==r.domain)throw this.#m(t,"repair_domain_mismatch","Feishu returned credentials for a different account domain.");t.stage="verifying_identity";let s;try{s=await this.#A({appId:i,appSecret:e,domain:r.domain})}catch(c){throw this.#m(t,"repair_credentials_invalid","Feishu could not verify the repaired app credentials.",c)}if(r.botOpenId&&s?.openId!==r.botOpenId)throw this.#m(t,"repair_bot_mismatch","The repaired Feishu app belongs to a different bot identity.");let g=await this.#G(()=>this.#k(t.botId,async()=>{let c=this.#r.getBot(t.botId);if(!c||c.deletionPending||DS(c)!==t.targetFingerprint)throw this.#m(t,"repair_target_changed","The Feishu bot changed while its callback repair was in progress.");let I;try{I=await this.#t.resolve(c.secretRef)}catch(f){throw this.#m(t,"credential_update_failed","Unable to read the current Feishu credential.",f)}if(I?.value!==e){t.stage="persisting_secret";try{await this.#t.set(c.secretRef,e)}catch(Q){if((await this.#t.resolve(c.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_update_failed","Unable to store the repaired Feishu credential.",Q)}if((await this.#t.resolve(c.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_state_unknown","The repaired Feishu credential could not be confirmed after writing.")}let B;t.stage="restarting";try{await this.#E(c,e),B=this.#n.get(t.botId)}catch(f){throw this.#s.set(t.botId,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u56DE\u8C03\u4FEE\u590D\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"}),this.#P(),this.#m(t,"repair_connection_failed","The repaired Feishu runtime could not be started.",f)}if(!B)throw this.#m(t,"repair_connection_failed","The repaired Feishu runtime is unavailable.");return this.#s.delete(t.botId),this.#P(),B}));if(typeof g.beginCardActionProbe!="function")throw this.#m(t,"card_action_probe_unavailable","The Feishu runtime cannot verify card callbacks.");t.stage="awaiting_callback";try{if((await g.beginCardActionProbe({expectedOperatorOpenId:t.initiator.actorOpenId??a,timeoutMs:this.#u,...t.initiator.chatId?{chatId:t.initiator.chatId}:{}}))?.verified!==!0){let I=new Error("Feishu runtime returned no callback proof");throw I.code="card_action_probe_failed",I}}catch(c){let I=c?.code==="card_action_probe_timeout"?"card_action_probe_timeout":c?.code==="card_action_probe_unavailable"?"card_action_probe_unavailable":c?.code==="card_action_probe_send_failed"?"card_action_probe_send_failed":"card_action_probe_failed";throw this.#m(t,I,I==="card_action_probe_timeout"?"Timed out waiting for the Feishu callback verification button.":"The Feishu card callback probe failed.",c)}t.stage="verified",t.publicError=null,this.#P()}#m(t,o,i,e){t.publicError={code:o,message:i};let a=new Error(i,e?{cause:e}:void 0);return a.code=o,a}async#D(t,o){if(t.cancelled)throw new Error("Registration was cancelled");let i=o.client_id,e=o.client_secret,a=o.user_info?.open_id,A=o.user_info?.tenant_brand==="lark"?"lark":"feishu";if(!a)throw new Error("Feishu registration returned no owner open_id");let r=await this.#A({appId:i,appSecret:e,domain:A});if(t.cancelled)throw new Error("Registration was cancelled");let s=this.#r.list().find(Q=>Q.appId===i),g=s?.id??this.#i();if(typeof g!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(g)||!s&&this.#r.getBot(g))throw new Error("Bot id generator returned an invalid or duplicate id");let c=s?.secretRef??j6(g),I=this.#g.get(g),d=await this.#t.resolve(c).catch(()=>{});await this.#t.set(c,e);let B;try{B=await this.#r.saveBot({...s,id:g,appId:i,secretRef:c,ownerOpenIds:[...new Set([...s?.ownerOpenIds??[],a])],domain:A,botName:r.name,botOpenId:r.openId,activated:r.activated,deletionPending:!1,connectedAt:new Date().toISOString(),createdAt:s?.createdAt??new Date().toISOString()}),t.botId=g,t.createdNew=!s,this.#g.set(g,t.id)}catch(Q){try{await this.#w(c,d)}catch(y){throw new Error("Unable to restore the Feishu credential after a config failure.",{cause:y})}throw Q}if(t.cancelled)throw t.createdNew?await this.#k(g,()=>this.#O(g)):(await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g)),new Error("Registration was cancelled");let f=!1;try{if(await this.#k(g,()=>this.#E(B,e)),t.cancelled)throw t.createdNew?await this.#k(g,()=>this.#O(g)):(await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g),d?.value&&!s.deletionPending?await this.#k(g,()=>this.#E(s,d.value)):await this.#k(g,()=>this.#T(g))),f=!0,new Error("Registration was cancelled");this.#s.delete(g),this.#P()}catch(Q){if(t.cancelled)throw!f&&t.createdNew&&this.#r.getBot(g)?await this.#k(g,()=>this.#O(g)):!f&&s&&(await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g),!this.#B&&d?.value&&!s.deletionPending?await this.#k(g,()=>this.#E(s,d.value)):await this.#k(g,()=>this.#T(g))),this.#P(),Q;if(s&&d?.value)try{throw await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g),s.deletionPending?(await this.#k(g,()=>this.#T(g)),this.#s.set(g,{code:"deletion_pending",message:"\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002"})):(await this.#k(g,()=>this.#E(s,d.value)),this.#s.delete(g)),this.#P(),Q}catch(y){throw y===Q?Q:(this.#s.set(g,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u8FDE\u63A5\u66F4\u65B0\u5931\u8D25\uFF0C\u4E14\u539F\u8FDE\u63A5\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u91CD\u8BD5\u3002"}),this.#P(),new Error("Unable to restore the previous Feishu bot connection.",{cause:y}))}throw this.#s.set(g,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"}),this.#P(),Q}}async#E(t,o){await this.#T(t.id);let i=await this.#l({botId:t.id,config:t,appSecret:o,repair:this.#N(t.id)});this.#n.set(t.id,i);try{await i.start()}catch(e){throw this.#n.get(t.id)===i&&this.#n.delete(t.id),await i.stop({preserveError:!0}).catch(()=>{}),e}}#N(t){let o=i=>{let e=this.#p.get(i);return e?.operation===Nu&&e.botId===t?e:null};return Object.freeze({start:({actorOpenId:i,chatId:e}={})=>this.startCallbackRepair(t,{actorOpenId:i,chatId:e}),status:({attemptId:i}={})=>o(i)?this.registrationStatus(i):null,cancel:async({attemptId:i}={})=>o(i)?this.cancelRegistration(i):this.status(t)})}async#T(t){let o=this.#n.get(t);this.#n.delete(t),o&&await o.stop()}async#O(t){let o=this.#r.getBot(t);if(o){o.deletionPending||(o=await this.#r.saveBot({...o,deletionPending:!0})),await this.#T(t);try{await this.#t.unset(o.secretRef)}catch(i){throw this.#s.set(t,{code:"credential_removal_failed",message:"\u65E0\u6CD5\u5220\u9664\u673A\u5668\u4EBA\u51ED\u636E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}),new Error("Unable to remove the Feishu credential.",{cause:i})}try{await this.#o({botId:t,config:o})}catch(i){throw this.#s.set(t,{code:"state_cleanup_failed",message:"\u65E0\u6CD5\u5220\u9664\u673A\u5668\u4EBA\u7684\u672C\u5730\u4F1A\u8BDD\u6570\u636E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}),new Error("Unable to remove the Feishu bot session state.",{cause:i})}await this.#r.removeBot(t),this.#s.delete(t),this.#g.delete(t)}}async#w(t,o){o?.value?await this.#t.set(t,o.value):await this.#t.unset(t)}#R(t){let o=this.#r.getBot(t);if(!o)throw new Error("Unknown Feishu bot");return o}#_(){if(this.#B)throw new Error("The Feishu controller is closed")}#G(t){let o=this.#d.then(t,t);return this.#d=o.then(()=>{},()=>{}),o}#k(t,o){let e=(this.#h.get(t)??Promise.resolve()).then(o,o),a=e.then(()=>{},()=>{});return this.#h.set(t,a),a.finally(()=>{this.#h.get(t)===a&&this.#h.delete(t)}),e}#F(){if(!(this.#p.size<=32))for(let[t,o]of this.#p){if(t===this.#I)continue;let i=o.manager.status().state;if(!wP.has(i)&&i!=="saving"&&this.#p.delete(t),this.#p.size<=32)break}}#P(){this.#C+=1}};var sve=["open.feishu.cn","open.larksuite.com"];function gve(n,t){if(t==="*")return!0;let o=t.startsWith(".")?t.slice(1):t;return o?n===o||n.endsWith(`.${o}`):!1}function cve(n){for(let t of["no_proxy","NO_PROXY"]){let o=n?.[t];if(typeof o!="string"||!o.trim())continue;let i=o.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);if(sve.some(e=>i.some(a=>gve(e,a))))return!0}return!1}function Ive(n){if(!cve(n))for(let t of["https_proxy","HTTPS_PROXY","http_proxy","HTTP_PROXY"]){let o=n?.[t];if(typeof o=="string"&&o.trim())return o.trim()}}function lve(n,t=o=>new V6.default(o)){let o=Ive(n);return o?t(o):void 0}function pve(n){let t=kc(n.dshHome??process.env.DSH_HOME??Yd(ove(),".dsh")),o=kc(n.dataDir??Yd(t,"integrations","dsh-feishu"));return{root:o,config:kc(n.configPath??Yd(o,"config.json")),legacyState:kc(n.statePath??Yd(o,"state.json")),bots:kc(n.botsDir??Yd(o,"bots")),workspaces:kc(n.workspacesPath??Yd(o,"workspaces.json"))}}async function DP(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-feishu requires ctx.credentials");let i=aa(n,t),e=o.lark??rP,a=o.Controller??vu,A=o.ConfigStore??fS,r=o.StateStore??iS,s=o.HarnessClient??uS,g=o.FeishuRuntime??CS,c=o.verifyFeishuApp??t6,I=fe=>c({...fe,httpInstance:e.defaultHttpInstance}),d=o.createConnectionSupervisor??aP,B=typeof n.logger=="function"?n.logger("dsh-feishu"):n.logger??console,f=()=>La(n),Q=pve(t),y=await new A(Q.config).load(),m=kc(t.workspace??process.cwd()),T=o.WorkspaceStore??ra,_=o.workspaces??await new T(Q.workspaces,{defaultWorkspace:m}).load(),R=typeof y.list=="function",K=()=>R?y.list():[],L=K();R&&await _.reconcile(L.map(fe=>fe.id)),await Promise.all(L.map(fe=>_.ensure(fe.id,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("feishu",fe)})));let F=typeof y.removeBot=="function"?Ha(y,{workspaces:_,method:"removeBot",botIdFromRemoved:fe=>fe.id,saveMethod:"saveBot",botIdFromSave:fe=>fe?.id}):y,q=new Map,V=fe=>!fe.id||!fe.secretRef||fe.secretRef===QS?Q.legacyState:kc(Q.bots,fe.id,"state.json"),x=async fe=>{let ke=fe.id??"__legacy__",Re=q.get(ke);return Re||(Re=await new r(V(fe)).load(),q.set(ke,Re)),Re},G=async fe=>{let ke=K().find(Re=>Re.id===fe);if(!ke)throw new Error("Unknown Feishu bot");return x(ke)},J=ja(n,o.commandExecutor),{controlExecutor:U,sessionMaintenanceExecutor:N,fileIngressExecutor:k}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),z=new s({...i,workspace:m,autostart:!1,dshBin:t.dshBin??"dsh",...J?{commandExecutor:J}:{},...U?{controlExecutor:U}:{},...N?{sessionMaintenanceExecutor:N}:{},...k?{fileIngressExecutor:k}:{}}),Ae=o.proxyEnv??process.env,ie=lve(Ae,o.createProxyAgent),we=new a({registerApp:fe=>e.registerApp(fe),verifyApp:I,credentials:n.credentials,configStore:F,createRuntime:async({botId:fe,config:ke,appSecret:Re,repair:We})=>{let ve=await x(ke),aA=fe??ke.id??ke.appId;await _.ensure(aA,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("feishu",ke)});let Be=Ka(z,{botId:aA,workspaces:_,state:ve,agentPresetCatalog:f});return new g({lark:e,botId:aA,repair:We,appId:ke.appId,appSecret:Re,domain:ke.domain,botOpenId:ke.botOpenId,groupResponseMode:ke.groupResponseMode,ownerOpenIds:ke.ownerOpenIds??[ke.ownerOpenId],harness:Be.harness,state:Be.state,contextEnhancement:{botId:aA,getSettings:()=>_.contextEnhancementFor(aA)},accessPolicy:qa(_,aA,{channel:"feishu",config:ke}),replyTimeoutMs:t.replyTimeoutMs??6e5,slashCommands:t.slashCommands!==!1,...ie?{wsAgent:ie}:{},logger:{error:(...Ie)=>B.error?.(`[${fe??ke.id}]`,...Ie),warn:(...Ie)=>B.warn?.(`[${fe??ke.id}]`,...Ie),info:(...Ie)=>B.info?.(`[${fe??ke.id}]`,...Ie),debug:(...Ie)=>B.debug?.(`[${fe??ke.id}]`,...Ie)}})},deleteState:async({botId:fe,config:ke})=>{q.delete(fe);try{await nve(V(ke))}catch(Re){if(Re?.code!=="ENOENT")throw Re}}}),se=xa(we,{workspaces:_,stateFor:G,agentPresetCatalog:f}),Te=d({controller:se,harness:z,logger:B,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:se,deliveryAdapter:Ya({channel:"feishu",workspaces:_,coreController:we,stateFor:G}),ready:Te.ready,async close(){await Te.close(),await se.close(),z.stopManagedProcess(),ie?.destroy?.()}}}import Nve from"qrcode";var Jd=qe(RP(),1);var Mve=qe(RP(),1);var _ve=Object.freeze({$locale:"en",IM\u673A\u5668\u4EBA:"IM bots",IM\u673A\u5668\u4EBA\u8BBE\u7F6E:"IM bot settings",\u66F4\u591A\u673A\u5668\u4EBA\u8BBE\u7F6E:"More bot settings",\u673A\u5668\u4EBA\u8BBE\u7F6E:"Bot settings",\u673A\u5668\u4EBA\u8BBE\u7F6E\u9875\u7B7E:"Bot settings tabs",\u6295\u9012\u8BBE\u7F6E:"Delivery settings",\u8BBF\u95EE\u8BBE\u7F6E:"Access settings",\u67E5\u770B\u8BBF\u95EE\u6743\u9650\u8BF4\u660E:"View access permission details",\u5141\u8BB8\u6240\u6709\u7528\u6237:"Allow all users",\u4EC5\u767D\u540D\u5355\u7528\u6237:"Allowlisted users only",\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650:"Default command permission",\u547D\u4EE4\u6743\u9650:"Command permission",\u53EF\u4EE5\u6267\u884C\u547D\u4EE4:"Can run commands",\u4E0D\u53EF\u4EE5\u6267\u884C\u547D\u4EE4:"Cannot run commands",\u767D\u540D\u5355\u7528\u6237:"Allowlisted users",\u67E5\u770B\u767D\u540D\u5355\u8BF4\u660E:"View allowlist details",\u547D\u4EE4\u6743\u9650\u4F8B\u5916:"Command permission exceptions","\u5F53\u524D\u6CA1\u6709\u767D\u540D\u5355\u7528\u6237\uFF0C\u4FDD\u5B58\u540E\u666E\u901A\u7528\u6237\u5C06\u65E0\u6CD5\u4F7F\u7528\u673A\u5668\u4EBA\u3002":"There are currently no allowlisted users. After saving, regular users will not be able to use the bot.",\u65B0\u589E\u7528\u6237:"Add user",\u5C1A\u672A\u6DFB\u52A0\u7528\u6237:"No users added",\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u7FA4\u804A:"Group chat is not supported by this channel","\u539F\u6240\u6709\u8005\u6216\u626B\u7801\u63A5\u5165\u8005\u59CB\u7EC8\u53EF\u4EE5\u8BBF\u95EE\u5E76\u6267\u884C\u547D\u4EE4\uFF1B\u4EE5\u4E0B\u8BBE\u7F6E\u4EC5\u7EA6\u675F\u5176\u4ED6\u7528\u6237\u3002":"The original owner or QR-code operator can always access the bot and run commands; the settings below apply only to other users.","\u6B64\u533A\u57DF\u65E0\u9700\u914D\u7F6E\uFF0C\u4FDD\u5B58\u79C1\u804A\u8BBE\u7F6E\u65F6\u4F1A\u4FDD\u7559\u73B0\u6709\u7FA4\u804A\u7B56\u7565\u3002":"No setup is needed here. Saving direct-message settings keeps the existing group policy.","\u8BBF\u95EE\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\u3002":"Access settings saved.","\u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Access settings are currently unavailable.","\u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not save access settings. Try again later.","\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u5DF2\u4FDD\u5B58\u7684\u8BBF\u95EE\u7B56\u7565\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\u3002":"The service did not return the saved access policy. Refresh and try again.","\u8BBF\u95EE\u7B56\u7565\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868\u5237\u65B0\u540E\u91CD\u8BD5\u3002":"The access policy is not ready. Return to the bot list, refresh, and try again.","\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Access settings are not supported by this channel yet.","\u7528\u6237\u6807\u8BC6\u65E0\u6548\u3002":"The user ID is invalid.","\u7528\u6237\u6807\u8BC6\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u3002":"The user ID must be a string.","\u7528\u6237\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A\u3001\u5305\u542B\u63A7\u5236\u5B57\u7B26\u6216\u8D85\u8FC7 256 \u4E2A\u5B57\u7B26\u3002":"The user ID cannot be empty, contain control characters, or exceed 256 characters.","\u7528\u6237\u6761\u76EE\u5FC5\u987B\u5305\u542B\u7528\u6237\u6807\u8BC6\u548C\u547D\u4EE4\u6743\u9650\u3002":"Each user entry must include a user ID and command permission.","\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002":"Command permission must be a boolean.","\u8BBF\u95EE\u6A21\u5F0F\u53EA\u80FD\u662F open \u6216 allowlist\u3002":"Access mode must be open or allowlist.","\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002":"Open-mode settings must be complete.","\u5F00\u653E\u6A21\u5F0F\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002":"The open-mode default command permission must be a boolean.","\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002":"Open-mode command permission overrides must be an array.","\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002":"Open-mode command permission overrides cannot contain duplicate user IDs.","\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002":"Allowlist-mode settings must be complete.","\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002":"Allowlist-mode users must be an array.","\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002":"Allowlist-mode users cannot contain duplicate user IDs.","\u8BBF\u95EE\u573A\u666F\u8BBE\u7F6E\u5FC5\u987B\u540C\u65F6\u5305\u542B\u6A21\u5F0F\u3001\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u548C\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u3002":"Each access context must include its mode, open-mode settings, and allowlist-mode settings.","\u8BF7\u540C\u65F6\u63D0\u4EA4\u5B8C\u6574\u7684\u79C1\u804A\u548C\u7FA4\u804A\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Submit complete direct-message and group access settings together.","\u586B\u5199\u5FAE\u4FE1\u7528\u6237 ID":"Enter a WeChat user ID","\u98DE\u4E66 Open ID":"Feishu Open ID","\u7FA4\u6210\u5458 Open ID":"Group member Open ID","\u9489\u9489\u7528\u6237 ID":"DingTalk user ID","\u586B\u5199 senderStaffId \u6216 senderId":"Enter senderStaffId or senderId","\u7FA4\u6210\u5458\u7528\u6237 ID":"Group member user ID","\u4F01\u4E1A\u5FAE\u4FE1\u7528\u6237 ID":"WeCom user ID","\u586B\u5199 userid":"Enter userid","\u586B\u5199 member_openid":"Enter member_openid","QQ User Open ID":"QQ User Open ID","\u7FA4\u6210\u5458 User ID":"Group member User ID","\u586B\u5199\u6570\u5B57 User ID":"Enter a numeric user ID","WhatsApp \u7535\u8BDD\u53F7\u7801\u6216 JID":"WhatsApp phone number or JID","\u7FA4\u6210\u5458\u7535\u8BDD\u53F7\u7801\u6216 JID":"Group member phone number or JID","8613800000000 \u6216\u5B8C\u6574 JID":"8613800000000 or a full JID","IM \u6E20\u9053":"IM channels","\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA":"Connecting DeepSeek Harness",\u5F53\u524D\u7248\u672C:"Current version","DSH-IM \u66F4\u65B0":"DSH-IM update",\u68C0\u67E5\u66F4\u65B0:"Check for updates",\u91CD\u65B0\u68C0\u67E5:"Check again",\u5237\u65B0\u72B6\u6001:"Refresh status",\u624B\u5DE5\u66F4\u65B0:"Manual update",\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4:"Manual update command",\u590D\u5236\u547D\u4EE4:"Copy command","\u590D\u5236\u4E2D\u2026":"Copying\u2026",\u5DF2\u590D\u5236:"Copied","\u547D\u4EE4\u5DF2\u590D\u5236\u3002":"Command copied.","\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u9009\u4E2D\u547D\u4EE4\u540E\u6309 Ctrl+C \u6216 \u2318C \u590D\u5236\u3002":"Copy failed. Select the command and press Ctrl+C or \u2318C to copy it.","\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u53EF\u4EE5\u4F7F\u7528\u547D\u4EE4\u66F4\u65B0\uFF1A":"If the automatic update fails, update with this command:","\u5C1A\u672A\u786E\u8BA4\u76EE\u6807\u7248\u672C\uFF0C\u6B64\u547D\u4EE4\u5B89\u88C5\u6267\u884C\u65F6 npm \u7684 latest \u7248\u672C\u3002":"No target version has been confirmed. This command installs the npm latest version available when you run it.","\u8BF7\u5728\u5F53\u524D Desktop \u7684\u5185\u7F6E\u7EC8\u7AEF\u6267\u884C\uFF0C\u5B8C\u6210\u540E\u624B\u52A8\u91CD\u542F\u3002":"Run this in the current Desktop\u2019s built-in terminal, then restart manually.","\u8BF7\u5728\u8FD0\u884C\u5F53\u524D Harness \u7684\u540C\u4E00\u73AF\u5883\u6267\u884C\uFF0C\u4FDD\u6301 DSH_HOME \u4E00\u81F4\uFF0C\u5B8C\u6210\u540E\u624B\u52A8\u91CD\u542F\u3002":"Run this in the same environment as the current Harness, with the same DSH_HOME, then restart manually.","\u8BF7\u7B49\u5F85\u5F53\u524D\u64CD\u4F5C\u7ED3\u675F\uFF0C\u786E\u8BA4\u6CA1\u6709\u5B89\u88C5\u8FDB\u7A0B\u8FD0\u884C\u540E\u518D\u6267\u884C\u547D\u4EE4\u3002":"Wait for the current operation to finish and confirm no installer is running before using this command.","\u6E90\u7801\u6216\u94FE\u63A5\u5B89\u88C5\u8BF7\u6309\u539F\u5B89\u88C5\u65B9\u5F0F\u66F4\u65B0\uFF0C\u4E0D\u63D0\u4F9B\u8986\u76D6\u6E90\u7801\u7684 npm \u547D\u4EE4\u3002":"Update source or linked installations using their original method. No npm command is provided to overwrite the source.","\u65E0\u6CD5\u5B89\u5168\u751F\u6210\u5F53\u524D profile \u7684\u547D\u4EE4\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u624B\u52A8\u786E\u8BA4 profile \u540E\u66F4\u65B0\u3002":"A safe command cannot be generated for this profile. Confirm the profile in your terminal before updating manually.",\u66F4\u65B0\u81F3:"Update to",\u5B89\u88C5\u66F4\u65B0:"Install update","\u6B63\u5728\u66F4\u65B0\u2026":"Updating\u2026",\u5F85\u624B\u52A8\u91CD\u542F:"Restart needed",\u8FD0\u884C\u7248\u672C:"Running version",\u5DF2\u5B89\u88C5\u7248\u672C:"Installed version","\u76EE\u6807 profile":"Target profile",\u76EE\u6807\u7248\u672C:"Target version",\u65E0\u6CD5\u786E\u8BA4:"Unknown",\u53D1\u73B0\u65B0\u7248\u672C:"Update available",\u5DF2\u662F\u6700\u65B0\u7248\u672C:"Up to date",\u5F53\u524D\u7248\u672C\u65E0\u9700\u66F4\u65B0:"No newer version available","\u5DF2\u83B7\u53D6 npm \u6700\u65B0\u7248\u672C":"Latest npm version retrieved","\u68C0\u67E5 npm \u6700\u65B0\u7248\u672C\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u5B89\u88C5\u3002":"Check the latest npm version. Nothing is installed automatically.","\u6B63\u5728\u4ECE npm \u68C0\u67E5\u6700\u65B0\u7248\u672C\u2026":"Checking npm for the latest version\u2026","\u6B63\u5728\u5B89\u88C5\uFF0C\u8BF7\u7A0D\u5019\u2026":"Installing, please wait\u2026","\u6B63\u5728\u6821\u9A8C\u5B89\u88C5\u7ED3\u679C\u2026":"Verifying the installation\u2026","\u5DF2\u5B89\u88C5\uFF0C\u5F85\u624B\u52A8\u91CD\u542F":"Installed \u2014 manual restart needed",\u66F4\u65B0\u5DF2\u751F\u6548:"Updated version is active",\u66F4\u65B0\u5931\u8D25:"Update failed",\u66F4\u65B0\u8BF7\u6C42\u5931\u8D25:"Update request failed","\u4EC5\u66F4\u65B0 DSH-IM\u3002\u5B89\u88C5\u5B8C\u6210\u540E\u9700\u624B\u52A8\u91CD\u542F\u540E\u53F0\uFF1B\u672C\u529F\u80FD\u4E0D\u4F1A\u81EA\u52A8\u91CD\u542F\u6216\u4E3B\u52A8\u5237\u65B0\u9875\u9762\u3002":"Only DSH-IM will be updated. Restart the backend manually after installation. This feature does not automatically restart it or initiate a page refresh.","\u5F53\u524D\u662F\u6E90\u7801\u6216\u94FE\u63A5\u5B89\u88C5\uFF0C\u53EA\u80FD\u68C0\u67E5\u7248\u672C\uFF1B\u8BF7\u624B\u52A8\u66F4\u65B0\u6E90\u7801\uFF0C\u6216\u8FC1\u79FB\u5230 npm \u5B89\u88C5\u3002":"This is a source or linked installation. You can check versions, but must update the source manually or migrate to an npm installation.","\u65E0\u6CD5\u786E\u8BA4\u5F53\u524D profile\uFF0C\u8BF7\u5728\u5BF9\u5E94\u7684 Harness \u73AF\u5883\u4E2D\u624B\u52A8\u66F4\u65B0\u3002":"The current profile could not be identified. Update manually in the corresponding Harness environment.","\u5F53\u524D\u8FD0\u884C\u73AF\u5883\u4E0D\u652F\u6301\u6309\u94AE\u5B89\u88C5\uFF0C\u8BF7\u624B\u52A8\u66F4\u65B0\u63D2\u4EF6\u3002":"This runtime cannot install through this button. Update the plugin manually.","\u5F53\u524D npm \u6E90\u914D\u7F6E\u4E0E\u5B98\u65B9\u6E90\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u5148\u68C0\u67E5 registry \u914D\u7F6E\u3002":"The npm registry configuration differs from the official registry. Check your registry settings first.","\u5F53\u524D Host \u7684 Node.js \u7248\u672C\u4E0D\u6EE1\u8DB3\u65B0\u7248\u8981\u6C42\uFF0C\u8BF7\u5148\u66F4\u65B0\u8FD0\u884C\u73AF\u5883\u3002":"The Host Node.js version does not meet the new version\u2019s requirements. Update the runtime first.","\u65B0\u7248\u672C\u5DF2\u5B89\u88C5\uFF0C\u8BF7\u5728\u65B9\u4FBF\u65F6\u624B\u52A8\u91CD\u542F\u5F53\u524D Harness \u6216 Desktop\u3002":"The new version is installed. Manually restart this Harness or Desktop when convenient.","\u4E0A\u6B21\u5B89\u88C5\u7ED3\u679C\u65E0\u6CD5\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u6B64 profile \u7684\u63D2\u4EF6\u5B89\u88C5\u72B6\u6001\u3002":"The previous installation result is uncertain. Check this profile\u2019s plugin installation first.","\u65E0\u6CD5\u8BBF\u95EE npm \u6216\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u68C0\u67E5\u3002":"npm is unreachable or the request timed out. Check again later.","npm \u8FD4\u56DE\u7684\u7248\u672C\u4FE1\u606F\u65E0\u6548\uFF0C\u6682\u65F6\u65E0\u6CD5\u66F4\u65B0\u3002":"npm returned invalid release information. Updating is unavailable.","\u7248\u672C\u786E\u8BA4\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u540E\u518D\u5B89\u88C5\u3002":"The version confirmation expired. Check again before installing.","\u63D2\u4EF6\u5B89\u88C5\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u3002":"The plugin installation changed. Check again.","\u6B64 profile \u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u67E5\u770B\u72B6\u6001\u3002":"This profile is already updating. Check its status shortly.","\u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u5B89\u88C5\u72B6\u6001\u540E\u91CD\u8BD5\u3002":"Installation failed. Check the current installation before retrying.","\u5B89\u88C5\u7ED3\u679C\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u68C0\u67E5\u63D2\u4EF6\u7248\u672C\u3002":"Installation verification failed. Check the plugin version manually.","\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u66F4\u65B0\u72B6\u6001\uFF0C\u8BF7\u5148\u68C0\u67E5\u5F53\u524D\u5B89\u88C5\u7ED3\u679C\u3002":"Update state could not be saved safely. Check the current installation result before retrying.","\u4E0A\u6B21\u66F4\u65B0\u5DF2\u4E2D\u65AD\uFF0C\u8BF7\u68C0\u67E5\u5B89\u88C5\u72B6\u6001\u540E\u91CD\u8BD5\u3002":"The previous update was interrupted. Check the installation before retrying.","\u66F4\u65B0\u670D\u52A1\u5DF2\u5173\u95ED\uFF0C\u8BF7\u624B\u52A8\u91CD\u65B0\u6253\u5F00\u8BBE\u7F6E\u9875\u3002":"The update service has closed. Reopen settings manually.","\u66F4\u65B0\u8BF7\u6C42\u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u7248\u672C\u3002":"The update request is invalid. Check the version again.","\u5F53\u524D\u63D2\u4EF6\u5B89\u88C5\u4E0D\u5B8C\u6574\u6216\u4E0E profile \u4E0D\u7B26\uFF0C\u8BF7\u624B\u52A8\u68C0\u67E5\u5B89\u88C5\u914D\u7F6E\u3002":"The plugin installation is incomplete or does not match this profile. Check the installation configuration manually.","\u65E0\u6CD5\u786E\u8BA4\u5F53\u524D npm \u6E90\u914D\u7F6E\uFF0C\u6682\u65F6\u4E0D\u80FD\u5B89\u88C5\u66F4\u65B0\u3002":"The npm registry configuration could not be verified. Installation is unavailable.","\u5B89\u88C5\u8D85\u65F6\uFF0C\u8BF7\u5148\u786E\u8BA4\u5F53\u524D\u5B89\u88C5\u72B6\u6001\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91CD\u8BD5\u3002":"Installation timed out. Check the current installation before retrying.","\u66F4\u65B0\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"The update request failed. Try again.","\u66F4\u65B0\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002":"The update service returned an unrecognized response.","\u5F53\u524D Host \u4E0D\u652F\u6301\u66F4\u65B0\u63A5\u53E3\uFF0C\u8BF7\u5148\u624B\u52A8\u66F4\u65B0\u63D2\u4EF6\u5E76\u91CD\u542F\u3002":"This Host does not support the update API. Update the plugin manually and restart first.","\u5173\u95ED\u7A97\u53E3\u4E0D\u4F1A\u53D6\u6D88\u5B89\u88C5\u3002\u8BF7\u52FF\u540C\u65F6\u5728\u5176\u4ED6\u7A97\u53E3\u7BA1\u7406\u6B64 profile \u7684\u63D2\u4EF6\u3002":"Closing this window does not cancel installation. Do not manage this profile\u2019s plugins in another window at the same time.","\u9875\u9762\u7248\u672C\u4E0E\u8FD0\u884C\u7248\u672C\u4E0D\u540C\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u9875\u9762\uFF1B\u82E5\u4ECD\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u624B\u52A8\u91CD\u542F Harness \u6216 Desktop\u3002":"The page and running versions differ. Refresh the page manually; if they still differ, manually restart Harness or Desktop.","\u8BF7\u5728\u673A\u5668\u4EBA\u7A7A\u95F2\u65F6\u5B89\u88C5\uFF1B\u5B89\u88C5\u4F1A\u4FEE\u6539\u5F53\u524D profile \u7684\u4F9D\u8D56\uFF0C\u5B8C\u6210\u540E\u9700\u624B\u52A8\u91CD\u542F\u3002":"Install while bots are idle. This changes the current profile\u2019s dependencies and requires a manual restart afterward.","AI Office":"AI Office","\uFF08\u5B9E\u9A8C\u529F\u80FD\uFF09":"(Experimental)","AI Office \u8BBE\u7F6E":"AI Office settings","AI Office \u8BBE\u7F6E\u9875\u7F3A\u5C11 RPC \u8FDE\u63A5":"AI Office settings are missing an RPC connection","\u6B63\u5728\u8BFB\u53D6 AI Office Connector\u2026":"Loading AI Office Connector\u2026","\u672C\u673A\u4E3B\u52A8\u8FDE\u63A5\u516C\u7F51 Office\uFF1BHarness \u4E0D\u5F00\u653E\u7AEF\u53E3\u3002\u534F\u8BAE Hook \u56FA\u5B9A\u4E3A ":"This machine connects outward to the public Office; Harness exposes no port. Protocol hooks: ",\u5C1A\u672A\u914D\u7F6E:"Not configured","\u5DF2\u8FDE\u63A5 Office":"Connected to Office",\u5DF2\u914D\u7F6E:"Configured",\u7B49\u5F85\u91CD\u8FDE:"Waiting to reconnect",\u51ED\u636E\u7F3A\u5931:"Credential missing",\u6700\u8FD1\u5FC3\u8DF3:"Last heartbeat",\u6700\u8FD1\u4E8B\u4EF6:"Last event",\u91CD\u8FDE\u6B21\u6570:"Reconnects","\u8FD0\u884C Job":"Running Jobs","\u5B8C\u6210 Job":"Completed Jobs",\u5C1A\u65E0:"None yet",\u8BBE\u5907\u8FDE\u63A5:"Device connection","Token \u53EA\u5199\u5165\u672C\u673A\u51ED\u636E\u5B58\u50A8":"Token is written only to the local credential store","\u7C98\u8D34 Office \u4E00\u6B21\u6027\u51ED\u636E":"Paste the one-time Office credential","\u5DF2\u5B89\u5168\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"Stored securely; leave blank to keep it",\u6700\u5927\u5E76\u53D1:"Max concurrency","Heartbeat \u79D2\u6570":"Heartbeat seconds","Workspace \u6620\u5C04":"Workspace mappings","\u6BCF\u884C alias=/\u672C\u673A/\u7EDD\u5BF9\u8DEF\u5F84\uFF1BOffice \u53EA\u80FD\u770B\u5230 alias\u3002":"One alias=/local/absolute/path per line; Office sees only aliases.","Instruction Preset \u6620\u5C04":"Instruction preset mappings","\u6BCF\u884C alias=\u6307\u4EE4\uFF1B\u65B0\u589E preset \u4E0D\u9700\u8981\u6539 Office \u4EE3\u7801\u3002":"One alias=instruction per line; new presets require no Office code change.",\u4FDD\u5B58\u5E76\u8FDE\u63A5:"Save and connect",\u6D4B\u8BD5\u8FDE\u63A5:"Test connection","\u6D4B\u8BD5\u4E2D\u2026":"Testing\u2026",\u91CD\u65B0\u8FDE\u63A5:"Reconnect",\u79FB\u9664\u8FDE\u63A5:"Remove connection","\u8FDE\u63A5\u6D4B\u8BD5\u901A\u8FC7\u3002":"Connection test passed.","\u914D\u7F6E\u5DF2\u4FDD\u5B58\u3002":"Configuration saved.","\u534F\u8BAE Hook \u9884\u89C8":"Protocol hook preview","\u7531 Base URL \u81EA\u52A8\u6D3E\u751F\uFF0C\u4E0D\u5355\u72EC\u586B\u5199":"Derived from Base URL; no separate input","Base URL \u65E0\u6548":"Invalid Base URL","Office Hook \u5C1A\u672A\u90E8\u7F72\u65F6\uFF0C\u914D\u7F6E\u4F1A\u5B89\u5168\u4FDD\u5B58\u5E76\u81EA\u52A8\u91CD\u8BD5\uFF1B\u51FA\u73B0 HTTP 404 \u4EE3\u8868\u534F\u8BAE\u7AEF\u70B9\u5F85\u4E0A\u7EBF\uFF0C\u4E0D\u4EE3\u8868 Harness \u6545\u969C\u3002":"Configuration is saved and retried while Office hooks are unavailable; HTTP 404 means the protocol endpoint is pending, not a Harness failure.","Workspace \u6620\u5C04\u6BCF\u884C\u5FC5\u987B\u4F7F\u7528 alias=value":"Each workspace mapping must use alias=value","Instruction Preset \u6620\u5C04\u6BCF\u884C\u5FC5\u987B\u4F7F\u7528 alias=value":"Each instruction preset mapping must use alias=value","action-items=\u8F6C\u6362\u4E3A\u8D1F\u8D23\u4EBA\u3001\u622A\u6B62\u548C\u9A8C\u6536\u660E\u786E\u7684\u5DE5\u5355":"action-items=Turn this into accountable tasks with deadlines and acceptance criteria","AI Office \u62D2\u7EDD\u4E86 Device Token\u3002":"AI Office rejected the Device Token.","AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002":"AI Office Connector hooks are not available yet.","AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002":"The AI Office Connector protocol is incompatible.","\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002":"AI Office cannot currently be reached from this machine.","AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002":"The AI Office connection was interrupted.","\u5E2E\u52A9\u4E0E\u53CD\u9988 \xB7 \u524D\u5F80 GitHub":"Help & feedback \xB7 Open GitHub","\u8BF7\u6539\u7528 localhost \u91CD\u65B0\u6253\u5F00":"Reopen with localhost","\u9875\u9762\u4F1A\u5728\u5F53\u524D\u7AEF\u53E3\u91CD\u65B0\u6253\u5F00\uFF0C\u673A\u5668\u4EBA\u914D\u7F6E\u4E0D\u4F1A\u6539\u53D8\u3002":"The page will reopen on the current port. Your bot configuration will not change.","\u4F7F\u7528 localhost \u91CD\u65B0\u6253\u5F00":"Reopen with localhost","\u5F53\u524D\u5730\u5740\u4E0E\u6D4F\u89C8\u5668\u7684\u672C\u673A\u8BF7\u6C42\u6821\u9A8C\u4E0D\u517C\u5BB9\u3002\u8BF7\u4F7F\u7528\u4E0A\u65B9\u6309\u94AE\u6539\u7528 localhost \u91CD\u65B0\u6253\u5F00\u3002":"This address is incompatible with the browser\u2019s local-request checks. Use the button above to reopen with localhost.",\u5FAE\u4FE1:"WeChat",\u98DE\u4E66:"Feishu",\u9489\u9489:"DingTalk",\u4F01\u4E1A\u5FAE\u4FE1:"WeCom",\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeChat bot",\u98DE\u4E66\u673A\u5668\u4EBA:"Feishu bot",\u9489\u9489\u673A\u5668\u4EBA:"DingTalk bot",\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeCom bot",QQ\u673A\u5668\u4EBA:"QQ bot",WhatsApp\u673A\u5668\u4EBA:"WhatsApp bot",WhatsApp\u8D26\u53F7:"WhatsApp account",\u5FAE\u4FE1\u8BBE\u7F6E:"WeChat settings",\u98DE\u4E66\u673A\u5668\u4EBA\u8BBE\u7F6E:"Feishu bot settings",\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F:"Group response mode","\u4EC5\u5728 @\u673A\u5668\u4EBA\u65F6\u54CD\u5E94\uFF08\u63A8\u8350\uFF09":"Only respond when @mentioned (recommended)",\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F:"Respond to all group messages","\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\uFF08\u9700\u98DE\u4E66\u654F\u611F\u6743\u9650\uFF09":"Respond to all group messages (requires a sensitive Feishu scope)",\u91CD\u65B0\u6388\u6743:"Reauthorize",\u53BB\u6388\u6743:"Authorize",\u91CD\u65B0\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650:"Reauthorize group-message permission",\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650:"Authorize group-message permission","\u6B63\u5728\u51C6\u5907\u6388\u6743\u2026":"Preparing authorization\u2026","\u6B63\u5728\u51C6\u5907\u2026":"Preparing\u2026","\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u5F00\u901A\uFF0C\u518D\u6B21\u5207\u6362\u65E0\u9700\u6388\u6743\u3002":"Direct messages always work; group chats require an explicit @mention of this bot. The group-message permission is already granted, so switching again needs no authorization.","\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u9009\u62E9\u5168\u90E8\u6D88\u606F\u540E\u4F1A\u6253\u5F00\u98DE\u4E66\u5B98\u65B9\u6388\u6743\u6D41\u7A0B\u3002":"Direct messages always work; group chats require an explicit @mention of this bot. Selecting all messages opens the official Feishu authorization flow.","\u5DF2\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF08im:message.group_msg\uFF09\uFF1B\u673A\u5668\u4EBA\u4F1A\u5904\u7406\u7FA4\u804A\u4E2D\u7684\u6240\u6709\u53EF\u89C1\u6D88\u606F\u3002":"The \u201CRead all messages in associated group chat\u201D scope (im:message.group_msg) is granted; the bot processes every visible group message.","\u5C1A\u672A\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF0C\u8BF7\u5B8C\u6210\u98DE\u4E66\u6388\u6743\u3002":"The \u201CRead all messages in associated group chat\u201D scope has not been confirmed. Complete Feishu authorization.","\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002":"Direct messages always work; group chats require an explicit @mention of this bot.","\u9700\u5728\u98DE\u4E66\u4E3A\u8BE5\u673A\u5668\u4EBA\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF08im:message.group_msg\uFF09\uFF1B\u5F00\u901A\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u5904\u7406\u7FA4\u804A\u4E2D\u7684\u6240\u6709\u53EF\u89C1\u6D88\u606F\u3002":"Grant this bot the \u201CRead all messages in associated group chat\u201D Feishu scope (im:message.group_msg); once granted, it will process every visible group message.","\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not update the group response mode. Try again.","\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not authorize group-message permission. Try again.",\u9489\u9489\u8BBE\u7F6E:"DingTalk settings",\u4F01\u4E1A\u5FAE\u4FE1\u8BBE\u7F6E:"WeCom settings",\u626B\u7801\u63A5\u5165\u673A\u5668\u4EBA:"Scan QR code",\u6B63\u5728\u63A5\u5165:"Connecting",\u624B\u52A8\u63A5\u5165:"Manual setup",\u6536\u8D77\u51ED\u636E:"Hide credentials",\u6536\u8D77\u63A5\u5165:"Hide setup",\u63A5\u5165\u673A\u5668\u4EBA:"Connect bot",\u5F00\u59CB\u63A5\u5165:"Start setup",\u5728\u7EBF:"online",\u8FD0\u884C\u6B63\u5E38:"Connected",\u6B63\u5728\u8FDE\u63A5:"Connecting","\u6B63\u5728\u8FDE\u63A5\u2026":"Connecting\u2026",\u8FDE\u63A5\u672A\u5C31\u7EEA:"Not connected",\u8FDE\u63A5\u4E2D:"Connecting",\u8FDE\u63A5\u4E2D\u65AD:"Disconnected",\u9700\u8981\u5904\u7406:"Needs attention",\u72B6\u6001\u672A\u77E5:"Unknown status",\u79BB\u7EBF:"Offline",\u5DF2\u65AD\u5F00:"Disconnected",\u6D88\u606F\u901A\u9053:"Message channel",\u67E5\u770B\u6D88\u606F\u901A\u9053\u8BF4\u660E:"View message channel details",\u6700\u8FD1\u68C0\u67E5:"Last checked",\u6700\u8FD1\u4E00\u6761\u6D88\u606F\u5904\u7406\u5931\u8D25:"Latest message failed",\u9519\u8BEF\u7801:"Code",\u53C2\u8003\u53F7:"Reference",\u5F53\u524D\u5DE5\u4F5C\u533A:"Current workspace",\u9009\u62E9\u76EE\u5F55:"Choose folder",\u9009\u62E9\u673A\u5668\u4EBA\u5DE5\u4F5C\u533A\u76EE\u5F55:"Select bot workspace folder",\u5F53\u524D\u76EE\u5F55:"Current folder",\u4E3B\u76EE\u5F55:"Home",\u76F4\u63A5\u8F93\u5165\u8DEF\u5F84:"Enter a path directly","\u652F\u6301 Windows \u76D8\u7B26\u3001UNC \u4E0E POSIX \u7EDD\u5BF9\u8DEF\u5F84\u3002":"Supports Windows drives, UNC paths, and POSIX absolute paths.","\u8F93\u5165 Host \u4E0A\u7684\u5B8C\u6574\u7EDD\u5BF9\u8DEF\u5F84":"Enter a full absolute path on the Host",\u524D\u5F80:"Go","\u8BFB\u53D6\u4E2D\u2026":"Loading\u2026","\u6B63\u5728\u51C6\u5907\u76EE\u5F55\u9009\u62E9\u5668\u2026":"Preparing folder picker\u2026","\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026":"Loading folders\u2026","\u8FD9\u4E2A\u76EE\u5F55\u4E2D\u6CA1\u6709\u5B50\u6587\u4EF6\u5939\u3002":"This folder has no subfolders.","\u6B64\u76EE\u5F55\u7684\u5B50\u6587\u4EF6\u5939\u8FC7\u591A\uFF0C\u4EC5\u663E\u793A\u524D\u4E00\u90E8\u5206\u3002":"This folder has too many subfolders; only the first group is shown.","\u65E0\u6CD5\u8BFB\u53D6\u76EE\u5F55\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not load the folder. Try again.",\u91CD\u8BD5:"Retry",\u663E\u793A\u9690\u85CF\u6587\u4EF6\u5939:"Show hidden folders","\u5207\u6362\u540E\u4F1A\u6E05\u9664\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u65E7\u4F1A\u8BDD\u6620\u5C04\u3002":"Switching clears this bot\u2019s previous session mappings.","\u5207\u6362\u4E2D\u2026":"Switching\u2026",\u9009\u62E9\u6B64\u76EE\u5F55:"Select this folder",\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84:"Absolute workspace path","/\u7EDD\u5BF9\u8DEF\u5F84/\u5230/\u5DE5\u4F5C\u533A":"/absolute/path/to/workspace",\u4FEE\u6539:"Change",\u4FDD\u5B58:"Save",\u4E0A\u4E0B\u6587\u589E\u5F3A:"Context enhancement",\u672A\u5F00\u542F:"Not enabled",\u4EC5\u7FA4\u804A:"Groups only",\u4EC5\u79C1\u804A:"Direct only",\u7FA4\u804A\u548C\u79C1\u804A:"Groups and direct",\u5173\u95ED\u5F39\u7A97:"Close dialog",\u67E5\u770B\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BF4\u660E:"View context enhancement details",\u4E0A\u4E0B\u6587\u589E\u5F3A\u8303\u56F4:"Context enhancement scope",\u542F\u7528\u8303\u56F4:"Enable in",\u542F\u7528:"Enabled","\uFF08\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u7FA4\u804A\uFF09":"(This channel does not support group chats)",\u6765\u6E90\u5B57\u6BB5:"Source fields",\u67E5\u770B\u6765\u6E90\u5B57\u6BB5\u8BF4\u660E:"View source field details",\u67E5\u770B\u7FA4\u804A\u6765\u6E90\u5B57\u6BB5\u8BF4\u660E:"View group source field details",\u67E5\u770B\u79C1\u804A\u6765\u6E90\u5B57\u6BB5\u8BF4\u660E:"View direct source field details",\u6E20\u9053:"Channel",\u4F1A\u8BDD\u7C7B\u578B:"Conversation type",\u53D1\u9001\u8005\u6807\u8BC6:"Sender ID",\u53D1\u9001\u8005\u6635\u79F0:"Sender name",\u67E5\u770B\u53D1\u9001\u8005\u6635\u79F0\u5B57\u6BB5\u8BF4\u660E:"View sender name field details",\u67E5\u770B\u7FA4\u804A\u53D1\u9001\u8005\u6635\u79F0\u5B57\u6BB5\u8BF4\u660E:"View group sender name field details",\u67E5\u770B\u79C1\u804A\u53D1\u9001\u8005\u6635\u79F0\u5B57\u6BB5\u8BF4\u660E:"View direct sender name field details","\u8BE5\u5B57\u6BB5\u4E0D\u662F\u6BCF\u4E2A\u6E20\u9053\u90FD\u80FD\u63D0\u4F9B\u3002\u5F53\u524D\u6D88\u606F\u6CA1\u6709\u53D1\u9001\u8005\u6635\u79F0\u65F6\uFF0C\u5373\u4F7F\u5DF2\u9009\u62E9\u8BE5\u5B57\u6BB5\uFF0C \u4E2D\u4E5F\u4F1A\u7701\u7565 senderName\u3002":"This field is not available on every channel. If the current message has no sender name, omits senderName even when the field is selected.",\u673A\u5668\u4EBA\u6807\u8BC6:"Bot ID",\u589E\u5F3A\u63D0\u793A\u8BCD:"Guidance",\u67E5\u770B\u589E\u5F3A\u63D0\u793A\u8BCD\u4F7F\u7528\u8BF4\u660E:"View guidance instructions",\u67E5\u770B\u7FA4\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\u4F7F\u7528\u8BF4\u660E:"View group guidance instructions",\u67E5\u770B\u79C1\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\u4F7F\u7528\u8BF4\u660E:"View direct guidance instructions",\u4F7F\u7528\u8BF4\u660E:"How to use","\u7528\u4E8E\u544A\u8BC9\u6A21\u578B\u5982\u4F55\u4F7F\u7528 \u4E2D\u5DF2\u9009\u62E9\u7684\u6765\u6E90\u5B57\u6BB5\u3002\u53EA\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002":"Tell the model how to use the selected fields in . Enter only the body; the plugin adds paired tags.",\u751F\u6548\u89C4\u5219:"Behavior",\u9690\u79C1\u63D0\u793A:"Privacy",\u4F7F\u7528\u793A\u4F8B:"Example","\u4EC5\u4F9D\u636E\u5F53\u524D\u6D88\u606F\u7684 \u4E2D\u5B9E\u9645\u63D0\u4F9B\u7684\u5B57\u6BB5\u7406\u89E3\u6765\u6E90\uFF1B\u6CA1\u6709\u63D0\u4F9B\u7684\u5B57\u6BB5\u4E0D\u8981\u731C\u6D4B\u6216\u8865\u5168\u3002\nconversationType\u662F\u7FA4\u804A\u65F6\u56DE\u590D\u4E25\u8083\u4E00\u70B9\uFF0CconversationType\u662F\u79C1\u804A\u65F6\u56DE\u590D\u4E00\u5B9A\u8981\u5E7D\u9ED8\u641E\u7B11\uFF0C\u50CF\u5468\u661F\u9A70\u7684\u7535\u5F71\u4E00\u6837\u641E\u7B11":`Understand the source only from fields actually present in for the current message; do not guess or fill in missing fields. +`)+1;e{let c=String(g??"")||"\u2026";await this.#i(a,T6(c)),A=c}};await o.markdown(r);let s=Cke(A);for(let[g,c]of s.entries()){let I=g===0?a:await this.#o(t,i.replyTo);g>0&&e.push(I),await this.#i(I,c),await this.#a(I)}return{messageId:a.messageId,providerMessageIds:e.map(g=>g.messageId)}}catch(a){for(let A of e)await this.#s(A.messageId);throw a}}async sendFile(t,o,{replyTo:i,signal:e}={}){return this.#l(t,o,{replyTo:i,signal:e,messageType:"file",presentation:"feishu-file"})}async sendImage(t,o,{replyTo:i,signal:e}={}){return this.#l(t,o,{replyTo:i,signal:e,messageType:"image",presentation:"feishu-image"})}async#l(t,o,{replyTo:i,signal:e,messageType:a,presentation:A}){if(e?.throwIfAborted(),typeof t!="string"||!t)throw new TypeError("chatId is required");if(!o||typeof o!="object"||typeof o.artifactId!="string"||!o.artifactId||typeof o.deliveryKey!="string"||!o.deliveryKey||typeof o.fileName!="string"||!o.fileName||!Buffer.isBuffer(o.bytes))throw new TypeError("A materialized result file is required");let r;try{r=await _6(Q=>{Q.throwIfAborted();let y=a==="image"?this.#e.im.v1.image.create({data:{image_type:"message",image:o.bytes}}):this.#e.im.v1.file.create({data:{file_type:"stream",file_name:o.fileName,file:o.bytes}});return un(o,y),y},{signal:e,timeoutMs:this.#t,stage:"upload"})}catch(Q){throw e?.aborted?hP(e):_u("upload",Q)}e?.throwIfAborted();let s=a==="image"?r?.image_key??r?.data?.image_key:r?.file_key??r?.data?.file_key;if(typeof s!="string"||!s)throw _u("upload",void 0,r?.code);let g=hke(o,t,a),c=JSON.stringify(a==="image"?{image_key:s}:{file_key:s}),I=i?{path:{message_id:i},data:{msg_type:a,content:c,uuid:g}}:{params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:a,content:c,uuid:g}},d=()=>{let Q=i?this.#e.im.v1.message.reply(I):this.#e.im.v1.message.create(I);return un(o,Q),Q},B;try{B=await _6(async Q=>{Q.throwIfAborted();let y;try{y=await d()}catch(m){if(k6(m)!==230049)throw m;y={code:230049}}return Q.throwIfAborted(),Number(y?.code)===230049&&(y=await d(),Q.throwIfAborted()),y},{signal:e,timeoutMs:this.#r,stage:"message send"})}catch(Q){throw e?.aborted?hP(e):_u("message send",Q,void 0,{uncertain:!0})}if(Number.isFinite(Number(B?.code))&&Number(B.code)!==0)throw _u("message send",void 0,B.code,{uncertain:!0});let f=B?.data?.message_id;if(typeof f!="string"||!f)throw _u("message send",void 0,void 0,{uncertain:!0});return Zt({deliveryId:o.deliveryKey,presentation:A,providerMessageIds:[f],artifacts:[{artifactId:o.artifactId,outcome:"sent"}]})}async#o(t,o){let i=T6(this.#A),a=Cl("Feishu card.create",await this.#e.cardkit.v1.card.create({data:{type:"card_json",data:JSON.stringify(uke(i))}}))?.data?.card_id;if(!a)throw new Error("Feishu card.create returned no card_id");let A=await this.#n(t,a,o);return{cardId:a,messageId:A,content:i,sequence:0}}async#i(t,o){if(o===t.content)return;let i=await this.#e.cardkit.v1.cardElement.content({path:{card_id:t.cardId,element_id:N6},data:{content:o,sequence:++t.sequence,uuid:`content_${t.cardId}_${t.sequence}`}});Cl("Feishu cardElement.content",i),t.content=o}async#a(t){let o=await this.#e.cardkit.v1.card.settings({path:{card_id:t.cardId},data:{settings:JSON.stringify({config:{streaming_mode:!1,summary:{content:Eke(t.content)||w("\u56DE\u7B54\u5B8C\u6210")}}}),sequence:++t.sequence,uuid:`settings_${t.cardId}_${t.sequence}`}});Cl("Feishu card.settings",o)}async#n(t,o,i){let e=JSON.stringify({type:"card",data:{card_id:o}}),a=i?await this.#e.im.v1.message.reply({path:{message_id:i},data:{msg_type:"interactive",content:e}}):await this.#e.im.v1.message.create({params:{receive_id_type:"chat_id"},data:{receive_id:t,msg_type:"interactive",content:e}});Cl("Feishu message send",a);let A=a?.data?.message_id;if(!A)throw new Error("Feishu message send returned no message_id");return A}async#s(t){try{let o=await this.#e.im.v1.message.delete({path:{message_id:t}});Cl("Feishu message delete",o)}catch(o){console.warn("[bridge] unable to recall a failed streaming card:",o.message)}}async addReaction(t,o){let e=Cl("Feishu reaction.create",await this.#e.im.v1.messageReaction.create({path:{message_id:t},data:{reaction_type:{emoji_type:o}}}))?.data?.reaction_id;if(!e)throw new Error("Feishu reaction.create returned no reaction_id");return e}async removeReaction(t,o){Cl("Feishu reaction.delete",await this.#e.im.v1.messageReaction.delete({path:{message_id:t,reaction_id:o}}))}};var P6="/open-apis/application/v7/app_slash_commands",Bke=new Set(["99991640","99991672"]),ES=Object.freeze(["application:app_slash_command:read","application:app_slash_command:write"]),G6="ai-agent_outlined",CP=Object.freeze([{command:"menu",icon:"skill_outlined",default:"\u6253\u5F00\u529F\u80FD\u83DC\u5355",en_us:"Open the feature menu"},{command:"new",icon:"ai-deepthink_outlined",default:"\u5F00\u542F\u5168\u65B0\u4F1A\u8BDD",en_us:"Start a fresh session"},{command:"help",icon:"promptword_outlined",default:"\u67E5\u770B\u5E2E\u52A9",en_us:"Show help"},{command:"status",icon:"ai-functions_outlined",default:"\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001",en_us:"Show bot status"},{command:"compact",icon:"ai-block_outlined",default:"\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587",en_us:"Compact the current session"},{command:"sessionlist",icon:"chat-ai_outlined",default:"\u5217\u51FA\u4F1A\u8BDD",en_us:"List sessions"},{command:"workspacelist",icon:"folder_outlined",default:"\u5217\u51FA\u5DE5\u4F5C\u533A",en_us:"List workspaces"},{command:"watch",icon:"flag_outlined",default:"\u5173\u6CE8\u4E00\u4E2A\u4F1A\u8BDD",en_us:"Watch a session"},{command:"unwatch",icon:"clear_outlined",default:"\u53D6\u6D88\u5173\u6CE8\u4F1A\u8BDD",en_us:"Unwatch a session"},{command:"watchlist",icon:"flag_outlined",default:"\u67E5\u770B\u5173\u6CE8\u5217\u8868",en_us:"List watched sessions"},{command:"archived",icon:"folder_outlined",default:"\u8BBE\u7F6E\u5F52\u6863\u4F1A\u8BDD\u663E\u9690\uFF08on/off\uFF09",en_us:"Show or hide archived sessions (on/off)"}]);function uP(n,t){let o=n==="lark"?"https://open.larksuite.com":"https://open.feishu.cn";return new URL(t,o)}function v6(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${t} returned a non-JSON response`);if(n.code!==0){let o=new Error(`${t} failed: ${n.msg||`code ${n.code}`}`);throw o.code=String(n.code),o.msg=n.msg,o}return n}function BP(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function fP(n,t,o){try{return v6(await n.request(t),o)}catch(i){let e=i?.response?.data;if(e&&typeof e=="object"&&!Array.isArray(e)&&Object.hasOwn(e,"code"))return v6(e,o);throw i}}async function fke({appId:n,appSecret:t,domain:o,httpInstance:i,timeoutMs:e,signal:a}){if(!n||!t)throw new Error("Feishu slash registration requires app credentials");if(!i||typeof i.request!="function")throw new TypeError("Feishu slash registration requires an HTTP instance");let A=await fP(i,{method:"POST",url:uP(o,"/open-apis/auth/v3/tenant_access_token/internal").href,headers:{"content-type":"application/json; charset=utf-8"},data:{app_id:n,app_secret:t},signal:BP(a,e),timeout:e},"Feishu authentication");if(!A.tenant_access_token)throw new Error("Feishu authentication returned no tenant access token");return A.tenant_access_token}async function Qke({tenantAccessToken:n,domain:t,httpInstance:o,timeoutMs:i,signal:e}){let a=await fP(o,{method:"GET",url:uP(t,P6).href,headers:{authorization:`Bearer ${n}`,"content-type":"application/json; charset=utf-8"},signal:BP(e,i),timeout:i},"Feishu slash command list");return Array.isArray(a.data?.items)?a.data.items:[]}async function yke({tenantAccessToken:n,domain:t,httpInstance:o,timeoutMs:i,signal:e,command:a,description:A,icon:r=G6}){let s={command:a};return A&&(A.default_value||A.i18n)?s.description=A:typeof A=="string"&&A.trim()&&(s.description={default_value:A.trim()}),r&&(s.description={...s.description??{},icon:{icon_key:r}}),(await fP(o,{method:"POST",url:uP(t,P6).href,headers:{authorization:`Bearer ${n}`,"content-type":"application/json; charset=utf-8"},data:s,signal:BP(e,i),timeout:i},`Feishu slash command create (/${a})`)).data?.command_id??null}async function F6({appId:n,appSecret:t,domain:o="feishu",httpInstance:i,timeoutMs:e=15e3,signal:a,manifest:A=CP}){let r=await fke({appId:n,appSecret:t,domain:o,httpInstance:i,timeoutMs:e,signal:a}),s=new Set((await Qke({tenantAccessToken:r,domain:o,httpInstance:i,timeoutMs:e,signal:a})).map(I=>I.command)),g=[],c=[];for(let I of A){let d=String(I.command??"").replace(/^\//,"");if(d&&!s.has(d))try{let B={default_value:I.default??I.en_us??d,i18n:{zh_cn:I.default??d,en_us:I.en_us??I.default??d}},f=await yke({tenantAccessToken:r,domain:o,httpInstance:i,timeoutMs:e,signal:a,command:d,description:B,icon:I.icon??G6});g.push({command:d,command_id:f})}catch(B){if(B?.code==="40000000"&&/already exists/i.test(B?.msg??"")){s.add(d);continue}if(Bke.has(B?.code)||/(?:lacks permission|access denied)/i.test(B?.msg??"")){c.push({command:d,error:B});break}c.push({command:d,error:B?.message??String(B)})}}return{created:g,existing:[...s].filter(I=>I!=null),failed:c}}var Ske=15e3,wke="\u2705 \u4FEE\u590D\u5B8C\u6210\uFF1A\u5DF2\u5B9E\u6D4B\u6536\u5230 card.action.trigger\uFF0C\u83DC\u5355\u6309\u94AE\u73B0\u5728\u53EF\u7528\u3002",Dke="\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u8D85\u65F6\uFF1A\u672A\u6536\u5230\u6D4B\u8BD5\u5361\u6309\u94AE\u7684 card.action.trigger\uFF0C\u4E0D\u80FD\u786E\u8BA4\u6309\u94AE\u5DF2\u4FEE\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u7684\u5361\u7247\u56DE\u8C03\u914D\u7F6E\uFF0C\u786E\u8BA4\u540E\u518D\u53D1\u9001 /repair\u3002",QP="\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u5931\u8D25\uFF1A\u65E0\u6CD5\u53D1\u9001\u4E13\u7528\u6D4B\u8BD5\u5361\uFF0C\u4E0D\u80FD\u786E\u8BA4 card.action.trigger \u5DF2\u6062\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u673A\u5668\u4EBA\u6D88\u606F\u6743\u9650\u548C\u8FDE\u63A5\u72B6\u6001\u3002",Oke="\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u4E2D\u65AD\uFF1ARuntime \u5DF2\u505C\u6B62\uFF0C\u672A\u5B8C\u6210 card.action.trigger \u5B9E\u6D4B\uFF0C\u4E0D\u80FD\u786E\u8BA4\u4FEE\u590D\u6210\u529F\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u7B49\u5F85\u673A\u5668\u4EBA\u6062\u590D\u8FDE\u63A5\u3002",bke=new Set(["connected","connecting","reconnecting"]);function Mn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Mke(n){return Mn(n?.operator?.open_id)??Mn(n?.operator?.operator_id?.open_id)}function _ke(n,t){try{let o=n?.getConnectionStatus?.()?.state;return typeof o=="string"&&o?o:t}catch{return t}}function Yd(n,t){let o=new Error(t);return o.code=n,o}function Tke(n,t){if(!n||typeof n.request!="function")return;let o=i=>({...i??{},timeout:i?.timeout??t});return{request:i=>n.request(o(i)),get:(i,e)=>n.get(i,o(e)),delete:(i,e)=>n.delete(i,o(e)),head:(i,e)=>n.head(i,o(e)),options:(i,e)=>n.options(i,o(e)),post:(i,e,a)=>n.post(i,e,o(a)),put:(i,e,a)=>n.put(i,e,o(a)),patch:(i,e,a)=>n.patch(i,e,o(a))}}function Nke({allowedSenderCount:n=1}={}){return{startedAt:null,ready:!1,feishuLongConnectionState:"idle",harnessReachable:!1,messagesReceived:0,messagesReplied:0,messagesRejected:0,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0,streamResponses:0,streamUpdates:0,streamFallbacks:0,streamErrors:0,cardActionsReceived:0,cardActionProbesVerified:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastCardActionAt:null,lastError:null,agentPreset:"standard",authorizationMode:"sender-open-id-allowlist",allowedSenderCount:n,slashCommandRegistration:"idle",slashCommandsRegistered:0,slashCommandsExisting:0,slashCommandsFailed:0,slashCommandsError:null}}var CS=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d;#h;#C;#u;#B=null;#f=null;#Q=null;#S=null;#y=null;#m=null;#D=new Map;#E;#N=!0;constructor({lark:t,botId:o,appId:i,appSecret:e,domain:a="feishu",botOpenId:A,groupResponseMode:r,ownerOpenId:s,ownerOpenIds:g,harness:c,state:I,contextEnhancement:d,accessPolicy:B,repair:f,replyTimeoutMs:Q=6e5,connectTimeoutMs:y=15e3,requestTimeoutMs:m=Ske,slashCommands:T=!0,wsAgent:_,logger:R=console}){if(!t)throw new Error("FeishuRuntime requires the Feishu SDK");if(!i||!e)throw new Error("FeishuRuntime requires app credentials");let K=Array.isArray(g)?g:[s],L=[...new Set(K.filter(F=>typeof F=="string"&&F))];if(L.length===0)throw new Error("FeishuRuntime requires at least one owner open_id");if(!c)throw new Error("FeishuRuntime requires a Harness client");if(!I)throw new Error("FeishuRuntime requires a state store");if(f!=null&&!Mn(o))throw new TypeError("FeishuRuntime repair capability requires a botId");if(!Number.isFinite(m)||m<=0)throw new TypeError("FeishuRuntime requestTimeoutMs must be a positive number");this.#e=t,this.#A=Mn(o),this.#t=i,this.#r=e,this.#l=a,this.#o=Mn(A),this.#i=Io(r),this.#a=L,this.#n=c,this.#s=I,this.#p=d,this.#c=B,this.#u=f??null,this.#g=Q,this.#I=y,this.#d=m,this.#N=!!T,this.#h=_,this.#C=R,this.#E=Nke({allowedSenderCount:L.length})}get status(){return structuredClone(this.#E)}setGroupResponseMode(t){this.#i=Io(t),this.#f?.setGroupResponseMode(this.#i)}async start(){for(;;){for(;this.#y;)await this.#y;if(this.#S)return this.#S;let o=this.#Q;if(o){let i=_ke(o,this.#E.feishuLongConnectionState);if(bke.has(i))return this.status;await this.stop({preserveError:i==="failed"});continue}if(this.#B||this.#f||this.#m){await this.stop({preserveError:this.#E.feishuLongConnectionState==="failed"});continue}break}let t;return t=this.#T().finally(()=>{this.#S===t&&(this.#S=null)}),this.#S=t,t}async#T(){let t=new AbortController;this.#m=t;let{signal:o}=t,i=()=>o.reason??new DOMException("Feishu runtime stopped","AbortError"),e=()=>!o.aborted&&this.#m===t,a=()=>{if(!e())throw i()};this.#E.startedAt=new Date().toISOString(),this.#E.feishuLongConnectionState="connecting",this.#E.lastError=null;try{await this.#n.ensureRunning({signal:o}),a(),this.#E.harnessReachable=!0;let A=this.#l==="lark"?this.#e.Domain.Lark:this.#e.Domain.Feishu,r={appId:this.#t,appSecret:this.#r,domain:A},s=Tke(this.#e.defaultHttpInstance,this.#d);s&&(r.httpInstance=s);let g=new this.#e.Client(r);this.#B=g;let c=new hS({client:g,initialText:w("\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026")}),I=new pS({client:g,channel:c,harness:this.#n,state:this.#s,contextEnhancement:this.#p,accessPolicy:this.#c,status:this.#E,allowedSenderOpenIds:new Set(this.#a),botId:this.#A,appId:this.#t,botOpenId:this.#o,groupResponseMode:this.#i,repair:this.#u,replyTimeoutMs:this.#g,signal:o,logger:this.#C});this.#f=I;let d=new this.#e.EventDispatcher({}).register({"im.message.receive_v1":T=>{e()&&I.accept(T)},"im.message.reaction.created_v1":()=>{},"im.message.reaction.deleted_v1":()=>{},"card.action.trigger":T=>{e()&&(this.#E.cardActionsReceived+=1,this.#E.lastCardActionAt=new Date().toISOString(),this.#O(T)||I.onCardAction(T))}}),B,f,Q=new Promise((T,_)=>{let R=!1,K=()=>{f(i())},L=(q,V)=>{R||(R=!0,clearTimeout(F),o.removeEventListener("abort",K),q(V))},F=setTimeout(()=>{L(_,new Error(`Feishu WebSocket handshake timed out after ${this.#I}ms`))},this.#I);B=()=>{L(T)},f=q=>{L(_,q)},o.addEventListener("abort",K,{once:!0}),o.aborted&&K()});Q.catch(()=>{});let y=new this.#e.WSClient({...r,...this.#h?{agent:this.#h}:{},loggerLevel:this.#e.LoggerLevel.info,handshakeTimeoutMs:this.#I,onReady:()=>{e()&&(this.#E.feishuLongConnectionState="connected",this.#E.ready=!0,this.#E.lastError=null,B())},onError:T=>{e()&&(this.#E.feishuLongConnectionState="failed",this.#E.ready=!1,this.#E.lastError=T?.message??String(T),this.#C.error("[dsh-feishu] Feishu long connection failed:",this.#E.lastError),f(T))},onReconnecting:()=>{e()&&(this.#E.feishuLongConnectionState="reconnecting",this.#E.ready=!1)},onReconnected:()=>{e()&&(this.#E.feishuLongConnectionState="connected",this.#E.ready=!0,this.#E.lastError=null)}});this.#Q=y;let m=Promise.resolve().then(()=>y.start({eventDispatcher:d})).catch(T=>{throw f(T),T});return await Promise.all([m,Q]),a(),this.#N&&s&&this.#R(s,e,o),this.status}catch(A){throw o.aborted||(this.#E.ready=!1,this.#E.feishuLongConnectionState="failed",this.#E.lastError=A?.message??String(A),await this.#G({preserveError:!0,abortController:t})),A}}async beginCardActionProbe({expectedOperatorOpenId:t,timeoutMs:o=9e4}={}){if(!this.#E.ready||!this.#B)throw Yd("card_action_probe_unavailable","\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");let i=Mn(t);if(!i||i==="*")throw new TypeError("A precise Feishu operator open_id is required");if(!Number.isFinite(o)||o<=0||o>10*6e4)throw new TypeError("Card-action probe timeout must be between 1 and 600000ms");let e=mke().replaceAll("-",""),a;try{a=await this.#B.im.v1.message.create({params:{receive_id_type:"open_id"},data:{receive_id:i,msg_type:"interactive",content:p6(e)}})}catch{throw this.#w(i,w(QP),"failure"),Yd("card_action_probe_send_failed","\u65E0\u6CD5\u53D1\u9001\u98DE\u4E66\u5361\u7247\u56DE\u8C03\u6D4B\u8BD5")}if(a?.code&&a.code!==0)throw this.#w(i,w(QP),"failure"),Yd("card_action_probe_send_failed","\u65E0\u6CD5\u53D1\u9001\u98DE\u4E66\u5361\u7247\u56DE\u8C03\u6D4B\u8BD5");let A=Mn(a?.data?.message_id)??Mn(a?.message_id);if(!A)throw this.#w(i,w(QP),"failure"),Yd("card_action_probe_send_failed","\u98DE\u4E66\u672A\u8FD4\u56DE\u6D4B\u8BD5\u5361\u7247\u7684\u6D88\u606F ID");return new Promise((r,s)=>{let g=setTimeout(()=>{let c=this.#D.get(A);!c||c.nonce!==e||(this.#D.delete(A),this.#w(i,w(Dke),"timeout"),s(Yd("card_action_probe_timeout","\u5728\u89C4\u5B9A\u65F6\u95F4\u5185\u672A\u6536\u5230\u98DE\u4E66\u5361\u7247\u6309\u94AE\u56DE\u8C03")))},o);g.unref?.(),this.#D.set(A,{messageId:A,nonce:e,expectedOperatorOpenId:i,timeout:g,resolve:r,reject:s})})}#O(t){let o=Mn(t?.context?.open_message_id);if(!o)return!1;let i=this.#D.get(o);if(!i)return!1;let e=t?.action?.value,a=Mke(t);return e?.action!=="repair_verify"||e?.nonce!==i.nonce||a!==i.expectedOperatorOpenId?!1:(clearTimeout(i.timeout),this.#D.delete(o),this.#E.cardActionProbesVerified+=1,this.#w(a,w(wke),"success").finally(()=>{i.resolve({verified:!0,messageId:o,operatorOpenId:a})}),!0)}#w(t,o,i){let e=this.#B;return e?Promise.resolve().then(async()=>{let a=await e.im.v1.message.create({params:{receive_id_type:"open_id"},data:{receive_id:t,msg_type:"text",content:JSON.stringify({text:o})}});if(a?.code&&a.code!==0)throw new Error("Feishu callback repair notice failed");return!0}).catch(()=>(this.#C.warn?.(`[dsh-feishu] unable to send the callback repair ${i} notice`),!1)):(this.#C.warn?.(`[dsh-feishu] unable to send the callback repair ${i} notice`),Promise.resolve(!1))}async sendConnectionTest(t){if(!this.#E.ready||!this.#B){let e=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw e.code="test-target-unavailable",e}if(typeof t!="string"||!t.trim())throw new TypeError("Feishu connection test text is required");let o=async(e,a,A)=>{let r=await this.#B.im.v1.message.create({params:{receive_id_type:e},data:{receive_id:a,msg_type:"text",content:JSON.stringify({text:A})}});if(r?.code&&r.code!==0)throw new Error(`Feishu connection test failed: ${r.msg||r.code}`)},i=this.#a.find(e=>e!=="*");return i?(await o("open_id",i,t),{sent:!0}):nc({state:this.#s,text:t,channelLabel:w("\u98DE\u4E66\u673A\u5668\u4EBA"),send:async(e,a)=>{let A=typeof e?.chatId=="string"?e.chatId.trim():"";if(!A)throw Cr(w("\u98DE\u4E66\u673A\u5668\u4EBA"));await o("chat_id",A,a)}})}async sendProactiveText(t,o,{signal:i}={}){if(!this.#E.ready||!this.#B){let r=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw r.code="bot-not-connected",r}let e=t?.kind==="user"?"open_id":t?.kind==="group"?"chat_id":null,a=t?.kind==="user"?Mn(t?.route?.openId):t?.kind==="group"?Mn(t?.route?.chatId):null;if(!e||!a){let r=new TypeError("Invalid Feishu proactive delivery target");throw r.code="invalid-target",r}i?.throwIfAborted();let A=await this.#B.im.v1.message.create({params:{receive_id_type:e},data:{receive_id:a,msg_type:"text",content:JSON.stringify({text:o})}});if(A?.code&&A.code!==0){let r=new Error(`Feishu proactive delivery failed: ${A.msg||A.code}`);throw r.code="target-rejected",r}return{sent:!0}}async#R(t,o,i){this.#E.slashCommandRegistration="registering",this.#E.slashCommandsError=null;try{let e=await F6({appId:this.#t,appSecret:this.#r,domain:this.#l,httpInstance:t,signal:i,manifest:CP});if(!o())return;this.#E.slashCommandRegistration="done",this.#E.slashCommandsRegistered=e.created.length,this.#E.slashCommandsExisting=e.existing.length,this.#E.slashCommandsFailed=e.failed.length,this.#E.slashCommandsError=e.failed.length>0?e.failed.map(a=>`/${a.command}: ${a.error?.message??String(a.error)}`).join("; "):null,e.created.length>0&&this.#C.info?.(`[dsh-feishu] registered ${e.created.length} slash command(s)`),e.failed.length>0&&this.#C.warn?.(`[dsh-feishu] ${e.failed.length} slash command(s) failed to register: ${this.#E.slashCommandsError}`)}catch(e){if(!o())return;this.#E.slashCommandRegistration="failed",this.#E.slashCommandsError=e?.message??String(e),this.#C.warn?.(`[dsh-feishu] slash command registration skipped: ${this.#E.slashCommandsError}`)}}stop(t={}){if(this.#y)return this.#y;let o;return o=this.#_(t).finally(()=>{this.#y===o&&(this.#y=null)}),this.#y=o,o}async#_({preserveError:t=!1}={}){let o=this.#m;this.#m===o&&(this.#m=null),o?.abort(new DOMException("Feishu runtime stopped","AbortError"));let i=this.#S;return i&&await i.catch(()=>{}),this.#G({preserveError:t,abortController:o})}async#G({preserveError:t=!1,abortController:o}={}){let i=t?this.#E.lastError:null;this.#m===o&&(this.#m=null),o?.abort(new DOMException("Feishu runtime stopped","AbortError"));for(let A of this.#D.values())clearTimeout(A.timeout),this.#w(A.expectedOperatorOpenId,w(Oke),"abort"),A.reject(Yd("abort","\u98DE\u4E66\u8FD0\u884C\u65F6\u5DF2\u505C\u6B62"));this.#D.clear(),this.#E.ready=!1;let e=this.#Q;this.#Q=null,e?.close({force:!0});let a=this.#f;return this.#f=null,a&&await a.waitForIdle(),this.#B=null,this.#E.feishuLongConnectionState=t?"failed":"idle",this.#E.slashCommandRegistration="idle",this.#E.lastError=i,this.status}};var uS=class extends ur{constructor(t){super({...t,rpcIdPrefix:"feishu",logPrefix:"dsh-feishu"})}};import{createHash as Rke}from"node:crypto";import{mkdir as kke,readFile as vke,rename as Pke,unlink as Gke,writeFile as Fke}from"node:fs/promises";import{dirname as Lke}from"node:path";var QS="DSH_FEISHU_APP_SECRET";function Qs(n){return typeof n=="string"&&n.trim()?n.trim():null}function L6(n){let t=Qs(n);return t&&/^[A-Za-z0-9_-]{1,128}$/.test(t)?t:null}function U6(n){return`bot_${Rke("sha256").update(n).digest("hex").slice(0,24)}`}function Uke(n){let t=Array.isArray(n.ownerOpenIds)?n.ownerOpenIds:[n.ownerOpenId];return[...new Set(t.map(Qs).filter(Boolean))]}function BS(n,{legacy:t=!1}={}){if(!n||typeof n!="object")return null;let o=Qs(n.appId),i=Uke(n);if(!o||i.length===0)return null;let e=L6(n.id)??(t?U6(o):null),a=Qs(n.secretRef)??(t?QS:null);if(!e||!a||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(a))return null;let A=n.domain==="lark"?"lark":"feishu";return Object.freeze({id:e,appId:o,secretRef:a,ownerOpenIds:Object.freeze(i),domain:A,botName:Qs(n.botName),botOpenId:Qs(n.botOpenId),activated:n.activated??null,groupResponseMode:Io(n.groupResponseMode),groupMessagePermissionGranted:n.groupMessagePermissionGranted===!0,deletionPending:n.deletionPending===!0,connectedAt:Qs(n.connectedAt),createdAt:Qs(n.createdAt)??Qs(n.connectedAt)})}function Hke(n){if(!n||typeof n!="object")return null;if(n.version===2&&Array.isArray(n.bots)){let o=n.bots.map(A=>BS(A));if(o.some(A=>A===null))throw new Error("dsh-feishu config contains an invalid bot entry");let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.id)||e.has(A.secretRef)||a.has(A.appId))throw new Error("dsh-feishu config contains duplicate bot identities");i.add(A.id),e.add(A.secretRef),a.add(A.appId)}return{value:Object.freeze({version:2,bots:Object.freeze(o)}),migrated:!1}}let t=BS(n,{legacy:!0});return t?{value:Object.freeze({version:2,bots:Object.freeze([t])}),migrated:!0}:null}var fS=class{#e;#A=Object.freeze({version:2,bots:Object.freeze([])});#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=JSON.parse(await vke(this.#e,"utf8")),o=Hke(t);if(!o)throw new Error("dsh-feishu config is incomplete or invalid");this.#A=o.value,o.migrated&&await this.#o(this.#A)}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=Object.freeze({version:2,bots:Object.freeze([])})}return this}get(){let t=this.#A.bots[0];if(!t)return null;let o=structuredClone(t);return o.ownerOpenId=o.ownerOpenIds[0],o}list(){return structuredClone(this.#A.bots)}getBot(t){let o=this.#A.bots.find(i=>i.id===t);return o?structuredClone(o):null}async save(t){let o={...t};o.id||(o.id=U6(Qs(o.appId)??"invalid")),o.secretRef||(o.secretRef=QS);let i=BS(o);if(!i)throw new Error("Refusing to persist incomplete dsh-feishu configuration");return await this.#r([i]),this.get()}async saveBot(t){let o=BS(t);if(!o)throw new Error("Refusing to persist incomplete dsh-feishu bot configuration");return this.#l(i=>{if(i.find(r=>r.secretRef===o.secretRef&&r.id!==o.id))throw new Error("Refusing to share a credential reference between Feishu bots");if(i.find(r=>r.appId===o.appId&&r.id!==o.id))throw new Error("Refusing to persist the same Feishu app twice");let A=i.findIndex(r=>r.id===o.id);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async removeBot(t){if(!L6(t))throw new TypeError("Invalid Feishu bot id");return this.#l(o=>{let i=o.findIndex(a=>a.id===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await Gke(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=Object.freeze({version:2,bots:Object.freeze([])})});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o=Object.freeze({version:2,bots:Object.freeze([...t])}),i=this.#t.then(async()=>{await this.#o(o),this.#A=o});this.#t=i.then(()=>{},()=>{}),await i}async#l(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:2,bots:Object.freeze(e)});await this.#o(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#o(t){await kke(Lke(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await Fke(o,`${JSON.stringify(t,null,2)} +`,{encoding:"utf8",mode:384}),await Pke(o,this.#e)}};import{randomUUID as J6}from"node:crypto";var yP=new Set(["starting","qr_ready","polling","slow_down","domain_switched","saving"]),Kke=new Set(["polling","slow_down","domain_switched"]),Ki=Object.freeze({IDLE:"idle",STARTING:"starting",QR_READY:"qr_ready",POLLING:"polling",SLOW_DOWN:"slow_down",DOMAIN_SWITCHED:"domain_switched",SAVING:"saving",SUCCEEDED:"succeeded",EXPIRED:"expired",CANCELLED:"cancelled",ERROR:"error"});function H6(n){return["access_denied","expired_token","abort"].includes(n?.code)?n.code:"registration_failed"}function mP(n){let t=H6(n);return{code:t,message:{access_denied:"Registration was denied.",abort:"Registration was cancelled.",expired_token:"The registration QR code expired."}[t]??"Unable to register the Feishu app."}}function xke(n){let t=Number(n);if(!Number.isFinite(t)||t<=0)throw new TypeError("registerApp onQRCodeReady returned an invalid expireIn");return t}function Yke(n){if(n!==void 0){if(n===null||typeof n!="object"||Array.isArray(n))throw new TypeError("registerApp returned invalid user_info");return{...n}}}var Tg=class{#e;#A;#t;#r;#l;#o=0;#i=null;#a;constructor({registerApp:t,onCredentials:o,now:i=Date.now,setTimeout:e=globalThis.setTimeout,clearTimeout:a=globalThis.clearTimeout}={}){if(typeof t!="function")throw new TypeError("RegistrationManager requires a registerApp function");if(typeof o!="function")throw new TypeError("RegistrationManager requires an onCredentials function");if(typeof i!="function"||typeof e!="function"||typeof a!="function")throw new TypeError("RegistrationManager clock dependencies must be functions");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#a=this.#s(null,Ki.IDLE)}start(t={}){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError("Registration options must be an object");this.#f();let o={id:++this.#o,controller:new AbortController,qrCodeUrl:null,expiresAt:null,pollIntervalSeconds:null,expiryTimer:null};this.#i=o,this.#a=this.#s(o,Ki.STARTING);let i={...t,signal:o.controller.signal,onQRCodeReady:a=>this.#c(o,a),onStatusChange:a=>this.#g(o,a)};return Promise.resolve().then(()=>this.#e(i)).then(a=>this.#I(o,a),a=>this.#d(o,a)),this.status()}status(){this.#h();let t={...this.#a};t.error&&(t.error={...t.error});let o=this.#i;return o&&o.expiresAt!==null&&yP.has(t.state)&&(t.remainingSeconds=Math.max(0,Math.ceil((o.expiresAt-this.#t())/1e3))),t}cancel(){let t=this.#i;return t?(this.#u(t,Ki.CANCELLED,{error:{code:"abort",message:"Registration was cancelled."}}),t.controller.abort(),this.status()):this.status()}#n(t){return this.#i===t}#s(t,o,i={}){let e={state:o,attempt:t?.id??this.#o,updatedAt:this.#t(),...i};return t?.qrCodeUrl&&yP.has(o)&&(e.qrCodeUrl=t.qrCodeUrl,e.expiresAt=t.expiresAt),t?.pollIntervalSeconds!==null&&yP.has(o)&&(e.pollIntervalSeconds=t.pollIntervalSeconds),e}#p(t,o,i={}){this.#n(t)&&(this.#a=this.#s(t,o,i))}#c(t,o){if(!this.#n(t))return;if(typeof o?.url!="string"||!o.url)throw new TypeError("registerApp onQRCodeReady returned an invalid URL");let i=xke(o.expireIn);t.qrCodeUrl=o.url,t.expiresAt=this.#t()+i*1e3,this.#B(t),t.expiryTimer=this.#r(()=>this.#C(t),i*1e3),t.expiryTimer?.unref?.(),this.#p(t,Ki.QR_READY)}#g(t,o){!this.#n(t)||!Kke.has(o?.status)||(o.status===Ki.SLOW_DOWN&&Number.isFinite(Number(o.interval))&&(t.pollIntervalSeconds=Number(o.interval)),this.#p(t,o.status))}async#I(t,o){if(!this.#n(t))return;let i=o?.client_id,e=o?.client_secret;if(typeof i!="string"||!i||typeof e!="string"||!e){this.#u(t,Ki.ERROR,{error:{code:"invalid_credentials",message:"Feishu registration returned invalid credentials."}});return}let a;try{a=Yke(o.user_info)}catch{this.#u(t,Ki.ERROR,{error:{code:"invalid_credentials",message:"Feishu registration returned invalid credentials."}});return}this.#B(t),t.qrCodeUrl=null,t.expiresAt=null,t.pollIntervalSeconds=null,this.#p(t,Ki.SAVING);try{await this.#A({client_id:i,client_secret:e,user_info:a})}catch{this.#n(t)&&this.#u(t,Ki.ERROR,{error:{code:"credentials_callback_failed",message:"Unable to store the Feishu credentials."}});return}this.#n(t)&&this.#u(t,Ki.SUCCEEDED)}#d(t,o){if(!this.#n(t))return;let i=H6(o);if(i==="expired_token"){this.#u(t,Ki.EXPIRED,{error:mP(o)});return}if(i==="abort"){this.#u(t,Ki.CANCELLED,{error:mP(o)});return}this.#u(t,Ki.ERROR,{error:mP(o)})}#h(){let t=this.#i;t&&t.expiresAt!==null&&this.#t()>=t.expiresAt&&this.#C(t)}#C(t){this.#n(t)&&(this.#u(t,Ki.EXPIRED,{error:{code:"expired_token",message:"The registration QR code expired."}}),t.controller.abort())}#u(t,o,i={}){this.#n(t)&&(this.#B(t),this.#a=this.#s(t,o,i),this.#i=null)}#B(t){t.expiryTimer!==null&&(this.#l(t.expiryTimer),t.expiryTimer=null)}#f(){let t=this.#i;t&&(this.#B(t),this.#i=null,t.controller.abort())}};var jke="card.action.trigger",Jke="im:message:readonly",qke="im:resource",Nu="callback_repair";function zke(n){return n==="lark"?"accounts.larksuite.com":"accounts.feishu.cn"}function Vke(n){return n==="lark"?"open.larksuite.com":"open.feishu.cn"}function SP(n,t,o="feishu",i="Feishu app update"){let e;try{e=new URL(n)}catch{throw new Error(`${i} returned an invalid verification URL`)}let a=o==="feishu"||o==="lark",A=e.searchParams.getAll("clientID"),r=e.searchParams.getAll("tp"),s=e.searchParams.getAll("addons"),g=String(t).includes("{{")||String(t).includes("}}")||[...e.searchParams.values()].some(c=>c.includes("{{")||c.includes("}}"));if(!a||e.protocol!=="https:"||e.hostname!==Vke(o)||e.port!==""||e.username!==""||e.password!==""||r.length!==1||r[0]!=="sdk"||A.length!==1||A[0]!==t||e.searchParams.has("createOnly")||s.length!==1||!s[0]?.trim()||g)throw new Error(`${i} returned an unsafe verification URL`);return e.toString()}function Wke(n,t,o="feishu"){return SP(n,t,o,"Feishu callback repair")}var yS=class{#e;#A;#t;constructor({registerApp:t,onCredentials:o,appId:i,domain:e="feishu"}={}){if(typeof t!="function")throw new TypeError("registerApp is required");if(typeof o!="function")throw new TypeError("onCredentials is required");if(typeof i!="string"||!i.trim())throw new TypeError("appId is required");if(e!=="feishu"&&e!=="lark")throw new TypeError("domain is invalid");this.#A=i.trim(),this.#t=e,this.#e=new Tg({registerApp:a=>t({...a,onQRCodeReady:A=>{Wke(A?.url,this.#A,this.#t),a.onQRCodeReady(A)}}),onCredentials:o})}start(){return this.#e.start({source:"deepseek-harness-card-action-repair",domain:zke(this.#t),appId:this.#A,addons:{preset:!1,scopes:{tenant:[Jke,qke,...ES]},callbacks:{items:[jke]}}})}status(){return this.#e.status()}cancel(){return this.#e.cancel()}};var Zke="im:message.group_msg",SS="group_message_permission";function Xke(n){return n==="lark"?"accounts.larksuite.com":"accounts.feishu.cn"}function $ke(n,t,o="feishu"){return SP(n,t,o,"Feishu group message permission update")}var mS=class{#e;#A;#t;constructor({registerApp:t,onCredentials:o,appId:i,domain:e="feishu"}={}){if(typeof t!="function")throw new TypeError("registerApp is required");if(typeof o!="function")throw new TypeError("onCredentials is required");if(typeof i!="string"||!i.trim())throw new TypeError("appId is required");if(e!=="feishu"&&e!=="lark")throw new TypeError("domain is invalid");this.#A=i.trim(),this.#t=e,this.#e=new Tg({registerApp:a=>t({...a,onQRCodeReady:A=>{$ke(A?.url,this.#A,this.#t),a.onQRCodeReady(A)}}),onCredentials:o})}start(){return this.#e.start({source:"deepseek-harness-group-message-permission",domain:Xke(this.#t),appId:this.#A,addons:{preset:!1,scopes:{tenant:[Zke]}}})}status(){return this.#e.status()}cancel(){return this.#e.cancel()}};var K6=Object.freeze(["im:message.p2p_msg:readonly","im:message.group_at_msg:readonly","im:message:readonly","im:message:send_as_bot","im:message.reactions:write_only","im:message:recall","im:resource","cardkit:card:write",...ES]);var wP=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]),wS=new Set([...wP,"saving"]),x6=new Set([Nu,SS]),Y6="*",eve=12e4,Ave=6e5;function q6(){return{ready:!1,feishuLongConnectionState:"idle",harnessReachable:!1}}function Ru(n){return n?n.status:q6()}function ku(n){return n.ready===!0&&n.feishuLongConnectionState==="connected"&&n.harnessReachable===!0}function z6(n){return n.length>12?`${n.slice(0,8)}\u2022\u2022\u2022\u2022${n.slice(-4)}`:"cli_\u2022\u2022\u2022\u2022"}function tve(n){return{name:n.botName,appIdMasked:z6(n.appId),activated:n.activated,domain:n.domain}}function rve({connected:n,error:t,connection:o}){return n?"connected":t||o.feishuLongConnectionState==="failed"?"error":"disconnected"}function ave(){return`bot_${J6().replaceAll("-","")}`}function ive(){return`reg_${J6().replaceAll("-","")}`}function j6(n){return`DSH_FEISHU_APP_SECRET_${n.slice(4).toUpperCase()}`}function DS(n){return JSON.stringify({id:n.id,appId:n.appId,secretRef:n.secretRef,ownerOpenIds:n.ownerOpenIds,domain:n.domain,botName:n.botName,botOpenId:n.botOpenId,activated:n.activated,groupResponseMode:Io(n.groupResponseMode),groupMessagePermissionGranted:n.groupMessagePermissionGranted===!0,deletionPending:n.deletionPending===!0,connectedAt:n.connectedAt??null,createdAt:n.createdAt??null})}function OS(n){return typeof n=="string"&&n.trim()?n.trim():null}var vu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n=new Map;#s=new Map;#p=new Map;#c=new Map;#g=new Map;#I=null;#d=Promise.resolve();#h=new Map;#C=1;#u;#B=!1;constructor({registerApp:t,verifyApp:o,credentials:i,configStore:e,createRuntime:a,deleteState:A=async()=>{},createBotId:r=ave,createRegistrationId:s=ive,callbackProbeTimeoutMs:g=eve}){if(typeof t!="function")throw new Error("registerApp is required");if(typeof o!="function")throw new Error("verifyApp is required");if(!i)throw new Error("credentials service is required");if(!e||typeof e.list!="function")throw new Error("multi-bot config store is required");if(typeof a!="function")throw new Error("createRuntime is required");if(typeof A!="function")throw new Error("deleteState must be a function");if(!Number.isFinite(g)||g<=0||g>Ave)throw new TypeError("callbackProbeTimeoutMs must be between 1 and 600000ms");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#u=g}async initialize(){if(this.#B)return this.status();let t=this.#r.list(),o=!1;return await Promise.allSettled(t.map(i=>this.#k(i.id,async()=>{let e=Ru(this.#n.get(i.id));if(ku(e)||e.feishuLongConnectionState==="connecting"||e.feishuLongConnectionState==="reconnecting")return;if(o=!0,i.deletionPending){this.#s.set(i.id,{code:"deletion_pending",message:"\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002"});return}let a;try{a=await this.#t.resolve(i.secretRef)}catch{this.#s.set(i.id,{code:"missing_credentials",message:"\u65E0\u6CD5\u8BFB\u53D6\u673A\u5668\u4EBA\u51ED\u636E\uFF0C\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u3002"});return}if(!a?.value){this.#s.set(i.id,{code:"missing_credentials",message:"\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u626B\u7801\u63A5\u5165\u3002"});return}try{await this.#E(i,a.value),this.#s.delete(i.id)}catch{this.#s.set(i.id,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u98DE\u4E66\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}}))),o&&this.#P(),this.status()}startRegistration(){this.#_();let t=this.#a();if(typeof t!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(t)||this.#p.has(t))throw new Error("Registration id generator returned an invalid or duplicate id");let o={id:t,manager:null,botId:null,createdNew:!1,cancelled:!1};return o.manager=new Tg({registerApp:this.#e,onCredentials:i=>this.#G(()=>this.#D(o,i))}),this.#p.set(t,o),this.#I=t,this.#F(),o.manager.start({source:"deepseek-harness",createOnly:!0,appPreset:{name:"{user} \u7684\u5317\u6C47\u661F\u6CB3 AI \u52A9\u624B",desc:"\u8FDE\u63A5\u98DE\u4E66\u4E0E DeepSeek Harness\uFF0C\u5728\u804A\u5929\u4E2D\u4F7F\u7528\u4F01\u4E1A AI \u52A9\u624B\u3002"},addons:{preset:!1,scopes:{tenant:[...K6]},events:{items:{tenant:["im.message.receive_v1"]}},callbacks:{items:["card.action.trigger"]}}}),this.#P(),this.registrationStatus(t)}startCallbackRepair(t,{actorOpenId:o,chatId:i}={}){this.#_();let e=this.#R(t);if(e.deletionPending)throw new Error("Cannot repair a Feishu bot pending deletion");let a=this.#c.get(t),A=a?this.#p.get(a):null;if(A&&wS.has(A.manager.status().state)){if(A.operation!==Nu)throw new Error("Another Feishu app update is already active for this bot");return this.registrationStatus(A.id)}this.#c.delete(t);let r=this.#a();if(typeof r!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(r)||this.#p.has(r))throw new Error("Registration id generator returned an invalid or duplicate id");let s={id:r,operation:Nu,manager:null,botId:t,createdNew:!1,cancelled:!1,remoteCommitted:!1,processing:null,publicError:null,stage:"authorizing",target:structuredClone(e),targetFingerprint:DS(e),initiator:{actorOpenId:OS(o),chatId:OS(i)}};return s.manager=new yS({registerApp:this.#e,appId:e.appId,domain:e.domain,onCredentials:g=>{s.remoteCommitted=!0;let I=this.#y(s,g).finally(()=>{s.processing===I&&(s.processing=null)});return s.processing=I,I}}),this.#p.set(r,s),this.#c.set(t,r),this.#I=r,this.#F(),s.manager.start(),this.#P(),this.registrationStatus(r)}startGroupMessagePermission(t){this.#_();let o=this.#R(t);if(o.deletionPending)throw new Error("Cannot update permissions for a Feishu bot pending deletion");let i=this.#c.get(t),e=i?this.#p.get(i):null;if(e&&wS.has(e.manager.status().state)){if(e.operation!==SS)throw new Error("Another Feishu app update is already active for this bot");return this.registrationStatus(e.id)}this.#c.delete(t);let a=this.#a();if(typeof a!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(a)||this.#p.has(a))throw new Error("Registration id generator returned an invalid or duplicate id");let A={id:a,operation:SS,manager:null,botId:t,createdNew:!1,cancelled:!1,remoteCommitted:!1,processing:null,publicError:null,stage:"authorizing",target:structuredClone(o),targetFingerprint:DS(o),initiator:{actorOpenId:null,chatId:null}};return A.manager=new mS({registerApp:this.#e,appId:o.appId,domain:o.domain,onCredentials:r=>{A.remoteCommitted=!0;let g=this.#S(A,r).finally(()=>{A.processing===g&&(A.processing=null)});return A.processing=g,g}}),this.#p.set(a,A),this.#c.set(t,a),this.#I=a,this.#F(),A.manager.start(),this.#P(),this.registrationStatus(a)}hasRegistration(t){return this.#p.has(t)}registrationStatus(t){let o=this.#p.get(t);return o?this.#f({registration:o,selectedBotId:o.botId}):null}async cancelRegistration(t=this.#I){let o=this.#p.get(t);if(!o)return this.status();let i=o.manager.status().state;return x6.has(o.operation)&&i==="saving"?this.registrationStatus(t):wS.has(i)?(o.cancelled=!0,o.manager.cancel(),await this.#G(async()=>{o.createdNew&&o.botId&&this.#g.get(o.botId)===o.id&&this.#r.getBot(o.botId)&&await this.#k(o.botId,()=>this.#O(o.botId))}),this.#P(),this.registrationStatus(t)??this.status()):this.registrationStatus(t)}status(t){return this.#f({registration:this.#p.get(this.#I)??null,selectedBotId:t})}async bindCredentials({appId:t,appSecret:o,domain:i="feishu"}={}){this.#_();let e=typeof t=="string"?t.trim():"",a=typeof o=="string"?o.trim():"",A=i==="lark"?"lark":"feishu";if(!e||!a)throw new TypeError("Feishu App ID and App Secret are required");return this.#G(async()=>{this.#_();let r=await this.#A({appId:e,appSecret:a,domain:A});this.#_();let s=this.#r.list().find(f=>f.appId===e),g=s?.id??this.#i();if(typeof g!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(g)||!s&&this.#r.getBot(g))throw new Error("Bot id generator returned an invalid or duplicate id");let c=s?.secretRef??j6(g),I=await this.#t.resolve(c).catch(()=>{}),d={...s,id:g,appId:e,secretRef:c,ownerOpenIds:s?.ownerOpenIds?.length?s.ownerOpenIds:[Y6],domain:A,botName:r.name,botOpenId:r.openId,activated:r.activated,deletionPending:!1,connectedAt:new Date().toISOString(),createdAt:s?.createdAt??new Date().toISOString()};await this.#t.set(c,a);let B;try{B=await this.#r.saveBot(d)}catch(f){throw await this.#w(c,I),f}return await this.#k(g,async()=>{try{await this.#E(B,a),this.#s.delete(g)}catch{this.#s.set(g,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u5DF2\u7ECF\u7ED1\u5B9A\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"})}}),this.#P(),this.status(g)})}async reconnectBot(t){return this.#_(),this.#k(t,async()=>{let o=this.#R(t);if(o.deletionPending)return this.#s.set(t,{code:"deletion_pending",message:"\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002"}),this.status(t);if(ku(Ru(this.#n.get(t))))return this.status(t);let i;try{i=await this.#t.resolve(o.secretRef)}catch{i=null}if(!i?.value)return this.#s.set(t,{code:"missing_credentials",message:"\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u626B\u7801\u63A5\u5165\u3002"}),this.#P(),this.status(t);try{await this.#E(o,i.value),this.#s.delete(t)}catch{this.#s.set(t,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u98DE\u4E66\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}return this.#P(),this.status(t)})}async sendConnectionTest(t){return this.#_(),this.#k(t,async()=>{let o=this.#R(t),i=this.#n.get(t);if(!ku(Ru(i))||typeof i.sendConnectionTest!="function"){let e=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw e.code="test-target-unavailable",e}return i.sendConnectionTest(Ra(`${o.botName}\uFF08${z6(o.appId)}\uFF09`,"\u98DE\u4E66\u673A\u5668\u4EBA"))})}async sendProactiveText(t,o,i,e={}){return this.#_(),this.#k(t,async()=>{this.#R(t);let a=this.#n.get(t);if(!ku(Ru(a))||typeof a.sendProactiveText!="function"){let A=new Error("\u98DE\u4E66\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5");throw A.code="bot-not-connected",A}return a.sendProactiveText(o,i,e)})}async disconnectBot(t){return this.#_(),this.#k(t,async()=>(this.#R(t),await this.#T(t),this.#s.delete(t),this.#P(),this.status(t)))}async updateGroupResponseMode(t,o){if(this.#_(),!nS(o))throw new TypeError("Invalid Feishu group response mode");return this.#G(()=>this.#k(t,async()=>{let i=this.#R(t);if(o==="all"&&i.groupMessagePermissionGranted!==!0){let a=new Error("Authorize im:message.group_msg before enabling all group messages");throw a.code="group_message_permission_required",a}let e=await this.#r.saveBot({...i,groupResponseMode:o});return this.#n.get(t)?.setGroupResponseMode?.(e.groupResponseMode),this.#P(),this.status(t)}))}async deleteBot(t){return this.#_(),this.#G(()=>this.#k(t,async()=>(this.#R(t),await this.#O(t),this.#P(),this.status())))}async reconnect(){let t=this.#r.list()[0];return t?this.reconnectBot(t.id):this.status()}async disconnect(){let t=this.#r.list()[0];return t?this.deleteBot(t.id):this.status()}async close(){if(this.#B)return;this.#B=!0;let t=[];for(let o of this.#p.values()){let i=o.manager.status().state;x6.has(o.operation)&&i==="saving"?(o.manager.cancel(),o.processing&&t.push(o.processing)):wS.has(i)&&(o.cancelled=!0,o.manager.cancel())}await this.#d,await Promise.allSettled([...this.#h.values()]),await Promise.allSettled([...this.#n.keys()].map(o=>this.#T(o))),await Promise.allSettled(t),await this.#d,await Promise.allSettled([...this.#h.values()]),await Promise.allSettled([...this.#n.keys()].map(o=>this.#T(o)))}#f({registration:t,selectedBotId:o}={}){let i=this.#r.list().map(I=>{let d=Ru(this.#n.get(I.id)),B=ku(d),f=this.#s.get(I.id)??null;return{botId:I.id,phase:rve({connected:B,error:f,connection:d}),connected:B,configured:!0,groupResponseMode:Io(I.groupResponseMode),groupMessagePermissionGranted:I.groupMessagePermissionGranted===!0,bot:tve(I),connection:d,lastMessageError:Xr(d.lastMessageError),error:f}}),e=t?this.#Q(t):{state:"idle",attempt:0,updatedAt:Date.now()},a=wP.has(e.state),A=e.state==="saving",r=!!t&&(a||A),s=i.find(I=>I.botId===o)??(r?null:i[0]??null),g=i.some(I=>I.connected),c=s?.phase??"unconfigured";return a?c="registering":A?c="connecting":e.state==="error"&&!s&&(c="error"),{schemaVersion:2,revision:this.#C,phase:c,connected:s?.connected??!1,configured:i.length>0,bot:s?.bot??null,connection:s?.connection??q6(),error:s?.error??e.error??null,registration:e,bots:i,totals:{configured:i.length,connected:i.filter(I=>I.connected).length},anyConnected:g}}#Q(t){let o=t.manager.status();return{...o,attempt:t.id,...t.botId?{botId:t.botId}:{},...t.operation?{operation:t.operation}:{},...t.stage?{stage:t.stage}:{},...o.state==="error"&&t.publicError?{error:{...t.publicError}}:{}}}async#S(t,o){let i=o.client_id,e=o.client_secret,a=OS(o.user_info?.open_id),A=o.user_info?.tenant_brand,r=t.target;if(t.cancelled)throw this.#m(t,"abort","Group message permission update was cancelled before local activation.");if(i!==r.appId)throw this.#m(t,"repair_app_mismatch","Feishu returned credentials for a different app.");if(!a)throw this.#m(t,"repair_owner_missing","Feishu returned no permission operator identity.");if(A!==void 0&&A!==r.domain)throw this.#m(t,"repair_domain_mismatch","Feishu returned credentials for a different account domain.");if(!r.ownerOpenIds.includes(Y6)&&!r.ownerOpenIds.includes(a))throw this.#m(t,"repair_owner_mismatch","The Feishu permission operator is not an owner of this configured bot.");t.stage="verifying_identity";let s;try{s=await this.#A({appId:i,appSecret:e,domain:r.domain})}catch(g){throw this.#m(t,"repair_credentials_invalid","Feishu could not verify the updated app credentials.",g)}if(r.botOpenId&&s?.openId!==r.botOpenId)throw this.#m(t,"repair_bot_mismatch","The updated Feishu app belongs to a different bot identity.");await this.#G(()=>this.#k(t.botId,async()=>{let g=this.#r.getBot(t.botId);if(!g||g.deletionPending||DS(g)!==t.targetFingerprint)throw this.#m(t,"repair_target_changed","The Feishu bot changed while its permission update was in progress.");let c;try{c=await this.#t.resolve(g.secretRef)}catch(d){throw this.#m(t,"credential_update_failed","Unable to read the current Feishu credential.",d)}if(c?.value!==e){t.stage="persisting_secret";try{await this.#t.set(g.secretRef,e)}catch(B){if((await this.#t.resolve(g.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_update_failed","Unable to store the updated Feishu credential.",B)}if((await this.#t.resolve(g.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_state_unknown","The updated Feishu credential could not be confirmed after writing.")}t.stage="enabling_all_messages";let I;try{I=await this.#r.saveBot({...g,groupMessagePermissionGranted:!0,groupResponseMode:"all"})}catch(d){throw this.#m(t,"group_message_permission_save_failed","The permission was accepted, but all-message mode could not be saved.",d)}t.stage="restarting";try{await this.#E(I,e)}catch(d){throw this.#s.set(t.botId,{code:"connection_failed",message:"\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u5F00\u901A\uFF0C\u4F46\u673A\u5668\u4EBA\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"}),this.#P(),this.#m(t,"group_message_permission_connection_failed","The permission was accepted, but the Feishu runtime could not restart.",d)}this.#s.delete(t.botId),t.stage="verified",t.publicError=null,this.#P()}))}async#y(t,o){let i=o.client_id,e=o.client_secret,a=OS(o.user_info?.open_id),A=o.user_info?.tenant_brand,r=t.target;if(t.cancelled)throw this.#m(t,"abort","Callback repair was cancelled before local activation.");if(i!==r.appId)throw this.#m(t,"repair_app_mismatch","Feishu returned credentials for a different app.");if(!a)throw this.#m(t,"repair_owner_missing","Feishu returned no repair operator identity.");if(A!==void 0&&A!==r.domain)throw this.#m(t,"repair_domain_mismatch","Feishu returned credentials for a different account domain.");t.stage="verifying_identity";let s;try{s=await this.#A({appId:i,appSecret:e,domain:r.domain})}catch(c){throw this.#m(t,"repair_credentials_invalid","Feishu could not verify the repaired app credentials.",c)}if(r.botOpenId&&s?.openId!==r.botOpenId)throw this.#m(t,"repair_bot_mismatch","The repaired Feishu app belongs to a different bot identity.");let g=await this.#G(()=>this.#k(t.botId,async()=>{let c=this.#r.getBot(t.botId);if(!c||c.deletionPending||DS(c)!==t.targetFingerprint)throw this.#m(t,"repair_target_changed","The Feishu bot changed while its callback repair was in progress.");let I;try{I=await this.#t.resolve(c.secretRef)}catch(f){throw this.#m(t,"credential_update_failed","Unable to read the current Feishu credential.",f)}if(I?.value!==e){t.stage="persisting_secret";try{await this.#t.set(c.secretRef,e)}catch(Q){if((await this.#t.resolve(c.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_update_failed","Unable to store the repaired Feishu credential.",Q)}if((await this.#t.resolve(c.secretRef).catch(()=>null))?.value!==e)throw this.#m(t,"credential_state_unknown","The repaired Feishu credential could not be confirmed after writing.")}let B;t.stage="restarting";try{await this.#E(c,e),B=this.#n.get(t.botId)}catch(f){throw this.#s.set(t.botId,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u56DE\u8C03\u4FEE\u590D\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"}),this.#P(),this.#m(t,"repair_connection_failed","The repaired Feishu runtime could not be started.",f)}if(!B)throw this.#m(t,"repair_connection_failed","The repaired Feishu runtime is unavailable.");return this.#s.delete(t.botId),this.#P(),B}));if(typeof g.beginCardActionProbe!="function")throw this.#m(t,"card_action_probe_unavailable","The Feishu runtime cannot verify card callbacks.");t.stage="awaiting_callback";try{if((await g.beginCardActionProbe({expectedOperatorOpenId:t.initiator.actorOpenId??a,timeoutMs:this.#u,...t.initiator.chatId?{chatId:t.initiator.chatId}:{}}))?.verified!==!0){let I=new Error("Feishu runtime returned no callback proof");throw I.code="card_action_probe_failed",I}}catch(c){let I=c?.code==="card_action_probe_timeout"?"card_action_probe_timeout":c?.code==="card_action_probe_unavailable"?"card_action_probe_unavailable":c?.code==="card_action_probe_send_failed"?"card_action_probe_send_failed":"card_action_probe_failed";throw this.#m(t,I,I==="card_action_probe_timeout"?"Timed out waiting for the Feishu callback verification button.":"The Feishu card callback probe failed.",c)}t.stage="verified",t.publicError=null,this.#P()}#m(t,o,i,e){t.publicError={code:o,message:i};let a=new Error(i,e?{cause:e}:void 0);return a.code=o,a}async#D(t,o){if(t.cancelled)throw new Error("Registration was cancelled");let i=o.client_id,e=o.client_secret,a=o.user_info?.open_id,A=o.user_info?.tenant_brand==="lark"?"lark":"feishu";if(!a)throw new Error("Feishu registration returned no owner open_id");let r=await this.#A({appId:i,appSecret:e,domain:A});if(t.cancelled)throw new Error("Registration was cancelled");let s=this.#r.list().find(Q=>Q.appId===i),g=s?.id??this.#i();if(typeof g!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(g)||!s&&this.#r.getBot(g))throw new Error("Bot id generator returned an invalid or duplicate id");let c=s?.secretRef??j6(g),I=this.#g.get(g),d=await this.#t.resolve(c).catch(()=>{});await this.#t.set(c,e);let B;try{B=await this.#r.saveBot({...s,id:g,appId:i,secretRef:c,ownerOpenIds:[...new Set([...s?.ownerOpenIds??[],a])],domain:A,botName:r.name,botOpenId:r.openId,activated:r.activated,deletionPending:!1,connectedAt:new Date().toISOString(),createdAt:s?.createdAt??new Date().toISOString()}),t.botId=g,t.createdNew=!s,this.#g.set(g,t.id)}catch(Q){try{await this.#w(c,d)}catch(y){throw new Error("Unable to restore the Feishu credential after a config failure.",{cause:y})}throw Q}if(t.cancelled)throw t.createdNew?await this.#k(g,()=>this.#O(g)):(await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g)),new Error("Registration was cancelled");let f=!1;try{if(await this.#k(g,()=>this.#E(B,e)),t.cancelled)throw t.createdNew?await this.#k(g,()=>this.#O(g)):(await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g),d?.value&&!s.deletionPending?await this.#k(g,()=>this.#E(s,d.value)):await this.#k(g,()=>this.#T(g))),f=!0,new Error("Registration was cancelled");this.#s.delete(g),this.#P()}catch(Q){if(t.cancelled)throw!f&&t.createdNew&&this.#r.getBot(g)?await this.#k(g,()=>this.#O(g)):!f&&s&&(await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g),!this.#B&&d?.value&&!s.deletionPending?await this.#k(g,()=>this.#E(s,d.value)):await this.#k(g,()=>this.#T(g))),this.#P(),Q;if(s&&d?.value)try{throw await this.#r.saveBot(s),await this.#w(c,d),I?this.#g.set(g,I):this.#g.delete(g),s.deletionPending?(await this.#k(g,()=>this.#T(g)),this.#s.set(g,{code:"deletion_pending",message:"\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002"})):(await this.#k(g,()=>this.#E(s,d.value)),this.#s.delete(g)),this.#P(),Q}catch(y){throw y===Q?Q:(this.#s.set(g,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u8FDE\u63A5\u66F4\u65B0\u5931\u8D25\uFF0C\u4E14\u539F\u8FDE\u63A5\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u91CD\u8BD5\u3002"}),this.#P(),new Error("Unable to restore the previous Feishu bot connection.",{cause:y}))}throw this.#s.set(g,{code:"connection_failed",message:"\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002"}),this.#P(),Q}}async#E(t,o){await this.#T(t.id);let i=await this.#l({botId:t.id,config:t,appSecret:o,repair:this.#N(t.id)});this.#n.set(t.id,i);try{await i.start()}catch(e){throw this.#n.get(t.id)===i&&this.#n.delete(t.id),await i.stop({preserveError:!0}).catch(()=>{}),e}}#N(t){let o=i=>{let e=this.#p.get(i);return e?.operation===Nu&&e.botId===t?e:null};return Object.freeze({start:({actorOpenId:i,chatId:e}={})=>this.startCallbackRepair(t,{actorOpenId:i,chatId:e}),status:({attemptId:i}={})=>o(i)?this.registrationStatus(i):null,cancel:async({attemptId:i}={})=>o(i)?this.cancelRegistration(i):this.status(t)})}async#T(t){let o=this.#n.get(t);this.#n.delete(t),o&&await o.stop()}async#O(t){let o=this.#r.getBot(t);if(o){o.deletionPending||(o=await this.#r.saveBot({...o,deletionPending:!0})),await this.#T(t);try{await this.#t.unset(o.secretRef)}catch(i){throw this.#s.set(t,{code:"credential_removal_failed",message:"\u65E0\u6CD5\u5220\u9664\u673A\u5668\u4EBA\u51ED\u636E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}),new Error("Unable to remove the Feishu credential.",{cause:i})}try{await this.#o({botId:t,config:o})}catch(i){throw this.#s.set(t,{code:"state_cleanup_failed",message:"\u65E0\u6CD5\u5220\u9664\u673A\u5668\u4EBA\u7684\u672C\u5730\u4F1A\u8BDD\u6570\u636E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}),new Error("Unable to remove the Feishu bot session state.",{cause:i})}await this.#r.removeBot(t),this.#s.delete(t),this.#g.delete(t)}}async#w(t,o){o?.value?await this.#t.set(t,o.value):await this.#t.unset(t)}#R(t){let o=this.#r.getBot(t);if(!o)throw new Error("Unknown Feishu bot");return o}#_(){if(this.#B)throw new Error("The Feishu controller is closed")}#G(t){let o=this.#d.then(t,t);return this.#d=o.then(()=>{},()=>{}),o}#k(t,o){let e=(this.#h.get(t)??Promise.resolve()).then(o,o),a=e.then(()=>{},()=>{});return this.#h.set(t,a),a.finally(()=>{this.#h.get(t)===a&&this.#h.delete(t)}),e}#F(){if(!(this.#p.size<=32))for(let[t,o]of this.#p){if(t===this.#I)continue;let i=o.manager.status().state;if(!wP.has(i)&&i!=="saving"&&this.#p.delete(t),this.#p.size<=32)break}}#P(){this.#C+=1}};var sve=["open.feishu.cn","open.larksuite.com"];function gve(n,t){if(t==="*")return!0;let o=t.startsWith(".")?t.slice(1):t;return o?n===o||n.endsWith(`.${o}`):!1}function cve(n){for(let t of["no_proxy","NO_PROXY"]){let o=n?.[t];if(typeof o!="string"||!o.trim())continue;let i=o.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);if(sve.some(e=>i.some(a=>gve(e,a))))return!0}return!1}function Ive(n){if(!cve(n))for(let t of["https_proxy","HTTPS_PROXY","http_proxy","HTTP_PROXY"]){let o=n?.[t];if(typeof o=="string"&&o.trim())return o.trim()}}function lve(n,t=o=>new V6.default(o)){let o=Ive(n);return o?t(o):void 0}function pve(n){let t=kc(n.dshHome??process.env.DSH_HOME??jd(ove(),".dsh")),o=kc(n.dataDir??jd(t,"integrations","dsh-feishu"));return{root:o,config:kc(n.configPath??jd(o,"config.json")),legacyState:kc(n.statePath??jd(o,"state.json")),bots:kc(n.botsDir??jd(o,"bots")),workspaces:kc(n.workspacesPath??jd(o,"workspaces.json"))}}async function DP(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-feishu requires ctx.credentials");let i=aa(n,t),e=o.lark??rP,a=o.Controller??vu,A=o.ConfigStore??fS,r=o.StateStore??iS,s=o.HarnessClient??uS,g=o.FeishuRuntime??CS,c=o.verifyFeishuApp??t6,I=fe=>c({...fe,httpInstance:e.defaultHttpInstance}),d=o.createConnectionSupervisor??aP,B=typeof n.logger=="function"?n.logger("dsh-feishu"):n.logger??console,f=()=>La(n),Q=pve(t),y=await new A(Q.config).load(),m=kc(t.workspace??process.cwd()),T=o.WorkspaceStore??ra,_=o.workspaces??await new T(Q.workspaces,{defaultWorkspace:m}).load(),R=typeof y.list=="function",K=()=>R?y.list():[],L=K();R&&await _.reconcile(L.map(fe=>fe.id)),await Promise.all(L.map(fe=>_.ensure(fe.id,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("feishu",fe)})));let F=typeof y.removeBot=="function"?Ha(y,{workspaces:_,method:"removeBot",botIdFromRemoved:fe=>fe.id,saveMethod:"saveBot",botIdFromSave:fe=>fe?.id}):y,q=new Map,V=fe=>!fe.id||!fe.secretRef||fe.secretRef===QS?Q.legacyState:kc(Q.bots,fe.id,"state.json"),x=async fe=>{let ke=fe.id??"__legacy__",Re=q.get(ke);return Re||(Re=await new r(V(fe)).load(),q.set(ke,Re)),Re},G=async fe=>{let ke=K().find(Re=>Re.id===fe);if(!ke)throw new Error("Unknown Feishu bot");return x(ke)},J=ja(n,o.commandExecutor),{controlExecutor:U,sessionMaintenanceExecutor:N,fileIngressExecutor:k}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),z=new s({...i,workspace:m,autostart:!1,dshBin:t.dshBin??"dsh",...J?{commandExecutor:J}:{},...U?{controlExecutor:U}:{},...N?{sessionMaintenanceExecutor:N}:{},...k?{fileIngressExecutor:k}:{}}),Ae=o.proxyEnv??process.env,ie=lve(Ae,o.createProxyAgent),we=new a({registerApp:fe=>e.registerApp(fe),verifyApp:I,credentials:n.credentials,configStore:F,createRuntime:async({botId:fe,config:ke,appSecret:Re,repair:We})=>{let ve=await x(ke),aA=fe??ke.id??ke.appId;await _.ensure(aA,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("feishu",ke)});let Be=Ka(z,{botId:aA,workspaces:_,state:ve,agentPresetCatalog:f});return new g({lark:e,botId:aA,repair:We,appId:ke.appId,appSecret:Re,domain:ke.domain,botOpenId:ke.botOpenId,groupResponseMode:ke.groupResponseMode,ownerOpenIds:ke.ownerOpenIds??[ke.ownerOpenId],harness:Be.harness,state:Be.state,contextEnhancement:{botId:aA,getSettings:()=>_.contextEnhancementFor(aA)},accessPolicy:qa(_,aA,{channel:"feishu",config:ke}),replyTimeoutMs:t.replyTimeoutMs??6e5,slashCommands:t.slashCommands!==!1,...ie?{wsAgent:ie}:{},logger:{error:(...Ie)=>B.error?.(`[${fe??ke.id}]`,...Ie),warn:(...Ie)=>B.warn?.(`[${fe??ke.id}]`,...Ie),info:(...Ie)=>B.info?.(`[${fe??ke.id}]`,...Ie),debug:(...Ie)=>B.debug?.(`[${fe??ke.id}]`,...Ie)}})},deleteState:async({botId:fe,config:ke})=>{q.delete(fe);try{await nve(V(ke))}catch(Re){if(Re?.code!=="ENOENT")throw Re}}}),se=xa(we,{workspaces:_,stateFor:G,agentPresetCatalog:f}),Te=d({controller:se,harness:z,logger:B,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:se,deliveryAdapter:Ya({channel:"feishu",workspaces:_,coreController:we,stateFor:G}),ready:Te.ready,async close(){await Te.close(),await se.close(),z.stopManagedProcess(),ie?.destroy?.()}}}import Nve from"qrcode";var qd=qe(RP(),1);var Mve=qe(RP(),1);var _ve=Object.freeze({$locale:"en",IM\u673A\u5668\u4EBA:"IM bots",IM\u673A\u5668\u4EBA\u8BBE\u7F6E:"IM bot settings",\u66F4\u591A\u673A\u5668\u4EBA\u8BBE\u7F6E:"More bot settings",\u673A\u5668\u4EBA\u8BBE\u7F6E:"Bot settings",\u673A\u5668\u4EBA\u8BBE\u7F6E\u9875\u7B7E:"Bot settings tabs",\u6295\u9012\u8BBE\u7F6E:"Delivery settings",\u8BBF\u95EE\u8BBE\u7F6E:"Access settings",\u67E5\u770B\u8BBF\u95EE\u6743\u9650\u8BF4\u660E:"View access permission details",\u5141\u8BB8\u6240\u6709\u7528\u6237:"Allow all users",\u4EC5\u767D\u540D\u5355\u7528\u6237:"Allowlisted users only",\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650:"Default command permission",\u547D\u4EE4\u6743\u9650:"Command permission",\u53EF\u4EE5\u6267\u884C\u547D\u4EE4:"Can run commands",\u4E0D\u53EF\u4EE5\u6267\u884C\u547D\u4EE4:"Cannot run commands",\u767D\u540D\u5355\u7528\u6237:"Allowlisted users",\u67E5\u770B\u767D\u540D\u5355\u8BF4\u660E:"View allowlist details",\u547D\u4EE4\u6743\u9650\u4F8B\u5916:"Command permission exceptions","\u5F53\u524D\u6CA1\u6709\u767D\u540D\u5355\u7528\u6237\uFF0C\u4FDD\u5B58\u540E\u666E\u901A\u7528\u6237\u5C06\u65E0\u6CD5\u4F7F\u7528\u673A\u5668\u4EBA\u3002":"There are currently no allowlisted users. After saving, regular users will not be able to use the bot.",\u65B0\u589E\u7528\u6237:"Add user",\u5C1A\u672A\u6DFB\u52A0\u7528\u6237:"No users added",\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u7FA4\u804A:"Group chat is not supported by this channel","\u539F\u6240\u6709\u8005\u6216\u626B\u7801\u63A5\u5165\u8005\u59CB\u7EC8\u53EF\u4EE5\u8BBF\u95EE\u5E76\u6267\u884C\u547D\u4EE4\uFF1B\u4EE5\u4E0B\u8BBE\u7F6E\u4EC5\u7EA6\u675F\u5176\u4ED6\u7528\u6237\u3002":"The original owner or QR-code operator can always access the bot and run commands; the settings below apply only to other users.","\u6B64\u533A\u57DF\u65E0\u9700\u914D\u7F6E\uFF0C\u4FDD\u5B58\u79C1\u804A\u8BBE\u7F6E\u65F6\u4F1A\u4FDD\u7559\u73B0\u6709\u7FA4\u804A\u7B56\u7565\u3002":"No setup is needed here. Saving direct-message settings keeps the existing group policy.","\u8BBF\u95EE\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\u3002":"Access settings saved.","\u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Access settings are currently unavailable.","\u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not save access settings. Try again later.","\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u5DF2\u4FDD\u5B58\u7684\u8BBF\u95EE\u7B56\u7565\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\u3002":"The service did not return the saved access policy. Refresh and try again.","\u8BBF\u95EE\u7B56\u7565\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868\u5237\u65B0\u540E\u91CD\u8BD5\u3002":"The access policy is not ready. Return to the bot list, refresh, and try again.","\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Access settings are not supported by this channel yet.","\u7528\u6237\u6807\u8BC6\u65E0\u6548\u3002":"The user ID is invalid.","\u7528\u6237\u6807\u8BC6\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u3002":"The user ID must be a string.","\u7528\u6237\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A\u3001\u5305\u542B\u63A7\u5236\u5B57\u7B26\u6216\u8D85\u8FC7 256 \u4E2A\u5B57\u7B26\u3002":"The user ID cannot be empty, contain control characters, or exceed 256 characters.","\u7528\u6237\u6761\u76EE\u5FC5\u987B\u5305\u542B\u7528\u6237\u6807\u8BC6\u548C\u547D\u4EE4\u6743\u9650\u3002":"Each user entry must include a user ID and command permission.","\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002":"Command permission must be a boolean.","\u8BBF\u95EE\u6A21\u5F0F\u53EA\u80FD\u662F open \u6216 allowlist\u3002":"Access mode must be open or allowlist.","\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002":"Open-mode settings must be complete.","\u5F00\u653E\u6A21\u5F0F\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002":"The open-mode default command permission must be a boolean.","\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002":"Open-mode command permission overrides must be an array.","\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002":"Open-mode command permission overrides cannot contain duplicate user IDs.","\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002":"Allowlist-mode settings must be complete.","\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002":"Allowlist-mode users must be an array.","\u767D\u540D\u5355\u6A21\u5F0F\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002":"Allowlist-mode users cannot contain duplicate user IDs.","\u8BBF\u95EE\u573A\u666F\u8BBE\u7F6E\u5FC5\u987B\u540C\u65F6\u5305\u542B\u6A21\u5F0F\u3001\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u548C\u767D\u540D\u5355\u6A21\u5F0F\u8BBE\u7F6E\u3002":"Each access context must include its mode, open-mode settings, and allowlist-mode settings.","\u8BF7\u540C\u65F6\u63D0\u4EA4\u5B8C\u6574\u7684\u79C1\u804A\u548C\u7FA4\u804A\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Submit complete direct-message and group access settings together.","\u586B\u5199\u5FAE\u4FE1\u7528\u6237 ID":"Enter a WeChat user ID","\u98DE\u4E66 Open ID":"Feishu Open ID","\u7FA4\u6210\u5458 Open ID":"Group member Open ID","\u9489\u9489\u7528\u6237 ID":"DingTalk user ID","\u586B\u5199 senderStaffId \u6216 senderId":"Enter senderStaffId or senderId","\u7FA4\u6210\u5458\u7528\u6237 ID":"Group member user ID","\u4F01\u4E1A\u5FAE\u4FE1\u7528\u6237 ID":"WeCom user ID","\u586B\u5199 userid":"Enter userid","\u586B\u5199 member_openid":"Enter member_openid","QQ User Open ID":"QQ User Open ID","\u7FA4\u6210\u5458 User ID":"Group member User ID","\u586B\u5199\u6570\u5B57 User ID":"Enter a numeric user ID","WhatsApp \u7535\u8BDD\u53F7\u7801\u6216 JID":"WhatsApp phone number or JID","\u7FA4\u6210\u5458\u7535\u8BDD\u53F7\u7801\u6216 JID":"Group member phone number or JID","8613800000000 \u6216\u5B8C\u6574 JID":"8613800000000 or a full JID","IM \u6E20\u9053":"IM channels","\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA":"Connecting DeepSeek Harness",\u5F53\u524D\u7248\u672C:"Current version","DSH-IM \u66F4\u65B0":"DSH-IM update",\u68C0\u67E5\u66F4\u65B0:"Check for updates",\u91CD\u65B0\u68C0\u67E5:"Check again",\u5237\u65B0\u72B6\u6001:"Refresh status",\u624B\u5DE5\u66F4\u65B0:"Manual update",\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4:"Manual update command",\u590D\u5236\u547D\u4EE4:"Copy command","\u590D\u5236\u4E2D\u2026":"Copying\u2026",\u5DF2\u590D\u5236:"Copied","\u547D\u4EE4\u5DF2\u590D\u5236\u3002":"Command copied.","\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u9009\u4E2D\u547D\u4EE4\u540E\u6309 Ctrl+C \u6216 \u2318C \u590D\u5236\u3002":"Copy failed. Select the command and press Ctrl+C or \u2318C to copy it.","\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u53EF\u4EE5\u4F7F\u7528\u547D\u4EE4\u66F4\u65B0\uFF1A":"If the automatic update fails, update with this command:","\u5C1A\u672A\u786E\u8BA4\u76EE\u6807\u7248\u672C\uFF0C\u6B64\u547D\u4EE4\u5B89\u88C5\u6267\u884C\u65F6 npm \u7684 latest \u7248\u672C\u3002":"No target version has been confirmed. This command installs the npm latest version available when you run it.","\u8BF7\u5728\u5F53\u524D Desktop \u7684\u5185\u7F6E\u7EC8\u7AEF\u6267\u884C\uFF0C\u5B8C\u6210\u540E\u624B\u52A8\u91CD\u542F\u3002":"Run this in the current Desktop\u2019s built-in terminal, then restart manually.","\u8BF7\u5728\u8FD0\u884C\u5F53\u524D Harness \u7684\u540C\u4E00\u73AF\u5883\u6267\u884C\uFF0C\u4FDD\u6301 DSH_HOME \u4E00\u81F4\uFF0C\u5B8C\u6210\u540E\u624B\u52A8\u91CD\u542F\u3002":"Run this in the same environment as the current Harness, with the same DSH_HOME, then restart manually.","\u8BF7\u7B49\u5F85\u5F53\u524D\u64CD\u4F5C\u7ED3\u675F\uFF0C\u786E\u8BA4\u6CA1\u6709\u5B89\u88C5\u8FDB\u7A0B\u8FD0\u884C\u540E\u518D\u6267\u884C\u547D\u4EE4\u3002":"Wait for the current operation to finish and confirm no installer is running before using this command.","\u6E90\u7801\u6216\u94FE\u63A5\u5B89\u88C5\u8BF7\u6309\u539F\u5B89\u88C5\u65B9\u5F0F\u66F4\u65B0\uFF0C\u4E0D\u63D0\u4F9B\u8986\u76D6\u6E90\u7801\u7684 npm \u547D\u4EE4\u3002":"Update source or linked installations using their original method. No npm command is provided to overwrite the source.","\u65E0\u6CD5\u5B89\u5168\u751F\u6210\u5F53\u524D profile \u7684\u547D\u4EE4\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u624B\u52A8\u786E\u8BA4 profile \u540E\u66F4\u65B0\u3002":"A safe command cannot be generated for this profile. Confirm the profile in your terminal before updating manually.",\u66F4\u65B0\u81F3:"Update to",\u5B89\u88C5\u66F4\u65B0:"Install update","\u6B63\u5728\u66F4\u65B0\u2026":"Updating\u2026",\u5F85\u624B\u52A8\u91CD\u542F:"Restart needed",\u8FD0\u884C\u7248\u672C:"Running version",\u5DF2\u5B89\u88C5\u7248\u672C:"Installed version","\u76EE\u6807 profile":"Target profile",\u76EE\u6807\u7248\u672C:"Target version",\u65E0\u6CD5\u786E\u8BA4:"Unknown",\u53D1\u73B0\u65B0\u7248\u672C:"Update available",\u5DF2\u662F\u6700\u65B0\u7248\u672C:"Up to date",\u5F53\u524D\u7248\u672C\u65E0\u9700\u66F4\u65B0:"No newer version available","\u5DF2\u83B7\u53D6 npm \u6700\u65B0\u7248\u672C":"Latest npm version retrieved","\u68C0\u67E5 npm \u6700\u65B0\u7248\u672C\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u5B89\u88C5\u3002":"Check the latest npm version. Nothing is installed automatically.","\u6B63\u5728\u4ECE npm \u68C0\u67E5\u6700\u65B0\u7248\u672C\u2026":"Checking npm for the latest version\u2026","\u6B63\u5728\u5B89\u88C5\uFF0C\u8BF7\u7A0D\u5019\u2026":"Installing, please wait\u2026","\u6B63\u5728\u6821\u9A8C\u5B89\u88C5\u7ED3\u679C\u2026":"Verifying the installation\u2026","\u5DF2\u5B89\u88C5\uFF0C\u5F85\u624B\u52A8\u91CD\u542F":"Installed \u2014 manual restart needed",\u66F4\u65B0\u5DF2\u751F\u6548:"Updated version is active",\u66F4\u65B0\u5931\u8D25:"Update failed",\u66F4\u65B0\u8BF7\u6C42\u5931\u8D25:"Update request failed","\u4EC5\u66F4\u65B0 DSH-IM\u3002\u5B89\u88C5\u5B8C\u6210\u540E\u9700\u624B\u52A8\u91CD\u542F\u540E\u53F0\uFF1B\u672C\u529F\u80FD\u4E0D\u4F1A\u81EA\u52A8\u91CD\u542F\u6216\u4E3B\u52A8\u5237\u65B0\u9875\u9762\u3002":"Only DSH-IM will be updated. Restart the backend manually after installation. This feature does not automatically restart it or initiate a page refresh.","\u5F53\u524D\u662F\u6E90\u7801\u6216\u94FE\u63A5\u5B89\u88C5\uFF0C\u53EA\u80FD\u68C0\u67E5\u7248\u672C\uFF1B\u8BF7\u624B\u52A8\u66F4\u65B0\u6E90\u7801\uFF0C\u6216\u8FC1\u79FB\u5230 npm \u5B89\u88C5\u3002":"This is a source or linked installation. You can check versions, but must update the source manually or migrate to an npm installation.","\u65E0\u6CD5\u786E\u8BA4\u5F53\u524D profile\uFF0C\u8BF7\u5728\u5BF9\u5E94\u7684 Harness \u73AF\u5883\u4E2D\u624B\u52A8\u66F4\u65B0\u3002":"The current profile could not be identified. Update manually in the corresponding Harness environment.","\u5F53\u524D\u8FD0\u884C\u73AF\u5883\u4E0D\u652F\u6301\u6309\u94AE\u5B89\u88C5\uFF0C\u8BF7\u624B\u52A8\u66F4\u65B0\u63D2\u4EF6\u3002":"This runtime cannot install through this button. Update the plugin manually.","\u5F53\u524D npm \u6E90\u914D\u7F6E\u4E0E\u5B98\u65B9\u6E90\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u5148\u68C0\u67E5 registry \u914D\u7F6E\u3002":"The npm registry configuration differs from the official registry. Check your registry settings first.","\u5F53\u524D Host \u7684 Node.js \u7248\u672C\u4E0D\u6EE1\u8DB3\u65B0\u7248\u8981\u6C42\uFF0C\u8BF7\u5148\u66F4\u65B0\u8FD0\u884C\u73AF\u5883\u3002":"The Host Node.js version does not meet the new version\u2019s requirements. Update the runtime first.","\u65B0\u7248\u672C\u5DF2\u5B89\u88C5\uFF0C\u8BF7\u5728\u65B9\u4FBF\u65F6\u624B\u52A8\u91CD\u542F\u5F53\u524D Harness \u6216 Desktop\u3002":"The new version is installed. Manually restart this Harness or Desktop when convenient.","\u4E0A\u6B21\u5B89\u88C5\u7ED3\u679C\u65E0\u6CD5\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u6B64 profile \u7684\u63D2\u4EF6\u5B89\u88C5\u72B6\u6001\u3002":"The previous installation result is uncertain. Check this profile\u2019s plugin installation first.","\u65E0\u6CD5\u8BBF\u95EE npm \u6216\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u68C0\u67E5\u3002":"npm is unreachable or the request timed out. Check again later.","npm \u8FD4\u56DE\u7684\u7248\u672C\u4FE1\u606F\u65E0\u6548\uFF0C\u6682\u65F6\u65E0\u6CD5\u66F4\u65B0\u3002":"npm returned invalid release information. Updating is unavailable.","\u7248\u672C\u786E\u8BA4\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u540E\u518D\u5B89\u88C5\u3002":"The version confirmation expired. Check again before installing.","\u63D2\u4EF6\u5B89\u88C5\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u3002":"The plugin installation changed. Check again.","\u6B64 profile \u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u67E5\u770B\u72B6\u6001\u3002":"This profile is already updating. Check its status shortly.","\u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u5B89\u88C5\u72B6\u6001\u540E\u91CD\u8BD5\u3002":"Installation failed. Check the current installation before retrying.","\u5B89\u88C5\u7ED3\u679C\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u68C0\u67E5\u63D2\u4EF6\u7248\u672C\u3002":"Installation verification failed. Check the plugin version manually.","\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u66F4\u65B0\u72B6\u6001\uFF0C\u8BF7\u5148\u68C0\u67E5\u5F53\u524D\u5B89\u88C5\u7ED3\u679C\u3002":"Update state could not be saved safely. Check the current installation result before retrying.","\u4E0A\u6B21\u66F4\u65B0\u5DF2\u4E2D\u65AD\uFF0C\u8BF7\u68C0\u67E5\u5B89\u88C5\u72B6\u6001\u540E\u91CD\u8BD5\u3002":"The previous update was interrupted. Check the installation before retrying.","\u66F4\u65B0\u670D\u52A1\u5DF2\u5173\u95ED\uFF0C\u8BF7\u624B\u52A8\u91CD\u65B0\u6253\u5F00\u8BBE\u7F6E\u9875\u3002":"The update service has closed. Reopen settings manually.","\u66F4\u65B0\u8BF7\u6C42\u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u7248\u672C\u3002":"The update request is invalid. Check the version again.","\u5F53\u524D\u63D2\u4EF6\u5B89\u88C5\u4E0D\u5B8C\u6574\u6216\u4E0E profile \u4E0D\u7B26\uFF0C\u8BF7\u624B\u52A8\u68C0\u67E5\u5B89\u88C5\u914D\u7F6E\u3002":"The plugin installation is incomplete or does not match this profile. Check the installation configuration manually.","\u65E0\u6CD5\u786E\u8BA4\u5F53\u524D npm \u6E90\u914D\u7F6E\uFF0C\u6682\u65F6\u4E0D\u80FD\u5B89\u88C5\u66F4\u65B0\u3002":"The npm registry configuration could not be verified. Installation is unavailable.","\u5B89\u88C5\u8D85\u65F6\uFF0C\u8BF7\u5148\u786E\u8BA4\u5F53\u524D\u5B89\u88C5\u72B6\u6001\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91CD\u8BD5\u3002":"Installation timed out. Check the current installation before retrying.","\u66F4\u65B0\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"The update request failed. Try again.","\u66F4\u65B0\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002":"The update service returned an unrecognized response.","\u5F53\u524D Host \u4E0D\u652F\u6301\u66F4\u65B0\u63A5\u53E3\uFF0C\u8BF7\u5148\u624B\u52A8\u66F4\u65B0\u63D2\u4EF6\u5E76\u91CD\u542F\u3002":"This Host does not support the update API. Update the plugin manually and restart first.","\u5173\u95ED\u7A97\u53E3\u4E0D\u4F1A\u53D6\u6D88\u5B89\u88C5\u3002\u8BF7\u52FF\u540C\u65F6\u5728\u5176\u4ED6\u7A97\u53E3\u7BA1\u7406\u6B64 profile \u7684\u63D2\u4EF6\u3002":"Closing this window does not cancel installation. Do not manage this profile\u2019s plugins in another window at the same time.","\u9875\u9762\u7248\u672C\u4E0E\u8FD0\u884C\u7248\u672C\u4E0D\u540C\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u9875\u9762\uFF1B\u82E5\u4ECD\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u624B\u52A8\u91CD\u542F Harness \u6216 Desktop\u3002":"The page and running versions differ. Refresh the page manually; if they still differ, manually restart Harness or Desktop.","\u8BF7\u5728\u673A\u5668\u4EBA\u7A7A\u95F2\u65F6\u5B89\u88C5\uFF1B\u5B89\u88C5\u4F1A\u4FEE\u6539\u5F53\u524D profile \u7684\u4F9D\u8D56\uFF0C\u5B8C\u6210\u540E\u9700\u624B\u52A8\u91CD\u542F\u3002":"Install while bots are idle. This changes the current profile\u2019s dependencies and requires a manual restart afterward.","AI Office":"AI Office","\uFF08\u5B9E\u9A8C\u529F\u80FD\uFF09":"(Experimental)","AI Office \u8BBE\u7F6E":"AI Office settings","AI Office \u8BBE\u7F6E\u9875\u7F3A\u5C11 RPC \u8FDE\u63A5":"AI Office settings are missing an RPC connection","\u6B63\u5728\u8BFB\u53D6 AI Office Connector\u2026":"Loading AI Office Connector\u2026","\u672C\u673A\u4E3B\u52A8\u8FDE\u63A5\u516C\u7F51 Office\uFF1BHarness \u4E0D\u5F00\u653E\u7AEF\u53E3\u3002\u534F\u8BAE Hook \u56FA\u5B9A\u4E3A ":"This machine connects outward to the public Office; Harness exposes no port. Protocol hooks: ",\u5C1A\u672A\u914D\u7F6E:"Not configured","\u5DF2\u8FDE\u63A5 Office":"Connected to Office",\u5DF2\u914D\u7F6E:"Configured",\u7B49\u5F85\u91CD\u8FDE:"Waiting to reconnect",\u51ED\u636E\u7F3A\u5931:"Credential missing",\u6700\u8FD1\u5FC3\u8DF3:"Last heartbeat",\u6700\u8FD1\u4E8B\u4EF6:"Last event",\u91CD\u8FDE\u6B21\u6570:"Reconnects","\u8FD0\u884C Job":"Running Jobs","\u5B8C\u6210 Job":"Completed Jobs",\u5C1A\u65E0:"None yet",\u8BBE\u5907\u8FDE\u63A5:"Device connection","Token \u53EA\u5199\u5165\u672C\u673A\u51ED\u636E\u5B58\u50A8":"Token is written only to the local credential store","\u7C98\u8D34 Office \u4E00\u6B21\u6027\u51ED\u636E":"Paste the one-time Office credential","\u5DF2\u5B89\u5168\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"Stored securely; leave blank to keep it",\u6700\u5927\u5E76\u53D1:"Max concurrency","Heartbeat \u79D2\u6570":"Heartbeat seconds","Workspace \u6620\u5C04":"Workspace mappings","\u6BCF\u884C alias=/\u672C\u673A/\u7EDD\u5BF9\u8DEF\u5F84\uFF1BOffice \u53EA\u80FD\u770B\u5230 alias\u3002":"One alias=/local/absolute/path per line; Office sees only aliases.","Instruction Preset \u6620\u5C04":"Instruction preset mappings","\u6BCF\u884C alias=\u6307\u4EE4\uFF1B\u65B0\u589E preset \u4E0D\u9700\u8981\u6539 Office \u4EE3\u7801\u3002":"One alias=instruction per line; new presets require no Office code change.",\u4FDD\u5B58\u5E76\u8FDE\u63A5:"Save and connect",\u6D4B\u8BD5\u8FDE\u63A5:"Test connection","\u6D4B\u8BD5\u4E2D\u2026":"Testing\u2026",\u91CD\u65B0\u8FDE\u63A5:"Reconnect",\u79FB\u9664\u8FDE\u63A5:"Remove connection","\u8FDE\u63A5\u6D4B\u8BD5\u901A\u8FC7\u3002":"Connection test passed.","\u914D\u7F6E\u5DF2\u4FDD\u5B58\u3002":"Configuration saved.","\u534F\u8BAE Hook \u9884\u89C8":"Protocol hook preview","\u7531 Base URL \u81EA\u52A8\u6D3E\u751F\uFF0C\u4E0D\u5355\u72EC\u586B\u5199":"Derived from Base URL; no separate input","Base URL \u65E0\u6548":"Invalid Base URL","Office Hook \u5C1A\u672A\u90E8\u7F72\u65F6\uFF0C\u914D\u7F6E\u4F1A\u5B89\u5168\u4FDD\u5B58\u5E76\u81EA\u52A8\u91CD\u8BD5\uFF1B\u51FA\u73B0 HTTP 404 \u4EE3\u8868\u534F\u8BAE\u7AEF\u70B9\u5F85\u4E0A\u7EBF\uFF0C\u4E0D\u4EE3\u8868 Harness \u6545\u969C\u3002":"Configuration is saved and retried while Office hooks are unavailable; HTTP 404 means the protocol endpoint is pending, not a Harness failure.","Workspace \u6620\u5C04\u6BCF\u884C\u5FC5\u987B\u4F7F\u7528 alias=value":"Each workspace mapping must use alias=value","Instruction Preset \u6620\u5C04\u6BCF\u884C\u5FC5\u987B\u4F7F\u7528 alias=value":"Each instruction preset mapping must use alias=value","action-items=\u8F6C\u6362\u4E3A\u8D1F\u8D23\u4EBA\u3001\u622A\u6B62\u548C\u9A8C\u6536\u660E\u786E\u7684\u5DE5\u5355":"action-items=Turn this into accountable tasks with deadlines and acceptance criteria","AI Office \u62D2\u7EDD\u4E86 Device Token\u3002":"AI Office rejected the Device Token.","AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002":"AI Office Connector hooks are not available yet.","AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002":"The AI Office Connector protocol is incompatible.","\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002":"AI Office cannot currently be reached from this machine.","AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002":"The AI Office connection was interrupted.","\u5E2E\u52A9\u4E0E\u53CD\u9988 \xB7 \u524D\u5F80 GitHub":"Help & feedback \xB7 Open GitHub","\u8BF7\u6539\u7528 localhost \u91CD\u65B0\u6253\u5F00":"Reopen with localhost","\u9875\u9762\u4F1A\u5728\u5F53\u524D\u7AEF\u53E3\u91CD\u65B0\u6253\u5F00\uFF0C\u673A\u5668\u4EBA\u914D\u7F6E\u4E0D\u4F1A\u6539\u53D8\u3002":"The page will reopen on the current port. Your bot configuration will not change.","\u4F7F\u7528 localhost \u91CD\u65B0\u6253\u5F00":"Reopen with localhost","\u5F53\u524D\u5730\u5740\u4E0E\u6D4F\u89C8\u5668\u7684\u672C\u673A\u8BF7\u6C42\u6821\u9A8C\u4E0D\u517C\u5BB9\u3002\u8BF7\u4F7F\u7528\u4E0A\u65B9\u6309\u94AE\u6539\u7528 localhost \u91CD\u65B0\u6253\u5F00\u3002":"This address is incompatible with the browser\u2019s local-request checks. Use the button above to reopen with localhost.",\u5FAE\u4FE1:"WeChat",\u98DE\u4E66:"Feishu",\u9489\u9489:"DingTalk",\u4F01\u4E1A\u5FAE\u4FE1:"WeCom",\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeChat bot",\u98DE\u4E66\u673A\u5668\u4EBA:"Feishu bot",\u9489\u9489\u673A\u5668\u4EBA:"DingTalk bot",\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeCom bot",QQ\u673A\u5668\u4EBA:"QQ bot",WhatsApp\u673A\u5668\u4EBA:"WhatsApp bot",WhatsApp\u8D26\u53F7:"WhatsApp account",\u5FAE\u4FE1\u8BBE\u7F6E:"WeChat settings",\u98DE\u4E66\u673A\u5668\u4EBA\u8BBE\u7F6E:"Feishu bot settings",\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F:"Group response mode","\u4EC5\u5728 @\u673A\u5668\u4EBA\u65F6\u54CD\u5E94\uFF08\u63A8\u8350\uFF09":"Only respond when @mentioned (recommended)",\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F:"Respond to all group messages","\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\uFF08\u9700\u98DE\u4E66\u654F\u611F\u6743\u9650\uFF09":"Respond to all group messages (requires a sensitive Feishu scope)",\u91CD\u65B0\u6388\u6743:"Reauthorize",\u53BB\u6388\u6743:"Authorize",\u91CD\u65B0\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650:"Reauthorize group-message permission",\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650:"Authorize group-message permission","\u6B63\u5728\u51C6\u5907\u6388\u6743\u2026":"Preparing authorization\u2026","\u6B63\u5728\u51C6\u5907\u2026":"Preparing\u2026","\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u5F00\u901A\uFF0C\u518D\u6B21\u5207\u6362\u65E0\u9700\u6388\u6743\u3002":"Direct messages always work; group chats require an explicit @mention of this bot. The group-message permission is already granted, so switching again needs no authorization.","\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u9009\u62E9\u5168\u90E8\u6D88\u606F\u540E\u4F1A\u6253\u5F00\u98DE\u4E66\u5B98\u65B9\u6388\u6743\u6D41\u7A0B\u3002":"Direct messages always work; group chats require an explicit @mention of this bot. Selecting all messages opens the official Feishu authorization flow.","\u5DF2\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF08im:message.group_msg\uFF09\uFF1B\u673A\u5668\u4EBA\u4F1A\u5904\u7406\u7FA4\u804A\u4E2D\u7684\u6240\u6709\u53EF\u89C1\u6D88\u606F\u3002":"The \u201CRead all messages in associated group chat\u201D scope (im:message.group_msg) is granted; the bot processes every visible group message.","\u5C1A\u672A\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF0C\u8BF7\u5B8C\u6210\u98DE\u4E66\u6388\u6743\u3002":"The \u201CRead all messages in associated group chat\u201D scope has not been confirmed. Complete Feishu authorization.","\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002":"Direct messages always work; group chats require an explicit @mention of this bot.","\u9700\u5728\u98DE\u4E66\u4E3A\u8BE5\u673A\u5668\u4EBA\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF08im:message.group_msg\uFF09\uFF1B\u5F00\u901A\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u5904\u7406\u7FA4\u804A\u4E2D\u7684\u6240\u6709\u53EF\u89C1\u6D88\u606F\u3002":"Grant this bot the \u201CRead all messages in associated group chat\u201D Feishu scope (im:message.group_msg); once granted, it will process every visible group message.","\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not update the group response mode. Try again.","\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not authorize group-message permission. Try again.",\u9489\u9489\u8BBE\u7F6E:"DingTalk settings",\u4F01\u4E1A\u5FAE\u4FE1\u8BBE\u7F6E:"WeCom settings",\u626B\u7801\u63A5\u5165\u673A\u5668\u4EBA:"Scan QR code",\u6B63\u5728\u63A5\u5165:"Connecting",\u624B\u52A8\u63A5\u5165:"Manual setup",\u6536\u8D77\u51ED\u636E:"Hide credentials",\u6536\u8D77\u63A5\u5165:"Hide setup",\u63A5\u5165\u673A\u5668\u4EBA:"Connect bot",\u5F00\u59CB\u63A5\u5165:"Start setup",\u5728\u7EBF:"online",\u8FD0\u884C\u6B63\u5E38:"Connected",\u6B63\u5728\u8FDE\u63A5:"Connecting","\u6B63\u5728\u8FDE\u63A5\u2026":"Connecting\u2026",\u8FDE\u63A5\u672A\u5C31\u7EEA:"Not connected",\u8FDE\u63A5\u4E2D:"Connecting",\u8FDE\u63A5\u4E2D\u65AD:"Disconnected",\u9700\u8981\u5904\u7406:"Needs attention",\u72B6\u6001\u672A\u77E5:"Unknown status",\u79BB\u7EBF:"Offline",\u5DF2\u65AD\u5F00:"Disconnected",\u6D88\u606F\u901A\u9053:"Message channel",\u67E5\u770B\u6D88\u606F\u901A\u9053\u8BF4\u660E:"View message channel details",\u6700\u8FD1\u68C0\u67E5:"Last checked",\u6700\u8FD1\u4E00\u6761\u6D88\u606F\u5904\u7406\u5931\u8D25:"Latest message failed",\u9519\u8BEF\u7801:"Code",\u53C2\u8003\u53F7:"Reference",\u5F53\u524D\u5DE5\u4F5C\u533A:"Current workspace",\u9009\u62E9\u76EE\u5F55:"Choose folder",\u9009\u62E9\u673A\u5668\u4EBA\u5DE5\u4F5C\u533A\u76EE\u5F55:"Select bot workspace folder",\u5F53\u524D\u76EE\u5F55:"Current folder",\u4E3B\u76EE\u5F55:"Home",\u76F4\u63A5\u8F93\u5165\u8DEF\u5F84:"Enter a path directly","\u652F\u6301 Windows \u76D8\u7B26\u3001UNC \u4E0E POSIX \u7EDD\u5BF9\u8DEF\u5F84\u3002":"Supports Windows drives, UNC paths, and POSIX absolute paths.","\u8F93\u5165 Host \u4E0A\u7684\u5B8C\u6574\u7EDD\u5BF9\u8DEF\u5F84":"Enter a full absolute path on the Host",\u524D\u5F80:"Go","\u8BFB\u53D6\u4E2D\u2026":"Loading\u2026","\u6B63\u5728\u51C6\u5907\u76EE\u5F55\u9009\u62E9\u5668\u2026":"Preparing folder picker\u2026","\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026":"Loading folders\u2026","\u8FD9\u4E2A\u76EE\u5F55\u4E2D\u6CA1\u6709\u5B50\u6587\u4EF6\u5939\u3002":"This folder has no subfolders.","\u6B64\u76EE\u5F55\u7684\u5B50\u6587\u4EF6\u5939\u8FC7\u591A\uFF0C\u4EC5\u663E\u793A\u524D\u4E00\u90E8\u5206\u3002":"This folder has too many subfolders; only the first group is shown.","\u65E0\u6CD5\u8BFB\u53D6\u76EE\u5F55\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not load the folder. Try again.",\u91CD\u8BD5:"Retry",\u663E\u793A\u9690\u85CF\u6587\u4EF6\u5939:"Show hidden folders","\u5207\u6362\u540E\u4F1A\u6E05\u9664\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u65E7\u4F1A\u8BDD\u6620\u5C04\u3002":"Switching clears this bot\u2019s previous session mappings.","\u5207\u6362\u4E2D\u2026":"Switching\u2026",\u9009\u62E9\u6B64\u76EE\u5F55:"Select this folder",\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84:"Absolute workspace path","/\u7EDD\u5BF9\u8DEF\u5F84/\u5230/\u5DE5\u4F5C\u533A":"/absolute/path/to/workspace",\u4FEE\u6539:"Change",\u4FDD\u5B58:"Save",\u4E0A\u4E0B\u6587\u589E\u5F3A:"Context enhancement",\u672A\u5F00\u542F:"Not enabled",\u4EC5\u7FA4\u804A:"Groups only",\u4EC5\u79C1\u804A:"Direct only",\u7FA4\u804A\u548C\u79C1\u804A:"Groups and direct",\u5173\u95ED\u5F39\u7A97:"Close dialog",\u67E5\u770B\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BF4\u660E:"View context enhancement details",\u4E0A\u4E0B\u6587\u589E\u5F3A\u8303\u56F4:"Context enhancement scope",\u542F\u7528\u8303\u56F4:"Enable in",\u542F\u7528:"Enabled","\uFF08\u5F53\u524D\u6E20\u9053\u4E0D\u652F\u6301\u7FA4\u804A\uFF09":"(This channel does not support group chats)",\u6765\u6E90\u5B57\u6BB5:"Source fields",\u67E5\u770B\u6765\u6E90\u5B57\u6BB5\u8BF4\u660E:"View source field details",\u67E5\u770B\u7FA4\u804A\u6765\u6E90\u5B57\u6BB5\u8BF4\u660E:"View group source field details",\u67E5\u770B\u79C1\u804A\u6765\u6E90\u5B57\u6BB5\u8BF4\u660E:"View direct source field details",\u6E20\u9053:"Channel",\u4F1A\u8BDD\u7C7B\u578B:"Conversation type",\u53D1\u9001\u8005\u6807\u8BC6:"Sender ID",\u53D1\u9001\u8005\u6635\u79F0:"Sender name",\u67E5\u770B\u53D1\u9001\u8005\u6635\u79F0\u5B57\u6BB5\u8BF4\u660E:"View sender name field details",\u67E5\u770B\u7FA4\u804A\u53D1\u9001\u8005\u6635\u79F0\u5B57\u6BB5\u8BF4\u660E:"View group sender name field details",\u67E5\u770B\u79C1\u804A\u53D1\u9001\u8005\u6635\u79F0\u5B57\u6BB5\u8BF4\u660E:"View direct sender name field details","\u8BE5\u5B57\u6BB5\u4E0D\u662F\u6BCF\u4E2A\u6E20\u9053\u90FD\u80FD\u63D0\u4F9B\u3002\u5F53\u524D\u6D88\u606F\u6CA1\u6709\u53D1\u9001\u8005\u6635\u79F0\u65F6\uFF0C\u5373\u4F7F\u5DF2\u9009\u62E9\u8BE5\u5B57\u6BB5\uFF0C \u4E2D\u4E5F\u4F1A\u7701\u7565 senderName\u3002":"This field is not available on every channel. If the current message has no sender name, omits senderName even when the field is selected.",\u673A\u5668\u4EBA\u6807\u8BC6:"Bot ID",\u589E\u5F3A\u63D0\u793A\u8BCD:"Guidance",\u67E5\u770B\u589E\u5F3A\u63D0\u793A\u8BCD\u4F7F\u7528\u8BF4\u660E:"View guidance instructions",\u67E5\u770B\u7FA4\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\u4F7F\u7528\u8BF4\u660E:"View group guidance instructions",\u67E5\u770B\u79C1\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\u4F7F\u7528\u8BF4\u660E:"View direct guidance instructions",\u4F7F\u7528\u8BF4\u660E:"How to use","\u7528\u4E8E\u544A\u8BC9\u6A21\u578B\u5982\u4F55\u4F7F\u7528 \u4E2D\u5DF2\u9009\u62E9\u7684\u6765\u6E90\u5B57\u6BB5\u3002\u53EA\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002":"Tell the model how to use the selected fields in . Enter only the body; the plugin adds paired tags.",\u751F\u6548\u89C4\u5219:"Behavior",\u9690\u79C1\u63D0\u793A:"Privacy",\u4F7F\u7528\u793A\u4F8B:"Example","\u4EC5\u4F9D\u636E\u5F53\u524D\u6D88\u606F\u7684 \u4E2D\u5B9E\u9645\u63D0\u4F9B\u7684\u5B57\u6BB5\u7406\u89E3\u6765\u6E90\uFF1B\u6CA1\u6709\u63D0\u4F9B\u7684\u5B57\u6BB5\u4E0D\u8981\u731C\u6D4B\u6216\u8865\u5168\u3002\nconversationType\u662F\u7FA4\u804A\u65F6\u56DE\u590D\u4E25\u8083\u4E00\u70B9\uFF0CconversationType\u662F\u79C1\u804A\u65F6\u56DE\u590D\u4E00\u5B9A\u8981\u5E7D\u9ED8\u641E\u7B11\uFF0C\u50CF\u5468\u661F\u9A70\u7684\u7535\u5F71\u4E00\u6837\u641E\u7B11":`Understand the source only from fields actually present in for the current message; do not guess or fill in missing fields. When conversationType is group, reply more seriously. When conversationType is direct, make the reply humorous and funny.`,"\u4EC5\u4F9D\u636E\u5F53\u524D\u6D88\u606F\u7684 \u4E2D\u5B9E\u9645\u63D0\u4F9B\u7684\u5B57\u6BB5\u7406\u89E3\u6765\u6E90\uFF1B\u6CA1\u6709\u63D0\u4F9B\u7684\u5B57\u6BB5\u4E0D\u8981\u731C\u6D4B\u6216\u8865\u5168\u3002\n\u5F53\u524D\u6D88\u606F\u6765\u81EA\u7FA4\u804A\uFF0C\u8BF7\u4F7F\u7528\u4E25\u8083\u3001\u514B\u5236\u3001\u7B80\u6D01\u7684\u8868\u8FBE\u65B9\u5F0F\u3002":`Understand the source only from fields actually present in for the current message; do not guess or fill in missing fields. This message is from a group chat. Use a serious, restrained, and concise style.`,"\u4EC5\u4F9D\u636E\u5F53\u524D\u6D88\u606F\u7684 \u4E2D\u5B9E\u9645\u63D0\u4F9B\u7684\u5B57\u6BB5\u7406\u89E3\u6765\u6E90\uFF1B\u6CA1\u6709\u63D0\u4F9B\u7684\u5B57\u6BB5\u4E0D\u8981\u731C\u6D4B\u6216\u8865\u5168\u3002\n\u5F53\u524D\u6D88\u606F\u6765\u81EA\u79C1\u804A\uFF0C\u53EF\u4EE5\u4F7F\u7528\u66F4\u8F7B\u677E\u3001\u5E7D\u9ED8\u3001\u8BE6\u7EC6\u7684\u8868\u8FBE\u65B9\u5F0F\u3002":`Understand the source only from fields actually present in for the current message; do not guess or fill in missing fields. This message is from a direct chat. You may use a lighter, more humorous, and detailed style.`,\u586B\u5165\u793A\u4F8B:"Use example",\u6E05\u7A7A:"Clear","\u9009\u62E9\u5728\u54EA\u4E9B\u4F1A\u8BDD\u4E2D\u542F\u7528\u3001\u63D0\u4F9B\u54EA\u4E9B\u6765\u6E90\u5B57\u6BB5\uFF0C\u4EE5\u53CA\u5982\u4F55\u4F7F\u7528\u8FD9\u4E9B\u4FE1\u606F\u3002\u4EC5\u4F7F\u7528\u5DF2\u6709\u6D88\u606F\u5143\u6570\u636E\uFF0C\u4E0D\u67E5\u8BE2\u5E73\u53F0 API\u3002":"Choose which conversations to enhance, which source fields to include, and how to use them. Only existing message metadata is used; no platform APIs are queried.","\u589E\u5F3A\u63D0\u793A\u8BCD\u4E2D\u8BF7\u4F7F\u7528\u5B57\u6BB5\u540D\uFF08\u5982 senderId\u3001conversationType\uFF09\u5F15\u7528\u8FD9\u4E9B\u4FE1\u606F\u3002\u53EA\u53D1\u9001\u52FE\u9009\u4E14\u5F53\u524D\u6D88\u606F\u4E2D\u53EF\u7528\u7684\u5B57\u6BB5\uFF0C\u4E0D\u4F1A\u989D\u5916\u67E5\u8BE2\u6216\u8865\u5168\u3002":"Reference these values by field name (such as senderId or conversationType) in the guidance. Only selected fields available in the current message are sent; no extra lookups are made.","\u589E\u5F3A\u63D0\u793A\u8BCD\u4E2D\u8BF7\u4F7F\u7528\u5B57\u6BB5\u540D\uFF08\u5982 senderId\u3001conversationType\uFF09\u5F15\u7528\u8FD9\u4E9B\u4FE1\u606F\u3002\u53EA\u53D1\u9001\u5F53\u524D\u4F1A\u8BDD\u4E2D\u52FE\u9009\u4E14\u53EF\u7528\u7684\u5B57\u6BB5\uFF0C\u4E0D\u4F1A\u989D\u5916\u67E5\u8BE2\u6216\u8865\u5168\u3002":"Reference these values by field name (such as senderId or conversationType) in the guidance. Only fields selected and available in the current conversation are sent; no extra lookups are made.","\u7528\u4E8E\u544A\u8BC9\u6A21\u578B\u5982\u4F55\u4F7F\u7528\u5F53\u524D\u7FA4\u804A\u6D88\u606F\u7684 \u6765\u6E90\u5B57\u6BB5\u3002\u53EA\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002":"Tell the model how to use fields for the current group message. Enter only the body; the plugin adds paired tags.","\u7528\u4E8E\u544A\u8BC9\u6A21\u578B\u5982\u4F55\u4F7F\u7528\u5F53\u524D\u79C1\u804A\u6D88\u606F\u7684 \u6765\u6E90\u5B57\u6BB5\u3002\u53EA\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002":"Tell the model how to use fields for the current direct message. Enter only the body; the plugin adds paired tags.","\u4EC5\u5728\u7FA4\u804A\u5F00\u5173\u5F00\u542F\u65F6\u4F7F\u7528\u3002\u6E05\u7A7A\u5E76\u4FDD\u5B58\u540E\u4E0D\u518D\u9644\u52A0\u7FA4\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\uFF1B\u6240\u9009\u6765\u6E90\u5B57\u6BB5\u4ECD\u6309\u5F53\u524D\u573A\u666F\u8BBE\u7F6E\u53D1\u9001\u3002":"Used only when group enhancement is enabled. Clear and save to omit group guidance; selected source fields still follow the group settings.","\u4EC5\u5728\u79C1\u804A\u5F00\u5173\u5F00\u542F\u65F6\u4F7F\u7528\u3002\u6E05\u7A7A\u5E76\u4FDD\u5B58\u540E\u4E0D\u518D\u9644\u52A0\u79C1\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\uFF1B\u6240\u9009\u6765\u6E90\u5B57\u6BB5\u4ECD\u6309\u5F53\u524D\u573A\u666F\u8BBE\u7F6E\u53D1\u9001\u3002":"Used only when direct enhancement is enabled. Clear and save to omit direct guidance; selected source fields still follow the direct settings.","\u53EA\u9700\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002\u6E05\u7A7A\u5E76\u4FDD\u5B58\u540E\uFF0C\u4E0D\u518D\u9644\u52A0\u589E\u5F3A\u63D0\u793A\u8BCD\uFF0C\u5DF2\u9009\u6765\u6E90\u5B57\u6BB5\u4ECD\u6309\u5F00\u5173\u8BBE\u7F6E\u53D1\u9001\u3002":"Enter only the body; the plugin adds paired tags. Clear and save to omit guidance. Selected source fields still follow the conversation switches.","\u53D1\u9001\u8005\u6807\u8BC6\u53EF\u80FD\u5305\u542B\u5E73\u53F0\u7528\u6237 ID \u6216\u7535\u8BDD\u53F7\u7801\u5F62\u5F0F\u7684\u6807\u8BC6\u3002\u5173\u95ED\u5F00\u5173\u4E0D\u4F1A\u5220\u9664\u5DF2\u7ECF\u5199\u5165\u4F1A\u8BDD\u5386\u53F2\u7684\u4FE1\u606F\u3002":"Sender IDs may contain platform user IDs or phone-number-like identifiers. Turning this off does not remove information already saved in conversation history.","\u4E0A\u4E0B\u6587\u589E\u5F3A\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not save context enhancement. Try again.","\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":"Submit the complete context enhancement settings.","\u7FA4\u804A\u548C\u79C1\u804A\u5F00\u5173\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002":"Group and direct switches must be booleans.","\u6765\u6E90\u5B57\u6BB5\u53EA\u80FD\u9009\u62E9\u5DF2\u5B9A\u4E49\u7684\u4E94\u4E2A\u5B57\u6BB5\u3002":"Source fields must be chosen from the five defined fields.","\u4FDD\u5B58\u4E2D\u2026":"Saving\u2026",\u672A\u8BBE\u7F6E:"Not set","\u5DE5\u4F5C\u533A\u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not update the workspace. Try again.","\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Enter an absolute workspace path.","\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002":"The workspace must be an absolute path.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002":"The workspace path does not exist.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002":"The workspace path must point to a directory.","\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002":"The bot could not be found.","Agent Preset":"Agent Preset","\u67E5\u770B Agent Preset \u8BF4\u660E":"View Agent Preset help","\u8DDF\u968F Host \u9ED8\u8BA4":"Follow the Host default","\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09":" (unavailable)","\u53EA\u5F71\u54CD\u65B0\u5EFA\u4F1A\u8BDD\uFF1B\u82E5\u5F53\u524D\u804A\u5929\u5DF2\u6709\u4F1A\u8BDD\uFF0C\u5148\u53D1\u9001 /new\uFF0C\u518D\u53D1\u9001\u666E\u901A\u6D88\u606F\u751F\u6548\u3002":"This affects only new sessions. If the current chat already has a session, send /new, then send a regular message to apply it.","\u5F53\u524D Agent Preset \u5DF2\u4E0D\u53EF\u7528\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6 Preset \u6216\u8DDF\u968F Host \u9ED8\u8BA4\u3002":"The current Agent Preset is unavailable. Choose another preset or follow the Host default.","Agent Preset \u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not update the Agent Preset. Try again.","\u8BF7\u9009\u62E9 Agent Preset\u3002":"Choose an Agent Preset.","Agent Preset \u65E0\u6548\u3002":"The Agent Preset is invalid.","Agent Preset \u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u7528\u3002":"The Agent Preset does not exist or is unavailable.",\u5C1A\u672A\u68C0\u67E5:"Not checked yet",\u521A\u521A:"Just now",\u68C0\u67E5\u8FDE\u63A5:"Check connection","\u68C0\u67E5\u4E2D\u2026":"Checking\u2026","\u8FDE\u63A5\u68C0\u67E5\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Connection check failed. Try again later.","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u5BF9\u5E94\u673A\u5668\u4EBA\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002":"Test message sent. Check the matching bot conversation.","\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\u3002\u673A\u5668\u4EBA\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002":"Connection check completed. The bot has not received a direct message it can use for testing.","\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"Connection check completed, but the test message could not be sent.","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u98DE\u4E66\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002":"Test message sent. Check the Feishu conversation.","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230 WhatsApp \u81EA\u804A\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002":"Test message sent. Check the WhatsApp self-chat.","\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7684 WhatsApp \u81EA\u804A\u76EE\u6807\u3002":"Connection check completed, but no WhatsApp self-chat target is available.","\u9489\u9489\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\u3002":"DingTalk connection check completed and the test message was sent.","\u9489\u9489\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"DingTalk connection check completed, but the test message could not be sent.","\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\u3002":"WeChat connection check completed and the test message was sent.","\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"WeChat connection check completed, but the test message could not be sent.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\u3002":"WeCom connection check completed and the test message was sent.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"WeCom connection check completed, but the test message could not be sent.",\u91CD\u8BD5\u8FDE\u63A5:"Reconnect","\u91CD\u8BD5\u4E2D\u2026":"Retrying\u2026",\u79FB\u9664\u63A5\u5165:"Remove connection",\u786E\u8BA4\u79FB\u9664\u63A5\u5165:"Remove connection",\u786E\u8BA4\u79FB\u9664:"Remove","\u6B63\u5728\u79FB\u9664\u2026":"Removing\u2026",\u4FDD\u7559\u673A\u5668\u4EBA:"Keep bot",\u4FDD\u7559\u8D26\u53F7:"Keep account",\u53D6\u6D88:"Cancel",\u5173\u95ED:"Close",\u7ACB\u5373\u91CD\u8BD5:"Retry now",\u91CD\u65B0\u8BFB\u53D6:"Reload",\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801:"Generate a new QR code",\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED:"Generate a new QR code",\u5237\u65B0\u4E8C\u7EF4\u7801:"Refresh QR code","\u5237\u65B0\u4E2D\u2026":"Refreshing\u2026",\u6362\u4E00\u4E2A\u4E8C\u7EF4\u7801:"Get another QR code",\u7EE7\u7EED\u8FDE\u63A5:"Continue connecting",\u7ED1\u5B9A\u5E76\u8FDE\u63A5:"Connect","\u6B63\u5728\u7ED1\u5B9A\u2026":"Connecting\u2026",\u9A8C\u8BC1\u5E76\u8FDE\u63A5:"Verify and connect","\u6B63\u5728\u9A8C\u8BC1\u5E76\u8FDE\u63A5\u2026":"Verifying and connecting\u2026","\u6B63\u5728\u9A8C\u8BC1\u2026":"Verifying\u2026","\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5":"The operation failed. Try again later.",\u8BF7\u7A0D\u540E\u91CD\u8BD5:"Try again later.",\u5F53\u524D\u4E8C\u7EF4\u7801\u6709\u6548\u65F6\u95F4:"QR code expires in",\u4E8C\u7EF4\u7801\u6709\u6548\u65F6\u95F4:"QR code expires in",\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F:"QR code expired",\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548:"QR code expired","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\n\u8BF7\u91CD\u65B0\u751F\u6210":`QR code expired -Generate a new one`,"\u4E8C\u7EF4\u7801\u56FE\u7247\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u81EA\u52A8\u5237\u65B0\u2026":"Refreshing QR code\u2026","\u4E8C\u7EF4\u7801\u672A\u5C31\u7EEA\uFF0C\u8BF7\u6253\u5F00\u6388\u6743\u94FE\u63A5":"The QR code is not ready. Open the authorization link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u4F7F\u7528\u5907\u7528\u94FE\u63A5\u3002":"The QR code is not ready. Use the alternate link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code is not ready. Generate a new one.",\u7B49\u5F85\u5237\u65B0:"Waiting to refresh",\u6B63\u5728\u5237\u65B0\u4E8C\u7EF4\u7801:"Refreshing QR code",\u6253\u5F00\u5907\u7528\u94FE\u63A5:"Open alternate link",\u751F\u6210\u4E8C\u7EF4\u7801:"Generate QR code",\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeChat QR code",\u751F\u6210\u98DE\u4E66\u4E8C\u7EF4\u7801:"Generate Feishu QR code",\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801:"Generate DingTalk QR code",\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeCom QR code","\u751F\u6210 QQ \u4E8C\u7EF4\u7801":"Generate QQ QR code","\u6B63\u5728\u751F\u6210\u4E8C\u7EF4\u7801\u2026":"Generating QR code\u2026",\u6B63\u5728\u51C6\u5907\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing authorization QR code",\u6B63\u5728\u51C6\u5907\u6743\u9650\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing permission authorization QR code",\u6B63\u5728\u51C6\u5907\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Preparing WeChat QR code",\u6B63\u5728\u6DFB\u52A0\u65B0\u673A\u5668\u4EBA:"Adding a new bot","\u6B63\u5728\u7533\u8BF7\u9489\u9489\u6388\u6743\u4E8C\u7EF4\u7801\u2026":"Requesting DingTalk authorization QR code\u2026","\u6B63\u5728\u7533\u8BF7\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u2026":"Requesting WeCom QR code\u2026","\u6B63\u5728\u7533\u8BF7 QQ \u4E8C\u7EF4\u7801\u2026":"Requesting QQ QR code\u2026","\u6B63\u5728\u751F\u6210 WhatsApp \u4E8C\u7EF4\u7801":"Generating WhatsApp QR code","\u626B\u7801\uFF0C\u521B\u5EFA\u7B2C\u4E00\u4E2A\u98DE\u4E66\u5165\u53E3":"Scan to create your first Feishu bot","\u626B\u7801\u53EA\u4F1A\u65B0\u589E\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA\u4F1A\u7EE7\u7EED\u6B63\u5E38\u6536\u53D1\u6D88\u606F\u3002":"Scanning adds one bot. Existing bots will continue to send and receive messages.","\u65E0\u9700\u624B\u52A8\u586B\u5199 App ID\u3002\u4EE5\u540E\u8FD8\u53EF\u4EE5\u7EE7\u7EED\u6DFB\u52A0\u673A\u5668\u4EBA\uFF0C\u5206\u522B\u670D\u52A1\u4E0D\u540C\u56E2\u961F\u6216\u98DE\u4E66\u79DF\u6237\u3002":"No App ID is required. You can add more bots later for different teams or Feishu tenants.",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u521B\u5EFA\u673A\u5668\u4EBA:"Scan with Feishu to create a bot",\u5237\u65B0\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED:"Refresh the QR code to continue","\u6253\u5F00\u98DE\u4E66\u79FB\u52A8\u7AEF\uFF0C\u4F7F\u7528\u626B\u4E00\u626B\u8BFB\u53D6\u4E8C\u7EF4\u7801":"Open Feishu on your phone and scan the QR code","\u6838\u5BF9\u5E94\u7528\u540D\u79F0\u4E0E\u6743\u9650\u8303\u56F4\uFF0C\u5E76\u786E\u8BA4\u521B\u5EFA":"Review the app name and permissions, then confirm","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u65B0\u673A\u5668\u4EBA\u7684\u957F\u8FDE\u63A5\u5C31\u7EEA":"Keep this page open until the bot connection is ready",\u5728\u98DE\u4E66\u4E2D\u6253\u5F00:"Open in Feishu",\u53D6\u6D88\u6DFB\u52A0:"Cancel",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u8865\u5168\u6743\u9650:"Scan with Feishu to complete permissions",\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u7FA4\u6D88\u606F\u6743\u9650:"Confirm group-message permission with Feishu","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u53EA\u589E\u91CF\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with only the \u201CRead all messages in associated group chat\u201D scope. It does not create a new app. After confirmation, \u201CRespond to all group messages\u201D is enabled automatically; other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\uFF0C\u5E76\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650":"Review the existing app and confirm the \u201CRead all messages in associated group chat\u201D permission","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u751F\u6548\u5E76\u81EA\u52A8\u5207\u6362\u54CD\u5E94\u65B9\u5F0F":"Keep this page open while the permission takes effect and the response mode switches automatically",\u53D6\u6D88\u6388\u6743:"Cancel authorization","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F":"Confirmed. Enabling all-message mode","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u8BBE\u7F6E\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Saving the setting and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Enabling all-message mode and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a group-message permission QR code for the existing Feishu app\u2026",\u7FA4\u6D88\u606F\u6743\u9650\u6CA1\u6709\u5F00\u901A\u5B8C\u6210:"Group-message permission was not granted","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u589E\u91CF\u8865\u5145\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u6309\u94AE\u56DE\u8C03\u3001\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u5B8C\u6210\u540E\u6B64\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u91CD\u8FDE\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with the missing card-button callback, im:message:readonly for reading images or files in user messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. It does not create a new app. The confirmation page shows only missing items; this bot reconnects briefly afterward, while other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\u540D\u79F0\uFF0C\u5E76\u786E\u8BA4\u53EA\u65B0\u589E\u5F53\u524D\u7F3A\u5C11\u7684\u4E0A\u8FF0\u914D\u7F6E":"Review the existing app name and confirm that only the missing items described above are added","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5B8C\u6210":"Keep this page open until permissions and the callback are complete",\u53D6\u6D88\u8865\u5168:"Cancel setup","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u5B8C\u6210\u6743\u9650\u4E0E\u56DE\u8C03\u914D\u7F6E":"Confirmed. Completing permissions and callback setup",\u6B63\u5728\u51C6\u5907\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Preparing the permission-completion QR code","\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u6743\u9650\u3001\u9A8C\u8BC1\u5361\u7247\u56DE\u8C03\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The update was submitted. Saving permissions, verifying the card callback, and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u4E00\u6B21\u6027\u66F4\u65B0\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time update QR code for the existing Feishu app\u2026",\u6743\u9650\u4E0E\u56DE\u8C03\u6CA1\u6709\u8865\u5168\u5B8C\u6210:"Permissions and callback setup did not finish",\u8865\u5168\u6743\u9650:"Complete permissions",\u8865\u5168\u8303\u56F4:"Completion scope","\u589E\u91CF\u6DFB\u52A0\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u56DE\u8C03 card.action.trigger\u3001\u8BFB\u53D6\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002":"Adds the missing card callback card.action.trigger, im:message:readonly for reading images or files in messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. The confirmation page shows only missing items; no new app is created.","\u7B49\u5F85\u626B\u7801\u2026":"Waiting for scan\u2026",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Feishu returned a permission-completion QR code for a different bot",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801:"Feishu returned a group-message permission QR code for a different bot","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4FEE\u590D\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu repair status is missing the bot ID","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u5E94\u7528\u66F4\u65B0\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu app-update status is missing the bot ID",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6CE8\u518C\u8FDB\u5EA6:"Feishu returned registration progress for a different operation",\u6B64\u673A\u5668\u4EBA:"this bot","\u7528\u4E8E\u4E3A${botName}\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time QR code for granting group-message permission to ${botName}","\u6B63\u5728\u4E3A\u300C${botName}\u300D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650":"Granting group-message permission to \u201C${botName}\u201D",'${botName ?? "\u673A\u5668\u4EBA"}\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002':'Permission-completion QR code generated for ${botName ?? "bot"}. Scan it with Feishu.','${botName ?? "\u673A\u5668\u4EBA"}\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u3002':'Group-message permission QR code generated for ${botName ?? "bot"}. Confirm it with Feishu.',"${targetBotName}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBotName} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBot.bot.name} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${targetBot.bot.name} is connected and ready to chat in Feishu.","\u5DF2\u53D6\u6D88\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002":"Completing permissions and the callback was cancelled.","\u5DF2\u53D6\u6D88\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u3002":"Group-message permission authorization was cancelled.","\u6743\u9650\u4E0E\u56DE\u8C03\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"Permissions and the callback were updated, but the bot connection could not be confirmed yet","\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"The group-message permission was updated, but the bot connection could not be confirmed yet",\u98DE\u4E66\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5931\u8D25:"Could not complete Feishu permissions and callback setup",\u98DE\u4E66\u7FA4\u6D88\u606F\u6743\u9650\u5F00\u901A\u5931\u8D25:"Could not grant the Feishu group-message permission","\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u98DE\u4E66\u6388\u6743\u64CD\u4F5C\uFF0C\u518D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u3002":"Finish the current Feishu authorization before granting group-message permission.","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u8FDE\u63A5\u65B0\u673A\u5668\u4EBA":"Confirmed. Connecting the new bot","\u6B63\u5728\u5B89\u5168\u4FDD\u5B58\u51ED\u636E\u5E76\u68C0\u67E5\u65B0\u673A\u5668\u4EBA\u7684\u6D88\u606F\u901A\u9053\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"Saving credentials and checking the new bot connection. Existing bots will not be interrupted.","\u6B63\u5728\u5411\u98DE\u4E66\u7533\u8BF7\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time authorization QR code from Feishu\u2026",\u65B0\u673A\u5668\u4EBA\u6CA1\u6709\u6DFB\u52A0\u5B8C\u6210:"The new bot was not added","\u65B0\u98DE\u4E66\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5F00\u59CB\u804A\u5929\u3002":"The new Feishu bot is connected and ready to chat.",\u98DE\u4E66\u5E94\u7528\u521B\u5EFA\u5931\u8D25:"Could not create the Feishu app","\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u8FDE\u63A5\u72B6\u6001":"The bot was created, but its connection could not be confirmed yet",\u673A\u5668\u4EBA\u4ECD\u672A\u8FDE\u63A5:"The bot is still offline",\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The bot is not connected yet",\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38:"Persistent connection is healthy",\u957F\u8FDE\u63A5:"Persistent connection",\u5E94\u7528\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"App identifier stored securely",\u673A\u5668\u4EBA\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"Bot identifier stored securely",\u5DF2\u5B89\u5168\u4FDD\u5B58:"Stored securely",\u5DF2\u63A5\u5165\u7684\u5FAE\u4FE1\u8D26\u53F7:"Connected WeChat accounts",\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA:"Connected bots",\u5DF2\u63A5\u5165\u7684\u9489\u9489\u673A\u5668\u4EBA:"Connected DingTalk bots",\u5DF2\u7ED1\u5B9A\u7684\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connected WeCom bots","\u5DF2\u7ED1\u5B9A\u7684 QQ \u673A\u5668\u4EBA":"Connected QQ bots","\u5DF2\u63A5\u5165\u7684 WhatsApp \u673A\u5668\u4EBA":"Connected WhatsApp accounts",\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801:"Scan with WeChat on your phone","\u626B\u4E00\u6B21\u7801\uFF0C\u5C31\u80FD\u5728\u5FAE\u4FE1\u91CC\u4F7F\u7528 Harness":"Scan once to use Harness in WeChat",\u6253\u5F00\u624B\u673A\u5FAE\u4FE1\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801:"Open WeChat on your phone and scan the QR code",\u5728\u5FAE\u4FE1\u4E2D\u786E\u8BA4\u8FDE\u63A5\u8BE5\u673A\u5668\u4EBA:"Confirm the bot connection in WeChat","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u673A\u5668\u4EBA\u81EA\u52A8\u8FDE\u63A5":"Keep this page open while the bot connects",\u7B49\u5F85\u5FAE\u4FE1\u626B\u7801:"Waiting for WeChat scan",\u9700\u8981\u914D\u5BF9\u7801:"Pairing code required",\u8F93\u5165\u624B\u673A\u5FAE\u4FE1\u663E\u793A\u7684\u6570\u5B57:"Enter the number shown in WeChat",\u5FAE\u4FE1\u914D\u5BF9\u7801:"WeChat pairing code","\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u624B\u673A\u4E0A\u786E\u8BA4":"Scanned. Confirm on your phone","\u914D\u5BF9\u7801\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u786E\u8BA4\u3002":"Pairing code submitted. Waiting for WeChat confirmation.","\u8FD9\u662F\u5FAE\u4FE1\u9644\u52A0\u7684\u5B89\u5168\u786E\u8BA4\u6B65\u9AA4\u3002\u914D\u5BF9\u7801\u53EA\u7528\u4E8E\u672C\u6B21\u626B\u7801\u8F6E\u8BE2\uFF0C\u4E0D\u4F1A\u5199\u5165\u914D\u7F6E\u6216\u65E5\u5FD7\u3002":"This is an additional WeChat confirmation step. The pairing code is used only for this connection and is never stored.","\u6B63\u5728\u4FDD\u5B58\u51ED\u636E\u5E76\u9A8C\u8BC1 Harness \u4E0E\u5FAE\u4FE1\u957F\u8F6E\u8BE2\u3002":"Saving credentials and verifying the WeChat connection.","\u5FAE\u4FE1\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u52A8\u6D88\u606F\u8FDE\u63A5":"Confirmed in WeChat. Starting the message connection","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Check that the store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be saved locally. Check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Check DSH_HOME and the workspace directory.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Confirm that dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u672C\u673A\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 Host \u4FE1\u4EFB\u914D\u7F6E\u3002":"WeChat was authorized, but Harness denied the local health check. Check the Host trust configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health endpoint was not found. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a service error. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health-check request. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed unexpectedly. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection could not be initialized. Check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u7ED1\u5B9A\uFF0C\u53EF\u4EE5\u5F00\u59CB\u5411\u5DF2\u7ED1\u5B9A\u7684\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u3002":"WeChat is connected and ready for messages.","\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ECF\u7ED1\u5B9A\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This WeChat account is connected and online.","\u5FAE\u4FE1\u8D26\u53F7\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"The WeChat account and local credentials were removed.","\u5DF2\u53D6\u6D88\u5FAE\u4FE1\u7ED1\u5B9A\u3002":"WeChat setup was cancelled.","\u6B63\u5728\u8054\u7CFB\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u3002":"Contacting the WeChat iLink service.","iLink \u957F\u8F6E\u8BE2":"iLink long polling","\u626B\u4E00\u6B21\u7801\uFF0C\u81EA\u52A8\u521B\u5EFA\u5E76\u8FDE\u63A5\u673A\u5668\u4EBA":"Scan once to create and connect a bot","\u4F7F\u7528\u9489\u9489 App \u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743":"Authorize the bot with the DingTalk app","\u4F7F\u7528\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u7684\u9489\u9489\u8D26\u53F7\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Scan the QR code with a DingTalk account that belongs to an organization","\u5728\u6388\u6743\u9875\u70B9\u51FB\u201C\u4E00\u952E\u521B\u5EFA\u65B0\u673A\u5668\u4EBA\u201D":"Select \u201CCreate new bot\u201D on the authorization page","\u8BF7\u52FF\u5173\u95ED\u672C\u9875\uFF0C\u9489\u9489\u5B8C\u6210\u6388\u6743\u540E\u5C06\u81EA\u52A8\u7EE7\u7EED\u3002":"Keep this page open. Setup will continue after DingTalk authorization.",\u7B49\u5F85\u9489\u9489\u626B\u7801\u6388\u6743:"Waiting for DingTalk authorization","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u521B\u5EFA\u9489\u9489\u673A\u5668\u4EBA":"Authorized. Creating the DingTalk bot",\u6B63\u5728\u786E\u8BA4\u9489\u9489\u6388\u6743:"Confirming DingTalk authorization","\u6B63\u5728\u68C0\u67E5\u9489\u9489 Stream \u957F\u8FDE\u63A5\uFF0C\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u663E\u793A\u4E3A\u5728\u7EBF\u3002":"Checking the DingTalk Stream connection. It will appear online when ready.","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u53EF\u4EE5\u5F00\u59CB\u53D1\u9001\u6D88\u606F\u3002":"The DingTalk bot is connected and ready for messages.","\u8FD9\u4E2A\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u7ECF\u63A5\u5165\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This DingTalk bot is connected and online.","Stream \u957F\u8FDE\u63A5":"Stream persistent connection","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA":"Scan with WeCom to create an AI bot","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u5B8C\u6210\u667A\u80FD\u673A\u5668\u4EBA\u6388\u6743":"Authorize the AI bot with WeCom","\u6253\u5F00\u4F01\u4E1A\u5FAE\u4FE1 App\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open WeCom and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA:"Confirm bot creation on the Tencent authorization page",\u8FD4\u56DE\u8FD9\u91CC\u7B49\u5F85\u8FDE\u63A5\u5B8C\u6210:"Return here and wait for the connection to complete","\u7B49\u5F85\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801":"Waiting for WeCom scan","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in WeCom. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the WeCom WebSocket connection.","WebSocket \u957F\u8FDE\u63A5":"WebSocket persistent connection","\u4F7F\u7528\u624B\u673A QQ \u626B\u7801\u521B\u5EFA\u5E76\u7ED1\u5B9A\u673A\u5668\u4EBA":"Scan with mobile QQ to create and connect a bot","\u4F7F\u7528\u624B\u673A QQ \u5B8C\u6210\u673A\u5668\u4EBA\u7ED1\u5B9A":"Complete bot setup with mobile QQ","\u6253\u5F00\u624B\u673A QQ\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open mobile QQ and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u6216\u7ED1\u5B9A\u673A\u5668\u4EBA:"Confirm bot creation or connection on the Tencent authorization page","\u7B49\u5F85\u624B\u673A QQ \u626B\u7801":"Waiting for mobile QQ scan","QQ \u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in QQ. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8 QQ WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the QQ WebSocket connection.","\u4F7F\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801\u5373\u53EF\u63A5\u5165\u3002":"Scan the QR code with WhatsApp to connect.","\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801":"Scan with WhatsApp on your phone","\u6253\u5F00 WhatsApp \u2192 \u8BBE\u7F6E \u2192 \u5DF2\u5173\u8054\u8BBE\u5907":"Open WhatsApp \u2192 Settings \u2192 Linked devices","\u70B9\u51FB\u201C\u5173\u8054\u8BBE\u5907\u201D\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Select \u201CLink a device\u201D and scan the QR code","\u7B49\u5F85 WhatsApp \u626B\u7801":"Waiting for WhatsApp scan","\u5DF2\u626B\u7801\uFF0C\u6B63\u5728\u8FDE\u63A5 WhatsApp":"Scanned. Connecting WhatsApp","\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u7684\u5173\u8054\u8BBE\u5907\u4F1A\u8BDD\u3002":"Creating a secure linked-device session.","\u5173\u8054\u8BBE\u5907\u6B63\u5728\u63A5\u5165 DeepSeek Harness\u3002":"Linking the device to DeepSeek Harness.","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"WhatsApp linked device is healthy","\u67E5\u770B WhatsApp \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View WhatsApp access mode details","WhatsApp \u8BBF\u95EE\u6A21\u5F0F":"WhatsApp access mode",\u4EC5\u81EA\u5DF1\u6A21\u5F0F:"Only me",\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F:"Selected contacts",\u5F00\u653E\u54CD\u5E94\u6A21\u5F0F:"Open responses","\u4EC5\u81EA\u5DF1\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Only me (default)","\u5DF2\u751F\u6548\uFF1A":"Active: ","\u53EA\u54CD\u5E94\u5DF2\u7ED1\u5B9A WhatsApp \u8D26\u53F7\u7684\u81EA\u804A\u6D88\u606F\u3002":"Only respond to self-chat messages from the linked WhatsApp account.","\u54CD\u5E94\u81EA\u804A\u548C\u767D\u540D\u5355\u8054\u7CFB\u4EBA\u7684\u79C1\u804A\uFF0C\u5FFD\u7565\u7FA4\u804A\u3002":"Respond to self-chat and allowlisted direct messages; ignore group messages.","\u54CD\u5E94\u6240\u6709\u79C1\u804A\u3001\u5DF2\u7ED1\u5B9A\u8D26\u53F7\u81EA\u5DF1\u53D1\u51FA\u7684\u7FA4\u804A\u6D88\u606F\uFF0C\u4EE5\u53CA\u5176\u4ED6\u7FA4\u6210\u5458\u7684\u63D0\u53CA\u6216\u56DE\u590D\u3002":"Respond to all direct messages, group messages sent by the linked account, and mentions or replies from other group members.","\u5141\u8BB8\u79C1\u804A\u7684 WhatsApp \u7535\u8BDD\u53F7\u7801":"WhatsApp phone numbers allowed to send direct messages",\u6BCF\u884C\u4E00\u4E2A\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\u7684\u53F7\u7801:"One number with country or region code per line","\u53EF\u4EE5\u5305\u542B\u5F00\u5934\u7684 +\uFF0C\u4FDD\u5B58\u65F6\u4F1A\u81EA\u52A8\u79FB\u9664\u3002":"A leading + is allowed and removed when saved.","\u4EC5\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Only Selected contacts uses the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u5C06\u53EA\u63A5\u53D7\u81EA\u804A\u6D88\u606F\u3002":"The allowlist is empty; only self-chat messages will be accepted after saving.","\u7535\u8BDD\u53F7\u7801\u5FC5\u987B\u5305\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each phone number must include a country or region code on its own line.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"WhatsApp access settings are currently unavailable.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save WhatsApp access settings.","Bot API \u957F\u8F6E\u8BE2":"Bot API long polling"," Gateway \u957F\u8FDE\u63A5":" Gateway persistent connection","Gateway \u957F\u8FDE\u63A5":"Gateway persistent connection"," Socket Mode \u957F\u8FDE\u63A5":" Socket Mode persistent connection","Socket Mode \u957F\u8FDE\u63A5":"Socket Mode persistent connection","\u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot","\u5148\u901A\u8FC7 @BotFather \u83B7\u53D6 Bot Token\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Get a Bot Token from @BotFather, then connect it here.","\u586B\u5199 @BotFather \u751F\u6210\u7684 Bot Token":"Enter the Bot Token from @BotFather",\u8BBF\u95EE\u6A21\u5F0F:"Access mode","Telegram \u8BBF\u95EE\u6A21\u5F0F":"Telegram access mode","\u67E5\u770B Telegram \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View Telegram access mode details","\u7FA4\u804A\u5168\u90E8\u5FFD\u7565\uFF0C\u79C1\u804A\u4EC5\u5141\u8BB8\u767D\u540D\u5355\u7528\u6237\u3002":"All group messages are ignored; only allowlisted users may send DMs.","\u4FDD\u6301\u539F\u6709\u884C\u4E3A\uFF1A\u79C1\u804A\u76F4\u63A5\u54CD\u5E94\uFF0C\u7FA4\u804A\u5728\u88AB\u63D0\u53CA\u6216\u56DE\u590D\u65F6\u54CD\u5E94\u3002":"Keep the original behavior: respond to DMs and to group mentions or replies.",\u5B89\u5168\u6A21\u5F0F:"Safe mode",\u517C\u5BB9\u6A21\u5F0F:"Compatible mode","\u5DF2\u751F\u6548\uFF1A\u5B89\u5168\u6A21\u5F0F":"Active: Safe mode","\u5DF2\u751F\u6548\uFF1A\u517C\u5BB9\u6A21\u5F0F":"Active: Compatible mode",\u6A21\u5F0F:"Mode","\u517C\u5BB9\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Compatible mode (default)","\u5B89\u5168\u6A21\u5F0F\uFF08\u79C1\u804A\u767D\u540D\u5355\uFF09":"Safe mode (private-chat allowlist)","\u5141\u8BB8\u79C1\u804A\u7684 Telegram User ID":"Telegram User IDs allowed to send DMs","\u6BCF\u884C\u4E00\u4E2A\u6570\u5B57 User ID":"One numeric User ID per line","\u767D\u540D\u5355\u4EC5\u5C5E\u4E8E\u5F53\u524D\u673A\u5668\u4EBA\u3002":"This allowlist belongs only to the current bot.","\u517C\u5BB9\u6A21\u5F0F\u4E0B\u6682\u4E0D\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Compatible mode does not enforce the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u8BE5\u673A\u5668\u4EBA\u4F1A\u62D2\u7EDD\u6240\u6709\u5165\u7AD9\u6D88\u606F\u3002":"The allowlist is empty; this bot will reject all inbound messages after saving.","\u6B63\u5728\u4FDD\u5B58\u2026":"Saving\u2026",\u4FDD\u5B58\u8BBF\u95EE\u8BBE\u7F6E:"Save access settings","User ID \u5FC5\u987B\u662F 1\u201316 \u4F4D\u6B63\u6574\u6570\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each User ID must be a 1\u201316 digit positive integer on its own line.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Telegram access settings are currently unavailable.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save Telegram access settings.","\u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot","\u5148\u5728 Developer Portal \u521B\u5EFA Bot \u5E76\u9080\u8BF7\u5230\u670D\u52A1\u5668\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Create a bot in the Developer Portal and invite it to your server, then connect it here.","\u586B\u5199 Discord Developer Portal \u7684 Bot Token":"Enter the Bot Token from the Discord Developer Portal","\u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot","\u5148\u7528 Manifest \u521B\u5EFA\u5E76\u914D\u7F6E Slack App":"Create and configure a Slack app with the manifest","\u590D\u5236\u914D\u7F6E\u540E\uFF0C\u5728 Slack \u9009\u62E9 From a manifest\uFF1B\u521B\u5EFA\u5B8C\u6210\u540E\u751F\u6210 connections:write App Token\uFF0C\u5E76\u5C06\u5E94\u7528\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002":"Copy the manifest and choose \u201CFrom a manifest\u201D in Slack. Then create a connections:write App Token and install the app to your workspace.","\u590D\u5236 Manifest":"Copy manifest","\u5DF2\u590D\u5236 Manifest":"Manifest copied","\u6253\u5F00 Slack \u521B\u5EFA\u9875":"Open Slack app creation","Bot Token \u6765\u81EA OAuth & Permissions\uFF1BApp Token \u6765\u81EA Basic Information\uFF0C\u5E76\u4E14\u5FC5\u987B\u5305\u542B connections:write\u3002":"Get the Bot Token from OAuth & Permissions and the App Token from Basic Information. The App Token must include connections:write.","\u4F7F\u7528\u5B98\u65B9 App Manifest \u5FEB\u901F\u914D\u7F6E\u673A\u5668\u4EBA\uFF0C\u518D\u586B\u5199 Bot Token \u4E0E App Token \u5EFA\u7ACB\u672C\u5730 Socket Mode \u8FDE\u63A5\u3002":"Configure the bot with the official app manifest, then enter the Bot Token and App Token to start a local Socket Mode connection.","Slack \u5DE5\u4F5C\u533A":"Slack workspace","Bot Token \u4E0E App Token":"Bot Token and App Token","\u586B\u5199 Bot Token":"Enter Bot Token",\u624B\u52A8\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot manually",\u624B\u52A8\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot manually",\u624B\u52A8\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot manually",\u624B\u52A8\u63A5\u5165QQ\u673A\u5668\u4EBA:"Connect QQ bot manually","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App ID":"Enter the Feishu Open Platform App ID","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App Secret":"Enter the Feishu Open Platform App Secret","\u586B\u5199\u9489\u9489\u5E94\u7528 Client ID":"Enter the DingTalk Client ID","\u586B\u5199\u9489\u9489\u5E94\u7528 Client Secret":"Enter the DingTalk Client Secret","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Bot ID":"Enter the WeCom AI Bot ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Secret":"Enter the WeCom AI Bot Secret","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppID":"Enter the QQ Open Platform AppID","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppSecret":"Enter the QQ Open Platform AppSecret",\u626B\u7801\u63A5\u5165\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeChat bot by QR code",\u626B\u7801\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot by QR code",\u626B\u7801\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot by QR code",\u626B\u7801\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot by QR code","\u626B\u7801\u63A5\u5165 QQ \u673A\u5668\u4EBA":"Connect QQ bot by QR code","\u626B\u7801\u63A5\u5165 WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u626B\u7801\u7ED1\u5B9A WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u4F7F\u7528 App ID \u548C App Secret \u7ED1\u5B9A\u98DE\u4E66\u673A\u5668\u4EBA":"Connect a Feishu bot with App ID and App Secret","\u4F7F\u7528 Client ID \u548C Client Secret \u7ED1\u5B9A\u9489\u9489\u673A\u5668\u4EBA":"Connect a DingTalk bot with Client ID and Client Secret","\u4F7F\u7528 Bot ID \u548C Secret \u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA":"Connect a WeCom bot with Bot ID and Secret","\u4F7F\u7528 AppID \u548C AppSecret \u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"Connect a QQ bot with AppID and AppSecret","\u4F7F\u7528 Manifest \u548C\u53CC Token \u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot with a manifest and two tokens","\u4F7F\u7528 Bot Token \u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot with a Bot Token","\u4F7F\u7528 Bot Token \u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot with a Bot Token",\u53D6\u6D88\u7ED1\u5B9A:"Cancel setup",\u53D6\u6D88\u63A5\u5165:"Cancel setup","\u4E8C\u7EF4\u7801\u7531\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u7B7E\u53D1\u3002\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u5E76\u786E\u8BA4\u540E\uFF0C\u8D26\u53F7\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\uFF0C\u6D4F\u89C8\u5668\u4E0D\u4F1A\u6536\u5230 bot_token\u3002":"The QR code is issued by Tencent WeChat iLink. After you scan and confirm, account credentials are written directly to the Harness Host and are never exposed to the browser.","\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u3002\u5982\u679C\u9489\u9489\u63D0\u793A\u5C1A\u672A\u52A0\u5165\u7EC4\u7EC7\uFF0C\u8BF7\u5728\u63D0\u793A\u9875\u521B\u5EFA\u7EC4\u7EC7\uFF0C\u6216\u6362\u7528\u5DF2\u52A0\u5165\u7EC4\u7EC7\u7684\u8D26\u53F7\u3002":"The DingTalk account must belong to an organization. If prompted, create an organization or use an account that already belongs to one.","\u8BF7\u5728\u624B\u673A\u4E0A\u6838\u5BF9\u5E76\u786E\u8BA4\u6388\u6743\u3002\u90E8\u5206\u8D26\u53F7\u4F1A\u989D\u5916\u663E\u793A\u4E00\u4E2A\u914D\u5BF9\u6570\u5B57\uFF0C\u9875\u9762\u4F1A\u5728\u9700\u8981\u65F6\u63D0\u793A\u8F93\u5165\u3002":"Review and confirm authorization on your phone. Some accounts may also require a pairing number.","\u6388\u6743\u7531\u9489\u9489\u5B98\u65B9\u9875\u9762\u5B8C\u6210\u3002\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4E00\u4E2A\u4F01\u4E1A/\u7EC4\u7EC7\u5E76\u6709\u6743\u521B\u5EFA\u673A\u5668\u4EBA\uFF1B\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u5E94\u7528\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\u3002":"Authorization is completed on DingTalk\u2019s official page. The account must belong to an organization and be allowed to create bots. Credentials are written directly to the Harness Host.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 AppID \u6216 AppSecret\u3002\u626B\u7801\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No AppID or AppSecret is required, and the bot connects automatically.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 Bot ID \u6216 Secret\u3002\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No Bot ID or Secret is required, and the bot connects automatically.","\u817E\u8BAF\u9875\u9762\u4F1A\u521B\u5EFA\u6216\u7ED1\u5B9A\u4E00\u4E2A QQ \u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"Tencent will create or connect a QQ bot and securely deliver its credentials to the local Harness Host.","\u4F01\u4E1A\u5FAE\u4FE1\u5B98\u65B9\u9875\u9762\u4F1A\u521B\u5EFA\u4E00\u4E2A\u667A\u80FD\u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"WeCom will create an AI bot and securely deliver its credentials to the local Harness Host.","\u4ECE\u6B64 Harness \u79FB\u9664\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\uFF1F":"Remove this WeChat account from Harness?","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 bot_token\u3001\u8D26\u53F7\u914D\u7F6E\u548C\u4F1A\u8BDD\u6620\u5C04\u3002\u5176\u4ED6\u5FAE\u4FE1\u8D26\u53F7\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the message connection and removes the locally stored bot_token, account configuration, and session mappings. Other WeChat accounts are not affected.","\u6B64\u64CD\u4F5C\u4F1A\u505C\u6B62\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u4FDD\u5B58\u5728\u672C\u673A\u7684\u63A5\u5165\u914D\u7F6E\u548C\u51ED\u636E\u3002\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E5F\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the bot connection and removes the locally stored configuration and credentials. The app in Feishu Open Platform is not deleted, and other bots are not affected.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u9489\u9489\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in DingTalk Open Platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u4F01\u4E1A\u5FAE\u4FE1\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in WeCom is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u817E\u8BAF\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot on Tencent\u2019s platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 WhatsApp \u5173\u8054\u8BBE\u5907\u548C\u4F1A\u8BDD\u6620\u5C04\u3002":"This stops the message connection and removes the locally stored WhatsApp linked device and session mappings.",\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA\u5217\u8868:"Loading Feishu bots","\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u2026":"Loading Feishu connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u5FAE\u4FE1\u8FDE\u63A5\u72B6\u6001\u2026":"Loading WeChat connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u9489\u9489\u8FDE\u63A5\u72B6\u6001\u2026":"Loading DingTalk connection status\u2026","\u901A\u8FC7\u626B\u7801\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness":"Connect a DingTalk bot to DeepSeek Harness by QR code",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"DingTalk did not return QR setup progress",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"DingTalk did not return a valid setup attempt","\u9489\u9489 Stream \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"DingTalk Stream connection is healthy",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"DingTalk did not return a valid bot list","${totals.connected} / ${totals.configured} \u5728\u7EBF":"${totals.connected} / ${totals.configured} online","\u7528\u4E8E\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a DingTalk bot to DeepSeek Harness","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\\n\u8BF7\u91CD\u65B0\u751F\u6210":"QR code expired\\nGenerate a new one","\u673A\u5668\u4EBA\u5DF2\u521B\u5EFA\uFF0C\u6B63\u5728\u5EFA\u7ACB\u6D88\u606F\u8FDE\u63A5":"Bot created. Starting the message connection",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u5B89\u5168\u7684\u4E8C\u7EF4\u7801:"DingTalk did not return a secure QR code","\u9489\u9489\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u9489\u9489 App \u626B\u63CF\u3002":"DingTalk QR code generated. Scan it with the DingTalk app.","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"DingTalk bot credentials connected.","\u5DF2\u53D6\u6D88\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165\u3002":"DingTalk bot setup cancelled.","\u9489\u9489\u673A\u5668\u4EBA\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"DingTalk bot and local credentials removed.",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4FE1\u606F:"Feishu did not return QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4E8C\u7EF4\u7801\u4FE1\u606F\u4E0D\u5B8C\u6574:"Feishu returned incomplete QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u673A\u5668\u4EBA\u72B6\u6001:"Feishu returned an invalid bot status","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u673A\u5668\u4EBA\u7F3A\u5C11 botId":"The Feishu bot is missing botId",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8FDE\u63A5\u72B6\u6001:"Feishu did not return connection status",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u521B\u5EFA\u8FDB\u5EA6:"Feishu did not return creation progress",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u672A\u77E5\u7684\u521B\u5EFA\u72B6\u6001:"Feishu returned an unknown creation status","\u5DF2\u63A5\u5165 ${totals.configured} \u4E2A\u673A\u5668\u4EBA\uFF0C\u5176\u4E2D ${totals.connected} \u4E2A\u5728\u7EBF":"${totals.connected} of ${totals.configured} bots online",\u5C1A\u672A\u63A5\u5165\u673A\u5668\u4EBA:"No bot connected yet","\u7528\u4E8E\u65B0\u589E DeepSeek Harness \u98DE\u4E66\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time authorization QR code for adding a Feishu bot to DeepSeek Harness",\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u626B\u7801:"Refresh and scan again",'${connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"}${bot.name}':'${connected ? "Check connection" : "Reconnect"} ${bot.name}',\u65E0\u6CD5\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA:"Could not load Feishu bots","\u6388\u6743\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002":"Authorization QR code generated. Scan it with Feishu.","\u98DE\u4E66\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"Feishu bot credentials connected.","\u5DF2\u53D6\u6D88\u6DFB\u52A0\u673A\u5668\u4EBA\u3002":"Adding the bot was cancelled.","${newBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${newBot.bot.name} is connected and ready to chat in Feishu.","${bot.name}\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001\u3002":"${bot.name} operation failed. Check the bot status.","${bot.name}\u5DF2\u4ECE\u6B64 DeepSeek Harness \u79FB\u9664\uFF1B\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u672A\u88AB\u5220\u9664\u3002":"${bot.name} was removed from this DeepSeek Harness. The app in Feishu Open Platform was not deleted.",\u65E0\u6CD5\u8BFB\u53D6\u8FDE\u63A5\u72B6\u6001:"Could not load connection status","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6":"QQ did not return QR setup progress","QQ \u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1":"QQ did not return a valid setup attempt","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"QQ WebSocket connection is healthy","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"QQ did not return a valid bot list","\u5C1A\u672A\u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"No QQ bot connected yet","\u7528\u4E8E\u7ED1\u5B9A QQ \u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a QQ bot","${channel}${connectionSummary}\u8FD0\u884C\u6B63\u5E38":"${channel}${connectionSummary} is healthy","${channel} \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"${channel} did not return a valid bot list","\u4F7F\u7528 Bot Token \u63A5\u5165 ${channel} \u673A\u5668\u4EBA":"Connect a ${channel} bot with a Bot Token","${model.totals.connected} / ${model.totals.configured} \u5728\u7EBF":"${model.totals.connected}/${model.totals.configured} online"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"WeCom did not return QR setup progress",\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeCom did not return a valid setup attempt","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"WeCom WebSocket connection is healthy",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"WeCom did not return a valid bot list",\u5C1A\u672A\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"No WeCom bot connected yet",\u7528\u4E8E\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801:"One-time QR code for connecting a WeCom bot",\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeChat did not return a valid setup attempt",\u5FAE\u4FE1\u7ED1\u5B9A\u6CA1\u6709\u5B8C\u6210:"WeChat setup did not complete",\u5FAE\u4FE1\u8FDE\u63A5\u6B63\u5E38:"WeChat connection is healthy",\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA:"WeChat connection is not ready","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002":"The current model does not support images. Use /models to list models, then /model to switch and resend.","\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds the Host size limit. Compress it and try again.","\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image resolution is too high. Compress it and try again.","\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image is invalid or unsupported. Send it again.","\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image could not be read. Send it again.","\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The declared image format does not match its content. Send it again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002":"The message exceeds the Host image-count limit. Remove some images and try again.","\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images exceed the Host total-size limit. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002":"The image download redirected and cannot be read.","\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds 5 MB. Compress it and try again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images are too large in total. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"The image download failed. Send it again.","\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002":"This image format is unsupported. Send a JPEG, PNG, WebP, or GIF image.","\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Message processing failed. Try again later.",\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u8D26\u53F7\u5217\u8868:"WeChat did not return a valid account list",\u5C1A\u672A\u7ED1\u5B9A\u5FAE\u4FE1:"No WeChat account connected yet","\u7528\u4E8E\u628A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7ED1\u5B9A\u5230 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a WeChat bot to DeepSeek Harness","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6D88\u606F\u957F\u8F6E\u8BE2\u53D8\u4E3A\u5728\u7EBF":"Keep this page open until long polling is online","\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u3002":"WeChat QR code generated. Scan it with WeChat on your phone.","\u79FB\u9664\u5931\u8D25\uFF1A${presentError(error).message}":"Removal failed: ${presentError(error).message}",\u65E0\u6CD5\u8BFB\u53D6\u5FAE\u4FE1\u72B6\u6001:"Could not load WeChat status","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u8FDB\u5EA6":"WhatsApp did not return QR setup progress","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u626B\u7801\u4EFB\u52A1":"WhatsApp did not return a valid setup attempt","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"WhatsApp did not return a valid account list","\u7528\u4E8E\u5173\u8054 WhatsApp \u8BBE\u5907\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for linking a WhatsApp device",\u7528\u6237:"User","\u5FAE\u4FE1\u7528\u6237 ID":"WeChat user ID","\u586B\u5199\u63A5\u6536\u6D88\u606F\u7684\u7528\u6237 ID":"Enter the recipient user ID",\u79C1\u804A:"Direct message",\u7FA4\u804A:"Group","\u7FA4 Chat ID":"Group Chat ID","\u7528\u6237 ID":"User ID","\u586B\u5199\u9489\u9489\u7528\u6237 ID":"Enter the DingTalk user ID","\u7FA4 Open Conversation ID":"Group Open Conversation ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u7528\u6237 ID":"Enter the WeCom user ID","\u586B\u5199\u7FA4 chatid":"Enter the group chatid",\u5355\u804A:"Direct message","\u7528\u6237 Open ID":"User Open ID","\u586B\u5199 user_openid":"Enter the user_openid","\u7FA4 Open ID":"Group Open ID","\u586B\u5199 group_openid":"Enter the group_openid",\u4F1A\u8BDD:"Conversation",\u7EBF\u7A0B:"Thread","Thread \u65F6\u95F4\u6233":"Thread timestamp",\u804A\u5929:"Chat",\u8BDD\u9898:"Topic",\u9891\u9053\u6216\u79C1\u4FE1:"Channel or DM","\u586B\u5199\u53EF\u53D1\u6D88\u606F\u7684 Channel ID":"Enter a Channel ID the bot can message","\u7528\u6237 JID":"User JID","\u7FA4 JID":"Group JID","\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Request failed. Try again later.","\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u81EA\u52A8\u590D\u5236\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236\u3002":"Automatic copy is unavailable. Select and copy the value manually.","\u76EE\u6807\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002":"Could not save the target. Check it and try again.","\u65E0\u6CD5\u751F\u6210\u672A\u5360\u7528\u7684 Target ID\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not generate an unused Target ID. Try again.",\u7F16\u8F91\u6295\u9012\u76EE\u6807:"Edit delivery target",\u65B0\u5EFA\u6295\u9012\u76EE\u6807:"New delivery target","\u5DF2\u4ECE\u4F1A\u8BDD\u81EA\u52A8\u586B\u5165\u76EE\u6807\u4FE1\u606F\uFF1B\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Target details were filled from the conversation. Review them before saving.","\u8BF7\u624B\u52A8\u586B\u5199\u4ECE\u5BF9\u5E94\u5E73\u53F0\u53D6\u5F97\u7684\u539F\u751F\u6807\u8BC6\u3002":"Enter the native identifier from the platform manually.","\u4F8B\u5982 daily-report":"For example, daily-report","\u4F7F\u7528\u5927\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u70B9\u3001\u4E0B\u5212\u7EBF\u3001\u5192\u53F7\u3001@ \u6216\u8FDE\u5B57\u7B26\u3002":"Use letters, numbers, dots, underscores, colons, @, or hyphens.","\u663E\u793A\u540D\u79F0\uFF08\u53EF\u9009\uFF09":"Display name (optional)","\u4F8B\u5982 \u6BCF\u65E5\u6C47\u62A5\u7FA4":"For example, Daily reports",\u76EE\u6807\u7C7B\u578B:"Target type",\u4FDD\u5B58\u76EE\u6807:"Save target",\u8BF7\u5148\u5B8C\u6210\u6295\u9012\u76EE\u6807\u8BFB\u53D6:"Wait for delivery targets to finish loading",\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9:"Choose from conversations",\u5DF2\u804A\u4F1A\u8BDD:"Conversation",\u4ECE\u4F1A\u8BDD\u9009\u62E9targetID:"Select a targetID from conversations","\u9009\u62E9\u540E\u4F1A\u81EA\u52A8\u586B\u5199\u76EE\u6807\u4FE1\u606F\u548C\u8C03\u7528\u522B\u540D\uFF0C\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Selecting a conversation fills the target details and call alias. Review them before saving.","\u6B63\u5728\u5237\u65B0\u2026":"Refreshing\u2026",\u5237\u65B0:"Refresh","\u6B63\u5728\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\u2026":"Loading known conversations\u2026","\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load known conversations. Try again later.",\u8FD8\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u4F1A\u8BDD:"No conversations to choose from","\u5148\u5728\u5BF9\u5E94\u5E73\u53F0\u4E0E\u673A\u5668\u4EBA\u804A\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u5237\u65B0\u3002":"Send the bot a message on the platform, then refresh.",\u5DF2\u6DFB\u52A0:"Added","\u624B\u52A8\u586B\u5199\uFF08\u9AD8\u7EA7\uFF09":"Enter manually (advanced)","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u76EE\u6807\u4F1A\u8BDD\u786E\u8BA4\u3002":"Test message sent. Confirm it in the target conversation.","\u6D4B\u8BD5\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Test delivery failed. Try again later.",\u5DF2\u590D\u5236\u8C03\u7528\u53C2\u6570:"Call parameters copied","\u590D\u5236\u5931\u8D25\u3002":"Copy failed.","\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not delete the target. Try again later.",\u590D\u5236\u8C03\u7528\u53C2\u6570:"Copy call parameters",\u673A\u5668\u4EBA\u79BB\u7EBF\u65F6\u4E0D\u53EF\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F:"Test delivery is unavailable while the bot is offline",\u6D4B\u8BD5\u6295\u9012\u76EE\u6807:"Test delivery target",\u6D4B\u8BD5:"Test",\u7F16\u8F91:"Edit",\u5220\u9664:"Delete","\u5220\u9664 ":"Delete ","\uFF1F\u4F7F\u7528\u8FD9\u4E2A targetId \u7684\u5916\u90E8\u8C03\u7528\u5C06\u8FD4\u56DE unknown-target\u3002":"? External calls using this targetId will return unknown-target.","\u6B63\u5728\u5220\u9664\u2026":"Deleting\u2026",\u786E\u8BA4\u5220\u9664:"Delete target","\u6295\u9012\u76EE\u6807\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Delivery target settings are unavailable.","\u65E0\u6CD5\u8BFB\u53D6\u6295\u9012\u76EE\u6807\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load delivery targets. Try again later.","\u2190 \u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868":"\u2190 Back to bots",\u4F7F\u7528\u6587\u6863:"User guide",\u6253\u5F00\u4E3B\u52A8\u6295\u9012\u4F7F\u7528\u6587\u6863:"Open the proactive delivery guide","\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u6295\u9012\u76EE\u6807\u3002":"Delivery targets are not supported for this channel.","\u5DF2\u590D\u5236 Bot ID":"Bot ID copied",\u590D\u5236:"Copy",\u6295\u9012\u76EE\u6807:"Delivery targets","\u673A\u5668\u4EBA\u5F53\u524D\u79BB\u7EBF\uFF1B\u4ECD\u53EF\u914D\u7F6E\u76EE\u6807\uFF0C\u6062\u590D\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5\u3002":"The bot is offline. You can still configure targets and test them after reconnection.",\u65B0\u5EFA\u76EE\u6807:"New target","\u6B63\u5728\u8BFB\u53D6\u6295\u9012\u76EE\u6807\u2026":"Loading delivery targets\u2026",\u5C1A\u672A\u914D\u7F6E\u6295\u9012\u76EE\u6807:"No delivery targets yet","\u70B9\u51FB\u201C\u65B0\u5EFA\u76EE\u6807\u201D\u53EF\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9\uFF0C\u4E5F\u53EF\u624B\u52A8\u586B\u5199\u3002":"Select New target to choose a conversation or enter the details manually."});var dlA=Object.freeze(Object.fromEntries(Object.keys(_ve).map(n=>[n,n==="$locale"?"zh":n])));var hlA=Object.freeze(["aria-label","alt","placeholder","title"]);var Tve=Object.freeze({defaultId:"",items:Object.freeze([])}),BlA=Jd.createContext(Tve);var kP="/feishu",g5=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",beginCallbackRepair:"bot.callback-repair.begin",beginGroupMessagePermission:"bot.group-message-permission.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete",setWorkspace:"bot.workspace.set",setAgentPreset:"bot.preset.set",setContextEnhancement:"bot.context-enhancement.set",setAccessPolicy:"bot.access-policy.set",setGroupResponseMode:"bot.group-response-mode.set",testConnection:"connection.test",disconnect:"connection.disconnect"}),MlA=Object.freeze({PROVISION:"provision",CALLBACK_REPAIR:"callback_repair",GROUP_MESSAGE_PERMISSION:"group_message_permission"});var Dt=Object.freeze({...g5,setAccessPolicy:Va});var ul=Object.freeze({reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete"}),d5=Object.freeze([...new Set([...Object.values(Dt),...Object.values(ul)])]),Rve=new Set(["idle","starting","qr_ready","polling","slow_down","domain_switched","saving","succeeded","expired","cancelled","error"]),kve=new Set(["provision","callback_repair","group_message_permission"]),h5="callback_repair",PP="group_message_permission",kS=new Set([h5,PP]),vve=new Set(["accounts.feishu.cn","accounts.larksuite.com","open.feishu.cn","open.larksuite.com"]),Pve=/^[A-Za-z0-9_-]{1,128}$/,Gve=/^cli_[A-Za-z0-9_-]+$/,c5=Object.freeze({abort:"Registration was cancelled.",access_denied:"Registration was denied.",expired_token:"The registration QR code expired.",invalid_credentials:"Feishu returned invalid app credentials.",credentials_callback_failed:"Unable to activate the Feishu connection.",registration_failed:"Unable to register the Feishu app.",connection_failed:"The bot was created, but its connection could not be started.",credential_removal_failed:"Unable to remove the Feishu credentials.",state_cleanup_failed:"Unable to remove the bot session data. Please retry.",deletion_pending:"Bot deletion is incomplete. Retry removal to finish cleanup.",missing_credentials:"The bot credentials are missing. Delete it and scan again.",repair_app_mismatch:"The authorized Feishu app does not match the selected bot.",repair_owner_missing:"Feishu did not return the authorizing account identity.",repair_domain_mismatch:"The authorized Feishu tenant does not match the selected bot.",repair_owner_mismatch:"The authorizing Feishu account is not an owner of the selected bot.",repair_credentials_invalid:"Feishu returned credentials that could not be verified for the selected bot.",repair_bot_mismatch:"The verified Feishu bot does not match the selected bot.",repair_target_changed:"The selected bot changed while repair was in progress. Start the repair again.",credential_update_failed:"Unable to store the repaired Feishu credentials.",credential_state_unknown:"The repaired Feishu credentials could not be confirmed after saving.",repair_connection_failed:"The callback update was accepted, but the selected bot could not reconnect.",group_message_permission_required:"Authorize access to all group messages before enabling this mode.",group_message_permission_save_failed:"Feishu granted the permission, but all-message mode could not be saved.",group_message_permission_connection_failed:"Feishu granted the permission, but the selected bot could not reconnect.",card_action_probe_unavailable:"The selected bot is not connected, so its card button cannot be verified.",card_action_probe_send_failed:"The callback update was accepted, but the verification card could not be sent.",card_action_probe_timeout:"Feishu accepted the update, but the card button was not verified in time. Start the repair again and click the test button within two minutes.",card_action_probe_failed:"Feishu accepted the update, but the card button verification failed."}),Fve=Object.freeze({idle:"pending",starting:"pending",qr_ready:"pending",polling:"pending",slow_down:"pending",domain_switched:"pending",saving:"connecting",succeeded:"connected",expired:"expired",cancelled:"failed",error:"failed"});function Lve(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}function jo(n,t){return Lve(n)&&Reflect.ownKeys(n).every(o=>typeof o=="string"&&t.has(o))}function Gu(n){return Number.isFinite(n)?n:void 0}function _n(n){return typeof n=="string"&&Pve.test(n)}function I5(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function FP(n){if(!n||typeof n!="object")return null;let t=typeof n.code=="string"&&Object.hasOwn(c5,n.code)?n.code:"registration_failed";return{code:t,message:c5[t]}}function ys(n){if(!n||typeof n!="object")return{state:"idle",attempt:0};let t=Rve.has(n.state)?n.state:"error",o=_n(n.attempt)?n.attempt:Gu(n.attempt)??0,i={state:t,attempt:o};i.operation=kve.has(n.operation)?n.operation:"provision";let e=Gu(n.updatedAt),a=Gu(n.expiresAt),A=Gu(n.remainingSeconds),r=Gu(n.pollIntervalSeconds);e!==void 0&&(i.updatedAt=e),typeof n.qrCodeUrl=="string"&&n.qrCodeUrl.length>0&&(i.qrCodeUrl=n.qrCodeUrl),a!==void 0&&(i.expiresAt=a),A!==void 0&&(i.remainingSeconds=A),r!==void 0&&(i.pollIntervalSeconds=r),_n(n.botId)&&(i.botId=n.botId);let s=FP(n.error);return s&&(i.error=s),i}function Uve(n,t,o){if(!(typeof n!="string"||n.length===0))try{let i=new URL(n);if(i.protocol!=="https:"||!vve.has(i.hostname)||i.port||i.username||i.password)return;if(kS.has(t)){let e=i.searchParams.getAll("clientID"),a=i.searchParams.getAll("tp"),A=i.searchParams.getAll("addons"),r=[...i.searchParams.values()].some(s=>s.includes("{{")||s.includes("}}"));if(e.length!==1||a.length!==1||a[0]!=="sdk"||!Gve.test(e[0]??"")||i.hostname!==o||i.searchParams.has("createOnly")||A.length!==1||!A[0]?.trim()||r)return}return i.toString()}catch{return}}function vS(n){let t=n&&typeof n=="object"?n:{};return{connected:t.connected===!0||t.ready===!0&&t.feishuLongConnectionState==="connected"&&t.harnessReachable===!0,ready:t.ready===!0,harnessReachable:t.harnessReachable===!0}}function E5(n){let t=n&&typeof n=="object"?n:{},o={name:typeof t.name=="string"&&t.name.length>0?t.name:"\u98DE\u4E66\u673A\u5668\u4EBA"};return typeof t.avatarUrl=="string"&&(o.avatarUrl=t.avatarUrl),typeof t.appIdMasked=="string"&&(o.appIdMasked=t.appIdMasked),typeof t.tenantName=="string"&&(o.tenantName=t.tenantName),(t.domain==="feishu"||t.domain==="lark")&&(o.domain=t.domain),(typeof t.activated=="boolean"||typeof t.activated=="number")&&(o.activated=t.activated),o}function C5(n,t){return t?{status:"healthy",summary:"\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38",lastCheckedAt:Date.now()}:n?.configured===!0?{status:"offline",summary:"\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",lastCheckedAt:Date.now()}:{status:"offline",summary:"\u5C1A\u672A\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA",lastCheckedAt:Date.now()}}function u5(n,t,o){return o?"connected":n?.phase==="error"||t.state==="error"?"error":n?.phase==="connecting"||t.state==="saving"?"connecting":n?.phase==="registering"||["starting","qr_ready","polling","slow_down","domain_switched"].includes(t.state)?"provisioning":"disconnected"}async function B5(n){return Nve.toDataURL(n,{errorCorrectionLevel:"M",margin:1,width:320,type:"image/png"})}async function Hve(n,t,o){let i=Uve(n.qrCodeUrl,n.operation,o),e={attemptId:String(n.attempt),operation:n.operation,...n.botId?{botId:n.botId}:{},expiresAt:n.expiresAt??Date.now()+5*6e4,pollIntervalMs:Math.max(800,Math.min(1e4,(n.pollIntervalSeconds??1.8)*1e3))};if(i)return{...e,verificationUrl:i,qrCodeDataUrl:await t(i)};if(n.state==="saving"&&kS.has(n.operation)&&n.botId)return{...e,submitted:!0}}function Kve(n){let t=n&&typeof n=="object"?n:{};if(!_n(t.botId))return null;let o=vS(t.connection),i=t.connected===!0||o.connected,e={state:"idle"},a={botId:t.botId,state:u5(t,e,i),connected:i,configured:t.configured===!0,agentPreset:ng(t.agentPreset),contextEnhancement:Np(t.contextEnhancement),accessPolicy:vp(t.accessPolicy),groupResponseMode:Io(t.groupResponseMode),groupMessagePermissionGranted:t.groupMessagePermissionGranted===!0,bot:E5(t.bot),health:C5(t,i)};typeof t.workspace=="string"&&t.workspace&&(a.workspace=t.workspace);let A=Xr(t.lastMessageError);A&&(a.lastMessageError=A);let r=FP(t.error);return r&&(a.error=r),a}async function Qa(n,{encodeQr:t=B5}={}){let o=n&&typeof n=="object"?n:{},i=ys(o.registration),e=vS(o.connection),a=o.connected===!0||e.connected,r=(kS.has(i.operation)&&i.botId&&Array.isArray(o.bots)?o.bots.find(d=>d?.botId===i.botId):void 0)?.bot?.domain==="lark"?"open.larksuite.com":"open.feishu.cn",s=await Hve(i,t,r),g=FP(o.error)??i.error??null,c=Array.isArray(o.bots)?o.bots.map(Kve).filter(Boolean):[],I={schemaVersion:o.schemaVersion===2?2:1,revision:Number.isSafeInteger(o.revision)&&o.revision>=0?o.revision:0,state:u5(o,i,a),connected:a,configured:o.configured===!0,bot:E5(o.bot),health:C5(o,a),bots:c,agentPresetCatalog:$n(o.agentPresetCatalog),totals:{configured:c.length||(o.configured===!0?1:0),connected:c.length?c.filter(d=>d.connected).length:a?1:0}};return s&&(I.provisioning=s),g&&(I.error=g),I}function NS(n){return{ok:!1,error:{code:"bad-request",message:n,details:{issues:[]}}}}function RS(){return{ok:!1,error:{code:"cancelled",message:"The Feishu request was cancelled.",details:{}}}}function xve(){return{ok:!1,error:{code:"internal",message:"The Feishu integration operation failed.",details:{}}}}function Yve(n,t){return n===Dt.status?jo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===Dt.testConnection?jo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===Dt.beginProvisioning?jo(t,new Set(["locale","replaceAttemptId"]))?t.locale!==void 0&&t.locale!=="zh-CN"?"The provisioning locale must be zh-CN.":t.replaceAttemptId!==void 0&&!_n(t.replaceAttemptId)?"replaceAttemptId must be a valid opaque id.":null:"Provisioning accepts locale and replaceAttemptId only.":n===Dt.beginCallbackRepair?jo(t,new Set(["botId"]))&&_n(t.botId)?null:"Callback repair requires a single valid botId.":n===Dt.beginGroupMessagePermission?jo(t,new Set(["botId"]))&&_n(t.botId)?null:"Group message permission update requires a single valid botId.":n===Dt.bindCredentials?jo(t,new Set(["appId","appSecret"]))&&I5(t.appId,256)&&I5(t.appSecret,1024)?null:"Credential binding requires App ID and App Secret.":n===Dt.pollProvisioning||n===Dt.cancelProvisioning?jo(t,new Set(["attemptId"]))&&_n(t.attemptId)?null:"A single valid attemptId is required.":n===Dt.disconnect?jo(t,new Set(["removeCredentials"]))&&t.removeCredentials===!0?null:"Disconnect requires removeCredentials=true.":n===ul.reconnectBot?jo(t,new Set(["botId","sendTest"]))&&_n(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"A valid botId and optional sendTest flag are required.":n===ul.disconnectBot?jo(t,new Set(["botId"]))&&_n(t.botId)?null:"A single valid botId is required.":n===ul.deleteBot?jo(t,new Set(["botId","confirm"]))&&_n(t.botId)&&t.confirm===!0?null:"Deleting a bot requires a valid botId and confirm=true.":n===Dt.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Dt.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Dt.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Dt.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Dt.setGroupResponseMode?jo(t,new Set(["botId","groupResponseMode"]))&&_n(t.botId)&&nS(t.groupResponseMode)?null:"\u8BF7\u9009\u62E9\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u3002":"Unknown Feishu endpoint."}function jve(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new Error("aborted"));return}let e=setTimeout(a,n);e.unref?.();function a(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),i(t.reason??new Error("aborted"))}t?.addEventListener("abort",A,{once:!0})})}async function GP(n,t){return typeof n.registrationStatus=="function"?n.registrationStatus(t):n.status()}async function vP(n,t,o,i){let e=t,a=Date.now()+15e3;for(;;){let A=ys(e?.registration);if(A.qrCodeUrl)return e;if(["error","expired","cancelled"].includes(A.state))throw new Error("Provisioning stopped before the QR code was ready.");if(Date.now()>=a)throw new Error("Provisioning QR code timed out.");if(await jve(50,i),e=await GP(n,o),!e)throw new Error("The provisioning attempt is no longer active.")}}function l5(n,t){return String(ys(n?.registration).attempt)===t}function p5(n){let t=ys(n?.registration);return t.state==="succeeded"?t.botId&&(n?.connected===!0||vS(n?.connection).connected)?"connected":"connecting":Fve[t.state]??"failed"}function Jve(n){if(!n||typeof n.status!="function"||typeof n.startRegistration!="function"||typeof n.cancelRegistration!="function"||typeof n.disconnect!="function")throw new TypeError("A Feishu controller with status/start/cancel/disconnect is required")}function f5(n,{encodeQr:t=B5}={}){Jve(n);let o=new Map,i=new Map,e=a=>{let A=o.get(a);return A||(o.size>=32&&o.delete(o.keys().next().value),A=Promise.resolve().then(()=>t(a)),o.set(a,A)),A};return async(a,A,r)=>{if(r?.aborted)return RS();if(!d5.includes(a))return NS("Unknown Feishu endpoint.");let s=Yve(a,A);if(s)return NS(s);try{let g;if(a===Dt.status)g=await Qa(await n.status(),{encodeQr:e});else if(a===Dt.beginProvisioning){A.replaceAttemptId&&await n.cancelRegistration(A.replaceAttemptId);let c=await n.startRegistration({locale:A.locale}),I=String(ys(c?.registration).attempt),d=await vP(n,c,I,r);if(g=(await Qa(d,{encodeQr:e})).provisioning,!g)throw new Error("Provisioning did not produce a QR code.");i.set(I,g.verificationUrl)}else if(a===Dt.beginCallbackRepair){if(typeof n.startCallbackRepair!="function")throw new Error("Feishu callback repair is unavailable.");let c=await n.startCallbackRepair(A.botId),I=String(ys(c?.registration).attempt),d=await vP(n,c,I,r);if(g=(await Qa(d,{encodeQr:e})).provisioning,!g||g.operation!==h5||g.botId!==A.botId)throw new Error("Callback repair did not produce a safe QR code.");i.set(I,g.verificationUrl)}else if(a===Dt.beginGroupMessagePermission){if(typeof n.startGroupMessagePermission!="function")throw new Error("Feishu group message permission update is unavailable.");let c=await n.startGroupMessagePermission(A.botId),I=String(ys(c?.registration).attempt),d=await vP(n,c,I,r);if(g=(await Qa(d,{encodeQr:e})).provisioning,!g||g.operation!==PP||g.botId!==A.botId)throw new Error("Group message permission update did not produce a safe QR code.");i.set(I,g.verificationUrl)}else if(a===Dt.pollProvisioning){let c=await GP(n,A.attemptId);if(!c||!l5(c,A.attemptId))return NS("The provisioning attempt is no longer active.");let I=ys(c.registration),d=await Qa(c,{encodeQr:e});if(g={status:p5(c),operation:I.operation,...I.botId?{botId:I.botId}:{},...d.provisioning?{provisioning:d.provisioning}:{},...I.botId&&d.connected?{connection:d}:{},...d.error?{message:d.error.message}:{}},["connected","expired","failed"].includes(g.status)){let B=i.get(A.attemptId);B&&o.delete(B),i.delete(A.attemptId)}}else if(a===Dt.cancelProvisioning){let c=await GP(n,A.attemptId);if(!c||!l5(c,A.attemptId))return NS("The provisioning attempt is no longer active.");let I=typeof n.registrationStatus=="function",d=ys(c.registration),B;!I&&d.state==="saving"?B=await n.disconnect():B=await n.cancelRegistration(A.attemptId);let f=ys(B?.registration);if(kS.has(d.operation)&&d.state==="saving"&&["saving","succeeded"].includes(f.state)&&(g={status:p5(B),operation:f.operation,...f.botId?{botId:f.botId}:{},message:d.operation===PP?"The permission update was already submitted and is still being applied.":"Callback repair was already submitted and is still being verified."}),g?.status!=="connecting"){let Q=i.get(A.attemptId);Q&&o.delete(Q),i.delete(A.attemptId),g??={status:"failed",operation:d.operation,...d.botId?{botId:d.botId}:{},message:"Registration was cancelled."}}}else if(a===Dt.bindCredentials){if(typeof n.bindCredentials!="function")throw new Error("Credential binding is unavailable");g=await Qa(await n.bindCredentials(A),{encodeQr:e})}else if(a===Dt.testConnection){let c=await n.status(),d=c?.connected===!0||vS(c?.connection).connected||typeof n.reconnect!="function"?c:await n.reconnect();g=await Qa(d,{encodeQr:e})}else if(a===Dt.disconnect)g=await Qa(await n.disconnect(),{encodeQr:e});else if(a===ul.reconnectBot){if(typeof n.reconnectBot!="function")throw new Error("Multi-bot reconnect is unavailable");let c=await n.reconnectBot(A.botId);if(r?.aborted)return RS();if(g=await Qa(c,{encodeQr:e}),A.sendTest===!0){let I=null;if(!(c?.bots?.some(B=>B?.botId===A.botId&&B.connected===!0)===!0))I=new Error("Feishu bot is not connected"),I.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let B=new Error("Connection test is unavailable");throw B.code="test-target-unavailable",B}await n.sendConnectionTest(A.botId)}catch(B){I=B}g={...g,testMessage:or(I)}}}else if(a===ul.disconnectBot){if(typeof n.disconnectBot!="function")throw new Error("Multi-bot disconnect is unavailable");g=await Qa(await n.disconnectBot(A.botId),{encodeQr:e})}else if(a===Dt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");g=await Qa(await n.updateWorkspace(A.botId,A.workspace),{encodeQr:e})}else if(a===Dt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");g=await n.updateContextEnhancement(A.botId,A.config,c=>Qa(c,{encodeQr:e}))}else if(a===Dt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");g=await n.updateAccessPolicy(A.botId,A.policy,c=>Qa(c,{encodeQr:e}))}else if(a===Dt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");g=await Qa(await n.updateAgentPreset(A.botId,A.agentPreset),{encodeQr:e})}else if(a===Dt.setGroupResponseMode){if(typeof n.updateGroupResponseMode!="function")throw new Error("Group response mode update is unavailable");g=await Qa(await n.updateGroupResponseMode(A.botId,A.groupResponseMode),{encodeQr:e})}else{if(typeof n.deleteBot!="function")throw new Error("Multi-bot delete is unavailable");g=await Qa(await n.deleteBot(A.botId),{encodeQr:e})}return r?.aborted?RS():{ok:!0,value:g}}catch(g){let c=Xa(g);return r?.aborted?RS():c?{ok:!1,error:{...c,details:{}}}:xve()}}}function PS(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(kP,f5(t,o),{authority:fr(i)})}function qve(n,t){if(t?.controller)return t.controller;if(typeof t?.createController=="function")return t.createController();if(typeof t?.createProvisioningManager=="function")return nT(t)}async function Q5(n,t={}){let o=qve(n,t);if(o)return PS(n,o,t.rpcOptions,t.rpcAuthority);let i=await DP(n,t),e=t.deliveryService&&i.deliveryAdapter?t.deliveryService.registerAdapter(i.deliveryAdapter):void 0,a=PS(n,i.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await e?.(),await i.close()},"dsh-feishu: close controller and live connection"),a}import{unlink as jPe}from"node:fs/promises";import{homedir as JPe}from"node:os";import{join as Hu,resolve as yl}from"node:path";import{createHash as zve}from"node:crypto";import{mkdir as Vve,readFile as Wve,rename as Zve,unlink as Xve,writeFile as $ve}from"node:fs/promises";import{dirname as ePe}from"node:path";var LP=Object.freeze({version:1,bots:Object.freeze([])});function vc(n){return typeof n=="string"&&n.trim()?n.trim():null}function y5(n){let t=vc(n);return t&&/^qq_[a-f0-9]{24}$/.test(t)?t:null}function APe(n){let t=vc(n);return t&&/^DSH_QQBOT_APP_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function FS(n){let t=vc(n);if(!t)throw new TypeError("appId is required");let o=zve("sha256").update(t).digest("hex").slice(0,24);return{botId:`qq_${o}`,secretRef:`DSH_QQBOT_APP_SECRET_${o.toUpperCase()}`}}function UP(n){let t=vc(n)??"";return t.length<=10?t?`${t.slice(0,3)}\u2022\u2022\u2022`:w("QQ\u673A\u5668\u4EBA"):`${t.slice(0,6)}\u2022\u2022\u2022\u2022${t.slice(-4)}`}function m5(n){if(!n||typeof n!="object")return null;let t=vc(n.appId),o=vc(n.ownerUserOpenid),i=y5(n.botId),e=APe(n.secretRef);if(!t||!o||!i||!e)return null;let a=FS(t);return a.botId!==i||a.secretRef!==e?null:Object.freeze({botId:i,appId:t,secretRef:e,ownerUserOpenid:o,createdAt:vc(n.createdAt)??new Date().toISOString(),connectedAt:vc(n.connectedAt)})}function tPe(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(m5);if(t.some(a=>a===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.appId)||e.has(a.secretRef))return null;o.add(a.botId),i.add(a.appId),e.add(a.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}var GS=class{#e;#A=LP;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=tPe(JSON.parse(await Wve(this.#e,"utf8")));if(!t)throw new Error("dsh-im QQ config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=LP}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByAppId(t){let o=this.#A.bots.find(i=>i.appId===t);return o?structuredClone(o):null}async save(t){let o=m5(t);if(!o)throw new Error("Refusing to persist incomplete QQ bot data");return this.#r(i=>{let e=i.find(r=>r.appId===o.appId&&r.botId!==o.botId),a=i.find(r=>r.secretRef===o.secretRef&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate QQ bot identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!y5(t))throw new TypeError("Invalid QQ bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await Xve(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=LP});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#l(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#l(t){await Vve(ePe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await $ve(o,`${JSON.stringify(t,null,2)} +Generate a new one`,"\u4E8C\u7EF4\u7801\u56FE\u7247\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u81EA\u52A8\u5237\u65B0\u2026":"Refreshing QR code\u2026","\u4E8C\u7EF4\u7801\u672A\u5C31\u7EEA\uFF0C\u8BF7\u6253\u5F00\u6388\u6743\u94FE\u63A5":"The QR code is not ready. Open the authorization link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u4F7F\u7528\u5907\u7528\u94FE\u63A5\u3002":"The QR code is not ready. Use the alternate link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code is not ready. Generate a new one.",\u7B49\u5F85\u5237\u65B0:"Waiting to refresh",\u6B63\u5728\u5237\u65B0\u4E8C\u7EF4\u7801:"Refreshing QR code",\u6253\u5F00\u5907\u7528\u94FE\u63A5:"Open alternate link",\u751F\u6210\u4E8C\u7EF4\u7801:"Generate QR code",\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeChat QR code",\u751F\u6210\u98DE\u4E66\u4E8C\u7EF4\u7801:"Generate Feishu QR code",\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801:"Generate DingTalk QR code",\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeCom QR code","\u751F\u6210 QQ \u4E8C\u7EF4\u7801":"Generate QQ QR code","\u6B63\u5728\u751F\u6210\u4E8C\u7EF4\u7801\u2026":"Generating QR code\u2026",\u6B63\u5728\u51C6\u5907\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing authorization QR code",\u6B63\u5728\u51C6\u5907\u6743\u9650\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing permission authorization QR code",\u6B63\u5728\u51C6\u5907\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Preparing WeChat QR code",\u6B63\u5728\u6DFB\u52A0\u65B0\u673A\u5668\u4EBA:"Adding a new bot","\u6B63\u5728\u7533\u8BF7\u9489\u9489\u6388\u6743\u4E8C\u7EF4\u7801\u2026":"Requesting DingTalk authorization QR code\u2026","\u6B63\u5728\u7533\u8BF7\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u2026":"Requesting WeCom QR code\u2026","\u6B63\u5728\u7533\u8BF7 QQ \u4E8C\u7EF4\u7801\u2026":"Requesting QQ QR code\u2026","\u6B63\u5728\u751F\u6210 WhatsApp \u4E8C\u7EF4\u7801":"Generating WhatsApp QR code","\u626B\u7801\uFF0C\u521B\u5EFA\u7B2C\u4E00\u4E2A\u98DE\u4E66\u5165\u53E3":"Scan to create your first Feishu bot","\u626B\u7801\u53EA\u4F1A\u65B0\u589E\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA\u4F1A\u7EE7\u7EED\u6B63\u5E38\u6536\u53D1\u6D88\u606F\u3002":"Scanning adds one bot. Existing bots will continue to send and receive messages.","\u65E0\u9700\u624B\u52A8\u586B\u5199 App ID\u3002\u4EE5\u540E\u8FD8\u53EF\u4EE5\u7EE7\u7EED\u6DFB\u52A0\u673A\u5668\u4EBA\uFF0C\u5206\u522B\u670D\u52A1\u4E0D\u540C\u56E2\u961F\u6216\u98DE\u4E66\u79DF\u6237\u3002":"No App ID is required. You can add more bots later for different teams or Feishu tenants.",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u521B\u5EFA\u673A\u5668\u4EBA:"Scan with Feishu to create a bot",\u5237\u65B0\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED:"Refresh the QR code to continue","\u6253\u5F00\u98DE\u4E66\u79FB\u52A8\u7AEF\uFF0C\u4F7F\u7528\u626B\u4E00\u626B\u8BFB\u53D6\u4E8C\u7EF4\u7801":"Open Feishu on your phone and scan the QR code","\u6838\u5BF9\u5E94\u7528\u540D\u79F0\u4E0E\u6743\u9650\u8303\u56F4\uFF0C\u5E76\u786E\u8BA4\u521B\u5EFA":"Review the app name and permissions, then confirm","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u65B0\u673A\u5668\u4EBA\u7684\u957F\u8FDE\u63A5\u5C31\u7EEA":"Keep this page open until the bot connection is ready",\u5728\u98DE\u4E66\u4E2D\u6253\u5F00:"Open in Feishu",\u53D6\u6D88\u6DFB\u52A0:"Cancel",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u8865\u5168\u6743\u9650:"Scan with Feishu to complete permissions",\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u7FA4\u6D88\u606F\u6743\u9650:"Confirm group-message permission with Feishu","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u53EA\u589E\u91CF\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with only the \u201CRead all messages in associated group chat\u201D scope. It does not create a new app. After confirmation, \u201CRespond to all group messages\u201D is enabled automatically; other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\uFF0C\u5E76\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650":"Review the existing app and confirm the \u201CRead all messages in associated group chat\u201D permission","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u751F\u6548\u5E76\u81EA\u52A8\u5207\u6362\u54CD\u5E94\u65B9\u5F0F":"Keep this page open while the permission takes effect and the response mode switches automatically",\u53D6\u6D88\u6388\u6743:"Cancel authorization","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F":"Confirmed. Enabling all-message mode","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u8BBE\u7F6E\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Saving the setting and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Enabling all-message mode and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a group-message permission QR code for the existing Feishu app\u2026",\u7FA4\u6D88\u606F\u6743\u9650\u6CA1\u6709\u5F00\u901A\u5B8C\u6210:"Group-message permission was not granted","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u589E\u91CF\u8865\u5145\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u6309\u94AE\u56DE\u8C03\u3001\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u5B8C\u6210\u540E\u6B64\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u91CD\u8FDE\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with the missing card-button callback, im:message:readonly for reading images or files in user messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. It does not create a new app. The confirmation page shows only missing items; this bot reconnects briefly afterward, while other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\u540D\u79F0\uFF0C\u5E76\u786E\u8BA4\u53EA\u65B0\u589E\u5F53\u524D\u7F3A\u5C11\u7684\u4E0A\u8FF0\u914D\u7F6E":"Review the existing app name and confirm that only the missing items described above are added","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5B8C\u6210":"Keep this page open until permissions and the callback are complete",\u53D6\u6D88\u8865\u5168:"Cancel setup","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u5B8C\u6210\u6743\u9650\u4E0E\u56DE\u8C03\u914D\u7F6E":"Confirmed. Completing permissions and callback setup",\u6B63\u5728\u51C6\u5907\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Preparing the permission-completion QR code","\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u6743\u9650\u3001\u9A8C\u8BC1\u5361\u7247\u56DE\u8C03\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The update was submitted. Saving permissions, verifying the card callback, and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u4E00\u6B21\u6027\u66F4\u65B0\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time update QR code for the existing Feishu app\u2026",\u6743\u9650\u4E0E\u56DE\u8C03\u6CA1\u6709\u8865\u5168\u5B8C\u6210:"Permissions and callback setup did not finish",\u8865\u5168\u6743\u9650:"Complete permissions",\u8865\u5168\u8303\u56F4:"Completion scope","\u589E\u91CF\u6DFB\u52A0\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u56DE\u8C03 card.action.trigger\u3001\u8BFB\u53D6\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002":"Adds the missing card callback card.action.trigger, im:message:readonly for reading images or files in messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. The confirmation page shows only missing items; no new app is created.","\u7B49\u5F85\u626B\u7801\u2026":"Waiting for scan\u2026",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Feishu returned a permission-completion QR code for a different bot",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801:"Feishu returned a group-message permission QR code for a different bot","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4FEE\u590D\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu repair status is missing the bot ID","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u5E94\u7528\u66F4\u65B0\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu app-update status is missing the bot ID",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6CE8\u518C\u8FDB\u5EA6:"Feishu returned registration progress for a different operation",\u6B64\u673A\u5668\u4EBA:"this bot","\u7528\u4E8E\u4E3A${botName}\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time QR code for granting group-message permission to ${botName}","\u6B63\u5728\u4E3A\u300C${botName}\u300D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650":"Granting group-message permission to \u201C${botName}\u201D",'${botName ?? "\u673A\u5668\u4EBA"}\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002':'Permission-completion QR code generated for ${botName ?? "bot"}. Scan it with Feishu.','${botName ?? "\u673A\u5668\u4EBA"}\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u3002':'Group-message permission QR code generated for ${botName ?? "bot"}. Confirm it with Feishu.',"${targetBotName}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBotName} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBot.bot.name} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${targetBot.bot.name} is connected and ready to chat in Feishu.","\u5DF2\u53D6\u6D88\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002":"Completing permissions and the callback was cancelled.","\u5DF2\u53D6\u6D88\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u3002":"Group-message permission authorization was cancelled.","\u6743\u9650\u4E0E\u56DE\u8C03\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"Permissions and the callback were updated, but the bot connection could not be confirmed yet","\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"The group-message permission was updated, but the bot connection could not be confirmed yet",\u98DE\u4E66\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5931\u8D25:"Could not complete Feishu permissions and callback setup",\u98DE\u4E66\u7FA4\u6D88\u606F\u6743\u9650\u5F00\u901A\u5931\u8D25:"Could not grant the Feishu group-message permission","\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u98DE\u4E66\u6388\u6743\u64CD\u4F5C\uFF0C\u518D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u3002":"Finish the current Feishu authorization before granting group-message permission.","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u8FDE\u63A5\u65B0\u673A\u5668\u4EBA":"Confirmed. Connecting the new bot","\u6B63\u5728\u5B89\u5168\u4FDD\u5B58\u51ED\u636E\u5E76\u68C0\u67E5\u65B0\u673A\u5668\u4EBA\u7684\u6D88\u606F\u901A\u9053\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"Saving credentials and checking the new bot connection. Existing bots will not be interrupted.","\u6B63\u5728\u5411\u98DE\u4E66\u7533\u8BF7\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time authorization QR code from Feishu\u2026",\u65B0\u673A\u5668\u4EBA\u6CA1\u6709\u6DFB\u52A0\u5B8C\u6210:"The new bot was not added","\u65B0\u98DE\u4E66\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5F00\u59CB\u804A\u5929\u3002":"The new Feishu bot is connected and ready to chat.",\u98DE\u4E66\u5E94\u7528\u521B\u5EFA\u5931\u8D25:"Could not create the Feishu app","\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u8FDE\u63A5\u72B6\u6001":"The bot was created, but its connection could not be confirmed yet",\u673A\u5668\u4EBA\u4ECD\u672A\u8FDE\u63A5:"The bot is still offline",\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The bot is not connected yet",\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38:"Persistent connection is healthy",\u957F\u8FDE\u63A5:"Persistent connection",\u5E94\u7528\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"App identifier stored securely",\u673A\u5668\u4EBA\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"Bot identifier stored securely",\u5DF2\u5B89\u5168\u4FDD\u5B58:"Stored securely",\u5DF2\u63A5\u5165\u7684\u5FAE\u4FE1\u8D26\u53F7:"Connected WeChat accounts",\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA:"Connected bots",\u5DF2\u63A5\u5165\u7684\u9489\u9489\u673A\u5668\u4EBA:"Connected DingTalk bots",\u5DF2\u7ED1\u5B9A\u7684\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connected WeCom bots","\u5DF2\u7ED1\u5B9A\u7684 QQ \u673A\u5668\u4EBA":"Connected QQ bots","\u5DF2\u63A5\u5165\u7684 WhatsApp \u673A\u5668\u4EBA":"Connected WhatsApp accounts",\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801:"Scan with WeChat on your phone","\u626B\u4E00\u6B21\u7801\uFF0C\u5C31\u80FD\u5728\u5FAE\u4FE1\u91CC\u4F7F\u7528 Harness":"Scan once to use Harness in WeChat",\u6253\u5F00\u624B\u673A\u5FAE\u4FE1\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801:"Open WeChat on your phone and scan the QR code",\u5728\u5FAE\u4FE1\u4E2D\u786E\u8BA4\u8FDE\u63A5\u8BE5\u673A\u5668\u4EBA:"Confirm the bot connection in WeChat","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u673A\u5668\u4EBA\u81EA\u52A8\u8FDE\u63A5":"Keep this page open while the bot connects",\u7B49\u5F85\u5FAE\u4FE1\u626B\u7801:"Waiting for WeChat scan",\u9700\u8981\u914D\u5BF9\u7801:"Pairing code required",\u8F93\u5165\u624B\u673A\u5FAE\u4FE1\u663E\u793A\u7684\u6570\u5B57:"Enter the number shown in WeChat",\u5FAE\u4FE1\u914D\u5BF9\u7801:"WeChat pairing code","\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u624B\u673A\u4E0A\u786E\u8BA4":"Scanned. Confirm on your phone","\u914D\u5BF9\u7801\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u786E\u8BA4\u3002":"Pairing code submitted. Waiting for WeChat confirmation.","\u8FD9\u662F\u5FAE\u4FE1\u9644\u52A0\u7684\u5B89\u5168\u786E\u8BA4\u6B65\u9AA4\u3002\u914D\u5BF9\u7801\u53EA\u7528\u4E8E\u672C\u6B21\u626B\u7801\u8F6E\u8BE2\uFF0C\u4E0D\u4F1A\u5199\u5165\u914D\u7F6E\u6216\u65E5\u5FD7\u3002":"This is an additional WeChat confirmation step. The pairing code is used only for this connection and is never stored.","\u6B63\u5728\u4FDD\u5B58\u51ED\u636E\u5E76\u9A8C\u8BC1 Harness \u4E0E\u5FAE\u4FE1\u957F\u8F6E\u8BE2\u3002":"Saving credentials and verifying the WeChat connection.","\u5FAE\u4FE1\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u52A8\u6D88\u606F\u8FDE\u63A5":"Confirmed in WeChat. Starting the message connection","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Check that the store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be saved locally. Check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Check DSH_HOME and the workspace directory.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Confirm that dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u672C\u673A\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 Host \u4FE1\u4EFB\u914D\u7F6E\u3002":"WeChat was authorized, but Harness denied the local health check. Check the Host trust configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health endpoint was not found. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a service error. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health-check request. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed unexpectedly. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection could not be initialized. Check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u7ED1\u5B9A\uFF0C\u53EF\u4EE5\u5F00\u59CB\u5411\u5DF2\u7ED1\u5B9A\u7684\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u3002":"WeChat is connected and ready for messages.","\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ECF\u7ED1\u5B9A\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This WeChat account is connected and online.","\u5FAE\u4FE1\u8D26\u53F7\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"The WeChat account and local credentials were removed.","\u5DF2\u53D6\u6D88\u5FAE\u4FE1\u7ED1\u5B9A\u3002":"WeChat setup was cancelled.","\u6B63\u5728\u8054\u7CFB\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u3002":"Contacting the WeChat iLink service.","iLink \u957F\u8F6E\u8BE2":"iLink long polling","\u626B\u4E00\u6B21\u7801\uFF0C\u81EA\u52A8\u521B\u5EFA\u5E76\u8FDE\u63A5\u673A\u5668\u4EBA":"Scan once to create and connect a bot","\u4F7F\u7528\u9489\u9489 App \u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743":"Authorize the bot with the DingTalk app","\u4F7F\u7528\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u7684\u9489\u9489\u8D26\u53F7\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Scan the QR code with a DingTalk account that belongs to an organization","\u5728\u6388\u6743\u9875\u70B9\u51FB\u201C\u4E00\u952E\u521B\u5EFA\u65B0\u673A\u5668\u4EBA\u201D":"Select \u201CCreate new bot\u201D on the authorization page","\u8BF7\u52FF\u5173\u95ED\u672C\u9875\uFF0C\u9489\u9489\u5B8C\u6210\u6388\u6743\u540E\u5C06\u81EA\u52A8\u7EE7\u7EED\u3002":"Keep this page open. Setup will continue after DingTalk authorization.",\u7B49\u5F85\u9489\u9489\u626B\u7801\u6388\u6743:"Waiting for DingTalk authorization","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u521B\u5EFA\u9489\u9489\u673A\u5668\u4EBA":"Authorized. Creating the DingTalk bot",\u6B63\u5728\u786E\u8BA4\u9489\u9489\u6388\u6743:"Confirming DingTalk authorization","\u6B63\u5728\u68C0\u67E5\u9489\u9489 Stream \u957F\u8FDE\u63A5\uFF0C\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u663E\u793A\u4E3A\u5728\u7EBF\u3002":"Checking the DingTalk Stream connection. It will appear online when ready.","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u53EF\u4EE5\u5F00\u59CB\u53D1\u9001\u6D88\u606F\u3002":"The DingTalk bot is connected and ready for messages.","\u8FD9\u4E2A\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u7ECF\u63A5\u5165\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This DingTalk bot is connected and online.","Stream \u957F\u8FDE\u63A5":"Stream persistent connection","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA":"Scan with WeCom to create an AI bot","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u5B8C\u6210\u667A\u80FD\u673A\u5668\u4EBA\u6388\u6743":"Authorize the AI bot with WeCom","\u6253\u5F00\u4F01\u4E1A\u5FAE\u4FE1 App\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open WeCom and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA:"Confirm bot creation on the Tencent authorization page",\u8FD4\u56DE\u8FD9\u91CC\u7B49\u5F85\u8FDE\u63A5\u5B8C\u6210:"Return here and wait for the connection to complete","\u7B49\u5F85\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801":"Waiting for WeCom scan","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in WeCom. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the WeCom WebSocket connection.","WebSocket \u957F\u8FDE\u63A5":"WebSocket persistent connection","\u4F7F\u7528\u624B\u673A QQ \u626B\u7801\u521B\u5EFA\u5E76\u7ED1\u5B9A\u673A\u5668\u4EBA":"Scan with mobile QQ to create and connect a bot","\u4F7F\u7528\u624B\u673A QQ \u5B8C\u6210\u673A\u5668\u4EBA\u7ED1\u5B9A":"Complete bot setup with mobile QQ","\u6253\u5F00\u624B\u673A QQ\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open mobile QQ and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u6216\u7ED1\u5B9A\u673A\u5668\u4EBA:"Confirm bot creation or connection on the Tencent authorization page","\u7B49\u5F85\u624B\u673A QQ \u626B\u7801":"Waiting for mobile QQ scan","QQ \u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in QQ. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8 QQ WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the QQ WebSocket connection.","\u4F7F\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801\u5373\u53EF\u63A5\u5165\u3002":"Scan the QR code with WhatsApp to connect.","\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801":"Scan with WhatsApp on your phone","\u6253\u5F00 WhatsApp \u2192 \u8BBE\u7F6E \u2192 \u5DF2\u5173\u8054\u8BBE\u5907":"Open WhatsApp \u2192 Settings \u2192 Linked devices","\u70B9\u51FB\u201C\u5173\u8054\u8BBE\u5907\u201D\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Select \u201CLink a device\u201D and scan the QR code","\u7B49\u5F85 WhatsApp \u626B\u7801":"Waiting for WhatsApp scan","\u5DF2\u626B\u7801\uFF0C\u6B63\u5728\u8FDE\u63A5 WhatsApp":"Scanned. Connecting WhatsApp","\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u7684\u5173\u8054\u8BBE\u5907\u4F1A\u8BDD\u3002":"Creating a secure linked-device session.","\u5173\u8054\u8BBE\u5907\u6B63\u5728\u63A5\u5165 DeepSeek Harness\u3002":"Linking the device to DeepSeek Harness.","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"WhatsApp linked device is healthy","\u67E5\u770B WhatsApp \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View WhatsApp access mode details","WhatsApp \u8BBF\u95EE\u6A21\u5F0F":"WhatsApp access mode",\u4EC5\u81EA\u5DF1\u6A21\u5F0F:"Only me",\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F:"Selected contacts",\u5F00\u653E\u54CD\u5E94\u6A21\u5F0F:"Open responses","\u4EC5\u81EA\u5DF1\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Only me (default)","\u5DF2\u751F\u6548\uFF1A":"Active: ","\u53EA\u54CD\u5E94\u5DF2\u7ED1\u5B9A WhatsApp \u8D26\u53F7\u7684\u81EA\u804A\u6D88\u606F\u3002":"Only respond to self-chat messages from the linked WhatsApp account.","\u54CD\u5E94\u81EA\u804A\u548C\u767D\u540D\u5355\u8054\u7CFB\u4EBA\u7684\u79C1\u804A\uFF0C\u5FFD\u7565\u7FA4\u804A\u3002":"Respond to self-chat and allowlisted direct messages; ignore group messages.","\u54CD\u5E94\u6240\u6709\u79C1\u804A\u3001\u5DF2\u7ED1\u5B9A\u8D26\u53F7\u81EA\u5DF1\u53D1\u51FA\u7684\u7FA4\u804A\u6D88\u606F\uFF0C\u4EE5\u53CA\u5176\u4ED6\u7FA4\u6210\u5458\u7684\u63D0\u53CA\u6216\u56DE\u590D\u3002":"Respond to all direct messages, group messages sent by the linked account, and mentions or replies from other group members.","\u5141\u8BB8\u79C1\u804A\u7684 WhatsApp \u7535\u8BDD\u53F7\u7801":"WhatsApp phone numbers allowed to send direct messages",\u6BCF\u884C\u4E00\u4E2A\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\u7684\u53F7\u7801:"One number with country or region code per line","\u53EF\u4EE5\u5305\u542B\u5F00\u5934\u7684 +\uFF0C\u4FDD\u5B58\u65F6\u4F1A\u81EA\u52A8\u79FB\u9664\u3002":"A leading + is allowed and removed when saved.","\u4EC5\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Only Selected contacts uses the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u5C06\u53EA\u63A5\u53D7\u81EA\u804A\u6D88\u606F\u3002":"The allowlist is empty; only self-chat messages will be accepted after saving.","\u7535\u8BDD\u53F7\u7801\u5FC5\u987B\u5305\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each phone number must include a country or region code on its own line.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"WhatsApp access settings are currently unavailable.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save WhatsApp access settings.","Bot API \u957F\u8F6E\u8BE2":"Bot API long polling"," Gateway \u957F\u8FDE\u63A5":" Gateway persistent connection","Gateway \u957F\u8FDE\u63A5":"Gateway persistent connection"," Socket Mode \u957F\u8FDE\u63A5":" Socket Mode persistent connection","Socket Mode \u957F\u8FDE\u63A5":"Socket Mode persistent connection","\u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot","\u5148\u901A\u8FC7 @BotFather \u83B7\u53D6 Bot Token\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Get a Bot Token from @BotFather, then connect it here.","\u586B\u5199 @BotFather \u751F\u6210\u7684 Bot Token":"Enter the Bot Token from @BotFather",\u8BBF\u95EE\u6A21\u5F0F:"Access mode","Telegram \u8BBF\u95EE\u6A21\u5F0F":"Telegram access mode","\u67E5\u770B Telegram \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View Telegram access mode details","\u7FA4\u804A\u5168\u90E8\u5FFD\u7565\uFF0C\u79C1\u804A\u4EC5\u5141\u8BB8\u767D\u540D\u5355\u7528\u6237\u3002":"All group messages are ignored; only allowlisted users may send DMs.","\u4FDD\u6301\u539F\u6709\u884C\u4E3A\uFF1A\u79C1\u804A\u76F4\u63A5\u54CD\u5E94\uFF0C\u7FA4\u804A\u5728\u88AB\u63D0\u53CA\u6216\u56DE\u590D\u65F6\u54CD\u5E94\u3002":"Keep the original behavior: respond to DMs and to group mentions or replies.",\u5B89\u5168\u6A21\u5F0F:"Safe mode",\u517C\u5BB9\u6A21\u5F0F:"Compatible mode","\u5DF2\u751F\u6548\uFF1A\u5B89\u5168\u6A21\u5F0F":"Active: Safe mode","\u5DF2\u751F\u6548\uFF1A\u517C\u5BB9\u6A21\u5F0F":"Active: Compatible mode",\u6A21\u5F0F:"Mode","\u517C\u5BB9\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Compatible mode (default)","\u5B89\u5168\u6A21\u5F0F\uFF08\u79C1\u804A\u767D\u540D\u5355\uFF09":"Safe mode (private-chat allowlist)","\u5141\u8BB8\u79C1\u804A\u7684 Telegram User ID":"Telegram User IDs allowed to send DMs","\u6BCF\u884C\u4E00\u4E2A\u6570\u5B57 User ID":"One numeric User ID per line","\u767D\u540D\u5355\u4EC5\u5C5E\u4E8E\u5F53\u524D\u673A\u5668\u4EBA\u3002":"This allowlist belongs only to the current bot.","\u517C\u5BB9\u6A21\u5F0F\u4E0B\u6682\u4E0D\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Compatible mode does not enforce the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u8BE5\u673A\u5668\u4EBA\u4F1A\u62D2\u7EDD\u6240\u6709\u5165\u7AD9\u6D88\u606F\u3002":"The allowlist is empty; this bot will reject all inbound messages after saving.","\u6B63\u5728\u4FDD\u5B58\u2026":"Saving\u2026",\u4FDD\u5B58\u8BBF\u95EE\u8BBE\u7F6E:"Save access settings","User ID \u5FC5\u987B\u662F 1\u201316 \u4F4D\u6B63\u6574\u6570\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each User ID must be a 1\u201316 digit positive integer on its own line.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Telegram access settings are currently unavailable.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save Telegram access settings.","\u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot","\u5148\u5728 Developer Portal \u521B\u5EFA Bot \u5E76\u9080\u8BF7\u5230\u670D\u52A1\u5668\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Create a bot in the Developer Portal and invite it to your server, then connect it here.","\u586B\u5199 Discord Developer Portal \u7684 Bot Token":"Enter the Bot Token from the Discord Developer Portal","\u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot","\u5148\u7528 Manifest \u521B\u5EFA\u5E76\u914D\u7F6E Slack App":"Create and configure a Slack app with the manifest","\u590D\u5236\u914D\u7F6E\u540E\uFF0C\u5728 Slack \u9009\u62E9 From a manifest\uFF1B\u521B\u5EFA\u5B8C\u6210\u540E\u751F\u6210 connections:write App Token\uFF0C\u5E76\u5C06\u5E94\u7528\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002":"Copy the manifest and choose \u201CFrom a manifest\u201D in Slack. Then create a connections:write App Token and install the app to your workspace.","\u590D\u5236 Manifest":"Copy manifest","\u5DF2\u590D\u5236 Manifest":"Manifest copied","\u6253\u5F00 Slack \u521B\u5EFA\u9875":"Open Slack app creation","Bot Token \u6765\u81EA OAuth & Permissions\uFF1BApp Token \u6765\u81EA Basic Information\uFF0C\u5E76\u4E14\u5FC5\u987B\u5305\u542B connections:write\u3002":"Get the Bot Token from OAuth & Permissions and the App Token from Basic Information. The App Token must include connections:write.","\u4F7F\u7528\u5B98\u65B9 App Manifest \u5FEB\u901F\u914D\u7F6E\u673A\u5668\u4EBA\uFF0C\u518D\u586B\u5199 Bot Token \u4E0E App Token \u5EFA\u7ACB\u672C\u5730 Socket Mode \u8FDE\u63A5\u3002":"Configure the bot with the official app manifest, then enter the Bot Token and App Token to start a local Socket Mode connection.","Slack \u5DE5\u4F5C\u533A":"Slack workspace","Bot Token \u4E0E App Token":"Bot Token and App Token","\u586B\u5199 Bot Token":"Enter Bot Token",\u624B\u52A8\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot manually",\u624B\u52A8\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot manually",\u624B\u52A8\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot manually",\u624B\u52A8\u63A5\u5165QQ\u673A\u5668\u4EBA:"Connect QQ bot manually","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App ID":"Enter the Feishu Open Platform App ID","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App Secret":"Enter the Feishu Open Platform App Secret","\u586B\u5199\u9489\u9489\u5E94\u7528 Client ID":"Enter the DingTalk Client ID","\u586B\u5199\u9489\u9489\u5E94\u7528 Client Secret":"Enter the DingTalk Client Secret","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Bot ID":"Enter the WeCom AI Bot ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Secret":"Enter the WeCom AI Bot Secret","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppID":"Enter the QQ Open Platform AppID","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppSecret":"Enter the QQ Open Platform AppSecret",\u626B\u7801\u63A5\u5165\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeChat bot by QR code",\u626B\u7801\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot by QR code",\u626B\u7801\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot by QR code",\u626B\u7801\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot by QR code","\u626B\u7801\u63A5\u5165 QQ \u673A\u5668\u4EBA":"Connect QQ bot by QR code","\u626B\u7801\u63A5\u5165 WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u626B\u7801\u7ED1\u5B9A WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u4F7F\u7528 App ID \u548C App Secret \u7ED1\u5B9A\u98DE\u4E66\u673A\u5668\u4EBA":"Connect a Feishu bot with App ID and App Secret","\u4F7F\u7528 Client ID \u548C Client Secret \u7ED1\u5B9A\u9489\u9489\u673A\u5668\u4EBA":"Connect a DingTalk bot with Client ID and Client Secret","\u4F7F\u7528 Bot ID \u548C Secret \u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA":"Connect a WeCom bot with Bot ID and Secret","\u4F7F\u7528 AppID \u548C AppSecret \u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"Connect a QQ bot with AppID and AppSecret","\u4F7F\u7528 Manifest \u548C\u53CC Token \u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot with a manifest and two tokens","\u4F7F\u7528 Bot Token \u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot with a Bot Token","\u4F7F\u7528 Bot Token \u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot with a Bot Token",\u53D6\u6D88\u7ED1\u5B9A:"Cancel setup",\u53D6\u6D88\u63A5\u5165:"Cancel setup","\u4E8C\u7EF4\u7801\u7531\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u7B7E\u53D1\u3002\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u5E76\u786E\u8BA4\u540E\uFF0C\u8D26\u53F7\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\uFF0C\u6D4F\u89C8\u5668\u4E0D\u4F1A\u6536\u5230 bot_token\u3002":"The QR code is issued by Tencent WeChat iLink. After you scan and confirm, account credentials are written directly to the Harness Host and are never exposed to the browser.","\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u3002\u5982\u679C\u9489\u9489\u63D0\u793A\u5C1A\u672A\u52A0\u5165\u7EC4\u7EC7\uFF0C\u8BF7\u5728\u63D0\u793A\u9875\u521B\u5EFA\u7EC4\u7EC7\uFF0C\u6216\u6362\u7528\u5DF2\u52A0\u5165\u7EC4\u7EC7\u7684\u8D26\u53F7\u3002":"The DingTalk account must belong to an organization. If prompted, create an organization or use an account that already belongs to one.","\u8BF7\u5728\u624B\u673A\u4E0A\u6838\u5BF9\u5E76\u786E\u8BA4\u6388\u6743\u3002\u90E8\u5206\u8D26\u53F7\u4F1A\u989D\u5916\u663E\u793A\u4E00\u4E2A\u914D\u5BF9\u6570\u5B57\uFF0C\u9875\u9762\u4F1A\u5728\u9700\u8981\u65F6\u63D0\u793A\u8F93\u5165\u3002":"Review and confirm authorization on your phone. Some accounts may also require a pairing number.","\u6388\u6743\u7531\u9489\u9489\u5B98\u65B9\u9875\u9762\u5B8C\u6210\u3002\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4E00\u4E2A\u4F01\u4E1A/\u7EC4\u7EC7\u5E76\u6709\u6743\u521B\u5EFA\u673A\u5668\u4EBA\uFF1B\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u5E94\u7528\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\u3002":"Authorization is completed on DingTalk\u2019s official page. The account must belong to an organization and be allowed to create bots. Credentials are written directly to the Harness Host.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 AppID \u6216 AppSecret\u3002\u626B\u7801\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No AppID or AppSecret is required, and the bot connects automatically.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 Bot ID \u6216 Secret\u3002\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No Bot ID or Secret is required, and the bot connects automatically.","\u817E\u8BAF\u9875\u9762\u4F1A\u521B\u5EFA\u6216\u7ED1\u5B9A\u4E00\u4E2A QQ \u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"Tencent will create or connect a QQ bot and securely deliver its credentials to the local Harness Host.","\u4F01\u4E1A\u5FAE\u4FE1\u5B98\u65B9\u9875\u9762\u4F1A\u521B\u5EFA\u4E00\u4E2A\u667A\u80FD\u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"WeCom will create an AI bot and securely deliver its credentials to the local Harness Host.","\u4ECE\u6B64 Harness \u79FB\u9664\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\uFF1F":"Remove this WeChat account from Harness?","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 bot_token\u3001\u8D26\u53F7\u914D\u7F6E\u548C\u4F1A\u8BDD\u6620\u5C04\u3002\u5176\u4ED6\u5FAE\u4FE1\u8D26\u53F7\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the message connection and removes the locally stored bot_token, account configuration, and session mappings. Other WeChat accounts are not affected.","\u6B64\u64CD\u4F5C\u4F1A\u505C\u6B62\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u4FDD\u5B58\u5728\u672C\u673A\u7684\u63A5\u5165\u914D\u7F6E\u548C\u51ED\u636E\u3002\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E5F\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the bot connection and removes the locally stored configuration and credentials. The app in Feishu Open Platform is not deleted, and other bots are not affected.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u9489\u9489\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in DingTalk Open Platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u4F01\u4E1A\u5FAE\u4FE1\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in WeCom is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u817E\u8BAF\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot on Tencent\u2019s platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 WhatsApp \u5173\u8054\u8BBE\u5907\u548C\u4F1A\u8BDD\u6620\u5C04\u3002":"This stops the message connection and removes the locally stored WhatsApp linked device and session mappings.",\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA\u5217\u8868:"Loading Feishu bots","\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u2026":"Loading Feishu connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u5FAE\u4FE1\u8FDE\u63A5\u72B6\u6001\u2026":"Loading WeChat connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u9489\u9489\u8FDE\u63A5\u72B6\u6001\u2026":"Loading DingTalk connection status\u2026","\u901A\u8FC7\u626B\u7801\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness":"Connect a DingTalk bot to DeepSeek Harness by QR code",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"DingTalk did not return QR setup progress",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"DingTalk did not return a valid setup attempt","\u9489\u9489 Stream \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"DingTalk Stream connection is healthy",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"DingTalk did not return a valid bot list","${totals.connected} / ${totals.configured} \u5728\u7EBF":"${totals.connected} / ${totals.configured} online","\u7528\u4E8E\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a DingTalk bot to DeepSeek Harness","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\\n\u8BF7\u91CD\u65B0\u751F\u6210":"QR code expired\\nGenerate a new one","\u673A\u5668\u4EBA\u5DF2\u521B\u5EFA\uFF0C\u6B63\u5728\u5EFA\u7ACB\u6D88\u606F\u8FDE\u63A5":"Bot created. Starting the message connection",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u5B89\u5168\u7684\u4E8C\u7EF4\u7801:"DingTalk did not return a secure QR code","\u9489\u9489\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u9489\u9489 App \u626B\u63CF\u3002":"DingTalk QR code generated. Scan it with the DingTalk app.","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"DingTalk bot credentials connected.","\u5DF2\u53D6\u6D88\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165\u3002":"DingTalk bot setup cancelled.","\u9489\u9489\u673A\u5668\u4EBA\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"DingTalk bot and local credentials removed.",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4FE1\u606F:"Feishu did not return QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4E8C\u7EF4\u7801\u4FE1\u606F\u4E0D\u5B8C\u6574:"Feishu returned incomplete QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u673A\u5668\u4EBA\u72B6\u6001:"Feishu returned an invalid bot status","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u673A\u5668\u4EBA\u7F3A\u5C11 botId":"The Feishu bot is missing botId",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8FDE\u63A5\u72B6\u6001:"Feishu did not return connection status",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u521B\u5EFA\u8FDB\u5EA6:"Feishu did not return creation progress",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u672A\u77E5\u7684\u521B\u5EFA\u72B6\u6001:"Feishu returned an unknown creation status","\u5DF2\u63A5\u5165 ${totals.configured} \u4E2A\u673A\u5668\u4EBA\uFF0C\u5176\u4E2D ${totals.connected} \u4E2A\u5728\u7EBF":"${totals.connected} of ${totals.configured} bots online",\u5C1A\u672A\u63A5\u5165\u673A\u5668\u4EBA:"No bot connected yet","\u7528\u4E8E\u65B0\u589E DeepSeek Harness \u98DE\u4E66\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time authorization QR code for adding a Feishu bot to DeepSeek Harness",\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u626B\u7801:"Refresh and scan again",'${connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"}${bot.name}':'${connected ? "Check connection" : "Reconnect"} ${bot.name}',\u65E0\u6CD5\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA:"Could not load Feishu bots","\u6388\u6743\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002":"Authorization QR code generated. Scan it with Feishu.","\u98DE\u4E66\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"Feishu bot credentials connected.","\u5DF2\u53D6\u6D88\u6DFB\u52A0\u673A\u5668\u4EBA\u3002":"Adding the bot was cancelled.","${newBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${newBot.bot.name} is connected and ready to chat in Feishu.","${bot.name}\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001\u3002":"${bot.name} operation failed. Check the bot status.","${bot.name}\u5DF2\u4ECE\u6B64 DeepSeek Harness \u79FB\u9664\uFF1B\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u672A\u88AB\u5220\u9664\u3002":"${bot.name} was removed from this DeepSeek Harness. The app in Feishu Open Platform was not deleted.",\u65E0\u6CD5\u8BFB\u53D6\u8FDE\u63A5\u72B6\u6001:"Could not load connection status","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6":"QQ did not return QR setup progress","QQ \u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1":"QQ did not return a valid setup attempt","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"QQ WebSocket connection is healthy","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"QQ did not return a valid bot list","\u5C1A\u672A\u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"No QQ bot connected yet","\u7528\u4E8E\u7ED1\u5B9A QQ \u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a QQ bot","${channel}${connectionSummary}\u8FD0\u884C\u6B63\u5E38":"${channel}${connectionSummary} is healthy","${channel} \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"${channel} did not return a valid bot list","\u4F7F\u7528 Bot Token \u63A5\u5165 ${channel} \u673A\u5668\u4EBA":"Connect a ${channel} bot with a Bot Token","${model.totals.connected} / ${model.totals.configured} \u5728\u7EBF":"${model.totals.connected}/${model.totals.configured} online"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"WeCom did not return QR setup progress",\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeCom did not return a valid setup attempt","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"WeCom WebSocket connection is healthy",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"WeCom did not return a valid bot list",\u5C1A\u672A\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"No WeCom bot connected yet",\u7528\u4E8E\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801:"One-time QR code for connecting a WeCom bot",\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeChat did not return a valid setup attempt",\u5FAE\u4FE1\u7ED1\u5B9A\u6CA1\u6709\u5B8C\u6210:"WeChat setup did not complete",\u5FAE\u4FE1\u8FDE\u63A5\u6B63\u5E38:"WeChat connection is healthy",\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA:"WeChat connection is not ready","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002":"The current model does not support images. Use /models to list models, then /model to switch and resend.","\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds the Host size limit. Compress it and try again.","\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image resolution is too high. Compress it and try again.","\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image is invalid or unsupported. Send it again.","\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image could not be read. Send it again.","\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The declared image format does not match its content. Send it again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002":"The message exceeds the Host image-count limit. Remove some images and try again.","\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images exceed the Host total-size limit. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002":"The image download redirected and cannot be read.","\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds 5 MB. Compress it and try again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images are too large in total. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"The image download failed. Send it again.","\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002":"This image format is unsupported. Send a JPEG, PNG, WebP, or GIF image.","\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Message processing failed. Try again later.",\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u8D26\u53F7\u5217\u8868:"WeChat did not return a valid account list",\u5C1A\u672A\u7ED1\u5B9A\u5FAE\u4FE1:"No WeChat account connected yet","\u7528\u4E8E\u628A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7ED1\u5B9A\u5230 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a WeChat bot to DeepSeek Harness","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6D88\u606F\u957F\u8F6E\u8BE2\u53D8\u4E3A\u5728\u7EBF":"Keep this page open until long polling is online","\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u3002":"WeChat QR code generated. Scan it with WeChat on your phone.","\u79FB\u9664\u5931\u8D25\uFF1A${presentError(error).message}":"Removal failed: ${presentError(error).message}",\u65E0\u6CD5\u8BFB\u53D6\u5FAE\u4FE1\u72B6\u6001:"Could not load WeChat status","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u8FDB\u5EA6":"WhatsApp did not return QR setup progress","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u626B\u7801\u4EFB\u52A1":"WhatsApp did not return a valid setup attempt","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"WhatsApp did not return a valid account list","\u7528\u4E8E\u5173\u8054 WhatsApp \u8BBE\u5907\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for linking a WhatsApp device",\u7528\u6237:"User","\u5FAE\u4FE1\u7528\u6237 ID":"WeChat user ID","\u586B\u5199\u63A5\u6536\u6D88\u606F\u7684\u7528\u6237 ID":"Enter the recipient user ID",\u79C1\u804A:"Direct message",\u7FA4\u804A:"Group","\u7FA4 Chat ID":"Group Chat ID","\u7528\u6237 ID":"User ID","\u586B\u5199\u9489\u9489\u7528\u6237 ID":"Enter the DingTalk user ID","\u7FA4 Open Conversation ID":"Group Open Conversation ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u7528\u6237 ID":"Enter the WeCom user ID","\u586B\u5199\u7FA4 chatid":"Enter the group chatid",\u5355\u804A:"Direct message","\u7528\u6237 Open ID":"User Open ID","\u586B\u5199 user_openid":"Enter the user_openid","\u7FA4 Open ID":"Group Open ID","\u586B\u5199 group_openid":"Enter the group_openid",\u4F1A\u8BDD:"Conversation",\u7EBF\u7A0B:"Thread","Thread \u65F6\u95F4\u6233":"Thread timestamp",\u804A\u5929:"Chat",\u8BDD\u9898:"Topic",\u9891\u9053\u6216\u79C1\u4FE1:"Channel or DM","\u586B\u5199\u53EF\u53D1\u6D88\u606F\u7684 Channel ID":"Enter a Channel ID the bot can message","\u7528\u6237 JID":"User JID","\u7FA4 JID":"Group JID","\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Request failed. Try again later.","\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u81EA\u52A8\u590D\u5236\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236\u3002":"Automatic copy is unavailable. Select and copy the value manually.","\u76EE\u6807\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002":"Could not save the target. Check it and try again.","\u65E0\u6CD5\u751F\u6210\u672A\u5360\u7528\u7684 Target ID\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not generate an unused Target ID. Try again.",\u7F16\u8F91\u6295\u9012\u76EE\u6807:"Edit delivery target",\u65B0\u5EFA\u6295\u9012\u76EE\u6807:"New delivery target","\u5DF2\u4ECE\u4F1A\u8BDD\u81EA\u52A8\u586B\u5165\u76EE\u6807\u4FE1\u606F\uFF1B\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Target details were filled from the conversation. Review them before saving.","\u8BF7\u624B\u52A8\u586B\u5199\u4ECE\u5BF9\u5E94\u5E73\u53F0\u53D6\u5F97\u7684\u539F\u751F\u6807\u8BC6\u3002":"Enter the native identifier from the platform manually.","\u4F8B\u5982 daily-report":"For example, daily-report","\u4F7F\u7528\u5927\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u70B9\u3001\u4E0B\u5212\u7EBF\u3001\u5192\u53F7\u3001@ \u6216\u8FDE\u5B57\u7B26\u3002":"Use letters, numbers, dots, underscores, colons, @, or hyphens.","\u663E\u793A\u540D\u79F0\uFF08\u53EF\u9009\uFF09":"Display name (optional)","\u4F8B\u5982 \u6BCF\u65E5\u6C47\u62A5\u7FA4":"For example, Daily reports",\u76EE\u6807\u7C7B\u578B:"Target type",\u4FDD\u5B58\u76EE\u6807:"Save target",\u8BF7\u5148\u5B8C\u6210\u6295\u9012\u76EE\u6807\u8BFB\u53D6:"Wait for delivery targets to finish loading",\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9:"Choose from conversations",\u5DF2\u804A\u4F1A\u8BDD:"Conversation",\u4ECE\u4F1A\u8BDD\u9009\u62E9targetID:"Select a targetID from conversations","\u9009\u62E9\u540E\u4F1A\u81EA\u52A8\u586B\u5199\u76EE\u6807\u4FE1\u606F\u548C\u8C03\u7528\u522B\u540D\uFF0C\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Selecting a conversation fills the target details and call alias. Review them before saving.","\u6B63\u5728\u5237\u65B0\u2026":"Refreshing\u2026",\u5237\u65B0:"Refresh","\u6B63\u5728\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\u2026":"Loading known conversations\u2026","\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load known conversations. Try again later.",\u8FD8\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u4F1A\u8BDD:"No conversations to choose from","\u5148\u5728\u5BF9\u5E94\u5E73\u53F0\u4E0E\u673A\u5668\u4EBA\u804A\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u5237\u65B0\u3002":"Send the bot a message on the platform, then refresh.",\u5DF2\u6DFB\u52A0:"Added","\u624B\u52A8\u586B\u5199\uFF08\u9AD8\u7EA7\uFF09":"Enter manually (advanced)","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u76EE\u6807\u4F1A\u8BDD\u786E\u8BA4\u3002":"Test message sent. Confirm it in the target conversation.","\u6D4B\u8BD5\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Test delivery failed. Try again later.",\u5DF2\u590D\u5236\u8C03\u7528\u53C2\u6570:"Call parameters copied","\u590D\u5236\u5931\u8D25\u3002":"Copy failed.","\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not delete the target. Try again later.",\u590D\u5236\u8C03\u7528\u53C2\u6570:"Copy call parameters",\u673A\u5668\u4EBA\u79BB\u7EBF\u65F6\u4E0D\u53EF\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F:"Test delivery is unavailable while the bot is offline",\u6D4B\u8BD5\u6295\u9012\u76EE\u6807:"Test delivery target",\u6D4B\u8BD5:"Test",\u7F16\u8F91:"Edit",\u5220\u9664:"Delete","\u5220\u9664 ":"Delete ","\uFF1F\u4F7F\u7528\u8FD9\u4E2A targetId \u7684\u5916\u90E8\u8C03\u7528\u5C06\u8FD4\u56DE unknown-target\u3002":"? External calls using this targetId will return unknown-target.","\u6B63\u5728\u5220\u9664\u2026":"Deleting\u2026",\u786E\u8BA4\u5220\u9664:"Delete target","\u6295\u9012\u76EE\u6807\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Delivery target settings are unavailable.","\u65E0\u6CD5\u8BFB\u53D6\u6295\u9012\u76EE\u6807\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load delivery targets. Try again later.","\u2190 \u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868":"\u2190 Back to bots",\u4F7F\u7528\u6587\u6863:"User guide",\u6253\u5F00\u4E3B\u52A8\u6295\u9012\u4F7F\u7528\u6587\u6863:"Open the proactive delivery guide","\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u6295\u9012\u76EE\u6807\u3002":"Delivery targets are not supported for this channel.","\u5DF2\u590D\u5236 Bot ID":"Bot ID copied",\u590D\u5236:"Copy",\u6295\u9012\u76EE\u6807:"Delivery targets","\u673A\u5668\u4EBA\u5F53\u524D\u79BB\u7EBF\uFF1B\u4ECD\u53EF\u914D\u7F6E\u76EE\u6807\uFF0C\u6062\u590D\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5\u3002":"The bot is offline. You can still configure targets and test them after reconnection.",\u65B0\u5EFA\u76EE\u6807:"New target","\u6B63\u5728\u8BFB\u53D6\u6295\u9012\u76EE\u6807\u2026":"Loading delivery targets\u2026",\u5C1A\u672A\u914D\u7F6E\u6295\u9012\u76EE\u6807:"No delivery targets yet","\u70B9\u51FB\u201C\u65B0\u5EFA\u76EE\u6807\u201D\u53EF\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9\uFF0C\u4E5F\u53EF\u624B\u52A8\u586B\u5199\u3002":"Select New target to choose a conversation or enter the details manually."});var dlA=Object.freeze(Object.fromEntries(Object.keys(_ve).map(n=>[n,n==="$locale"?"zh":n])));var hlA=Object.freeze(["aria-label","alt","placeholder","title"]);var Tve=Object.freeze({defaultId:"",items:Object.freeze([])}),BlA=qd.createContext(Tve);var kP="/feishu",g5=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",beginCallbackRepair:"bot.callback-repair.begin",beginGroupMessagePermission:"bot.group-message-permission.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete",setWorkspace:"bot.workspace.set",setAgentPreset:"bot.preset.set",setContextEnhancement:"bot.context-enhancement.set",setAccessPolicy:"bot.access-policy.set",setGroupResponseMode:"bot.group-response-mode.set",testConnection:"connection.test",disconnect:"connection.disconnect"}),MlA=Object.freeze({PROVISION:"provision",CALLBACK_REPAIR:"callback_repair",GROUP_MESSAGE_PERMISSION:"group_message_permission"});var Dt=Object.freeze({...g5,setAccessPolicy:Va});var ul=Object.freeze({reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete"}),d5=Object.freeze([...new Set([...Object.values(Dt),...Object.values(ul)])]),Rve=new Set(["idle","starting","qr_ready","polling","slow_down","domain_switched","saving","succeeded","expired","cancelled","error"]),kve=new Set(["provision","callback_repair","group_message_permission"]),h5="callback_repair",PP="group_message_permission",kS=new Set([h5,PP]),vve=new Set(["accounts.feishu.cn","accounts.larksuite.com","open.feishu.cn","open.larksuite.com"]),Pve=/^[A-Za-z0-9_-]{1,128}$/,Gve=/^cli_[A-Za-z0-9_-]+$/,c5=Object.freeze({abort:"Registration was cancelled.",access_denied:"Registration was denied.",expired_token:"The registration QR code expired.",invalid_credentials:"Feishu returned invalid app credentials.",credentials_callback_failed:"Unable to activate the Feishu connection.",registration_failed:"Unable to register the Feishu app.",connection_failed:"The bot was created, but its connection could not be started.",credential_removal_failed:"Unable to remove the Feishu credentials.",state_cleanup_failed:"Unable to remove the bot session data. Please retry.",deletion_pending:"Bot deletion is incomplete. Retry removal to finish cleanup.",missing_credentials:"The bot credentials are missing. Delete it and scan again.",repair_app_mismatch:"The authorized Feishu app does not match the selected bot.",repair_owner_missing:"Feishu did not return the authorizing account identity.",repair_domain_mismatch:"The authorized Feishu tenant does not match the selected bot.",repair_owner_mismatch:"The authorizing Feishu account is not an owner of the selected bot.",repair_credentials_invalid:"Feishu returned credentials that could not be verified for the selected bot.",repair_bot_mismatch:"The verified Feishu bot does not match the selected bot.",repair_target_changed:"The selected bot changed while repair was in progress. Start the repair again.",credential_update_failed:"Unable to store the repaired Feishu credentials.",credential_state_unknown:"The repaired Feishu credentials could not be confirmed after saving.",repair_connection_failed:"The callback update was accepted, but the selected bot could not reconnect.",group_message_permission_required:"Authorize access to all group messages before enabling this mode.",group_message_permission_save_failed:"Feishu granted the permission, but all-message mode could not be saved.",group_message_permission_connection_failed:"Feishu granted the permission, but the selected bot could not reconnect.",card_action_probe_unavailable:"The selected bot is not connected, so its card button cannot be verified.",card_action_probe_send_failed:"The callback update was accepted, but the verification card could not be sent.",card_action_probe_timeout:"Feishu accepted the update, but the card button was not verified in time. Start the repair again and click the test button within two minutes.",card_action_probe_failed:"Feishu accepted the update, but the card button verification failed."}),Fve=Object.freeze({idle:"pending",starting:"pending",qr_ready:"pending",polling:"pending",slow_down:"pending",domain_switched:"pending",saving:"connecting",succeeded:"connected",expired:"expired",cancelled:"failed",error:"failed"});function Lve(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}function jo(n,t){return Lve(n)&&Reflect.ownKeys(n).every(o=>typeof o=="string"&&t.has(o))}function Gu(n){return Number.isFinite(n)?n:void 0}function _n(n){return typeof n=="string"&&Pve.test(n)}function I5(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function FP(n){if(!n||typeof n!="object")return null;let t=typeof n.code=="string"&&Object.hasOwn(c5,n.code)?n.code:"registration_failed";return{code:t,message:c5[t]}}function ys(n){if(!n||typeof n!="object")return{state:"idle",attempt:0};let t=Rve.has(n.state)?n.state:"error",o=_n(n.attempt)?n.attempt:Gu(n.attempt)??0,i={state:t,attempt:o};i.operation=kve.has(n.operation)?n.operation:"provision";let e=Gu(n.updatedAt),a=Gu(n.expiresAt),A=Gu(n.remainingSeconds),r=Gu(n.pollIntervalSeconds);e!==void 0&&(i.updatedAt=e),typeof n.qrCodeUrl=="string"&&n.qrCodeUrl.length>0&&(i.qrCodeUrl=n.qrCodeUrl),a!==void 0&&(i.expiresAt=a),A!==void 0&&(i.remainingSeconds=A),r!==void 0&&(i.pollIntervalSeconds=r),_n(n.botId)&&(i.botId=n.botId);let s=FP(n.error);return s&&(i.error=s),i}function Uve(n,t,o){if(!(typeof n!="string"||n.length===0))try{let i=new URL(n);if(i.protocol!=="https:"||!vve.has(i.hostname)||i.port||i.username||i.password)return;if(kS.has(t)){let e=i.searchParams.getAll("clientID"),a=i.searchParams.getAll("tp"),A=i.searchParams.getAll("addons"),r=[...i.searchParams.values()].some(s=>s.includes("{{")||s.includes("}}"));if(e.length!==1||a.length!==1||a[0]!=="sdk"||!Gve.test(e[0]??"")||i.hostname!==o||i.searchParams.has("createOnly")||A.length!==1||!A[0]?.trim()||r)return}return i.toString()}catch{return}}function vS(n){let t=n&&typeof n=="object"?n:{};return{connected:t.connected===!0||t.ready===!0&&t.feishuLongConnectionState==="connected"&&t.harnessReachable===!0,ready:t.ready===!0,harnessReachable:t.harnessReachable===!0}}function E5(n){let t=n&&typeof n=="object"?n:{},o={name:typeof t.name=="string"&&t.name.length>0?t.name:"\u98DE\u4E66\u673A\u5668\u4EBA"};return typeof t.avatarUrl=="string"&&(o.avatarUrl=t.avatarUrl),typeof t.appIdMasked=="string"&&(o.appIdMasked=t.appIdMasked),typeof t.tenantName=="string"&&(o.tenantName=t.tenantName),(t.domain==="feishu"||t.domain==="lark")&&(o.domain=t.domain),(typeof t.activated=="boolean"||typeof t.activated=="number")&&(o.activated=t.activated),o}function C5(n,t){return t?{status:"healthy",summary:"\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38",lastCheckedAt:Date.now()}:n?.configured===!0?{status:"offline",summary:"\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",lastCheckedAt:Date.now()}:{status:"offline",summary:"\u5C1A\u672A\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA",lastCheckedAt:Date.now()}}function u5(n,t,o){return o?"connected":n?.phase==="error"||t.state==="error"?"error":n?.phase==="connecting"||t.state==="saving"?"connecting":n?.phase==="registering"||["starting","qr_ready","polling","slow_down","domain_switched"].includes(t.state)?"provisioning":"disconnected"}async function B5(n){return Nve.toDataURL(n,{errorCorrectionLevel:"M",margin:1,width:320,type:"image/png"})}async function Hve(n,t,o){let i=Uve(n.qrCodeUrl,n.operation,o),e={attemptId:String(n.attempt),operation:n.operation,...n.botId?{botId:n.botId}:{},expiresAt:n.expiresAt??Date.now()+5*6e4,pollIntervalMs:Math.max(800,Math.min(1e4,(n.pollIntervalSeconds??1.8)*1e3))};if(i)return{...e,verificationUrl:i,qrCodeDataUrl:await t(i)};if(n.state==="saving"&&kS.has(n.operation)&&n.botId)return{...e,submitted:!0}}function Kve(n){let t=n&&typeof n=="object"?n:{};if(!_n(t.botId))return null;let o=vS(t.connection),i=t.connected===!0||o.connected,e={state:"idle"},a={botId:t.botId,state:u5(t,e,i),connected:i,configured:t.configured===!0,agentPreset:ng(t.agentPreset),contextEnhancement:Rp(t.contextEnhancement),accessPolicy:Pp(t.accessPolicy),groupResponseMode:Io(t.groupResponseMode),groupMessagePermissionGranted:t.groupMessagePermissionGranted===!0,bot:E5(t.bot),health:C5(t,i)};typeof t.workspace=="string"&&t.workspace&&(a.workspace=t.workspace);let A=Xr(t.lastMessageError);A&&(a.lastMessageError=A);let r=FP(t.error);return r&&(a.error=r),a}async function Qa(n,{encodeQr:t=B5}={}){let o=n&&typeof n=="object"?n:{},i=ys(o.registration),e=vS(o.connection),a=o.connected===!0||e.connected,r=(kS.has(i.operation)&&i.botId&&Array.isArray(o.bots)?o.bots.find(d=>d?.botId===i.botId):void 0)?.bot?.domain==="lark"?"open.larksuite.com":"open.feishu.cn",s=await Hve(i,t,r),g=FP(o.error)??i.error??null,c=Array.isArray(o.bots)?o.bots.map(Kve).filter(Boolean):[],I={schemaVersion:o.schemaVersion===2?2:1,revision:Number.isSafeInteger(o.revision)&&o.revision>=0?o.revision:0,state:u5(o,i,a),connected:a,configured:o.configured===!0,bot:E5(o.bot),health:C5(o,a),bots:c,agentPresetCatalog:$n(o.agentPresetCatalog),totals:{configured:c.length||(o.configured===!0?1:0),connected:c.length?c.filter(d=>d.connected).length:a?1:0}};return s&&(I.provisioning=s),g&&(I.error=g),I}function NS(n){return{ok:!1,error:{code:"bad-request",message:n,details:{issues:[]}}}}function RS(){return{ok:!1,error:{code:"cancelled",message:"The Feishu request was cancelled.",details:{}}}}function xve(){return{ok:!1,error:{code:"internal",message:"The Feishu integration operation failed.",details:{}}}}function Yve(n,t){return n===Dt.status?jo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===Dt.testConnection?jo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===Dt.beginProvisioning?jo(t,new Set(["locale","replaceAttemptId"]))?t.locale!==void 0&&t.locale!=="zh-CN"?"The provisioning locale must be zh-CN.":t.replaceAttemptId!==void 0&&!_n(t.replaceAttemptId)?"replaceAttemptId must be a valid opaque id.":null:"Provisioning accepts locale and replaceAttemptId only.":n===Dt.beginCallbackRepair?jo(t,new Set(["botId"]))&&_n(t.botId)?null:"Callback repair requires a single valid botId.":n===Dt.beginGroupMessagePermission?jo(t,new Set(["botId"]))&&_n(t.botId)?null:"Group message permission update requires a single valid botId.":n===Dt.bindCredentials?jo(t,new Set(["appId","appSecret"]))&&I5(t.appId,256)&&I5(t.appSecret,1024)?null:"Credential binding requires App ID and App Secret.":n===Dt.pollProvisioning||n===Dt.cancelProvisioning?jo(t,new Set(["attemptId"]))&&_n(t.attemptId)?null:"A single valid attemptId is required.":n===Dt.disconnect?jo(t,new Set(["removeCredentials"]))&&t.removeCredentials===!0?null:"Disconnect requires removeCredentials=true.":n===ul.reconnectBot?jo(t,new Set(["botId","sendTest"]))&&_n(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"A valid botId and optional sendTest flag are required.":n===ul.disconnectBot?jo(t,new Set(["botId"]))&&_n(t.botId)?null:"A single valid botId is required.":n===ul.deleteBot?jo(t,new Set(["botId","confirm"]))&&_n(t.botId)&&t.confirm===!0?null:"Deleting a bot requires a valid botId and confirm=true.":n===Dt.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Dt.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Dt.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Dt.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Dt.setGroupResponseMode?jo(t,new Set(["botId","groupResponseMode"]))&&_n(t.botId)&&nS(t.groupResponseMode)?null:"\u8BF7\u9009\u62E9\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u3002":"Unknown Feishu endpoint."}function jve(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new Error("aborted"));return}let e=setTimeout(a,n);e.unref?.();function a(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),i(t.reason??new Error("aborted"))}t?.addEventListener("abort",A,{once:!0})})}async function GP(n,t){return typeof n.registrationStatus=="function"?n.registrationStatus(t):n.status()}async function vP(n,t,o,i){let e=t,a=Date.now()+15e3;for(;;){let A=ys(e?.registration);if(A.qrCodeUrl)return e;if(["error","expired","cancelled"].includes(A.state))throw new Error("Provisioning stopped before the QR code was ready.");if(Date.now()>=a)throw new Error("Provisioning QR code timed out.");if(await jve(50,i),e=await GP(n,o),!e)throw new Error("The provisioning attempt is no longer active.")}}function l5(n,t){return String(ys(n?.registration).attempt)===t}function p5(n){let t=ys(n?.registration);return t.state==="succeeded"?t.botId&&(n?.connected===!0||vS(n?.connection).connected)?"connected":"connecting":Fve[t.state]??"failed"}function Jve(n){if(!n||typeof n.status!="function"||typeof n.startRegistration!="function"||typeof n.cancelRegistration!="function"||typeof n.disconnect!="function")throw new TypeError("A Feishu controller with status/start/cancel/disconnect is required")}function f5(n,{encodeQr:t=B5}={}){Jve(n);let o=new Map,i=new Map,e=a=>{let A=o.get(a);return A||(o.size>=32&&o.delete(o.keys().next().value),A=Promise.resolve().then(()=>t(a)),o.set(a,A)),A};return async(a,A,r)=>{if(r?.aborted)return RS();if(!d5.includes(a))return NS("Unknown Feishu endpoint.");let s=Yve(a,A);if(s)return NS(s);try{let g;if(a===Dt.status)g=await Qa(await n.status(),{encodeQr:e});else if(a===Dt.beginProvisioning){A.replaceAttemptId&&await n.cancelRegistration(A.replaceAttemptId);let c=await n.startRegistration({locale:A.locale}),I=String(ys(c?.registration).attempt),d=await vP(n,c,I,r);if(g=(await Qa(d,{encodeQr:e})).provisioning,!g)throw new Error("Provisioning did not produce a QR code.");i.set(I,g.verificationUrl)}else if(a===Dt.beginCallbackRepair){if(typeof n.startCallbackRepair!="function")throw new Error("Feishu callback repair is unavailable.");let c=await n.startCallbackRepair(A.botId),I=String(ys(c?.registration).attempt),d=await vP(n,c,I,r);if(g=(await Qa(d,{encodeQr:e})).provisioning,!g||g.operation!==h5||g.botId!==A.botId)throw new Error("Callback repair did not produce a safe QR code.");i.set(I,g.verificationUrl)}else if(a===Dt.beginGroupMessagePermission){if(typeof n.startGroupMessagePermission!="function")throw new Error("Feishu group message permission update is unavailable.");let c=await n.startGroupMessagePermission(A.botId),I=String(ys(c?.registration).attempt),d=await vP(n,c,I,r);if(g=(await Qa(d,{encodeQr:e})).provisioning,!g||g.operation!==PP||g.botId!==A.botId)throw new Error("Group message permission update did not produce a safe QR code.");i.set(I,g.verificationUrl)}else if(a===Dt.pollProvisioning){let c=await GP(n,A.attemptId);if(!c||!l5(c,A.attemptId))return NS("The provisioning attempt is no longer active.");let I=ys(c.registration),d=await Qa(c,{encodeQr:e});if(g={status:p5(c),operation:I.operation,...I.botId?{botId:I.botId}:{},...d.provisioning?{provisioning:d.provisioning}:{},...I.botId&&d.connected?{connection:d}:{},...d.error?{message:d.error.message}:{}},["connected","expired","failed"].includes(g.status)){let B=i.get(A.attemptId);B&&o.delete(B),i.delete(A.attemptId)}}else if(a===Dt.cancelProvisioning){let c=await GP(n,A.attemptId);if(!c||!l5(c,A.attemptId))return NS("The provisioning attempt is no longer active.");let I=typeof n.registrationStatus=="function",d=ys(c.registration),B;!I&&d.state==="saving"?B=await n.disconnect():B=await n.cancelRegistration(A.attemptId);let f=ys(B?.registration);if(kS.has(d.operation)&&d.state==="saving"&&["saving","succeeded"].includes(f.state)&&(g={status:p5(B),operation:f.operation,...f.botId?{botId:f.botId}:{},message:d.operation===PP?"The permission update was already submitted and is still being applied.":"Callback repair was already submitted and is still being verified."}),g?.status!=="connecting"){let Q=i.get(A.attemptId);Q&&o.delete(Q),i.delete(A.attemptId),g??={status:"failed",operation:d.operation,...d.botId?{botId:d.botId}:{},message:"Registration was cancelled."}}}else if(a===Dt.bindCredentials){if(typeof n.bindCredentials!="function")throw new Error("Credential binding is unavailable");g=await Qa(await n.bindCredentials(A),{encodeQr:e})}else if(a===Dt.testConnection){let c=await n.status(),d=c?.connected===!0||vS(c?.connection).connected||typeof n.reconnect!="function"?c:await n.reconnect();g=await Qa(d,{encodeQr:e})}else if(a===Dt.disconnect)g=await Qa(await n.disconnect(),{encodeQr:e});else if(a===ul.reconnectBot){if(typeof n.reconnectBot!="function")throw new Error("Multi-bot reconnect is unavailable");let c=await n.reconnectBot(A.botId);if(r?.aborted)return RS();if(g=await Qa(c,{encodeQr:e}),A.sendTest===!0){let I=null;if(!(c?.bots?.some(B=>B?.botId===A.botId&&B.connected===!0)===!0))I=new Error("Feishu bot is not connected"),I.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let B=new Error("Connection test is unavailable");throw B.code="test-target-unavailable",B}await n.sendConnectionTest(A.botId)}catch(B){I=B}g={...g,testMessage:or(I)}}}else if(a===ul.disconnectBot){if(typeof n.disconnectBot!="function")throw new Error("Multi-bot disconnect is unavailable");g=await Qa(await n.disconnectBot(A.botId),{encodeQr:e})}else if(a===Dt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");g=await Qa(await n.updateWorkspace(A.botId,A.workspace),{encodeQr:e})}else if(a===Dt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");g=await n.updateContextEnhancement(A.botId,A.config,c=>Qa(c,{encodeQr:e}))}else if(a===Dt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");g=await n.updateAccessPolicy(A.botId,A.policy,c=>Qa(c,{encodeQr:e}))}else if(a===Dt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");g=await Qa(await n.updateAgentPreset(A.botId,A.agentPreset),{encodeQr:e})}else if(a===Dt.setGroupResponseMode){if(typeof n.updateGroupResponseMode!="function")throw new Error("Group response mode update is unavailable");g=await Qa(await n.updateGroupResponseMode(A.botId,A.groupResponseMode),{encodeQr:e})}else{if(typeof n.deleteBot!="function")throw new Error("Multi-bot delete is unavailable");g=await Qa(await n.deleteBot(A.botId),{encodeQr:e})}return r?.aborted?RS():{ok:!0,value:g}}catch(g){let c=Xa(g);return r?.aborted?RS():c?{ok:!1,error:{...c,details:{}}}:xve()}}}function PS(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(kP,f5(t,o),{authority:fr(i)})}function qve(n,t){if(t?.controller)return t.controller;if(typeof t?.createController=="function")return t.createController();if(typeof t?.createProvisioningManager=="function")return nT(t)}async function Q5(n,t={}){let o=qve(n,t);if(o)return PS(n,o,t.rpcOptions,t.rpcAuthority);let i=await DP(n,t),e=t.deliveryService&&i.deliveryAdapter?t.deliveryService.registerAdapter(i.deliveryAdapter):void 0,a=PS(n,i.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await e?.(),await i.close()},"dsh-feishu: close controller and live connection"),a}import{unlink as jPe}from"node:fs/promises";import{homedir as JPe}from"node:os";import{join as Hu,resolve as yl}from"node:path";import{createHash as zve}from"node:crypto";import{mkdir as Vve,readFile as Wve,rename as Zve,unlink as Xve,writeFile as $ve}from"node:fs/promises";import{dirname as ePe}from"node:path";var LP=Object.freeze({version:1,bots:Object.freeze([])});function vc(n){return typeof n=="string"&&n.trim()?n.trim():null}function y5(n){let t=vc(n);return t&&/^qq_[a-f0-9]{24}$/.test(t)?t:null}function APe(n){let t=vc(n);return t&&/^DSH_QQBOT_APP_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function FS(n){let t=vc(n);if(!t)throw new TypeError("appId is required");let o=zve("sha256").update(t).digest("hex").slice(0,24);return{botId:`qq_${o}`,secretRef:`DSH_QQBOT_APP_SECRET_${o.toUpperCase()}`}}function UP(n){let t=vc(n)??"";return t.length<=10?t?`${t.slice(0,3)}\u2022\u2022\u2022`:w("QQ\u673A\u5668\u4EBA"):`${t.slice(0,6)}\u2022\u2022\u2022\u2022${t.slice(-4)}`}function m5(n){if(!n||typeof n!="object")return null;let t=vc(n.appId),o=vc(n.ownerUserOpenid),i=y5(n.botId),e=APe(n.secretRef);if(!t||!o||!i||!e)return null;let a=FS(t);return a.botId!==i||a.secretRef!==e?null:Object.freeze({botId:i,appId:t,secretRef:e,ownerUserOpenid:o,createdAt:vc(n.createdAt)??new Date().toISOString(),connectedAt:vc(n.connectedAt)})}function tPe(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(m5);if(t.some(a=>a===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.appId)||e.has(a.secretRef))return null;o.add(a.botId),i.add(a.appId),e.add(a.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}var GS=class{#e;#A=LP;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=tPe(JSON.parse(await Wve(this.#e,"utf8")));if(!t)throw new Error("dsh-im QQ config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=LP}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByAppId(t){let o=this.#A.bots.find(i=>i.appId===t);return o?structuredClone(o):null}async save(t){let o=m5(t);if(!o)throw new Error("Refusing to persist incomplete QQ bot data");return this.#r(i=>{let e=i.find(r=>r.appId===o.appId&&r.botId!==o.botId),a=i.find(r=>r.secretRef===o.secretRef&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate QQ bot identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!y5(t))throw new TypeError("Invalid QQ bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await Xve(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=LP});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#l(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#l(t){await Vve(ePe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await $ve(o,`${JSON.stringify(t,null,2)} `,{encoding:"utf8",mode:384}),await Zve(o,this.#e)}};var LS=class extends ur{constructor(t){super({...t,rpcIdPrefix:"qq",logPrefix:"dsh-qq"})}};import{randomUUID as rPe}from"node:crypto";var S5=new Set(["starting","pending","refreshing","connecting"]),Bl=new Set(["connected","failed","cancelled"]),aPe=5*6e4;function fl(n){return typeof n=="string"&&n.trim()?n.trim():null}function Tn(n,t){return Object.freeze({code:n,message:t})}function US(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var Fu=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=null;#p=new Map;#c=0;#g=!1;constructor({qrAuth:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.start!="function")throw new TypeError("QQ QR auth is required");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("QqController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("QqController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#g)return this.status();for(let t of this.#t.list())await this.#f(t.botId,async()=>{if(this.#g||this.#i.get(t.botId)?.status?.ready)return;let o=await this.#u(t.secretRef);if(!o){this.#a.set(t.botId,Tn("missing-secret",w("QQ \u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}try{await this.#h(t,o),this.#a.delete(t.botId)}catch(i){this.#a.set(t.botId,Tn("connection-failed",w("QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:qq] bot ${t.botId} failed to initialize:`,i)}finally{this.#Q()}});return this.status()}async startProvisioning(){if(this.#g)throw new Error("QQ controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t,o,i=new Promise((a,A)=>{t=a,o=A}),e={id:rPe(),state:"starting",createdAt:Date.now(),expiresAt:null,qrRevision:0,verificationUrl:null,controller:new AbortController,dispose:null,task:null,error:null,botId:null};this.#n.set(e.id,e),this.#s=e.id,this.#Q();try{return e.dispose=this.#e.start({onQrDisplayed:a=>{if(e.controller.signal.aborted||Bl.has(e.state))return;let A=fl(a);A&&(e.verificationUrl=A,e.qrRevision+=1,e.expiresAt=Date.now()+aPe,e.state="pending",this.#Q(),t())},onQrExpired:()=>{e.controller.signal.aborted||Bl.has(e.state)||(e.state="refreshing",e.verificationUrl=null,e.expiresAt=null,this.#Q())},onSuccess:a=>{e.controller.signal.aborted||Bl.has(e.state)||(e.task=this.#I(e,a))},onFailure:a=>{e.controller.signal.aborted||Bl.has(e.state)||(e.state="failed",e.error=Tn("qr-connect-failed",w("QQ \u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#s===e.id&&(this.#s=null),this.#Q(),o(a))}},{signal:e.controller.signal}),await i,US(e)}catch(a){throw e.controller.signal.aborted?(e.state="cancelled",e.error=Tn("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):Bl.has(e.state)||(e.state="failed",e.error=Tn("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210 QQ \u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#s===e.id&&(this.#s=null),this.#Q(),a}}registrationStatus(t){return US(this.#n.get(t))}async bindCredentials({appId:t,appSecret:o}={}){if(this.#g)throw new Error("QQ controller is closed");let i=fl(t),e=fl(o);if(!i||!e)throw new TypeError("QQ AppID and AppSecret are required");if(this.#s&&await this.cancelProvisioning(this.#s),this.#g)throw new Error("QQ controller is closed");let a=FS(i);return await this.#f(a.botId,async()=>{if(this.#g)throw new Error("QQ controller is closed");let A=this.#t.getByAppId(i),r=await this.#A.resolve(a.secretRef).catch(()=>{});if(this.#g)throw new Error("QQ controller is closed");let s={botId:a.botId,appId:i,secretRef:a.secretRef,ownerUserOpenid:A?.ownerUserOpenid??"*",createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(a.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#B(a.secretRef,r),g}try{await this.#h(s,e),this.#a.delete(a.botId)}catch(g){this.#a.set(a.botId,Tn("connection-failed",w("QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:qq] bot ${a.botId} credential connection failed:`,g)}this.#Q()}),this.status()}async cancelProvisioning(t){let o=this.#n.get(t);return o?(Bl.has(o.state)||(o.controller.abort(),o.dispose?.(),await o.task?.catch(()=>{}),Bl.has(o.state)||(o.state="cancelled"),o.error??=Tn("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))),this.#s===o.id&&(this.#s=null),this.#Q(),US(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown QQ bot");return await this.#f(t,async()=>{let i=await this.#u(o.secretRef);if(!i)throw new Error("QQ bot secret is missing");try{await this.#h(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,Tn("connection-failed",w("QQ \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#Q()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown QQ bot");return this.#f(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let e=new Error(w("QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return await i.sendConnectionTest(Ra(w("QQ \u673A\u5668\u4EBA\uFF08{appId}\uFF09",{appId:UP(o.appId)}))),{sent:!0}})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown QQ bot");return this.#f(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown QQ bot");return await this.#f(t,async()=>{let i=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#C(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.secretRef,i.value).catch(()=>{}),await this.#h(o,i.value).catch(()=>{})),new Error("Unable to remove the QQ bot safely.",{cause:e})}await this.#l({botId:t,config:o}).catch(e=>{this.#o.warn?.(`[dsh-im:qq] bot ${t} state cleanup failed:`,e)}),this.#a.delete(t),this.#Q()}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#i.get(e.botId)?.status??null,A=a?.ready===!0&&a.qqConnectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.qqConnectionState==="connecting"?"connecting":this.#a.has(e.botId)||a?.qqConnectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("QQ\u673A\u5668\u4EBA"),appIdMasked:UP(e.appId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null,lastConnectedAt:a?.lastConnectedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),error:structuredClone(this.#a.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,i=this.#s?this.#n.get(this.#s):null;return{schemaVersion:1,revision:this.#c,state:i&&S5.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&S5.has(i.state)?{provisioning:US(i)}:{}}}async close(){this.#g||(this.#g=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#C(t))))}async#I(t,o){try{t.state="connecting",t.verificationUrl=null,t.expiresAt=null,this.#Q();let i=Array.isArray(o)?o[0]:null,e=fl(i?.appId),a=fl(i?.appSecret),A=fl(i?.userOpenid);if(!e||!a||!A)throw new Error("QQ authorization returned incomplete credentials");t.botId=await this.#d(t,{appId:e,appSecret:a,ownerUserOpenid:A}),t.state="connected",t.error=null}catch(i){t.controller.signal.aborted?(t.state="cancelled",t.error=Tn("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Tn("activation-failed",w("QQ \u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#o.error?.("[dsh-im:qq] provisioning failed:",i))}finally{t.dispose?.(),this.#s===t.id&&(this.#s=null),this.#Q()}}async#d(t,{appId:o,appSecret:i,ownerUserOpenid:e}){let a=FS(o),A=this.#t.getByAppId(o),r=await this.#A.resolve(a.secretRef).catch(()=>{}),s={botId:a.botId,appId:o,secretRef:a.secretRef,ownerUserOpenid:e,createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};return this.#f(a.botId,async()=>{await this.#A.set(a.secretRef,i);try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#t.save(s)}catch(g){throw await this.#B(a.secretRef,r),g}try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#h(s,i),this.#a.delete(a.botId)}catch(g){if(t.controller.signal.aborted)throw await this.#C(a.botId),A?await this.#t.save(A).catch(()=>{}):await this.#t.remove(a.botId).catch(()=>null)&&await this.#l({botId:a.botId,config:s}).catch(I=>{this.#o.warn?.("[dsh-im:qq] cancelled bot state cleanup failed:",I)}),await this.#B(a.secretRef,r),g;this.#a.set(a.botId,Tn("connection-failed",w("QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:qq] bot ${a.botId} activation connection failed:`,g)}return this.#Q(),a.botId})}async#h(t,o){if(this.#g)throw new Error("QQ controller is closed");if(await this.#C(t.botId),this.#g)throw new Error("QQ controller is closed");let i=await this.#r({botId:t.botId,config:t,appSecret:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError("createRuntime returned an invalid QQ runtime");this.#i.set(t.botId,i);try{await i.start()}catch(e){throw await i.stop().catch(()=>{}),this.#i.delete(t.botId),e}}async#C(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-im:qq] bot ${t} failed to stop cleanly:`,i)})}async#u(t){let o=await this.#A.resolve(t).catch(()=>{});return fl(o?.value)}async#B(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#f(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#Q(){this.#c+=1}};import{QQBot as TPe,contentSanitizer as NPe,typingIndicator as RPe}from"@tencent-connect/qqbot-nodejs";import{ApiError as iPe}from"@tencent-connect/qqbot-nodejs";var w5=4500,oPe=/^( {0,3})(`{3,}|~{3,})(.*)$/,nPe=new Set([40034090]),sPe=Object.freeze({c2c:4,group:5}),gPe=()=>w("\u56DE\u7B54\u8F83\u957F\uFF0C\u540E\u7EED\u5185\u5BB9\u672A\u80FD\u901A\u8FC7 QQ \u5B8C\u6574\u53D1\u9001\uFF0C\u8BF7\u56DE\u590D\u201C\u7EE7\u7EED\u201D\u3002");function KP(n,t){let o=Math.min(t,n.length),i=n.charCodeAt(o-1),e=n.charCodeAt(o);return i>=55296&&i<=56319&&e>=56320&&e<=57343&&(o-=1),Math.max(1,o)}function b5(n){let t=n.endsWith("\r")?n.slice(0,-1):n,o=oPe.exec(t);return!o||o[2][0]==="`"&&o[3].includes("`")?null:{delimiter:o[2],info:o[3],indent:o[1].length}}function cPe(n,t){let o=/^ {0,3}(`{3,}|~{3,})[ \t]*$/.exec(n);return!!(o&&o[1][0]===t.delimiter[0]&&o[1].length>=t.delimiter.length)}function D5(n,t){let o=0;for(let i of n.split(` `)){let e=0;for(;e<3&&i[e]===" ";)e+=1;let a=0;for(;i[e+a]===t;)a+=1;o=Math.max(o,a)}return o}function IPe(n,t){let o="`".repeat(Math.max(3,D5(n,"`")+1)),i="~".repeat(Math.max(3,D5(n,"~")+1));return t.includes("`")?i:o.length<=i.length?o:i}function lPe(n,t){let o=0,i=0,e=t;for(;e>0&&olPe(o,t))}function HP(n,t){if(n.length<=t)return[n];let o=[],i=n;for(;i.length>t;){let e=KP(i,t),a=i.lastIndexOf(` `,e-1);a>=0&&(e=a+1),o.push(i.slice(0,e)),i=i.slice(e)}return(i||o.length===0)&&o.push(i),o}function xP(n,t,o){if(o<8)return HP(n,o).map(A=>({markdown:A,plain:A}));let i=IPe(n,t),e=`${i}${t}`;e.length+i.length+2>=o&&(e=i);let a=o-e.length-i.length-2;return a<1?HP(n,o).map(A=>({markdown:A,plain:A})):HP(n,a).map(A=>({markdown:`${e} @@ -384,8 +384,8 @@ ${s}`,r=[s]):(A=g,r.push(s))}return a.push({markdown:A,plain:a.length===0?A:r.jo ${c}`;d.length>i?(A.length>0&&a.push({markdown:A,plain:A}),A=c):A=d;return}r();let I=c;for(;I.length>i;){let d=KP(I,i),B=I.slice(0,d);a.push({markdown:B,plain:B}),I=I.slice(d)}A=I},g=c=>{let I=c;for(;I.length>i;){r();let d=KP(I,i),B=I.slice(0,d);a.push({markdown:B,plain:B}),I=I.slice(d)}s(I)};for(let c=0;cc.length>0||I.length>0)}function uPe(){let n=Date.now()%1e8,t=Math.floor(Math.random()*65536);return(n^t)%65536}function BPe(n){return n instanceof iPe&&n.httpStatus>=400&&n.httpStatus<500&&nPe.has(Number(n.bizCode))}function O5(n,t,o,i){return typeof n?.send=="function"?n.send({target:t,msgType:0,content:o,extra:{msg_seq:i}}):n.sendText(t,o)}async function _5(n,t,o,{logger:i}={}){let e=CPe(o),a=[],A=uPe(),r=t?.msgId?sPe[t.scope]:null,s=r!==null&&e.length>r,g=s?r-1:e.length,c=t?.msgId?{scope:t.scope,targetId:t.targetId}:t,I=!1,d=async()=>{if(!(I||!t?.msgId)){I=!0;try{a.push(await O5(n,t,gPe(),A+e.length&65535))}catch(B){i?.warn?.("[dsh-im:qq] unable to send partial reply notice:",B)}}};for(let[B,f]of e.entries()){let Q=A+B&65535,y=s&&B>=g?c:t;if(typeof n?.send=="function")try{a.push(await n.send({target:y,msgType:2,markdown:{content:f.markdown},extra:{msg_seq:Q}}));continue}catch(m){if(!BPe(m)){if(i?.warn?.("[dsh-im:qq] markdown delivery outcome is uncertain; refusing a duplicate-prone retry:",m),a.length===0)throw m;await d();break}i?.warn?.("[dsh-im:qq] markdown delivery failed; retrying as plain text:",m)}if(f.plain.length!==0)try{a.push(await O5(n,y,f.plain,Q))}catch(m){if(a.length===0)throw m;await d();break}}return a}function HS(){return w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")}var KS=12e4,fPe=Object.freeze([".myqcloud.com",".qpic.cn",".qq.com",".qq.com.cn",".tencentcos.com",".ugcimg.cn"]),QPe=/\.(?:gif|jpe?g|png|webp)$/i;function yPe(){return[w("QQ \u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` -`)}function mPe(n){return`${n.kind}:${n.kind==="group"?n.groupOpenid:n.senderId}`}function SPe(n,t){return n?.kind==="group"||t==="*"||n?.senderId===t}function Lu(n){return typeof n?.content=="string"?n.content.trim():""}function N5(n){let t=lo(n?.content_type??n?.contentType);return t?t.split(";",1)[0].trim().toLowerCase():null}function jP(n){return N5(n)?.startsWith("image/")===!0||QPe.test(lo(n?.filename)??"")}function qd(n){return Array.isArray(n?.attachments)&&n.attachments.some(jP)}function Ql(n){return Array.isArray(n?.attachments)&&n.attachments.some(t=>!jP(t))}async function wPe(n,{fetchImpl:t,signal:o}){let i=n.startsWith("//")?`https:${n}`:n,e=await t(new URL(i),{method:"GET",signal:o,redirect:"follow"});if(!e?.ok)throw await e?.body?.cancel?.().catch?.(()=>{}),new Error(`QQ file download failed with HTTP ${e?.status??"unknown"}`);return Buffer.from(await e.arrayBuffer())}function T5(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[],i=[];for(let e of n?.attachments??[]){let a=lo(e?.url),A=lo(e?.filename)??void 0,r=N5(e),s=Number(e?.size);if(jP(e)){o.push({...A?{name:A}:{},...r?.startsWith("image/")?{mediaType:r}:{},...Number.isFinite(s)&&s>=0?{size:s}:{},load:({signal:g,maxBytes:c})=>{if(!a)throw new Error("QQ image attachment has no download URL");return Do(a,{fetchImpl:t,signal:g,maxBytes:c,allowedHosts:fPe})}});continue}i.push({name:A??(i.length===0?"file":`file-${i.length+1}`),...r?.includes("/")?{mediaType:r}:{},...Number.isFinite(s)&&s>=0?{size:s}:{},load:({signal:g}={})=>{if(!a)throw new Error("QQ file attachment has no download URL");return wPe(a,{fetchImpl:t,signal:g})}})}return{content:Lu(n),images:o,files:i}}function lo(n){return typeof n=="string"&&n.trim()?n.trim():null}function DPe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");if(t?.name==="UploadDailyLimitExceededError")return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u4ECA\u65E5\u6587\u4EF6\u4E0A\u4F20\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D QQ \u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D QQ \u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0CQQ \u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB QQ \u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7 QQ \u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function OPe(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):n}function R5(n,{dispatched:t=!1}={}){if(n?.code?.startsWith?.("artifact-"))return n;if(n?.name==="UploadDailyLimitExceededError"){let e=new Error("QQ daily file upload limit exceeded",{cause:n});return e.name=n.name,e.code="artifact-rate-limited",e}let o=Number(n?.httpStatus),i=new Error("QQ file delivery failed",{cause:n});return o===401||o===403?i.code="artifact-permission-required":o===413?i.code="artifact-too-large":o===429?i.code="artifact-rate-limited":[400,404,405,406,410,415,422].includes(o)?i.code="artifact-provider-rejected":i.code=t?"artifact-delivery-uncertain":"artifact-provider-failed",i}function JP(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function k5(n,t){return t?(t.throwIfAborted(),new Promise((o,i)=>{let e=!1,a=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>a(i,JP(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>a(o,r),r=>a(i,r)),t.aborted&&A()})):n}async function bPe(n,t,o,{signal:i,timeoutMs:e=KS}={}){if(i?.throwIfAborted(),typeof n?.sendImage!="function"){let a=new Error("QQ image delivery is unavailable");throw a.code="artifact-provider-unavailable",a}try{let a=AbortSignal.timeout(e),A=i?AbortSignal.any([i,a]):a,r=n.sendImage(t,{buffer:o.bytes},{onProgress:()=>i?.throwIfAborted()});return un(o,r),await k5(r,A)}catch(a){throw i?.aborted?JP(i):R5(a,{dispatched:!0})}}async function MPe(n,t,o,{signal:i,timeoutMs:e=KS}={}){if(i?.throwIfAborted(),typeof n?.sendFile!="function"){let a=new Error("QQ file delivery is unavailable");throw a.code="artifact-provider-unavailable",a}try{let a=AbortSignal.timeout(e),A=i?AbortSignal.any([i,a]):a,r=n.sendFile(t,{buffer:o.bytes},{fileName:o.fileName,onProgress:()=>i?.throwIfAborted()});return un(o,r),await k5(r,A)}catch(a){throw i?.aborted?JP(i):R5(a,{dispatched:!0})}}function _Pe(n,t){return t.questions[t.index]&&lo(n?.senderId)===t.actor&&(n.kind!=="group"||n.rawEventType==="GROUP_AT_MESSAGE_CREATE")&&!qd(n)&&!Ql(n)&&lo(Lu(n))}function qP(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,artifactsSent:0,artifactSendErrors:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var xS=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g=new Map;#I=new Map;#d=new Map;#h=new Map;#C=new Set;#u=new Set;#B;#f=new Ti;constructor({bot:t,ownerUserOpenid:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,status:r=qP(),logger:s=console,replyTimeoutMs:g=6e5,signal:c,fetchImpl:I=fetch,fileUploadTimeoutMs:d=KS}){if(!t||typeof t.sendText!="function")throw new TypeError("QQ bot client is required");if(!o)throw new TypeError("QQ scanner identity is required");if(!i||!e)throw new TypeError("Harness client and state store are required");if(typeof I!="function")throw new TypeError("fetchImpl must be a function");if(!Number.isInteger(d)||d<1)throw new TypeError("fileUploadTimeoutMs must be a positive integer");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=Math.min(d,KS),this.#B=new Di({label:"qq",logger:s})}get status(){return structuredClone(this.#i)}accept(t){if(this.#s?.aborted)return Promise.resolve();let o=lo(t?.messageId),i=lo(t?.senderId);if(!o||!i||t?.senderIsBot===!0||!["c2c","group"].includes(t?.kind)||this.#r.hasSeen(o)||this.#h.has(o))return Promise.resolve();let e=mPe(t),a=t.kind!=="group"||t.rawEventType==="GROUP_AT_MESSAGE_CREATE",A=Lu(t);if(a){let d=this.#o?Ba(this.#o,{conversationType:t.kind==="c2c"?"direct":"group",senderIds:i,text:A,hasImages:qd(t),hasFiles:Ql(t)}):SPe(t,this.#A)?{allowed:!0,reason:"legacy-owner"}:{allowed:!1,reason:"sender-not-allowed"};if(!d.allowed)return this.#h.set(o,null),this.#m(t,o,d)}this.#h.set(o,Aa(this.#l,t.kind==="c2c"?"direct":"group")),t.kind==="c2c"&&(this.#A==="*"||i===this.#A)&&t.replyTarget?.scope==="c2c"&&lo(t.replyTarget.targetId)===i&&So(this.#r,t.replyTarget);let r=this.#I.get(e),s=Ni(A),g=this.#f.status(e);if(s&&a&&t.kind==="group")return this.#y(t,o,{message:es()});if(t.kind==="c2c"&&(s||g.phase==="collecting")){let B=/^\/batch$/iu.test(A)&&g.phase==="idle"&&(this.#g.has(e)||r||this.#B.hasPending(e))?{handled:!0,kind:"busy",message:No()}:this.#f.handle(e,A,{plainText:!!A&&!qd(t)&&!Ql(t)});if(B.handled)return B.kind==="submit"?this.#Q({...t,content:B.prompt,attachments:[]},o,e,{batchSubmission:B}):this.#y(t,o,B)}let c=Fa(A)?Ao:Ql(t)?null:ni(A)?Mi:si(A)?to:gi(A)?_i:null;if(c&&a){let d;return d=this.#S(t,o,e,A,c).catch(B=>{if(B?.code==="turn-stopped"||this.#s?.aborted)return;this.#i.lastError=B?.message??String(B);let f=At(this.#i,B);return this.#a.error?.(`[dsh-im:qq] failed to process a command [${f.referenceId}]:`,B),this.#e.sendText(t.replyTarget,dt(f)).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#u.delete(d)}),this.#u.add(d),d}let I=this.#B.claimReply({key:e,actor:i,messageId:o,text:qd(t)||Ql(t)?"":Lu(t),addressed:t.kind!=="group"||t.rawEventType==="GROUP_AT_MESSAGE_CREATE",hasPendingQuestion:!!r,questionCompletion:r?.submitting||r?.claimedReplyMessageId?r.queue:null,isQuestionPending:()=>this.#I.has(e),send:d=>this.#e.sendText(t.replyTarget,d)});if(I){let d;return d=I.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#h.delete(o),this.#C.delete(d)}),this.#C.add(d),d}if(r&&i!==r.actor)return this.#Q(t,o,e);if(r?.submitting||r?.claimedReplyMessageId)return this.#Q(t,o,e);if(r){_Pe(t,r)&&(r.claimedReplyMessageId=o);let B=(r.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#N(t,o,e,r)).catch(f=>this.#F(t,o,f)).finally(()=>{this.#h.delete(o),r.claimedReplyMessageId===o&&(r.claimedReplyMessageId=null),r.queue===B&&(r.queue=null)});return r.queue=B,B}return this.#Q(t,o,e)}#Q(t,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1,batchSubmission:A=null}={}){let s=t.kind!=="group"||t.rawEventType==="GROUP_AT_MESSAGE_CREATE"?Rp(T5(t,{fetchImpl:this.#p}),{signal:this.#s}):void 0,c=(this.#g.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#E(t,i,{alreadyRecorded:a,preparedMessage:s,batchSubmission:A})).finally(()=>{e&&this.#h.delete(o),this.#g.get(i)===c&&this.#g.delete(i)});return this.#g.set(i,c),c}async waitForIdle(){await Promise.allSettled([...this.#g.values(),...[...this.#I.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#C,...this.#u])}async#S(t,o,i,e,a){if(this.#s?.throwIfAborted(),this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString();let A=await a(e,this.#t,this.#r,i,{signal:this.#s,isDirect:t.kind==="c2c",hasImages:qd(t),hasFiles:Ql(t),pendingInteraction:this.#I.has(i)||this.#B.hasPending(i),control:{owner:this,key:i}});A?.stopped&&await Promise.allSettled([this.#k(i),this.#B.closeRoute(i)]);for(let r of A?.messages??[A?.message])r&&await this.#e.sendText(t.replyTarget,r);this.#i.lastError=null}#y(t,o,i){let e;return e=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),i.message&&await this.#e.sendText(t.replyTarget,i.message),this.#i.lastError=null)}).catch(async a=>{if(this.#s?.aborted)return;this.#i.lastError=a?.message??String(a);let A=At(this.#i,a);this.#a.error?.(`[dsh-im:qq] failed to process a batch input message [${A.referenceId}]:`,a),await this.#e.sendText(t.replyTarget,dt(A)).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#u.delete(e)}),this.#u.add(e),e}#m(t,o,i){let e;return e=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),i.reason==="command-not-allowed"?(this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),await this.#e.sendText(t.replyTarget,w(ao)),this.#i.messagesReplied+=1,this.#i.lastReplyAt=new Date().toISOString()):(this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString()),this.#i.lastError=null)}).catch(a=>{this.#s?.aborted||(this.#i.lastError=a?.message??String(a),this.#a.error?.("[dsh-im:qq] failed to apply inbound access policy:",a))}).finally(()=>{this.#h.delete(o),this.#u.delete(e)}),this.#u.add(e),e}async#D(t,o,i=[],e=null){if(i.length===0)return{receipt:e,failureNoticeVisible:!1,artifactSendErrors:0};let a=await vo({artifacts:i,baseReceipt:e,deliveryId:o,aggregatePresentation:e?"qq-text-and-files":"qq-files",alwaysMerge:!0,channelKey:"qq",signal:this.#s,sendImage:A=>bPe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#c}),sendFile:A=>MPe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#c}),onFailure:(A,r)=>At(this.#i,r,{userMessage:DPe(A?.fileName,r),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#e.sendText(t,dt(s)),logger:this.#a});return this.#i.artifactsSent=(this.#i.artifactsSent??0)+a.artifactsSent,this.#i.artifactSendErrors=(this.#i.artifactSendErrors??0)+a.artifactSendErrors,{receipt:a.receipt,failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}}async#E(t,o,{alreadyRecorded:i=!1,preparedMessage:e,batchSubmission:a=null}={}){if(this.#s?.aborted)return;let A=lo(t?.messageId),r=lo(t?.senderId);if(!A||!r||t.senderIsBot===!0||!["c2c","group"].includes(t.kind))return;if(!i){if(this.#r.hasSeen(A))return;this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}let s=i,g=async()=>{s||(await this.#r.markSeen(A),s=!0)};if(t.kind==="group"&&t.rawEventType!=="GROUP_AT_MESSAGE_CREATE")return;let c=t.replyTarget,I=e??T5(t,{fetchImpl:this.#p}),d=I.content,B=Tt(I),f=wt(I),Q=null,y=a===null;try{if(!d&&!B&&!f){await this.#e.sendText(c,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002")),await g();return}let m=d.toLowerCase();if(!B&&!f&&m==="/help"){await this.#e.sendText(c,yPe()),await g();return}if(!B&&!f&&m==="/status"){await this.#t.ensureRunning({signal:this.#s}),await this.#e.sendText(c,w("QQ \u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002")),await g();return}if(!B&&!f&&m==="/new"){await this.#r.clearSession(o),await this.#e.sendText(c,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002")),await g();return}let T=B||f?null:await Mo(d,this.#t,o);if(T){for(let k of T.messages??[T.message])await this.#e.sendText(c,k);await g();return}let _=B||f?null:await bi(d,this.#t,this.#r,o,{signal:this.#s});if(_){await this.#e.sendText(c,_.message),await g();return}let R=B?await Oo(I,{signal:this.#s}):void 0,K=this.#h.get(A);K&&(R=To(R??d,K,()=>({channel:"qq",senderId:r,senderName:t.kind==="group"?t.senderName:void 0})));let L=[],F,q=[];try{await g(),{answer:F,artifacts:q=[]}=await Oi({harness:this.#t,state:this.#r,key:o,...R!==void 0?{content:R}:{text:d},createOptions:{signal:this.#s},existsOptions:{signal:this.#s},askOptions:{timeoutMs:this.#n,signal:this.#s,control:{owner:this,key:o},progressMode:"all",onUpdate:k=>{if(k.error){let z=(lo(k.toolName)??w("\u5DE5\u5177")).replace(/[\r\n]+/gu," ").slice(0,80);L.push(w("\u5DE5\u5177\u8C03\u7528\u300C{name}\u300D\u672A\u6210\u529F\uFF0C\u8BF7\u68C0\u67E5\u5DE5\u5177\u914D\u7F6E\u6216\u7A0D\u540E\u91CD\u8BD5\u3002",{name:z}))}},onInteraction:k=>this.#T(k,{key:o,actor:r,target:c,requiresMention:t.kind==="group"}),onInteractionResolved:k=>this.#O(k),files:I.files}}),a&&(this.#f.complete(o,a.token),y=!0)}finally{await Promise.allSettled([this.#k(o),this.#B.closeRoute(o)])}this.#s?.throwIfAborted();let V=OPe(F,q),x=L.length>0?`${V} +`);f.length<=i?s(f):(r(),a.push(...EPe(B,i))),c=d;continue}g(e[c]),c+=1}return r(),a.filter(({markdown:c,plain:I})=>c.length>0||I.length>0)}function uPe(){let n=Date.now()%1e8,t=Math.floor(Math.random()*65536);return(n^t)%65536}function BPe(n){return n instanceof iPe&&n.httpStatus>=400&&n.httpStatus<500&&nPe.has(Number(n.bizCode))}function O5(n,t,o,i){return typeof n?.send=="function"?n.send({target:t,msgType:0,content:o,extra:{msg_seq:i}}):n.sendText(t,o)}async function _5(n,t,o,{logger:i}={}){let e=CPe(o),a=[],A=uPe(),r=t?.msgId?sPe[t.scope]:null,s=r!==null&&e.length>r,g=s?r-1:e.length,c=t?.msgId?{scope:t.scope,targetId:t.targetId}:t,I=!1,d=async()=>{if(!(I||!t?.msgId)){I=!0;try{a.push(await O5(n,t,gPe(),A+e.length&65535))}catch(B){i?.warn?.("[dsh-im:qq] unable to send partial reply notice:",B)}}};for(let[B,f]of e.entries()){let Q=A+B&65535,y=s&&B>=g?c:t;if(typeof n?.send=="function")try{a.push(await n.send({target:y,msgType:2,markdown:{content:f.markdown},extra:{msg_seq:Q}}));continue}catch(m){if(!BPe(m)){if(i?.warn?.("[dsh-im:qq] markdown delivery outcome is uncertain; refusing a duplicate-prone retry:",m),a.length===0)throw m;await d();break}i?.warn?.("[dsh-im:qq] markdown delivery failed; retrying as plain text:",m)}if(f.plain.length!==0)try{a.push(await O5(n,y,f.plain,Q))}catch(m){if(a.length===0)throw m;await d();break}}return a}function HS(){return w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")}var KS=12e4,fPe=Object.freeze([".myqcloud.com",".qpic.cn",".qq.com",".qq.com.cn",".tencentcos.com",".ugcimg.cn"]),QPe=/\.(?:gif|jpe?g|png|webp)$/i;function yPe(){return[w("QQ \u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` +`)}function mPe(n){return`${n.kind}:${n.kind==="group"?n.groupOpenid:n.senderId}`}function SPe(n,t){return n?.kind==="group"||t==="*"||n?.senderId===t}function Lu(n){return typeof n?.content=="string"?n.content.trim():""}function N5(n){let t=lo(n?.content_type??n?.contentType);return t?t.split(";",1)[0].trim().toLowerCase():null}function jP(n){return N5(n)?.startsWith("image/")===!0||QPe.test(lo(n?.filename)??"")}function zd(n){return Array.isArray(n?.attachments)&&n.attachments.some(jP)}function Ql(n){return Array.isArray(n?.attachments)&&n.attachments.some(t=>!jP(t))}async function wPe(n,{fetchImpl:t,signal:o}){let i=n.startsWith("//")?`https:${n}`:n,e=await t(new URL(i),{method:"GET",signal:o,redirect:"follow"});if(!e?.ok)throw await e?.body?.cancel?.().catch?.(()=>{}),new Error(`QQ file download failed with HTTP ${e?.status??"unknown"}`);return Buffer.from(await e.arrayBuffer())}function T5(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[],i=[];for(let e of n?.attachments??[]){let a=lo(e?.url),A=lo(e?.filename)??void 0,r=N5(e),s=Number(e?.size);if(jP(e)){o.push({...A?{name:A}:{},...r?.startsWith("image/")?{mediaType:r}:{},...Number.isFinite(s)&&s>=0?{size:s}:{},load:({signal:g,maxBytes:c})=>{if(!a)throw new Error("QQ image attachment has no download URL");return Do(a,{fetchImpl:t,signal:g,maxBytes:c,allowedHosts:fPe})}});continue}i.push({name:A??(i.length===0?"file":`file-${i.length+1}`),...r?.includes("/")?{mediaType:r}:{},...Number.isFinite(s)&&s>=0?{size:s}:{},load:({signal:g}={})=>{if(!a)throw new Error("QQ file attachment has no download URL");return wPe(a,{fetchImpl:t,signal:g})}})}return{content:Lu(n),images:o,files:i}}function lo(n){return typeof n=="string"&&n.trim()?n.trim():null}function DPe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");if(t?.name==="UploadDailyLimitExceededError")return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u4ECA\u65E5\u6587\u4EF6\u4E0A\u4F20\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D QQ \u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D QQ \u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0CQQ \u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB QQ \u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7 QQ \u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function OPe(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):n}function R5(n,{dispatched:t=!1}={}){if(n?.code?.startsWith?.("artifact-"))return n;if(n?.name==="UploadDailyLimitExceededError"){let e=new Error("QQ daily file upload limit exceeded",{cause:n});return e.name=n.name,e.code="artifact-rate-limited",e}let o=Number(n?.httpStatus),i=new Error("QQ file delivery failed",{cause:n});return o===401||o===403?i.code="artifact-permission-required":o===413?i.code="artifact-too-large":o===429?i.code="artifact-rate-limited":[400,404,405,406,410,415,422].includes(o)?i.code="artifact-provider-rejected":i.code=t?"artifact-delivery-uncertain":"artifact-provider-failed",i}function JP(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function k5(n,t){return t?(t.throwIfAborted(),new Promise((o,i)=>{let e=!1,a=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>a(i,JP(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>a(o,r),r=>a(i,r)),t.aborted&&A()})):n}async function bPe(n,t,o,{signal:i,timeoutMs:e=KS}={}){if(i?.throwIfAborted(),typeof n?.sendImage!="function"){let a=new Error("QQ image delivery is unavailable");throw a.code="artifact-provider-unavailable",a}try{let a=AbortSignal.timeout(e),A=i?AbortSignal.any([i,a]):a,r=n.sendImage(t,{buffer:o.bytes},{onProgress:()=>i?.throwIfAborted()});return un(o,r),await k5(r,A)}catch(a){throw i?.aborted?JP(i):R5(a,{dispatched:!0})}}async function MPe(n,t,o,{signal:i,timeoutMs:e=KS}={}){if(i?.throwIfAborted(),typeof n?.sendFile!="function"){let a=new Error("QQ file delivery is unavailable");throw a.code="artifact-provider-unavailable",a}try{let a=AbortSignal.timeout(e),A=i?AbortSignal.any([i,a]):a,r=n.sendFile(t,{buffer:o.bytes},{fileName:o.fileName,onProgress:()=>i?.throwIfAborted()});return un(o,r),await k5(r,A)}catch(a){throw i?.aborted?JP(i):R5(a,{dispatched:!0})}}function _Pe(n,t){return t.questions[t.index]&&lo(n?.senderId)===t.actor&&(n.kind!=="group"||n.rawEventType==="GROUP_AT_MESSAGE_CREATE")&&!zd(n)&&!Ql(n)&&lo(Lu(n))}function qP(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,artifactsSent:0,artifactSendErrors:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var xS=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g=new Map;#I=new Map;#d=new Map;#h=new Map;#C=new Set;#u=new Set;#B;#f=new Ti;constructor({bot:t,ownerUserOpenid:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,status:r=qP(),logger:s=console,replyTimeoutMs:g=6e5,signal:c,fetchImpl:I=fetch,fileUploadTimeoutMs:d=KS}){if(!t||typeof t.sendText!="function")throw new TypeError("QQ bot client is required");if(!o)throw new TypeError("QQ scanner identity is required");if(!i||!e)throw new TypeError("Harness client and state store are required");if(typeof I!="function")throw new TypeError("fetchImpl must be a function");if(!Number.isInteger(d)||d<1)throw new TypeError("fileUploadTimeoutMs must be a positive integer");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=Math.min(d,KS),this.#B=new Di({label:"qq",logger:s})}get status(){return structuredClone(this.#i)}accept(t){if(this.#s?.aborted)return Promise.resolve();let o=lo(t?.messageId),i=lo(t?.senderId);if(!o||!i||t?.senderIsBot===!0||!["c2c","group"].includes(t?.kind)||this.#r.hasSeen(o)||this.#h.has(o))return Promise.resolve();let e=mPe(t),a=t.kind!=="group"||t.rawEventType==="GROUP_AT_MESSAGE_CREATE",A=Lu(t);if(a){let d=this.#o?Ba(this.#o,{conversationType:t.kind==="c2c"?"direct":"group",senderIds:i,text:A,hasImages:zd(t),hasFiles:Ql(t)}):SPe(t,this.#A)?{allowed:!0,reason:"legacy-owner"}:{allowed:!1,reason:"sender-not-allowed"};if(!d.allowed)return this.#h.set(o,null),this.#m(t,o,d)}this.#h.set(o,Aa(this.#l,t.kind==="c2c"?"direct":"group")),t.kind==="c2c"&&(this.#A==="*"||i===this.#A)&&t.replyTarget?.scope==="c2c"&&lo(t.replyTarget.targetId)===i&&So(this.#r,t.replyTarget);let r=this.#I.get(e),s=Ni(A),g=this.#f.status(e);if(s&&a&&t.kind==="group")return this.#y(t,o,{message:es()});if(t.kind==="c2c"&&(s||g.phase==="collecting")){let B=/^\/batch$/iu.test(A)&&g.phase==="idle"&&(this.#g.has(e)||r||this.#B.hasPending(e))?{handled:!0,kind:"busy",message:No()}:this.#f.handle(e,A,{plainText:!!A&&!zd(t)&&!Ql(t)});if(B.handled)return B.kind==="submit"?this.#Q({...t,content:B.prompt,attachments:[]},o,e,{batchSubmission:B}):this.#y(t,o,B)}let c=Fa(A)?Ao:Ql(t)?null:ni(A)?Mi:si(A)?to:gi(A)?_i:null;if(c&&a){let d;return d=this.#S(t,o,e,A,c).catch(B=>{if(B?.code==="turn-stopped"||this.#s?.aborted)return;this.#i.lastError=B?.message??String(B);let f=At(this.#i,B);return this.#a.error?.(`[dsh-im:qq] failed to process a command [${f.referenceId}]:`,B),this.#e.sendText(t.replyTarget,dt(f)).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#u.delete(d)}),this.#u.add(d),d}let I=this.#B.claimReply({key:e,actor:i,messageId:o,text:zd(t)||Ql(t)?"":Lu(t),addressed:t.kind!=="group"||t.rawEventType==="GROUP_AT_MESSAGE_CREATE",hasPendingQuestion:!!r,questionCompletion:r?.submitting||r?.claimedReplyMessageId?r.queue:null,isQuestionPending:()=>this.#I.has(e),send:d=>this.#e.sendText(t.replyTarget,d)});if(I){let d;return d=I.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#h.delete(o),this.#C.delete(d)}),this.#C.add(d),d}if(r&&i!==r.actor)return this.#Q(t,o,e);if(r?.submitting||r?.claimedReplyMessageId)return this.#Q(t,o,e);if(r){_Pe(t,r)&&(r.claimedReplyMessageId=o);let B=(r.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#N(t,o,e,r)).catch(f=>this.#F(t,o,f)).finally(()=>{this.#h.delete(o),r.claimedReplyMessageId===o&&(r.claimedReplyMessageId=null),r.queue===B&&(r.queue=null)});return r.queue=B,B}return this.#Q(t,o,e)}#Q(t,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1,batchSubmission:A=null}={}){let s=t.kind!=="group"||t.rawEventType==="GROUP_AT_MESSAGE_CREATE"?kp(T5(t,{fetchImpl:this.#p}),{signal:this.#s}):void 0,c=(this.#g.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#E(t,i,{alreadyRecorded:a,preparedMessage:s,batchSubmission:A})).finally(()=>{e&&this.#h.delete(o),this.#g.get(i)===c&&this.#g.delete(i)});return this.#g.set(i,c),c}async waitForIdle(){await Promise.allSettled([...this.#g.values(),...[...this.#I.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#C,...this.#u])}async#S(t,o,i,e,a){if(this.#s?.throwIfAborted(),this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString();let A=await a(e,this.#t,this.#r,i,{signal:this.#s,isDirect:t.kind==="c2c",hasImages:zd(t),hasFiles:Ql(t),pendingInteraction:this.#I.has(i)||this.#B.hasPending(i),control:{owner:this,key:i}});A?.stopped&&await Promise.allSettled([this.#k(i),this.#B.closeRoute(i)]);for(let r of A?.messages??[A?.message])r&&await this.#e.sendText(t.replyTarget,r);this.#i.lastError=null}#y(t,o,i){let e;return e=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),i.message&&await this.#e.sendText(t.replyTarget,i.message),this.#i.lastError=null)}).catch(async a=>{if(this.#s?.aborted)return;this.#i.lastError=a?.message??String(a);let A=At(this.#i,a);this.#a.error?.(`[dsh-im:qq] failed to process a batch input message [${A.referenceId}]:`,a),await this.#e.sendText(t.replyTarget,dt(A)).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#u.delete(e)}),this.#u.add(e),e}#m(t,o,i){let e;return e=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),i.reason==="command-not-allowed"?(this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),await this.#e.sendText(t.replyTarget,w(ao)),this.#i.messagesReplied+=1,this.#i.lastReplyAt=new Date().toISOString()):(this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString()),this.#i.lastError=null)}).catch(a=>{this.#s?.aborted||(this.#i.lastError=a?.message??String(a),this.#a.error?.("[dsh-im:qq] failed to apply inbound access policy:",a))}).finally(()=>{this.#h.delete(o),this.#u.delete(e)}),this.#u.add(e),e}async#D(t,o,i=[],e=null){if(i.length===0)return{receipt:e,failureNoticeVisible:!1,artifactSendErrors:0};let a=await vo({artifacts:i,baseReceipt:e,deliveryId:o,aggregatePresentation:e?"qq-text-and-files":"qq-files",alwaysMerge:!0,channelKey:"qq",signal:this.#s,sendImage:A=>bPe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#c}),sendFile:A=>MPe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#c}),onFailure:(A,r)=>At(this.#i,r,{userMessage:DPe(A?.fileName,r),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#e.sendText(t,dt(s)),logger:this.#a});return this.#i.artifactsSent=(this.#i.artifactsSent??0)+a.artifactsSent,this.#i.artifactSendErrors=(this.#i.artifactSendErrors??0)+a.artifactSendErrors,{receipt:a.receipt,failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}}async#E(t,o,{alreadyRecorded:i=!1,preparedMessage:e,batchSubmission:a=null}={}){if(this.#s?.aborted)return;let A=lo(t?.messageId),r=lo(t?.senderId);if(!A||!r||t.senderIsBot===!0||!["c2c","group"].includes(t.kind))return;if(!i){if(this.#r.hasSeen(A))return;this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}let s=i,g=async()=>{s||(await this.#r.markSeen(A),s=!0)};if(t.kind==="group"&&t.rawEventType!=="GROUP_AT_MESSAGE_CREATE")return;let c=t.replyTarget,I=e??T5(t,{fetchImpl:this.#p}),d=I.content,B=Tt(I),f=wt(I),Q=null,y=a===null;try{if(!d&&!B&&!f){await this.#e.sendText(c,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002")),await g();return}let m=d.toLowerCase();if(!B&&!f&&m==="/help"){await this.#e.sendText(c,yPe()),await g();return}if(!B&&!f&&m==="/status"){await this.#t.ensureRunning({signal:this.#s}),await this.#e.sendText(c,w("QQ \u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002")),await g();return}if(!B&&!f&&m==="/new"){await this.#r.clearSession(o),await this.#e.sendText(c,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002")),await g();return}let T=B||f?null:await Mo(d,this.#t,o);if(T){for(let k of T.messages??[T.message])await this.#e.sendText(c,k);await g();return}let _=B||f?null:await bi(d,this.#t,this.#r,o,{signal:this.#s});if(_){await this.#e.sendText(c,_.message),await g();return}let R=B?await Oo(I,{signal:this.#s}):void 0,K=this.#h.get(A);K&&(R=To(R??d,K,()=>({channel:"qq",senderId:r,senderName:t.kind==="group"?t.senderName:void 0})));let L=[],F,q=[];try{await g(),{answer:F,artifacts:q=[]}=await Oi({harness:this.#t,state:this.#r,key:o,...R!==void 0?{content:R}:{text:d},createOptions:{signal:this.#s},existsOptions:{signal:this.#s},askOptions:{timeoutMs:this.#n,signal:this.#s,control:{owner:this,key:o},progressMode:"all",onUpdate:k=>{if(k.error){let z=(lo(k.toolName)??w("\u5DE5\u5177")).replace(/[\r\n]+/gu," ").slice(0,80);L.push(w("\u5DE5\u5177\u8C03\u7528\u300C{name}\u300D\u672A\u6210\u529F\uFF0C\u8BF7\u68C0\u67E5\u5DE5\u5177\u914D\u7F6E\u6216\u7A0D\u540E\u91CD\u8BD5\u3002",{name:z}))}},onInteraction:k=>this.#T(k,{key:o,actor:r,target:c,requiresMention:t.kind==="group"}),onInteractionResolved:k=>this.#O(k),files:I.files}}),a&&(this.#f.complete(o,a.token),y=!0)}finally{await Promise.allSettled([this.#k(o),this.#B.closeRoute(o)])}this.#s?.throwIfAborted();let V=OPe(F,q),x=L.length>0?`${V} --- @@ -393,31 +393,31 @@ ${L.join(` `)}`:V,G=null,J=null;try{let k=!1;if(Q)try{await Q.update(x),k=!0,G=Zt({deliveryId:A,presentation:"qq-text",providerMessageIds:Ua(Q)});try{await Q.complete()}catch(z){this.#a.warn?.("[dsh-im:qq] QQ stream completion failed after visible final content:",z)}}catch(z){Q.cancel?.(),this.#a.warn?.("[dsh-im:qq] QQ stream update failed; using markdown fallback:",z)}if(!k){let z=await _5(this.#e,c,x,{logger:this.#a});G=Zt({deliveryId:A,presentation:"qq-text",providerMessageIds:z.flatMap(Ae=>Ua(Ae))})}}catch(k){J=ka(k),this.#a.warn?.("[dsh-im:qq] final text delivery failed; continuing with result files:",k)}let U=await this.#D(c,A,q,G),N=U.receipt?.artifacts?.some(({outcome:k})=>k==="sent"||k==="unknown");if(J&&!N&&!U.failureNoticeVisible)throw J;return J&&U.artifactSendErrors===0&&At(this.#i,J),this.#i.messagesReplied+=1,this.#i.lastReplyAt=new Date().toISOString(),this.#i.lastError=null,!J&&U.artifactSendErrors===0&&wo(this.#i),U.receipt}catch(m){let T=null;if(!y&&a&&(m?.code==="turn-stopped"?this.#f.complete(o,a.token):T=this.#f.fail(o,a.token).message??null,y=!0),m?.code==="turn-stopped"){try{Q?.cancel?.()}catch(K){this.#a.warn?.("[dsh-im:qq] unable to cancel a stopped QQ stream:",K)}try{await this.#e.sendText(c,w("\u5DF2\u505C\u6B62\u3002"))}catch(K){this.#a.warn?.("[dsh-im:qq] unable to announce a stopped QQ turn:",K)}await g();return}try{Q?.cancel?.()}catch(K){this.#a.warn?.("[dsh-im:qq] unable to cancel a failed QQ stream:",K)}if(this.#s?.aborted)return;this.#i.lastError=m?.message??String(m);let _=ko(m)??bo(m),R=At(this.#i,m,{userMessage:_,reason:eo(m)?.reason});this.#a.error?.(`[dsh-im:qq] failed to process an inbound message [${R.referenceId}]:`,m);try{let K=dt(R);await this.#e.sendText(c,T?`${K} -${T}`:K),await g()}catch(K){this.#a.error?.("[dsh-im:qq] failed to send the safe error reply:",K)}}}async#N(t,o,i,e){this.#s?.throwIfAborted();let a=this.#I.get(i),A=e.claimedReplyMessageId===o;if(!a||a!==e||a.submitting)return A&&(!a||a!==e)?this.#R(t,o):this.#Q(t,o,i,{releaseMessageId:!1});if(this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),t.kind==="group"&&t.rawEventType!=="GROUP_AT_MESSAGE_CREATE"))return;let r=lo(Lu(t));if(!r||qd(t)||Ql(t)){await this.#e.sendText(t.replyTarget,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"));return}let s=this.#I.get(i);if(!s||s!==e||s.submitting){if(A&&(!s||s!==e)){await this.#e.sendText(t.replyTarget,HS());return}return this.#Q(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(s.target=t.replyTarget,s.needsPresentation){try{await this.#w(s)}catch{this.#i.lastError=w("QQ \u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#a.error?.("[dsh-im:qq] failed to retry an interaction question"),s.interaction.reconnect?.();return}let c=this.#I.get(i);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#e.sendText(t.replyTarget,HS()).catch(()=>{});return}return this.#Q(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let g=s.questions[s.index];if(g){if(s.answers.push(wi(g,r)),s.index+=1,s.index{});return}if(this.#I.get(i)!==s)return;s.submitting=!1,s.answers.pop(),s.index-=1,this.#i.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#a.error?.("[dsh-im:qq] failed to answer a Harness interaction"),await this.#e.sendText(s.target,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#T(t,{key:o,actor:i,target:e,requiresMention:a}){if(t?.kind==="approval")return this.#B.handleRequested(t,{key:o,actor:i,requiresMention:a,send:c=>this.#e.sendText(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#a.warn?.("[dsh-im:qq] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"QQ safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#e.sendText(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002")).catch(()=>{});return}let s=this.#I.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#w(s);return}if(this.#d.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"QQ is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,target:e,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#I.set(o,g),this.#d.set(r,o),await this.#w(g)}async#O(t){if(t?.kind==="approval"){await this.#B.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#d.get(o);i&&this.#G(i,o)}#w(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=this.#e.sendText(t.target,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===i&&(t.presentationPromise=null)});return t.presentationPromise=i,i}async#R(t,o){this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),await this.#e.sendText(t.replyTarget,HS()).catch(()=>{}))}#_(t,o){let i=this.#I.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#I.delete(t),this.#d.delete(i.interactionId),i)}#G(t,o){return this.#_(t,o)!==null}async#k(t){let o=this.#_(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The QQ interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#a.warn?.("[dsh-im:qq] failed to cancel a pending Harness interaction")}}async#F(t,o,i){if(this.#s?.aborted)return;this.#i.lastError=i?.message??String(i);let e=At(this.#i,i);this.#a.error?.(`[dsh-im:qq] failed to process an interaction reply [${e.referenceId}]:`,i),this.#r.hasSeen(o)||await this.#r.markSeen(o).catch(()=>{}),await this.#e.sendText(t.replyTarget,dt(e)).catch(()=>{})}};function kPe(){let n=new Error("QQ WebSocket did not become ready in time");return n.code="connect-timeout",n}function vPe(){return{startedAt:null,ready:!1,qqConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...qP()}}var Uu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=vPe();#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,appSecret:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,createBot:c=d=>new TPe(d),typingMiddleware:I=RPe}){if(!t||!o||!i||!e)throw new TypeError("QqRuntime requires config, app secret, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#c)}async sendConnectionTest(t){if(!this.#c.ready||!this.#g)throw Cr(w("QQ\u673A\u5668\u4EBA"));let o=typeof this.#e.ownerUserOpenid=="string"?this.#e.ownerUserOpenid.trim():"",i=kE(this.#r),e=i?.scope==="c2c"&&typeof i.targetId=="string"?i.targetId.trim():"",a=e?{scope:"c2c",targetId:e}:o&&o!=="*"?{scope:"c2c",targetId:o}:null;if(!a)throw Cr(w("QQ\u673A\u5668\u4EBA"));return await this.#g.sendText(a,t),{sent:!0}}async sendProactiveText(t,o,{signal:i}={}){let e=t?.kind==="user"?typeof t?.route?.userOpenId=="string"?t.route.userOpenId.trim():"":t?.kind==="group"&&typeof t?.route?.groupOpenId=="string"?t.route.groupOpenId.trim():"";if(!e){let a=new TypeError("Invalid QQ proactive delivery target");throw a.code="invalid-target",a}if(!this.#c.ready||!this.#g){let a=new Error("QQ bot is not connected");throw a.code="bot-not-connected",a}return i?.throwIfAborted(),this.#g.sendText({scope:t.kind==="user"?"c2c":"group",targetId:e},o)}async start(){return this.#c.ready&&this.#g?this.status:this.#C?this.#C:(this.#C=this.#u().finally(()=>{this.#C=null}),this.#C)}async#u(){await this.stop(),this.#c.startedAt=new Date().toISOString(),this.#c.qqConnectionState="connecting",this.#c.lastError=null,await this.#t.ensureRunning(),this.#c.harnessReachable=!0;let t={error:(...d)=>this.#i.error?.(...d),warn:(...d)=>this.#i.warn?.(...d),info:(...d)=>this.#i.info?.(...d),debug:()=>{}},o=this.#s({appId:this.#e.appId,appSecret:this.#A,accountId:this.#e.botId,logger:t,transport:"websocket",tokenPrefetch:"sync",markdownSupport:!1});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("QQ bot factory returned an invalid client");let i=new AbortController;this.#d=i,this.#g=o,this.#I=new xS({bot:o,ownerUserOpenid:this.#e.ownerUserOpenid,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#c,logger:this.#i,replyTimeoutMs:this.#a,signal:i.signal}),o.use(NPe({parseFaceTags:!0})),o.use?.(this.#p({keepAlive:!0,predicate:d=>{let B=d?.message;return!B||B.kind==="group"&&B.rawEventType!=="GROUP_AT_MESSAGE_CREATE"?!1:this.#o?Ba(this.#o,{conversationType:B.kind==="c2c"?"direct":"group",senderIds:B.senderId,text:typeof B.content=="string"?B.content.trim():""}).allowed:B.kind==="group"||this.#e.ownerUserOpenid==="*"||B.senderId===this.#e.ownerUserOpenid}}));let e,a,A=new Promise((d,B)=>{e=d,a=B}),r=()=>{let d=Date.now();this.#c.ready=!0,this.#c.qqConnectionState="connected",this.#c.lastCheckedAt=d,this.#c.lastConnectedAt=d,this.#c.lastError=null,e()},s=d=>{this.#c.ready?(this.#c.lastError=d?.message??String(d),this.#i.warn?.(`[dsh-im:qq] bot ${this.#e.botId} connection error:`,d)):a(d)},g=(d,B)=>{let f=this.#I?.accept(B);f&&f.catch(Q=>{i.signal.aborted||this.#i.error?.(`[dsh-im:qq] bot ${this.#e.botId} message handling failed:`,Q)})};o.on("ready",r),o.on("resumed",r),o.on("error",s),o.on("message",g);let c=Promise.resolve().then(()=>o.start(i.signal));this.#h=c,c.catch(d=>{i.signal.aborted||(a(d),this.#c.ready=!1,this.#c.qqConnectionState="failed",this.#c.lastError=d?.message??String(d),this.#i.error?.(`[dsh-im:qq] bot ${this.#e.botId} connection stopped:`,d))});let I;try{return await Promise.race([A,new Promise((d,B)=>{I=setTimeout(()=>B(kPe()),this.#n)})]),this.#c.ready=!0,this.#c.qqConnectionState="connected",this.#c.lastCheckedAt=Date.now(),this.#c.lastConnectedAt=Date.now(),this.status}catch(d){throw this.#c.ready=!1,this.#c.qqConnectionState="failed",this.#c.lastError=d?.message??String(d),await this.stop(),d}finally{clearTimeout(I)}}async stop(){let t=this.#g,o=this.#I,i=this.#h;this.#d?.abort(),this.#d=null,this.#g=null,this.#I=null,this.#h=null;try{t?.stop()}catch(e){this.#i.warn?.(`[dsh-im:qq] bot ${this.#e.botId} failed to stop cleanly:`,e)}return await Promise.race([i?.catch(()=>{})??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),await o?.waitForIdle(),this.#c.ready=!1,this.#c.qqConnectionState="idle",this.status}};import{startQrConnect as PPe}from"@tencent-connect/qqbot-connector";var YS=class{#e;#A;constructor({start:t=PPe,source:o="deepseek-harness"}={}){if(typeof t!="function")throw new TypeError("QQ QR connector is required");this.#e=t,this.#A=o}start(t,{signal:o}={}){if(!t||typeof t.onSuccess!="function"||typeof t.onFailure!="function")throw new TypeError("QQ QR callbacks are required");return this.#e(t,{displayQrCodeToConsole:!1,source:this.#A,signal:o})}};import{mkdir as GPe,readFile as FPe,rename as LPe,unlink as UPe,writeFile as HPe}from"node:fs/promises";import{dirname as KPe}from"node:path";var jS=Object.freeze({version:1,sessions:{},seenMessageIds:[]});function xPe(n){if(!n||typeof n!="object")return structuredClone(jS);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&typeof i=="string"&&i&&(t[o]=i);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[]}}var JS=class{#e;#A=structuredClone(jS);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=xPe(JSON.parse(await FPe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(jS),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await UPe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(jS)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} -`,o=this.#t.then(async()=>{await GPe(KPe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await HPe(i,t,{encoding:"utf8",mode:384}),await LPe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};var v5=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function YPe(n){if(!Array.isArray(n)||n.length===0)return[...v5];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...v5]}var qS=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=YPe(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(iLa(n),B=qPe(t),f=await new e(B.config).load(),Q=yl(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(z=>z.botId)),await Promise.all(T.map(z=>m.ensure(z.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("qq",z)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=o.qrAuth??new g({source:t.qrSource??"deepseek-harness"}),K=new Map,L=z=>yl(B.bots,z,"state.json"),F=async z=>{let Ae=K.get(z);return Ae||(Ae=await new a(L(z)).load(),K.set(z,Ae)),Ae},q=ja(n,o.commandExecutor),{controlExecutor:V,sessionMaintenanceExecutor:x,fileIngressExecutor:G}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),J=new A({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...q?{commandExecutor:q}:{},...V?{controlExecutor:V}:{},...x?{sessionMaintenanceExecutor:x}:{},...G?{fileIngressExecutor:G}:{}}),U=new r({qrAuth:R,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:z,config:Ae,appSecret:ie})=>{let we=await F(z);await m.ensure(z,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("qq",Ae)});let se=Ka(J,{botId:z,workspaces:m,state:we,agentPresetCatalog:d});return new s({config:Ae,appSecret:ie,harness:se.harness,state:se.state,contextEnhancement:{botId:z,getSettings:()=>m.contextEnhancementFor(z)},accessPolicy:qa(m,z,{channel:"qq",config:Ae}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...Te)=>I.error?.(`[${z}]`,...Te),warn:(...Te)=>I.warn?.(`[${z}]`,...Te),info:(...Te)=>I.info?.(`[${z}]`,...Te),debug:(...Te)=>I.debug?.(`[${z}]`,...Te)}})},deleteState:async({botId:z})=>{let Ae=K.get(z);if(K.delete(z),Ae&&typeof Ae.remove=="function")await Ae.remove();else try{await jPe(L(z))}catch(ie){if(ie?.code!=="ENOENT")throw ie}}}),N=xa(U,{workspaces:m,stateFor:F,agentPresetCatalog:d}),k=c({controller:N,harness:J,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:N,deliveryAdapter:Ya({channel:"qq",workspaces:m,coreController:U,stateFor:F}),ready:k.ready,async close(){await k.close(),await N.close(),J.stopManagedProcess()}}}import zPe from"qrcode";var G5="/qq",cr=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),F5=Object.freeze(Object.values(cr)),VPe=new Set(["appSecret","app_secret","secretRef","ownerUserOpenid","userOpenid","verificationUrl"]);function XP(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function zd(n,t){return XP(n)&&Object.keys(n).every(o=>t.includes(o))}function WP(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function P5(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function WPe(n,t){return XP(t)?n===cr.status?zd(t,[])?null:"connection.status does not accept fields.":n===cr.beginProvisioning?zd(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[cr.pollProvisioning,cr.cancelProvisioning].includes(n)?zd(t,["attemptId"])&&WP(t.attemptId)?null:`${n} requires an attemptId.`:n===cr.bindCredentials?zd(t,["appId","appSecret"])&&P5(t.appId,256)&&P5(t.appSecret,1024)?null:"bot.bind-credentials requires AppID and AppSecret.":n===cr.reconnectBot?zd(t,["botId","sendTest"])&&WP(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and accepts only sendTest=true.":n===cr.deleteBot?zd(t,["botId","confirm"])&&WP(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===cr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===cr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===cr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===cr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown QQ endpoint.":"Payload must be an object."}function Vd(n){if(Array.isArray(n))return n.map(Vd);if(!XP(n))return n;let t={};for(let[o,i]of Object.entries(n))VPe.has(o)||(t[o]=Vd(i));return t}async function ZPe(n){return zPe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function ZP(n,t){return!n||typeof n.verificationUrl!="string"?Vd(n):Vd({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Pc(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await ZP(o.provisioning,t)),Vd(o)}function L5(n,{encodeQr:t=ZPe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete QQ controller is required (${e})`);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!F5.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown QQ endpoint."}};let r=WPe(e,a);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===cr.status)s=await Pc(await n.status(),i);else if(e===cr.beginProvisioning)s=await ZP(await n.startProvisioning(),i);else if(e===cr.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await ZP(g,i)}else if(e===cr.cancelProvisioning)s=Vd(await n.cancelProvisioning(a.attemptId));else if(e===cr.bindCredentials)s=await Pc(await n.bindCredentials(a),i);else if(e===cr.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};let c;if(a.sendTest===!0)if(!(g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("QQ\u673A\u5668\u4EBA"));else{let d=null;try{await n.sendConnectionTest(a.botId)}catch(B){d=B}c=or(d)}s=await Pc({...g,...c?{testMessage:c}:{}},i)}else if(e===cr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Pc(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===cr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Pc(g,i))}else if(e===cr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Pc(g,i))}else if(e===cr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Pc(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await Pc(await n.deleteBot(a.botId),i);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"qq-operation-failed",message:"QQ \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function zS(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(G5,L5(t,o),{authority:fr(i)})}async function U5(n,t={}){if(t?.controller)return zS(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await VP(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=zS(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close QQ bot connections"),e}import{unlink as NGe}from"node:fs/promises";import{resolve as X5}from"node:path";import{createHash as XPe}from"node:crypto";import{mkdir as $Pe,readFile as eGe,rename as AGe,unlink as tGe,writeFile as rGe}from"node:fs/promises";import{dirname as aGe}from"node:path";var $P=Object.freeze({version:1,bots:Object.freeze([])}),H5=/^slack_[a-f0-9]{24}$/,iGe=/^DSH_SLACK_BOT_TOKEN_[A-F0-9]{24}$/,oGe=/^DSH_SLACK_APP_TOKEN_[A-F0-9]{24}$/;function Jo(n){return typeof n=="string"&&n.trim()?n.trim():null}function eG(n){let t=Jo(n);if(!t)throw new TypeError("platformId is required");let o=XPe("sha256").update(t).digest("hex").slice(0,24),i=o.toUpperCase();return{botId:`slack_${o}`,botTokenRef:`DSH_SLACK_BOT_TOKEN_${i}`,appTokenRef:`DSH_SLACK_APP_TOKEN_${i}`}}function AG(n){let t=Jo(n)??"",[o,i]=t.split(":");return o&&i?`${o.slice(0,5)}\u2022\u2022\u2022 \xB7 ${i.slice(0,5)}\u2022\u2022\u2022`:t?`${t.slice(0,6)}\u2022\u2022\u2022\u2022`:w("Slack\u673A\u5668\u4EBA")}var VS=class{#e;#A=$P;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#l(JSON.parse(await eGe(this.#e,"utf8")));if(!t)throw new Error("dsh-im Slack config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=$P}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByPlatformId(t){let o=this.#A.bots.find(i=>i.platformId===t);return o?structuredClone(o):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete Slack bot data");return this.#o(i=>{if(i.find(A=>A.botId!==o.botId&&(A.platformId===o.platformId||A.botTokenRef===o.botTokenRef||A.appTokenRef===o.appTokenRef)))throw new Error("Duplicate Slack bot identity");let a=i.findIndex(A=>A.botId===o.botId);return a===-1?i.push(o):i[a]=o,structuredClone(o)})}async remove(t){if(!H5.test(t))throw new TypeError("Invalid Slack bot id");return this.#o(o=>{let i=o.findIndex(e=>e.botId===t);return i===-1?null:structuredClone(o.splice(i,1)[0])})}async clear(){let t=this.#t.then(async()=>{try{await tGe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=$P});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=Jo(t.botId),i=Jo(t.platformId),e=Jo(t.botTokenRef),a=Jo(t.appTokenRef),A=Jo(t.name);if(!o||!i||!e||!a||!A||!H5.test(o)||!iGe.test(e)||!oGe.test(a))return null;let r=eG(i);return r.botId!==o||r.botTokenRef!==e||r.appTokenRef!==a?null:Object.freeze({botId:o,platformId:i,botTokenRef:e,appTokenRef:a,name:A,username:Jo(t.username),teamId:Jo(t.teamId),teamName:Jo(t.teamName),createdAt:Jo(t.createdAt)??new Date().toISOString(),connectedAt:Jo(t.connectedAt)})}#l(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.platformId)||a.has(A.botTokenRef)||a.has(A.appTokenRef))return null;i.add(A.botId),e.add(A.platformId),a.add(A.botTokenRef),a.add(A.appTokenRef)}return Object.freeze({version:1,bots:Object.freeze(o)})}async#o(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await $Pe(aGe(this.#e),{recursive:!0,mode:448});let A=`${this.#e}.tmp`;await rGe(A,`${JSON.stringify(a,null,2)} -`,{encoding:"utf8",mode:384}),await AGe(A,this.#e),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}};var nGe="https://slack.com/api/",Yu="files.slack.com",sGe="slack.com",K5="/files-pri/",gGe=Object.freeze([Yu]),cGe="/upload/",IGe=12e4;function Ss(n){return typeof n=="string"&&n.trim()?n.trim():null}function x5(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function Ku(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function lGe(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function Y5(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),Number.isInteger(t?.status)&&(n.status=t.status),n}function ml(n){let t="artifact-provider-failed",o="Slack file upload preparation failed";n?.code==="slack-file_upload_size_restricted"?(t="artifact-too-large",o="Slack rejected the result file because it is too large"):n?.code==="slack-missing-scope"?(t="artifact-permission-required",o="Slack file delivery requires the files:write scope"):n?.code?.startsWith?.("slack-")&&(t="artifact-provider-rejected",o="Slack rejected file upload preparation");let i=new Error(o,{cause:n});return i.code=t,Y5(i,n)}function pGe(n){let t=new Error("Slack file completion result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",Y5(t,n)}function dGe(n){return Number.isInteger(n)&&n>=300&&n<400}async function tG(n){try{await n?.body?.cancel?.()}catch{}}function hGe(n){let t=new URL(n);if(t.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(t.username||t.password||t.port&&t.port!=="443")throw new Error("Image download URL is not hosted by the messaging platform");if(t.hostname===sGe&&t.pathname.startsWith(K5)&&(t.hostname=Yu),t.hostname!==Yu||!t.pathname.startsWith(K5))throw new Error("Image download URL is not hosted by the messaging platform");return t.hash="",t}function EGe(n){let t=new URL(n);if(t.protocol!=="https:"||t.username||t.password||t.port&&t.port!=="443"||t.hostname!==Yu||!t.pathname.startsWith(cGe))throw new Error("Slack returned an unsafe file upload URL");return t.hash="",t}function CGe(n,t){let o=n?.headers?.get?.("location");if(!o)return null;try{return new URL(o,t)}catch{return null}}function uGe(n){let t=n?.headers?.get?.("x-oauth-scopes");return t==null?null:new Set(t.split(",").map(o=>o.trim()).filter(Boolean))}function BGe(n){return n?.protocol==="https:"&&!n.username&&!n.password&&(!n.port||n.port==="443")&&n.hostname.endsWith(".slack.com")&&n.hostname!==Yu&&n.pathname==="/"&&n.searchParams.has("redir")}function fGe(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Nn(n,t){let o=Ss(n);if(!o||!/^[A-Z][A-Z0-9]{4,30}$/i.test(o))throw new TypeError(`Invalid Slack ${t}`);return o}function ms(n,t){let o=Ss(n);if(!o)throw new TypeError(`Slack ${t} is required`);return o}function xu(n,{trim:t=!0}={}){let o=typeof n=="string"?n:"",i=t?o.trim():o;if(!i)throw new TypeError("Slack message text is required");return i.replace(/<@([A-Z0-9]+)>/gi,"@$1").replace(/]*)?>/gi,"@$1")}function QGe(n,t,o){let i=Ss(t?.error)??"unknown_error",e=new Error(`Slack ${n} failed: ${i.replaceAll("_"," ")}`);return e.providerCode=i,["invalid_auth","not_authed","token_revoked","account_inactive"].includes(i)?e.code=o==="app"?"slack-invalid-app-token":"slack-invalid-bot-token":i==="missing_scope"?e.code="slack-missing-scope":i==="method_not_supported_for_channel_type"||i==="channel_type_not_supported"||i==="deprecated_endpoint"?e.code="slack-stream-unavailable":e.code=`slack-${i}`,e}function j5(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())}function J5(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())}var ju=class{#e;#A;#t;#r;#l=null;#o;constructor({botToken:t,appToken:o,fetchImpl:i=fetch,baseUrl:e=nGe,fileUploadTimeoutMs:a=IGe}){if(t!==void 0&&!j5(t))throw new TypeError("Slack Bot Token is invalid");if(o!==void 0&&!J5(o))throw new TypeError("Slack App Token is invalid");if(!t&&!o)throw new TypeError("SlackApi requires a token");if(typeof i!="function")throw new TypeError("SlackApi requires fetch");this.#e=t?.trim(),this.#A=o?.trim(),this.#t=i,this.#r=new URL(e),this.#o=lGe(a,"fileUploadTimeoutMs")}authTest(t={}){return this.#a("auth.test",{...t,tokenKind:"bot"})}openConnection(t={}){return this.#a("apps.connections.open",{...t,tokenKind:"app",body:void 0})}async fileInfo({fileId:t,signal:o}={}){let i=await this.#a("files.info",{tokenKind:"bot",signal:o,body:{file:Nn(t,"file id")}});if(!i?.file||typeof i.file!="object"||Array.isArray(i.file))throw new Error("Slack files.info returned no file object");return i.file}postMessage({channelId:t,text:o,threadTs:i,signal:e}){return this.#a("chat.postMessage",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),text:xu(o),...i?{thread_ts:Ss(i)}:{},mrkdwn:!0,link_names:!1,unfurl_links:!1,unfurl_media:!1}})}updateMessage({channelId:t,ts:o,text:i,signal:e}){return this.#a("chat.update",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),ts:ms(o,"message timestamp"),text:xu(i),parse:"none",link_names:!1}})}addReaction({channelId:t,messageTs:o,emojiName:i,signal:e,timeoutMs:a}){return this.#a("reactions.add",{tokenKind:"bot",signal:e,timeoutMs:a,retry:!1,body:{channel:Nn(t,"channel id"),timestamp:ms(o,"message timestamp"),name:ms(i,"reaction name")}})}removeReaction({channelId:t,messageTs:o,emojiName:i,signal:e,timeoutMs:a}){return this.#a("reactions.remove",{tokenKind:"bot",signal:e,timeoutMs:a,retry:!1,body:{channel:Nn(t,"channel id"),timestamp:ms(o,"message timestamp"),name:ms(i,"reaction name")}})}startStream({channelId:t,threadTs:o,recipientTeamId:i,recipientUserId:e,markdownText:a,signal:A}){return this.#a("chat.startStream",{tokenKind:"bot",signal:A,body:{channel:Nn(t,"channel id"),thread_ts:ms(o,"thread timestamp"),...i?{recipient_team_id:Nn(i,"team id")}:{},...e?{recipient_user_id:Nn(e,"user id")}:{},...Ss(a)?{markdown_text:xu(a)}:{}}})}appendStream({channelId:t,ts:o,markdownText:i,signal:e}){return this.#a("chat.appendStream",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),ts:ms(o,"stream timestamp"),markdown_text:xu(i,{trim:!1})}})}stopStream({channelId:t,ts:o,markdownText:i,signal:e}){return this.#a("chat.stopStream",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),ts:ms(o,"stream timestamp"),...Ss(i)?{markdown_text:xu(i,{trim:!1})}:{}}})}async uploadFile({channelId:t,threadTs:o,file:i,signal:e}){if(!i||typeof i!="object"||typeof i.fileName!="string"||!i.fileName||!Buffer.isBuffer(i.bytes))throw new TypeError("A Slack file is required");if(e?.aborted)throw Ku(e);let a=x5(e,this.#o),A;try{A=await this.#a("files.getUploadURLExternal",{tokenKind:"bot",signal:a,timeoutMs:this.#o,body:{filename:i.fileName,length:i.bytes.byteLength}})}catch(I){throw e?.aborted?Ku(e):ml(I)}let r,s;try{r=ms(A?.file_id,"file id"),s=EGe(A?.upload_url)}catch(I){throw ml(I)}let g;try{g=await this.#t(s,{method:"POST",headers:{"content-type":i.mediaType??"application/octet-stream"},body:i.bytes,signal:a,redirect:"error"})}catch(I){throw e?.aborted?Ku(e):ml(I)}if(!Number.isInteger(g?.status))throw ml(new Error("Slack file upload returned an invalid response"));if(g.status!==200){await tG(g);let I=new Error(`Slack file upload failed with HTTP ${g.status}`);throw I.status=g.status,g.status===413?I.code="artifact-too-large":g.status===429?I.code="artifact-rate-limited":I.code="artifact-provider-rejected",I}await tG(g);let c;try{c={files:[{id:r,title:i.fileName}],channel_id:Nn(t,"channel id"),...o?{thread_ts:ms(o,"thread timestamp")}:{}}}catch(I){throw ml(I)}if(a.aborted)throw e?.aborted?Ku(e):ml(a.reason);try{let I=await this.#a("files.completeUploadExternal",{tokenKind:"bot",signal:a,timeoutMs:this.#o,retry:!1,body:c});if(!Array.isArray(I?.files)||!I.files.some(d=>Ss(d?.id)===r))throw new Error("Slack file completion did not confirm the uploaded file");return I}catch(I){throw e?.aborted?Ku(e):I?.code==="slack-missing-scope"?ml(I):pGe(I)}}async downloadFile({url:t,signal:o,maxBytes:i}){return this.#i({url:t,signal:o,maxBytes:i,stream:!1})}async downloadFileStream({url:t,signal:o}){return this.#i({url:t,signal:o,stream:!0})}async#i({url:t,signal:o,maxBytes:i,stream:e}){if(!this.#e)throw new TypeError("Slack bot token is required for file download");let a=hGe(t),r={fetchImpl:async(s,g)=>{let c=await this.#t(s,g);if(!dGe(c?.status))return c;let I=CGe(c,s);if(this.#l&&!this.#l.has("files:read")||BGe(I))throw await tG(c),new ut("slack-file-access-required","Slack redirected a private file request to the workspace because file access was not granted",w("Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002"));return c},headers:{authorization:`Bearer ${this.#e}`},signal:o,allowedHosts:gGe};return e?xp(a,r):Do(a,{...r,maxBytes:i})}async#a(t,{tokenKind:o,body:i,signal:e,timeoutMs:a=15e3,retry:A=!0}){let r=o==="app"?this.#A:this.#e;if(!r)throw new TypeError(`Slack ${o} token is required for ${t}`);let s=t==="files.getUploadURLExternal"||t==="files.info",g;try{g=await this.#t(new URL(t,this.#r),{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":i===void 0||s?"application/x-www-form-urlencoded;charset=utf-8":"application/json;charset=utf-8","user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.2.2)"},...i===void 0?{}:{body:s?new URLSearchParams(i).toString():JSON.stringify(i)},signal:x5(e,a),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Slack ${t} transport failed`)}if(o==="bot"){let I=uGe(g);I&&(this.#l=I)}let c;try{c=await g.json()}catch{throw new Error(`Slack ${t} returned invalid JSON`)}if(g.status===429&&A){let I=Number(g.headers.get("retry-after"))||1;return await fGe(Math.min(1e4,Math.max(100,I*1e3)),e),this.#a(t,{tokenKind:o,body:i,signal:e,timeoutMs:a,retry:!1})}if(!g.ok||c?.ok!==!0){let I=QGe(t,c,o);throw I.status=g.status,I}return c}};async function q5({botToken:n,appToken:t},o={}){if(!j5(n)){let r=new TypeError(w("Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002"));throw r.code="slack-invalid-bot-token",r}if(!J5(t)){let r=new TypeError(w("Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002"));throw r.code="slack-invalid-app-token",r}let i=new ju({botToken:n,appToken:t,...o}),[e,a]=await Promise.all([i.authTest(),i.openConnection()]);if(!e?.team_id||!e?.user_id||!e?.bot_id)throw new Error(w("Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002"));let A;try{A=new URL(a?.url)}catch{A=null}if(!A||A.protocol!=="wss:"){let r=new Error(w("Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002"));throw r.code="slack-socket-mode",r}return{platformId:`${e.team_id}:${e.user_id}`,name:Ss(e.user)??"DeepSeek Harness",username:Ss(e.user),teamId:String(e.team_id),teamName:Ss(e.team)}}var rG=Object.freeze({key:"slack",label:"Slack",connectionLabel:" Socket Mode \u957F\u8FDE\u63A5",reactions:Object.freeze({processing:"eyes",success:"white_check_mark",error:"x"})}),WS=class extends ns{constructor(t){super({descriptor:rG,...t})}};function Ng(n){return typeof n=="string"&&n.trim()?n.trim():null}function ZS(n,t){return Object.freeze({code:n,message:t})}var Ju=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=0;#p=!1;constructor({credentials:t,configStore:o,inspectCredentials:i=q5,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.resolve!="function"||typeof t.set!="function"||typeof t.unset!="function")throw new TypeError("Slack requires the DSH credential provider");if(!o||typeof o.list!="function"||typeof o.save!="function"||typeof o.remove!="function")throw new TypeError("Slack requires a config store");if(typeof i!="function"||typeof e!="function")throw new TypeError("Slack controller dependencies are incomplete");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#p)return this.status();for(let t of this.#A.list())await this.#h(t.botId,async()=>{if(this.#p||this.#i.get(t.botId)?.status?.ready)return;let o=await this.#I(t);if(!o){this.#a.set(t.botId,ZS("missing-token",w("Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002")));return}try{await this.#c(t,o),this.#a.delete(t.botId)}catch(i){this.#a.set(t.botId,ZS("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${t.botId} failed to initialize:`,i)}finally{this.#C()}});return this.status()}async bindCredentials({botToken:t,appToken:o}={}){if(this.#p)throw new Error("Slack controller is closed");let i=Ng(t),e=Ng(o);if(!i||!e)throw new TypeError("Slack Bot Token and App Token are required");let a=await this.#t({botToken:i,appToken:e}),A=Ng(a?.platformId),r=Ng(a?.name);if(!A||!r)throw new Error("Slack returned an invalid bot identity");let s=eG(A);return await this.#h(s.botId,async()=>{if(this.#p)throw new Error("Slack controller is closed");let g=this.#A.getByPlatformId(A),c=await this.#e.resolve(s.botTokenRef).catch(()=>{}),I=await this.#e.resolve(s.appTokenRef).catch(()=>{}),d={...s,platformId:A,name:r,username:Ng(a.username),teamId:Ng(a.teamId),teamName:Ng(a.teamName),createdAt:g?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};try{await this.#e.set(s.botTokenRef,i),await this.#e.set(s.appTokenRef,e),await this.#A.save(d)}catch(B){throw await Promise.all([this.#d(s.botTokenRef,c),this.#d(s.appTokenRef,I)]),B}try{await this.#c(d,{botToken:i,appToken:e}),this.#a.delete(s.botId)}catch(B){this.#a.set(s.botId,ZS("connection-failed",w("Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${s.botId} credential connection failed:`,B)}this.#C()}),this.status()}async reconnectBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#h(t,async()=>{let i=await this.#I(o);if(!i)throw new Error("Slack bot credentials are missing");try{await this.#c(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,ZS("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002"))),e}finally{this.#C()}}),this.status()}async sendConnectionTest(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return this.#h(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let e=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return await i.sendConnectionTest(Ra(`${o.name}\uFF08${AG(o.platformId)}\uFF09`,w("Slack\u673A\u5668\u4EBA"))),{sent:!0}})}async sendProactiveText(t,o,i,e={}){if(!this.#A.get(t))throw new Error("Unknown Slack bot");return this.#h(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#h(t,async()=>{let i=await this.#e.resolve(o.botTokenRef).catch(()=>{}),e=await this.#e.resolve(o.appTokenRef).catch(()=>{});await this.#g(t);try{await this.#e.unset(o.botTokenRef),await this.#e.unset(o.appTokenRef),await this.#A.remove(t)}catch(a){throw await Promise.all([this.#d(o.botTokenRef,i),this.#d(o.appTokenRef,e)]),i?.value&&e?.value&&await this.#c(o,{botToken:i.value,appToken:e.value}).catch(()=>{}),new Error("Unable to remove the Slack bot safely.",{cause:a})}await this.#l({botId:t,config:o}).catch(a=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} state cleanup failed:`,a)}),this.#a.delete(t),this.#C()}),this.status()}status(){let t=this.#A.list().map(i=>{let e=this.#i.get(i.botId)?.status??null,a=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=a?"connected":e?.connectionState==="connecting"?"connecting":this.#a.has(i.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:i.botId,state:A,connected:a,configured:!0,bot:{name:i.name,username:i.username,teamName:i.teamName,idMasked:AG(i.platformId)},health:{status:a?"healthy":A==="error"?"error":"offline",summary:a?w(`Slack${rG.connectionLabel}\u8FD0\u884C\u6B63\u5E38`):A==="error"?w("Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:Xr(e?.lastMessageError),error:structuredClone(this.#a.get(i.botId)??null)}}),o=t.filter(i=>i.connected).length;return{schemaVersion:1,revision:this.#s,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#p||(this.#p=!0,await Promise.allSettled([...this.#n.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#g(t))))}async#c(t,{botToken:o,appToken:i}){if(this.#p)throw new Error("Slack controller is closed");if(await this.#g(t.botId),this.#p)throw new Error("Slack controller is closed");let e=await this.#r({botId:t.botId,config:t,botToken:o,appToken:i});if(!e||typeof e.start!="function"||typeof e.stop!="function")throw new TypeError("createRuntime returned an invalid Slack runtime");this.#i.set(t.botId,e);try{await e.start()}catch(a){throw await e.stop().catch(()=>{}),this.#i.delete(t.botId),a}}async#g(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} failed to stop cleanly:`,i)})}async#I(t){let[o,i]=await Promise.all([this.#e.resolve(t.botTokenRef).catch(()=>{}),this.#e.resolve(t.appTokenRef).catch(()=>{})]),e=Ng(o?.value),a=Ng(i?.value);return e&&a?{botToken:e,appToken:a}:null}async#d(t,o){o?.value?await this.#e.set(t,o.value).catch(()=>{}):await this.#e.unset(t).catch(()=>{})}#h(t,o){let a=(this.#n.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#n.get(t)===a&&this.#n.delete(t)});return this.#n.set(t,a),a}#C(){this.#s+=1}};var XS=class extends ur{constructor(t){super({...t,rpcIdPrefix:"slack",logPrefix:"dsh-slack"})}};var z5=Object.freeze([1e3,3e3,5e3,1e4,3e4]),iG=38e3,V5=11e3,Z5=new Set(["image/jpeg","image/png","image/webp","image/gif"]);function aG(n,t,o){if(typeof n.addEventListener=="function")n.addEventListener(t,o);else if(typeof n.on=="function")n.on(t,o);else throw new TypeError("Slack WebSocket does not support events")}function yGe(n){let t=n?.data??n;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString("utf8"):t instanceof ArrayBuffer?Buffer.from(t).toString("utf8"):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):null}function mGe(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Slack returned an insecure Socket Mode URL");return t.href}function SGe(n){return typeof n=="string"?n.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"):""}function wGe(n,t){return SGe(n).replace(new RegExp(`<@${t}>`,"gi"),"").trim()}function oG(n){return typeof n?.url_private_download=="string"&&n.url_private_download?n.url_private_download:n?.url_private}function DGe(n,t){let o=typeof n?.mimetype=="string"?n.mimetype.toLowerCase():"",i=oG(n);return!Z5.has(o)||typeof i!="string"||!i?null:{name:typeof n.name=="string"?n.name:void 0,mediaType:o,size:Number.isSafeInteger(n.size)&&n.size>=0?n.size:void 0,load:e=>t(i,e)}}function OGe(n,t,o){let i=typeof n?.mimetype=="string"&&n.mimetype?n.mimetype.toLowerCase():void 0,e=oG(n);if(Z5.has(i))return null;let a=n?.file_access==="check_file_info"&&typeof n?.id=="string"&&n.id;return(typeof e!="string"||!e)&&!a?null:{name:typeof n?.name=="string"&&n.name?n.name:typeof n?.title=="string"&&n.title?n.title:a?n.id:"slack-file",...i?{mediaType:i}:{},size:Number.isSafeInteger(n?.size)&&n.size>=0?n.size:void 0,load:async({signal:A}={})=>{if(!a)return t(e,{signal:A});let r=await o(n.id,{signal:A}),s=oG(r);if(typeof s!="string"||!s)throw new Error("Slack files.info returned no downloadable URL");let g=await t(s,{signal:A}),c=typeof r?.name=="string"&&r.name?r.name:typeof r?.title=="string"&&r.title?r.title:n.id,I=typeof r?.mimetype=="string"&&r.mimetype?r.mimetype.toLowerCase():void 0;return Buffer.isBuffer(g)||g instanceof Uint8Array?{data:g,name:c,...I?{mediaType:I}:{}}:{...g,name:c,...I?{mediaType:I}:{}}}}}function bGe(n,t,{loadFile:o=async()=>{throw new Error("Slack file downloader is unavailable")},loadFileStream:i=o,loadFileInfo:e=async()=>{throw new Error("Slack file metadata loader is unavailable")}}={}){let a=n?.event;if(!a||!n?.event_id||!a.channel||!a.user||!a.ts)return null;let A=a.type==="message"&&a.channel_type==="im",r=a.type==="app_mention";if(!A&&!r||a.subtype&&a.subtype!=="file_share"||a.bot_id||a.app_id)return null;let s=String(a.thread_ts??a.ts);return{messageId:String(n.event_id),senderId:String(a.user),senderIsBot:String(a.user)===String(t),kind:A?"direct":"group",conversationId:A?String(a.channel):`${a.channel}:${s}`,content:wGe(a.text??"",t),plainText:!Array.isArray(a.files)||a.files.length===0,images:Array.isArray(a.files)?a.files.map(g=>DGe(g,o)).filter(Boolean):[],files:Array.isArray(a.files)?a.files.map(g=>OGe(g,i,e)).filter(Boolean):[],addressed:A||r,reactionTarget:{channelId:String(a.channel),messageTs:String(a.ts)},replyTarget:{channelId:String(a.channel),threadTs:s,recipientUserId:String(a.user),recipientTeamId:String(a.user_team??n.team_id??"")},connectionTestTarget:{channelId:String(a.channel)}}}function MGe(n){if(typeof n!="string")return!1;let t="__DSH_IM_TOOL_NAME__",o=w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:t}),i=o.indexOf(t);if(i<0)return!1;let e=o.slice(0,i),a=o.slice(i+t.length),A=n.trim();return A.startsWith(e)&&A.endsWith(a)&&A.length>e.length+a.length}async function W5(n,t,o,i,e){if(i)for(let a=0;a{let y=ss(Q,iG)[0]??"";if(!y||!y.startsWith(A))return;let m=y.slice(A.length);m&&(await W5(n,t,a,m,o),A=y)},f=()=>{I||c||s!==null||g||!r||(s=setTimeout(()=>{s=null;let Q=r;r="",g=B(Q).catch(y=>{c=!0,i.warn?.("[dsh-im:slack] streaming append failed:",y)}).finally(()=>{g=null,f()})},350),s?.unref?.())};return{messageId:a,get providerMessageIds(){return[...d]},update(Q){I||c||typeof Q!="string"||!Q.trim()||MGe(Q)||(r=Q,f())},async finish(Q){if(I)throw new Error("Slack message stream is already closed");I=!0,s!==null&&clearTimeout(s),s=null,r="",await g?.catch(()=>{});let y=ss(Q,iG),m=y[0]??w("\u5904\u7406\u5B8C\u6210\u3002");!c&&m.startsWith(A)?(await W5(n,t,a,m.slice(A.length),o),await n.stopStream({channelId:t.channelId,ts:a,signal:o})):(await n.stopStream({channelId:t.channelId,ts:a,signal:o}).catch(()=>{}),await n.updateMessage({channelId:t.channelId,ts:a,text:m,signal:o}));for(let T of y.slice(1)){let _=await n.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:T,signal:o});typeof _?.ts=="string"&&_.ts&&d.push(_.ts)}},cancel(){I=!0,r="",s!==null&&clearTimeout(s),s=null,n.stopStream({channelId:t.channelId,ts:a,signal:o}).catch(()=>{})}}}var nG=class{#e;#A;#t;constructor({api:t,signal:o,logger:i}){this.#e=t,this.#A=o,this.#t=i}async sendText(t,o){let i=ss(o,iG),e=[];for(let a of i){let A=await this.#e.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:a,signal:this.#A});typeof A?.ts=="string"&&A.ts&&e.push(A.ts)}return{providerMessageIds:e}}async addReaction(t,o,{signal:i}={}){let e=String(o??"").trim();return await this.#e.addReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:e,signal:i??this.#A}),e}removeReaction(t,o,{signal:i}={}){return this.#e.removeReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:o,signal:i??this.#A})}openStream(t){return _Ge({api:this.#e,target:t,signal:this.#A,logger:this.#t})}sendFile(t,o){return this.#e.uploadFile({channelId:t.channelId,threadTs:t.threadTs,file:o,signal:this.#A})}};function TGe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...io()}}var qu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g=TGe();#I=null;#d=null;#h=null;#C=null;#u=null;#B=null;#f=0;#Q=0;#S=!0;#y=null;constructor({config:t,botToken:o,appToken:i,harness:e,state:a,contextEnhancement:A,accessPolicy:r,logger:s=console,replyTimeoutMs:g=6e5,connectTimeoutMs:c=2e4,createApi:I=B=>new ju(B),createWebSocket:d=B=>new WebSocket(B)}){if(!t||!o||!i||!e||!a)throw new TypeError("SlackRuntime requires config, both tokens, Harness, and state");if(typeof d!="function")throw new TypeError("SlackRuntime requires WebSocket");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=d}get status(){return structuredClone(this.#g)}async sendConnectionTest(t){if(!this.#g.ready||!this.#d){let o=new Error("Slack bot is not connected");throw o.code="test-target-unavailable",o}return this.#d.sendConnectionTest(t)}async sendProactiveText(t,o,i={}){if(!this.#g.ready||!this.#d){let A=new Error("Slack bot is not connected");throw A.code="bot-not-connected",A}let e=typeof t?.route?.channelId=="string"?t.route.channelId.trim():"",a=typeof t?.route?.threadTs=="string"?t.route.threadTs.trim():"";if(!e||t?.kind!=="conversation"&&t?.kind!=="thread"||t.kind==="thread"&&!a||t.kind==="conversation"&&a){let A=new TypeError("Invalid Slack proactive delivery target");throw A.code="invalid-target",A}return this.#d.sendProactiveText({channelId:e,...a?{threadTs:a}:{}},o,i)}async start(){return this.#g.ready&&this.#C?this.status:this.#y?this.#y:(this.#y=this.#m().finally(()=>{this.#y=null}),this.#y)}async#m(){await this.stop(),this.#S=!1,this.#f=0,this.#g.startedAt=new Date().toISOString(),this.#g.connectionState="connecting",this.#g.lastError=null,await this.#r.ensureRunning(),this.#g.harnessReachable=!0;let t=new AbortController;this.#h=t;let o=this.#p({botToken:this.#A,appToken:this.#t});this.#I=o;try{let i=await o.authTest({signal:t.signal});if(`${i?.team_id}:${i?.user_id}`!==this.#e.platformId)throw new Error("Slack Bot Token identity does not match the saved bot");let e=new nG({api:o,signal:t.signal,logger:this.#a});this.#d=new WS({bot:e,harness:this.#r,state:this.#l,contextEnhancement:this.#o,accessPolicy:this.#i,status:this.#g,logger:this.#a,replyTimeoutMs:this.#n,signal:t.signal});let a;try{await Promise.race([this.#D(),new Promise((A,r)=>{a=setTimeout(()=>r(new Error("Slack Socket Mode did not become ready in time")),this.#s),a?.unref?.()})])}finally{clearTimeout(a)}return this.status}catch(i){throw this.#g.ready=!1,this.#g.connectionState="failed",this.#g.lastError=i?.message??String(i),await this.stop(),i}}async#D(){if(this.#S)throw new Error("Slack runtime is stopped");let t=await this.#I.openConnection({signal:this.#h?.signal});return this.#E(t?.url)}#E(t){if(this.#S)return Promise.reject(new Error("Slack runtime is stopped"));let o=++this.#Q,i=this.#c(mGe(t));this.#C=i;let e=!1;return new Promise((a,A)=>{let r=s=>{if(e||o!==this.#Q)return;e=!0,this.#u=s?.connection_info?.app_id??null,this.#f=0;let g=Date.now();this.#g.ready=!0,this.#g.connectionState="connected",this.#g.lastCheckedAt=g,this.#g.lastConnectedAt=g,this.#g.lastError=null,a()};aG(i,"message",s=>{if(o!==this.#Q||this.#S)return;let g=yGe(s);if(!g)return;let c;try{c=JSON.parse(g)}catch{this.#a.warn?.("[dsh-im:slack] ignored malformed Socket Mode JSON");return}if(c.type==="hello"){r(c);return}if(c.envelope_id&&i.readyState===1&&(i.send(JSON.stringify({envelope_id:c.envelope_id})),this.#g.lastCheckedAt=Date.now()),c.type==="disconnect"){i.close(4e3,"Slack requested reconnect");return}if(c.type!=="events_api"||c.payload?.type!=="event_callback"||this.#u&&c.payload.api_app_id&&c.payload.api_app_id!==this.#u)return;let I=bGe(c.payload,this.#e.platformId.split(":")[1],{loadFile:(B,f)=>this.#I.downloadFile({url:B,...f}),loadFileStream:(B,f)=>this.#I.downloadFileStream({url:B,...f}),loadFileInfo:(B,f)=>this.#I.fileInfo({fileId:B,...f})}),d=this.#d;I&&d&&d.accept(I).catch(B=>{o!==this.#Q||this.#S||this.#a.error?.(`[dsh-im:slack] bot ${this.#e.botId} message handling failed:`,B)})}),aG(i,"close",(s={})=>{if(o!==this.#Q)return;if(this.#C===i&&(this.#C=null),this.#S){e||A(new DOMException("Stopped","AbortError"));return}let g=Number(s.code)||0,c=new Error(`Slack Socket Mode closed (${g||"unknown"})`);this.#g.ready=!1,this.#g.connectionState="connecting",this.#g.lastError=c.message,e||(e=!0,A(c)),this.#N()}),aG(i,"error",()=>{o!==this.#Q||this.#S||(this.#g.lastError="Slack Socket Mode WebSocket error")})})}#N(){if(this.#S||this.#B!==null)return;let t=z5[Math.min(this.#f,z5.length-1)];this.#f+=1,this.#B=setTimeout(()=>{this.#B=null,this.#D().catch(o=>{this.#S||(this.#a.warn?.("[dsh-im:slack] Socket Mode reconnect failed:",o),this.#N())})},t),this.#B?.unref?.()}async stop(){this.#S=!0,this.#Q+=1,this.#h?.abort(),this.#h=null,this.#B!==null&&clearTimeout(this.#B),this.#B=null;let t=this.#C,o=this.#d;this.#C=null,this.#d=null,this.#I=null,this.#u=null;try{t&&t.readyState<2&&t.close(1e3,"Plugin stopped")}catch(i){this.#a.warn?.(`[dsh-im:slack] bot ${this.#e.botId} failed to close Socket Mode:`,i)}return await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(i=>setTimeout(i,2e3))]),this.#g.ready=!1,this.#g.connectionState="idle",this.status}};var $S=class extends gs{};async function sG(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-im slack requires ctx.credentials");let i=aa(n,t),e=o.ConfigStore??VS,a=o.StateStore??$S,A=o.HarnessClient??XS,r=o.Controller??Ju,s=o.Runtime??qu,g=o.createConnectionSupervisor??Yp,c=typeof n.logger=="function"?n.logger("dsh-im:slack"):n.logger??console,I=()=>La(n),d=W_(t,"slack"),B=await new e(d.config).load(),f=X5(t.workspace??process.cwd()),Q=o.WorkspaceStore??ra,y=o.workspaces??await new Q(d.workspaces,{defaultWorkspace:f}).load(),m=B.list();await y.reconcile(m.map(N=>N.botId)),await Promise.all(m.map(N=>y.ensure(N.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("slack",N)})));let T=typeof B.remove=="function"?Ha(B,{workspaces:y}):B,_=new Map,R=N=>X5(d.bots,N,"state.json"),K=async N=>{let k=_.get(N);return k||(k=await new a(R(N)).load(),_.set(N,k)),k},L=ja(n,o.commandExecutor),{controlExecutor:F,sessionMaintenanceExecutor:q,fileIngressExecutor:V}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),x=new A({...i,workspace:f,autostart:!1,dshBin:t.dshBin??"dsh",...L?{commandExecutor:L}:{},...F?{controlExecutor:F}:{},...q?{sessionMaintenanceExecutor:q}:{},...V?{fileIngressExecutor:V}:{}}),G=new r({credentials:n.credentials,configStore:T,logger:c,...o.inspectCredentials?{inspectCredentials:o.inspectCredentials}:{},createRuntime:async({botId:N,config:k,botToken:z,appToken:Ae})=>{let ie=await K(N);await y.ensure(N,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("slack",k)});let we=Ka(x,{botId:N,workspaces:y,state:ie,agentPresetCatalog:I});return new s({config:k,botToken:z,appToken:Ae,harness:we.harness,state:we.state,contextEnhancement:{botId:N,getSettings:()=>y.contextEnhancementFor(N)},accessPolicy:qa(y,N,{channel:"slack",config:k}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...se)=>c.error?.(`[${N}]`,...se),warn:(...se)=>c.warn?.(`[${N}]`,...se),info:(...se)=>c.info?.(`[${N}]`,...se),debug:(...se)=>c.debug?.(`[${N}]`,...se)}})},deleteState:async({botId:N})=>{let k=_.get(N);if(_.delete(N),k&&typeof k.remove=="function")await k.remove();else try{await NGe(R(N))}catch(z){if(z?.code!=="ENOENT")throw z}}}),J=xa(G,{workspaces:y,stateFor:K,agentPresetCatalog:I}),U=g({channel:"slack",controller:J,harness:x,logger:c,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:J,deliveryAdapter:Ya({channel:"slack",workspaces:y,coreController:G,stateFor:K}),ready:U.ready,async close(){await U.close(),await J.close(),x.stopManagedProcess()}}}var eZ="/slack",ya=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),AZ=Object.freeze(Object.values(ya)),RGe=new Set(["token","botToken","appToken","botTokenRef","appTokenRef","tokenRef","platformId","secret","secretRef"]);function cG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function ew(n,t){return cG(n)&&Object.keys(n).every(o=>t.includes(o))}function $5(n){return typeof n=="string"&&/^slack_[a-f0-9]{24}$/.test(n)}function kGe(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function vGe(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function PGe(n,t){return cG(t)?n===ya.status?ew(t,[])?null:"connection.status does not accept fields.":n===ya.bindCredentials?ew(t,["botToken","appToken"])&&kGe(t.botToken)&&vGe(t.appToken)?null:"bot.bind-credentials requires xoxb Bot Token and xapp App Token.":n===ya.reconnectBot?ew(t,["botId","sendTest"])&&$5(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId.":n===ya.deleteBot?ew(t,["botId","confirm"])&&$5(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===ya.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===ya.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===ya.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===ya.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown Slack endpoint.":"Payload must be an object."}function gG(n){if(Array.isArray(n))return n.map(gG);if(!cG(n))return n;let t={};for(let[o,i]of Object.entries(n))RGe.has(o)||(t[o]=gG(i));return t}function GGe(n){let t=Xa(n);return t||(n?.code==="slack-invalid-bot-token"?{code:"invalid-bot-token",message:"Slack Bot Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xoxb- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-invalid-app-token"?{code:"invalid-app-token",message:"Slack App Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xapp- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-missing-scope"?{code:"missing-scope",message:"Slack \u5E94\u7528\u6743\u9650\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u91CD\u65B0\u5BFC\u5165 Manifest \u5E76\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002"}:n?.code==="slack-socket-mode"?{code:"socket-mode-unavailable",message:n.message}:{code:"slack-operation-failed",message:"Slack \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"})}function tZ(n){for(let t of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[t]!="function")throw new TypeError(`A complete Slack controller is required (${t})`);return async(t,o,i)=>{if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!AZ.includes(t))return{ok:!1,error:{code:"bad-request",message:"Unknown Slack endpoint."}};let e=PGe(t,o);if(e)return{ok:!1,error:{code:"bad-request",message:e}};try{let a;if(t===ya.status)a=await n.status();else if(t===ya.bindCredentials)a=await n.bindCredentials(o);else if(t===ya.reconnectBot){if(a=await n.reconnectBot(o.botId),i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(o.sendTest===!0){let A=null;try{if(a?.bots?.find(r=>r?.botId===o.botId)?.connected!==!0){let r=new Error("Bot is not connected");throw r.code="test-target-unavailable",r}if(typeof n.sendConnectionTest!="function"){let r=new Error("Connection test is unavailable");throw r.code="test-target-unavailable",r}await n.sendConnectionTest(o.botId)}catch(r){A=r}a={...a,testMessage:or(A)}}}else if(t===ya.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");a=await n.updateWorkspace(o.botId,o.workspace)}else if(t===ya.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");a=await n.updateContextEnhancement(o.botId,o.config)}else if(t===ya.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");a=await n.updateAccessPolicy(o.botId,o.policy)}else if(t===ya.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");a=await n.updateAgentPreset(o.botId,o.agentPreset)}else a=await n.deleteBot(o.botId);return i?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:gG(a)}}catch(a){return i?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:GGe(a)}}}}function Aw(n,t,o){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(eZ,tZ(t),{authority:fr(o)})}async function rZ(n,t={}){if(t?.controller)return Aw(n,t.controller,t.rpcAuthority);let o=await sG(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Aw(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Slack bot connections"),e}var aZ=Object.freeze({botPrefix:"telegram",tokenRefPrefix:"DSH_TELEGRAM_BOT_TOKEN"}),IG=Object.freeze({compatible:"compatible",privateAllowlist:"private-allowlist"}),FGe=/^[1-9]\d{0,15}$/;function iZ(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedUsers must be an array of numeric Telegram User IDs");let t=n.map(o=>{let i=typeof o=="number"&&Number.isSafeInteger(o)?String(o):typeof o=="string"?o.trim():"";if(!FGe.test(i))throw new TypeError("allowedUsers contains an invalid Telegram User ID");return i});return Object.freeze([...new Set(t)])}function rw(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("Telegram access policy must be an object");let t=n.accessMode??IG.compatible;if(!Object.values(IG).includes(t))throw new TypeError("Telegram accessMode must be compatible or private-allowlist");return Object.freeze({accessMode:t,allowedUsers:iZ(n.allowedUsers)})}function LGe(n){let t=Object.hasOwn(n,"accessMode"),o=Object.hasOwn(n,"allowedUsers");if(!t&&!o)return{};try{let i=rw(n);return{...t?{accessMode:i.accessMode}:{},...o||t?{allowedUsers:i.allowedUsers}:{}}}catch{return null}}function oZ(n){return eC(n,aZ)}function nZ(n){return YQ(n,w("Telegram\u673A\u5668\u4EBA"))}var tw=class extends Hp{constructor(t){super(t,{channel:"Telegram",...aZ,normalizeBotExtension:LGe})}async save(t){let o=t?.platformId?this.getByPlatformId(String(t.platformId)):null;return super.save({...o,...t})}};var aw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"telegram",logPrefix:"dsh-telegram"})}};var UGe="https://api.telegram.org/",sZ=Object.freeze(["api.telegram.org"]),HGe=12e4;function Rg(n){return typeof n=="string"&&n.trim()?n.trim():null}function gZ(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function lG(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function KGe(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function IZ(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function pG(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("A Telegram rich message is required");let t=["markdown","html","blocks"].filter(i=>n[i]!==void 0);if(t.length!==1)throw new TypeError("A Telegram rich message requires exactly one format");let o=t[0];if((o==="markdown"||o==="html")&&(typeof n[o]!="string"||!n[o].trim()))throw new TypeError("Telegram rich message text is invalid");if(o==="blocks"&&!Array.isArray(n.blocks))throw new TypeError("Telegram rich message blocks are invalid");return n}function xGe(n,t="document"){let o=Number(n?.providerCode),i=Number(n?.status),e=Rg(n?.message)??"",a="artifact-provider-rejected",A=`Telegram rejected the ${t}.`;o===401||o===403||i===401||i===403?(a="artifact-permission-required",A=`Telegram denied permission to send the ${t}.`):o===413||i===413||/(?:file|request|entity).{0,20}(?:too (?:big|large)|size limit)|too (?:big|large)/i.test(e)?(a="artifact-too-large",A=`The ${t} exceeds Telegram's size limit.`):o===429||i===429?(a="artifact-rate-limited",A=`Telegram rate-limited ${t} delivery.`):(o>=500||i>=500)&&(a="artifact-delivery-uncertain",A=`Telegram ${t} delivery result is uncertain.`);let r=new Error(A,{cause:n});return r.code=a,IZ(r,n)}function cZ(n,t="document"){let o=new Error(`Telegram ${t} delivery result is uncertain`,{cause:n});return o.code="artifact-delivery-uncertain",IZ(o,n)}function YGe(n){return typeof n=="string"&&/^\d{5,20}:[A-Za-z0-9_-]{20,}$/.test(n.trim())}var jGe=/^[a-z0-9_]{1,32}$/;function JGe(n){return!!n&&typeof n=="object"&&!Array.isArray(n)&&typeof n.command=="string"&&jGe.test(n.command)&&typeof n.description=="string"&&n.description.length>=1&&n.description.length<=256}var dG=Object.freeze({type:"commands"}),zu=class{#e;#A;#t;#r;#l;constructor({token:t,fetchImpl:o=fetch,FormDataImpl:i=globalThis.FormData,baseUrl:e=UGe,fileUploadTimeoutMs:a=HGe}){if(!YGe(t))throw new TypeError("Telegram Bot Token is invalid");if(typeof o!="function")throw new TypeError("TelegramApi requires fetch");if(typeof i!="function")throw new TypeError("TelegramApi requires FormData");this.#e=t.trim(),this.#A=o,this.#t=i,this.#r=new URL(e),this.#l=KGe(a,"fileUploadTimeoutMs")}async getMe(t={}){return this.#a("getMe",{},t)}async getWebhookInfo(t={}){return this.#a("getWebhookInfo",{},t)}async getUpdates({offset:t,timeout:o=25,signal:i}={}){let e={timeout:o,limit:100,allowed_updates:["message"],...Number.isSafeInteger(t)?{offset:t}:{}};return this.#a("getUpdates",e,{signal:i,timeoutMs:Math.max(1e4,(o+10)*1e3)})}async getFile({fileId:t,signal:o}={}){let i=Rg(t);if(!i||!/^[A-Za-z0-9_-]{1,512}$/.test(i))throw new TypeError("Telegram file id is invalid");return this.#a("getFile",{file_id:i},{signal:o})}async downloadFile({fileId:t,signal:o,maxBytes:i}={}){let e=await this.#o(t,o);return Do(e,{fetchImpl:this.#A,signal:o,maxBytes:i,allowedHosts:sZ})}async downloadFileStream({fileId:t,signal:o}={}){let i=await this.#o(t,o);return xp(i,{fetchImpl:this.#A,signal:o,allowedHosts:sZ})}async#o(t,o){let i=await this.getFile({fileId:t,signal:o}),e=Rg(i?.file_path);if(!e||e.startsWith("/")||e.includes("\\")||e.includes("?")||e.includes("#"))throw new Error("Telegram returned an invalid file path");let a;try{a=e.split("/").map(r=>decodeURIComponent(r))}catch{throw new Error("Telegram returned an invalid file path")}if(a.some(r=>!r||r==="."||r===".."))throw new Error("Telegram returned an invalid file path");let A=new URL(this.#r);return A.pathname=`/file/bot${this.#e}/${e}`,A}async sendMessage({chatId:t,text:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#a("sendMessage",{chat_id:t,text:o,link_preview_options:{is_disabled:!0},...i?{reply_parameters:{message_id:i,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:a})}async setMessageReaction({chatId:t,messageId:o,emoji:i,signal:e,timeoutMs:a}){let A=Rg(i);return this.#a("setMessageReaction",{chat_id:t,message_id:o,reaction:A?[{type:"emoji",emoji:A}]:[]},{signal:e,timeoutMs:a})}async sendRichMessage({chatId:t,richMessage:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#a("sendRichMessage",{chat_id:t,rich_message:pG(o),...i?{reply_parameters:{message_id:i,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:a})}async sendRichMessageDraft({chatId:t,draftId:o,richMessage:i,messageThreadId:e,signal:a}){if(!Number.isSafeInteger(o)||o===0)throw new TypeError("Telegram rich message draft id must be a non-zero integer");return this.#a("sendRichMessageDraft",{chat_id:t,draft_id:o,rich_message:pG(i),...e?{message_thread_id:e}:{}},{signal:a})}async sendDocument({chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#i("sendDocument","document","document",{chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a})}async sendPhoto({chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#i("sendPhoto","photo","photo",{chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a})}async#i(t,o,i,{chatId:e,file:a,replyToMessageId:A,messageThreadId:r,signal:s}){if(!a||typeof a!="object"||typeof a.fileName!="string"||!a.fileName||!Buffer.isBuffer(a.bytes))throw new TypeError(`A Telegram ${i} is required`);let g=new this.#t;if(g.append("chat_id",String(e)),g.append(o,new Blob([a.bytes],{type:a.mediaType??"application/octet-stream"}),a.fileName),A&&g.append("reply_parameters",JSON.stringify({message_id:A,allow_sending_without_reply:!0})),r&&g.append("message_thread_id",String(r)),s?.aborted)throw lG(s);let c=gZ(s,this.#l);try{return await this.#a(t,g,{signal:c,timeoutMs:this.#l,multipart:!0})}catch(I){throw s?.aborted?lG(s):I?.deliveryOutcome==="unknown"?cZ(I?.cause??I,i):I?.code?.startsWith?.("telegram-")?xGe(I,i):cZ(I,i)}}async editMessageText({chatId:t,messageId:o,text:i,richMessage:e,signal:a}){if(i===void 0==(e===void 0))throw new TypeError("Telegram message edit requires exactly one of text or richMessage");return this.#a("editMessageText",{chat_id:t,message_id:o,...i===void 0?{rich_message:pG(e)}:{text:i,link_preview_options:{is_disabled:!0}}},{signal:a})}async sendChatAction({chatId:t,messageThreadId:o,signal:i}){return this.#a("sendChatAction",{chat_id:t,action:"typing",...o?{message_thread_id:o}:{}},{signal:i})}async setMyCommands({commands:t,scope:o,languageCode:i,signal:e}={}){if(!Array.isArray(t)||t.length===0||t.some(a=>!JGe(a)))throw new TypeError("Telegram bot commands are invalid");return this.#a("setMyCommands",{commands:t,...o?{scope:o}:{},...Rg(i)?{language_code:Rg(i)}:{}},{signal:e})}async setChatMenuButton({menuButton:t=dG,signal:o}={}){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError("Telegram menu button is invalid");return this.#a("setChatMenuButton",{menu_button:t},{signal:o})}async#a(t,o,{signal:i,timeoutMs:e=15e3,multipart:a=!1}={}){if(i?.aborted)throw lG(i);let A=new URL(this.#r);A.pathname=`${A.pathname.replace(/\/$/,"")}/bot${this.#e}/${t}`;let r;try{r=await this.#A(A,{method:"POST",...a?{}:{headers:{"content-type":"application/json"}},body:a?o:JSON.stringify(o),signal:gZ(i,e),redirect:"error"})}catch(g){let c=new Error(`Telegram ${t} transport failed`,{cause:g});throw c.code=g?.name==="TimeoutError"?"telegram-timeout":g?.name==="AbortError"?"telegram-aborted-after-dispatch":"telegram-transport-error",c.deliveryOutcome="unknown",c}let s;try{s=await r.json()}catch{let g=new Error(`Telegram ${t} returned invalid JSON`);throw g.status=r?.status,g.code="telegram-response-invalid",g.deliveryOutcome="unknown",g}if(!r.ok||s?.ok!==!0){let g=Rg(s?.description),c=new Error(g??`Telegram ${t} failed`);c.code=Number.isInteger(s?.error_code)?`telegram-${s.error_code}`:"telegram-api-error",c.status=r.status,Number.isInteger(s?.error_code)&&(c.providerCode=s.error_code);let I=Number(s?.parameters?.retry_after);throw Number.isFinite(I)&&I>=0&&(c.retry_after=I,c.retryAfter=I),c}return s.result}};async function lZ(n,t={}){let i=await new zu({token:n,...t}).getMe();if(!i?.id||i?.is_bot!==!0)throw new Error("Telegram token does not belong to a bot");return{platformId:String(i.id),name:Rg([i.first_name,i.last_name].filter(Boolean).join(" "))??w("Telegram\u673A\u5668\u4EBA"),username:Rg(i.username)}}var hG=Object.freeze({key:"telegram",label:"Telegram",connectionLabel:" Bot API \u957F\u8F6E\u8BE2",reactions:Object.freeze({processing:"\u{1F440}",success:"\u{1F44D}",error:"\u{1F44E}"})}),iw=class extends ns{constructor(t){super({descriptor:hG,...t})}};var Vu=class extends Kp{#e;constructor(t){super({...t,descriptor:hG,inspectToken:t.inspectToken??lZ,deriveIdentity:oZ,maskPlatformId:nZ}),this.#e=t.configStore}status(){let t=super.status();return{...t,bots:t.bots.map(o=>{let i=this.#e.get(o.botId),e=rw(i??{});return{...o,accessPolicy:e}})}}async setAccessPolicy(t,o){let i=rw(o);return this.updateBotConfig(t,e=>({...e,...i}))}};import{randomInt as eFe}from"node:crypto";import{EnvHttpProxyAgent as qGe,FormData as zGe,fetch as VGe}from"undici";var WGe=4;function pZ(){let n=new qGe({connections:WGe}),t=!1;return{fetchImpl:(o,i={})=>VGe(o,{...i,dispatcher:n}),FormDataImpl:zGe,async destroy(){t||(t=!0,await n.destroy())}}}function CG(n){if(typeof n!="string"||!n.trim())throw new TypeError("Telegram message text must be a non-empty string");return n}function uG(n){return n==="&"?5:n==="<"||n===">"?4:1}function EG(n){return Array.from(n).reduce((t,o)=>t+uG(o),0)}function ZGe(n,t,o,i){let e=t+Math.floor(i*.5);for(let a=o-1;a>=e;a-=1)if(n[a]===` +${T}`:K),await g()}catch(K){this.#a.error?.("[dsh-im:qq] failed to send the safe error reply:",K)}}}async#N(t,o,i,e){this.#s?.throwIfAborted();let a=this.#I.get(i),A=e.claimedReplyMessageId===o;if(!a||a!==e||a.submitting)return A&&(!a||a!==e)?this.#R(t,o):this.#Q(t,o,i,{releaseMessageId:!1});if(this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),t.kind==="group"&&t.rawEventType!=="GROUP_AT_MESSAGE_CREATE"))return;let r=lo(Lu(t));if(!r||zd(t)||Ql(t)){await this.#e.sendText(t.replyTarget,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"));return}let s=this.#I.get(i);if(!s||s!==e||s.submitting){if(A&&(!s||s!==e)){await this.#e.sendText(t.replyTarget,HS());return}return this.#Q(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(s.target=t.replyTarget,s.needsPresentation){try{await this.#w(s)}catch{this.#i.lastError=w("QQ \u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#a.error?.("[dsh-im:qq] failed to retry an interaction question"),s.interaction.reconnect?.();return}let c=this.#I.get(i);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#e.sendText(t.replyTarget,HS()).catch(()=>{});return}return this.#Q(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let g=s.questions[s.index];if(g){if(s.answers.push(wi(g,r)),s.index+=1,s.index{});return}if(this.#I.get(i)!==s)return;s.submitting=!1,s.answers.pop(),s.index-=1,this.#i.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#a.error?.("[dsh-im:qq] failed to answer a Harness interaction"),await this.#e.sendText(s.target,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#T(t,{key:o,actor:i,target:e,requiresMention:a}){if(t?.kind==="approval")return this.#B.handleRequested(t,{key:o,actor:i,requiresMention:a,send:c=>this.#e.sendText(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#a.warn?.("[dsh-im:qq] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"QQ safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#e.sendText(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002")).catch(()=>{});return}let s=this.#I.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#w(s);return}if(this.#d.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"QQ is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,target:e,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#I.set(o,g),this.#d.set(r,o),await this.#w(g)}async#O(t){if(t?.kind==="approval"){await this.#B.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#d.get(o);i&&this.#G(i,o)}#w(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=this.#e.sendText(t.target,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===i&&(t.presentationPromise=null)});return t.presentationPromise=i,i}async#R(t,o){this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),await this.#e.sendText(t.replyTarget,HS()).catch(()=>{}))}#_(t,o){let i=this.#I.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#I.delete(t),this.#d.delete(i.interactionId),i)}#G(t,o){return this.#_(t,o)!==null}async#k(t){let o=this.#_(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The QQ interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#a.warn?.("[dsh-im:qq] failed to cancel a pending Harness interaction")}}async#F(t,o,i){if(this.#s?.aborted)return;this.#i.lastError=i?.message??String(i);let e=At(this.#i,i);this.#a.error?.(`[dsh-im:qq] failed to process an interaction reply [${e.referenceId}]:`,i),this.#r.hasSeen(o)||await this.#r.markSeen(o).catch(()=>{}),await this.#e.sendText(t.replyTarget,dt(e)).catch(()=>{})}};function kPe(){let n=new Error("QQ WebSocket did not become ready in time");return n.code="connect-timeout",n}function vPe(){return{startedAt:null,ready:!1,qqConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...qP()}}var Uu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=vPe();#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,appSecret:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,createBot:c=d=>new TPe(d),typingMiddleware:I=RPe}){if(!t||!o||!i||!e)throw new TypeError("QqRuntime requires config, app secret, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#c)}async sendConnectionTest(t){if(!this.#c.ready||!this.#g)throw Cr(w("QQ\u673A\u5668\u4EBA"));let o=typeof this.#e.ownerUserOpenid=="string"?this.#e.ownerUserOpenid.trim():"",i=vE(this.#r),e=i?.scope==="c2c"&&typeof i.targetId=="string"?i.targetId.trim():"",a=e?{scope:"c2c",targetId:e}:o&&o!=="*"?{scope:"c2c",targetId:o}:null;if(!a)throw Cr(w("QQ\u673A\u5668\u4EBA"));return await this.#g.sendText(a,t),{sent:!0}}async sendProactiveText(t,o,{signal:i}={}){let e=t?.kind==="user"?typeof t?.route?.userOpenId=="string"?t.route.userOpenId.trim():"":t?.kind==="group"&&typeof t?.route?.groupOpenId=="string"?t.route.groupOpenId.trim():"";if(!e){let a=new TypeError("Invalid QQ proactive delivery target");throw a.code="invalid-target",a}if(!this.#c.ready||!this.#g){let a=new Error("QQ bot is not connected");throw a.code="bot-not-connected",a}return i?.throwIfAborted(),this.#g.sendText({scope:t.kind==="user"?"c2c":"group",targetId:e},o)}async start(){return this.#c.ready&&this.#g?this.status:this.#C?this.#C:(this.#C=this.#u().finally(()=>{this.#C=null}),this.#C)}async#u(){await this.stop(),this.#c.startedAt=new Date().toISOString(),this.#c.qqConnectionState="connecting",this.#c.lastError=null,await this.#t.ensureRunning(),this.#c.harnessReachable=!0;let t={error:(...d)=>this.#i.error?.(...d),warn:(...d)=>this.#i.warn?.(...d),info:(...d)=>this.#i.info?.(...d),debug:()=>{}},o=this.#s({appId:this.#e.appId,appSecret:this.#A,accountId:this.#e.botId,logger:t,transport:"websocket",tokenPrefetch:"sync",markdownSupport:!1});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("QQ bot factory returned an invalid client");let i=new AbortController;this.#d=i,this.#g=o,this.#I=new xS({bot:o,ownerUserOpenid:this.#e.ownerUserOpenid,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#c,logger:this.#i,replyTimeoutMs:this.#a,signal:i.signal}),o.use(NPe({parseFaceTags:!0})),o.use?.(this.#p({keepAlive:!0,predicate:d=>{let B=d?.message;return!B||B.kind==="group"&&B.rawEventType!=="GROUP_AT_MESSAGE_CREATE"?!1:this.#o?Ba(this.#o,{conversationType:B.kind==="c2c"?"direct":"group",senderIds:B.senderId,text:typeof B.content=="string"?B.content.trim():""}).allowed:B.kind==="group"||this.#e.ownerUserOpenid==="*"||B.senderId===this.#e.ownerUserOpenid}}));let e,a,A=new Promise((d,B)=>{e=d,a=B}),r=()=>{let d=Date.now();this.#c.ready=!0,this.#c.qqConnectionState="connected",this.#c.lastCheckedAt=d,this.#c.lastConnectedAt=d,this.#c.lastError=null,e()},s=d=>{this.#c.ready?(this.#c.lastError=d?.message??String(d),this.#i.warn?.(`[dsh-im:qq] bot ${this.#e.botId} connection error:`,d)):a(d)},g=(d,B)=>{let f=this.#I?.accept(B);f&&f.catch(Q=>{i.signal.aborted||this.#i.error?.(`[dsh-im:qq] bot ${this.#e.botId} message handling failed:`,Q)})};o.on("ready",r),o.on("resumed",r),o.on("error",s),o.on("message",g);let c=Promise.resolve().then(()=>o.start(i.signal));this.#h=c,c.catch(d=>{i.signal.aborted||(a(d),this.#c.ready=!1,this.#c.qqConnectionState="failed",this.#c.lastError=d?.message??String(d),this.#i.error?.(`[dsh-im:qq] bot ${this.#e.botId} connection stopped:`,d))});let I;try{return await Promise.race([A,new Promise((d,B)=>{I=setTimeout(()=>B(kPe()),this.#n)})]),this.#c.ready=!0,this.#c.qqConnectionState="connected",this.#c.lastCheckedAt=Date.now(),this.#c.lastConnectedAt=Date.now(),this.status}catch(d){throw this.#c.ready=!1,this.#c.qqConnectionState="failed",this.#c.lastError=d?.message??String(d),await this.stop(),d}finally{clearTimeout(I)}}async stop(){let t=this.#g,o=this.#I,i=this.#h;this.#d?.abort(),this.#d=null,this.#g=null,this.#I=null,this.#h=null;try{t?.stop()}catch(e){this.#i.warn?.(`[dsh-im:qq] bot ${this.#e.botId} failed to stop cleanly:`,e)}return await Promise.race([i?.catch(()=>{})??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),await o?.waitForIdle(),this.#c.ready=!1,this.#c.qqConnectionState="idle",this.status}};import{startQrConnect as PPe}from"@tencent-connect/qqbot-connector";var YS=class{#e;#A;constructor({start:t=PPe,source:o="deepseek-harness"}={}){if(typeof t!="function")throw new TypeError("QQ QR connector is required");this.#e=t,this.#A=o}start(t,{signal:o}={}){if(!t||typeof t.onSuccess!="function"||typeof t.onFailure!="function")throw new TypeError("QQ QR callbacks are required");return this.#e(t,{displayQrCodeToConsole:!1,source:this.#A,signal:o})}};import{mkdir as GPe,readFile as FPe,rename as LPe,unlink as UPe,writeFile as HPe}from"node:fs/promises";import{dirname as KPe}from"node:path";var jS=Object.freeze({version:1,sessions:{},seenMessageIds:[]});function xPe(n){if(!n||typeof n!="object")return structuredClone(jS);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&typeof i=="string"&&i&&(t[o]=i);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[]}}var JS=class{#e;#A=structuredClone(jS);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=xPe(JSON.parse(await FPe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(jS),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await UPe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(jS)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} +`,o=this.#t.then(async()=>{await GPe(KPe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await HPe(i,t,{encoding:"utf8",mode:384}),await LPe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};var v5=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function YPe(n){if(!Array.isArray(n)||n.length===0)return[...v5];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...v5]}var qS=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=YPe(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(iLa(n),B=qPe(t),f=await new e(B.config).load(),Q=yl(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(z=>z.botId)),await Promise.all(T.map(z=>m.ensure(z.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("qq",z)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=o.qrAuth??new g({source:t.qrSource??"deepseek-harness"}),K=new Map,L=z=>yl(B.bots,z,"state.json"),F=async z=>{let Ae=K.get(z);return Ae||(Ae=await new a(L(z)).load(),K.set(z,Ae)),Ae},q=ja(n,o.commandExecutor),{controlExecutor:V,sessionMaintenanceExecutor:x,fileIngressExecutor:G}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),J=new A({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...q?{commandExecutor:q}:{},...V?{controlExecutor:V}:{},...x?{sessionMaintenanceExecutor:x}:{},...G?{fileIngressExecutor:G}:{}}),U=new r({qrAuth:R,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:z,config:Ae,appSecret:ie})=>{let we=await F(z);await m.ensure(z,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("qq",Ae)});let se=Ka(J,{botId:z,workspaces:m,state:we,agentPresetCatalog:d});return new s({config:Ae,appSecret:ie,harness:se.harness,state:se.state,contextEnhancement:{botId:z,getSettings:()=>m.contextEnhancementFor(z)},accessPolicy:qa(m,z,{channel:"qq",config:Ae}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...Te)=>I.error?.(`[${z}]`,...Te),warn:(...Te)=>I.warn?.(`[${z}]`,...Te),info:(...Te)=>I.info?.(`[${z}]`,...Te),debug:(...Te)=>I.debug?.(`[${z}]`,...Te)}})},deleteState:async({botId:z})=>{let Ae=K.get(z);if(K.delete(z),Ae&&typeof Ae.remove=="function")await Ae.remove();else try{await jPe(L(z))}catch(ie){if(ie?.code!=="ENOENT")throw ie}}}),N=xa(U,{workspaces:m,stateFor:F,agentPresetCatalog:d}),k=c({controller:N,harness:J,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:N,deliveryAdapter:Ya({channel:"qq",workspaces:m,coreController:U,stateFor:F}),ready:k.ready,async close(){await k.close(),await N.close(),J.stopManagedProcess()}}}import zPe from"qrcode";var G5="/qq",cr=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),F5=Object.freeze(Object.values(cr)),VPe=new Set(["appSecret","app_secret","secretRef","ownerUserOpenid","userOpenid","verificationUrl"]);function XP(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Vd(n,t){return XP(n)&&Object.keys(n).every(o=>t.includes(o))}function WP(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function P5(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function WPe(n,t){return XP(t)?n===cr.status?Vd(t,[])?null:"connection.status does not accept fields.":n===cr.beginProvisioning?Vd(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[cr.pollProvisioning,cr.cancelProvisioning].includes(n)?Vd(t,["attemptId"])&&WP(t.attemptId)?null:`${n} requires an attemptId.`:n===cr.bindCredentials?Vd(t,["appId","appSecret"])&&P5(t.appId,256)&&P5(t.appSecret,1024)?null:"bot.bind-credentials requires AppID and AppSecret.":n===cr.reconnectBot?Vd(t,["botId","sendTest"])&&WP(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and accepts only sendTest=true.":n===cr.deleteBot?Vd(t,["botId","confirm"])&&WP(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===cr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===cr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===cr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===cr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown QQ endpoint.":"Payload must be an object."}function Wd(n){if(Array.isArray(n))return n.map(Wd);if(!XP(n))return n;let t={};for(let[o,i]of Object.entries(n))VPe.has(o)||(t[o]=Wd(i));return t}async function ZPe(n){return zPe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function ZP(n,t){return!n||typeof n.verificationUrl!="string"?Wd(n):Wd({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Pc(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await ZP(o.provisioning,t)),Wd(o)}function L5(n,{encodeQr:t=ZPe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete QQ controller is required (${e})`);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!F5.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown QQ endpoint."}};let r=WPe(e,a);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===cr.status)s=await Pc(await n.status(),i);else if(e===cr.beginProvisioning)s=await ZP(await n.startProvisioning(),i);else if(e===cr.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await ZP(g,i)}else if(e===cr.cancelProvisioning)s=Wd(await n.cancelProvisioning(a.attemptId));else if(e===cr.bindCredentials)s=await Pc(await n.bindCredentials(a),i);else if(e===cr.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};let c;if(a.sendTest===!0)if(!(g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("QQ\u673A\u5668\u4EBA"));else{let d=null;try{await n.sendConnectionTest(a.botId)}catch(B){d=B}c=or(d)}s=await Pc({...g,...c?{testMessage:c}:{}},i)}else if(e===cr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Pc(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===cr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Pc(g,i))}else if(e===cr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Pc(g,i))}else if(e===cr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Pc(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await Pc(await n.deleteBot(a.botId),i);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"qq-operation-failed",message:"QQ \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function zS(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(G5,L5(t,o),{authority:fr(i)})}async function U5(n,t={}){if(t?.controller)return zS(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await VP(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=zS(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close QQ bot connections"),e}import{unlink as NGe}from"node:fs/promises";import{resolve as X5}from"node:path";import{createHash as XPe}from"node:crypto";import{mkdir as $Pe,readFile as eGe,rename as AGe,unlink as tGe,writeFile as rGe}from"node:fs/promises";import{dirname as aGe}from"node:path";var $P=Object.freeze({version:1,bots:Object.freeze([])}),H5=/^slack_[a-f0-9]{24}$/,iGe=/^DSH_SLACK_BOT_TOKEN_[A-F0-9]{24}$/,oGe=/^DSH_SLACK_APP_TOKEN_[A-F0-9]{24}$/;function Jo(n){return typeof n=="string"&&n.trim()?n.trim():null}function eG(n){let t=Jo(n);if(!t)throw new TypeError("platformId is required");let o=XPe("sha256").update(t).digest("hex").slice(0,24),i=o.toUpperCase();return{botId:`slack_${o}`,botTokenRef:`DSH_SLACK_BOT_TOKEN_${i}`,appTokenRef:`DSH_SLACK_APP_TOKEN_${i}`}}function AG(n){let t=Jo(n)??"",[o,i]=t.split(":");return o&&i?`${o.slice(0,5)}\u2022\u2022\u2022 \xB7 ${i.slice(0,5)}\u2022\u2022\u2022`:t?`${t.slice(0,6)}\u2022\u2022\u2022\u2022`:w("Slack\u673A\u5668\u4EBA")}var VS=class{#e;#A=$P;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#l(JSON.parse(await eGe(this.#e,"utf8")));if(!t)throw new Error("dsh-im Slack config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=$P}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByPlatformId(t){let o=this.#A.bots.find(i=>i.platformId===t);return o?structuredClone(o):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete Slack bot data");return this.#o(i=>{if(i.find(A=>A.botId!==o.botId&&(A.platformId===o.platformId||A.botTokenRef===o.botTokenRef||A.appTokenRef===o.appTokenRef)))throw new Error("Duplicate Slack bot identity");let a=i.findIndex(A=>A.botId===o.botId);return a===-1?i.push(o):i[a]=o,structuredClone(o)})}async remove(t){if(!H5.test(t))throw new TypeError("Invalid Slack bot id");return this.#o(o=>{let i=o.findIndex(e=>e.botId===t);return i===-1?null:structuredClone(o.splice(i,1)[0])})}async clear(){let t=this.#t.then(async()=>{try{await tGe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=$P});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=Jo(t.botId),i=Jo(t.platformId),e=Jo(t.botTokenRef),a=Jo(t.appTokenRef),A=Jo(t.name);if(!o||!i||!e||!a||!A||!H5.test(o)||!iGe.test(e)||!oGe.test(a))return null;let r=eG(i);return r.botId!==o||r.botTokenRef!==e||r.appTokenRef!==a?null:Object.freeze({botId:o,platformId:i,botTokenRef:e,appTokenRef:a,name:A,username:Jo(t.username),teamId:Jo(t.teamId),teamName:Jo(t.teamName),createdAt:Jo(t.createdAt)??new Date().toISOString(),connectedAt:Jo(t.connectedAt)})}#l(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.platformId)||a.has(A.botTokenRef)||a.has(A.appTokenRef))return null;i.add(A.botId),e.add(A.platformId),a.add(A.botTokenRef),a.add(A.appTokenRef)}return Object.freeze({version:1,bots:Object.freeze(o)})}async#o(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await $Pe(aGe(this.#e),{recursive:!0,mode:448});let A=`${this.#e}.tmp`;await rGe(A,`${JSON.stringify(a,null,2)} +`,{encoding:"utf8",mode:384}),await AGe(A,this.#e),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}};var nGe="https://slack.com/api/",Yu="files.slack.com",sGe="slack.com",K5="/files-pri/",gGe=Object.freeze([Yu]),cGe="/upload/",IGe=12e4;function Ss(n){return typeof n=="string"&&n.trim()?n.trim():null}function x5(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function Ku(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function lGe(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function Y5(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),Number.isInteger(t?.status)&&(n.status=t.status),n}function ml(n){let t="artifact-provider-failed",o="Slack file upload preparation failed";n?.code==="slack-file_upload_size_restricted"?(t="artifact-too-large",o="Slack rejected the result file because it is too large"):n?.code==="slack-missing-scope"?(t="artifact-permission-required",o="Slack file delivery requires the files:write scope"):n?.code?.startsWith?.("slack-")&&(t="artifact-provider-rejected",o="Slack rejected file upload preparation");let i=new Error(o,{cause:n});return i.code=t,Y5(i,n)}function pGe(n){let t=new Error("Slack file completion result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",Y5(t,n)}function dGe(n){return Number.isInteger(n)&&n>=300&&n<400}async function tG(n){try{await n?.body?.cancel?.()}catch{}}function hGe(n){let t=new URL(n);if(t.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(t.username||t.password||t.port&&t.port!=="443")throw new Error("Image download URL is not hosted by the messaging platform");if(t.hostname===sGe&&t.pathname.startsWith(K5)&&(t.hostname=Yu),t.hostname!==Yu||!t.pathname.startsWith(K5))throw new Error("Image download URL is not hosted by the messaging platform");return t.hash="",t}function EGe(n){let t=new URL(n);if(t.protocol!=="https:"||t.username||t.password||t.port&&t.port!=="443"||t.hostname!==Yu||!t.pathname.startsWith(cGe))throw new Error("Slack returned an unsafe file upload URL");return t.hash="",t}function CGe(n,t){let o=n?.headers?.get?.("location");if(!o)return null;try{return new URL(o,t)}catch{return null}}function uGe(n){let t=n?.headers?.get?.("x-oauth-scopes");return t==null?null:new Set(t.split(",").map(o=>o.trim()).filter(Boolean))}function BGe(n){return n?.protocol==="https:"&&!n.username&&!n.password&&(!n.port||n.port==="443")&&n.hostname.endsWith(".slack.com")&&n.hostname!==Yu&&n.pathname==="/"&&n.searchParams.has("redir")}function fGe(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Nn(n,t){let o=Ss(n);if(!o||!/^[A-Z][A-Z0-9]{4,30}$/i.test(o))throw new TypeError(`Invalid Slack ${t}`);return o}function ms(n,t){let o=Ss(n);if(!o)throw new TypeError(`Slack ${t} is required`);return o}function xu(n,{trim:t=!0}={}){let o=typeof n=="string"?n:"",i=t?o.trim():o;if(!i)throw new TypeError("Slack message text is required");return i.replace(/<@([A-Z0-9]+)>/gi,"@$1").replace(/]*)?>/gi,"@$1")}function QGe(n,t,o){let i=Ss(t?.error)??"unknown_error",e=new Error(`Slack ${n} failed: ${i.replaceAll("_"," ")}`);return e.providerCode=i,["invalid_auth","not_authed","token_revoked","account_inactive"].includes(i)?e.code=o==="app"?"slack-invalid-app-token":"slack-invalid-bot-token":i==="missing_scope"?e.code="slack-missing-scope":i==="method_not_supported_for_channel_type"||i==="channel_type_not_supported"||i==="deprecated_endpoint"?e.code="slack-stream-unavailable":e.code=`slack-${i}`,e}function j5(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())}function J5(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())}var ju=class{#e;#A;#t;#r;#l=null;#o;constructor({botToken:t,appToken:o,fetchImpl:i=fetch,baseUrl:e=nGe,fileUploadTimeoutMs:a=IGe}){if(t!==void 0&&!j5(t))throw new TypeError("Slack Bot Token is invalid");if(o!==void 0&&!J5(o))throw new TypeError("Slack App Token is invalid");if(!t&&!o)throw new TypeError("SlackApi requires a token");if(typeof i!="function")throw new TypeError("SlackApi requires fetch");this.#e=t?.trim(),this.#A=o?.trim(),this.#t=i,this.#r=new URL(e),this.#o=lGe(a,"fileUploadTimeoutMs")}authTest(t={}){return this.#a("auth.test",{...t,tokenKind:"bot"})}openConnection(t={}){return this.#a("apps.connections.open",{...t,tokenKind:"app",body:void 0})}async fileInfo({fileId:t,signal:o}={}){let i=await this.#a("files.info",{tokenKind:"bot",signal:o,body:{file:Nn(t,"file id")}});if(!i?.file||typeof i.file!="object"||Array.isArray(i.file))throw new Error("Slack files.info returned no file object");return i.file}postMessage({channelId:t,text:o,threadTs:i,signal:e}){return this.#a("chat.postMessage",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),text:xu(o),...i?{thread_ts:Ss(i)}:{},mrkdwn:!0,link_names:!1,unfurl_links:!1,unfurl_media:!1}})}updateMessage({channelId:t,ts:o,text:i,signal:e}){return this.#a("chat.update",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),ts:ms(o,"message timestamp"),text:xu(i),parse:"none",link_names:!1}})}addReaction({channelId:t,messageTs:o,emojiName:i,signal:e,timeoutMs:a}){return this.#a("reactions.add",{tokenKind:"bot",signal:e,timeoutMs:a,retry:!1,body:{channel:Nn(t,"channel id"),timestamp:ms(o,"message timestamp"),name:ms(i,"reaction name")}})}removeReaction({channelId:t,messageTs:o,emojiName:i,signal:e,timeoutMs:a}){return this.#a("reactions.remove",{tokenKind:"bot",signal:e,timeoutMs:a,retry:!1,body:{channel:Nn(t,"channel id"),timestamp:ms(o,"message timestamp"),name:ms(i,"reaction name")}})}startStream({channelId:t,threadTs:o,recipientTeamId:i,recipientUserId:e,markdownText:a,signal:A}){return this.#a("chat.startStream",{tokenKind:"bot",signal:A,body:{channel:Nn(t,"channel id"),thread_ts:ms(o,"thread timestamp"),...i?{recipient_team_id:Nn(i,"team id")}:{},...e?{recipient_user_id:Nn(e,"user id")}:{},...Ss(a)?{markdown_text:xu(a)}:{}}})}appendStream({channelId:t,ts:o,markdownText:i,signal:e}){return this.#a("chat.appendStream",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),ts:ms(o,"stream timestamp"),markdown_text:xu(i,{trim:!1})}})}stopStream({channelId:t,ts:o,markdownText:i,signal:e}){return this.#a("chat.stopStream",{tokenKind:"bot",signal:e,body:{channel:Nn(t,"channel id"),ts:ms(o,"stream timestamp"),...Ss(i)?{markdown_text:xu(i,{trim:!1})}:{}}})}async uploadFile({channelId:t,threadTs:o,file:i,signal:e}){if(!i||typeof i!="object"||typeof i.fileName!="string"||!i.fileName||!Buffer.isBuffer(i.bytes))throw new TypeError("A Slack file is required");if(e?.aborted)throw Ku(e);let a=x5(e,this.#o),A;try{A=await this.#a("files.getUploadURLExternal",{tokenKind:"bot",signal:a,timeoutMs:this.#o,body:{filename:i.fileName,length:i.bytes.byteLength}})}catch(I){throw e?.aborted?Ku(e):ml(I)}let r,s;try{r=ms(A?.file_id,"file id"),s=EGe(A?.upload_url)}catch(I){throw ml(I)}let g;try{g=await this.#t(s,{method:"POST",headers:{"content-type":i.mediaType??"application/octet-stream"},body:i.bytes,signal:a,redirect:"error"})}catch(I){throw e?.aborted?Ku(e):ml(I)}if(!Number.isInteger(g?.status))throw ml(new Error("Slack file upload returned an invalid response"));if(g.status!==200){await tG(g);let I=new Error(`Slack file upload failed with HTTP ${g.status}`);throw I.status=g.status,g.status===413?I.code="artifact-too-large":g.status===429?I.code="artifact-rate-limited":I.code="artifact-provider-rejected",I}await tG(g);let c;try{c={files:[{id:r,title:i.fileName}],channel_id:Nn(t,"channel id"),...o?{thread_ts:ms(o,"thread timestamp")}:{}}}catch(I){throw ml(I)}if(a.aborted)throw e?.aborted?Ku(e):ml(a.reason);try{let I=await this.#a("files.completeUploadExternal",{tokenKind:"bot",signal:a,timeoutMs:this.#o,retry:!1,body:c});if(!Array.isArray(I?.files)||!I.files.some(d=>Ss(d?.id)===r))throw new Error("Slack file completion did not confirm the uploaded file");return I}catch(I){throw e?.aborted?Ku(e):I?.code==="slack-missing-scope"?ml(I):pGe(I)}}async downloadFile({url:t,signal:o,maxBytes:i}){return this.#i({url:t,signal:o,maxBytes:i,stream:!1})}async downloadFileStream({url:t,signal:o}){return this.#i({url:t,signal:o,stream:!0})}async#i({url:t,signal:o,maxBytes:i,stream:e}){if(!this.#e)throw new TypeError("Slack bot token is required for file download");let a=hGe(t),r={fetchImpl:async(s,g)=>{let c=await this.#t(s,g);if(!dGe(c?.status))return c;let I=CGe(c,s);if(this.#l&&!this.#l.has("files:read")||BGe(I))throw await tG(c),new ut("slack-file-access-required","Slack redirected a private file request to the workspace because file access was not granted",w("Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002"));return c},headers:{authorization:`Bearer ${this.#e}`},signal:o,allowedHosts:gGe};return e?Yp(a,r):Do(a,{...r,maxBytes:i})}async#a(t,{tokenKind:o,body:i,signal:e,timeoutMs:a=15e3,retry:A=!0}){let r=o==="app"?this.#A:this.#e;if(!r)throw new TypeError(`Slack ${o} token is required for ${t}`);let s=t==="files.getUploadURLExternal"||t==="files.info",g;try{g=await this.#t(new URL(t,this.#r),{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":i===void 0||s?"application/x-www-form-urlencoded;charset=utf-8":"application/json;charset=utf-8","user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.2.2)"},...i===void 0?{}:{body:s?new URLSearchParams(i).toString():JSON.stringify(i)},signal:x5(e,a),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Slack ${t} transport failed`)}if(o==="bot"){let I=uGe(g);I&&(this.#l=I)}let c;try{c=await g.json()}catch{throw new Error(`Slack ${t} returned invalid JSON`)}if(g.status===429&&A){let I=Number(g.headers.get("retry-after"))||1;return await fGe(Math.min(1e4,Math.max(100,I*1e3)),e),this.#a(t,{tokenKind:o,body:i,signal:e,timeoutMs:a,retry:!1})}if(!g.ok||c?.ok!==!0){let I=QGe(t,c,o);throw I.status=g.status,I}return c}};async function q5({botToken:n,appToken:t},o={}){if(!j5(n)){let r=new TypeError(w("Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002"));throw r.code="slack-invalid-bot-token",r}if(!J5(t)){let r=new TypeError(w("Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002"));throw r.code="slack-invalid-app-token",r}let i=new ju({botToken:n,appToken:t,...o}),[e,a]=await Promise.all([i.authTest(),i.openConnection()]);if(!e?.team_id||!e?.user_id||!e?.bot_id)throw new Error(w("Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002"));let A;try{A=new URL(a?.url)}catch{A=null}if(!A||A.protocol!=="wss:"){let r=new Error(w("Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002"));throw r.code="slack-socket-mode",r}return{platformId:`${e.team_id}:${e.user_id}`,name:Ss(e.user)??"DeepSeek Harness",username:Ss(e.user),teamId:String(e.team_id),teamName:Ss(e.team)}}var rG=Object.freeze({key:"slack",label:"Slack",connectionLabel:" Socket Mode \u957F\u8FDE\u63A5",reactions:Object.freeze({processing:"eyes",success:"white_check_mark",error:"x"})}),WS=class extends ns{constructor(t){super({descriptor:rG,...t})}};function Ng(n){return typeof n=="string"&&n.trim()?n.trim():null}function ZS(n,t){return Object.freeze({code:n,message:t})}var Ju=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=0;#p=!1;constructor({credentials:t,configStore:o,inspectCredentials:i=q5,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.resolve!="function"||typeof t.set!="function"||typeof t.unset!="function")throw new TypeError("Slack requires the DSH credential provider");if(!o||typeof o.list!="function"||typeof o.save!="function"||typeof o.remove!="function")throw new TypeError("Slack requires a config store");if(typeof i!="function"||typeof e!="function")throw new TypeError("Slack controller dependencies are incomplete");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#p)return this.status();for(let t of this.#A.list())await this.#h(t.botId,async()=>{if(this.#p||this.#i.get(t.botId)?.status?.ready)return;let o=await this.#I(t);if(!o){this.#a.set(t.botId,ZS("missing-token",w("Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002")));return}try{await this.#c(t,o),this.#a.delete(t.botId)}catch(i){this.#a.set(t.botId,ZS("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${t.botId} failed to initialize:`,i)}finally{this.#C()}});return this.status()}async bindCredentials({botToken:t,appToken:o}={}){if(this.#p)throw new Error("Slack controller is closed");let i=Ng(t),e=Ng(o);if(!i||!e)throw new TypeError("Slack Bot Token and App Token are required");let a=await this.#t({botToken:i,appToken:e}),A=Ng(a?.platformId),r=Ng(a?.name);if(!A||!r)throw new Error("Slack returned an invalid bot identity");let s=eG(A);return await this.#h(s.botId,async()=>{if(this.#p)throw new Error("Slack controller is closed");let g=this.#A.getByPlatformId(A),c=await this.#e.resolve(s.botTokenRef).catch(()=>{}),I=await this.#e.resolve(s.appTokenRef).catch(()=>{}),d={...s,platformId:A,name:r,username:Ng(a.username),teamId:Ng(a.teamId),teamName:Ng(a.teamName),createdAt:g?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};try{await this.#e.set(s.botTokenRef,i),await this.#e.set(s.appTokenRef,e),await this.#A.save(d)}catch(B){throw await Promise.all([this.#d(s.botTokenRef,c),this.#d(s.appTokenRef,I)]),B}try{await this.#c(d,{botToken:i,appToken:e}),this.#a.delete(s.botId)}catch(B){this.#a.set(s.botId,ZS("connection-failed",w("Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${s.botId} credential connection failed:`,B)}this.#C()}),this.status()}async reconnectBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#h(t,async()=>{let i=await this.#I(o);if(!i)throw new Error("Slack bot credentials are missing");try{await this.#c(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,ZS("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002"))),e}finally{this.#C()}}),this.status()}async sendConnectionTest(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return this.#h(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let e=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return await i.sendConnectionTest(Ra(`${o.name}\uFF08${AG(o.platformId)}\uFF09`,w("Slack\u673A\u5668\u4EBA"))),{sent:!0}})}async sendProactiveText(t,o,i,e={}){if(!this.#A.get(t))throw new Error("Unknown Slack bot");return this.#h(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#h(t,async()=>{let i=await this.#e.resolve(o.botTokenRef).catch(()=>{}),e=await this.#e.resolve(o.appTokenRef).catch(()=>{});await this.#g(t);try{await this.#e.unset(o.botTokenRef),await this.#e.unset(o.appTokenRef),await this.#A.remove(t)}catch(a){throw await Promise.all([this.#d(o.botTokenRef,i),this.#d(o.appTokenRef,e)]),i?.value&&e?.value&&await this.#c(o,{botToken:i.value,appToken:e.value}).catch(()=>{}),new Error("Unable to remove the Slack bot safely.",{cause:a})}await this.#l({botId:t,config:o}).catch(a=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} state cleanup failed:`,a)}),this.#a.delete(t),this.#C()}),this.status()}status(){let t=this.#A.list().map(i=>{let e=this.#i.get(i.botId)?.status??null,a=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=a?"connected":e?.connectionState==="connecting"?"connecting":this.#a.has(i.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:i.botId,state:A,connected:a,configured:!0,bot:{name:i.name,username:i.username,teamName:i.teamName,idMasked:AG(i.platformId)},health:{status:a?"healthy":A==="error"?"error":"offline",summary:a?w(`Slack${rG.connectionLabel}\u8FD0\u884C\u6B63\u5E38`):A==="error"?w("Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:Xr(e?.lastMessageError),error:structuredClone(this.#a.get(i.botId)??null)}}),o=t.filter(i=>i.connected).length;return{schemaVersion:1,revision:this.#s,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#p||(this.#p=!0,await Promise.allSettled([...this.#n.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#g(t))))}async#c(t,{botToken:o,appToken:i}){if(this.#p)throw new Error("Slack controller is closed");if(await this.#g(t.botId),this.#p)throw new Error("Slack controller is closed");let e=await this.#r({botId:t.botId,config:t,botToken:o,appToken:i});if(!e||typeof e.start!="function"||typeof e.stop!="function")throw new TypeError("createRuntime returned an invalid Slack runtime");this.#i.set(t.botId,e);try{await e.start()}catch(a){throw await e.stop().catch(()=>{}),this.#i.delete(t.botId),a}}async#g(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} failed to stop cleanly:`,i)})}async#I(t){let[o,i]=await Promise.all([this.#e.resolve(t.botTokenRef).catch(()=>{}),this.#e.resolve(t.appTokenRef).catch(()=>{})]),e=Ng(o?.value),a=Ng(i?.value);return e&&a?{botToken:e,appToken:a}:null}async#d(t,o){o?.value?await this.#e.set(t,o.value).catch(()=>{}):await this.#e.unset(t).catch(()=>{})}#h(t,o){let a=(this.#n.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#n.get(t)===a&&this.#n.delete(t)});return this.#n.set(t,a),a}#C(){this.#s+=1}};var XS=class extends ur{constructor(t){super({...t,rpcIdPrefix:"slack",logPrefix:"dsh-slack"})}};var z5=Object.freeze([1e3,3e3,5e3,1e4,3e4]),iG=38e3,V5=11e3,Z5=new Set(["image/jpeg","image/png","image/webp","image/gif"]);function aG(n,t,o){if(typeof n.addEventListener=="function")n.addEventListener(t,o);else if(typeof n.on=="function")n.on(t,o);else throw new TypeError("Slack WebSocket does not support events")}function yGe(n){let t=n?.data??n;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString("utf8"):t instanceof ArrayBuffer?Buffer.from(t).toString("utf8"):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):null}function mGe(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Slack returned an insecure Socket Mode URL");return t.href}function SGe(n){return typeof n=="string"?n.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"):""}function wGe(n,t){return SGe(n).replace(new RegExp(`<@${t}>`,"gi"),"").trim()}function oG(n){return typeof n?.url_private_download=="string"&&n.url_private_download?n.url_private_download:n?.url_private}function DGe(n,t){let o=typeof n?.mimetype=="string"?n.mimetype.toLowerCase():"",i=oG(n);return!Z5.has(o)||typeof i!="string"||!i?null:{name:typeof n.name=="string"?n.name:void 0,mediaType:o,size:Number.isSafeInteger(n.size)&&n.size>=0?n.size:void 0,load:e=>t(i,e)}}function OGe(n,t,o){let i=typeof n?.mimetype=="string"&&n.mimetype?n.mimetype.toLowerCase():void 0,e=oG(n);if(Z5.has(i))return null;let a=n?.file_access==="check_file_info"&&typeof n?.id=="string"&&n.id;return(typeof e!="string"||!e)&&!a?null:{name:typeof n?.name=="string"&&n.name?n.name:typeof n?.title=="string"&&n.title?n.title:a?n.id:"slack-file",...i?{mediaType:i}:{},size:Number.isSafeInteger(n?.size)&&n.size>=0?n.size:void 0,load:async({signal:A}={})=>{if(!a)return t(e,{signal:A});let r=await o(n.id,{signal:A}),s=oG(r);if(typeof s!="string"||!s)throw new Error("Slack files.info returned no downloadable URL");let g=await t(s,{signal:A}),c=typeof r?.name=="string"&&r.name?r.name:typeof r?.title=="string"&&r.title?r.title:n.id,I=typeof r?.mimetype=="string"&&r.mimetype?r.mimetype.toLowerCase():void 0;return Buffer.isBuffer(g)||g instanceof Uint8Array?{data:g,name:c,...I?{mediaType:I}:{}}:{...g,name:c,...I?{mediaType:I}:{}}}}}function bGe(n,t,{loadFile:o=async()=>{throw new Error("Slack file downloader is unavailable")},loadFileStream:i=o,loadFileInfo:e=async()=>{throw new Error("Slack file metadata loader is unavailable")}}={}){let a=n?.event;if(!a||!n?.event_id||!a.channel||!a.user||!a.ts)return null;let A=a.type==="message"&&a.channel_type==="im",r=a.type==="app_mention";if(!A&&!r||a.subtype&&a.subtype!=="file_share"||a.bot_id||a.app_id)return null;let s=String(a.thread_ts??a.ts);return{messageId:String(n.event_id),senderId:String(a.user),senderIsBot:String(a.user)===String(t),kind:A?"direct":"group",conversationId:A?String(a.channel):`${a.channel}:${s}`,content:wGe(a.text??"",t),plainText:!Array.isArray(a.files)||a.files.length===0,images:Array.isArray(a.files)?a.files.map(g=>DGe(g,o)).filter(Boolean):[],files:Array.isArray(a.files)?a.files.map(g=>OGe(g,i,e)).filter(Boolean):[],addressed:A||r,reactionTarget:{channelId:String(a.channel),messageTs:String(a.ts)},replyTarget:{channelId:String(a.channel),threadTs:s,recipientUserId:String(a.user),recipientTeamId:String(a.user_team??n.team_id??"")},connectionTestTarget:{channelId:String(a.channel)}}}function MGe(n){if(typeof n!="string")return!1;let t="__DSH_IM_TOOL_NAME__",o=w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:t}),i=o.indexOf(t);if(i<0)return!1;let e=o.slice(0,i),a=o.slice(i+t.length),A=n.trim();return A.startsWith(e)&&A.endsWith(a)&&A.length>e.length+a.length}async function W5(n,t,o,i,e){if(i)for(let a=0;a{let y=ss(Q,iG)[0]??"";if(!y||!y.startsWith(A))return;let m=y.slice(A.length);m&&(await W5(n,t,a,m,o),A=y)},f=()=>{I||c||s!==null||g||!r||(s=setTimeout(()=>{s=null;let Q=r;r="",g=B(Q).catch(y=>{c=!0,i.warn?.("[dsh-im:slack] streaming append failed:",y)}).finally(()=>{g=null,f()})},350),s?.unref?.())};return{messageId:a,get providerMessageIds(){return[...d]},update(Q){I||c||typeof Q!="string"||!Q.trim()||MGe(Q)||(r=Q,f())},async finish(Q){if(I)throw new Error("Slack message stream is already closed");I=!0,s!==null&&clearTimeout(s),s=null,r="",await g?.catch(()=>{});let y=ss(Q,iG),m=y[0]??w("\u5904\u7406\u5B8C\u6210\u3002");!c&&m.startsWith(A)?(await W5(n,t,a,m.slice(A.length),o),await n.stopStream({channelId:t.channelId,ts:a,signal:o})):(await n.stopStream({channelId:t.channelId,ts:a,signal:o}).catch(()=>{}),await n.updateMessage({channelId:t.channelId,ts:a,text:m,signal:o}));for(let T of y.slice(1)){let _=await n.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:T,signal:o});typeof _?.ts=="string"&&_.ts&&d.push(_.ts)}},cancel(){I=!0,r="",s!==null&&clearTimeout(s),s=null,n.stopStream({channelId:t.channelId,ts:a,signal:o}).catch(()=>{})}}}var nG=class{#e;#A;#t;constructor({api:t,signal:o,logger:i}){this.#e=t,this.#A=o,this.#t=i}async sendText(t,o){let i=ss(o,iG),e=[];for(let a of i){let A=await this.#e.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:a,signal:this.#A});typeof A?.ts=="string"&&A.ts&&e.push(A.ts)}return{providerMessageIds:e}}async addReaction(t,o,{signal:i}={}){let e=String(o??"").trim();return await this.#e.addReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:e,signal:i??this.#A}),e}removeReaction(t,o,{signal:i}={}){return this.#e.removeReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:o,signal:i??this.#A})}openStream(t){return _Ge({api:this.#e,target:t,signal:this.#A,logger:this.#t})}sendFile(t,o){return this.#e.uploadFile({channelId:t.channelId,threadTs:t.threadTs,file:o,signal:this.#A})}};function TGe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...io()}}var qu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g=TGe();#I=null;#d=null;#h=null;#C=null;#u=null;#B=null;#f=0;#Q=0;#S=!0;#y=null;constructor({config:t,botToken:o,appToken:i,harness:e,state:a,contextEnhancement:A,accessPolicy:r,logger:s=console,replyTimeoutMs:g=6e5,connectTimeoutMs:c=2e4,createApi:I=B=>new ju(B),createWebSocket:d=B=>new WebSocket(B)}){if(!t||!o||!i||!e||!a)throw new TypeError("SlackRuntime requires config, both tokens, Harness, and state");if(typeof d!="function")throw new TypeError("SlackRuntime requires WebSocket");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=d}get status(){return structuredClone(this.#g)}async sendConnectionTest(t){if(!this.#g.ready||!this.#d){let o=new Error("Slack bot is not connected");throw o.code="test-target-unavailable",o}return this.#d.sendConnectionTest(t)}async sendProactiveText(t,o,i={}){if(!this.#g.ready||!this.#d){let A=new Error("Slack bot is not connected");throw A.code="bot-not-connected",A}let e=typeof t?.route?.channelId=="string"?t.route.channelId.trim():"",a=typeof t?.route?.threadTs=="string"?t.route.threadTs.trim():"";if(!e||t?.kind!=="conversation"&&t?.kind!=="thread"||t.kind==="thread"&&!a||t.kind==="conversation"&&a){let A=new TypeError("Invalid Slack proactive delivery target");throw A.code="invalid-target",A}return this.#d.sendProactiveText({channelId:e,...a?{threadTs:a}:{}},o,i)}async start(){return this.#g.ready&&this.#C?this.status:this.#y?this.#y:(this.#y=this.#m().finally(()=>{this.#y=null}),this.#y)}async#m(){await this.stop(),this.#S=!1,this.#f=0,this.#g.startedAt=new Date().toISOString(),this.#g.connectionState="connecting",this.#g.lastError=null,await this.#r.ensureRunning(),this.#g.harnessReachable=!0;let t=new AbortController;this.#h=t;let o=this.#p({botToken:this.#A,appToken:this.#t});this.#I=o;try{let i=await o.authTest({signal:t.signal});if(`${i?.team_id}:${i?.user_id}`!==this.#e.platformId)throw new Error("Slack Bot Token identity does not match the saved bot");let e=new nG({api:o,signal:t.signal,logger:this.#a});this.#d=new WS({bot:e,harness:this.#r,state:this.#l,contextEnhancement:this.#o,accessPolicy:this.#i,status:this.#g,logger:this.#a,replyTimeoutMs:this.#n,signal:t.signal});let a;try{await Promise.race([this.#D(),new Promise((A,r)=>{a=setTimeout(()=>r(new Error("Slack Socket Mode did not become ready in time")),this.#s),a?.unref?.()})])}finally{clearTimeout(a)}return this.status}catch(i){throw this.#g.ready=!1,this.#g.connectionState="failed",this.#g.lastError=i?.message??String(i),await this.stop(),i}}async#D(){if(this.#S)throw new Error("Slack runtime is stopped");let t=await this.#I.openConnection({signal:this.#h?.signal});return this.#E(t?.url)}#E(t){if(this.#S)return Promise.reject(new Error("Slack runtime is stopped"));let o=++this.#Q,i=this.#c(mGe(t));this.#C=i;let e=!1;return new Promise((a,A)=>{let r=s=>{if(e||o!==this.#Q)return;e=!0,this.#u=s?.connection_info?.app_id??null,this.#f=0;let g=Date.now();this.#g.ready=!0,this.#g.connectionState="connected",this.#g.lastCheckedAt=g,this.#g.lastConnectedAt=g,this.#g.lastError=null,a()};aG(i,"message",s=>{if(o!==this.#Q||this.#S)return;let g=yGe(s);if(!g)return;let c;try{c=JSON.parse(g)}catch{this.#a.warn?.("[dsh-im:slack] ignored malformed Socket Mode JSON");return}if(c.type==="hello"){r(c);return}if(c.envelope_id&&i.readyState===1&&(i.send(JSON.stringify({envelope_id:c.envelope_id})),this.#g.lastCheckedAt=Date.now()),c.type==="disconnect"){i.close(4e3,"Slack requested reconnect");return}if(c.type!=="events_api"||c.payload?.type!=="event_callback"||this.#u&&c.payload.api_app_id&&c.payload.api_app_id!==this.#u)return;let I=bGe(c.payload,this.#e.platformId.split(":")[1],{loadFile:(B,f)=>this.#I.downloadFile({url:B,...f}),loadFileStream:(B,f)=>this.#I.downloadFileStream({url:B,...f}),loadFileInfo:(B,f)=>this.#I.fileInfo({fileId:B,...f})}),d=this.#d;I&&d&&d.accept(I).catch(B=>{o!==this.#Q||this.#S||this.#a.error?.(`[dsh-im:slack] bot ${this.#e.botId} message handling failed:`,B)})}),aG(i,"close",(s={})=>{if(o!==this.#Q)return;if(this.#C===i&&(this.#C=null),this.#S){e||A(new DOMException("Stopped","AbortError"));return}let g=Number(s.code)||0,c=new Error(`Slack Socket Mode closed (${g||"unknown"})`);this.#g.ready=!1,this.#g.connectionState="connecting",this.#g.lastError=c.message,e||(e=!0,A(c)),this.#N()}),aG(i,"error",()=>{o!==this.#Q||this.#S||(this.#g.lastError="Slack Socket Mode WebSocket error")})})}#N(){if(this.#S||this.#B!==null)return;let t=z5[Math.min(this.#f,z5.length-1)];this.#f+=1,this.#B=setTimeout(()=>{this.#B=null,this.#D().catch(o=>{this.#S||(this.#a.warn?.("[dsh-im:slack] Socket Mode reconnect failed:",o),this.#N())})},t),this.#B?.unref?.()}async stop(){this.#S=!0,this.#Q+=1,this.#h?.abort(),this.#h=null,this.#B!==null&&clearTimeout(this.#B),this.#B=null;let t=this.#C,o=this.#d;this.#C=null,this.#d=null,this.#I=null,this.#u=null;try{t&&t.readyState<2&&t.close(1e3,"Plugin stopped")}catch(i){this.#a.warn?.(`[dsh-im:slack] bot ${this.#e.botId} failed to close Socket Mode:`,i)}return await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(i=>setTimeout(i,2e3))]),this.#g.ready=!1,this.#g.connectionState="idle",this.status}};var $S=class extends gs{};async function sG(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-im slack requires ctx.credentials");let i=aa(n,t),e=o.ConfigStore??VS,a=o.StateStore??$S,A=o.HarnessClient??XS,r=o.Controller??Ju,s=o.Runtime??qu,g=o.createConnectionSupervisor??jp,c=typeof n.logger=="function"?n.logger("dsh-im:slack"):n.logger??console,I=()=>La(n),d=W_(t,"slack"),B=await new e(d.config).load(),f=X5(t.workspace??process.cwd()),Q=o.WorkspaceStore??ra,y=o.workspaces??await new Q(d.workspaces,{defaultWorkspace:f}).load(),m=B.list();await y.reconcile(m.map(N=>N.botId)),await Promise.all(m.map(N=>y.ensure(N.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("slack",N)})));let T=typeof B.remove=="function"?Ha(B,{workspaces:y}):B,_=new Map,R=N=>X5(d.bots,N,"state.json"),K=async N=>{let k=_.get(N);return k||(k=await new a(R(N)).load(),_.set(N,k)),k},L=ja(n,o.commandExecutor),{controlExecutor:F,sessionMaintenanceExecutor:q,fileIngressExecutor:V}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),x=new A({...i,workspace:f,autostart:!1,dshBin:t.dshBin??"dsh",...L?{commandExecutor:L}:{},...F?{controlExecutor:F}:{},...q?{sessionMaintenanceExecutor:q}:{},...V?{fileIngressExecutor:V}:{}}),G=new r({credentials:n.credentials,configStore:T,logger:c,...o.inspectCredentials?{inspectCredentials:o.inspectCredentials}:{},createRuntime:async({botId:N,config:k,botToken:z,appToken:Ae})=>{let ie=await K(N);await y.ensure(N,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("slack",k)});let we=Ka(x,{botId:N,workspaces:y,state:ie,agentPresetCatalog:I});return new s({config:k,botToken:z,appToken:Ae,harness:we.harness,state:we.state,contextEnhancement:{botId:N,getSettings:()=>y.contextEnhancementFor(N)},accessPolicy:qa(y,N,{channel:"slack",config:k}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...se)=>c.error?.(`[${N}]`,...se),warn:(...se)=>c.warn?.(`[${N}]`,...se),info:(...se)=>c.info?.(`[${N}]`,...se),debug:(...se)=>c.debug?.(`[${N}]`,...se)}})},deleteState:async({botId:N})=>{let k=_.get(N);if(_.delete(N),k&&typeof k.remove=="function")await k.remove();else try{await NGe(R(N))}catch(z){if(z?.code!=="ENOENT")throw z}}}),J=xa(G,{workspaces:y,stateFor:K,agentPresetCatalog:I}),U=g({channel:"slack",controller:J,harness:x,logger:c,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:J,deliveryAdapter:Ya({channel:"slack",workspaces:y,coreController:G,stateFor:K}),ready:U.ready,async close(){await U.close(),await J.close(),x.stopManagedProcess()}}}var eZ="/slack",ya=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),AZ=Object.freeze(Object.values(ya)),RGe=new Set(["token","botToken","appToken","botTokenRef","appTokenRef","tokenRef","platformId","secret","secretRef"]);function cG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function ew(n,t){return cG(n)&&Object.keys(n).every(o=>t.includes(o))}function $5(n){return typeof n=="string"&&/^slack_[a-f0-9]{24}$/.test(n)}function kGe(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function vGe(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function PGe(n,t){return cG(t)?n===ya.status?ew(t,[])?null:"connection.status does not accept fields.":n===ya.bindCredentials?ew(t,["botToken","appToken"])&&kGe(t.botToken)&&vGe(t.appToken)?null:"bot.bind-credentials requires xoxb Bot Token and xapp App Token.":n===ya.reconnectBot?ew(t,["botId","sendTest"])&&$5(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId.":n===ya.deleteBot?ew(t,["botId","confirm"])&&$5(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===ya.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===ya.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===ya.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===ya.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown Slack endpoint.":"Payload must be an object."}function gG(n){if(Array.isArray(n))return n.map(gG);if(!cG(n))return n;let t={};for(let[o,i]of Object.entries(n))RGe.has(o)||(t[o]=gG(i));return t}function GGe(n){let t=Xa(n);return t||(n?.code==="slack-invalid-bot-token"?{code:"invalid-bot-token",message:"Slack Bot Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xoxb- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-invalid-app-token"?{code:"invalid-app-token",message:"Slack App Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xapp- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-missing-scope"?{code:"missing-scope",message:"Slack \u5E94\u7528\u6743\u9650\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u91CD\u65B0\u5BFC\u5165 Manifest \u5E76\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002"}:n?.code==="slack-socket-mode"?{code:"socket-mode-unavailable",message:n.message}:{code:"slack-operation-failed",message:"Slack \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"})}function tZ(n){for(let t of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[t]!="function")throw new TypeError(`A complete Slack controller is required (${t})`);return async(t,o,i)=>{if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!AZ.includes(t))return{ok:!1,error:{code:"bad-request",message:"Unknown Slack endpoint."}};let e=PGe(t,o);if(e)return{ok:!1,error:{code:"bad-request",message:e}};try{let a;if(t===ya.status)a=await n.status();else if(t===ya.bindCredentials)a=await n.bindCredentials(o);else if(t===ya.reconnectBot){if(a=await n.reconnectBot(o.botId),i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(o.sendTest===!0){let A=null;try{if(a?.bots?.find(r=>r?.botId===o.botId)?.connected!==!0){let r=new Error("Bot is not connected");throw r.code="test-target-unavailable",r}if(typeof n.sendConnectionTest!="function"){let r=new Error("Connection test is unavailable");throw r.code="test-target-unavailable",r}await n.sendConnectionTest(o.botId)}catch(r){A=r}a={...a,testMessage:or(A)}}}else if(t===ya.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");a=await n.updateWorkspace(o.botId,o.workspace)}else if(t===ya.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");a=await n.updateContextEnhancement(o.botId,o.config)}else if(t===ya.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");a=await n.updateAccessPolicy(o.botId,o.policy)}else if(t===ya.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");a=await n.updateAgentPreset(o.botId,o.agentPreset)}else a=await n.deleteBot(o.botId);return i?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:gG(a)}}catch(a){return i?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:GGe(a)}}}}function Aw(n,t,o){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(eZ,tZ(t),{authority:fr(o)})}async function rZ(n,t={}){if(t?.controller)return Aw(n,t.controller,t.rpcAuthority);let o=await sG(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Aw(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Slack bot connections"),e}var aZ=Object.freeze({botPrefix:"telegram",tokenRefPrefix:"DSH_TELEGRAM_BOT_TOKEN"}),IG=Object.freeze({compatible:"compatible",privateAllowlist:"private-allowlist"}),FGe=/^[1-9]\d{0,15}$/;function iZ(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedUsers must be an array of numeric Telegram User IDs");let t=n.map(o=>{let i=typeof o=="number"&&Number.isSafeInteger(o)?String(o):typeof o=="string"?o.trim():"";if(!FGe.test(i))throw new TypeError("allowedUsers contains an invalid Telegram User ID");return i});return Object.freeze([...new Set(t)])}function rw(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("Telegram access policy must be an object");let t=n.accessMode??IG.compatible;if(!Object.values(IG).includes(t))throw new TypeError("Telegram accessMode must be compatible or private-allowlist");return Object.freeze({accessMode:t,allowedUsers:iZ(n.allowedUsers)})}function LGe(n){let t=Object.hasOwn(n,"accessMode"),o=Object.hasOwn(n,"allowedUsers");if(!t&&!o)return{};try{let i=rw(n);return{...t?{accessMode:i.accessMode}:{},...o||t?{allowedUsers:i.allowedUsers}:{}}}catch{return null}}function oZ(n){return eC(n,aZ)}function nZ(n){return YQ(n,w("Telegram\u673A\u5668\u4EBA"))}var tw=class extends Kp{constructor(t){super(t,{channel:"Telegram",...aZ,normalizeBotExtension:LGe})}async save(t){let o=t?.platformId?this.getByPlatformId(String(t.platformId)):null;return super.save({...o,...t})}};var aw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"telegram",logPrefix:"dsh-telegram"})}};var UGe="https://api.telegram.org/",sZ=Object.freeze(["api.telegram.org"]),HGe=12e4;function Rg(n){return typeof n=="string"&&n.trim()?n.trim():null}function gZ(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function lG(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function KGe(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function IZ(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function pG(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("A Telegram rich message is required");let t=["markdown","html","blocks"].filter(i=>n[i]!==void 0);if(t.length!==1)throw new TypeError("A Telegram rich message requires exactly one format");let o=t[0];if((o==="markdown"||o==="html")&&(typeof n[o]!="string"||!n[o].trim()))throw new TypeError("Telegram rich message text is invalid");if(o==="blocks"&&!Array.isArray(n.blocks))throw new TypeError("Telegram rich message blocks are invalid");return n}function xGe(n,t="document"){let o=Number(n?.providerCode),i=Number(n?.status),e=Rg(n?.message)??"",a="artifact-provider-rejected",A=`Telegram rejected the ${t}.`;o===401||o===403||i===401||i===403?(a="artifact-permission-required",A=`Telegram denied permission to send the ${t}.`):o===413||i===413||/(?:file|request|entity).{0,20}(?:too (?:big|large)|size limit)|too (?:big|large)/i.test(e)?(a="artifact-too-large",A=`The ${t} exceeds Telegram's size limit.`):o===429||i===429?(a="artifact-rate-limited",A=`Telegram rate-limited ${t} delivery.`):(o>=500||i>=500)&&(a="artifact-delivery-uncertain",A=`Telegram ${t} delivery result is uncertain.`);let r=new Error(A,{cause:n});return r.code=a,IZ(r,n)}function cZ(n,t="document"){let o=new Error(`Telegram ${t} delivery result is uncertain`,{cause:n});return o.code="artifact-delivery-uncertain",IZ(o,n)}function YGe(n){return typeof n=="string"&&/^\d{5,20}:[A-Za-z0-9_-]{20,}$/.test(n.trim())}var jGe=/^[a-z0-9_]{1,32}$/;function JGe(n){return!!n&&typeof n=="object"&&!Array.isArray(n)&&typeof n.command=="string"&&jGe.test(n.command)&&typeof n.description=="string"&&n.description.length>=1&&n.description.length<=256}var dG=Object.freeze({type:"commands"}),zu=class{#e;#A;#t;#r;#l;constructor({token:t,fetchImpl:o=fetch,FormDataImpl:i=globalThis.FormData,baseUrl:e=UGe,fileUploadTimeoutMs:a=HGe}){if(!YGe(t))throw new TypeError("Telegram Bot Token is invalid");if(typeof o!="function")throw new TypeError("TelegramApi requires fetch");if(typeof i!="function")throw new TypeError("TelegramApi requires FormData");this.#e=t.trim(),this.#A=o,this.#t=i,this.#r=new URL(e),this.#l=KGe(a,"fileUploadTimeoutMs")}async getMe(t={}){return this.#a("getMe",{},t)}async getWebhookInfo(t={}){return this.#a("getWebhookInfo",{},t)}async getUpdates({offset:t,timeout:o=25,signal:i}={}){let e={timeout:o,limit:100,allowed_updates:["message"],...Number.isSafeInteger(t)?{offset:t}:{}};return this.#a("getUpdates",e,{signal:i,timeoutMs:Math.max(1e4,(o+10)*1e3)})}async getFile({fileId:t,signal:o}={}){let i=Rg(t);if(!i||!/^[A-Za-z0-9_-]{1,512}$/.test(i))throw new TypeError("Telegram file id is invalid");return this.#a("getFile",{file_id:i},{signal:o})}async downloadFile({fileId:t,signal:o,maxBytes:i}={}){let e=await this.#o(t,o);return Do(e,{fetchImpl:this.#A,signal:o,maxBytes:i,allowedHosts:sZ})}async downloadFileStream({fileId:t,signal:o}={}){let i=await this.#o(t,o);return Yp(i,{fetchImpl:this.#A,signal:o,allowedHosts:sZ})}async#o(t,o){let i=await this.getFile({fileId:t,signal:o}),e=Rg(i?.file_path);if(!e||e.startsWith("/")||e.includes("\\")||e.includes("?")||e.includes("#"))throw new Error("Telegram returned an invalid file path");let a;try{a=e.split("/").map(r=>decodeURIComponent(r))}catch{throw new Error("Telegram returned an invalid file path")}if(a.some(r=>!r||r==="."||r===".."))throw new Error("Telegram returned an invalid file path");let A=new URL(this.#r);return A.pathname=`/file/bot${this.#e}/${e}`,A}async sendMessage({chatId:t,text:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#a("sendMessage",{chat_id:t,text:o,link_preview_options:{is_disabled:!0},...i?{reply_parameters:{message_id:i,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:a})}async setMessageReaction({chatId:t,messageId:o,emoji:i,signal:e,timeoutMs:a}){let A=Rg(i);return this.#a("setMessageReaction",{chat_id:t,message_id:o,reaction:A?[{type:"emoji",emoji:A}]:[]},{signal:e,timeoutMs:a})}async sendRichMessage({chatId:t,richMessage:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#a("sendRichMessage",{chat_id:t,rich_message:pG(o),...i?{reply_parameters:{message_id:i,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:a})}async sendRichMessageDraft({chatId:t,draftId:o,richMessage:i,messageThreadId:e,signal:a}){if(!Number.isSafeInteger(o)||o===0)throw new TypeError("Telegram rich message draft id must be a non-zero integer");return this.#a("sendRichMessageDraft",{chat_id:t,draft_id:o,rich_message:pG(i),...e?{message_thread_id:e}:{}},{signal:a})}async sendDocument({chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#i("sendDocument","document","document",{chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a})}async sendPhoto({chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a}){return this.#i("sendPhoto","photo","photo",{chatId:t,file:o,replyToMessageId:i,messageThreadId:e,signal:a})}async#i(t,o,i,{chatId:e,file:a,replyToMessageId:A,messageThreadId:r,signal:s}){if(!a||typeof a!="object"||typeof a.fileName!="string"||!a.fileName||!Buffer.isBuffer(a.bytes))throw new TypeError(`A Telegram ${i} is required`);let g=new this.#t;if(g.append("chat_id",String(e)),g.append(o,new Blob([a.bytes],{type:a.mediaType??"application/octet-stream"}),a.fileName),A&&g.append("reply_parameters",JSON.stringify({message_id:A,allow_sending_without_reply:!0})),r&&g.append("message_thread_id",String(r)),s?.aborted)throw lG(s);let c=gZ(s,this.#l);try{return await this.#a(t,g,{signal:c,timeoutMs:this.#l,multipart:!0})}catch(I){throw s?.aborted?lG(s):I?.deliveryOutcome==="unknown"?cZ(I?.cause??I,i):I?.code?.startsWith?.("telegram-")?xGe(I,i):cZ(I,i)}}async editMessageText({chatId:t,messageId:o,text:i,richMessage:e,signal:a}){if(i===void 0==(e===void 0))throw new TypeError("Telegram message edit requires exactly one of text or richMessage");return this.#a("editMessageText",{chat_id:t,message_id:o,...i===void 0?{rich_message:pG(e)}:{text:i,link_preview_options:{is_disabled:!0}}},{signal:a})}async sendChatAction({chatId:t,messageThreadId:o,signal:i}){return this.#a("sendChatAction",{chat_id:t,action:"typing",...o?{message_thread_id:o}:{}},{signal:i})}async setMyCommands({commands:t,scope:o,languageCode:i,signal:e}={}){if(!Array.isArray(t)||t.length===0||t.some(a=>!JGe(a)))throw new TypeError("Telegram bot commands are invalid");return this.#a("setMyCommands",{commands:t,...o?{scope:o}:{},...Rg(i)?{language_code:Rg(i)}:{}},{signal:e})}async setChatMenuButton({menuButton:t=dG,signal:o}={}){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError("Telegram menu button is invalid");return this.#a("setChatMenuButton",{menu_button:t},{signal:o})}async#a(t,o,{signal:i,timeoutMs:e=15e3,multipart:a=!1}={}){if(i?.aborted)throw lG(i);let A=new URL(this.#r);A.pathname=`${A.pathname.replace(/\/$/,"")}/bot${this.#e}/${t}`;let r;try{r=await this.#A(A,{method:"POST",...a?{}:{headers:{"content-type":"application/json"}},body:a?o:JSON.stringify(o),signal:gZ(i,e),redirect:"error"})}catch(g){let c=new Error(`Telegram ${t} transport failed`,{cause:g});throw c.code=g?.name==="TimeoutError"?"telegram-timeout":g?.name==="AbortError"?"telegram-aborted-after-dispatch":"telegram-transport-error",c.deliveryOutcome="unknown",c}let s;try{s=await r.json()}catch{let g=new Error(`Telegram ${t} returned invalid JSON`);throw g.status=r?.status,g.code="telegram-response-invalid",g.deliveryOutcome="unknown",g}if(!r.ok||s?.ok!==!0){let g=Rg(s?.description),c=new Error(g??`Telegram ${t} failed`);c.code=Number.isInteger(s?.error_code)?`telegram-${s.error_code}`:"telegram-api-error",c.status=r.status,Number.isInteger(s?.error_code)&&(c.providerCode=s.error_code);let I=Number(s?.parameters?.retry_after);throw Number.isFinite(I)&&I>=0&&(c.retry_after=I,c.retryAfter=I),c}return s.result}};async function lZ(n,t={}){let i=await new zu({token:n,...t}).getMe();if(!i?.id||i?.is_bot!==!0)throw new Error("Telegram token does not belong to a bot");return{platformId:String(i.id),name:Rg([i.first_name,i.last_name].filter(Boolean).join(" "))??w("Telegram\u673A\u5668\u4EBA"),username:Rg(i.username)}}var hG=Object.freeze({key:"telegram",label:"Telegram",connectionLabel:" Bot API \u957F\u8F6E\u8BE2",reactions:Object.freeze({processing:"\u{1F440}",success:"\u{1F44D}",error:"\u{1F44E}"})}),iw=class extends ns{constructor(t){super({descriptor:hG,...t})}};var Vu=class extends xp{#e;constructor(t){super({...t,descriptor:hG,inspectToken:t.inspectToken??lZ,deriveIdentity:oZ,maskPlatformId:nZ}),this.#e=t.configStore}status(){let t=super.status();return{...t,bots:t.bots.map(o=>{let i=this.#e.get(o.botId),e=rw(i??{});return{...o,accessPolicy:e}})}}async setAccessPolicy(t,o){let i=rw(o);return this.updateBotConfig(t,e=>({...e,...i}))}};import{randomInt as eFe}from"node:crypto";import{EnvHttpProxyAgent as qGe,FormData as zGe,fetch as VGe}from"undici";var WGe=4;function pZ(){let n=new qGe({connections:WGe}),t=!1;return{fetchImpl:(o,i={})=>VGe(o,{...i,dispatcher:n}),FormDataImpl:zGe,async destroy(){t||(t=!0,await n.destroy())}}}function CG(n){if(typeof n!="string"||!n.trim())throw new TypeError("Telegram message text must be a non-empty string");return n}function uG(n){return n==="&"?5:n==="<"||n===">"?4:1}function EG(n){return Array.from(n).reduce((t,o)=>t+uG(o),0)}function ZGe(n,t,o,i){let e=t+Math.floor(i*.5);for(let a=o-1;a>=e;a-=1)if(n[a]===` `||n[a]===" ")return a+1;return o}function BG(n,t,o=()=>1){if(typeof n!="string")throw new TypeError("Telegram message text must be a string");if(!n)return[];let i=Array.from(n),e=[],a=0;for(;at)break;r+=s,A+=1}if(A===a)throw new Error("Telegram message character exceeds the chunk limit");A",">")}function dZ(n,t){return BG(n,t,uG).map(o=>({source:o,markdown:Wu(o)}))}function $Ge(n,t,o,i){let e=n.slice(t.length,n.length-o.length),a=EG(t)+Math.max(EG(o),EG("```"))+1,A=i-a;if(A<1)throw new Error("Telegram Rich Markdown code fence exceeds the limit");let r=BG(e,A,uG);return r.map((s,g)=>{let c=g===r.length-1,I=s.endsWith(` `)?"":` `,d=c?o:"```",B=`${g===0?t:""}${s}${c?o:""}`,f=Wu(`${t}${s}${I}${d}`);if(Array.from(f).length>i)throw new Error("Telegram Rich Markdown code block exceeds the limit");return{source:B,markdown:f}})}function fG(n){let t=CG(n);return hZ(t),Wu(t)}function QG(n,t=3e4){if(!Number.isInteger(t)||t<128||t>32768)throw new TypeError("Telegram Rich Markdown limit is invalid");let o=CG(n),i=hZ(o),e=Wu(o);if(Array.from(e).length<=t)return[{source:o,markdown:e}];let a=[],A=0;for(let r=0;rA&&a.push(...dZ(o.slice(A,s.index),t));let c=g.index+g[0].length,I=o.slice(s.index,c),d=Wu(I);Array.from(d).length<=t?a.push({source:I,markdown:d}):a.push(...$Ge(I,s[0],g[0],t)),A=c}return A4096)throw new TypeError("Telegram regular message limit is invalid");return BG(CG(n),t,o=>o.length)}var AFe=Object.freeze([{command:"new",description:"\u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"},{command:"compact",description:"\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"},{command:"workspace",description:"\u5207\u6362\u5DE5\u4F5C\u533A"},{command:"workspacelist",description:"\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"},{command:"sessionlist",description:"\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"},{command:"sessions",description:"\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"},{command:"session",description:"\u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"},{command:"models",description:"\u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"},{command:"model",description:"\u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"},{command:"presetlist",description:"\u5217\u51FA\u53EF\u7528 Agent Preset"},{command:"presets",description:"\u5217\u51FA\u53EF\u7528 Agent Preset"},{command:"preset",description:"\u67E5\u770B\u6216\u8BBE\u7F6E\u65B0\u4F1A\u8BDD Agent Preset"},{command:"stop",description:"\u505C\u6B62\u5F53\u524D\u4EFB\u52A1"},{command:"steer",description:"\u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"},{command:"batch",description:"\u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09"},{command:"send",description:"\u63D0\u4EA4\u5F53\u524D\u6279\u6B21"},{command:"cancel",description:"\u53D6\u6D88\u5F53\u524D\u6279\u6B21"},{command:"status",description:"\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"},{command:"version",description:"\u67E5\u770B\u63D2\u4EF6\u7248\u672C"},{command:"help",description:"\u663E\u793A\u5E2E\u52A9"}]);function tFe(){return AFe.map(n=>({...n,description:w(n.description)}))}function rFe(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function aFe(n,t){return t?[[n?.text,n?.entities],[n?.caption,n?.caption_entities]].some(([o,i])=>typeof o=="string"&&Array.isArray(i)&&i.some(e=>e?.type!=="mention"||!Number.isInteger(e.offset)||!Number.isInteger(e.length)?!1:o.slice(e.offset,e.offset+e.length).toLowerCase()===`@${t.toLowerCase()}`)):!1}function iFe(n,t){return!t||typeof n!="string"?n:n.replace(new RegExp(`@${rFe(t)}\\b`,"ig"),"").trim()}var oFe=new Set(["image/jpeg","image/png","image/webp","image/gif"]),nFe=new Map([[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".png","image/png"],[".webp","image/webp"],[".gif","image/gif"]]);function CZ(n){let t=n?.mime_type??n?.mimetype,o=typeof t=="string"?t.toLowerCase():"";if(oFe.has(o))return o;let i=typeof n?.file_name=="string"?n.file_name.toLowerCase():"";for(let[e,a]of nFe)if(i.endsWith(e))return a;return null}function wG(n){return Number.isSafeInteger(n)&&n>=0?n:void 0}function EZ(n){return wG(n?.file_size)??(Number(n?.width)||0)*(Number(n?.height)||0)}function sFe(n,t){let o,i,e;if(Array.isArray(n?.photo)&&n.photo.length>0)o=n.photo.reduce((a,A)=>EZ(A)>EZ(a)?A:a),i="image/jpeg",e=`${o.file_unique_id??o.file_id??"telegram-photo"}.jpg`;else if(n?.document){let a=CZ(n.document);if(!a)return null;o=n.document,i=a,e=typeof o.file_name=="string"?o.file_name:void 0}return!o||typeof o.file_id!="string"?null:{name:e,mediaType:i,size:wG(o.file_size),load:a=>t(o.file_id,a)}}function gFe(n,t){let o=n?.document;if(!o||CZ(o)||typeof o.file_id!="string"||!o.file_id)return null;let i=typeof o.mime_type=="string"&&o.mime_type?o.mime_type.toLowerCase():void 0;return{name:typeof o.file_name=="string"&&o.file_name?o.file_name:String(o.file_unique_id??o.file_id),...i?{mediaType:i}:{},size:wG(o.file_size),load:({signal:e}={})=>t(o.file_id,{signal:e})}}function cFe(n,{botId:t,username:o,loadFile:i=async()=>{throw new Error("Telegram file downloader is unavailable")},loadFileStream:e=i}){let a=n?.message,A=a?.chat?.id,r=a?.from?.id,s=a?.message_id;if(!Number.isSafeInteger(n?.update_id)||A===void 0||r===void 0||!Number.isSafeInteger(s)||!["private","group","supergroup"].includes(a.chat?.type))return null;let g=a.chat.type==="private",c=g||String(a.reply_to_message?.from?.id??"")===String(t)||aFe(a,o),I=Number.isSafeInteger(a.message_thread_id)?a.message_thread_id:void 0,d=sFe(a,i),B=gFe(a,e);return{messageId:String(n.update_id),senderId:String(r),contextSource:()=>({senderName:[a.from?.first_name,a.from?.last_name].filter(f=>typeof f=="string"&&f.trim()).map(f=>f.trim()).join(" ")||a.from?.username}),senderIsBot:a.from?.is_bot===!0,kind:g?"direct":"group",conversationId:I===void 0?String(A):`${A}:${I}`,content:iFe(a.text??a.caption??"",o),plainText:typeof a.text=="string",images:d?[d]:[],files:B?[B]:[],addressed:c,reactionTarget:{chatId:A,messageId:s},replyTarget:{chatId:A,chatType:a.chat.type,replyToMessageId:s,messageThreadId:I},connectionTestTarget:{chatId:A,messageThreadId:I}}}function mG(n){return Number.isSafeInteger(n?.message_id)?String(n.message_id):null}function Zu(n){let t=Number(n?.providerCode),o=Number(n?.status),i=n?.deliveryOutcome==="unknown"||t>=500||o>=500||["telegram-timeout","telegram-aborted-after-dispatch","telegram-transport-error","telegram-response-invalid"].includes(n?.code);return{outcome:i?"unknown":"failed",reason:typeof n?.code=="string"&&n.code?n.code:i?"telegram-delivery-uncertain":"telegram-provider-rejected"}}function xi(n,t,o="sent",i){return{presentation:n,providerMessageIds:[...new Set(t)],deliveryOutcome:o,...i?{reason:i}:{}}}var ow=class{#e;#A;#t;#r;#l;#o=!1;#i=null;constructor({update:t,finish:o,fail:i,providerMessageIds:e=[],presentation:a,logger:A}){this.#e=t,this.#A=o,this.#t=i,this.#l=e,this.presentation=a,this.#r=A}get providerMessageIds(){return[...this.#l]}async update(t){if(this.#o)return;let o=ts(t),i=`${o.format}:${o.text}`;if(i!==this.#i){this.#i=i;try{return await this.#e(o)}catch(e){this.#r.warn?.("[dsh-im:telegram] rich stream update failed:",e);return}}}async finish(t){if(this.#o)throw new Error("Message stream is already closed");this.#o=!0;let o=await this.#A(ts(t));return this.#l.push(...o?.providerMessageIds??[]),o}async fail(t){if(this.#o)return;this.#o=!0;let o=await this.#t(ts(t,"plain"));return this.#l.push(...o?.providerMessageIds??[]),o}cancel(){this.#o=!0}},SG=class{#e;#A;#t;constructor({api:t,signal:o,logger:i=console}){this.#e=t,this.#A=o,this.#t=i}async sendText(t,o){let i=yG(o),e=[];for(let[a,A]of i.entries()){let r=await this.#e.sendMessage({chatId:t.chatId,text:A,replyToMessageId:a===0?t.replyToMessageId:void 0,messageThreadId:t.messageThreadId,signal:this.#A});Number.isSafeInteger(r?.message_id)&&e.push(String(r.message_id))}return{providerMessageIds:e}}async addReaction(t,o,{signal:i}={}){let e=String(o??"").trim();return await this.#e.setMessageReaction({chatId:t.chatId,messageId:t.messageId,emoji:e,signal:i??this.#A}),e}removeReaction(t,o,{signal:i}={}){return this.#e.setMessageReaction({chatId:t.chatId,messageId:t.messageId,signal:i??this.#A})}sendTyping(t){return this.#e.sendChatAction({chatId:t.chatId,messageThreadId:t.messageThreadId,signal:this.#A})}sendFile(t,o){return this.#e.sendDocument({chatId:t.chatId,file:o,replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A})}sendImage(t,o){return this.#e.sendPhoto({chatId:t.chatId,file:o,replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A})}async#r(t,o,{placeholderMessageId:i}={}){let e=yG(o),a=i===void 0?[]:[String(i)],A=0;if(i!==void 0)try{await this.#e.editMessageText({chatId:t.chatId,messageId:i,text:e[0],signal:this.#A}),A=1}catch(r){let s=Zu(r);if(s.outcome==="unknown")return xi("text-fallback",a,"unknown",s.reason);let g=await this.#r(t,o),c=g.deliveryOutcome==="sent"?"\u56DE\u590D\u5DF2\u53D1\u9001\u3002":g.deliveryOutcome==="unknown"?"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002":"\u6D88\u606F\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";try{await this.#e.editMessageText({chatId:t.chatId,messageId:i,text:c,signal:this.#A})}catch(I){this.#t.warn?.("[dsh-im:telegram] unable to replace the processing placeholder:",I)}return xi("text-fallback",[...a,...g.providerMessageIds],g.deliveryOutcome,g.reason)}for(let r=A;rI.source).join(""),c=await this.#r({...t,replyToMessageId:a===0?t.replyToMessageId:void 0},g);return xi(c.presentation,[...e,...c.providerMessageIds],c.deliveryOutcome,c.reason)}return xi("telegram-rich-final",e)}async#o(t,o,i){if(i.format==="plain")return this.#r(t,i.text,{placeholderMessageId:o});let e;try{e=QG(i.text)}catch{return this.#r(t,i.text,{placeholderMessageId:o})}let a=[String(o)];try{await this.#e.editMessageText({chatId:t.chatId,messageId:o,richMessage:{markdown:e[0].markdown},signal:this.#A})}catch(A){let r=Zu(A);return r.outcome==="unknown"?xi("telegram-rich-final",a,"unknown",r.reason):this.#r(t,i.text,{placeholderMessageId:o})}for(let[A,r]of e.slice(1).entries())try{let s=await this.#e.sendRichMessage({chatId:t.chatId,richMessage:{markdown:r.markdown},messageThreadId:t.messageThreadId,signal:this.#A}),g=mG(s);g&&a.push(g)}catch(s){let g=Zu(s);if(g.outcome==="unknown")return xi("telegram-rich-final",a,"unknown",g.reason);let c=e.slice(A+1).map(d=>d.source).join(""),I=await this.#r({...t,replyToMessageId:void 0},c);return xi(I.presentation,[...a,...I.providerMessageIds],I.deliveryOutcome,I.reason)}return xi("telegram-rich-final",a)}sendDelivery(t,o){return this.#l(t,ts(o))}async openDeliveryStream(t){if(t.chatType==="private"){let e=eFe(1,2147483647),a=async r=>{let s={markdown:fG(r.text)};return await this.#e.sendRichMessageDraft({chatId:t.chatId,draftId:e,richMessage:s,messageThreadId:t.messageThreadId,signal:this.#A}),xi("telegram-rich-draft",[])},A=new ow({update:a,finish:r=>this.#l(t,r),fail:r=>this.#r(t,r.text),presentation:"telegram-rich-draft",logger:this.#t});return await A.update(ts("\u6B63\u5728\u5904\u7406\u2026","plain")),A}let i=(await this.#e.sendMessage({chatId:t.chatId,text:"\u6B63\u5728\u5904\u7406\u2026",replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A}))?.message_id;if(!Number.isSafeInteger(i))throw new Error("Telegram did not return a placeholder message id");return new ow({update:async e=>e.format==="plain"?(await this.#e.editMessageText({chatId:t.chatId,messageId:i,text:e.text,signal:this.#A}),xi("text-fallback",[String(i)])):(await this.#e.editMessageText({chatId:t.chatId,messageId:i,richMessage:{markdown:fG(e.text)},signal:this.#A}),xi("telegram-rich-draft",[String(i)])),finish:e=>this.#o(t,i,e),fail:e=>this.#r(t,e.text,{placeholderMessageId:i}),providerMessageIds:[String(i)],presentation:"telegram-regular",logger:this.#t})}async openStream(t){return VQ({limit:4e3,create:async i=>(await this.#e.sendMessage({chatId:t.chatId,text:i,replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A})).message_id,edit:(i,e)=>this.#e.editMessageText({chatId:t.chatId,messageId:i,text:e,signal:this.#A}),sendRemainder:i=>this.#e.sendMessage({chatId:t.chatId,text:i,messageThreadId:t.messageThreadId,signal:this.#A}),messageIdForResult:i=>i?.message_id}).start()}};function IFe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...io()}}var Xu=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p=IFe();#c=null;#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,token:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,createApi:g=I=>new zu(I),createHttpTransport:c=pZ}){if(!t||!o||!i||!e)throw new TypeError("TelegramRuntime requires config, token, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c}get status(){return structuredClone(this.#p)}async sendConnectionTest(t){if(!this.#p.ready||!this.#I){let o=new Error("Telegram bot is not connected");throw o.code="test-target-unavailable",o}return this.#I.sendConnectionTest(t)}async sendProactiveText(t,o,i={}){if(!this.#p.ready||!this.#I){let r=new Error("Telegram bot is not connected");throw r.code="bot-not-connected",r}let e=typeof t?.route?.chatId=="string"?t.route.chatId.trim():"",a=Number(e),A=t?.route?.messageThreadId;if(!/^-?\d+$/.test(e)||!Number.isSafeInteger(a)||t?.kind!=="chat"&&t?.kind!=="topic"||t.kind==="topic"&&(!Number.isSafeInteger(A)||A<=0)||t.kind==="chat"&&A!==void 0){let r=new TypeError("Invalid Telegram proactive delivery target");throw r.code="invalid-target",r}return this.#I.sendProactiveText({chatId:a,...t.kind==="topic"?{messageThreadId:A}:{}},o,i)}async start(){return this.#p.ready&&this.#h?this.status:this.#C?this.#C:(this.#C=this.#u().finally(()=>{this.#C=null}),this.#C)}async#u(){await this.stop(),this.#p.startedAt=new Date().toISOString(),this.#p.connectionState="connecting",this.#p.lastError=null,await this.#t.ensureRunning(),this.#p.harnessReachable=!0;let t=new AbortController;this.#d=t;try{let o=this.#s();this.#c=o;let i=this.#n({token:this.#A,fetchImpl:o.fetchImpl,FormDataImpl:o.FormDataImpl});this.#g=i;let e=await i.getMe({signal:t.signal});if(String(e?.id??"")!==this.#e.platformId||e?.is_bot!==!0)throw new Error("Telegram token identity does not match the saved bot");let a=await i.getWebhookInfo({signal:t.signal});if(typeof a?.url=="string"&&a.url){let g=new Error(w("\u8BE5 Telegram \u673A\u5668\u4EBA\u5DF2\u914D\u7F6E Webhook\uFF0C\u8BF7\u5148\u5728\u539F\u670D\u52A1\u4E2D\u79FB\u9664 Webhook \u540E\u91CD\u8BD5\u3002"));throw g.code="webhook-configured",g}try{await i.setMyCommands({commands:tFe(),signal:t.signal}),await i.setChatMenuButton({menuButton:dG,signal:t.signal})}catch(g){this.#i.warn?.(`[dsh-im:telegram] bot ${this.#e.botId} command menu setup failed:`,g)}let A=new SG({api:i,signal:t.signal,logger:this.#i});this.#I=new iw({bot:A,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#p,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let r=this.#r.cursor();if(r===null){let g=await i.getUpdates({offset:-1,timeout:0,signal:t.signal});r=g.length>0?g.at(-1).update_id+1:0,await this.#r.setCursor(r)}let s=Date.now();return this.#p.ready=!0,this.#p.connectionState="connected",this.#p.lastCheckedAt=s,this.#p.lastConnectedAt=s,this.#h=this.#B(r,t.signal),this.#h.catch(g=>{t.signal.aborted||(this.#p.ready=!1,this.#p.connectionState="failed",this.#p.lastError=g?.message??String(g),this.#i.error?.(`[dsh-im:telegram] bot ${this.#e.botId} polling stopped:`,g))}),this.status}catch(o){throw this.#p.ready=!1,this.#p.connectionState="failed",this.#p.lastError=o?.message??String(o),await this.stop(),o}}async#B(t,o){let i=t;for(;!o.aborted;){let e=await this.#g.getUpdates({offset:i,timeout:25,signal:o});if(this.#p.lastCheckedAt=Date.now(),o.aborted)return;let a=e.map(A=>{let r=A?.message?.chat?.type;return{update:A,contextSnapshot:Aa(this.#l,r==="private"?"direct":r==="group"||r==="supergroup"?"group":null)}});for(let{update:A,contextSnapshot:r}of a){if(o.aborted)return;let s=cFe(A,{botId:this.#e.platformId,username:this.#e.username,loadFile:(g,c)=>this.#g.downloadFile({fileId:g,...c}),loadFileStream:(g,c)=>this.#g.downloadFileStream({fileId:g,...c})});s&&this.#I.accept(s,{contextSnapshot:r}).catch(g=>{o.aborted||this.#i.error?.(`[dsh-im:telegram] bot ${this.#e.botId} message handling failed:`,g)}),i=A.update_id+1,await this.#r.setCursor(i)}}}async stop(){let t=this.#h,o=this.#I,i=this.#c;this.#d?.abort(),this.#d=null,this.#h=null,this.#c=null,this.#g=null,this.#I=null,await Promise.race([t?.catch(()=>{})??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]);try{await i?.destroy()}catch{this.#i.warn?.("[dsh-im:telegram] Telegram HTTP transport cleanup failed")}return this.#p.ready=!1,this.#p.connectionState="idle",this.status}};var nw=class extends gs{};function DG(n,t={},o={}){return XQ(n,t,o,{channel:"telegram",ConfigStore:tw,StateStore:nw,HarnessClient:aw,Controller:Vu,Runtime:Xu})}var uZ="/telegram",BZ=Tr,lFe=Object.freeze(Object.values(BZ));function fZ(n){return ey(n,{channel:"Telegram"})}function sw(n,t,o){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(uZ,fZ(t),{authority:fr(o)})}async function QZ(n,t={}){if(t?.controller)return sw(n,t.controller,t.rpcAuthority);let o=await DG(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=sw(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Telegram bot connections"),e}import{unlink as rLe}from"node:fs/promises";import{homedir as aLe}from"node:os";import{join as rB,resolve as Ol}from"node:path";import{createHash as pFe}from"node:crypto";import{mkdir as dFe,readFile as hFe,rename as EFe,unlink as CFe,writeFile as uFe}from"node:fs/promises";import{dirname as BFe}from"node:path";var OG=Object.freeze({version:1,bots:Object.freeze([])});function Sl(n){return typeof n=="string"&&n.trim()?n.trim():null}function yZ(n){let t=Sl(n);return t&&/^wecom_[a-f0-9]{24}$/.test(t)?t:null}function fFe(n){let t=Sl(n);return t&&/^DSH_WECOM_BOT_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function cw(n){let t=Sl(n);if(!t)throw new TypeError("Enterprise WeChat bot ID is required");let o=pFe("sha256").update(t).digest("hex").slice(0,24);return{botId:`wecom_${o}`,secretRef:`DSH_WECOM_BOT_SECRET_${o.toUpperCase()}`}}function bG(n){let t=Sl(n)??"";return t?t.length<=10?`${t.slice(0,3)}\u2022\u2022\u2022`:`${t.slice(0,6)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA")}function mZ(n){if(!n||typeof n!="object")return null;let t=yZ(n.botId),o=Sl(n.remoteBotId),i=fFe(n.secretRef);if(!t||!o||!i)return null;let e=cw(o);return e.botId!==t||e.secretRef!==i?null:Object.freeze({botId:t,remoteBotId:o,secretRef:i,createdAt:Sl(n.createdAt)??new Date().toISOString(),connectedAt:Sl(n.connectedAt)})}function QFe(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(mZ);if(t.some(a=>a===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.remoteBotId)||e.has(a.secretRef))return null;o.add(a.botId),i.add(a.remoteBotId),e.add(a.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}var gw=class{#e;#A=OG;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=QFe(JSON.parse(await hFe(this.#e,"utf8")));if(!t)throw new Error("dsh-im Enterprise WeChat config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=OG}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByRemoteBotId(t){let o=this.#A.bots.find(i=>i.remoteBotId===t);return o?structuredClone(o):null}async save(t){let o=mZ(t);if(!o)throw new Error("Refusing to persist incomplete Enterprise WeChat bot data");return this.#r(i=>{let e=i.find(r=>r.remoteBotId===o.remoteBotId&&r.botId!==o.botId),a=i.find(r=>r.secretRef===o.secretRef&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate Enterprise WeChat bot identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!yZ(t))throw new TypeError("Invalid Enterprise WeChat bot ID");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await CFe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=OG});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#l(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#l(t){await dFe(BFe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await uFe(o,`${JSON.stringify(t,null,2)} -`,{encoding:"utf8",mode:384}),await EFe(o,this.#e)}};var Iw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"wecom",logPrefix:"dsh-wecom"})}};var yFe="https://work.weixin.qq.com/ai/qc/generate",mFe="https://work.weixin.qq.com/ai/qc/query_result";function SZ(){return process.platform==="win32"?2:process.platform==="linux"?3:1}function Wd(n){return typeof n=="string"&&n.trim()?n.trim():null}function SFe(n){let t=Wd(n);if(!t)return null;try{let o=new URL(t);return o.protocol==="https:"&&o.hostname==="work.weixin.qq.com"&&(!o.port||o.port==="443")?o.href:null}catch{return null}}function wFe(n,t){return n?AbortSignal.any([n,AbortSignal.timeout(t)]):AbortSignal.timeout(t)}async function wZ(n,t,o){let i=await n(t,{method:"GET",redirect:"error",signal:wFe(o,1e4),headers:{accept:"application/json"}});if(!i.ok)throw new Error(`Enterprise WeChat QR service returned HTTP ${i.status}`);return i.json()}var lw=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=()=>Date.now(),source:i="deepseek-harness",platform:e=SZ()}={}){if(typeof t!="function")throw new TypeError("A fetch implementation is required");this.#e=t,this.#A=o,this.#t=i,this.#r=[1,2,3].includes(e)?e:SZ()}async start({signal:t}={}){let o=new URL(yFe);o.searchParams.set("source",this.#t),o.searchParams.set("plat",String(this.#r));let i=await wZ(this.#e,o,t),e=Wd(i?.data?.scode),a=SFe(i?.data?.auth_url);if(!e||!a)throw new Error("Enterprise WeChat QR service returned invalid data");return{scode:e,verificationUrl:a,expiresAt:this.#A()+3e5,pollIntervalMs:3e3}}async poll({scode:t,signal:o}={}){let i=Wd(t);if(!i)throw new TypeError("Enterprise WeChat QR poll code is required");let e=new URL(mFe);e.searchParams.set("scode",i);let a=await wZ(this.#e,e,o),A=Wd(a?.data?.status)?.toLowerCase();if(A==="success"){let r=Wd(a?.data?.bot_info?.botid),s=Wd(a?.data?.bot_info?.secret);if(!r||!s)throw new Error("Enterprise WeChat QR result omitted bot credentials");return{status:"success",remoteBotId:r,secret:s}}return["expired","timeout"].includes(A)?{status:"expired"}:["fail","failed","error"].includes(A)?{status:"failed"}:{status:"waiting"}}};import{mkdir as DFe,readFile as OFe,rename as bFe,unlink as MFe,writeFile as _Fe}from"node:fs/promises";import{dirname as TFe}from"node:path";var pw=Object.freeze({version:1,sessions:{},seenMessageIds:[]});function NFe(n){if(!n||typeof n!="object")return structuredClone(pw);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&typeof i=="string"&&i&&(t[o]=i);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[]}}var dw=class{#e;#A=structuredClone(pw);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=NFe(JSON.parse(await OFe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(pw),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await MFe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(pw)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} -`,o=this.#t.then(async()=>{await DFe(TFe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await _Fe(i,t,{encoding:"utf8",mode:384}),await bFe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{randomUUID as RFe}from"node:crypto";var DZ=new Set(["pending","connecting"]),$u=new Set(["connected","failed","cancelled","expired"]);function wl(n){return typeof n=="string"&&n.trim()?n.trim():null}function Yi(n,t){return Object.freeze({code:n,message:t})}function Dl(n){return n?{attemptId:n.id,status:n.state,pollIntervalMs:n.pollIntervalMs,qrRevision:n.qrRevision,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var eB=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=null;#p=new Map;#c=0;#g=!1;constructor({qrAuth:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("Enterprise WeChat QR auth is required");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("WecomController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("WecomController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#g)return this.status();for(let t of this.#t.list())await this.#Q(t.botId,async()=>{let o=this.#i.get(t.botId)?.status;if(this.#g||o?.ready||o?.wecomConnectionState==="connecting")return;let i=await this.#B(t.secretRef);if(!i){this.#a.set(t.botId,Yi("missing-secret",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}try{await this.#C(t,i),this.#a.delete(t.botId)}catch{this.#a.set(t.botId,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${t.botId} failed to initialize`)}finally{this.#y()}});return this.status()}async startProvisioning(){if(this.#g)throw new Error("Enterprise WeChat controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t={id:RFe(),state:"pending",createdAt:Date.now(),expiresAt:null,pollIntervalMs:3e3,qrRevision:1,verificationUrl:null,scode:null,botId:null,error:null,controller:new AbortController,polling:null,transition:null};this.#n.set(t.id,t),this.#s=t.id,this.#y();try{let o=await this.#e.start({signal:t.controller.signal});if(t.scode=wl(o.scode),t.verificationUrl=wl(o.verificationUrl),t.expiresAt=Number(o.expiresAt),t.pollIntervalMs=Math.min(1e4,Math.max(500,Number(o.pollIntervalMs)||3e3)),!t.scode||!t.verificationUrl||!Number.isFinite(t.expiresAt))throw new Error("Enterprise WeChat QR auth returned incomplete data");return this.#y(),Dl(t)}catch(o){throw t.state=t.controller.signal.aborted?"cancelled":"failed",t.error=t.controller.signal.aborted?Yi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002")):Yi("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#S(t),o}}async registrationStatus(t){let o=this.#n.get(t);if(!o||$u.has(o.state))return Dl(o);if(o.state==="connecting")return await o.transition?.catch(()=>{}),Dl(o);if(Date.now()>=o.expiresAt)return o.state="expired",o.error=Yi("expired",w("\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),o.controller.abort(),this.#S(o),Dl(o);if(!o.polling){let i=this.#I(o).finally(()=>{o.polling===i&&(o.polling=null)});o.polling=i}return await o.polling.catch(()=>{}),Dl(o)}async bindCredentials({botId:t,secret:o}={}){if(this.#g)throw new Error("Enterprise WeChat controller is closed");let i=wl(t),e=wl(o);if(!i||!e)throw new TypeError("Enterprise WeChat Bot ID and Secret are required");if(this.#s&&await this.cancelProvisioning(this.#s),this.#g)throw new Error("Enterprise WeChat controller is closed");let a=cw(i);return await this.#Q(a.botId,async()=>{if(this.#g)throw new Error("Enterprise WeChat controller is closed");let A=this.#t.getByRemoteBotId(i),r=await this.#A.resolve(a.secretRef).catch(()=>{});if(this.#g)throw new Error("Enterprise WeChat controller is closed");let s={botId:a.botId,remoteBotId:i,secretRef:a.secretRef,createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(a.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#f(a.secretRef,r),g}try{await this.#C(s,e),this.#a.delete(a.botId)}catch{this.#a.set(a.botId,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${a.botId} credential connection failed`)}this.#y()}),this.status()}async cancelProvisioning(t){let o=this.#n.get(t);return o?($u.has(o.state)||(o.controller.abort(),await Promise.allSettled([o.polling,o.transition].filter(Boolean)),$u.has(o.state)||(o.state="cancelled"),o.error??=Yi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002")),this.#S(o)),Dl(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return await this.#Q(t,async()=>{let i=await this.#B(o.secretRef);if(!i)throw new Error("Enterprise WeChat bot secret is missing");try{await this.#C(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#y()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return this.#Q(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Cr(w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"));return i.sendConnectionTest(Ra(w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{botId}\uFF09",{botId:bG(o.remoteBotId)})))})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown Enterprise WeChat bot");return this.#Q(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return await this.#Q(t,async()=>{let i=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#u(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.secretRef,i.value).catch(()=>{}),await this.#C(o,i.value).catch(()=>{})),new Error("Unable to remove the Enterprise WeChat bot safely.",{cause:e})}await this.#l({botId:t,config:o}).catch(e=>{this.#o.warn?.(`[dsh-im:wecom] bot ${t} state cleanup failed:`,e)}),this.#a.delete(t),this.#y()}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#i.get(e.botId)?.status??null,A=a?.ready===!0&&a.wecomConnectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.wecomConnectionState==="connecting"?"connecting":this.#a.has(e.botId)||a?.wecomConnectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"),appIdMasked:bG(e.remoteBotId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null,lastConnectedAt:a?.lastConnectedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),error:structuredClone(this.#a.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,i=this.#s?this.#n.get(this.#s):null;return{schemaVersion:1,revision:this.#c,state:i&&DZ.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&DZ.has(i.state)?{provisioning:Dl(i)}:{}}}async close(){this.#g||(this.#g=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#u(t))))}async#I(t){try{let o=await this.#e.poll({scode:t.scode,signal:t.controller.signal});if(t.controller.signal.aborted||$u.has(t.state)||o.status==="waiting")return;if(o.status==="expired"){t.state="expired",t.error=Yi("expired",w("\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#S(t);return}if(o.status!=="success"){t.state="failed",t.error=Yi("qr-connect-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#S(t);return}t.state="connecting",t.verificationUrl=null,t.expiresAt=null,t.scode=null,this.#y();let i=this.#d(t,o);t.transition=i,await i}catch{if(t.controller.signal.aborted)return;t.state="failed",t.error=Yi("qr-connect-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#o.warn?.("[dsh-im:wecom] QR polling failed"),this.#S(t)}}async#d(t,o){try{let i=wl(o.remoteBotId),e=wl(o.secret);if(!i||!e)throw new Error("Enterprise WeChat authorization returned incomplete credentials");t.botId=await this.#h(t,{remoteBotId:i,secret:e}),t.state="connected",t.error=null}catch{t.controller.signal.aborted?(t.state="cancelled",t.error=Yi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Yi("activation-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#o.error?.("[dsh-im:wecom] provisioning failed"))}finally{this.#S(t)}}async#h(t,{remoteBotId:o,secret:i}){let e=cw(o),a=this.#t.getByRemoteBotId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,remoteBotId:o,secretRef:e.secretRef,createdAt:a?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};return this.#Q(e.botId,async()=>{await this.#A.set(e.secretRef,i);try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#t.save(r)}catch(s){throw await this.#f(e.secretRef,A),s}try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#C(r,i),this.#a.delete(e.botId)}catch(s){if(t.controller.signal.aborted)throw await this.#u(e.botId),a?await this.#t.save(a).catch(()=>{}):await this.#t.remove(e.botId).catch(()=>null)&&await this.#l({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-im:wecom] cancelled bot state cleanup failed:",c)}),await this.#f(e.secretRef,A),s;this.#a.set(e.botId,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${e.botId} activation connection failed`)}return this.#y(),e.botId})}async#C(t,o){if(this.#g)throw new Error("Enterprise WeChat controller is closed");if(await this.#u(t.botId),this.#g)throw new Error("Enterprise WeChat controller is closed");let i=await this.#r({botId:t.botId,config:t,secret:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError("createRuntime returned an invalid Enterprise WeChat runtime");this.#i.set(t.botId,i);try{await i.start()}catch(e){throw await i.stop().catch(()=>{}),this.#i.delete(t.botId),e}}async#u(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-im:wecom] bot ${t} failed to stop cleanly:`,i)})}async#B(t){let o=await this.#A.resolve(t).catch(()=>{});return wl(o?.value)}async#f(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#Q(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#S(t){t.scode=null,t.verificationUrl=null,t.expiresAt=null,this.#s===t.id&&(this.#s=null),this.#y();let o=[...this.#n.values()].filter(i=>$u.has(i.state));for(;o.length>16;)this.#n.delete(o.shift().id)}#y(){this.#c+=1}};import{WSAuthFailureError as ZFe,WSClient as XFe,WSReconnectExhaustedError as $Fe}from"@wecom/aibot-node-sdk";import{generateReqId as kFe}from"@wecom/aibot-node-sdk";var NG=12e4;function vFe(){return[w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` +`,{encoding:"utf8",mode:384}),await EFe(o,this.#e)}};var Iw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"wecom",logPrefix:"dsh-wecom"})}};var yFe="https://work.weixin.qq.com/ai/qc/generate",mFe="https://work.weixin.qq.com/ai/qc/query_result";function SZ(){return process.platform==="win32"?2:process.platform==="linux"?3:1}function Zd(n){return typeof n=="string"&&n.trim()?n.trim():null}function SFe(n){let t=Zd(n);if(!t)return null;try{let o=new URL(t);return o.protocol==="https:"&&o.hostname==="work.weixin.qq.com"&&(!o.port||o.port==="443")?o.href:null}catch{return null}}function wFe(n,t){return n?AbortSignal.any([n,AbortSignal.timeout(t)]):AbortSignal.timeout(t)}async function wZ(n,t,o){let i=await n(t,{method:"GET",redirect:"error",signal:wFe(o,1e4),headers:{accept:"application/json"}});if(!i.ok)throw new Error(`Enterprise WeChat QR service returned HTTP ${i.status}`);return i.json()}var lw=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=()=>Date.now(),source:i="deepseek-harness",platform:e=SZ()}={}){if(typeof t!="function")throw new TypeError("A fetch implementation is required");this.#e=t,this.#A=o,this.#t=i,this.#r=[1,2,3].includes(e)?e:SZ()}async start({signal:t}={}){let o=new URL(yFe);o.searchParams.set("source",this.#t),o.searchParams.set("plat",String(this.#r));let i=await wZ(this.#e,o,t),e=Zd(i?.data?.scode),a=SFe(i?.data?.auth_url);if(!e||!a)throw new Error("Enterprise WeChat QR service returned invalid data");return{scode:e,verificationUrl:a,expiresAt:this.#A()+3e5,pollIntervalMs:3e3}}async poll({scode:t,signal:o}={}){let i=Zd(t);if(!i)throw new TypeError("Enterprise WeChat QR poll code is required");let e=new URL(mFe);e.searchParams.set("scode",i);let a=await wZ(this.#e,e,o),A=Zd(a?.data?.status)?.toLowerCase();if(A==="success"){let r=Zd(a?.data?.bot_info?.botid),s=Zd(a?.data?.bot_info?.secret);if(!r||!s)throw new Error("Enterprise WeChat QR result omitted bot credentials");return{status:"success",remoteBotId:r,secret:s}}return["expired","timeout"].includes(A)?{status:"expired"}:["fail","failed","error"].includes(A)?{status:"failed"}:{status:"waiting"}}};import{mkdir as DFe,readFile as OFe,rename as bFe,unlink as MFe,writeFile as _Fe}from"node:fs/promises";import{dirname as TFe}from"node:path";var pw=Object.freeze({version:1,sessions:{},seenMessageIds:[]});function NFe(n){if(!n||typeof n!="object")return structuredClone(pw);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&typeof i=="string"&&i&&(t[o]=i);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[]}}var dw=class{#e;#A=structuredClone(pw);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=NFe(JSON.parse(await OFe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(pw),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await MFe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(pw)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} +`,o=this.#t.then(async()=>{await DFe(TFe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await _Fe(i,t,{encoding:"utf8",mode:384}),await bFe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{randomUUID as RFe}from"node:crypto";var DZ=new Set(["pending","connecting"]),$u=new Set(["connected","failed","cancelled","expired"]);function wl(n){return typeof n=="string"&&n.trim()?n.trim():null}function Yi(n,t){return Object.freeze({code:n,message:t})}function Dl(n){return n?{attemptId:n.id,status:n.state,pollIntervalMs:n.pollIntervalMs,qrRevision:n.qrRevision,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var eB=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=null;#p=new Map;#c=0;#g=!1;constructor({qrAuth:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("Enterprise WeChat QR auth is required");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("WecomController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("WecomController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#g)return this.status();for(let t of this.#t.list())await this.#Q(t.botId,async()=>{let o=this.#i.get(t.botId)?.status;if(this.#g||o?.ready||o?.wecomConnectionState==="connecting")return;let i=await this.#B(t.secretRef);if(!i){this.#a.set(t.botId,Yi("missing-secret",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}try{await this.#C(t,i),this.#a.delete(t.botId)}catch{this.#a.set(t.botId,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${t.botId} failed to initialize`)}finally{this.#y()}});return this.status()}async startProvisioning(){if(this.#g)throw new Error("Enterprise WeChat controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t={id:RFe(),state:"pending",createdAt:Date.now(),expiresAt:null,pollIntervalMs:3e3,qrRevision:1,verificationUrl:null,scode:null,botId:null,error:null,controller:new AbortController,polling:null,transition:null};this.#n.set(t.id,t),this.#s=t.id,this.#y();try{let o=await this.#e.start({signal:t.controller.signal});if(t.scode=wl(o.scode),t.verificationUrl=wl(o.verificationUrl),t.expiresAt=Number(o.expiresAt),t.pollIntervalMs=Math.min(1e4,Math.max(500,Number(o.pollIntervalMs)||3e3)),!t.scode||!t.verificationUrl||!Number.isFinite(t.expiresAt))throw new Error("Enterprise WeChat QR auth returned incomplete data");return this.#y(),Dl(t)}catch(o){throw t.state=t.controller.signal.aborted?"cancelled":"failed",t.error=t.controller.signal.aborted?Yi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002")):Yi("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#S(t),o}}async registrationStatus(t){let o=this.#n.get(t);if(!o||$u.has(o.state))return Dl(o);if(o.state==="connecting")return await o.transition?.catch(()=>{}),Dl(o);if(Date.now()>=o.expiresAt)return o.state="expired",o.error=Yi("expired",w("\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),o.controller.abort(),this.#S(o),Dl(o);if(!o.polling){let i=this.#I(o).finally(()=>{o.polling===i&&(o.polling=null)});o.polling=i}return await o.polling.catch(()=>{}),Dl(o)}async bindCredentials({botId:t,secret:o}={}){if(this.#g)throw new Error("Enterprise WeChat controller is closed");let i=wl(t),e=wl(o);if(!i||!e)throw new TypeError("Enterprise WeChat Bot ID and Secret are required");if(this.#s&&await this.cancelProvisioning(this.#s),this.#g)throw new Error("Enterprise WeChat controller is closed");let a=cw(i);return await this.#Q(a.botId,async()=>{if(this.#g)throw new Error("Enterprise WeChat controller is closed");let A=this.#t.getByRemoteBotId(i),r=await this.#A.resolve(a.secretRef).catch(()=>{});if(this.#g)throw new Error("Enterprise WeChat controller is closed");let s={botId:a.botId,remoteBotId:i,secretRef:a.secretRef,createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(a.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#f(a.secretRef,r),g}try{await this.#C(s,e),this.#a.delete(a.botId)}catch{this.#a.set(a.botId,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${a.botId} credential connection failed`)}this.#y()}),this.status()}async cancelProvisioning(t){let o=this.#n.get(t);return o?($u.has(o.state)||(o.controller.abort(),await Promise.allSettled([o.polling,o.transition].filter(Boolean)),$u.has(o.state)||(o.state="cancelled"),o.error??=Yi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002")),this.#S(o)),Dl(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return await this.#Q(t,async()=>{let i=await this.#B(o.secretRef);if(!i)throw new Error("Enterprise WeChat bot secret is missing");try{await this.#C(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#y()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return this.#Q(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Cr(w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"));return i.sendConnectionTest(Ra(w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{botId}\uFF09",{botId:bG(o.remoteBotId)})))})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown Enterprise WeChat bot");return this.#Q(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return await this.#Q(t,async()=>{let i=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#u(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.secretRef,i.value).catch(()=>{}),await this.#C(o,i.value).catch(()=>{})),new Error("Unable to remove the Enterprise WeChat bot safely.",{cause:e})}await this.#l({botId:t,config:o}).catch(e=>{this.#o.warn?.(`[dsh-im:wecom] bot ${t} state cleanup failed:`,e)}),this.#a.delete(t),this.#y()}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#i.get(e.botId)?.status??null,A=a?.ready===!0&&a.wecomConnectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.wecomConnectionState==="connecting"?"connecting":this.#a.has(e.botId)||a?.wecomConnectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"),appIdMasked:bG(e.remoteBotId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null,lastConnectedAt:a?.lastConnectedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),error:structuredClone(this.#a.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,i=this.#s?this.#n.get(this.#s):null;return{schemaVersion:1,revision:this.#c,state:i&&DZ.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&DZ.has(i.state)?{provisioning:Dl(i)}:{}}}async close(){this.#g||(this.#g=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#u(t))))}async#I(t){try{let o=await this.#e.poll({scode:t.scode,signal:t.controller.signal});if(t.controller.signal.aborted||$u.has(t.state)||o.status==="waiting")return;if(o.status==="expired"){t.state="expired",t.error=Yi("expired",w("\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#S(t);return}if(o.status!=="success"){t.state="failed",t.error=Yi("qr-connect-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#S(t);return}t.state="connecting",t.verificationUrl=null,t.expiresAt=null,t.scode=null,this.#y();let i=this.#d(t,o);t.transition=i,await i}catch{if(t.controller.signal.aborted)return;t.state="failed",t.error=Yi("qr-connect-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#o.warn?.("[dsh-im:wecom] QR polling failed"),this.#S(t)}}async#d(t,o){try{let i=wl(o.remoteBotId),e=wl(o.secret);if(!i||!e)throw new Error("Enterprise WeChat authorization returned incomplete credentials");t.botId=await this.#h(t,{remoteBotId:i,secret:e}),t.state="connected",t.error=null}catch{t.controller.signal.aborted?(t.state="cancelled",t.error=Yi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Yi("activation-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#o.error?.("[dsh-im:wecom] provisioning failed"))}finally{this.#S(t)}}async#h(t,{remoteBotId:o,secret:i}){let e=cw(o),a=this.#t.getByRemoteBotId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,remoteBotId:o,secretRef:e.secretRef,createdAt:a?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};return this.#Q(e.botId,async()=>{await this.#A.set(e.secretRef,i);try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#t.save(r)}catch(s){throw await this.#f(e.secretRef,A),s}try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#C(r,i),this.#a.delete(e.botId)}catch(s){if(t.controller.signal.aborted)throw await this.#u(e.botId),a?await this.#t.save(a).catch(()=>{}):await this.#t.remove(e.botId).catch(()=>null)&&await this.#l({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-im:wecom] cancelled bot state cleanup failed:",c)}),await this.#f(e.secretRef,A),s;this.#a.set(e.botId,Yi("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${e.botId} activation connection failed`)}return this.#y(),e.botId})}async#C(t,o){if(this.#g)throw new Error("Enterprise WeChat controller is closed");if(await this.#u(t.botId),this.#g)throw new Error("Enterprise WeChat controller is closed");let i=await this.#r({botId:t.botId,config:t,secret:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError("createRuntime returned an invalid Enterprise WeChat runtime");this.#i.set(t.botId,i);try{await i.start()}catch(e){throw await i.stop().catch(()=>{}),this.#i.delete(t.botId),e}}async#u(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-im:wecom] bot ${t} failed to stop cleanly:`,i)})}async#B(t){let o=await this.#A.resolve(t).catch(()=>{});return wl(o?.value)}async#f(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#Q(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#S(t){t.scode=null,t.verificationUrl=null,t.expiresAt=null,this.#s===t.id&&(this.#s=null),this.#y();let o=[...this.#n.values()].filter(i=>$u.has(i.state));for(;o.length>16;)this.#n.delete(o.shift().id)}#y(){this.#c+=1}};import{WSAuthFailureError as ZFe,WSClient as XFe,WSReconnectExhaustedError as $Fe}from"@wecom/aibot-node-sdk";import{generateReqId as kFe}from"@wecom/aibot-node-sdk";var NG=12e4;function vFe(){return[w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` `)}var PFe=18e3,OZ=5*1024*1024,_Z=4;function ma(n){return typeof n=="string"&&n.trim()?n.trim():null}function ws(n){return n?.body&&typeof n.body=="object"?n.body:{}}function bZ(n){let t=ws(n);return t.chattype==="group"?`group:${t.chatid}`:`direct:${t.from?.userid}`}function vG(n){let t=ws(n),o="";return t.msgtype==="text"?o=typeof t.text?.content=="string"?t.text.content.trim():"":t.msgtype==="voice"?o=typeof t.voice?.content=="string"?t.voice.content.trim():"":t.msgtype==="mixed"&&Array.isArray(t.mixed?.msg_item)&&(o=t.mixed.msg_item.filter(i=>i?.msgtype==="text"&&typeof i.text?.content=="string").map(i=>i.text.content).join(` `).trim()),t.chattype==="group"?o.replace(/^\s*@\S+(?:\s+|$)/u,"").trim():o}function GFe(n){let t=ws(n);return t.msgtype==="image"?[t.image]:t.msgtype!=="mixed"||!Array.isArray(t.mixed?.msg_item)?[]:t.mixed.msg_item.filter(o=>o?.msgtype==="image").map(o=>o.image)}function FFe(n){let t=ws(n);return t.msgtype==="file"&&t.file&&typeof t.file=="object"?[t.file]:[]}function LFe(n,t){let o=ma(t?.url);if(!o)return null;let i=ma(t?.aeskey)??void 0;return{async load({signal:e,maxBytes:a}){if(e?.throwIfAborted(),typeof n?.downloadFile!="function")throw new Error("Enterprise WeChat image download is unavailable");let A=await n.downloadFile(o,i);e?.throwIfAborted();let r=A?.buffer;if(!Buffer.isBuffer(r)&&!(r instanceof Uint8Array))throw new Error("Enterprise WeChat image download returned no data");let s=Buffer.from(r);if(Number.isFinite(a)&&s.length>a)throw new ut("image-too-large",`Enterprise WeChat image exceeds ${a} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return{data:s,name:A?.filename}}}}function UFe(n,t){let o=ma(t?.url);if(!o)return null;let i=ma(t?.aeskey)??void 0;return{name:ma(t?.filename??t?.file_name??t?.name)??"file",async load({signal:e}={}){if(e?.throwIfAborted(),typeof n?.downloadFile!="function")throw new Error("Enterprise WeChat file download is unavailable");let a=await n.downloadFile(o,i);e?.throwIfAborted();let A=a?.buffer??a?.data;if(!Buffer.isBuffer(A)&&!(A instanceof Uint8Array))throw new Error("Enterprise WeChat file download returned no data");return{data:Buffer.from(A),...ma(a?.filename)?{name:a.filename.trim()}:{}}}}}function MG(n,t){return{content:vG(n),images:GFe(n).map(o=>LFe(t,o)).filter(Boolean),files:FFe(n).map(o=>UFe(t,o)).filter(Boolean)}}function HFe(n,t){return!Array.isArray(n?.files)||n.files.length===0?n:{...n,files:n.files.map(o=>{let i=o.load({signal:t});return i.catch(()=>{}),{...o,async load({signal:e}={}){e?.throwIfAborted();let a=await i;return e?.throwIfAborted(),a}}})}}function KFe(n,t){return Tt(n)?{...n,images:n.images.map(o=>{let i=o.load({signal:t,maxBytes:OZ});return i.catch(()=>{}),{...o,async load({signal:e,maxBytes:a=OZ}={}){e?.throwIfAborted();let A=await i;e?.throwIfAborted();let r=A?.data??A?.buffer??A;if((Buffer.isBuffer(r)||r instanceof Uint8Array?r.length:0)>a)throw new ut("image-too-large",`Enterprise WeChat image exceeds ${a} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return A}}})}:n}function xFe(n){return{...n,images:n.images.map(t=>({...t,async load(){throw new ut("image-queue-full",`Enterprise WeChat already has ${_Z} prefetched images`,w("\u5F53\u524D\u5F85\u5904\u7406\u56FE\u7247\u8F83\u591A\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u53D1\u9001\u3002"))}}))}}function RG(n){return ws(n).msgtype==="text"?vG(n):""}function YFe(n){return ws(n).msgtype==="text"&&!!ma(vG(n))}function hw(n,t=PFe){let o=String(n??"").trim();if(!o)return[];let i=[],e="",a=0;for(let A of o){let r=Buffer.byteLength(A);e&&a+r>t?(i.push(e),e=A,a=r):(e+=A,a+=r)}return e&&i.push(e),i}function jFe(n){return n?.type==="tool"?w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:n.name}):n?.text}function AB(n,t="",{finish:o=!1}={}){let i=String(n??"").replace(/<\/?think>/gi,"").trim(),e=String(t??"").trim();if(!i)return e;let a=o||e?`${i}`:`${i}`;return e?`${a} ${e}`:a}function JFe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA\u7F3A\u5C11\u7D20\u6750\u4E0A\u4F20\u6216\u6587\u4EF6\u6D88\u606F\u80FD\u529B\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6743\u9650\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u4F01\u4E1A\u5FAE\u4FE1\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u4F01\u4E1A\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function kG(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function MZ(n,t){return t?(t.throwIfAborted(),new Promise((o,i)=>{let e=!1,a=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>a(i,kG(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>a(o,r),r=>a(i,r)),t.aborted&&A()})):n}function _G(n,{dispatched:t=!1}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.httpStatus??n?.status??n?.response?.status),i=Number(n?.providerCode??n?.errcode??n?.body?.errcode),e=new Error("Enterprise WeChat file delivery failed",{cause:n});return o===401||o===403||i===48002?e.code="artifact-permission-required":o===413?e.code="artifact-too-large":o===429||i===45009?e.code="artifact-rate-limited":Number.isFinite(i)&&i!==0?e.code="artifact-provider-rejected":e.code=t?"artifact-delivery-uncertain":"artifact-provider-failed",Number.isFinite(o)&&(e.status=o),Number.isFinite(i)&&(e.providerCode=i),e}async function TZ(n,t,o,i,{signal:e,timeoutMs:a=NG}={}){if(e?.throwIfAborted(),typeof n?.uploadMedia!="function"||typeof n?.sendMediaMessage!="function"){let d=new Error(`Enterprise WeChat ${i} delivery is unavailable`);throw d.code="artifact-provider-unavailable",d}let A=AbortSignal.timeout(a),r=e?AbortSignal.any([e,A]):A,s;try{let d=n.uploadMedia(o.bytes,{type:i,filename:o.fileName});un(o,d),s=await MZ(d,r)}catch(d){throw e?.aborted?kG(e):_G(d)}e?.throwIfAborted();let g=ma(s?.media_id);if(!g){let d=new Error(`Enterprise WeChat ${i} upload returned no media id`);throw d.code="artifact-provider-rejected",d}let c;try{let d=n.sendMediaMessage(t,i,g);un(o,d),c=await MZ(d,r)}catch(d){throw e?.aborted?kG(e):_G(d,{dispatched:!0})}e?.throwIfAborted();let I=Number(c?.body?.errcode??c?.errcode);if(Number.isFinite(I)&&I!==0)throw _G({providerCode:I});return c}function qFe(n,t,o,i){return TZ(n,t,o,"image",i)}function zFe(n,t,o,i){return TZ(n,t,o,"file",i)}function VFe(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):w("\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u6587\u672C\u3002")}function TG(n){return ma(n?.body?.msgid)??ma(n?.body?.message_id)}function WFe(n,t){return t.questions[t.index]&&ma(ws(n).from?.userid)===t.actor&&ma(RG(n))}function PG(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,artifactsSent:0,artifactSendErrors:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var Ew=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=new Map;#g=new Map;#I=new Map;#d=new Map;#h=new Set;#C=new Set;#u;#B=new Ti;#f=0;constructor({client:t,harness:o,state:i,contextEnhancement:e,accessPolicy:a,status:A=PG(),logger:r=console,replyTimeoutMs:s=6e5,generateStreamId:g=kFe,fileUploadTimeoutMs:c=NG,signal:I}){if(!t||typeof t.replyStream!="function"||typeof t.sendMessage!="function")throw new TypeError("Enterprise WeChat client is required");if(!o||!i)throw new TypeError("Harness client and state store are required");if(!Number.isInteger(c)||c<1)throw new TypeError("fileUploadTimeoutMs must be a positive integer");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#p=Math.min(c,NG),this.#s=I,this.#u=new Di({label:"wecom",logger:r})}get status(){return structuredClone(this.#o)}accept(t){if(this.#s?.aborted)return Promise.resolve();let o=ws(t),i=ma(o.msgid),e=ma(o.from?.userid),a=o.chattype==="group"?ma(o.chatid):e;if(!i||!e||!a||!["single","group"].includes(o.chattype)||this.#t.hasSeen(i)||this.#d.has(i))return Promise.resolve();let A=bZ(t),r=this.#g.get(A),s=MG(t,this.#e),g=ma(s.content)??"",c=o.chattype==="single"?"direct":"group",I=Ba(this.#l,{conversationType:c,senderIds:e,text:g,hasImages:Tt(s),hasFiles:wt(s)});if(!I.allowed)return this.#d.set(i,null),this.#y(t,i,a,I);this.#d.set(i,Aa(this.#r,c)),o.chattype==="single"&&So(this.#t,{chatId:a});let d=Ni(g),B=this.#B.status(A);if(d&&o.chattype==="group")return this.#S(t,i,a,{message:es()});if(o.chattype==="single"&&(d||B.phase==="collecting")){let m=/^\/batch$/iu.test(g)&&B.phase==="idle"&&(this.#c.has(A)||r||this.#u.hasPending(A))?{handled:!0,kind:"busy",message:No()}:this.#B.handle(A,g,{plainText:YFe(t)});if(m.handled)return m.kind==="submit"?this.#Q({...t,body:{...o,msgtype:"text",text:{content:m.prompt}}},i,A,{batchSubmission:m}):this.#S(t,i,a,m)}let f=Fa(g)?Ao:wt(s)?null:ni(g)?Mi:si(g)?to:gi(g)?_i:null;if(f){let y;return y=this.#m(t,i,a,A,s,f).catch(m=>{if(m?.code==="turn-stopped"||this.#s?.aborted)return;this.#o.lastError=m?.message??String(m);let T=At(this.#o,m);return this.#i.error?.(`[dsh-im:wecom] failed to process a command [${T.referenceId}]`),this.#E(t,a,dt(T)).catch(()=>{})}).finally(()=>{this.#d.delete(i),this.#C.delete(y)}),this.#C.add(y),y}let Q=this.#u.claimReply({key:A,actor:e,messageId:i,text:RG(t),addressed:!0,hasPendingQuestion:!!r,questionCompletion:r?.submitting||r?.claimedReplyMessageId?r.queue:null,isQuestionPending:()=>this.#g.has(A),send:y=>this.#E(t,a,y)});if(Q){let y;return y=Q.process(async()=>this.#t.hasSeen(i)?!1:(await this.#t.markSeen(i),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#d.delete(i),this.#h.delete(y)}),this.#h.add(y),y}if(r&&r.actor!==e)return this.#Q(t,i,A);if(r?.submitting||r?.claimedReplyMessageId)return this.#Q(t,i,A);if(r){WFe(t,r)&&(r.claimedReplyMessageId=i);let m=(r.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#O(t,i,e,a,A,r)).finally(()=>{this.#d.delete(i),r.claimedReplyMessageId===i&&(r.claimedReplyMessageId=null),r.queue===m&&(r.queue=null)});return r.queue=m,m}return this.#Q(t,i,A)}#Q(t,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1,batchSubmission:A=null}={}){let r=MG(t,this.#e),s=r.images.length,g=0,c=r;s>0&&(this.#f+s<=_Z?(g=s,this.#f+=g,c=KFe(r,this.#s)):c=xFe(r)),c=HFe(c,this.#s);let d=(this.#c.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#T(t,{alreadyRecorded:a,preparedMessage:c,batchSubmission:A})).finally(()=>{this.#f-=g,e&&this.#d.delete(o),this.#c.get(i)===d&&this.#c.delete(i)});return this.#c.set(i,d),d}#S(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#t.hasSeen(o)||(await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),e.message&&await this.#E(t,i,e.message),this.#o.lastError=null)}).catch(async A=>{if(this.#s?.aborted)return;this.#o.lastError=A?.message??String(A);let r=At(this.#o,A);this.#i.error?.(`[dsh-im:wecom] failed to process a batch input message [${r.referenceId}]`),await this.#E(t,i,dt(r)).catch(()=>{})}).finally(()=>{this.#d.delete(o),this.#C.delete(a)}),this.#C.add(a),a}#y(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#t.hasSeen(o)||(await this.#t.markSeen(o),e.reason==="command-not-allowed"?(this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),await this.#E(t,i,w(ao)),this.#o.messagesReplied+=1,this.#o.lastReplyAt=new Date().toISOString()):(this.#o.messagesRejected+=1,this.#o.lastRejectedAt=new Date().toISOString()),this.#o.lastError=null)}).catch(A=>{this.#s?.aborted||(this.#o.lastError=A?.message??String(A),this.#i.error?.("[dsh-im:wecom] failed to apply inbound access policy",A))}).finally(()=>{this.#d.delete(o),this.#C.delete(a)}),this.#C.add(a),a}async waitForIdle(){await Promise.allSettled([...this.#c.values(),...[...this.#g.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#h,...this.#C])}async#m(t,o,i,e,a,A){if(this.#s?.throwIfAborted(),this.#t.hasSeen(o))return;await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString();let r=await A(a.content,this.#A,this.#t,e,{signal:this.#s,isDirect:ws(t).chattype==="single",hasImages:Tt(a),hasFiles:wt(a),pendingInteraction:this.#g.has(e)||this.#u.hasPending(e),control:{owner:this,key:e}});r?.stopped&&await Promise.allSettled([this.#P(e),this.#u.closeRoute(e)]);for(let s of r?.messages??[r?.message])s&&await this.#E(t,i,s);this.#o.lastError=null}async#D(t,o){let i=[];for(let e of hw(o)){this.#s?.throwIfAborted();let a=await this.#e.sendMessage(t,{msgtype:"markdown",markdown:{content:e}}),A=TG(a);A&&i.push(A)}return i}async#E(t,o,i){this.#s?.throwIfAborted();let e=hw(i);if(e.length!==0)try{await this.#e.replyStream(t,this.#n("stream"),e[0],!0);for(let a of e.slice(1))await this.#e.sendMessage(o,{msgtype:"markdown",markdown:{content:a}})}catch{await this.#D(o,i)}}async#N(t,o,i=[],e=null){if(i.length===0)return{receipt:e,failureNoticeVisible:!1,artifactSendErrors:0};let a=await vo({artifacts:i,baseReceipt:e,deliveryId:o,aggregatePresentation:e?"wecom-text-and-files":"wecom-files",alwaysMerge:!0,channelKey:"wecom",signal:this.#s,sendImage:A=>qFe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#p}),sendFile:A=>zFe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#p}),onFailure:(A,r)=>At(this.#o,r,{userMessage:JFe(A?.fileName,r),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#D(t,dt(s)),logger:this.#i});return this.#o.artifactsSent=(this.#o.artifactsSent??0)+a.artifactsSent,this.#o.artifactSendErrors=(this.#o.artifactSendErrors??0)+a.artifactSendErrors,{receipt:a.receipt,failureNoticeVisible:a.failureNoticeVisible,artifactSendErrors:a.artifactSendErrors}}async#T(t,{alreadyRecorded:o=!1,preparedMessage:i,batchSubmission:e=null}={}){if(this.#s?.aborted)return;let a=ws(t),A=typeof a.msgid=="string"?a.msgid:"",r=typeof a.from?.userid=="string"?a.from.userid:"",s=a.chattype==="group"?a.chatid:r;if(!A||!r||!s||!["single","group"].includes(a.chattype))return;if(!o){if(this.#t.hasSeen(A))return;this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString()}let g=i??MG(t,this.#e),c=g.content,I=Tt(g),d=wt(g),B=bZ(t),f=null,Q=!1,y=w("\u6B63\u5728\u601D\u8003\u4E2D\u2026"),m="",T=e===null,_=!1;try{if(!c&&!I&&!d){await this.#E(t,s,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002")),await this.#t.markSeen(A);return}let R=c.toLowerCase();if(!I&&!d&&R==="/help"){await this.#E(t,s,vFe()),await this.#t.markSeen(A);return}if(!I&&!d&&R==="/status"){await this.#A.ensureRunning({signal:this.#s}),await this.#E(t,s,w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002")),await this.#t.markSeen(A);return}if(!I&&!d&&R==="/new"){await this.#t.clearSession(B),await this.#E(t,s,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002")),await this.#t.markSeen(A);return}let K=I||d?null:await Mo(c,this.#A,B);if(K){for(let ie of K.messages??[K.message])await this.#E(t,s,ie);await this.#t.markSeen(A);return}let L=I||d?null:await bi(c,this.#A,this.#t,B,{signal:this.#s});if(L){await this.#E(t,s,L.message),await this.#t.markSeen(A);return}f=this.#n("stream");try{await this.#e.replyStream(t,f,AB(y),!1),Q=!0}catch(ie){this.#i.warn?.("[dsh-im:wecom] unable to start a stream; using an active reply:",ie)}let F=I?await Oo(g,{signal:this.#s}):void 0,q=this.#d.get(A);q&&(F=To(F??c,q,()=>({channel:"wecom",senderId:r}))),await this.#t.markSeen(A),_=!0;let{answer:V,artifacts:x=[]}=await Oi({harness:this.#A,state:this.#t,key:B,text:c,content:F,createOptions:{signal:this.#s},existsOptions:{signal:this.#s},askOptions:{timeoutMs:this.#a,signal:this.#s,control:{owner:this,key:B},onUpdate:Q&&typeof this.#e.replyStreamNonBlocking=="function"?async ie=>{ie?.type==="text"?m=ie.text:y=jFe(ie)||y;let we=hw(AB(y,m))[0];we&&await this.#e.replyStreamNonBlocking(t,f,we,!1)}:void 0,onInteraction:ie=>this.#w(ie,{key:B,actor:r,chatId:s,requiresMention:a.chattype==="group"}),onInteractionResolved:ie=>this.#R(ie),files:g.files}});e&&(this.#B.complete(B,e.token),T=!0),this.#s?.throwIfAborted();let G=VFe(V,x),J=hw(AB(y,G,{finish:!0})),U=!1,N=null,k=null;try{if(Q&&J.length>0)try{let ie=[],we=await this.#e.replyStream(t,f,J[0],!0),se=TG(we);se&&ie.push(se);for(let Te of J.slice(1)){let fe=await this.#e.sendMessage(s,{msgtype:"markdown",markdown:{content:Te}}),ke=TG(fe);ke&&ie.push(ke)}U=!0,N=Zt({deliveryId:A,presentation:"wecom-text",providerMessageIds:ie})}catch(ie){this.#i.warn?.("[dsh-im:wecom] stream finalization failed; using an active reply:",ie)}if(!U){let ie=await this.#D(s,G);N=Zt({deliveryId:A,presentation:"wecom-text",providerMessageIds:ie})}}catch(ie){k=ka(ie),this.#i.warn?.("[dsh-im:wecom] final text delivery failed; continuing with result files:",ie)}let z=await this.#N(s,A,x,N),Ae=z.receipt?.artifacts?.some(({outcome:ie})=>ie==="sent"||ie==="unknown");if(k&&!Ae&&!z.failureNoticeVisible)throw k;return k&&z.artifactSendErrors===0&&At(this.#o,k),_||await this.#t.markSeen(A),this.#o.messagesReplied+=1,this.#o.lastReplyAt=new Date().toISOString(),this.#o.lastError=null,!k&&z.artifactSendErrors===0&&wo(this.#o),z.receipt}catch(R){let K=null;if(!T&&e&&(R?.code==="turn-stopped"?this.#B.complete(B,e.token):K=this.#B.fail(B,e.token).message??null,T=!0),R?.code==="turn-stopped"){Q&&f&&await this.#e.replyStream(t,f,AB(y,w("\u5DF2\u505C\u6B62\u3002"),{finish:!0}),!0).catch(()=>{}),_||await this.#t.markSeen(A);return}if(this.#s?.aborted)return;this.#o.lastError=R?.message??String(R);let L=ko(R)??bo(R),F=At(this.#o,R,{userMessage:L,reason:eo(R)?.reason});this.#i.error?.(`[dsh-im:wecom] failed to process an inbound message [${F.referenceId}]`);let q=dt(F),V=K?`${q} -${K}`:q;try{Q&&f?await this.#e.replyStream(t,f,AB(y,V,{finish:!0}),!0):await this.#E(t,s,V),_||await this.#t.markSeen(A)}catch{this.#i.error?.("[dsh-im:wecom] failed to send the safe error reply")}}finally{await Promise.allSettled([this.#P(B),this.#u.closeRoute(B)])}}async#O(t,o,i,e,a,A){if(this.#s?.aborted)return;let r=this.#g.get(a),s=A.claimedReplyMessageId===o;if(!r||r!==A||r.submitting)return s&&(!r||r!==A)?this.#G(t,o,e):this.#Q(t,o,a,{releaseMessageId:!1});if(this.#t.hasSeen(o))return;await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString();let g=ma(RG(t));if(!g){await this.#E(t,e,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002")).catch(()=>{});return}let c=this.#g.get(a);if(!c||c!==A||c.submitting){if(s&&(!c||c!==A)){await this.#E(t,e,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{});return}return this.#Q(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.actor!==i)return this.#Q(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0});if(c.chatId=e,c.needsPresentation){try{await this.#_(c)}catch{this.#o.lastError=w("\u4F01\u4E1A\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#i.error?.("[dsh-im:wecom] failed to retry an interaction question"),c.interaction.reconnect?.();return}let d=this.#g.get(a);if(!d||d!==A||d.submitting){if(s&&(!d||d!==A)){await this.#E(t,e,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{});return}return this.#Q(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(wi(I,g)),c.index+=1,c.index{});return}if(this.#g.get(a)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#o.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#i.error?.("[dsh-im:wecom] failed to answer a Harness interaction"),await this.#E(t,e,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#w(t,{key:o,actor:i,chatId:e,requiresMention:a}){if(t?.kind==="approval")return this.#u.handleRequested(t,{key:o,actor:i,requiresMention:a,send:c=>this.#D(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#i.warn?.("[dsh-im:wecom] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Enterprise WeChat safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#D(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002")).catch(()=>{});return}let s=this.#g.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#_(s);return}if(this.#I.has(r))return;if(s){this.#i.warn?.("[dsh-im:wecom] cancelled a second pending Harness question"),await t.respond({ok:!1,error:{code:"cancelled",message:"Enterprise WeChat is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,chatId:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,presentationPromise:null};this.#g.set(o,g),this.#I.set(g.interactionId,o),await this.#_(g)}async#R(t){if(t?.kind==="approval"){await this.#u.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#I.get(o);i&&this.#F(i,o)}#_(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=this.#D(t.chatId,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===i&&(t.presentationPromise=null)});return t.presentationPromise=i,i}async#G(t,o,i){this.#t.hasSeen(o)||(await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),await this.#E(t,i,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{}))}#k(t,o){let i=this.#g.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#g.delete(t),this.#I.delete(i.interactionId),i)}#F(t,o){return this.#k(t,o)!==null}async#P(t){let o=this.#k(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Enterprise WeChat interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#i.warn?.("[dsh-im:wecom] failed to cancel a pending Harness interaction")}}};function eLe(){let n=new Error("Enterprise WeChat WebSocket authentication timed out");return n.code="connect-timeout",n}function ALe(){return{startedAt:null,ready:!1,wecomConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...PG()}}var tB=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=ALe();#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,secret:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,maxReconnectAttempts:c=10,createClient:I=d=>new XFe(d)}){if(!t||!o||!i||!e)throw new TypeError("WecomRuntime requires config, secret, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#c)}async start(){if(this.#c.ready&&this.#g)return this.status;if(this.#d)return this.#d;this.#C?.abort(new DOMException("Enterprise WeChat runtime replaced","AbortError"));let t=new AbortController;return this.#h=t,this.#C=t,this.#d=this.#u(t.signal).finally(()=>{this.#h===t&&(this.#h=null),this.#d=null}),this.#d}async#u(t){await this.#B(),t.throwIfAborted(),this.#c.startedAt=new Date().toISOString(),this.#c.wecomConnectionState="connecting",this.#c.lastError=null,await this.#t.ensureRunning(),this.#c.harnessReachable=!0;let o={debug(){},info(){},warn(){},error(){}},i=this.#p({botId:this.#e.remoteBotId,secret:this.#A,logger:o,maxReconnectAttempts:this.#s});if(!i||typeof i.connect!="function"||typeof i.disconnect!="function")throw new TypeError("Enterprise WeChat client factory returned an invalid client");this.#g=i,this.#I=new Ew({client:i,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#c,logger:this.#i,replyTimeoutMs:this.#a,signal:t});let e,a,A=!1,r=new Promise((f,Q)=>{e=f,a=Q}),s=()=>{if(this.#g!==i||t.aborted)return;A=!0;let f=Date.now();this.#c.ready=!0,this.#c.wecomConnectionState="connected",this.#c.lastCheckedAt=f,this.#c.lastConnectedAt=f,this.#c.lastError=null,e()},g=()=>{this.#g===i&&(this.#c.ready=!1,this.#c.wecomConnectionState="connecting",this.#c.lastCheckedAt=Date.now())},c=()=>{this.#g===i&&(this.#c.ready=!1,this.#c.wecomConnectionState="connecting",this.#c.lastCheckedAt=Date.now())},I=f=>{if(this.#g!==i)return;let Q=f instanceof ZFe||f instanceof $Fe;!A&&Q&&a(f),Q&&(this.#c.ready=!1,this.#c.wecomConnectionState="failed"),this.#c.lastError=Q?f.name:"connection-error",this.#i.warn?.(`[dsh-im:wecom] bot ${this.#e.botId} connection error`)},d=f=>this.#I?.accept(f);i.on("authenticated",s),i.on("disconnected",g),i.on("reconnecting",c),i.on("error",I),i.on("message",d);let B;try{return i.connect(),await Promise.race([r,new Promise((f,Q)=>{t.addEventListener("abort",()=>Q(t.reason),{once:!0})}),new Promise((f,Q)=>{B=setTimeout(()=>Q(eLe()),this.#n)})]),this.status}catch(f){throw t.aborted?(await this.#B(),f):(this.#c.ready=!1,this.#c.wecomConnectionState="failed",this.#c.lastError=f?.message??String(f),await this.#B(),f)}finally{clearTimeout(B)}}async stop(){let t=this.#d;return this.#h?.abort(new DOMException("Enterprise WeChat runtime stopped","AbortError")),this.#C?.abort(new DOMException("Enterprise WeChat runtime stopped","AbortError")),this.#C=null,await this.#B(),await t?.catch(()=>{}),this.status}async sendConnectionTest(t){return nc({state:this.#r,text:t,channelLabel:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"),send:async({chatId:o},i)=>{if(!this.#c.ready||!this.#g)throw new Error("Enterprise WeChat runtime is not connected");await this.#g.sendMessage(o,{msgtype:"markdown",markdown:{content:i}})}})}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.chatId=="string"?t.route.chatId.trim():"";if(t?.kind!=="user"&&t?.kind!=="group"||!e){let a=new TypeError("Invalid Enterprise WeChat proactive delivery target");throw a.code="invalid-target",a}if(!this.#c.ready||!this.#g){let a=new Error("Enterprise WeChat runtime is not connected");throw a.code="bot-not-connected",a}return i?.throwIfAborted(),await this.#g.sendMessage(e,{msgtype:"markdown",markdown:{content:o}}),{sent:!0}}async#B(){let t=this.#g,o=this.#I;this.#g=null,this.#I=null;try{t?.disconnect(),t?.removeAllListeners?.()}catch{this.#i.warn?.(`[dsh-im:wecom] bot ${this.#e.botId} failed to stop cleanly`)}await o?.waitForIdle(),this.#c.ready=!1,this.#c.wecomConnectionState="idle"}};var NZ=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function tLe(n){if(!Array.isArray(n)||n.length===0)return[...NZ];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...NZ]}var Cw=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=tLe(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(iLa(n),B=iLe(t),f=await new e(B.config).load(),Q=Ol(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(z=>z.botId)),await Promise.all(T.map(z=>m.ensure(z.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("wecom",z)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=o.qrAuth??new g({source:t.qrSource??"deepseek-harness",platform:t.qrPlatform}),K=new Map,L=z=>Ol(B.bots,z,"state.json"),F=async z=>{let Ae=K.get(z);return Ae||(Ae=await new a(L(z)).load(),K.set(z,Ae)),Ae},q=ja(n,o.commandExecutor),{controlExecutor:V,sessionMaintenanceExecutor:x,fileIngressExecutor:G}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),J=new A({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...q?{commandExecutor:q}:{},...V?{controlExecutor:V}:{},...x?{sessionMaintenanceExecutor:x}:{},...G?{fileIngressExecutor:G}:{}}),U=new r({qrAuth:R,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:z,config:Ae,secret:ie})=>{let we=await F(z);await m.ensure(z,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("wecom",Ae)});let se=Ka(J,{botId:z,workspaces:m,state:we,agentPresetCatalog:d});return new s({config:Ae,secret:ie,harness:se.harness,state:se.state,contextEnhancement:{botId:z,getSettings:()=>m.contextEnhancementFor(z)},accessPolicy:qa(m,z,{channel:"wecom",config:Ae}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,maxReconnectAttempts:t.maxReconnectAttempts??10,logger:{error:(...Te)=>I.error?.(`[${z}]`,...Te),warn:(...Te)=>I.warn?.(`[${z}]`,...Te),info:(...Te)=>I.info?.(`[${z}]`,...Te),debug:(...Te)=>I.debug?.(`[${z}]`,...Te)}})},deleteState:async({botId:z})=>{let Ae=K.get(z);if(K.delete(z),Ae&&typeof Ae.remove=="function")await Ae.remove();else try{await rLe(L(z))}catch(ie){if(ie?.code!=="ENOENT")throw ie}}}),N=xa(U,{workspaces:m,stateFor:F,agentPresetCatalog:d}),k=c({controller:N,harness:J,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:N,deliveryAdapter:Ya({channel:"wecom",workspaces:m,coreController:U,stateFor:F}),ready:k.ready,async close(){await k.close(),await N.close(),J.stopManagedProcess()}}}import oLe from"qrcode";var kZ="/wecom",Ir=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),vZ=Object.freeze(Object.values(Ir)),nLe=new Set(["secret","secretRef","scode","remoteBotId","verificationUrl","bot_info","botid"]);function HG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Zd(n,t){return HG(n)&&Object.keys(n).every(o=>t.includes(o))}function LG(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function RZ(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function sLe(n,t){return HG(t)?n===Ir.status?Zd(t,[])?null:"connection.status does not accept fields.":n===Ir.beginProvisioning?Zd(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Ir.pollProvisioning,Ir.cancelProvisioning].includes(n)?Zd(t,["attemptId"])&&LG(t.attemptId)?null:`${n} requires an attemptId.`:n===Ir.bindCredentials?Zd(t,["botId","secret"])&&RZ(t.botId,512)&&RZ(t.secret,1024)?null:"bot.bind-credentials requires Bot ID and Secret.":n===Ir.reconnectBot?Zd(t,["botId","sendTest"])&&LG(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Ir.deleteBot?Zd(t,["botId","confirm"])&&LG(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Ir.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Ir.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Ir.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Ir.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown Enterprise WeChat endpoint.":"Payload must be an object."}function Xd(n){if(Array.isArray(n))return n.map(Xd);if(!HG(n))return n;let t={};for(let[o,i]of Object.entries(n))nLe.has(o)||(t[o]=Xd(i));return t}async function gLe(n){return oLe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function UG(n,t){return!n||typeof n.verificationUrl!="string"?Xd(n):Xd({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Gc(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await UG(o.provisioning,t)),Xd(o)}function PZ(n,{encodeQr:t=gLe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete Enterprise WeChat controller is required (${e})`);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!vZ.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown Enterprise WeChat endpoint."}};let r=sLe(e,a);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Ir.status)s=await Gc(await n.status(),i);else if(e===Ir.beginProvisioning)s=await UG(await n.startProvisioning(),i);else if(e===Ir.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await UG(g,i)}else if(e===Ir.cancelProvisioning)s=Xd(await n.cancelProvisioning(a.attemptId));else if(e===Ir.bindCredentials)s=await Gc(await n.bindCredentials(a),i);else if(e===Ir.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=or()}catch(d){c=or(d)}s=await Gc({...g,...c?{testMessage:c}:{}},i)}else if(e===Ir.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Gc(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===Ir.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Gc(g,i))}else if(e===Ir.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Gc(g,i))}else if(e===Ir.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Gc(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await Gc(await n.deleteBot(a.botId),i);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"wecom-operation-failed",message:"\u4F01\u4E1A\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function uw(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(kZ,PZ(t,o),{authority:fr(i)})}async function GZ(n,t={}){if(t?.controller)return uw(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await FG(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=uw(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Enterprise WeChat bot connections"),e}import{unlink as p2e}from"node:fs/promises";import{homedir as d2e}from"node:os";import{join as lB,resolve as _l}from"node:path";import{createHash as _Le}from"node:crypto";import{mkdir as TLe,readFile as NLe,rename as RLe,unlink as kLe,writeFile as vLe}from"node:fs/promises";import{dirname as PLe}from"node:path";import{createCipheriv as cLe,createDecipheriv as ILe,createHash as FZ,randomBytes as xG,randomUUID as LZ}from"node:crypto";var Bw="https://ilinkai.weixin.qq.com/",lLe="2.4.6",pLe="3",KZ="https://novac2c.cdn.weixin.qq.com/c2c",bl=1800,YG="novac2c.cdn.weixin.qq.com",dLe="bot",hLe=2<<16|1024|6,ELe=15e3,UZ=35e3,CLe=3,uLe=new Set(["wait","scaned","confirmed","expired","scaned_but_redirect","need_verifycode","verify_code_blocked","binded_redirect"]),NA=class extends Error{constructor(t,o,i={}){super(o,i),this.name="WeixinApiError",this.code=t,this.status=i.status,this.providerCode=i.providerCode}};function Mt(n){return typeof n=="string"&&n.trim()?n.trim():null}function xZ(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function YZ(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function aB(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),i=xZ(n?.providerCode),e=i??"",a=t,A="Weixin could not prepare the file for delivery.";o===401||o===403||i==="401"||i==="403"||/(?:permission|forbidden|unauthor|access.?denied)/i.test(e)?(a="artifact-permission-required",A="Weixin denied permission to send the file."):o===413||i==="413"||/(?:too.?large|size.?limit)/i.test(e)?(a="artifact-too-large",A="The file exceeds Weixin's size limit."):o===429||i==="429"||/(?:rate.?limit|too.?many)/i.test(e)?(a="artifact-rate-limited",A="Weixin rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="Weixin rejected the file message.");let r=new Error(A,{cause:n});return r.code=a,YZ(r,n)}function BLe(n){let t=new Error("Weixin file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",YZ(t,n)}function KG(n){if(!n||typeof n!="object")return null;for(let t of["ret","errcode"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return xZ(n[t])??"rejected";return null}function fLe(n,t){if(t?.aborted)throw $d(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?BLe(n):aB(n)}function QLe(n){let t=Mt(n);return!t||t.length%4!==0||!/^[A-Za-z0-9+/]+={0,2}$/.test(t)?null:Buffer.from(t,"base64")}function jZ(n){let t=Mt(n?.aeskey);if(t){if(!/^[0-9a-fA-F]{32}$/.test(t))throw new NA("invalid-image-key","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002");return Buffer.from(t,"hex")}let o=QLe(n?.media?.aes_key);if(o?.length===16)return o;if(o?.length===32&&/^[0-9a-fA-F]{32}$/.test(o.toString("ascii")))return Buffer.from(o.toString("ascii"),"hex");throw new NA("invalid-image-key","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002")}function JZ(n,t){let o=Buffer.from(n),i=Buffer.from(t);if(i.length!==16||o.length===0||o.length%16!==0)throw new NA("invalid-image-ciphertext","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u6570\u636E\u65E0\u6548\u3002");try{let e=ILe("aes-128-ecb",i,null);return Buffer.concat([e.update(o),e.final()])}catch(e){throw new NA("image-decryption-failed","\u5FAE\u4FE1\u56FE\u7247\u89E3\u5BC6\u5931\u8D25\u3002",{cause:e})}}function qZ(n){let t=Mt(n?.encrypt_query_param);if(t)return`${KZ}/download?encrypted_query_param=${encodeURIComponent(t)}`;let o=Mt(n?.full_url);if(!o)throw new NA("missing-image-url","\u5FAE\u4FE1\u56FE\u7247\u6CA1\u6709\u53EF\u7528\u7684\u4E0B\u8F7D\u5730\u5740\u3002");let i;try{i=new URL(o)}catch{throw new NA("invalid-image-url","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u65E0\u6548\u3002")}if(i.protocol!=="https:"||i.hostname!==YG||i.port&&i.port!=="443"||!i.pathname.startsWith("/c2c/"))throw new NA("untrusted-image-url","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002");return i.username="",i.password="",i.hash="",i.toString()}function jG(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[];for(let i of n?.item_list??[]){let e=i?.image_item;!e||typeof e!="object"||o.push({name:o.length===0?"image":`image-${o.length+1}`,load:async({signal:a,maxBytes:A})=>{let r=jZ(e),s=qZ(e.media),g=await Do(s,{fetchImpl:t,signal:a,maxBytes:A+16,allowedHosts:[YG]});return JZ(g,r)}})}return o}async function yLe(n,{fetchImpl:t,signal:o}){let i=await t(new URL(n),{method:"GET",signal:o,redirect:"manual"});if(!i?.ok)throw await i?.body?.cancel?.().catch?.(()=>{}),new NA("file-download-failed",`\u5FAE\u4FE1\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${i?.status??"unknown"}\uFF09\u3002`,{status:i?.status});return Buffer.from(await i.arrayBuffer())}function JG(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[];for(let i of n?.item_list??[]){let e=i?.file_item;if(!e||typeof e!="object")continue;let a=Number(e.len);o.push({name:Mt(e.file_name)??(o.length===0?"file":`file-${o.length+1}`),...Number.isFinite(a)&&a>=0?{size:a}:{},load:async({signal:A}={})=>{A?.throwIfAborted();let r=jZ(e),s=qZ(e.media),g=await yLe(s,{fetchImpl:t,signal:A});return A?.throwIfAborted(),JZ(g,r)}})}return o}function qG(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="weixin.qq.com"||t.endsWith(".weixin.qq.com")||t==="wechat.com"||t.endsWith(".wechat.com")}function eh(n){let t;try{t=new URL(n)}catch{throw new NA("invalid-base-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002")}if(t.protocol!=="https:"||!qG(t.hostname)||t.port!==""&&t.port!=="443")throw new NA("untrusted-base-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002");return t.username="",t.password="",t.search="",t.hash="",t.pathname.endsWith("/")||(t.pathname+="/"),t.toString()}function mLe(n){let t=Mt(n);if(!t)throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002");let o;try{o=new URL(t)}catch{throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002")}if(o.protocol!=="https:"||!qG(o.hostname))throw new NA("untrusted-qr","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002");return o.toString()}function zZ(){return{"iLink-App-Id":dLe,"iLink-App-ClientVersion":String(hLe)}}function SLe(n){let t={...zZ(),"content-type":"application/json",AuthorizationType:"ilink_bot_token","X-WECHAT-UIN":Buffer.from(String(xG(4).readUInt32BE(0)),"utf8").toString("base64")};return Mt(n)&&(t.Authorization=`Bearer ${n.trim()}`),t}function Fc(){return{channel_version:lLe,bot_agent:"DeepSeekHarness/1.1.0"}}function wLe(n){return Math.ceil((n+1)/16)*16}function HZ(n){let t;try{t=new URL(n)}catch{throw new NA("invalid-upload-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002")}if(t.protocol!=="https:"||t.hostname!==YG||t.port&&t.port!=="443"||t.pathname!=="/c2c/upload"||t.username||t.password)throw new NA("untrusted-upload-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002");return t.hash="",t}function DLe(n,t){let o=Mt(n?.upload_full_url);if(o)return HZ(o);let i=Mt(n?.upload_param);if(!i)throw new NA("missing-upload-url","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002");let e=new URL(`${KZ}/upload`);return e.searchParams.set("encrypted_query_param",i),e.searchParams.set("filekey",t),HZ(e)}function OLe(n,t){let o=cLe("aes-128-ecb",t,null);return Buffer.concat([o.update(n),o.final()])}async function bLe(n,t,o,{signal:i}={}){let e;for(let a=1;a<=CLe;a+=1){i?.throwIfAborted();try{let A=await n(t,{method:"POST",headers:{"content-type":"application/octet-stream"},body:o,signal:i?AbortSignal.any([i,AbortSignal.timeout(6e4)]):AbortSignal.timeout(6e4),redirect:"error"});if(A.status>=400&&A.status<500)throw new NA("upload-rejected",`\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u88AB\u62D2\u7EDD\uFF08HTTP ${A.status}\uFF09\u3002`,{status:A.status});if(A.status!==200)throw new NA("upload-failed",`\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF08HTTP ${A.status}\uFF09\u3002`,{status:A.status});let r=Mt(A.headers.get("x-encrypted-param"));if(await A.body?.cancel?.().catch(()=>{}),!r)throw new NA("invalid-upload-response","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u7F3A\u5C11\u4E0B\u8F7D\u53C2\u6570\u3002");return r}catch(A){if(i?.aborted)throw $d(i);if(A instanceof NA&&(A.code==="upload-rejected"||A.status<500))throw A;e=A}}throw e instanceof NA?e:new NA("upload-failed","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002",{cause:e})}function $d(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}async function Ds(n,{method:t,baseUrl:o,endpoint:i,body:e,token:a,timeoutMs:A=ELe,signal:r,authenticated:s=!0}){let g=eh(o),c=new URL(i,g);if(!qG(c.hostname))throw new NA("untrusted-endpoint","\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002");let I=new AbortController,d=!1,B=()=>I.abort(r?.reason);if(r?.aborted)throw $d(r);r?.addEventListener("abort",B,{once:!0});let f=A>0?setTimeout(()=>{d=!0,I.abort()},A):null;try{let Q=await n(c,{method:t,headers:s?SLe(a):zZ(),...e===void 0?{}:{body:JSON.stringify(e)},signal:I.signal});if(!Q.ok)throw new NA("http-error",`\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${Q.status}\uFF09\u3002`,{status:Q.status});try{return await Q.json()}catch(y){throw new NA("invalid-response","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:y})}}catch(Q){throw r?.aborted?$d(r):d?new NA("timeout","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:Q}):Q instanceof NA?Q:new NA("network-error","\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002",{cause:Q})}finally{f&&clearTimeout(f),r?.removeEventListener("abort",B)}}function MLe(n){if(!n||typeof n!="object"||!uLe.has(n.status))throw new NA("invalid-login-status","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002");return n}function VZ({fetchImpl:n=fetch}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");async function t({baseUrl:o,token:i,toUserId:e,file:a,contextToken:A,runId:r,signal:s},{mediaType:g,createItem:c}){let I=Mt(e);if(!I||!a||typeof a!="object"||typeof a.fileName!="string"||!a.fileName||!Buffer.isBuffer(a.bytes))throw new TypeError("toUserId and a file are required");s?.throwIfAborted();let d=xG(16).toString("hex"),B=xG(16),f=FZ("md5").update(a.bytes).digest("hex"),Q;try{Q=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getuploadurl",token:i,signal:s,body:{filekey:d,media_type:g,to_user_id:I,rawsize:a.bytes.byteLength,rawfilemd5:f,filesize:wLe(a.bytes.byteLength),no_need_thumb:!0,aeskey:B.toString("hex"),base_info:Fc()}})}catch(x){if(s?.aborted)throw $d(s);let G=Number(x?.status),J=x?.code==="http-error"&&G>=400&&G<500?"artifact-provider-rejected":"artifact-provider-failed";throw aB(x,{fallback:J})}let y=KG(Q);if(y)throw aB(new NA("upload-url-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{providerCode:y}));let m=DLe(Q,d),T=OLe(a.bytes,B),_;try{_=await bLe(n,m,T,{signal:s})}catch(x){if(s?.aborted)throw $d(s);let G=Number(x?.status),J=x?.code==="upload-rejected"||G>=400&&G<500?"artifact-provider-rejected":"artifact-provider-failed";throw aB(x,{fallback:J})}s?.throwIfAborted();let R=Mt(a.deliveryKey)??Mt(a.artifactId)??LZ(),K=g===3?R:`${R}\0${g}`,L=`dsh-weixin-${FZ("sha256").update(K).digest("hex").slice(0,32)}`,F={encrypt_query_param:_,aes_key:Buffer.from(B.toString("hex")).toString("base64"),encrypt_type:1},q;try{q=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendmessage",token:i,signal:s,body:{msg:{from_user_id:"",to_user_id:I,client_id:L,message_type:2,message_state:2,item_list:[c({file:a,media:F,ciphertextSize:T.byteLength})],...Mt(A)?{context_token:A.trim()}:{},...Mt(r)?{run_id:r.trim()}:{}},base_info:Fc()}})}catch(x){throw fLe(x,s)}let V=KG(q);if(V)throw aB(new NA("send-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:V}));return{messageId:L}}return Object.freeze({inboundImages(o){return jG(o,{fetchImpl:n})},inboundFiles(o){return JG(o,{fetchImpl:n})},async beginLogin({localTokens:o=[],botType:i=pLe,signal:e}={}){let a=[...new Set(o.map(Mt).filter(Boolean))].slice(-10),A=await Ds(n,{method:"POST",baseUrl:Bw,endpoint:`ilink/bot/get_bot_qrcode?bot_type=${encodeURIComponent(i)}`,body:{local_token_list:a},timeoutMs:1e4,signal:e}),r=Mt(A?.qrcode);if(!r)throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002");return{qrcode:r,qrcodeUrl:mLe(A.qrcode_img_content)}},async pollLogin({qrcode:o,baseUrl:i=Bw,verifyCode:e,signal:a}){let A=Mt(o);if(!A)throw new TypeError("qrcode is required");let r=`ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(A)}`;Mt(e)&&(r+=`&verify_code=${encodeURIComponent(e.trim())}`);let s=await Ds(n,{method:"GET",baseUrl:i,endpoint:r,timeoutMs:UZ,signal:a,authenticated:!1});return MLe(s)},async getUpdates({baseUrl:o,token:i,getUpdatesBuf:e="",timeoutMs:a,signal:A}){try{return await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getupdates",body:{get_updates_buf:e,base_info:Fc()},token:i,timeoutMs:a??UZ,signal:A})}catch(r){if(r instanceof NA&&r.code==="timeout")return{ret:0,msgs:[],get_updates_buf:e};throw r}},async getConfig({baseUrl:o,token:i,toUserId:e,contextToken:a,signal:A}){let r=Mt(e);if(!r)throw new TypeError("toUserId is required");let s=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getconfig",token:i,signal:A,timeoutMs:1e4,body:{ilink_user_id:r,...Mt(a)?{context_token:a.trim()}:{},base_info:Fc()}});if(s?.ret!==void 0&&s.ret!==0)throw new NA("config-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u914D\u7F6E\u8BF7\u6C42\u3002");return{typingTicket:Mt(s?.typing_ticket)}},async sendTyping({baseUrl:o,token:i,toUserId:e,typingTicket:a,status:A,signal:r}){let s=Mt(e),g=Mt(a);if(!s||!g)throw new TypeError("toUserId and typingTicket are required");if(A!==1&&A!==2)throw new TypeError("typing status must be 1 or 2");let c=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendtyping",token:i,signal:r,timeoutMs:1e4,body:{ilink_user_id:s,typing_ticket:g,status:A,base_info:Fc()}});if(c?.ret!==void 0&&c.ret!==0)throw new NA("typing-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u8F93\u5165\u72B6\u6001\u8BF7\u6C42\u3002");return!0},async sendText({baseUrl:o,token:i,toUserId:e,text:a,contextToken:A,runId:r,signal:s}){let g=Mt(e),c=Mt(a);if(!g||!c)throw new TypeError("toUserId and text are required");let I=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendmessage",token:i,signal:s,body:{msg:{from_user_id:"",to_user_id:g,client_id:`dsh-weixin-${LZ()}`,message_type:2,message_state:2,item_list:[{type:1,text_item:{text:c}}],...Mt(A)?{context_token:A.trim()}:{},...Mt(r)?{run_id:r.trim()}:{}},base_info:Fc()}}),d=KG(I);if(d)throw new NA("send-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002",{providerCode:d});return!0},async sendFile(o){return t(o,{mediaType:3,createItem:({file:i,media:e})=>({type:4,file_item:{media:e,file_name:i.fileName,len:String(i.bytes.byteLength)}})})},async sendImage(o){return t(o,{mediaType:1,createItem:({media:i,ciphertextSize:e})=>({type:2,image_item:{media:i,mid_size:e}})})},async notifyStart({baseUrl:o,token:i,signal:e}){let a=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/msg/notifystart",token:i,signal:e,timeoutMs:1e4,body:{base_info:Fc()}});if(a?.ret!==void 0&&a.ret!==0)throw new NA("start-rejected","\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002");return a},async notifyStop({baseUrl:o,token:i,signal:e}){return Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/msg/notifystop",token:i,signal:e,timeoutMs:1e4,body:{base_info:Fc()}})}})}function Ml(n){for(let t of n?.item_list??[]){if(t?.type===1&&typeof t.text_item?.text=="string"){let o=t.text_item.text.trim();if(o)return o}if(t?.type===3&&typeof t.voice_item?.text=="string"){let o=t.voice_item.text.trim();if(o)return o}}return null}function zG(n){return n?.message_id!==void 0&&n.message_id!==null?String(n.message_id):Mt(n?.client_id)}function WZ(n,t=bl){if(n.length<=t)return[n];let o=[],i=n;for(;i.length>t;){let e=i.lastIndexOf(` -`,t);ea===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.accountId)||e.has(a.tokenRef))return null;o.add(a.botId),i.add(a.accountId),e.add(a.tokenRef)}return Object.freeze({version:1,accounts:Object.freeze(t)})}var fw=class{#e;#A=VG;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=FLe(JSON.parse(await NLe(this.#e,"utf8")));if(!t)throw new Error("dsh-weixin config contains invalid account data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=VG}return this}list(){return structuredClone(this.#A.accounts)}get(t){let o=this.#A.accounts.find(i=>i.botId===t);return o?structuredClone(o):null}getByAccountId(t){let o=this.#A.accounts.find(i=>i.accountId===t);return o?structuredClone(o):null}async save(t){let o=XZ(t);if(!o)throw new Error("Refusing to persist incomplete dsh-weixin account data");return this.#r(i=>{let e=i.find(r=>r.accountId===o.accountId&&r.botId!==o.botId),a=i.find(r=>r.tokenRef===o.tokenRef&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate Weixin account identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!ZZ(t))throw new TypeError("Invalid Weixin bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await kLe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=VG});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.accounts];o=t(e);let a=Object.freeze({version:1,accounts:Object.freeze(e)});await this.#l(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#l(t){await TLe(PLe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await vLe(o,`${JSON.stringify(t,null,2)} +${K}`:q;try{Q&&f?await this.#e.replyStream(t,f,AB(y,V,{finish:!0}),!0):await this.#E(t,s,V),_||await this.#t.markSeen(A)}catch{this.#i.error?.("[dsh-im:wecom] failed to send the safe error reply")}}finally{await Promise.allSettled([this.#P(B),this.#u.closeRoute(B)])}}async#O(t,o,i,e,a,A){if(this.#s?.aborted)return;let r=this.#g.get(a),s=A.claimedReplyMessageId===o;if(!r||r!==A||r.submitting)return s&&(!r||r!==A)?this.#G(t,o,e):this.#Q(t,o,a,{releaseMessageId:!1});if(this.#t.hasSeen(o))return;await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString();let g=ma(RG(t));if(!g){await this.#E(t,e,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002")).catch(()=>{});return}let c=this.#g.get(a);if(!c||c!==A||c.submitting){if(s&&(!c||c!==A)){await this.#E(t,e,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{});return}return this.#Q(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.actor!==i)return this.#Q(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0});if(c.chatId=e,c.needsPresentation){try{await this.#_(c)}catch{this.#o.lastError=w("\u4F01\u4E1A\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#i.error?.("[dsh-im:wecom] failed to retry an interaction question"),c.interaction.reconnect?.();return}let d=this.#g.get(a);if(!d||d!==A||d.submitting){if(s&&(!d||d!==A)){await this.#E(t,e,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{});return}return this.#Q(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(wi(I,g)),c.index+=1,c.index{});return}if(this.#g.get(a)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#o.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#i.error?.("[dsh-im:wecom] failed to answer a Harness interaction"),await this.#E(t,e,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#w(t,{key:o,actor:i,chatId:e,requiresMention:a}){if(t?.kind==="approval")return this.#u.handleRequested(t,{key:o,actor:i,requiresMention:a,send:c=>this.#D(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#i.warn?.("[dsh-im:wecom] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Enterprise WeChat safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#D(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002")).catch(()=>{});return}let s=this.#g.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#_(s);return}if(this.#I.has(r))return;if(s){this.#i.warn?.("[dsh-im:wecom] cancelled a second pending Harness question"),await t.respond({ok:!1,error:{code:"cancelled",message:"Enterprise WeChat is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,requiresMention:a,questions:A,answers:[],index:0,chatId:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,presentationPromise:null};this.#g.set(o,g),this.#I.set(g.interactionId,o),await this.#_(g)}async#R(t){if(t?.kind==="approval"){await this.#u.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#I.get(o);i&&this.#F(i,o)}#_(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=this.#D(t.chatId,Si(o,t.index,t.questions.length,{requiresMention:t.requiresMention})).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===i&&(t.presentationPromise=null)});return t.presentationPromise=i,i}async#G(t,o,i){this.#t.hasSeen(o)||(await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),await this.#E(t,i,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{}))}#k(t,o){let i=this.#g.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#g.delete(t),this.#I.delete(i.interactionId),i)}#F(t,o){return this.#k(t,o)!==null}async#P(t){let o=this.#k(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Enterprise WeChat interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#i.warn?.("[dsh-im:wecom] failed to cancel a pending Harness interaction")}}};function eLe(){let n=new Error("Enterprise WeChat WebSocket authentication timed out");return n.code="connect-timeout",n}function ALe(){return{startedAt:null,ready:!1,wecomConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...PG()}}var tB=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=ALe();#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,secret:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,maxReconnectAttempts:c=10,createClient:I=d=>new XFe(d)}){if(!t||!o||!i||!e)throw new TypeError("WecomRuntime requires config, secret, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#c)}async start(){if(this.#c.ready&&this.#g)return this.status;if(this.#d)return this.#d;this.#C?.abort(new DOMException("Enterprise WeChat runtime replaced","AbortError"));let t=new AbortController;return this.#h=t,this.#C=t,this.#d=this.#u(t.signal).finally(()=>{this.#h===t&&(this.#h=null),this.#d=null}),this.#d}async#u(t){await this.#B(),t.throwIfAborted(),this.#c.startedAt=new Date().toISOString(),this.#c.wecomConnectionState="connecting",this.#c.lastError=null,await this.#t.ensureRunning(),this.#c.harnessReachable=!0;let o={debug(){},info(){},warn(){},error(){}},i=this.#p({botId:this.#e.remoteBotId,secret:this.#A,logger:o,maxReconnectAttempts:this.#s});if(!i||typeof i.connect!="function"||typeof i.disconnect!="function")throw new TypeError("Enterprise WeChat client factory returned an invalid client");this.#g=i,this.#I=new Ew({client:i,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o,status:this.#c,logger:this.#i,replyTimeoutMs:this.#a,signal:t});let e,a,A=!1,r=new Promise((f,Q)=>{e=f,a=Q}),s=()=>{if(this.#g!==i||t.aborted)return;A=!0;let f=Date.now();this.#c.ready=!0,this.#c.wecomConnectionState="connected",this.#c.lastCheckedAt=f,this.#c.lastConnectedAt=f,this.#c.lastError=null,e()},g=()=>{this.#g===i&&(this.#c.ready=!1,this.#c.wecomConnectionState="connecting",this.#c.lastCheckedAt=Date.now())},c=()=>{this.#g===i&&(this.#c.ready=!1,this.#c.wecomConnectionState="connecting",this.#c.lastCheckedAt=Date.now())},I=f=>{if(this.#g!==i)return;let Q=f instanceof ZFe||f instanceof $Fe;!A&&Q&&a(f),Q&&(this.#c.ready=!1,this.#c.wecomConnectionState="failed"),this.#c.lastError=Q?f.name:"connection-error",this.#i.warn?.(`[dsh-im:wecom] bot ${this.#e.botId} connection error`)},d=f=>this.#I?.accept(f);i.on("authenticated",s),i.on("disconnected",g),i.on("reconnecting",c),i.on("error",I),i.on("message",d);let B;try{return i.connect(),await Promise.race([r,new Promise((f,Q)=>{t.addEventListener("abort",()=>Q(t.reason),{once:!0})}),new Promise((f,Q)=>{B=setTimeout(()=>Q(eLe()),this.#n)})]),this.status}catch(f){throw t.aborted?(await this.#B(),f):(this.#c.ready=!1,this.#c.wecomConnectionState="failed",this.#c.lastError=f?.message??String(f),await this.#B(),f)}finally{clearTimeout(B)}}async stop(){let t=this.#d;return this.#h?.abort(new DOMException("Enterprise WeChat runtime stopped","AbortError")),this.#C?.abort(new DOMException("Enterprise WeChat runtime stopped","AbortError")),this.#C=null,await this.#B(),await t?.catch(()=>{}),this.status}async sendConnectionTest(t){return nc({state:this.#r,text:t,channelLabel:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"),send:async({chatId:o},i)=>{if(!this.#c.ready||!this.#g)throw new Error("Enterprise WeChat runtime is not connected");await this.#g.sendMessage(o,{msgtype:"markdown",markdown:{content:i}})}})}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.chatId=="string"?t.route.chatId.trim():"";if(t?.kind!=="user"&&t?.kind!=="group"||!e){let a=new TypeError("Invalid Enterprise WeChat proactive delivery target");throw a.code="invalid-target",a}if(!this.#c.ready||!this.#g){let a=new Error("Enterprise WeChat runtime is not connected");throw a.code="bot-not-connected",a}return i?.throwIfAborted(),await this.#g.sendMessage(e,{msgtype:"markdown",markdown:{content:o}}),{sent:!0}}async#B(){let t=this.#g,o=this.#I;this.#g=null,this.#I=null;try{t?.disconnect(),t?.removeAllListeners?.()}catch{this.#i.warn?.(`[dsh-im:wecom] bot ${this.#e.botId} failed to stop cleanly`)}await o?.waitForIdle(),this.#c.ready=!1,this.#c.wecomConnectionState="idle"}};var NZ=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function tLe(n){if(!Array.isArray(n)||n.length===0)return[...NZ];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...NZ]}var Cw=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=tLe(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(iLa(n),B=iLe(t),f=await new e(B.config).load(),Q=Ol(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(z=>z.botId)),await Promise.all(T.map(z=>m.ensure(z.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("wecom",z)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=o.qrAuth??new g({source:t.qrSource??"deepseek-harness",platform:t.qrPlatform}),K=new Map,L=z=>Ol(B.bots,z,"state.json"),F=async z=>{let Ae=K.get(z);return Ae||(Ae=await new a(L(z)).load(),K.set(z,Ae)),Ae},q=ja(n,o.commandExecutor),{controlExecutor:V,sessionMaintenanceExecutor:x,fileIngressExecutor:G}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),J=new A({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...q?{commandExecutor:q}:{},...V?{controlExecutor:V}:{},...x?{sessionMaintenanceExecutor:x}:{},...G?{fileIngressExecutor:G}:{}}),U=new r({qrAuth:R,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:z,config:Ae,secret:ie})=>{let we=await F(z);await m.ensure(z,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("wecom",Ae)});let se=Ka(J,{botId:z,workspaces:m,state:we,agentPresetCatalog:d});return new s({config:Ae,secret:ie,harness:se.harness,state:se.state,contextEnhancement:{botId:z,getSettings:()=>m.contextEnhancementFor(z)},accessPolicy:qa(m,z,{channel:"wecom",config:Ae}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,maxReconnectAttempts:t.maxReconnectAttempts??10,logger:{error:(...Te)=>I.error?.(`[${z}]`,...Te),warn:(...Te)=>I.warn?.(`[${z}]`,...Te),info:(...Te)=>I.info?.(`[${z}]`,...Te),debug:(...Te)=>I.debug?.(`[${z}]`,...Te)}})},deleteState:async({botId:z})=>{let Ae=K.get(z);if(K.delete(z),Ae&&typeof Ae.remove=="function")await Ae.remove();else try{await rLe(L(z))}catch(ie){if(ie?.code!=="ENOENT")throw ie}}}),N=xa(U,{workspaces:m,stateFor:F,agentPresetCatalog:d}),k=c({controller:N,harness:J,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:N,deliveryAdapter:Ya({channel:"wecom",workspaces:m,coreController:U,stateFor:F}),ready:k.ready,async close(){await k.close(),await N.close(),J.stopManagedProcess()}}}import oLe from"qrcode";var kZ="/wecom",Ir=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),vZ=Object.freeze(Object.values(Ir)),nLe=new Set(["secret","secretRef","scode","remoteBotId","verificationUrl","bot_info","botid"]);function HG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Xd(n,t){return HG(n)&&Object.keys(n).every(o=>t.includes(o))}function LG(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function RZ(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function sLe(n,t){return HG(t)?n===Ir.status?Xd(t,[])?null:"connection.status does not accept fields.":n===Ir.beginProvisioning?Xd(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Ir.pollProvisioning,Ir.cancelProvisioning].includes(n)?Xd(t,["attemptId"])&&LG(t.attemptId)?null:`${n} requires an attemptId.`:n===Ir.bindCredentials?Xd(t,["botId","secret"])&&RZ(t.botId,512)&&RZ(t.secret,1024)?null:"bot.bind-credentials requires Bot ID and Secret.":n===Ir.reconnectBot?Xd(t,["botId","sendTest"])&&LG(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Ir.deleteBot?Xd(t,["botId","confirm"])&&LG(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Ir.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Ir.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Ir.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Ir.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown Enterprise WeChat endpoint.":"Payload must be an object."}function $d(n){if(Array.isArray(n))return n.map($d);if(!HG(n))return n;let t={};for(let[o,i]of Object.entries(n))nLe.has(o)||(t[o]=$d(i));return t}async function gLe(n){return oLe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function UG(n,t){return!n||typeof n.verificationUrl!="string"?$d(n):$d({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Gc(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await UG(o.provisioning,t)),$d(o)}function PZ(n,{encodeQr:t=gLe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete Enterprise WeChat controller is required (${e})`);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!vZ.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown Enterprise WeChat endpoint."}};let r=sLe(e,a);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Ir.status)s=await Gc(await n.status(),i);else if(e===Ir.beginProvisioning)s=await UG(await n.startProvisioning(),i);else if(e===Ir.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await UG(g,i)}else if(e===Ir.cancelProvisioning)s=$d(await n.cancelProvisioning(a.attemptId));else if(e===Ir.bindCredentials)s=await Gc(await n.bindCredentials(a),i);else if(e===Ir.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=or()}catch(d){c=or(d)}s=await Gc({...g,...c?{testMessage:c}:{}},i)}else if(e===Ir.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Gc(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===Ir.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Gc(g,i))}else if(e===Ir.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Gc(g,i))}else if(e===Ir.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Gc(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await Gc(await n.deleteBot(a.botId),i);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"wecom-operation-failed",message:"\u4F01\u4E1A\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function uw(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(kZ,PZ(t,o),{authority:fr(i)})}async function GZ(n,t={}){if(t?.controller)return uw(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await FG(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=uw(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close Enterprise WeChat bot connections"),e}import{unlink as p2e}from"node:fs/promises";import{homedir as d2e}from"node:os";import{join as lB,resolve as _l}from"node:path";import{createHash as _Le}from"node:crypto";import{mkdir as TLe,readFile as NLe,rename as RLe,unlink as kLe,writeFile as vLe}from"node:fs/promises";import{dirname as PLe}from"node:path";import{createCipheriv as cLe,createDecipheriv as ILe,createHash as FZ,randomBytes as xG,randomUUID as LZ}from"node:crypto";var Bw="https://ilinkai.weixin.qq.com/",lLe="2.4.6",pLe="3",KZ="https://novac2c.cdn.weixin.qq.com/c2c",bl=1800,YG="novac2c.cdn.weixin.qq.com",dLe="bot",hLe=2<<16|1024|6,ELe=15e3,UZ=35e3,CLe=3,uLe=new Set(["wait","scaned","confirmed","expired","scaned_but_redirect","need_verifycode","verify_code_blocked","binded_redirect"]),NA=class extends Error{constructor(t,o,i={}){super(o,i),this.name="WeixinApiError",this.code=t,this.status=i.status,this.providerCode=i.providerCode}};function Mt(n){return typeof n=="string"&&n.trim()?n.trim():null}function xZ(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function YZ(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function aB(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),i=xZ(n?.providerCode),e=i??"",a=t,A="Weixin could not prepare the file for delivery.";o===401||o===403||i==="401"||i==="403"||/(?:permission|forbidden|unauthor|access.?denied)/i.test(e)?(a="artifact-permission-required",A="Weixin denied permission to send the file."):o===413||i==="413"||/(?:too.?large|size.?limit)/i.test(e)?(a="artifact-too-large",A="The file exceeds Weixin's size limit."):o===429||i==="429"||/(?:rate.?limit|too.?many)/i.test(e)?(a="artifact-rate-limited",A="Weixin rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="Weixin rejected the file message.");let r=new Error(A,{cause:n});return r.code=a,YZ(r,n)}function BLe(n){let t=new Error("Weixin file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",YZ(t,n)}function KG(n){if(!n||typeof n!="object")return null;for(let t of["ret","errcode"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return xZ(n[t])??"rejected";return null}function fLe(n,t){if(t?.aborted)throw eh(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?BLe(n):aB(n)}function QLe(n){let t=Mt(n);return!t||t.length%4!==0||!/^[A-Za-z0-9+/]+={0,2}$/.test(t)?null:Buffer.from(t,"base64")}function jZ(n){let t=Mt(n?.aeskey);if(t){if(!/^[0-9a-fA-F]{32}$/.test(t))throw new NA("invalid-image-key","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002");return Buffer.from(t,"hex")}let o=QLe(n?.media?.aes_key);if(o?.length===16)return o;if(o?.length===32&&/^[0-9a-fA-F]{32}$/.test(o.toString("ascii")))return Buffer.from(o.toString("ascii"),"hex");throw new NA("invalid-image-key","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002")}function JZ(n,t){let o=Buffer.from(n),i=Buffer.from(t);if(i.length!==16||o.length===0||o.length%16!==0)throw new NA("invalid-image-ciphertext","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u6570\u636E\u65E0\u6548\u3002");try{let e=ILe("aes-128-ecb",i,null);return Buffer.concat([e.update(o),e.final()])}catch(e){throw new NA("image-decryption-failed","\u5FAE\u4FE1\u56FE\u7247\u89E3\u5BC6\u5931\u8D25\u3002",{cause:e})}}function qZ(n){let t=Mt(n?.encrypt_query_param);if(t)return`${KZ}/download?encrypted_query_param=${encodeURIComponent(t)}`;let o=Mt(n?.full_url);if(!o)throw new NA("missing-image-url","\u5FAE\u4FE1\u56FE\u7247\u6CA1\u6709\u53EF\u7528\u7684\u4E0B\u8F7D\u5730\u5740\u3002");let i;try{i=new URL(o)}catch{throw new NA("invalid-image-url","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u65E0\u6548\u3002")}if(i.protocol!=="https:"||i.hostname!==YG||i.port&&i.port!=="443"||!i.pathname.startsWith("/c2c/"))throw new NA("untrusted-image-url","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002");return i.username="",i.password="",i.hash="",i.toString()}function jG(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[];for(let i of n?.item_list??[]){let e=i?.image_item;!e||typeof e!="object"||o.push({name:o.length===0?"image":`image-${o.length+1}`,load:async({signal:a,maxBytes:A})=>{let r=jZ(e),s=qZ(e.media),g=await Do(s,{fetchImpl:t,signal:a,maxBytes:A+16,allowedHosts:[YG]});return JZ(g,r)}})}return o}async function yLe(n,{fetchImpl:t,signal:o}){let i=await t(new URL(n),{method:"GET",signal:o,redirect:"manual"});if(!i?.ok)throw await i?.body?.cancel?.().catch?.(()=>{}),new NA("file-download-failed",`\u5FAE\u4FE1\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${i?.status??"unknown"}\uFF09\u3002`,{status:i?.status});return Buffer.from(await i.arrayBuffer())}function JG(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[];for(let i of n?.item_list??[]){let e=i?.file_item;if(!e||typeof e!="object")continue;let a=Number(e.len);o.push({name:Mt(e.file_name)??(o.length===0?"file":`file-${o.length+1}`),...Number.isFinite(a)&&a>=0?{size:a}:{},load:async({signal:A}={})=>{A?.throwIfAborted();let r=jZ(e),s=qZ(e.media),g=await yLe(s,{fetchImpl:t,signal:A});return A?.throwIfAborted(),JZ(g,r)}})}return o}function qG(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="weixin.qq.com"||t.endsWith(".weixin.qq.com")||t==="wechat.com"||t.endsWith(".wechat.com")}function Ah(n){let t;try{t=new URL(n)}catch{throw new NA("invalid-base-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002")}if(t.protocol!=="https:"||!qG(t.hostname)||t.port!==""&&t.port!=="443")throw new NA("untrusted-base-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002");return t.username="",t.password="",t.search="",t.hash="",t.pathname.endsWith("/")||(t.pathname+="/"),t.toString()}function mLe(n){let t=Mt(n);if(!t)throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002");let o;try{o=new URL(t)}catch{throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002")}if(o.protocol!=="https:"||!qG(o.hostname))throw new NA("untrusted-qr","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002");return o.toString()}function zZ(){return{"iLink-App-Id":dLe,"iLink-App-ClientVersion":String(hLe)}}function SLe(n){let t={...zZ(),"content-type":"application/json",AuthorizationType:"ilink_bot_token","X-WECHAT-UIN":Buffer.from(String(xG(4).readUInt32BE(0)),"utf8").toString("base64")};return Mt(n)&&(t.Authorization=`Bearer ${n.trim()}`),t}function Fc(){return{channel_version:lLe,bot_agent:"DeepSeekHarness/1.1.0"}}function wLe(n){return Math.ceil((n+1)/16)*16}function HZ(n){let t;try{t=new URL(n)}catch{throw new NA("invalid-upload-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002")}if(t.protocol!=="https:"||t.hostname!==YG||t.port&&t.port!=="443"||t.pathname!=="/c2c/upload"||t.username||t.password)throw new NA("untrusted-upload-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002");return t.hash="",t}function DLe(n,t){let o=Mt(n?.upload_full_url);if(o)return HZ(o);let i=Mt(n?.upload_param);if(!i)throw new NA("missing-upload-url","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002");let e=new URL(`${KZ}/upload`);return e.searchParams.set("encrypted_query_param",i),e.searchParams.set("filekey",t),HZ(e)}function OLe(n,t){let o=cLe("aes-128-ecb",t,null);return Buffer.concat([o.update(n),o.final()])}async function bLe(n,t,o,{signal:i}={}){let e;for(let a=1;a<=CLe;a+=1){i?.throwIfAborted();try{let A=await n(t,{method:"POST",headers:{"content-type":"application/octet-stream"},body:o,signal:i?AbortSignal.any([i,AbortSignal.timeout(6e4)]):AbortSignal.timeout(6e4),redirect:"error"});if(A.status>=400&&A.status<500)throw new NA("upload-rejected",`\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u88AB\u62D2\u7EDD\uFF08HTTP ${A.status}\uFF09\u3002`,{status:A.status});if(A.status!==200)throw new NA("upload-failed",`\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF08HTTP ${A.status}\uFF09\u3002`,{status:A.status});let r=Mt(A.headers.get("x-encrypted-param"));if(await A.body?.cancel?.().catch(()=>{}),!r)throw new NA("invalid-upload-response","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u7F3A\u5C11\u4E0B\u8F7D\u53C2\u6570\u3002");return r}catch(A){if(i?.aborted)throw eh(i);if(A instanceof NA&&(A.code==="upload-rejected"||A.status<500))throw A;e=A}}throw e instanceof NA?e:new NA("upload-failed","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002",{cause:e})}function eh(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}async function Ds(n,{method:t,baseUrl:o,endpoint:i,body:e,token:a,timeoutMs:A=ELe,signal:r,authenticated:s=!0}){let g=Ah(o),c=new URL(i,g);if(!qG(c.hostname))throw new NA("untrusted-endpoint","\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002");let I=new AbortController,d=!1,B=()=>I.abort(r?.reason);if(r?.aborted)throw eh(r);r?.addEventListener("abort",B,{once:!0});let f=A>0?setTimeout(()=>{d=!0,I.abort()},A):null;try{let Q=await n(c,{method:t,headers:s?SLe(a):zZ(),...e===void 0?{}:{body:JSON.stringify(e)},signal:I.signal});if(!Q.ok)throw new NA("http-error",`\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${Q.status}\uFF09\u3002`,{status:Q.status});try{return await Q.json()}catch(y){throw new NA("invalid-response","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:y})}}catch(Q){throw r?.aborted?eh(r):d?new NA("timeout","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:Q}):Q instanceof NA?Q:new NA("network-error","\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002",{cause:Q})}finally{f&&clearTimeout(f),r?.removeEventListener("abort",B)}}function MLe(n){if(!n||typeof n!="object"||!uLe.has(n.status))throw new NA("invalid-login-status","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002");return n}function VZ({fetchImpl:n=fetch}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");async function t({baseUrl:o,token:i,toUserId:e,file:a,contextToken:A,runId:r,signal:s},{mediaType:g,createItem:c}){let I=Mt(e);if(!I||!a||typeof a!="object"||typeof a.fileName!="string"||!a.fileName||!Buffer.isBuffer(a.bytes))throw new TypeError("toUserId and a file are required");s?.throwIfAborted();let d=xG(16).toString("hex"),B=xG(16),f=FZ("md5").update(a.bytes).digest("hex"),Q;try{Q=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getuploadurl",token:i,signal:s,body:{filekey:d,media_type:g,to_user_id:I,rawsize:a.bytes.byteLength,rawfilemd5:f,filesize:wLe(a.bytes.byteLength),no_need_thumb:!0,aeskey:B.toString("hex"),base_info:Fc()}})}catch(x){if(s?.aborted)throw eh(s);let G=Number(x?.status),J=x?.code==="http-error"&&G>=400&&G<500?"artifact-provider-rejected":"artifact-provider-failed";throw aB(x,{fallback:J})}let y=KG(Q);if(y)throw aB(new NA("upload-url-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{providerCode:y}));let m=DLe(Q,d),T=OLe(a.bytes,B),_;try{_=await bLe(n,m,T,{signal:s})}catch(x){if(s?.aborted)throw eh(s);let G=Number(x?.status),J=x?.code==="upload-rejected"||G>=400&&G<500?"artifact-provider-rejected":"artifact-provider-failed";throw aB(x,{fallback:J})}s?.throwIfAborted();let R=Mt(a.deliveryKey)??Mt(a.artifactId)??LZ(),K=g===3?R:`${R}\0${g}`,L=`dsh-weixin-${FZ("sha256").update(K).digest("hex").slice(0,32)}`,F={encrypt_query_param:_,aes_key:Buffer.from(B.toString("hex")).toString("base64"),encrypt_type:1},q;try{q=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendmessage",token:i,signal:s,body:{msg:{from_user_id:"",to_user_id:I,client_id:L,message_type:2,message_state:2,item_list:[c({file:a,media:F,ciphertextSize:T.byteLength})],...Mt(A)?{context_token:A.trim()}:{},...Mt(r)?{run_id:r.trim()}:{}},base_info:Fc()}})}catch(x){throw fLe(x,s)}let V=KG(q);if(V)throw aB(new NA("send-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:V}));return{messageId:L}}return Object.freeze({inboundImages(o){return jG(o,{fetchImpl:n})},inboundFiles(o){return JG(o,{fetchImpl:n})},async beginLogin({localTokens:o=[],botType:i=pLe,signal:e}={}){let a=[...new Set(o.map(Mt).filter(Boolean))].slice(-10),A=await Ds(n,{method:"POST",baseUrl:Bw,endpoint:`ilink/bot/get_bot_qrcode?bot_type=${encodeURIComponent(i)}`,body:{local_token_list:a},timeoutMs:1e4,signal:e}),r=Mt(A?.qrcode);if(!r)throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002");return{qrcode:r,qrcodeUrl:mLe(A.qrcode_img_content)}},async pollLogin({qrcode:o,baseUrl:i=Bw,verifyCode:e,signal:a}){let A=Mt(o);if(!A)throw new TypeError("qrcode is required");let r=`ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(A)}`;Mt(e)&&(r+=`&verify_code=${encodeURIComponent(e.trim())}`);let s=await Ds(n,{method:"GET",baseUrl:i,endpoint:r,timeoutMs:UZ,signal:a,authenticated:!1});return MLe(s)},async getUpdates({baseUrl:o,token:i,getUpdatesBuf:e="",timeoutMs:a,signal:A}){try{return await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getupdates",body:{get_updates_buf:e,base_info:Fc()},token:i,timeoutMs:a??UZ,signal:A})}catch(r){if(r instanceof NA&&r.code==="timeout")return{ret:0,msgs:[],get_updates_buf:e};throw r}},async getConfig({baseUrl:o,token:i,toUserId:e,contextToken:a,signal:A}){let r=Mt(e);if(!r)throw new TypeError("toUserId is required");let s=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getconfig",token:i,signal:A,timeoutMs:1e4,body:{ilink_user_id:r,...Mt(a)?{context_token:a.trim()}:{},base_info:Fc()}});if(s?.ret!==void 0&&s.ret!==0)throw new NA("config-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u914D\u7F6E\u8BF7\u6C42\u3002");return{typingTicket:Mt(s?.typing_ticket)}},async sendTyping({baseUrl:o,token:i,toUserId:e,typingTicket:a,status:A,signal:r}){let s=Mt(e),g=Mt(a);if(!s||!g)throw new TypeError("toUserId and typingTicket are required");if(A!==1&&A!==2)throw new TypeError("typing status must be 1 or 2");let c=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendtyping",token:i,signal:r,timeoutMs:1e4,body:{ilink_user_id:s,typing_ticket:g,status:A,base_info:Fc()}});if(c?.ret!==void 0&&c.ret!==0)throw new NA("typing-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u8F93\u5165\u72B6\u6001\u8BF7\u6C42\u3002");return!0},async sendText({baseUrl:o,token:i,toUserId:e,text:a,contextToken:A,runId:r,signal:s}){let g=Mt(e),c=Mt(a);if(!g||!c)throw new TypeError("toUserId and text are required");let I=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendmessage",token:i,signal:s,body:{msg:{from_user_id:"",to_user_id:g,client_id:`dsh-weixin-${LZ()}`,message_type:2,message_state:2,item_list:[{type:1,text_item:{text:c}}],...Mt(A)?{context_token:A.trim()}:{},...Mt(r)?{run_id:r.trim()}:{}},base_info:Fc()}}),d=KG(I);if(d)throw new NA("send-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002",{providerCode:d});return!0},async sendFile(o){return t(o,{mediaType:3,createItem:({file:i,media:e})=>({type:4,file_item:{media:e,file_name:i.fileName,len:String(i.bytes.byteLength)}})})},async sendImage(o){return t(o,{mediaType:1,createItem:({media:i,ciphertextSize:e})=>({type:2,image_item:{media:i,mid_size:e}})})},async notifyStart({baseUrl:o,token:i,signal:e}){let a=await Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/msg/notifystart",token:i,signal:e,timeoutMs:1e4,body:{base_info:Fc()}});if(a?.ret!==void 0&&a.ret!==0)throw new NA("start-rejected","\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002");return a},async notifyStop({baseUrl:o,token:i,signal:e}){return Ds(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/msg/notifystop",token:i,signal:e,timeoutMs:1e4,body:{base_info:Fc()}})}})}function Ml(n){for(let t of n?.item_list??[]){if(t?.type===1&&typeof t.text_item?.text=="string"){let o=t.text_item.text.trim();if(o)return o}if(t?.type===3&&typeof t.voice_item?.text=="string"){let o=t.voice_item.text.trim();if(o)return o}}return null}function zG(n){return n?.message_id!==void 0&&n.message_id!==null?String(n.message_id):Mt(n?.client_id)}function WZ(n,t=bl){if(n.length<=t)return[n];let o=[],i=n;for(;i.length>t;){let e=i.lastIndexOf(` +`,t);ea===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.accountId)||e.has(a.tokenRef))return null;o.add(a.botId),i.add(a.accountId),e.add(a.tokenRef)}return Object.freeze({version:1,accounts:Object.freeze(t)})}var fw=class{#e;#A=VG;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=FLe(JSON.parse(await NLe(this.#e,"utf8")));if(!t)throw new Error("dsh-weixin config contains invalid account data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=VG}return this}list(){return structuredClone(this.#A.accounts)}get(t){let o=this.#A.accounts.find(i=>i.botId===t);return o?structuredClone(o):null}getByAccountId(t){let o=this.#A.accounts.find(i=>i.accountId===t);return o?structuredClone(o):null}async save(t){let o=XZ(t);if(!o)throw new Error("Refusing to persist incomplete dsh-weixin account data");return this.#r(i=>{let e=i.find(r=>r.accountId===o.accountId&&r.botId!==o.botId),a=i.find(r=>r.tokenRef===o.tokenRef&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate Weixin account identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!ZZ(t))throw new TypeError("Invalid Weixin bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await kLe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=VG});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.accounts];o=t(e);let a=Object.freeze({version:1,accounts:Object.freeze(e)});await this.#l(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#l(t){await TLe(PLe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await vLe(o,`${JSON.stringify(t,null,2)} `,{encoding:"utf8",mode:384}),await RLe(o,this.#e)}};var Qw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"weixin",logPrefix:"dsh-weixin"})}};import{mkdir as LLe,readFile as ULe,rename as HLe,unlink as KLe,writeFile as xLe}from"node:fs/promises";import{dirname as YLe}from"node:path";var yw=Object.freeze({version:1,sessions:{},seenMessageIds:[],getUpdatesBuf:""});function jLe(n){if(!n||typeof n!="object")return structuredClone(yw);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&typeof i=="string"&&i&&(t[o]=i);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[],getUpdatesBuf:typeof n.getUpdatesBuf=="string"?n.getUpdatesBuf:""}}var mw=class{#e;#A=structuredClone(yw);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=jLe(JSON.parse(await ULe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(yw),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}getUpdatesBuf(){return this.#A.getUpdatesBuf}async setGetUpdatesBuf(t){typeof t!="string"||t===this.#A.getUpdatesBuf||(this.#A.getUpdatesBuf=t,await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await KLe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(yw)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} -`,o=this.#t.then(async()=>{await LLe(YLe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await xLe(i,t,{encoding:"utf8",mode:384}),await HLe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{randomUUID as JLe}from"node:crypto";var $Z=new Set(["starting","pending","scanned","needs_verification","connecting"]),Sw=new Set(["connected","expired","failed","cancelled"]),e9=5*6e4,r9=Object.freeze({"credential-read-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002","credential-save-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002","account-config-save-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002","runtime-prepare-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002","harness-connect-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002","harness-timeout":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002","harness-auth-required":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u9700\u8981\u8EAB\u4EFD\u8BA4\u8BC1\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u3001\u7F51\u5173\u6216\u81EA\u5B9A\u4E49\u9274\u6743\u914D\u7F6E\u3002","harness-proxy-auth-required":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u672C\u673A Harness \u8BF7\u6C42\u88AB\u4EE3\u7406\u8981\u6C42\u8BA4\u8BC1\u3002\u8BF7\u8BA9\u56DE\u73AF\u5730\u5740\u7ED5\u8FC7\u4EE3\u7406\uFF0C\u5E76\u68C0\u67E5 NO_PROXY \u914D\u7F6E\u3002","harness-loopback-forbidden":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5F02\u5E38\u62D2\u7EDD\u4E86\u56DE\u73AF\u5730\u5740\u7684\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 HTTP \u4EE3\u7406\u3001Harness \u6E90\u7801\u7248\u672C\u548C\u6784\u5EFA\u4EA7\u7269\u3002","harness-host-untrusted":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u7684 Host \u4FE1\u4EFB\u68C0\u67E5\u62D2\u7EDD\u4E86\u975E\u56DE\u73AF\u5730\u5740\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5 harnessBaseUrl \u4E0E trustedHosts \u914D\u7F6E\u3002","harness-request-forbidden":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u5065\u5EB7\u68C0\u67E5\u6536\u5230\u4E86\u975E Harness \u6807\u51C6\u7684 403 \u62D2\u7EDD\u54CD\u5E94\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u6216\u7F51\u5173\u914D\u7F6E\u3002","harness-api-not-found":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002","harness-http-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","harness-response-invalid":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002","harness-rpc-rejected":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","harness-check-unknown-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","connection-start-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002"});function Ah(n){return typeof n=="string"&&n.trim()?n.trim():null}function qLe(){return new DOMException("Provisioning was cancelled","AbortError")}function A9(n,t){let o=Ah(n);return o?eh(o.includes("://")?o:`https://${o}`):eh(t)}function iB(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},pollIntervalMs:1e3,...n.state==="needs_verification"?{verificationRequired:!0}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function pi(n,t){return Object.freeze({code:n,message:t})}function oB(n,t){let o=new Error(`Weixin activation failed during ${n}`,{cause:t});return o.name="WeixinActivationStageError",o.code=n,o}function zLe(n){if(n instanceof NA)return pi(n.code,n.message);let t=r9[n?.code];return t?pi(n.code,w(t)):pi("activation-unknown-failed",w("\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002"))}function t9(n,t){return n instanceof NA||r9[n?.code]?n:oB(t,n)}var nB=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=null;#p=new Map;#c=0;#g=!1;constructor({api:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.beginLogin!="function"||typeof t.pollLogin!="function")throw new TypeError("WeixinController requires a Weixin API client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("WeixinController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("WeixinController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#g)return this.status();for(let t of this.#t.list())this.#i.get(t.botId)?.status?.ready!==!0&&await this.#Q(t.botId,async()=>{let i=this.#t.get(t.botId);if(!(!i||this.#g))try{let e=await this.#u(i.tokenRef);if(!e){this.#a.set(i.botId,pi("missing-token",w("\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}await this.#h(i,e),this.#a.delete(i.botId)}catch(e){this.#a.set(i.botId,pi("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-weixin] account ${i.botId} failed to initialize:`,e)}finally{this.#y()}});return this.status()}async startProvisioning(){if(this.#g)throw new Error("dsh-weixin controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t={id:JLe(),state:"starting",createdAt:Date.now(),expiresAt:Date.now()+e9,controller:new AbortController,pendingVerifyCode:null,verifyResolve:null,currentBaseUrl:Bw,error:null,botId:null,task:null};this.#n.set(t.id,t),this.#s=t.id,this.#y();try{let o=(await Promise.all(this.#t.list().slice(-10).map(async e=>this.#u(e.tokenRef)))).filter(Boolean),i=await this.#e.beginLogin({localTokens:o,signal:t.controller.signal});return this.#f(t),t.qrcode=i.qrcode,t.verificationUrl=i.qrcodeUrl,t.state="pending",t.expiresAt=Date.now()+e9,this.#y(),t.task=this.#I(t),iB(t)}catch(o){throw t.controller.signal.aborted?(t.state="cancelled",t.error=pi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=pi(o instanceof NA?o.code:"qr-start-failed",o instanceof NA?o.message:w("\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#s===t.id&&(this.#s=null),this.#y(),o}}registrationStatus(t){return iB(this.#n.get(t))}async submitVerification(t,o){let i=this.#n.get(t);if(!i||i.state!=="needs_verification")throw new Error("The provisioning attempt is not waiting for a verification code");let e=Ah(o);if(!e||!/^\d{4,8}$/.test(e))throw new TypeError("Verification code must contain 4 to 8 digits");return i.pendingVerifyCode=e,i.state="scanned",i.verifyResolve?.(),i.verifyResolve=null,this.#y(),iB(i)}async cancelProvisioning(t){let o=this.#n.get(t);return o?(Sw.has(o.state)||(o.controller.abort(),o.verifyResolve?.(),o.verifyResolve=null,await o.task?.catch(()=>{}),Sw.has(o.state)||(o.state="cancelled"),o.error??=pi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))),this.#s===o.id&&(this.#s=null),this.#y(),iB(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Weixin account");return await this.#Q(t,async()=>{let i=await this.#u(o.tokenRef);if(!i)throw new Error("The Weixin token is missing");try{await this.#h(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,pi("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#y()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Weixin account");return this.#Q(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Cr(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));return i.sendConnectionTest(Ra(w("\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{name}\uFF09",{name:ZG(o.accountId)})))})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown Weixin account");return this.#Q(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Weixin account");return await this.#Q(t,async()=>{let i=await this.#A.resolve(o.tokenRef).catch(()=>{});await this.#C(t);try{await this.#A.unset(o.tokenRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.tokenRef,i.value).catch(()=>{}),await this.#h(o,i.value).catch(()=>{})),new Error("Unable to remove the Weixin account safely.",{cause:e})}try{await this.#l({botId:t,config:o})}catch(e){this.#o.warn?.(`[dsh-weixin] account ${t} state cleanup failed:`,e)}this.#a.delete(t),this.#y()}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#i.get(e.botId)?.status??null,A=a?.ready===!0&&a.weixinConnectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.weixinConnectionState==="connecting"?"connecting":this.#a.has(e.botId)||a?.weixinConnectionState==="failed"?"error":"offline",s=this.#a.get(e.botId)??(r==="error"?pi("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002")):null);return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("\u5FAE\u4FE1\u673A\u5668\u4EBA"),accountIdMasked:ZG(e.accountId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,i=this.#s?this.#n.get(this.#s):null;return{schemaVersion:1,revision:this.#c,state:i&&$Z.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&$Z.has(i.state)?{provisioning:iB(i)}:{}}}async close(){this.#g||(this.#g=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#i.keys()].map(t=>this.#C(t))))}async#I(t){try{for(;!t.controller.signal.aborted&&Date.now(){t.verifyResolve=i,t.controller.signal.aborted&&i()}),t.verifyResolve=null,this.#f(t));let o=await this.#e.pollLogin({qrcode:t.qrcode,baseUrl:t.currentBaseUrl,verifyCode:t.pendingVerifyCode,signal:t.controller.signal});if(this.#f(t),o.status==="wait")t.state="pending";else if(o.status==="scaned")t.pendingVerifyCode=null,t.state="scanned";else if(o.status==="need_verifycode")t.pendingVerifyCode=null,t.state="needs_verification";else if(o.status==="verify_code_blocked"){t.state="failed",t.error=pi("verification-blocked",w("\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"));break}else if(o.status==="expired"){t.state="expired",t.error=pi("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"));break}else if(o.status==="scaned_but_redirect")t.currentBaseUrl=A9(o.redirect_host,t.currentBaseUrl),t.state="scanned";else if(o.status==="binded_redirect"){let i=this.#t.list().find(e=>this.#i.get(e.botId)?.status?.ready===!0)??this.#t.list()[0];i?(t.state="connected",t.botId=i.botId,t.alreadyConnected=!0):(t.state="failed",t.error=pi("already-bound",w("\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002")));break}else if(o.status==="confirmed"){let i=Ah(o.bot_token),e=Ah(o.ilink_bot_id),a=Ah(o.ilink_user_id);if(!i||!e||!a)throw new NA("incomplete-login",w("\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002"));t.state="connecting",this.#y();let A=A9(o.baseurl,t.currentBaseUrl);t.botId=await this.#d(t,{token:i,accountId:e,ownerUserId:a,baseUrl:A}),t.state="connected",t.error=null;break}this.#y()}!t.controller.signal.aborted&&Date.now()>=t.expiresAt&&!Sw.has(t.state)&&(t.state="expired",t.error=pi("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=pi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=zLe(o),this.#o.error?.("[dsh-weixin] provisioning failed:",o))}finally{t.pendingVerifyCode=null,t.verifyResolve?.(),t.verifyResolve=null,this.#s===t.id&&(this.#s=null),this.#y(),this.#S()}}async#d(t,{token:o,accountId:i,ownerUserId:e,baseUrl:a}){let A=WG(i),r=this.#t.getByAccountId(i),s={botId:A.botId,accountId:i,tokenRef:A.tokenRef,ownerUserId:e,baseUrl:a,createdAt:r?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()},g;try{g=await this.#A.resolve(A.tokenRef)}catch(c){throw oB("credential-read-failed",c)}return this.#Q(A.botId,async()=>{try{try{await this.#A.set(A.tokenRef,o)}catch(c){throw oB("credential-save-failed",c)}this.#f(t);try{await this.#t.save(s)}catch(c){throw oB("account-config-save-failed",c)}return this.#f(t),await this.#h(s,o),this.#f(t),this.#a.delete(A.botId),this.#y(),A.botId}catch(c){throw await this.#C(A.botId),r?await this.#t.save(r).catch(()=>{}):this.#t.get(A.botId)&&await this.#t.remove(A.botId).catch(()=>null)&&await this.#l({botId:A.botId,config:s}).catch(d=>{this.#o.warn?.("[dsh-weixin] failed to clean up cancelled bot state:",d)}),await this.#B(A.tokenRef,g),r&&g?.value&&await this.#h(r,g.value).catch(()=>{}),c}})}async#h(t,o){await this.#C(t.botId);let i;try{i=await this.#r({botId:t.botId,config:t,token:o})}catch(e){throw t9(e,"runtime-prepare-failed")}if(!i||typeof i.start!="function"||typeof i.stop!="function")throw oB("runtime-prepare-failed",new TypeError("createRuntime returned an invalid Weixin runtime"));try{await i.start(),this.#i.set(t.botId,i)}catch(e){throw await i.stop().catch(()=>{}),t9(e,"connection-start-failed")}}async#C(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-weixin] account ${t} failed to stop cleanly:`,i)})}async#u(t){let o=await this.#A.resolve(t).catch(()=>{});return Ah(o?.value)}async#B(t,o){try{o?.value?await this.#A.set(t,o.value):await this.#A.unset(t)}catch(i){this.#o.error?.(`[dsh-weixin] failed to restore credential ${t}:`,i)}}#f(t){if(t.controller.signal.aborted||this.#s!==t.id)throw qLe()}#Q(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#S(){for(let[t,o]of this.#n)t!==this.#s&&Sw.has(o.state)&&this.#n.size>16&&this.#n.delete(t)}#y(){this.#c+=1}};var ww=()=>w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),VLe=5e3,XG=6e4,o9=Symbol("weixin-send-diagnostic"),WLe=()=>[w("\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` +`,o=this.#t.then(async()=>{await LLe(YLe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await xLe(i,t,{encoding:"utf8",mode:384}),await HLe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{randomUUID as JLe}from"node:crypto";var $Z=new Set(["starting","pending","scanned","needs_verification","connecting"]),Sw=new Set(["connected","expired","failed","cancelled"]),e9=5*6e4,r9=Object.freeze({"credential-read-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002","credential-save-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002","account-config-save-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002","runtime-prepare-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002","harness-connect-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002","harness-timeout":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002","harness-auth-required":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u9700\u8981\u8EAB\u4EFD\u8BA4\u8BC1\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u3001\u7F51\u5173\u6216\u81EA\u5B9A\u4E49\u9274\u6743\u914D\u7F6E\u3002","harness-proxy-auth-required":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u672C\u673A Harness \u8BF7\u6C42\u88AB\u4EE3\u7406\u8981\u6C42\u8BA4\u8BC1\u3002\u8BF7\u8BA9\u56DE\u73AF\u5730\u5740\u7ED5\u8FC7\u4EE3\u7406\uFF0C\u5E76\u68C0\u67E5 NO_PROXY \u914D\u7F6E\u3002","harness-loopback-forbidden":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5F02\u5E38\u62D2\u7EDD\u4E86\u56DE\u73AF\u5730\u5740\u7684\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 HTTP \u4EE3\u7406\u3001Harness \u6E90\u7801\u7248\u672C\u548C\u6784\u5EFA\u4EA7\u7269\u3002","harness-host-untrusted":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u7684 Host \u4FE1\u4EFB\u68C0\u67E5\u62D2\u7EDD\u4E86\u975E\u56DE\u73AF\u5730\u5740\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5 harnessBaseUrl \u4E0E trustedHosts \u914D\u7F6E\u3002","harness-request-forbidden":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u5065\u5EB7\u68C0\u67E5\u6536\u5230\u4E86\u975E Harness \u6807\u51C6\u7684 403 \u62D2\u7EDD\u54CD\u5E94\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u6216\u7F51\u5173\u914D\u7F6E\u3002","harness-api-not-found":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002","harness-http-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","harness-response-invalid":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002","harness-rpc-rejected":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","harness-check-unknown-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","connection-start-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002"});function th(n){return typeof n=="string"&&n.trim()?n.trim():null}function qLe(){return new DOMException("Provisioning was cancelled","AbortError")}function A9(n,t){let o=th(n);return o?Ah(o.includes("://")?o:`https://${o}`):Ah(t)}function iB(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},pollIntervalMs:1e3,...n.state==="needs_verification"?{verificationRequired:!0}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function pi(n,t){return Object.freeze({code:n,message:t})}function oB(n,t){let o=new Error(`Weixin activation failed during ${n}`,{cause:t});return o.name="WeixinActivationStageError",o.code=n,o}function zLe(n){if(n instanceof NA)return pi(n.code,n.message);let t=r9[n?.code];return t?pi(n.code,w(t)):pi("activation-unknown-failed",w("\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002"))}function t9(n,t){return n instanceof NA||r9[n?.code]?n:oB(t,n)}var nB=class{#e;#A;#t;#r;#l;#o;#i=new Map;#a=new Map;#n=new Map;#s=null;#p=new Map;#c=0;#g=!1;constructor({api:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!t||typeof t.beginLogin!="function"||typeof t.pollLogin!="function")throw new TypeError("WeixinController requires a Weixin API client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("WeixinController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("WeixinController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A}async initialize(){if(this.#g)return this.status();for(let t of this.#t.list())this.#i.get(t.botId)?.status?.ready!==!0&&await this.#Q(t.botId,async()=>{let i=this.#t.get(t.botId);if(!(!i||this.#g))try{let e=await this.#u(i.tokenRef);if(!e){this.#a.set(i.botId,pi("missing-token",w("\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}await this.#h(i,e),this.#a.delete(i.botId)}catch(e){this.#a.set(i.botId,pi("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-weixin] account ${i.botId} failed to initialize:`,e)}finally{this.#y()}});return this.status()}async startProvisioning(){if(this.#g)throw new Error("dsh-weixin controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t={id:JLe(),state:"starting",createdAt:Date.now(),expiresAt:Date.now()+e9,controller:new AbortController,pendingVerifyCode:null,verifyResolve:null,currentBaseUrl:Bw,error:null,botId:null,task:null};this.#n.set(t.id,t),this.#s=t.id,this.#y();try{let o=(await Promise.all(this.#t.list().slice(-10).map(async e=>this.#u(e.tokenRef)))).filter(Boolean),i=await this.#e.beginLogin({localTokens:o,signal:t.controller.signal});return this.#f(t),t.qrcode=i.qrcode,t.verificationUrl=i.qrcodeUrl,t.state="pending",t.expiresAt=Date.now()+e9,this.#y(),t.task=this.#I(t),iB(t)}catch(o){throw t.controller.signal.aborted?(t.state="cancelled",t.error=pi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=pi(o instanceof NA?o.code:"qr-start-failed",o instanceof NA?o.message:w("\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#s===t.id&&(this.#s=null),this.#y(),o}}registrationStatus(t){return iB(this.#n.get(t))}async submitVerification(t,o){let i=this.#n.get(t);if(!i||i.state!=="needs_verification")throw new Error("The provisioning attempt is not waiting for a verification code");let e=th(o);if(!e||!/^\d{4,8}$/.test(e))throw new TypeError("Verification code must contain 4 to 8 digits");return i.pendingVerifyCode=e,i.state="scanned",i.verifyResolve?.(),i.verifyResolve=null,this.#y(),iB(i)}async cancelProvisioning(t){let o=this.#n.get(t);return o?(Sw.has(o.state)||(o.controller.abort(),o.verifyResolve?.(),o.verifyResolve=null,await o.task?.catch(()=>{}),Sw.has(o.state)||(o.state="cancelled"),o.error??=pi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))),this.#s===o.id&&(this.#s=null),this.#y(),iB(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Weixin account");return await this.#Q(t,async()=>{let i=await this.#u(o.tokenRef);if(!i)throw new Error("The Weixin token is missing");try{await this.#h(o,i),this.#a.delete(t)}catch(e){throw this.#a.set(t,pi("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#y()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Weixin account");return this.#Q(t,async()=>{let i=this.#i.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Cr(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));return i.sendConnectionTest(Ra(w("\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{name}\uFF09",{name:ZG(o.accountId)})))})}async sendProactiveText(t,o,i,e={}){if(!this.#t.get(t))throw new Error("Unknown Weixin account");return this.#Q(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Weixin account");return await this.#Q(t,async()=>{let i=await this.#A.resolve(o.tokenRef).catch(()=>{});await this.#C(t);try{await this.#A.unset(o.tokenRef),await this.#t.remove(t)}catch(e){throw i?.value&&(await this.#A.set(o.tokenRef,i.value).catch(()=>{}),await this.#h(o,i.value).catch(()=>{})),new Error("Unable to remove the Weixin account safely.",{cause:e})}try{await this.#l({botId:t,config:o})}catch(e){this.#o.warn?.(`[dsh-weixin] account ${t} state cleanup failed:`,e)}this.#a.delete(t),this.#y()}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#i.get(e.botId)?.status??null,A=a?.ready===!0&&a.weixinConnectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.weixinConnectionState==="connecting"?"connecting":this.#a.has(e.botId)||a?.weixinConnectionState==="failed"?"error":"offline",s=this.#a.get(e.botId)??(r==="error"?pi("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002")):null);return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("\u5FAE\u4FE1\u673A\u5668\u4EBA"),accountIdMasked:ZG(e.accountId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,i=this.#s?this.#n.get(this.#s):null;return{schemaVersion:1,revision:this.#c,state:i&&$Z.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&$Z.has(i.state)?{provisioning:iB(i)}:{}}}async close(){this.#g||(this.#g=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#i.keys()].map(t=>this.#C(t))))}async#I(t){try{for(;!t.controller.signal.aborted&&Date.now(){t.verifyResolve=i,t.controller.signal.aborted&&i()}),t.verifyResolve=null,this.#f(t));let o=await this.#e.pollLogin({qrcode:t.qrcode,baseUrl:t.currentBaseUrl,verifyCode:t.pendingVerifyCode,signal:t.controller.signal});if(this.#f(t),o.status==="wait")t.state="pending";else if(o.status==="scaned")t.pendingVerifyCode=null,t.state="scanned";else if(o.status==="need_verifycode")t.pendingVerifyCode=null,t.state="needs_verification";else if(o.status==="verify_code_blocked"){t.state="failed",t.error=pi("verification-blocked",w("\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"));break}else if(o.status==="expired"){t.state="expired",t.error=pi("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"));break}else if(o.status==="scaned_but_redirect")t.currentBaseUrl=A9(o.redirect_host,t.currentBaseUrl),t.state="scanned";else if(o.status==="binded_redirect"){let i=this.#t.list().find(e=>this.#i.get(e.botId)?.status?.ready===!0)??this.#t.list()[0];i?(t.state="connected",t.botId=i.botId,t.alreadyConnected=!0):(t.state="failed",t.error=pi("already-bound",w("\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002")));break}else if(o.status==="confirmed"){let i=th(o.bot_token),e=th(o.ilink_bot_id),a=th(o.ilink_user_id);if(!i||!e||!a)throw new NA("incomplete-login",w("\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002"));t.state="connecting",this.#y();let A=A9(o.baseurl,t.currentBaseUrl);t.botId=await this.#d(t,{token:i,accountId:e,ownerUserId:a,baseUrl:A}),t.state="connected",t.error=null;break}this.#y()}!t.controller.signal.aborted&&Date.now()>=t.expiresAt&&!Sw.has(t.state)&&(t.state="expired",t.error=pi("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=pi("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=zLe(o),this.#o.error?.("[dsh-weixin] provisioning failed:",o))}finally{t.pendingVerifyCode=null,t.verifyResolve?.(),t.verifyResolve=null,this.#s===t.id&&(this.#s=null),this.#y(),this.#S()}}async#d(t,{token:o,accountId:i,ownerUserId:e,baseUrl:a}){let A=WG(i),r=this.#t.getByAccountId(i),s={botId:A.botId,accountId:i,tokenRef:A.tokenRef,ownerUserId:e,baseUrl:a,createdAt:r?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()},g;try{g=await this.#A.resolve(A.tokenRef)}catch(c){throw oB("credential-read-failed",c)}return this.#Q(A.botId,async()=>{try{try{await this.#A.set(A.tokenRef,o)}catch(c){throw oB("credential-save-failed",c)}this.#f(t);try{await this.#t.save(s)}catch(c){throw oB("account-config-save-failed",c)}return this.#f(t),await this.#h(s,o),this.#f(t),this.#a.delete(A.botId),this.#y(),A.botId}catch(c){throw await this.#C(A.botId),r?await this.#t.save(r).catch(()=>{}):this.#t.get(A.botId)&&await this.#t.remove(A.botId).catch(()=>null)&&await this.#l({botId:A.botId,config:s}).catch(d=>{this.#o.warn?.("[dsh-weixin] failed to clean up cancelled bot state:",d)}),await this.#B(A.tokenRef,g),r&&g?.value&&await this.#h(r,g.value).catch(()=>{}),c}})}async#h(t,o){await this.#C(t.botId);let i;try{i=await this.#r({botId:t.botId,config:t,token:o})}catch(e){throw t9(e,"runtime-prepare-failed")}if(!i||typeof i.start!="function"||typeof i.stop!="function")throw oB("runtime-prepare-failed",new TypeError("createRuntime returned an invalid Weixin runtime"));try{await i.start(),this.#i.set(t.botId,i)}catch(e){throw await i.stop().catch(()=>{}),t9(e,"connection-start-failed")}}async#C(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(i=>{this.#o.warn?.(`[dsh-weixin] account ${t} failed to stop cleanly:`,i)})}async#u(t){let o=await this.#A.resolve(t).catch(()=>{});return th(o?.value)}async#B(t,o){try{o?.value?await this.#A.set(t,o.value):await this.#A.unset(t)}catch(i){this.#o.error?.(`[dsh-weixin] failed to restore credential ${t}:`,i)}}#f(t){if(t.controller.signal.aborted||this.#s!==t.id)throw qLe()}#Q(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#S(){for(let[t,o]of this.#n)t!==this.#s&&Sw.has(o.state)&&this.#n.size>16&&this.#n.delete(t)}#y(){this.#c+=1}};var ww=()=>w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),VLe=5e3,XG=6e4,o9=Symbol("weixin-send-diagnostic"),WLe=()=>[w("\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` `);function ZLe(n){return`p2p:${n}`}function Or(n){return typeof n=="string"&&n.trim()?n.trim():null}function cB(n){let t=n==null?"":String(n).trim();return/^-?[A-Za-z0-9_.:-]{1,160}$/u.test(t)?t:"-"}function XLe(n){try{return cB(new URL(n).hostname.toLowerCase())}catch{return"-"}}function $Le({baseUrl:n,text:t,chunk:o,chunkIndex:i,chunkCount:e,maxMessageChars:a,contextToken:A,runId:r,error:s}){let g=Number(s?.status??s?.httpStatus),c=Number.isInteger(g)?String(g):s?.code==="send-rejected"?"2xx":"-";return["endpoint=sendmessage",`host=${XLe(n)}`,`chunk=${i+1}/${e}`,`chunkChars=${o.length}`,`chunkUtf8Bytes=${Buffer.byteLength(o,"utf8")}`,`totalChars=${t.length}`,`totalUtf8Bytes=${Buffer.byteLength(t,"utf8")}`,`limitChars=${a}`,`contextToken=${A?"yes":"no"}`,`runId=${r?"yes":"no"}`,`http=${c}`,`provider=${cB(s?.providerCode)}`,`cause=${cB(s?.code??s?.name)}`].join(" ")}function e2e(n,t){let o=$Le({...t,error:n}),i=new Error(`Weixin text delivery failed (${o})`,{cause:n}),e=cB(n?.code);i.code=e==="-"?"weixin-send-failed":e;let a=Number(n?.status??n?.httpStatus);Number.isInteger(a)&&(i.status=a);let A=cB(n?.providerCode);return A!=="-"&&(i.providerCode=A),i[o9]=o,i}function a9(n){let t=n;for(let o=0;t&&o<5;o+=1){let i=t[o9];if(typeof i=="string"&&i)return{reason:"weixin-send-failed",userMessage:[w("\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u53D1\u9001\u5931\u8D25\uFF0C\u53EF\u80FD\u53EA\u6536\u5230\u90E8\u5206\u5185\u5BB9\u3002\u8BF7\u5C06\u4E0B\u9762\u7684\u8BCA\u65AD\u4FE1\u606F\u5B8C\u6574\u53CD\u9988\u7ED9\u7BA1\u7406\u5458\u3002"),w("\u5FAE\u4FE1\u53D1\u9001\u8BCA\u65AD\uFF1A{diagnostic}",{diagnostic:i})].join(` -`)};t=t.cause}}function i9(n,t){return{content:Ml(n)??"",images:typeof t?.inboundImages=="function"?t.inboundImages(n):jG(n),files:typeof t?.inboundFiles=="function"?t.inboundFiles(n):JG(n)}}function sB(n){return Array.isArray(n?.item_list)&&n.item_list.some(t=>t?.image_item&&typeof t.image_item=="object")}function gB(n){return Array.isArray(n?.item_list)&&n.item_list.some(t=>t?.file_item&&typeof t.file_item=="object")}function A2e(n){return Array.isArray(n?.item_list)&&n.item_list.length>0&&n.item_list.every(t=>t?.type===1&&typeof t.text_item?.text=="string")&&!!Or(Ml(n))}function t2e(n,t){return t.questions[t.index]&&Or(n?.from_user_id)===t.actor&&!sB(n)&&!gB(n)&&Or(Ml(n))}function r2e(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function $G(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var Dw=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d=new Map;#h=new Map;#C=new Map;#u=new Map;#B=new Set;#f=new Set;#Q;#S=new Ti;#y=null;#m=null;#D=null;#E=0;#N=Promise.resolve();#T=!1;#O=0;#w=!1;constructor({api:t,baseUrl:o,token:i,ownerUserId:e,harness:a,state:A,contextEnhancement:r,accessPolicy:s,status:g=$G(),logger:c=console,replyTimeoutMs:I=6e5,maxMessageChars:d=bl,typingKeepaliveMs:B=VLe,signal:f}){if(!t||typeof t.sendText!="function")throw new TypeError("Weixin API is required");if(!o||!i||!e)throw new TypeError("Weixin account credentials are required");if(!a||!A)throw new TypeError("Harness client and state store are required");if(!Number.isFinite(B)||B<=0)throw new TypeError("typingKeepaliveMs must be a positive number");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=d,this.#g=B,this.#I=f,this.#Q=new Di({label:"weixin",logger:c})}get status(){return structuredClone(this.#n)}accept(t){if(this.#I?.aborted||t?.message_type===2)return Promise.resolve();let o=zG(t),i=Or(t?.from_user_id);if(!o||!i||this.#o.hasSeen(o)||this.#u.has(o))return Promise.resolve();let e=Or(Ml(t))??"",a=this.#a?Ba(this.#a,{conversationType:"direct",senderIds:i,text:e,hasImages:sB(t),hasFiles:gB(t)}):i===this.#r?{allowed:!0,reason:"legacy-owner"}:{allowed:!1,reason:"sender-not-allowed"};if(!a.allowed)return this.#u.set(o,null),this.#G(o,i,t,a);this.#u.set(o,Aa(this.#i,"direct")),i===this.#r&&So(this.#o,{toUserId:i});let A=ZLe(i),r=Or(t?.context_token)??void 0,s=Or(t?.run_id)??void 0,g=this.#h.get(A),c=Ni(e),I=this.#S.status(A);if(c||I.phase==="collecting"){let Q=/^\/batch$/iu.test(e)&&I.phase==="idle"&&(this.#d.has(A)||g||this.#Q.hasPending(A))?{handled:!0,kind:"busy",message:No()}:this.#S.handle(A,e,{plainText:A2e(t)});if(Q.handled)return Q.kind==="submit"?this.#R({...t,item_list:[{type:1,text_item:{text:Q.prompt}}]},o,A,{batchSubmission:Q}):this.#_(t,o,A,i,r,s,Q)}let d=Fa(e)?Ao:gB(t)?null:ni(e)?Mi:si(e)?to:gi(e)?_i:null;if(d){let f;return f=this.#k(t,o,A,i,r,s,e,d).catch(Q=>{if(Q?.code==="turn-stopped"||this.#I?.aborted)return;this.#n.lastError=Q?.message??String(Q);let y=At(this.#n,Q);return this.#s.error?.(`[dsh-weixin] failed to process a command [${y.referenceId}]:`,Q),this.#j(A,i,dt(y),r,s).catch(()=>{})}).finally(()=>{this.#u.delete(o),this.#f.delete(f)}),this.#f.add(f),f}let B=this.#Q.claimReply({key:A,actor:i,messageId:o,text:sB(t)||gB(t)?"":Ml(t),addressed:!0,hasPendingQuestion:!!g,questionCompletion:g?.submitting||g?.claimedReplyMessageId?g.queue:null,isQuestionPending:()=>this.#h.has(A),send:f=>this.#M(i,f,r,s)});if(B){let f;return f=B.process(async()=>this.#o.hasSeen(o)?!1:(await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#u.delete(o),this.#B.delete(f)}),this.#B.add(f),f}if(g?.submitting||g?.claimedReplyMessageId)return this.#R(t,o,A);if(g){t2e(t,g)&&(g.claimedReplyMessageId=o);let Q=(g.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#P(t,o,A,g)).catch(y=>this.#z(t,o,y)).finally(()=>{this.#u.delete(o),g.claimedReplyMessageId===o&&(g.claimedReplyMessageId=null),g.queue===Q&&(g.queue=null)});return g.queue=Q,Q}return this.#R(t,o,A)}#R(t,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1,batchSubmission:A=null}={}){let r=Rp(i9(t,this.#e),{signal:this.#I}),g=(this.#d.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#F(t,i,{alreadyRecorded:a,preparedMessage:r,batchSubmission:A})).finally(()=>{e&&this.#u.delete(o),this.#d.get(i)===g&&this.#d.delete(i)});return this.#d.set(i,g),g}#_(t,o,i,e,a,A,r){let s;return s=Promise.resolve().then(async()=>{this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),r.message&&await this.#j(i,e,r.message,a,A),this.#n.lastError=null)}).catch(async g=>{if(this.#I?.aborted)return;this.#n.lastError=g?.message??String(g);let c=At(this.#n,g);this.#s.error?.(`[dsh-weixin] failed to process a batch input message [${c.referenceId}]:`,g),await this.#j(i,e,dt(c),a,A).catch(()=>{})}).finally(()=>{this.#u.delete(o),this.#f.delete(s)}),this.#f.add(s),s}#G(t,o,i,e){let a=Or(i?.context_token)??void 0,A=Or(i?.run_id)??void 0,r;return r=Promise.resolve().then(async()=>{this.#o.hasSeen(t)||(await this.#o.markSeen(t),e.reason==="command-not-allowed"?(this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),await this.#M(o,w(ao),a,A),this.#n.messagesReplied+=1,this.#n.lastReplyAt=new Date().toISOString()):(this.#n.messagesRejected+=1,this.#n.lastRejectedAt=new Date().toISOString()),this.#n.lastError=null)}).catch(s=>{this.#I?.aborted||(this.#n.lastError=s?.message??String(s),this.#s.error?.("[dsh-weixin] failed to apply inbound access policy:",s))}).finally(()=>{this.#u.delete(t),this.#f.delete(r)}),this.#f.add(r),r}async waitForIdle(){await Promise.allSettled([...this.#d.values(),...[...this.#h.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#B,...this.#f,this.#N])}async close(){this.#T=!0,await this.#Z({signal:AbortSignal.timeout(5e3)})}async#k(t,o,i,e,a,A,r,s){if(this.#I?.throwIfAborted(),this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString();let g=await s(r,this.#l,this.#o,i,{signal:this.#I,isDirect:!0,hasImages:sB(t),hasFiles:gB(t),pendingInteraction:this.#h.has(i)||this.#Q.hasPending(i),control:{owner:this,key:i}});g?.stopped&&await Promise.allSettled([this.#W(i),this.#Q.closeRoute(i)]);for(let c of g?.messages??[g?.message])c&&(g?.stopped?await this.#M(e,c,a,A):await this.#j(i,e,c,a,A));this.#n.lastError=null}async#F(t,o,{alreadyRecorded:i=!1,preparedMessage:e,batchSubmission:a=null}={}){this.#I?.throwIfAborted();let A=zG(t),r=Or(t?.from_user_id);if(!A||!r)return;if(!i){if(this.#o.hasSeen(A))return;this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString()}let s=typeof t.context_token=="string"?t.context_token:void 0,g=typeof t.run_id=="string"?t.run_id:void 0,c=a===null,I=!1;try{let d=e??i9(t,this.#e),B=d.content,f=Tt(d),Q=wt(d);if(!B&&!f&&!Q){await this.#M(r,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002"),s,g),await this.#o.markSeen(A);return}let y=B.trim().toLowerCase();if(!f&&!Q&&y==="/help"){await this.#M(r,WLe(),s,g),await this.#o.markSeen(A);return}if(!f&&!Q&&y==="/status"){await this.#l.ensureRunning({signal:this.#I}),await this.#M(r,w("\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),s,g),await this.#o.markSeen(A);return}if(!f&&!Q&&y==="/new"){await this.#o.clearSession(o),await this.#M(r,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),s,g),await this.#o.markSeen(A);return}let m=f||Q?null:await Mo(B,this.#l,o);if(m){for(let V of m.messages??[m.message])await this.#M(r,V,s,g);await this.#o.markSeen(A);return}let T=f||Q?null:await bi(B,this.#l,this.#o,o,{signal:this.#I});if(T){await this.#M(r,T.message,s,g),await this.#o.markSeen(A);return}let _,R=[];await this.#ie(r,s);try{let V=f?await Oo(d,{signal:this.#I}):void 0,x=this.#u.get(A);x&&(V=To(V??B,x,()=>({channel:"weixin",senderId:r}))),await this.#o.markSeen(A),I=!0,{answer:_,artifacts:R=[]}=await Oi({harness:this.#l,state:this.#o,key:o,...V!==void 0?{content:V}:{text:B},createOptions:{signal:this.#I},existsOptions:{signal:this.#I},askOptions:{timeoutMs:this.#p,signal:this.#I,control:{owner:this,key:o},onUpdate:()=>this.#J(o,r,s),onInteraction:G=>this.#H(G,{key:o,actor:r,contextToken:s,runId:g}),onInteractionResolved:async G=>{await this.#U(G),await this.#J(o,r,s)},files:d.files}}),a&&(this.#S.complete(o,a.token),c=!0)}finally{await Promise.allSettled([this.#Z(),this.#W(o),this.#Q.closeRoute(o)])}let K=typeof _=="string"&&_.trim()?_:R.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):_,L=null,F=null;try{F=Zt({deliveryId:A,presentation:"weixin-text",providerMessageIds:await this.#M(r,K,s,g)})}catch(V){L=ka(V)}let q=await this.#x(r,A,R,s,g,F);if(L&&!q.userVisible)throw L;return L&&q.artifactSendErrors===0&&At(this.#n,L,a9(L)),I||await this.#o.markSeen(A),this.#n.messagesReplied+=1,this.#n.lastReplyAt=new Date().toISOString(),this.#n.lastError=null,!L&&q.artifactSendErrors===0&&wo(this.#n),q.receipt}catch(d){let B=null;if(!c&&a&&(d?.code==="turn-stopped"?this.#S.complete(o,a.token):B=this.#S.fail(o,a.token).message??null,c=!0),d?.code==="turn-stopped"){I||await this.#o.markSeen(A);return}if(this.#I?.aborted)return;this.#n.lastError=d?.message??String(d);let f=ko(d)??bo(d),Q=eo(d),y=a9(d),m=At(this.#n,d,{userMessage:f??y?.userMessage,reason:Q?.reason??y?.reason});this.#s.error?.(`[dsh-weixin] failed to process an inbound message [${m.referenceId}]:`,d);try{await this.#M(r,B?`${dt(m)} +`)};t=t.cause}}function i9(n,t){return{content:Ml(n)??"",images:typeof t?.inboundImages=="function"?t.inboundImages(n):jG(n),files:typeof t?.inboundFiles=="function"?t.inboundFiles(n):JG(n)}}function sB(n){return Array.isArray(n?.item_list)&&n.item_list.some(t=>t?.image_item&&typeof t.image_item=="object")}function gB(n){return Array.isArray(n?.item_list)&&n.item_list.some(t=>t?.file_item&&typeof t.file_item=="object")}function A2e(n){return Array.isArray(n?.item_list)&&n.item_list.length>0&&n.item_list.every(t=>t?.type===1&&typeof t.text_item?.text=="string")&&!!Or(Ml(n))}function t2e(n,t){return t.questions[t.index]&&Or(n?.from_user_id)===t.actor&&!sB(n)&&!gB(n)&&Or(Ml(n))}function r2e(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function $G(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var Dw=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c;#g;#I;#d=new Map;#h=new Map;#C=new Map;#u=new Map;#B=new Set;#f=new Set;#Q;#S=new Ti;#y=null;#m=null;#D=null;#E=0;#N=Promise.resolve();#T=!1;#O=0;#w=!1;constructor({api:t,baseUrl:o,token:i,ownerUserId:e,harness:a,state:A,contextEnhancement:r,accessPolicy:s,status:g=$G(),logger:c=console,replyTimeoutMs:I=6e5,maxMessageChars:d=bl,typingKeepaliveMs:B=VLe,signal:f}){if(!t||typeof t.sendText!="function")throw new TypeError("Weixin API is required");if(!o||!i||!e)throw new TypeError("Weixin account credentials are required");if(!a||!A)throw new TypeError("Harness client and state store are required");if(!Number.isFinite(B)||B<=0)throw new TypeError("typingKeepaliveMs must be a positive number");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=I,this.#c=d,this.#g=B,this.#I=f,this.#Q=new Di({label:"weixin",logger:c})}get status(){return structuredClone(this.#n)}accept(t){if(this.#I?.aborted||t?.message_type===2)return Promise.resolve();let o=zG(t),i=Or(t?.from_user_id);if(!o||!i||this.#o.hasSeen(o)||this.#u.has(o))return Promise.resolve();let e=Or(Ml(t))??"",a=this.#a?Ba(this.#a,{conversationType:"direct",senderIds:i,text:e,hasImages:sB(t),hasFiles:gB(t)}):i===this.#r?{allowed:!0,reason:"legacy-owner"}:{allowed:!1,reason:"sender-not-allowed"};if(!a.allowed)return this.#u.set(o,null),this.#G(o,i,t,a);this.#u.set(o,Aa(this.#i,"direct")),i===this.#r&&So(this.#o,{toUserId:i});let A=ZLe(i),r=Or(t?.context_token)??void 0,s=Or(t?.run_id)??void 0,g=this.#h.get(A),c=Ni(e),I=this.#S.status(A);if(c||I.phase==="collecting"){let Q=/^\/batch$/iu.test(e)&&I.phase==="idle"&&(this.#d.has(A)||g||this.#Q.hasPending(A))?{handled:!0,kind:"busy",message:No()}:this.#S.handle(A,e,{plainText:A2e(t)});if(Q.handled)return Q.kind==="submit"?this.#R({...t,item_list:[{type:1,text_item:{text:Q.prompt}}]},o,A,{batchSubmission:Q}):this.#_(t,o,A,i,r,s,Q)}let d=Fa(e)?Ao:gB(t)?null:ni(e)?Mi:si(e)?to:gi(e)?_i:null;if(d){let f;return f=this.#k(t,o,A,i,r,s,e,d).catch(Q=>{if(Q?.code==="turn-stopped"||this.#I?.aborted)return;this.#n.lastError=Q?.message??String(Q);let y=At(this.#n,Q);return this.#s.error?.(`[dsh-weixin] failed to process a command [${y.referenceId}]:`,Q),this.#j(A,i,dt(y),r,s).catch(()=>{})}).finally(()=>{this.#u.delete(o),this.#f.delete(f)}),this.#f.add(f),f}let B=this.#Q.claimReply({key:A,actor:i,messageId:o,text:sB(t)||gB(t)?"":Ml(t),addressed:!0,hasPendingQuestion:!!g,questionCompletion:g?.submitting||g?.claimedReplyMessageId?g.queue:null,isQuestionPending:()=>this.#h.has(A),send:f=>this.#M(i,f,r,s)});if(B){let f;return f=B.process(async()=>this.#o.hasSeen(o)?!1:(await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#u.delete(o),this.#B.delete(f)}),this.#B.add(f),f}if(g?.submitting||g?.claimedReplyMessageId)return this.#R(t,o,A);if(g){t2e(t,g)&&(g.claimedReplyMessageId=o);let Q=(g.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#P(t,o,A,g)).catch(y=>this.#z(t,o,y)).finally(()=>{this.#u.delete(o),g.claimedReplyMessageId===o&&(g.claimedReplyMessageId=null),g.queue===Q&&(g.queue=null)});return g.queue=Q,Q}return this.#R(t,o,A)}#R(t,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1,batchSubmission:A=null}={}){let r=kp(i9(t,this.#e),{signal:this.#I}),g=(this.#d.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#F(t,i,{alreadyRecorded:a,preparedMessage:r,batchSubmission:A})).finally(()=>{e&&this.#u.delete(o),this.#d.get(i)===g&&this.#d.delete(i)});return this.#d.set(i,g),g}#_(t,o,i,e,a,A,r){let s;return s=Promise.resolve().then(async()=>{this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),r.message&&await this.#j(i,e,r.message,a,A),this.#n.lastError=null)}).catch(async g=>{if(this.#I?.aborted)return;this.#n.lastError=g?.message??String(g);let c=At(this.#n,g);this.#s.error?.(`[dsh-weixin] failed to process a batch input message [${c.referenceId}]:`,g),await this.#j(i,e,dt(c),a,A).catch(()=>{})}).finally(()=>{this.#u.delete(o),this.#f.delete(s)}),this.#f.add(s),s}#G(t,o,i,e){let a=Or(i?.context_token)??void 0,A=Or(i?.run_id)??void 0,r;return r=Promise.resolve().then(async()=>{this.#o.hasSeen(t)||(await this.#o.markSeen(t),e.reason==="command-not-allowed"?(this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),await this.#M(o,w(ao),a,A),this.#n.messagesReplied+=1,this.#n.lastReplyAt=new Date().toISOString()):(this.#n.messagesRejected+=1,this.#n.lastRejectedAt=new Date().toISOString()),this.#n.lastError=null)}).catch(s=>{this.#I?.aborted||(this.#n.lastError=s?.message??String(s),this.#s.error?.("[dsh-weixin] failed to apply inbound access policy:",s))}).finally(()=>{this.#u.delete(t),this.#f.delete(r)}),this.#f.add(r),r}async waitForIdle(){await Promise.allSettled([...this.#d.values(),...[...this.#h.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#B,...this.#f,this.#N])}async close(){this.#T=!0,await this.#Z({signal:AbortSignal.timeout(5e3)})}async#k(t,o,i,e,a,A,r,s){if(this.#I?.throwIfAborted(),this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString();let g=await s(r,this.#l,this.#o,i,{signal:this.#I,isDirect:!0,hasImages:sB(t),hasFiles:gB(t),pendingInteraction:this.#h.has(i)||this.#Q.hasPending(i),control:{owner:this,key:i}});g?.stopped&&await Promise.allSettled([this.#W(i),this.#Q.closeRoute(i)]);for(let c of g?.messages??[g?.message])c&&(g?.stopped?await this.#M(e,c,a,A):await this.#j(i,e,c,a,A));this.#n.lastError=null}async#F(t,o,{alreadyRecorded:i=!1,preparedMessage:e,batchSubmission:a=null}={}){this.#I?.throwIfAborted();let A=zG(t),r=Or(t?.from_user_id);if(!A||!r)return;if(!i){if(this.#o.hasSeen(A))return;this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString()}let s=typeof t.context_token=="string"?t.context_token:void 0,g=typeof t.run_id=="string"?t.run_id:void 0,c=a===null,I=!1;try{let d=e??i9(t,this.#e),B=d.content,f=Tt(d),Q=wt(d);if(!B&&!f&&!Q){await this.#M(r,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002"),s,g),await this.#o.markSeen(A);return}let y=B.trim().toLowerCase();if(!f&&!Q&&y==="/help"){await this.#M(r,WLe(),s,g),await this.#o.markSeen(A);return}if(!f&&!Q&&y==="/status"){await this.#l.ensureRunning({signal:this.#I}),await this.#M(r,w("\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),s,g),await this.#o.markSeen(A);return}if(!f&&!Q&&y==="/new"){await this.#o.clearSession(o),await this.#M(r,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),s,g),await this.#o.markSeen(A);return}let m=f||Q?null:await Mo(B,this.#l,o);if(m){for(let V of m.messages??[m.message])await this.#M(r,V,s,g);await this.#o.markSeen(A);return}let T=f||Q?null:await bi(B,this.#l,this.#o,o,{signal:this.#I});if(T){await this.#M(r,T.message,s,g),await this.#o.markSeen(A);return}let _,R=[];await this.#ie(r,s);try{let V=f?await Oo(d,{signal:this.#I}):void 0,x=this.#u.get(A);x&&(V=To(V??B,x,()=>({channel:"weixin",senderId:r}))),await this.#o.markSeen(A),I=!0,{answer:_,artifacts:R=[]}=await Oi({harness:this.#l,state:this.#o,key:o,...V!==void 0?{content:V}:{text:B},createOptions:{signal:this.#I},existsOptions:{signal:this.#I},askOptions:{timeoutMs:this.#p,signal:this.#I,control:{owner:this,key:o},onUpdate:()=>this.#J(o,r,s),onInteraction:G=>this.#H(G,{key:o,actor:r,contextToken:s,runId:g}),onInteractionResolved:async G=>{await this.#U(G),await this.#J(o,r,s)},files:d.files}}),a&&(this.#S.complete(o,a.token),c=!0)}finally{await Promise.allSettled([this.#Z(),this.#W(o),this.#Q.closeRoute(o)])}let K=typeof _=="string"&&_.trim()?_:R.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):_,L=null,F=null;try{F=Zt({deliveryId:A,presentation:"weixin-text",providerMessageIds:await this.#M(r,K,s,g)})}catch(V){L=ka(V)}let q=await this.#x(r,A,R,s,g,F);if(L&&!q.userVisible)throw L;return L&&q.artifactSendErrors===0&&At(this.#n,L,a9(L)),I||await this.#o.markSeen(A),this.#n.messagesReplied+=1,this.#n.lastReplyAt=new Date().toISOString(),this.#n.lastError=null,!L&&q.artifactSendErrors===0&&wo(this.#n),q.receipt}catch(d){let B=null;if(!c&&a&&(d?.code==="turn-stopped"?this.#S.complete(o,a.token):B=this.#S.fail(o,a.token).message??null,c=!0),d?.code==="turn-stopped"){I||await this.#o.markSeen(A);return}if(this.#I?.aborted)return;this.#n.lastError=d?.message??String(d);let f=ko(d)??bo(d),Q=eo(d),y=a9(d),m=At(this.#n,d,{userMessage:f??y?.userMessage,reason:Q?.reason??y?.reason});this.#s.error?.(`[dsh-weixin] failed to process an inbound message [${m.referenceId}]:`,d);try{await this.#M(r,B?`${dt(m)} -${B}`:dt(m),s,g),I||await this.#o.markSeen(A)}catch(T){this.#s.error?.("[dsh-weixin] failed to send the safe error reply:",T)}}}async#P(t,o,i,e){this.#I?.throwIfAborted();let a=this.#h.get(i),A=e.claimedReplyMessageId===o;if(!a||a!==e||a.submitting)return A&&(!a||a!==e)?this.#v(t,o):this.#R(t,o,i,{releaseMessageId:!1});if(this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString();let r=Or(Ml(t)),s=Or(t?.context_token)??void 0,g=Or(t?.run_id)??void 0;if(!r||sB(t)){await this.#M(e.actor,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),s,g);return}let c=this.#h.get(i);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#M(e.actor,ww(),s,g);return}return this.#R(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.contextToken=s,c.runId=g,c.needsPresentation){try{await this.#L(c)}catch{this.#n.lastError=w("\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to retry an interaction question"),c.interaction.reconnect?.();return}let d=this.#h.get(i);if(!d||d!==e||d.submitting){if(A&&(!d||d!==e)){await this.#M(e.actor,ww(),s,g).catch(()=>{});return}return this.#R(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(wi(I,r)),c.index+=1,c.index{});return}if(this.#h.get(i)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#n.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to answer a Harness interaction"),await this.#M(c.actor,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002"),c.contextToken,c.runId).catch(()=>{})}}}async#H(t,{key:o,actor:i,contextToken:e,runId:a}){if(t?.kind==="approval")return this.#Q.handleRequested(t,{key:o,actor:i,send:c=>this.#M(i,c,e,a)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#s.warn?.("[dsh-weixin] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#M(i,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),e,a).catch(()=>{});return}let s=this.#h.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#L(s);return}if(this.#C.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,questions:A,answers:[],index:0,contextToken:e,runId:a,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#h.set(o,g),this.#C.set(r,o),await this.#L(g)}async#U(t){if(t?.kind==="approval"){await this.#Q.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#C.get(o);i&&this.#q(i,o)}#L(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=this.#M(t.actor,Si(o,t.index,t.questions.length),t.contextToken,t.runId).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===i&&(t.presentationPromise=null)});return t.presentationPromise=i,i}async#v(t,o){this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),await this.#M(Or(t?.from_user_id),ww(),Or(t?.context_token)??void 0,Or(t?.run_id)??void 0).catch(()=>{}))}#K(t,o){let i=this.#h.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#h.delete(t),this.#C.delete(i.interactionId),i)}#q(t,o){return this.#K(t,o)!==null}async#W(t){let o=this.#K(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Weixin interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#s.warn?.("[dsh-weixin] failed to cancel a pending Harness interaction")}}async#z(t,o,i){if(this.#I?.aborted)return;this.#n.lastError=i?.message??String(i);let e=At(this.#n,i);this.#s.error?.(`[dsh-weixin] failed to process an interaction reply [${e.referenceId}]:`,i),this.#o.hasSeen(o)||await this.#o.markSeen(o).catch(()=>{}),await this.#M(Or(t?.from_user_id),dt(e),Or(t?.context_token)??void 0,Or(t?.run_id)??void 0).catch(()=>{})}async#M(t,o,i,e){await this.#Z();let a=[],A=WZ(o,this.#c);for(let r=0;r{}).then(t);return this.#N=o.catch(()=>{}),o}async#ie(t,o){let i=Or(t);if(!i||this.#T||this.#I?.aborted||Date.now(){if(e!==this.#E||this.#T)return!1;let a=this.#y;if(!a){let A=await this.#e.getConfig({baseUrl:this.#A,token:this.#t,toUserId:i,contextToken:o,signal:this.#I});if(a=Or(A?.typingTicket),!a)return this.#O=Date.now()+XG,!1;if(e!==this.#E||this.#T)return!1;this.#y=a,this.#O=0}return this.#m=i,await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:i,typingTicket:a,status:1,signal:this.#I}),e!==this.#E||this.#T?!1:(this.#w=!1,this.#O=0,this.#te(e),!0)})}catch(a){return e===this.#E&&(this.#Y(),this.#w=!!(this.#m&&this.#y),this.#O=Date.now()+XG),!this.#I?.aborted&&!this.#T&&this.#s.warn?.("[dsh-weixin] typing indicator failed:",a),!1}}async#Z({signal:t=AbortSignal.timeout(5e3)}={}){++this.#E,this.#Y();let o=this.#m,i=this.#y,e=this.#w;if(this.#m=null,typeof this.#e.sendTyping!="function")return!1;try{return await this.#ee(async()=>{if(!o||!i)return!1;try{await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:o,typingTicket:i,status:2,signal:t})}finally{e&&this.#y===i&&(this.#y=null),this.#w=!1}return!0})}catch(a){return t?.aborted||this.#s.warn?.("[dsh-weixin] typing cancellation failed:",a),!1}}#te(t){if(this.#Y(),t!==this.#E||!this.#m||this.#T)return;let o=setTimeout(()=>{this.#D===o&&(this.#D=null),this.#ee(async()=>t!==this.#E||!this.#m||this.#T?!1:(await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:this.#m,typingTicket:this.#y,status:1,signal:this.#I}),!0)).then(i=>{i&&this.#te(t)}).catch(i=>{t===this.#E&&(this.#w=!!(this.#m&&this.#y),this.#O=Date.now()+XG,!this.#I?.aborted&&!this.#T&&this.#s.warn?.("[dsh-weixin] typing keepalive failed:",i))})},this.#g);o.unref?.(),this.#D=o}#Y(){this.#D&&clearTimeout(this.#D),this.#D=null}#J(t,o,i){return this.#h.has(t)||this.#Q.hasPending(t)?Promise.resolve(!1):this.#ie(o,i)}async#x(t,o,i,e,a,A){let r=(g,c)=>this.#e[g]({baseUrl:this.#A,token:this.#t,toUserId:t,file:c,contextToken:e,runId:a,signal:this.#I}),s=await vo({artifacts:i,baseReceipt:A,deliveryId:o,aggregatePresentation:A?"weixin-text-and-files":"weixin-files",channelKey:"weixin",signal:this.#I,sendImage:typeof this.#e.sendImage=="function"?g=>r("sendImage",g):void 0,sendFile:typeof this.#e.sendFile=="function"?g=>r("sendFile",g):void 0,onFailure:(g,c)=>At(this.#n,c,{userMessage:r2e(g?.fileName,c),reason:c?.code}),sendFailureNotice:(g,c,I)=>this.#M(t,dt(I),e,a),logger:this.#s});return this.#n.artifactsSent=(this.#n.artifactsSent??0)+s.artifactsSent,this.#n.artifactSendErrors=(this.#n.artifactSendErrors??0)+s.artifactSendErrors,{receipt:s.receipt,userVisible:s.userVisible,artifactSendErrors:s.artifactSendErrors}}};var a2e=Object.freeze([250,1e3,3e3]),i2e=new Set(["harness-connect-failed","harness-timeout","harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden","harness-api-not-found","harness-http-failed","harness-response-invalid","harness-rpc-rejected"]);function o2e(n){if(n===void 0)return[...a2e];if(!Array.isArray(n))throw new TypeError("startRetryDelaysMs must be an array");return n.map(t=>{if(!Number.isFinite(t)||t<0)throw new TypeError("startRetryDelaysMs must contain non-negative delays");return t})}function n2e(n){return n instanceof NA?n.code==="network-error"||n.code==="timeout"?!0:n.code==="http-error"&&(n.status===408||n.status===425||n.status===429||n.status>=500):!1}function s2e(n,t){let o=new Error(`Weixin runtime failed during ${n}`,{cause:t});return o.name="WeixinRuntimeStartError",o.code=n,o}function g2e(n){let t=i2e.has(n?.code)?n.code:"harness-check-unknown-failed";return s2e(t,n)}function n9(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let a=setTimeout(()=>{t?.removeEventListener("abort",A),o()},n),A=()=>{clearTimeout(a),t?.removeEventListener("abort",A),i(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",A,{once:!0})})}function c2e(n){if(!Array.isArray(n)||n.length<2)return Array.isArray(n)?n:[];let t=["seq","create_time_ms"].find(o=>n.every(i=>typeof i?.[o]=="number"&&Number.isFinite(i[o])||typeof i?.[o]=="string"&&i[o].trim()&&Number.isFinite(Number(i[o]))));return t?n.map((o,i)=>({message:o,index:i,order:Number(o[t])})).sort((o,i)=>o.order-i.order||o.index-i.index).map(({message:o})=>o):n}function I2e(){return{startedAt:null,ready:!1,weixinConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastError:null,...$G()}}var IB=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=I2e();#g=null;#I=null;#d=null;#h=null;constructor({api:t,config:o,token:i,harness:e,state:a,contextEnhancement:A,accessPolicy:r,logger:s=console,replyTimeoutMs:g=6e5,maxMessageChars:c=bl,startRetryDelaysMs:I}){if(!t||!o||!i||!e||!a)throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=o2e(I)}get status(){return structuredClone(this.#c)}async start(){return this.#c.ready&&this.#d?this.status:this.#h?this.#h:(this.#h=this.#C().finally(()=>{this.#h=null}),this.#h)}async#C(){await this.stop(),this.#c.startedAt=new Date().toISOString(),this.#c.weixinConnectionState="connecting",this.#c.lastError=null;try{try{await this.#r.ensureRunning()}catch(o){throw g2e(o)}this.#c.harnessReachable=!0,await this.#u(),this.#I=new AbortController;let t=this.#I.signal;return this.#g=new Dw({api:this.#e,baseUrl:this.#A.baseUrl,token:this.#t,ownerUserId:this.#A.ownerUserId,harness:this.#r,state:this.#l,contextEnhancement:this.#o,accessPolicy:this.#i,status:this.#c,logger:this.#a,replyTimeoutMs:this.#n,maxMessageChars:this.#s,signal:t}),this.#c.ready=!0,this.#c.weixinConnectionState="connected",this.#c.lastCheckedAt=Date.now(),this.#d=this.#B(t).catch(o=>{t.aborted||(this.#c.ready=!1,this.#c.weixinConnectionState="failed",this.#c.lastError=o?.message??String(o),this.#a.error?.(`[dsh-weixin] account ${this.#A.botId} monitor stopped:`,o))}),this.status}catch(t){throw this.#I?.abort(),this.#I=null,this.#g=null,this.#c.ready=!1,this.#c.weixinConnectionState="failed",this.#c.lastError=t?.message??String(t),t}}async#u(){for(let t=0;;t+=1)try{return await this.#e.notifyStart({baseUrl:this.#A.baseUrl,token:this.#t})}catch(o){let i=this.#p[t];if(i===void 0||!n2e(o))throw o;this.#a.warn?.(`[dsh-weixin] account ${this.#A.botId} start request failed; retrying in ${i}ms:`,o),await n9(i)}}async#B(t){let o=0;for(;!t.aborted;)try{let i=await this.#e.getUpdates({baseUrl:this.#A.baseUrl,token:this.#t,getUpdatesBuf:this.#l.getUpdatesBuf(),signal:t});if(t.aborted)return;if(i?.ret!==void 0&&i.ret!==0||i?.errcode!==void 0&&i.errcode!==0){let a=i.errcode??i.ret;throw new NA(a===-14?"stale-token":"updates-rejected",a===-14?w("\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002"))}o=0,this.#c.ready=!0,this.#c.weixinConnectionState="connected",this.#c.lastCheckedAt=Date.now(),this.#c.lastError=null;for(let a of c2e(i?.msgs))this.#g.accept(a).catch(A=>{t.aborted||this.#a.error?.(`[dsh-weixin] account ${this.#A.botId} message handling failed:`,A)});typeof i?.get_updates_buf=="string"&&i.get_updates_buf&&await this.#l.setGetUpdatesBuf(i.get_updates_buf)}catch(i){if(t.aborted)return;if(o+=1,this.#c.lastError=i?.message??String(i),this.#a.warn?.(`[dsh-weixin] account ${this.#A.botId} poll failed (${o}/3):`,i),i instanceof NA&&i.code==="stale-token"||o>=3)throw i;await n9(Math.min(2e3*2**(o-1),1e4),t)}}async stop(){let t=this.#d,o=this.#g,i=!!(this.#I||t||this.#c.ready);if(this.#I?.abort(),this.#I=null,this.#d=null,await o?.close?.(),await t?.catch(()=>{}),await o?.waitForIdle(),this.#g=null,i)try{await this.#e.notifyStop({baseUrl:this.#A.baseUrl,token:this.#t,signal:AbortSignal.timeout(1e4)})}catch(e){this.#a.warn?.(`[dsh-weixin] account ${this.#A.botId} stop notification failed:`,e)}return this.#c.ready=!1,this.#c.weixinConnectionState="idle",this.status}async sendConnectionTest(t){let o=kE(this.#l),i=typeof o?.toUserId=="string"&&o.toUserId.trim()?o.toUserId.trim():typeof this.#A.ownerUserId=="string"&&this.#A.ownerUserId.trim()?this.#A.ownerUserId.trim():null;if(!i)throw Cr(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));if(!this.#c.ready||!this.#I)throw new Error("Weixin runtime is not connected");return await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:i,text:t,signal:this.#I.signal}),{sent:!0}}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.toUserId=="string"?t.route.toUserId.trim():"";if(t?.kind!=="user"||!e){let a=new TypeError("Invalid Weixin proactive delivery target");throw a.code="invalid-target",a}if(!this.#c.ready||!this.#I){let a=new Error("Weixin runtime is not connected");throw a.code="bot-not-connected",a}return i?.throwIfAborted(),await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:e,text:o,signal:i??this.#I.signal}),{sent:!0}}};var s9=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function l2e(n){if(!Array.isArray(n)||n.length===0)return[...s9];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...s9]}var Ow=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=l2e(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(iLa(n),B=h2e(t),f=await new e(B.config).load(),Q=_l(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("weixin",k)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=new Map,K=k=>_l(B.accounts,k,"state.json"),L=async k=>{let z=R.get(k);return z||(z=await new a(K(k)).load(),R.set(k,z)),z},F=ja(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:V,fileIngressExecutor:x}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new A({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...V?{sessionMaintenanceExecutor:V}:{},...x?{fileIngressExecutor:x}:{}}),J=new r({api:g,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:k,config:z,token:Ae})=>{let ie=await L(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("weixin",z)});let we=Ka(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:d});return new s({api:g,config:z,token:Ae,harness:we.harness,state:we.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:qa(m,k,{channel:"weixin",config:z}),replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??bl,logger:{error:(...se)=>I.error?.(`[${k}]`,...se),warn:(...se)=>I.warn?.(`[${k}]`,...se),info:(...se)=>I.info?.(`[${k}]`,...se),debug:(...se)=>I.debug?.(`[${k}]`,...se)}})},deleteState:async({botId:k})=>{let z=R.get(k);if(R.delete(k),z&&typeof z.remove=="function")await z.remove();else try{await p2e(K(k))}catch(Ae){if(Ae?.code!=="ENOENT")throw Ae}}}),U=xa(J,{workspaces:m,stateFor:L,agentPresetCatalog:d}),N=c({controller:U,harness:G,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:U,deliveryAdapter:Ya({channel:"weixin",workspaces:m,coreController:J,stateFor:L}),ready:N.ready,async close(){await N.close(),await U.close(),G.stopManagedProcess()}}}import E2e from"qrcode";var g9="/weixin",lr=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",submitVerification:"provision.verify",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),c9=Object.freeze(Object.values(lr));function I9(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function th(n,t){return I9(n)&&Object.keys(n).every(o=>t.includes(o))}function bw(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function C2e(n,t){return I9(t)?n===lr.status?th(t,[])?null:"connection.status does not accept fields.":n===lr.beginProvisioning?th(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[lr.pollProvisioning,lr.cancelProvisioning].includes(n)?th(t,["attemptId"])&&bw(t.attemptId)?null:`${n} requires an attemptId.`:n===lr.submitVerification?th(t,["attemptId","verifyCode"])&&bw(t.attemptId)&&typeof t.verifyCode=="string"&&/^\d{4,8}$/.test(t.verifyCode)?null:"provision.verify requires an attemptId and a 4-to-8-digit code.":n===lr.reconnectBot?th(t,["botId","sendTest"])&&bw(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===lr.deleteBot?th(t,["botId","confirm"])&&bw(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===lr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===lr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===lr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===lr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown Weixin endpoint.":"Payload must be an object."}function Mw(n){return{ok:!1,error:{code:"bad-request",message:n}}}function pB(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function u2e(){return{ok:!1,error:{code:"weixin-operation-failed",message:"\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}async function B2e(n){return E2e.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function _w(n,t){return!n||!n.verificationUrl?n:{...n,qrCodeDataUrl:await t(n.verificationUrl)}}async function Tl(n,t){let o=structuredClone(n);return o.provisioning&&(o.provisioning=await _w(o.provisioning,t)),o}function f2e(n){if(!n||typeof n.status!="function"||typeof n.startProvisioning!="function"||typeof n.registrationStatus!="function"||typeof n.submitVerification!="function"||typeof n.cancelProvisioning!="function"||typeof n.reconnectBot!="function"||typeof n.deleteBot!="function")throw new TypeError("A complete Weixin controller is required")}function l9(n,{encodeQr:t=B2e}={}){f2e(n);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return pB();if(!c9.includes(e))return Mw("Unknown Weixin endpoint.");let r=C2e(e,a);if(r)return Mw(r);try{let s;if(e===lr.status)s=await Tl(await n.status(),i);else if(e===lr.beginProvisioning){let g=await n.startProvisioning();if(A?.aborted)return await n.cancelProvisioning(g.attemptId),pB();s=await _w(g,i)}else if(e===lr.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return Mw("The provisioning attempt no longer exists.");s=await _w(g,i)}else if(e===lr.submitVerification)s=await _w(await n.submitVerification(a.attemptId,a.verifyCode),i);else if(e===lr.cancelProvisioning){if(s=await n.cancelProvisioning(a.attemptId),!s)return Mw("The provisioning attempt no longer exists.")}else if(e===lr.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return pB();let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=or()}catch(d){c=or(d)}s=await Tl({...g,...c?{testMessage:c}:{}},i)}else if(e===lr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Tl(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===lr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Tl(g,i))}else if(e===lr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Tl(g,i))}else if(e===lr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Tl(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await Tl(await n.deleteBot(a.botId),i);return A?.aborted?pB():{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?pB():g?{ok:!1,error:g}:u2e()}}}function Tw(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(g9,l9(t,o),{authority:fr(i)})}async function p9(n,t={}){if(t?.controller)return Tw(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await AF(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Tw(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-weixin: close account connections"),e}import{rm as SZe,unlink as wZe}from"node:fs/promises";import{homedir as DZe}from"node:os";import{join as bE,resolve as ic}from"node:path";import{createHash as Q2e}from"node:crypto";import{mkdir as y2e,readFile as m2e,rename as S2e,unlink as w2e,writeFile as D2e}from"node:fs/promises";import{dirname as O2e}from"node:path";var tF=Object.freeze({version:2,bots:Object.freeze([])}),d9=/^whatsapp_[a-f0-9]{24}$/,b2e=/^[a-f0-9-]{36}$/,M2e=/^[1-9]\d{4,14}$/,rF=Object.freeze({selfOnly:"self-only",privateAllowlist:"private-allowlist",open:"open"});function rh(n){return typeof n=="string"&&n.trim()?n.trim():null}function Nw(n){let t=rh(n)?.toLowerCase();return/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(t??"")?t:null}function aF(n){let t=Nw(n);if(!t)throw new TypeError("A valid WhatsApp account JID is required");return`whatsapp_${Q2e("sha256").update(t).digest("hex").slice(0,24)}`}function iF(n){let t=Nw(n)?.split("@")[0]??"";return t?t.length<=7?`${t.slice(0,2)}\u2022\u2022\u2022${t.slice(-2)}`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("WhatsApp\u8D26\u53F7")}function _2e(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedNumbers must be an array of WhatsApp phone numbers");let t=n.map(o=>{let i=typeof o=="string"?o.trim().replace(/^\+/,""):"";if(!M2e.test(i))throw new TypeError("allowedNumbers contains an invalid WhatsApp phone number");return i});return Object.freeze([...new Set(t)])}function kw(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("WhatsApp access policy must be an object");let t=n.accessMode??rF.selfOnly;if(!Object.values(rF).includes(t))throw new TypeError("WhatsApp accessMode is invalid");return Object.freeze({accessMode:t,allowedNumbers:_2e(n.allowedNumbers)})}var Rw=class{#e;#A=tF;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#l(JSON.parse(await m2e(this.#e,"utf8")));if(!t)throw new Error("dsh-im WhatsApp config contains invalid account data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=tF}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByAccountJid(t){let o=Nw(t),i=this.#A.bots.find(e=>e.accountJid===o);return i?structuredClone(i):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete WhatsApp account data");return this.#o(i=>{let e=i.find(r=>r.accountJid===o.accountJid&&r.botId!==o.botId),a=i.find(r=>r.authDirectory===o.authDirectory&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate WhatsApp account identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!d9.test(t))throw new TypeError("Invalid WhatsApp bot id");return this.#o(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await w2e(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=tF});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=Nw(t.accountJid),i=rh(t.botId),e=rh(t.authDirectory),a=rh(t.name);if(!o||!i||!e||!a||!d9.test(i)||!b2e.test(e)||aF(o)!==i)return null;let A;try{A=kw(t)}catch{return null}return Object.freeze({botId:i,accountJid:o,authDirectory:e,name:a,createdAt:rh(t.createdAt)??new Date().toISOString(),connectedAt:rh(t.connectedAt),...A})}#l(t){if(!t||t.version!==2||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.accountJid)||a.has(A.authDirectory))return null;i.add(A.botId),e.add(A.accountJid),a.add(A.authDirectory)}return Object.freeze({version:2,bots:Object.freeze(o)})}async#o(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:2,bots:Object.freeze(e)});await this.#i(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#i(t){await y2e(O2e(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await D2e(o,`${JSON.stringify(t,null,2)} -`,{encoding:"utf8",mode:384}),await S2e(o,this.#e)}};var vw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"whatsapp",logPrefix:"dsh-whatsapp"})}};var Pw=class extends gs{};import{randomUUID as T2e}from"node:crypto";var h9=new Set(["starting","pending","connecting"]),Gw=new Set(["connected","failed","cancelled"]),N2e=6e4;function Uc(n,t){return Object.freeze({code:n,message:t})}function Fw(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.qrValue?{qrValue:n.qrValue}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var dB=class{#e;#A;#t;#r;#l;#o;#i;#a=new Map;#n=new Map;#s=new Map;#p=new Map;#c=null;#g=0;#I=!1;constructor({configStore:t,authPath:o,createSession:i,createRuntime:e,deleteAuth:a=async()=>{},deleteState:A=async()=>{},logger:r=console}){if(!t||typeof t.list!="function"||typeof t.save!="function"||typeof t.remove!="function")throw new TypeError("WhatsappController requires a config store");if(typeof o!="function"||typeof i!="function"||typeof e!="function")throw new TypeError("WhatsappController dependencies are incomplete");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r}async initialize(){if(this.#I)return this.status();for(let t of this.#e.list())await this.#B(t.botId,async()=>{if(!(this.#I||this.#a.get(t.botId)?.status?.ready))try{await this.#C(t),this.#n.delete(t.botId)}catch(o){this.#n.set(t.botId,Uc(o?.code==="relink-required"?"relink-required":"connection-failed",o?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#i.warn?.(`[dsh-im:whatsapp] bot ${t.botId} failed to initialize`)}finally{this.#f()}});return this.status()}async startProvisioning(){if(this.#I)throw new Error("WhatsApp controller is closed");this.#c&&await this.cancelProvisioning(this.#c);let t,o,i=!1,e=new Promise((r,s)=>{t=()=>{i||(i=!0,r())},o=g=>{i||(i=!0,s(g))}}),a=T2e(),A={id:a,state:"starting",authDirectory:a,createdAt:Date.now(),expiresAt:null,qrRevision:0,qrValue:null,controller:new AbortController,session:null,task:null,error:null,botId:null};this.#s.set(a,A),this.#c=a,this.#f();try{let r=await this.#t({authDir:this.#A(A.authDirectory),signal:A.controller.signal,logger:this.#i,onQr:s=>{A.controller.signal.aborted||Gw.has(A.state)||typeof s!="string"||!s||(A.qrValue=s,A.qrRevision+=1,A.expiresAt=Date.now()+N2e,A.state="pending",this.#f(),t())}});return A.session=r,A.task=r.ready.then(s=>this.#d(A,s)).catch(s=>this.#h(A,s,o)),await e,Fw(A)}catch(r){throw await this.#h(A,r,o),r}}registrationStatus(t){return Fw(this.#s.get(t))}async cancelProvisioning(t){let o=this.#s.get(t);return o?(Gw.has(o.state)||(o.controller.abort(),await o.session?.close().catch(()=>{}),await o.task?.catch(()=>{}),Gw.has(o.state)||(o.state="cancelled",o.error=Uc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),await this.#l(o.authDirectory).catch(()=>{})),this.#c===o.id&&(this.#c=null),this.#f(),Fw(o)):null}async reconnectBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{try{await this.#C(o),this.#n.delete(t)}catch(i){throw this.#n.set(t,Uc(i?.code==="relink-required"?"relink-required":"connection-failed",i?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),i}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let i=this.#a.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let e=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return i.sendConnectionTest(Ra(`${o.name}\uFF08${iF(o.accountJid)}\uFF09`,w("WhatsApp\u673A\u5668\u4EBA")))})}async sendProactiveText(t,o,i,e={}){if(!this.#e.get(t))throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let A=this.#a.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async setAccessPolicy(t,o){if(this.#I)throw new Error("WhatsApp controller is closed");let i=kw(o);return await this.#B(t,async()=>{if(this.#I)throw new Error("WhatsApp controller is closed");let e=this.#e.get(t);if(!e)throw new Error("Unknown WhatsApp bot");let a=await this.#e.save({...e,...i});this.#a.get(t)?.setAccessPolicy?.(a),this.#f()}),this.status()}async deleteBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{await this.#u(t);try{await this.#e.remove(t)}catch(i){throw await this.#C(o).catch(()=>{}),i}await Promise.allSettled([this.#l(o.authDirectory),this.#o({botId:t,config:o})]),this.#n.delete(t),this.#f()}),this.status()}status(){let t=this.#e.list().map(e=>{let a=this.#a.get(e.botId)?.status??null,A=a?.ready===!0&&a.connectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.connectionState==="connecting"?"connecting":this.#n.has(e.botId)||a?.connectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:e.name,idMasked:iF(e.accountJid)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA"):w("WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null,lastConnectedAt:a?.lastConnectedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),accessPolicy:kw(e),error:structuredClone(this.#n.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,i=this.#c?this.#s.get(this.#c):null;return{schemaVersion:1,revision:this.#g,state:i&&h9.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&h9.has(i.state)?{provisioning:Fw(i)}:{}}}async close(){this.#I||(this.#I=!0,this.#c&&await this.cancelProvisioning(this.#c),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#a.keys()].map(t=>this.#u(t))))}async#d(t,o){if(t.controller.signal.aborted||this.#I)return;t.state="connecting",t.qrValue=null,t.expiresAt=null,this.#f();let i=aF(o.accountJid);t.botId=i,await t.session?.close();let e=this.#e.get(i),a={botId:i,accountJid:o.accountJid,authDirectory:t.authDirectory,name:o.name,createdAt:e?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString(),accessMode:e?.accessMode,allowedNumbers:e?.allowedNumbers};try{if(t.controller.signal.aborted||this.#I)throw Object.assign(new Error,{name:"AbortError"});if(await this.#e.save(a),t.controller.signal.aborted||this.#I)throw Object.assign(new Error,{name:"AbortError"});try{await this.#C(a),this.#n.delete(i)}catch{this.#n.set(i,Uc("connection-failed",w("WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#i.warn?.(`[dsh-im:whatsapp] bot ${i} did not reconnect after QR binding`)}e?.authDirectory&&e.authDirectory!==a.authDirectory&&await this.#l(e.authDirectory).catch(()=>{}),t.state="connected",t.error=null}catch(A){t.controller.signal.aborted||this.#I||A?.name==="AbortError"?(await this.#u(i),e?await this.#e.save(e).catch(()=>{}):await this.#e.remove(i).catch(()=>null)&&await this.#o({botId:i,config:a}).catch(s=>{this.#i.warn?.("[dsh-im:whatsapp] cancelled bot state cleanup failed:",s)}),await this.#l(t.authDirectory).catch(()=>{}),e&&await this.#C(e).catch(()=>{}),t.state="cancelled",t.error=Uc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(await this.#l(t.authDirectory).catch(()=>{}),t.state="failed",t.error=Uc("activation-failed",w("WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002")),this.#i.error?.("[dsh-im:whatsapp] unable to persist linked-device session"))}finally{this.#c===t.id&&(this.#c=null),this.#f()}}async#h(t,o,i=()=>{}){Gw.has(t.state)||(t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=Uc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Uc("qr-connect-failed",w("\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"))),this.#c===t.id&&(this.#c=null),await t.session?.close().catch(()=>{}),await this.#l(t.authDirectory).catch(()=>{}),this.#f(),i(o))}async#C(t){if(this.#I)throw new Error("WhatsApp controller is closed");if(await this.#u(t.botId),this.#I)throw new Error("WhatsApp controller is closed");let o=await this.#r({botId:t.botId,config:t,authDir:this.#A(t.authDirectory)});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("createRuntime returned an invalid WhatsApp runtime");this.#a.set(t.botId,o);try{await o.start()}catch(i){throw await o.stop().catch(()=>{}),this.#a.delete(t.botId),i}}async#u(t){let o=this.#a.get(t);this.#a.delete(t),await o?.stop().catch(()=>{})}#B(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#f(){this.#g+=1}};import{createHash as sZe,randomBytes as Wce}from"node:crypto";var v=qe(Rm(),1),D=v.default.Reader,P=v.default.Writer,l=v.default.util,p=v.default.roots.default||(v.default.roots.default={});function ge(n,t){if(typeof n=="string")return n;if(typeof n=="number")return String(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?(e-(1n<<64n)).toString():e.toString()}return String(n)}function ce(n,t){if(typeof n=="number")return n;if(typeof n=="string")return Number(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?Number(e-(1n<<64n)):Number(e)}return Number(n)}var oe=p.proto=(()=>{let n={};return n.ADVDeviceIdentity=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.keyIndex=e.uint32();break}case 4:{s.accountType=e.int32();break}case 5:{s.deviceType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVDeviceIdentity)return e;var a=new p.proto.ADVDeviceIdentity;switch(e.rawId!=null&&(a.rawId=e.rawId>>>0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.keyIndex!=null&&(a.keyIndex=e.keyIndex>>>0),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}switch(e.deviceType){default:if(typeof e.deviceType=="number"){a.deviceType=e.deviceType;break}break;case"E2EE":case 0:a.deviceType=0;break;case"HOSTED":case 1:a.deviceType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,a.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp,!0):a.longs===Number?ce(e.timestamp,!0):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.keyIndex!=null&&e.hasOwnProperty("keyIndex")&&(A.keyIndex=e.keyIndex,a.oneofs&&(A._keyIndex="keyIndex")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:p.proto.ADVEncryptionType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=a.enums===String?p.proto.ADVEncryptionType[e.deviceType]===void 0?e.deviceType:p.proto.ADVEncryptionType[e.deviceType]:e.deviceType,a.oneofs&&(A._deviceType="deviceType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVDeviceIdentity"},t})(),n.ADVEncryptionType=(function(){let t={},o=Object.create(t);return o[t[0]="E2EE"]=0,o[t[1]="HOSTED"]=1,o})(),n.ADVKeyIndexList=(function(){function t(i){if(this.validIndexes=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.currentIndex=e.uint32();break}case 4:{if(s.validIndexes&&s.validIndexes.length||(s.validIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.currentIndex!=null&&(a.currentIndex=e.currentIndex>>>0),e.validIndexes){if(!Array.isArray(e.validIndexes))throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected");a.validIndexes=[];for(var A=0;A>>0}switch(e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.validIndexes=[]),e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,a.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp,!0):a.longs===Number?ce(e.timestamp,!0):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.currentIndex!=null&&e.hasOwnProperty("currentIndex")&&(A.currentIndex=e.currentIndex,a.oneofs&&(A._currentIndex="currentIndex")),e.validIndexes&&e.validIndexes.length){A.validIndexes=[];for(var r=0;r>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignatureKey=e.bytes();break}case 3:{s.accountSignature=e.bytes();break}case 4:{s.deviceSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVSignedDeviceIdentity)return e;var a=new p.proto.ADVSignedDeviceIdentity;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,a.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(a.accountSignatureKey=e.accountSignatureKey)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,a.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(a.accountSignature=e.accountSignature)),e.deviceSignature!=null&&(typeof e.deviceSignature=="string"?l.base64.decode(e.deviceSignature,a.deviceSignature=l.newBuffer(l.base64.length(e.deviceSignature)),0):e.deviceSignature.length>=0&&(a.deviceSignature=e.deviceSignature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=a.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,a.oneofs&&(A._accountSignatureKey="accountSignatureKey")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=a.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,a.oneofs&&(A._accountSignature="accountSignature")),e.deviceSignature!=null&&e.hasOwnProperty("deviceSignature")&&(A.deviceSignature=a.bytes===String?l.base64.encode(e.deviceSignature,0,e.deviceSignature.length):a.bytes===Array?Array.prototype.slice.call(e.deviceSignature):e.deviceSignature,a.oneofs&&(A._deviceSignature="deviceSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentity"},t})(),n.ADVSignedDeviceIdentityHMAC=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.hmac=e.bytes();break}case 3:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVSignedDeviceIdentityHMAC)return e;var a=new p.proto.ADVSignedDeviceIdentityHMAC;switch(e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.hmac!=null&&(typeof e.hmac=="string"?l.base64.decode(e.hmac,a.hmac=l.newBuffer(l.base64.length(e.hmac)),0):e.hmac.length>=0&&(a.hmac=e.hmac)),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.hmac!=null&&e.hasOwnProperty("hmac")&&(A.hmac=a.bytes===String?l.base64.encode(e.hmac,0,e.hmac.length):a.bytes===Array?Array.prototype.slice.call(e.hmac):e.hmac,a.oneofs&&(A._hmac="hmac")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:p.proto.ADVEncryptionType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentityHMAC"},t})(),n.ADVSignedKeyIndexList=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignature=e.bytes();break}case 3:{s.accountSignatureKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVSignedKeyIndexList)return e;var a=new p.proto.ADVSignedKeyIndexList;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,a.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(a.accountSignature=e.accountSignature)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,a.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(a.accountSignatureKey=e.accountSignatureKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=a.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,a.oneofs&&(A._accountSignature="accountSignature")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=a.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,a.oneofs&&(A._accountSignatureKey="accountSignatureKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedKeyIndexList"},t})(),n.AIHomeState=(function(){function t(i){if(this.capabilityOptions=[],this.conversationOptions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lastFetchTime=e.int64();break}case 2:{s.capabilityOptions&&s.capabilityOptions.length||(s.capabilityOptions=[]),s.capabilityOptions.push(p.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}case 3:{s.conversationOptions&&s.conversationOptions.length||(s.conversationOptions=[]),s.conversationOptions.push(p.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIHomeState)return e;var a=new p.proto.AIHomeState;if(e.lastFetchTime!=null&&(l.Long?(a.lastFetchTime=l.Long.fromValue(e.lastFetchTime)).unsigned=!1:typeof e.lastFetchTime=="string"?a.lastFetchTime=parseInt(e.lastFetchTime,10):typeof e.lastFetchTime=="number"?a.lastFetchTime=e.lastFetchTime:typeof e.lastFetchTime=="object"&&(a.lastFetchTime=new l.LongBits(e.lastFetchTime.low>>>0,e.lastFetchTime.high>>>0).toNumber())),e.capabilityOptions){if(!Array.isArray(e.capabilityOptions))throw TypeError(".proto.AIHomeState.capabilityOptions: array expected");a.capabilityOptions=[];for(var A=0;A>>3){case 1:{c.type=A.int32();break}case 2:{c.title=A.string();break}case 3:{c.promptText=A.string();break}case 4:{c.sessionId=A.string();break}case 5:{c.imageWdsIdentifier=A.string();break}case 6:{c.imageTintColor=A.string();break}case 7:{c.imageBackgroundColor=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIHomeState.AIHomeOption)return A;var r=new p.proto.AIHomeState.AIHomeOption;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PROMPT":case 0:r.type=0;break;case"CREATE_IMAGE":case 1:r.type=1;break;case"ANIMATE_PHOTO":case 2:r.type=2;break;case"ANALYZE_FILE":case 3:r.type=3;break}return A.title!=null&&(r.title=String(A.title)),A.promptText!=null&&(r.promptText=String(A.promptText)),A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.imageWdsIdentifier!=null&&(r.imageWdsIdentifier=String(A.imageWdsIdentifier)),A.imageTintColor!=null&&(r.imageTintColor=String(A.imageTintColor)),A.imageBackgroundColor!=null&&(r.imageBackgroundColor=String(A.imageBackgroundColor)),r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]===void 0?A.type:p.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]:A.type,r.oneofs&&(s._type="type")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.promptText!=null&&A.hasOwnProperty("promptText")&&(s.promptText=A.promptText,r.oneofs&&(s._promptText="promptText")),A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.imageWdsIdentifier!=null&&A.hasOwnProperty("imageWdsIdentifier")&&(s.imageWdsIdentifier=A.imageWdsIdentifier,r.oneofs&&(s._imageWdsIdentifier="imageWdsIdentifier")),A.imageTintColor!=null&&A.hasOwnProperty("imageTintColor")&&(s.imageTintColor=A.imageTintColor,r.oneofs&&(s._imageTintColor="imageTintColor")),A.imageBackgroundColor!=null&&A.hasOwnProperty("imageBackgroundColor")&&(s.imageBackgroundColor=A.imageBackgroundColor,r.oneofs&&(s._imageBackgroundColor="imageBackgroundColor")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIHomeState.AIHomeOption"},i.AIHomeActionType=(function(){let a={},A=Object.create(a);return A[a[0]="PROMPT"]=0,A[a[1]="CREATE_IMAGE"]=1,A[a[2]="ANIMATE_PHOTO"]=2,A[a[3]="ANALYZE_FILE"]=3,A})(),i})(),t})(),n.AIQueryFanout=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.timestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIQueryFanout)return e;var a=new p.proto.AIQueryFanout;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIQueryFanout.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.AIQueryFanout.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIQueryFanout"},t})(),n.AIRegenerateMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.responseTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRegenerateMetadata)return e;var a=new p.proto.AIRegenerateMetadata;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIRegenerateMetadata.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}return e.responseTimestampMs!=null&&(l.Long?(a.responseTimestampMs=l.Long.fromValue(e.responseTimestampMs)).unsigned=!1:typeof e.responseTimestampMs=="string"?a.responseTimestampMs=parseInt(e.responseTimestampMs,10):typeof e.responseTimestampMs=="number"?a.responseTimestampMs=e.responseTimestampMs:typeof e.responseTimestampMs=="object"&&(a.responseTimestampMs=new l.LongBits(e.responseTimestampMs.low>>>0,e.responseTimestampMs.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.responseTimestampMs!=null&&e.hasOwnProperty("responseTimestampMs")&&(typeof e.responseTimestampMs=="number"?A.responseTimestampMs=a.longs===String?String(e.responseTimestampMs):e.responseTimestampMs:A.responseTimestampMs=a.longs===String?ge(e.responseTimestampMs):a.longs===Number?ce(e.responseTimestampMs):e.responseTimestampMs,a.oneofs&&(A._responseTimestampMs="responseTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRegenerateMetadata"},t})(),n.AIRichResponseCodeMetadata=(function(){function t(i){if(this.codeBlocks=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.codeLanguage=e.string();break}case 2:{s.codeBlocks&&s.codeBlocks.length||(s.codeBlocks=[]),s.codeBlocks.push(p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseCodeMetadata)return e;var a=new p.proto.AIRichResponseCodeMetadata;if(e.codeLanguage!=null&&(a.codeLanguage=String(e.codeLanguage)),e.codeBlocks){if(!Array.isArray(e.codeBlocks))throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: array expected");a.codeBlocks=[];for(var A=0;A>>3){case 1:{c.highlightType=A.int32();break}case 2:{c.codeContent=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock)return A;var r=new p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock;switch(A.highlightType){default:if(typeof A.highlightType=="number"){r.highlightType=A.highlightType;break}break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT":case 0:r.highlightType=0;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD":case 1:r.highlightType=1;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD":case 2:r.highlightType=2;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING":case 3:r.highlightType=3;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER":case 4:r.highlightType=4;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT":case 5:r.highlightType=5;break}return A.codeContent!=null&&(r.codeContent=String(A.codeContent)),r},i.toObject=function(A,r){r||(r={});var s={};return A.highlightType!=null&&A.hasOwnProperty("highlightType")&&(s.highlightType=r.enums===String?p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]===void 0?A.highlightType:p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]:A.highlightType,r.oneofs&&(s._highlightType="highlightType")),A.codeContent!=null&&A.hasOwnProperty("codeContent")&&(s.codeContent=A.codeContent,r.oneofs&&(s._codeContent="codeContent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock"},i})(),t.AIRichResponseCodeHighlightType=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT"]=0,e[i[1]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD"]=1,e[i[2]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD"]=2,e[i[3]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING"]=3,e[i[4]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER"]=4,e[i[5]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT"]=5,e})(),t})(),n.AIRichResponseContentItemsMetadata=(function(){function t(i){if(this.itemsMetadata=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.itemsMetadata&&s.itemsMetadata.length||(s.itemsMetadata=[]),s.itemsMetadata.push(p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.decode(e,e.uint32()));break}case 2:{s.contentType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseContentItemsMetadata)return e;var a=new p.proto.AIRichResponseContentItemsMetadata;if(e.itemsMetadata){if(!Array.isArray(e.itemsMetadata))throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: array expected");a.itemsMetadata=[];for(var A=0;A>>3){case 1:{c.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata)return A;var r=new p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata;if(A.reelItem!=null){if(typeof A.reelItem!="object")throw TypeError(".proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected");r.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(A.reelItem)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.reelItem!=null&&A.hasOwnProperty("reelItem")&&(s.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(A.reelItem,r),r.oneofs&&(s.aIRichResponseContentItem="reelItem")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata"},i})(),t.AIRichResponseReelItem=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.profileIconUrl=A.string();break}case 3:{c.thumbnailUrl=A.string();break}case 4:{c.videoUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem)return A;var r=new p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem;return A.title!=null&&(r.title=String(A.title)),A.profileIconUrl!=null&&(r.profileIconUrl=String(A.profileIconUrl)),A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.videoUrl!=null&&(r.videoUrl=String(A.videoUrl)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.profileIconUrl!=null&&A.hasOwnProperty("profileIconUrl")&&(s.profileIconUrl=A.profileIconUrl,r.oneofs&&(s._profileIconUrl="profileIconUrl")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.videoUrl!=null&&A.hasOwnProperty("videoUrl")&&(s.videoUrl=A.videoUrl,r.oneofs&&(s._videoUrl="videoUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem"},i})(),t.ContentType=(function(){let i={},e=Object.create(i);return e[i[0]="DEFAULT"]=0,e[i[1]="CAROUSEL"]=1,e})(),t})(),n.AIRichResponseDynamicMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.version=e.uint64();break}case 3:{s.url=e.string();break}case 4:{s.loopCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseDynamicMetadata)return e;var a=new p.proto.AIRichResponseDynamicMetadata;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN":case 0:a.type=0;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE":case 1:a.type=1;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF":case 2:a.type=2;break}return e.version!=null&&(l.Long?(a.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?a.version=parseInt(e.version,10):typeof e.version=="number"?a.version=e.version:typeof e.version=="object"&&(a.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),e.url!=null&&(a.url=String(e.url)),e.loopCount!=null&&(a.loopCount=e.loopCount>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]===void 0?e.type:p.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]:e.type,a.oneofs&&(A._type="type")),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=a.longs===String?String(e.version):e.version:A.version=a.longs===String?ge(e.version,!0):a.longs===Number?ce(e.version,!0):e.version,a.oneofs&&(A._version="version")),e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.loopCount!=null&&e.hasOwnProperty("loopCount")&&(A.loopCount=e.loopCount,a.oneofs&&(A._loopCount="loopCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseDynamicMetadata"},t.AIRichResponseDynamicMetadataType=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN"]=0,e[i[1]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE"]=1,e[i[2]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF"]=2,e})(),t})(),n.AIRichResponseGridImageMetadata=(function(){function t(i){if(this.imageUrls=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.gridImageUrl=p.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageUrls&&s.imageUrls.length||(s.imageUrls=[]),s.imageUrls.push(p.proto.AIRichResponseImageURL.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseGridImageMetadata)return e;var a=new p.proto.AIRichResponseGridImageMetadata;if(e.gridImageUrl!=null){if(typeof e.gridImageUrl!="object")throw TypeError(".proto.AIRichResponseGridImageMetadata.gridImageUrl: object expected");a.gridImageUrl=p.proto.AIRichResponseImageURL.fromObject(e.gridImageUrl)}if(e.imageUrls){if(!Array.isArray(e.imageUrls))throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: array expected");a.imageUrls=[];for(var A=0;A>>3){case 1:{s.imagePreviewUrl=e.string();break}case 2:{s.imageHighResUrl=e.string();break}case 3:{s.sourceUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseImageURL)return e;var a=new p.proto.AIRichResponseImageURL;return e.imagePreviewUrl!=null&&(a.imagePreviewUrl=String(e.imagePreviewUrl)),e.imageHighResUrl!=null&&(a.imageHighResUrl=String(e.imageHighResUrl)),e.sourceUrl!=null&&(a.sourceUrl=String(e.sourceUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.imagePreviewUrl!=null&&e.hasOwnProperty("imagePreviewUrl")&&(A.imagePreviewUrl=e.imagePreviewUrl,a.oneofs&&(A._imagePreviewUrl="imagePreviewUrl")),e.imageHighResUrl!=null&&e.hasOwnProperty("imageHighResUrl")&&(A.imageHighResUrl=e.imageHighResUrl,a.oneofs&&(A._imageHighResUrl="imageHighResUrl")),e.sourceUrl!=null&&e.hasOwnProperty("sourceUrl")&&(A.sourceUrl=e.sourceUrl,a.oneofs&&(A._sourceUrl="sourceUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseImageURL"},t})(),n.AIRichResponseInlineImageMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.imageUrl=p.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageText=e.string();break}case 3:{s.alignment=e.int32();break}case 4:{s.tapLinkUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseInlineImageMetadata)return e;var a=new p.proto.AIRichResponseInlineImageMetadata;if(e.imageUrl!=null){if(typeof e.imageUrl!="object")throw TypeError(".proto.AIRichResponseInlineImageMetadata.imageUrl: object expected");a.imageUrl=p.proto.AIRichResponseImageURL.fromObject(e.imageUrl)}switch(e.imageText!=null&&(a.imageText=String(e.imageText)),e.alignment){default:if(typeof e.alignment=="number"){a.alignment=e.alignment;break}break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED":case 0:a.alignment=0;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED":case 1:a.alignment=1;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED":case 2:a.alignment=2;break}return e.tapLinkUrl!=null&&(a.tapLinkUrl=String(e.tapLinkUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.imageUrl!=null&&e.hasOwnProperty("imageUrl")&&(A.imageUrl=p.proto.AIRichResponseImageURL.toObject(e.imageUrl,a),a.oneofs&&(A._imageUrl="imageUrl")),e.imageText!=null&&e.hasOwnProperty("imageText")&&(A.imageText=e.imageText,a.oneofs&&(A._imageText="imageText")),e.alignment!=null&&e.hasOwnProperty("alignment")&&(A.alignment=a.enums===String?p.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]===void 0?e.alignment:p.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]:e.alignment,a.oneofs&&(A._alignment="alignment")),e.tapLinkUrl!=null&&e.hasOwnProperty("tapLinkUrl")&&(A.tapLinkUrl=e.tapLinkUrl,a.oneofs&&(A._tapLinkUrl="tapLinkUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseInlineImageMetadata"},t.AIRichResponseImageAlignment=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED"]=0,e[i[1]="AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED"]=1,e[i[2]="AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED"]=2,e})(),t})(),n.AIRichResponseLatexMetadata=(function(){function t(i){if(this.expressions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.text=e.string();break}case 2:{s.expressions&&s.expressions.length||(s.expressions=[]),s.expressions.push(p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseLatexMetadata)return e;var a=new p.proto.AIRichResponseLatexMetadata;if(e.text!=null&&(a.text=String(e.text)),e.expressions){if(!Array.isArray(e.expressions))throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: array expected");a.expressions=[];for(var A=0;A>>3){case 1:{c.latexExpression=A.string();break}case 2:{c.url=A.string();break}case 3:{c.width=A.double();break}case 4:{c.height=A.double();break}case 5:{c.fontHeight=A.double();break}case 6:{c.imageTopPadding=A.double();break}case 7:{c.imageLeadingPadding=A.double();break}case 8:{c.imageBottomPadding=A.double();break}case 9:{c.imageTrailingPadding=A.double();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression)return A;var r=new p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression;return A.latexExpression!=null&&(r.latexExpression=String(A.latexExpression)),A.url!=null&&(r.url=String(A.url)),A.width!=null&&(r.width=Number(A.width)),A.height!=null&&(r.height=Number(A.height)),A.fontHeight!=null&&(r.fontHeight=Number(A.fontHeight)),A.imageTopPadding!=null&&(r.imageTopPadding=Number(A.imageTopPadding)),A.imageLeadingPadding!=null&&(r.imageLeadingPadding=Number(A.imageLeadingPadding)),A.imageBottomPadding!=null&&(r.imageBottomPadding=Number(A.imageBottomPadding)),A.imageTrailingPadding!=null&&(r.imageTrailingPadding=Number(A.imageTrailingPadding)),r},i.toObject=function(A,r){r||(r={});var s={};return A.latexExpression!=null&&A.hasOwnProperty("latexExpression")&&(s.latexExpression=A.latexExpression,r.oneofs&&(s._latexExpression="latexExpression")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=r.json&&!isFinite(A.width)?String(A.width):A.width,r.oneofs&&(s._width="width")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=r.json&&!isFinite(A.height)?String(A.height):A.height,r.oneofs&&(s._height="height")),A.fontHeight!=null&&A.hasOwnProperty("fontHeight")&&(s.fontHeight=r.json&&!isFinite(A.fontHeight)?String(A.fontHeight):A.fontHeight,r.oneofs&&(s._fontHeight="fontHeight")),A.imageTopPadding!=null&&A.hasOwnProperty("imageTopPadding")&&(s.imageTopPadding=r.json&&!isFinite(A.imageTopPadding)?String(A.imageTopPadding):A.imageTopPadding,r.oneofs&&(s._imageTopPadding="imageTopPadding")),A.imageLeadingPadding!=null&&A.hasOwnProperty("imageLeadingPadding")&&(s.imageLeadingPadding=r.json&&!isFinite(A.imageLeadingPadding)?String(A.imageLeadingPadding):A.imageLeadingPadding,r.oneofs&&(s._imageLeadingPadding="imageLeadingPadding")),A.imageBottomPadding!=null&&A.hasOwnProperty("imageBottomPadding")&&(s.imageBottomPadding=r.json&&!isFinite(A.imageBottomPadding)?String(A.imageBottomPadding):A.imageBottomPadding,r.oneofs&&(s._imageBottomPadding="imageBottomPadding")),A.imageTrailingPadding!=null&&A.hasOwnProperty("imageTrailingPadding")&&(s.imageTrailingPadding=r.json&&!isFinite(A.imageTrailingPadding)?String(A.imageTrailingPadding):A.imageTrailingPadding,r.oneofs&&(s._imageTrailingPadding="imageTrailingPadding")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression"},i})(),t})(),n.AIRichResponseMapMetadata=(function(){function t(i){if(this.annotations=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.centerLatitude=e.double();break}case 2:{s.centerLongitude=e.double();break}case 3:{s.latitudeDelta=e.double();break}case 4:{s.longitudeDelta=e.double();break}case 5:{s.annotations&&s.annotations.length||(s.annotations=[]),s.annotations.push(p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.decode(e,e.uint32()));break}case 6:{s.showInfoList=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseMapMetadata)return e;var a=new p.proto.AIRichResponseMapMetadata;if(e.centerLatitude!=null&&(a.centerLatitude=Number(e.centerLatitude)),e.centerLongitude!=null&&(a.centerLongitude=Number(e.centerLongitude)),e.latitudeDelta!=null&&(a.latitudeDelta=Number(e.latitudeDelta)),e.longitudeDelta!=null&&(a.longitudeDelta=Number(e.longitudeDelta)),e.annotations){if(!Array.isArray(e.annotations))throw TypeError(".proto.AIRichResponseMapMetadata.annotations: array expected");a.annotations=[];for(var A=0;A>>3){case 1:{c.annotationNumber=A.uint32();break}case 2:{c.latitude=A.double();break}case 3:{c.longitude=A.double();break}case 4:{c.title=A.string();break}case 5:{c.body=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation)return A;var r=new p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation;return A.annotationNumber!=null&&(r.annotationNumber=A.annotationNumber>>>0),A.latitude!=null&&(r.latitude=Number(A.latitude)),A.longitude!=null&&(r.longitude=Number(A.longitude)),A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),r},i.toObject=function(A,r){r||(r={});var s={};return A.annotationNumber!=null&&A.hasOwnProperty("annotationNumber")&&(s.annotationNumber=A.annotationNumber,r.oneofs&&(s._annotationNumber="annotationNumber")),A.latitude!=null&&A.hasOwnProperty("latitude")&&(s.latitude=r.json&&!isFinite(A.latitude)?String(A.latitude):A.latitude,r.oneofs&&(s._latitude="latitude")),A.longitude!=null&&A.hasOwnProperty("longitude")&&(s.longitude=r.json&&!isFinite(A.longitude)?String(A.longitude):A.longitude,r.oneofs&&(s._longitude="longitude")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation"},i})(),t})(),n.AIRichResponseMessage=(function(){function t(i){if(this.submessages=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageType=e.int32();break}case 2:{s.submessages&&s.submessages.length||(s.submessages=[]),s.submessages.push(p.proto.AIRichResponseSubMessage.decode(e,e.uint32()));break}case 3:{s.unifiedResponse=p.proto.AIRichResponseUnifiedResponse.decode(e,e.uint32());break}case 4:{s.contextInfo=p.proto.ContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseMessage)return e;var a=new p.proto.AIRichResponseMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){a.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_TYPE_UNKNOWN":case 0:a.messageType=0;break;case"AI_RICH_RESPONSE_TYPE_STANDARD":case 1:a.messageType=1;break}if(e.submessages){if(!Array.isArray(e.submessages))throw TypeError(".proto.AIRichResponseMessage.submessages: array expected");a.submessages=[];for(var A=0;A>>3){case 1:{s.messageType=e.int32();break}case 2:{s.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.decode(e,e.uint32());break}case 3:{s.messageText=e.string();break}case 4:{s.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.decode(e,e.uint32());break}case 5:{s.codeMetadata=p.proto.AIRichResponseCodeMetadata.decode(e,e.uint32());break}case 6:{s.tableMetadata=p.proto.AIRichResponseTableMetadata.decode(e,e.uint32());break}case 7:{s.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.decode(e,e.uint32());break}case 8:{s.latexMetadata=p.proto.AIRichResponseLatexMetadata.decode(e,e.uint32());break}case 9:{s.mapMetadata=p.proto.AIRichResponseMapMetadata.decode(e,e.uint32());break}case 10:{s.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseSubMessage)return e;var a=new p.proto.AIRichResponseSubMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){a.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_UNKNOWN":case 0:a.messageType=0;break;case"AI_RICH_RESPONSE_GRID_IMAGE":case 1:a.messageType=1;break;case"AI_RICH_RESPONSE_TEXT":case 2:a.messageType=2;break;case"AI_RICH_RESPONSE_INLINE_IMAGE":case 3:a.messageType=3;break;case"AI_RICH_RESPONSE_TABLE":case 4:a.messageType=4;break;case"AI_RICH_RESPONSE_CODE":case 5:a.messageType=5;break;case"AI_RICH_RESPONSE_DYNAMIC":case 6:a.messageType=6;break;case"AI_RICH_RESPONSE_MAP":case 7:a.messageType=7;break;case"AI_RICH_RESPONSE_LATEX":case 8:a.messageType=8;break;case"AI_RICH_RESPONSE_CONTENT_ITEMS":case 9:a.messageType=9;break}if(e.gridImageMetadata!=null){if(typeof e.gridImageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.gridImageMetadata: object expected");a.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.fromObject(e.gridImageMetadata)}if(e.messageText!=null&&(a.messageText=String(e.messageText)),e.imageMetadata!=null){if(typeof e.imageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.imageMetadata: object expected");a.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.fromObject(e.imageMetadata)}if(e.codeMetadata!=null){if(typeof e.codeMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.codeMetadata: object expected");a.codeMetadata=p.proto.AIRichResponseCodeMetadata.fromObject(e.codeMetadata)}if(e.tableMetadata!=null){if(typeof e.tableMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.tableMetadata: object expected");a.tableMetadata=p.proto.AIRichResponseTableMetadata.fromObject(e.tableMetadata)}if(e.dynamicMetadata!=null){if(typeof e.dynamicMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.dynamicMetadata: object expected");a.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.fromObject(e.dynamicMetadata)}if(e.latexMetadata!=null){if(typeof e.latexMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.latexMetadata: object expected");a.latexMetadata=p.proto.AIRichResponseLatexMetadata.fromObject(e.latexMetadata)}if(e.mapMetadata!=null){if(typeof e.mapMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.mapMetadata: object expected");a.mapMetadata=p.proto.AIRichResponseMapMetadata.fromObject(e.mapMetadata)}if(e.contentItemsMetadata!=null){if(typeof e.contentItemsMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.contentItemsMetadata: object expected");a.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.fromObject(e.contentItemsMetadata)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageType!=null&&e.hasOwnProperty("messageType")&&(A.messageType=a.enums===String?p.proto.AIRichResponseSubMessageType[e.messageType]===void 0?e.messageType:p.proto.AIRichResponseSubMessageType[e.messageType]:e.messageType,a.oneofs&&(A._messageType="messageType")),e.gridImageMetadata!=null&&e.hasOwnProperty("gridImageMetadata")&&(A.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.toObject(e.gridImageMetadata,a),a.oneofs&&(A._gridImageMetadata="gridImageMetadata")),e.messageText!=null&&e.hasOwnProperty("messageText")&&(A.messageText=e.messageText,a.oneofs&&(A._messageText="messageText")),e.imageMetadata!=null&&e.hasOwnProperty("imageMetadata")&&(A.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.toObject(e.imageMetadata,a),a.oneofs&&(A._imageMetadata="imageMetadata")),e.codeMetadata!=null&&e.hasOwnProperty("codeMetadata")&&(A.codeMetadata=p.proto.AIRichResponseCodeMetadata.toObject(e.codeMetadata,a),a.oneofs&&(A._codeMetadata="codeMetadata")),e.tableMetadata!=null&&e.hasOwnProperty("tableMetadata")&&(A.tableMetadata=p.proto.AIRichResponseTableMetadata.toObject(e.tableMetadata,a),a.oneofs&&(A._tableMetadata="tableMetadata")),e.dynamicMetadata!=null&&e.hasOwnProperty("dynamicMetadata")&&(A.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.toObject(e.dynamicMetadata,a),a.oneofs&&(A._dynamicMetadata="dynamicMetadata")),e.latexMetadata!=null&&e.hasOwnProperty("latexMetadata")&&(A.latexMetadata=p.proto.AIRichResponseLatexMetadata.toObject(e.latexMetadata,a),a.oneofs&&(A._latexMetadata="latexMetadata")),e.mapMetadata!=null&&e.hasOwnProperty("mapMetadata")&&(A.mapMetadata=p.proto.AIRichResponseMapMetadata.toObject(e.mapMetadata,a),a.oneofs&&(A._mapMetadata="mapMetadata")),e.contentItemsMetadata!=null&&e.hasOwnProperty("contentItemsMetadata")&&(A.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.toObject(e.contentItemsMetadata,a),a.oneofs&&(A._contentItemsMetadata="contentItemsMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseSubMessage"},t})(),n.AIRichResponseSubMessageType=(function(){let t={},o=Object.create(t);return o[t[0]="AI_RICH_RESPONSE_UNKNOWN"]=0,o[t[1]="AI_RICH_RESPONSE_GRID_IMAGE"]=1,o[t[2]="AI_RICH_RESPONSE_TEXT"]=2,o[t[3]="AI_RICH_RESPONSE_INLINE_IMAGE"]=3,o[t[4]="AI_RICH_RESPONSE_TABLE"]=4,o[t[5]="AI_RICH_RESPONSE_CODE"]=5,o[t[6]="AI_RICH_RESPONSE_DYNAMIC"]=6,o[t[7]="AI_RICH_RESPONSE_MAP"]=7,o[t[8]="AI_RICH_RESPONSE_LATEX"]=8,o[t[9]="AI_RICH_RESPONSE_CONTENT_ITEMS"]=9,o})(),n.AIRichResponseTableMetadata=(function(){function t(i){if(this.rows=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rows&&s.rows.length||(s.rows=[]),s.rows.push(p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.decode(e,e.uint32()));break}case 2:{s.title=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseTableMetadata)return e;var a=new p.proto.AIRichResponseTableMetadata;if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".proto.AIRichResponseTableMetadata.rows: array expected");a.rows=[];for(var A=0;A>>3){case 1:{c.items&&c.items.length||(c.items=[]),c.items.push(A.string());break}case 2:{c.isHeading=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow)return A;var r=new p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow;if(A.items){if(!Array.isArray(A.items))throw TypeError(".proto.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected");r.items=[];for(var s=0;s>>3){case 1:{s.data=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseUnifiedResponse)return e;var a=new p.proto.AIRichResponseUnifiedResponse;return e.data!=null&&(typeof e.data=="string"?l.base64.decode(e.data,a.data=l.newBuffer(l.base64.length(e.data)),0):e.data.length>=0&&(a.data=e.data)),a},t.toObject=function(e,a){a||(a={});var A={};return e.data!=null&&e.hasOwnProperty("data")&&(A.data=a.bytes===String?l.base64.encode(e.data,0,e.data.length):a.bytes===Array?Array.prototype.slice.call(e.data):e.data,a.oneofs&&(A._data="data")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseUnifiedResponse"},t})(),n.AIThreadInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.decode(e,e.uint32());break}case 2:{s.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIThreadInfo)return e;var a=new p.proto.AIThreadInfo;if(e.serverInfo!=null){if(typeof e.serverInfo!="object")throw TypeError(".proto.AIThreadInfo.serverInfo: object expected");a.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.fromObject(e.serverInfo)}if(e.clientInfo!=null){if(typeof e.clientInfo!="object")throw TypeError(".proto.AIThreadInfo.clientInfo: object expected");a.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.fromObject(e.clientInfo)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.serverInfo!=null&&e.hasOwnProperty("serverInfo")&&(A.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.toObject(e.serverInfo,a),a.oneofs&&(A._serverInfo="serverInfo")),e.clientInfo!=null&&e.hasOwnProperty("clientInfo")&&(A.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.toObject(e.clientInfo,a),a.oneofs&&(A._clientInfo="clientInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIThreadInfo"},t.AIThreadClientInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIThreadInfo.AIThreadClientInfo)return A;var r=new p.proto.AIThreadInfo.AIThreadClientInfo;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DEFAULT":case 1:r.type=1;break;case"INCOGNITO":case 2:r.type=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]===void 0?A.type:p.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadClientInfo"},i.AIThreadType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="DEFAULT"]=1,A[a[2]="INCOGNITO"]=2,A})(),i})(),t.AIThreadServerInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIThreadInfo.AIThreadServerInfo)return A;var r=new p.proto.AIThreadInfo.AIThreadServerInfo;return A.title!=null&&(r.title=String(A.title)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadServerInfo"},i})(),t})(),n.Account=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lid=e.string();break}case 2:{s.username=e.string();break}case 3:{s.countryCode=e.string();break}case 4:{s.isUsernameDeleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Account)return e;var a=new p.proto.Account;return e.lid!=null&&(a.lid=String(e.lid)),e.username!=null&&(a.username=String(e.username)),e.countryCode!=null&&(a.countryCode=String(e.countryCode)),e.isUsernameDeleted!=null&&(a.isUsernameDeleted=!!e.isUsernameDeleted),a},t.toObject=function(e,a){a||(a={});var A={};return e.lid!=null&&e.hasOwnProperty("lid")&&(A.lid=e.lid,a.oneofs&&(A._lid="lid")),e.username!=null&&e.hasOwnProperty("username")&&(A.username=e.username,a.oneofs&&(A._username="username")),e.countryCode!=null&&e.hasOwnProperty("countryCode")&&(A.countryCode=e.countryCode,a.oneofs&&(A._countryCode="countryCode")),e.isUsernameDeleted!=null&&e.hasOwnProperty("isUsernameDeleted")&&(A.isUsernameDeleted=e.isUsernameDeleted,a.oneofs&&(A._isUsernameDeleted="isUsernameDeleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Account"},t})(),n.ActionLink=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.url=e.string();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ActionLink)return e;var a=new p.proto.ActionLink;return e.url!=null&&(a.url=String(e.url)),e.buttonTitle!=null&&(a.buttonTitle=String(e.buttonTitle)),a},t.toObject=function(e,a){a||(a={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,a.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ActionLink"},t})(),n.AutoDownloadSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.downloadImages=e.bool();break}case 2:{s.downloadAudio=e.bool();break}case 3:{s.downloadVideo=e.bool();break}case 4:{s.downloadDocuments=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AutoDownloadSettings)return e;var a=new p.proto.AutoDownloadSettings;return e.downloadImages!=null&&(a.downloadImages=!!e.downloadImages),e.downloadAudio!=null&&(a.downloadAudio=!!e.downloadAudio),e.downloadVideo!=null&&(a.downloadVideo=!!e.downloadVideo),e.downloadDocuments!=null&&(a.downloadDocuments=!!e.downloadDocuments),a},t.toObject=function(e,a){a||(a={});var A={};return e.downloadImages!=null&&e.hasOwnProperty("downloadImages")&&(A.downloadImages=e.downloadImages,a.oneofs&&(A._downloadImages="downloadImages")),e.downloadAudio!=null&&e.hasOwnProperty("downloadAudio")&&(A.downloadAudio=e.downloadAudio,a.oneofs&&(A._downloadAudio="downloadAudio")),e.downloadVideo!=null&&e.hasOwnProperty("downloadVideo")&&(A.downloadVideo=e.downloadVideo,a.oneofs&&(A._downloadVideo="downloadVideo")),e.downloadDocuments!=null&&e.hasOwnProperty("downloadDocuments")&&(A.downloadDocuments=e.downloadDocuments,a.oneofs&&(A._downloadDocuments="downloadDocuments")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AutoDownloadSettings"},t})(),n.AvatarUserSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.fbid=e.string();break}case 2:{s.password=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AvatarUserSettings)return e;var a=new p.proto.AvatarUserSettings;return e.fbid!=null&&(a.fbid=String(e.fbid)),e.password!=null&&(a.password=String(e.password)),a},t.toObject=function(e,a){a||(a={});var A={};return e.fbid!=null&&e.hasOwnProperty("fbid")&&(A.fbid=e.fbid,a.oneofs&&(A._fbid="fbid")),e.password!=null&&e.hasOwnProperty("password")&&(A.password=e.password,a.oneofs&&(A._password="password")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AvatarUserSettings"},t})(),n.BizAccountLinkInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.whatsappBizAcctFbid=e.uint64();break}case 2:{s.whatsappAcctNumber=e.string();break}case 3:{s.issueTime=e.uint64();break}case 4:{s.hostStorage=e.int32();break}case 5:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BizAccountLinkInfo)return e;var a=new p.proto.BizAccountLinkInfo;switch(e.whatsappBizAcctFbid!=null&&(l.Long?(a.whatsappBizAcctFbid=l.Long.fromValue(e.whatsappBizAcctFbid)).unsigned=!0:typeof e.whatsappBizAcctFbid=="string"?a.whatsappBizAcctFbid=parseInt(e.whatsappBizAcctFbid,10):typeof e.whatsappBizAcctFbid=="number"?a.whatsappBizAcctFbid=e.whatsappBizAcctFbid:typeof e.whatsappBizAcctFbid=="object"&&(a.whatsappBizAcctFbid=new l.LongBits(e.whatsappBizAcctFbid.low>>>0,e.whatsappBizAcctFbid.high>>>0).toNumber(!0))),e.whatsappAcctNumber!=null&&(a.whatsappAcctNumber=String(e.whatsappAcctNumber)),e.issueTime!=null&&(l.Long?(a.issueTime=l.Long.fromValue(e.issueTime)).unsigned=!0:typeof e.issueTime=="string"?a.issueTime=parseInt(e.issueTime,10):typeof e.issueTime=="number"?a.issueTime=e.issueTime:typeof e.issueTime=="object"&&(a.issueTime=new l.LongBits(e.issueTime.low>>>0,e.issueTime.high>>>0).toNumber(!0))),e.hostStorage){default:if(typeof e.hostStorage=="number"){a.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:a.hostStorage=0;break;case"FACEBOOK":case 1:a.hostStorage=1;break}switch(e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"ENTERPRISE":case 0:a.accountType=0;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.whatsappBizAcctFbid!=null&&e.hasOwnProperty("whatsappBizAcctFbid")&&(typeof e.whatsappBizAcctFbid=="number"?A.whatsappBizAcctFbid=a.longs===String?String(e.whatsappBizAcctFbid):e.whatsappBizAcctFbid:A.whatsappBizAcctFbid=a.longs===String?ge(e.whatsappBizAcctFbid,!0):a.longs===Number?ce(e.whatsappBizAcctFbid,!0):e.whatsappBizAcctFbid,a.oneofs&&(A._whatsappBizAcctFbid="whatsappBizAcctFbid")),e.whatsappAcctNumber!=null&&e.hasOwnProperty("whatsappAcctNumber")&&(A.whatsappAcctNumber=e.whatsappAcctNumber,a.oneofs&&(A._whatsappAcctNumber="whatsappAcctNumber")),e.issueTime!=null&&e.hasOwnProperty("issueTime")&&(typeof e.issueTime=="number"?A.issueTime=a.longs===String?String(e.issueTime):e.issueTime:A.issueTime=a.longs===String?ge(e.issueTime,!0):a.longs===Number?ce(e.issueTime,!0):e.issueTime,a.oneofs&&(A._issueTime="issueTime")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=a.enums===String?p.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:p.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]:e.hostStorage,a.oneofs&&(A._hostStorage="hostStorage")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.BizAccountLinkInfo.AccountType[e.accountType]===void 0?e.accountType:p.proto.BizAccountLinkInfo.AccountType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountLinkInfo"},t.AccountType=(function(){let i={},e=Object.create(i);return e[i[0]="ENTERPRISE"]=0,e})(),t.HostStorageType=(function(){let i={},e=Object.create(i);return e[i[0]="ON_PREMISE"]=0,e[i[1]="FACEBOOK"]=1,e})(),t})(),n.BizAccountPayload=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.vnameCert=p.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 2:{s.bizAcctLinkInfo=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BizAccountPayload)return e;var a=new p.proto.BizAccountPayload;if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizAccountPayload.vnameCert: object expected");a.vnameCert=p.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}return e.bizAcctLinkInfo!=null&&(typeof e.bizAcctLinkInfo=="string"?l.base64.decode(e.bizAcctLinkInfo,a.bizAcctLinkInfo=l.newBuffer(l.base64.length(e.bizAcctLinkInfo)),0):e.bizAcctLinkInfo.length>=0&&(a.bizAcctLinkInfo=e.bizAcctLinkInfo)),a},t.toObject=function(e,a){a||(a={});var A={};return e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=p.proto.VerifiedNameCertificate.toObject(e.vnameCert,a),a.oneofs&&(A._vnameCert="vnameCert")),e.bizAcctLinkInfo!=null&&e.hasOwnProperty("bizAcctLinkInfo")&&(A.bizAcctLinkInfo=a.bytes===String?l.base64.encode(e.bizAcctLinkInfo,0,e.bizAcctLinkInfo.length):a.bytes===Array?Array.prototype.slice.call(e.bizAcctLinkInfo):e.bizAcctLinkInfo,a.oneofs&&(A._bizAcctLinkInfo="bizAcctLinkInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountPayload"},t})(),n.BizIdentityInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.vlevel=e.int32();break}case 2:{s.vnameCert=p.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 3:{s.signed=e.bool();break}case 4:{s.revoked=e.bool();break}case 5:{s.hostStorage=e.int32();break}case 6:{s.actualActors=e.int32();break}case 7:{s.privacyModeTs=e.uint64();break}case 8:{s.featureControls=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BizIdentityInfo)return e;var a=new p.proto.BizIdentityInfo;switch(e.vlevel){default:if(typeof e.vlevel=="number"){a.vlevel=e.vlevel;break}break;case"UNKNOWN":case 0:a.vlevel=0;break;case"LOW":case 1:a.vlevel=1;break;case"HIGH":case 2:a.vlevel=2;break}if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected");a.vnameCert=p.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}switch(e.signed!=null&&(a.signed=!!e.signed),e.revoked!=null&&(a.revoked=!!e.revoked),e.hostStorage){default:if(typeof e.hostStorage=="number"){a.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:a.hostStorage=0;break;case"FACEBOOK":case 1:a.hostStorage=1;break}switch(e.actualActors){default:if(typeof e.actualActors=="number"){a.actualActors=e.actualActors;break}break;case"SELF":case 0:a.actualActors=0;break;case"BSP":case 1:a.actualActors=1;break}return e.privacyModeTs!=null&&(l.Long?(a.privacyModeTs=l.Long.fromValue(e.privacyModeTs)).unsigned=!0:typeof e.privacyModeTs=="string"?a.privacyModeTs=parseInt(e.privacyModeTs,10):typeof e.privacyModeTs=="number"?a.privacyModeTs=e.privacyModeTs:typeof e.privacyModeTs=="object"&&(a.privacyModeTs=new l.LongBits(e.privacyModeTs.low>>>0,e.privacyModeTs.high>>>0).toNumber(!0))),e.featureControls!=null&&(l.Long?(a.featureControls=l.Long.fromValue(e.featureControls)).unsigned=!0:typeof e.featureControls=="string"?a.featureControls=parseInt(e.featureControls,10):typeof e.featureControls=="number"?a.featureControls=e.featureControls:typeof e.featureControls=="object"&&(a.featureControls=new l.LongBits(e.featureControls.low>>>0,e.featureControls.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.vlevel!=null&&e.hasOwnProperty("vlevel")&&(A.vlevel=a.enums===String?p.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]===void 0?e.vlevel:p.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]:e.vlevel,a.oneofs&&(A._vlevel="vlevel")),e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=p.proto.VerifiedNameCertificate.toObject(e.vnameCert,a),a.oneofs&&(A._vnameCert="vnameCert")),e.signed!=null&&e.hasOwnProperty("signed")&&(A.signed=e.signed,a.oneofs&&(A._signed="signed")),e.revoked!=null&&e.hasOwnProperty("revoked")&&(A.revoked=e.revoked,a.oneofs&&(A._revoked="revoked")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=a.enums===String?p.proto.BizIdentityInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:p.proto.BizIdentityInfo.HostStorageType[e.hostStorage]:e.hostStorage,a.oneofs&&(A._hostStorage="hostStorage")),e.actualActors!=null&&e.hasOwnProperty("actualActors")&&(A.actualActors=a.enums===String?p.proto.BizIdentityInfo.ActualActorsType[e.actualActors]===void 0?e.actualActors:p.proto.BizIdentityInfo.ActualActorsType[e.actualActors]:e.actualActors,a.oneofs&&(A._actualActors="actualActors")),e.privacyModeTs!=null&&e.hasOwnProperty("privacyModeTs")&&(typeof e.privacyModeTs=="number"?A.privacyModeTs=a.longs===String?String(e.privacyModeTs):e.privacyModeTs:A.privacyModeTs=a.longs===String?ge(e.privacyModeTs,!0):a.longs===Number?ce(e.privacyModeTs,!0):e.privacyModeTs,a.oneofs&&(A._privacyModeTs="privacyModeTs")),e.featureControls!=null&&e.hasOwnProperty("featureControls")&&(typeof e.featureControls=="number"?A.featureControls=a.longs===String?String(e.featureControls):e.featureControls:A.featureControls=a.longs===String?ge(e.featureControls,!0):a.longs===Number?ce(e.featureControls,!0):e.featureControls,a.oneofs&&(A._featureControls="featureControls")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizIdentityInfo"},t.ActualActorsType=(function(){let i={},e=Object.create(i);return e[i[0]="SELF"]=0,e[i[1]="BSP"]=1,e})(),t.HostStorageType=(function(){let i={},e=Object.create(i);return e[i[0]="ON_PREMISE"]=0,e[i[1]="FACEBOOK"]=1,e})(),t.VerifiedLevelValue=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="LOW"]=1,e[i[2]="HIGH"]=2,e})(),t})(),n.BotAgeCollectionMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.ageCollectionEligible=e.bool();break}case 2:{s.shouldTriggerAgeCollectionOnClient=e.bool();break}case 3:{s.ageCollectionType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotAgeCollectionMetadata)return e;var a=new p.proto.BotAgeCollectionMetadata;switch(e.ageCollectionEligible!=null&&(a.ageCollectionEligible=!!e.ageCollectionEligible),e.shouldTriggerAgeCollectionOnClient!=null&&(a.shouldTriggerAgeCollectionOnClient=!!e.shouldTriggerAgeCollectionOnClient),e.ageCollectionType){default:if(typeof e.ageCollectionType=="number"){a.ageCollectionType=e.ageCollectionType;break}break;case"O18_BINARY":case 0:a.ageCollectionType=0;break;case"WAFFLE":case 1:a.ageCollectionType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.ageCollectionEligible!=null&&e.hasOwnProperty("ageCollectionEligible")&&(A.ageCollectionEligible=e.ageCollectionEligible,a.oneofs&&(A._ageCollectionEligible="ageCollectionEligible")),e.shouldTriggerAgeCollectionOnClient!=null&&e.hasOwnProperty("shouldTriggerAgeCollectionOnClient")&&(A.shouldTriggerAgeCollectionOnClient=e.shouldTriggerAgeCollectionOnClient,a.oneofs&&(A._shouldTriggerAgeCollectionOnClient="shouldTriggerAgeCollectionOnClient")),e.ageCollectionType!=null&&e.hasOwnProperty("ageCollectionType")&&(A.ageCollectionType=a.enums===String?p.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]===void 0?e.ageCollectionType:p.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]:e.ageCollectionType,a.oneofs&&(A._ageCollectionType="ageCollectionType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAgeCollectionMetadata"},t.AgeCollectionType=(function(){let i={},e=Object.create(i);return e[i[0]="O18_BINARY"]=0,e[i[1]="WAFFLE"]=1,e})(),t})(),n.BotAvatarMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sentiment=e.uint32();break}case 2:{s.behaviorGraph=e.string();break}case 3:{s.action=e.uint32();break}case 4:{s.intensity=e.uint32();break}case 5:{s.wordCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotAvatarMetadata)return e;var a=new p.proto.BotAvatarMetadata;return e.sentiment!=null&&(a.sentiment=e.sentiment>>>0),e.behaviorGraph!=null&&(a.behaviorGraph=String(e.behaviorGraph)),e.action!=null&&(a.action=e.action>>>0),e.intensity!=null&&(a.intensity=e.intensity>>>0),e.wordCount!=null&&(a.wordCount=e.wordCount>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.sentiment!=null&&e.hasOwnProperty("sentiment")&&(A.sentiment=e.sentiment,a.oneofs&&(A._sentiment="sentiment")),e.behaviorGraph!=null&&e.hasOwnProperty("behaviorGraph")&&(A.behaviorGraph=e.behaviorGraph,a.oneofs&&(A._behaviorGraph="behaviorGraph")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=e.action,a.oneofs&&(A._action="action")),e.intensity!=null&&e.hasOwnProperty("intensity")&&(A.intensity=e.intensity,a.oneofs&&(A._intensity="intensity")),e.wordCount!=null&&e.hasOwnProperty("wordCount")&&(A.wordCount=e.wordCount,a.oneofs&&(A._wordCount="wordCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAvatarMetadata"},t})(),n.BotCapabilityMetadata=(function(){function t(o){if(this.capabilities=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{if(r.capabilities&&r.capabilities.length||(r.capabilities=[]),(s&7)===2)for(var g=i.uint32()+i.pos;i.pos>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.kind=e.int32();break}case 3:{s.text=e.string();break}case 4:{s.kindNegative=e.uint64();break}case 5:{s.kindPositive=e.uint64();break}case 6:{s.kindReport=e.int32();break}case 7:{s.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotFeedbackMessage)return e;var a=new p.proto.BotFeedbackMessage;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.BotFeedbackMessage.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}switch(e.kind){default:if(typeof e.kind=="number"){a.kind=e.kind;break}break;case"BOT_FEEDBACK_POSITIVE":case 0:a.kind=0;break;case"BOT_FEEDBACK_NEGATIVE_GENERIC":case 1:a.kind=1;break;case"BOT_FEEDBACK_NEGATIVE_HELPFUL":case 2:a.kind=2;break;case"BOT_FEEDBACK_NEGATIVE_INTERESTING":case 3:a.kind=3;break;case"BOT_FEEDBACK_NEGATIVE_ACCURATE":case 4:a.kind=4;break;case"BOT_FEEDBACK_NEGATIVE_SAFE":case 5:a.kind=5;break;case"BOT_FEEDBACK_NEGATIVE_OTHER":case 6:a.kind=6;break;case"BOT_FEEDBACK_NEGATIVE_REFUSED":case 7:a.kind=7;break;case"BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING":case 8:a.kind=8;break;case"BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT":case 9:a.kind=9;break;case"BOT_FEEDBACK_NEGATIVE_PERSONALIZED":case 10:a.kind=10;break;case"BOT_FEEDBACK_NEGATIVE_CLARITY":case 11:a.kind=11;break;case"BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON":case 12:a.kind=12;break;case"BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY":case 13:a.kind=13;break;case"BOT_FEEDBACK_NEGATIVE":case 14:a.kind=14;break}switch(e.text!=null&&(a.text=String(e.text)),e.kindNegative!=null&&(l.Long?(a.kindNegative=l.Long.fromValue(e.kindNegative)).unsigned=!0:typeof e.kindNegative=="string"?a.kindNegative=parseInt(e.kindNegative,10):typeof e.kindNegative=="number"?a.kindNegative=e.kindNegative:typeof e.kindNegative=="object"&&(a.kindNegative=new l.LongBits(e.kindNegative.low>>>0,e.kindNegative.high>>>0).toNumber(!0))),e.kindPositive!=null&&(l.Long?(a.kindPositive=l.Long.fromValue(e.kindPositive)).unsigned=!0:typeof e.kindPositive=="string"?a.kindPositive=parseInt(e.kindPositive,10):typeof e.kindPositive=="number"?a.kindPositive=e.kindPositive:typeof e.kindPositive=="object"&&(a.kindPositive=new l.LongBits(e.kindPositive.low>>>0,e.kindPositive.high>>>0).toNumber(!0))),e.kindReport){default:if(typeof e.kindReport=="number"){a.kindReport=e.kindReport;break}break;case"NONE":case 0:a.kindReport=0;break;case"GENERIC":case 1:a.kindReport=1;break}if(e.sideBySideSurveyMetadata!=null){if(typeof e.sideBySideSurveyMetadata!="object")throw TypeError(".proto.BotFeedbackMessage.sideBySideSurveyMetadata: object expected");a.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.fromObject(e.sideBySideSurveyMetadata)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.kind!=null&&e.hasOwnProperty("kind")&&(A.kind=a.enums===String?p.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]===void 0?e.kind:p.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]:e.kind,a.oneofs&&(A._kind="kind")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),e.kindNegative!=null&&e.hasOwnProperty("kindNegative")&&(typeof e.kindNegative=="number"?A.kindNegative=a.longs===String?String(e.kindNegative):e.kindNegative:A.kindNegative=a.longs===String?ge(e.kindNegative,!0):a.longs===Number?ce(e.kindNegative,!0):e.kindNegative,a.oneofs&&(A._kindNegative="kindNegative")),e.kindPositive!=null&&e.hasOwnProperty("kindPositive")&&(typeof e.kindPositive=="number"?A.kindPositive=a.longs===String?String(e.kindPositive):e.kindPositive:A.kindPositive=a.longs===String?ge(e.kindPositive,!0):a.longs===Number?ce(e.kindPositive,!0):e.kindPositive,a.oneofs&&(A._kindPositive="kindPositive")),e.kindReport!=null&&e.hasOwnProperty("kindReport")&&(A.kindReport=a.enums===String?p.proto.BotFeedbackMessage.ReportKind[e.kindReport]===void 0?e.kindReport:p.proto.BotFeedbackMessage.ReportKind[e.kindReport]:e.kindReport,a.oneofs&&(A._kindReport="kindReport")),e.sideBySideSurveyMetadata!=null&&e.hasOwnProperty("sideBySideSurveyMetadata")&&(A.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.toObject(e.sideBySideSurveyMetadata,a),a.oneofs&&(A._sideBySideSurveyMetadata="sideBySideSurveyMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotFeedbackMessage"},t.BotFeedbackKind=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_FEEDBACK_POSITIVE"]=0,e[i[1]="BOT_FEEDBACK_NEGATIVE_GENERIC"]=1,e[i[2]="BOT_FEEDBACK_NEGATIVE_HELPFUL"]=2,e[i[3]="BOT_FEEDBACK_NEGATIVE_INTERESTING"]=3,e[i[4]="BOT_FEEDBACK_NEGATIVE_ACCURATE"]=4,e[i[5]="BOT_FEEDBACK_NEGATIVE_SAFE"]=5,e[i[6]="BOT_FEEDBACK_NEGATIVE_OTHER"]=6,e[i[7]="BOT_FEEDBACK_NEGATIVE_REFUSED"]=7,e[i[8]="BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING"]=8,e[i[9]="BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=9,e[i[10]="BOT_FEEDBACK_NEGATIVE_PERSONALIZED"]=10,e[i[11]="BOT_FEEDBACK_NEGATIVE_CLARITY"]=11,e[i[12]="BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON"]=12,e[i[13]="BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY"]=13,e[i[14]="BOT_FEEDBACK_NEGATIVE"]=14,e})(),t.BotFeedbackKindMultipleNegative=(function(){let i={},e=Object.create(i);return e[i[1]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC"]=1,e[i[2]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL"]=2,e[i[4]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING"]=4,e[i[8]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE"]=8,e[i[16]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE"]=16,e[i[32]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER"]=32,e[i[64]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED"]=64,e[i[128]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING"]=128,e[i[256]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=256,e})(),t.BotFeedbackKindMultiplePositive=(function(){let i={},e=Object.create(i);return e[i[1]="BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC"]=1,e})(),t.ReportKind=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="GENERIC"]=1,e})(),t.SideBySideSurveyMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.selectedRequestId=A.string();break}case 2:{c.surveyId=A.uint32();break}case 3:{c.simonSessionFbid=A.string();break}case 4:{c.responseOtid=A.string();break}case 5:{c.responseTimestampMsString=A.string();break}case 6:{c.isSelectedResponsePrimary=A.bool();break}case 7:{c.messageIdToEdit=A.string();break}case 8:{c.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.decode(A,A.uint32());break}case 9:{c.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata)return A;var r=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata;if(A.selectedRequestId!=null&&(r.selectedRequestId=String(A.selectedRequestId)),A.surveyId!=null&&(r.surveyId=A.surveyId>>>0),A.simonSessionFbid!=null&&(r.simonSessionFbid=String(A.simonSessionFbid)),A.responseOtid!=null&&(r.responseOtid=String(A.responseOtid)),A.responseTimestampMsString!=null&&(r.responseTimestampMsString=String(A.responseTimestampMsString)),A.isSelectedResponsePrimary!=null&&(r.isSelectedResponsePrimary=!!A.isSelectedResponsePrimary),A.messageIdToEdit!=null&&(r.messageIdToEdit=String(A.messageIdToEdit)),A.analyticsData!=null){if(typeof A.analyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.analyticsData: object expected");r.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.fromObject(A.analyticsData)}if(A.metaAiAnalyticsData!=null){if(typeof A.metaAiAnalyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.metaAiAnalyticsData: object expected");r.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.fromObject(A.metaAiAnalyticsData)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.selectedRequestId!=null&&A.hasOwnProperty("selectedRequestId")&&(s.selectedRequestId=A.selectedRequestId,r.oneofs&&(s._selectedRequestId="selectedRequestId")),A.surveyId!=null&&A.hasOwnProperty("surveyId")&&(s.surveyId=A.surveyId,r.oneofs&&(s._surveyId="surveyId")),A.simonSessionFbid!=null&&A.hasOwnProperty("simonSessionFbid")&&(s.simonSessionFbid=A.simonSessionFbid,r.oneofs&&(s._simonSessionFbid="simonSessionFbid")),A.responseOtid!=null&&A.hasOwnProperty("responseOtid")&&(s.responseOtid=A.responseOtid,r.oneofs&&(s._responseOtid="responseOtid")),A.responseTimestampMsString!=null&&A.hasOwnProperty("responseTimestampMsString")&&(s.responseTimestampMsString=A.responseTimestampMsString,r.oneofs&&(s._responseTimestampMsString="responseTimestampMsString")),A.isSelectedResponsePrimary!=null&&A.hasOwnProperty("isSelectedResponsePrimary")&&(s.isSelectedResponsePrimary=A.isSelectedResponsePrimary,r.oneofs&&(s._isSelectedResponsePrimary="isSelectedResponsePrimary")),A.messageIdToEdit!=null&&A.hasOwnProperty("messageIdToEdit")&&(s.messageIdToEdit=A.messageIdToEdit,r.oneofs&&(s._messageIdToEdit="messageIdToEdit")),A.analyticsData!=null&&A.hasOwnProperty("analyticsData")&&(s.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.toObject(A.analyticsData,r),r.oneofs&&(s._analyticsData="analyticsData")),A.metaAiAnalyticsData!=null&&A.hasOwnProperty("metaAiAnalyticsData")&&(s.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.toObject(A.metaAiAnalyticsData,r),r.oneofs&&(s._metaAiAnalyticsData="metaAiAnalyticsData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata"},i.SideBySideSurveyAnalyticsData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.tessaEvent=s.string();break}case 2:{d.tessaSessionFbid=s.string();break}case 3:{d.simonSessionFbid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData)return s;var g=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData;return s.tessaEvent!=null&&(g.tessaEvent=String(s.tessaEvent)),s.tessaSessionFbid!=null&&(g.tessaSessionFbid=String(s.tessaSessionFbid)),s.simonSessionFbid!=null&&(g.simonSessionFbid=String(s.simonSessionFbid)),g},a.toObject=function(s,g){g||(g={});var c={};return s.tessaEvent!=null&&s.hasOwnProperty("tessaEvent")&&(c.tessaEvent=s.tessaEvent,g.oneofs&&(c._tessaEvent="tessaEvent")),s.tessaSessionFbid!=null&&s.hasOwnProperty("tessaSessionFbid")&&(c.tessaSessionFbid=s.tessaSessionFbid,g.oneofs&&(c._tessaSessionFbid="tessaSessionFbid")),s.simonSessionFbid!=null&&s.hasOwnProperty("simonSessionFbid")&&(c.simonSessionFbid=s.simonSessionFbid,g.oneofs&&(c._simonSessionFbid="simonSessionFbid")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData"},a})(),i.SidebySideSurveyMetaAiAnalyticsData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.surveyId=s.uint32();break}case 2:{d.primaryResponseId=s.string();break}case 3:{d.testArmName=s.string();break}case 4:{d.timestampMsString=s.string();break}case 5:{d.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.decode(s,s.uint32());break}case 6:{d.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.decode(s,s.uint32());break}case 7:{d.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.decode(s,s.uint32());break}case 8:{d.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.decode(s,s.uint32());break}case 9:{d.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData)return s;var g=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData;if(s.surveyId!=null&&(g.surveyId=s.surveyId>>>0),s.primaryResponseId!=null&&(g.primaryResponseId=String(s.primaryResponseId)),s.testArmName!=null&&(g.testArmName=String(s.testArmName)),s.timestampMsString!=null&&(g.timestampMsString=String(s.timestampMsString)),s.ctaImpressionEvent!=null){if(typeof s.ctaImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaImpressionEvent: object expected");g.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.fromObject(s.ctaImpressionEvent)}if(s.ctaClickEvent!=null){if(typeof s.ctaClickEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaClickEvent: object expected");g.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.fromObject(s.ctaClickEvent)}if(s.cardImpressionEvent!=null){if(typeof s.cardImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.cardImpressionEvent: object expected");g.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.fromObject(s.cardImpressionEvent)}if(s.responseEvent!=null){if(typeof s.responseEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.responseEvent: object expected");g.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.fromObject(s.responseEvent)}if(s.abandonEvent!=null){if(typeof s.abandonEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.abandonEvent: object expected");g.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.fromObject(s.abandonEvent)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.surveyId!=null&&s.hasOwnProperty("surveyId")&&(c.surveyId=s.surveyId,g.oneofs&&(c._surveyId="surveyId")),s.primaryResponseId!=null&&s.hasOwnProperty("primaryResponseId")&&(c.primaryResponseId=s.primaryResponseId,g.oneofs&&(c._primaryResponseId="primaryResponseId")),s.testArmName!=null&&s.hasOwnProperty("testArmName")&&(c.testArmName=s.testArmName,g.oneofs&&(c._testArmName="testArmName")),s.timestampMsString!=null&&s.hasOwnProperty("timestampMsString")&&(c.timestampMsString=s.timestampMsString,g.oneofs&&(c._timestampMsString="timestampMsString")),s.ctaImpressionEvent!=null&&s.hasOwnProperty("ctaImpressionEvent")&&(c.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.toObject(s.ctaImpressionEvent,g),g.oneofs&&(c._ctaImpressionEvent="ctaImpressionEvent")),s.ctaClickEvent!=null&&s.hasOwnProperty("ctaClickEvent")&&(c.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.toObject(s.ctaClickEvent,g),g.oneofs&&(c._ctaClickEvent="ctaClickEvent")),s.cardImpressionEvent!=null&&s.hasOwnProperty("cardImpressionEvent")&&(c.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.toObject(s.cardImpressionEvent,g),g.oneofs&&(c._cardImpressionEvent="cardImpressionEvent")),s.responseEvent!=null&&s.hasOwnProperty("responseEvent")&&(c.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.toObject(s.responseEvent,g),g.oneofs&&(c._responseEvent="responseEvent")),s.abandonEvent!=null&&s.hasOwnProperty("abandonEvent")&&(c.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.toObject(s.abandonEvent,g),g.oneofs&&(c._abandonEvent="abandonEvent")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData"},a.SideBySideSurveyAbandonEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.abandonDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData;return c.abandonDwellTimeMsString!=null&&(I.abandonDwellTimeMsString=String(c.abandonDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var d={};return c.abandonDwellTimeMsString!=null&&c.hasOwnProperty("abandonDwellTimeMsString")&&(d.abandonDwellTimeMsString=c.abandonDwellTimeMsString,I.oneofs&&(d._abandonDwellTimeMsString="abandonDwellTimeMsString")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData"},r})(),a.SideBySideSurveyCTAClickEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}case 2:{f.clickDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),c.clickDwellTimeMsString!=null&&(I.clickDwellTimeMsString=String(c.clickDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var d={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(d.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(d._isSurveyExpired="isSurveyExpired")),c.clickDwellTimeMsString!=null&&c.hasOwnProperty("clickDwellTimeMsString")&&(d.clickDwellTimeMsString=c.clickDwellTimeMsString,I.oneofs&&(d._clickDwellTimeMsString="clickDwellTimeMsString")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData"},r})(),a.SideBySideSurveyCTAImpressionEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),I},r.toObject=function(c,I){I||(I={});var d={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(d.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(d._isSurveyExpired="isSurveyExpired")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData"},r})(),a.SideBySideSurveyCardImpressionEventData=(function(){function r(s){if(s)for(var g=Object.keys(s),c=0;c>>3){default:g.skipType(f&7);break}}return B},r.fromObject=function(g){return g instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData?g:new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData},r.toObject=function(){return{}},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(g){return g===void 0&&(g="type.googleapis.com"),g+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData"},r})(),a.SideBySideSurveyResponseEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.responseDwellTimeMsString=c.string();break}case 2:{f.selectedResponseId=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData;return c.responseDwellTimeMsString!=null&&(I.responseDwellTimeMsString=String(c.responseDwellTimeMsString)),c.selectedResponseId!=null&&(I.selectedResponseId=String(c.selectedResponseId)),I},r.toObject=function(c,I){I||(I={});var d={};return c.responseDwellTimeMsString!=null&&c.hasOwnProperty("responseDwellTimeMsString")&&(d.responseDwellTimeMsString=c.responseDwellTimeMsString,I.oneofs&&(d._responseDwellTimeMsString="responseDwellTimeMsString")),c.selectedResponseId!=null&&c.hasOwnProperty("selectedResponseId")&&(d.selectedResponseId=c.selectedResponseId,I.oneofs&&(d._selectedResponseId="selectedResponseId")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData"},r})(),a})(),i})(),t})(),n.BotImagineMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.imagineType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotImagineMetadata)return e;var a=new p.proto.BotImagineMetadata;switch(e.imagineType){default:if(typeof e.imagineType=="number"){a.imagineType=e.imagineType;break}break;case"UNKNOWN":case 0:a.imagineType=0;break;case"IMAGINE":case 1:a.imagineType=1;break;case"MEMU":case 2:a.imagineType=2;break;case"FLASH":case 3:a.imagineType=3;break;case"EDIT":case 4:a.imagineType=4;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.imagineType!=null&&e.hasOwnProperty("imagineType")&&(A.imagineType=a.enums===String?p.proto.BotImagineMetadata.ImagineType[e.imagineType]===void 0?e.imagineType:p.proto.BotImagineMetadata.ImagineType[e.imagineType]:e.imagineType,a.oneofs&&(A._imagineType="imagineType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotImagineMetadata"},t.ImagineType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="IMAGINE"]=1,e[i[2]="MEMU"]=2,e[i[3]="FLASH"]=3,e[i[4]="EDIT"]=4,e})(),t})(),n.BotLinkedAccount=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotLinkedAccount)return e;var a=new p.proto.BotLinkedAccount;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"BOT_LINKED_ACCOUNT_TYPE_1P":case 0:a.type=0;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.BotLinkedAccount.BotLinkedAccountType[e.type]===void 0?e.type:p.proto.BotLinkedAccount.BotLinkedAccountType[e.type]:e.type,a.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotLinkedAccount"},t.BotLinkedAccountType=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_LINKED_ACCOUNT_TYPE_1P"]=0,e})(),t})(),n.BotLinkedAccountsMetadata=(function(){function t(i){if(this.accounts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(p.proto.BotLinkedAccount.decode(e,e.uint32()));break}case 2:{s.acAuthTokens=e.bytes();break}case 3:{s.acErrorCode=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotLinkedAccountsMetadata)return e;var a=new p.proto.BotLinkedAccountsMetadata;if(e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");a.accounts=[];for(var A=0;A=0&&(a.acAuthTokens=e.acAuthTokens)),e.acErrorCode!=null&&(a.acErrorCode=e.acErrorCode|0),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.accounts=[]),e.accounts&&e.accounts.length){A.accounts=[];for(var r=0;r>>3){case 1:{s.fileSha256=e.string();break}case 2:{s.mediaKey=e.string();break}case 3:{s.fileEncSha256=e.string();break}case 4:{s.directPath=e.string();break}case 5:{s.mediaKeyTimestamp=e.int64();break}case 6:{s.mimetype=e.string();break}case 7:{s.orientationType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMediaMetadata)return e;var a=new p.proto.BotMediaMetadata;switch(e.fileSha256!=null&&(a.fileSha256=String(e.fileSha256)),e.mediaKey!=null&&(a.mediaKey=String(e.mediaKey)),e.fileEncSha256!=null&&(a.fileEncSha256=String(e.fileEncSha256)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.mediaKeyTimestamp!=null&&(l.Long?(a.mediaKeyTimestamp=l.Long.fromValue(e.mediaKeyTimestamp)).unsigned=!1:typeof e.mediaKeyTimestamp=="string"?a.mediaKeyTimestamp=parseInt(e.mediaKeyTimestamp,10):typeof e.mediaKeyTimestamp=="number"?a.mediaKeyTimestamp=e.mediaKeyTimestamp:typeof e.mediaKeyTimestamp=="object"&&(a.mediaKeyTimestamp=new l.LongBits(e.mediaKeyTimestamp.low>>>0,e.mediaKeyTimestamp.high>>>0).toNumber())),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.orientationType){default:if(typeof e.orientationType=="number"){a.orientationType=e.orientationType;break}break;case"CENTER":case 1:a.orientationType=1;break;case"LEFT":case 2:a.orientationType=2;break;case"RIGHT":case 3:a.orientationType=3;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.mediaKeyTimestamp!=null&&e.hasOwnProperty("mediaKeyTimestamp")&&(typeof e.mediaKeyTimestamp=="number"?A.mediaKeyTimestamp=a.longs===String?String(e.mediaKeyTimestamp):e.mediaKeyTimestamp:A.mediaKeyTimestamp=a.longs===String?ge(e.mediaKeyTimestamp):a.longs===Number?ce(e.mediaKeyTimestamp):e.mediaKeyTimestamp,a.oneofs&&(A._mediaKeyTimestamp="mediaKeyTimestamp")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.orientationType!=null&&e.hasOwnProperty("orientationType")&&(A.orientationType=a.enums===String?p.proto.BotMediaMetadata.OrientationType[e.orientationType]===void 0?e.orientationType:p.proto.BotMediaMetadata.OrientationType[e.orientationType]:e.orientationType,a.oneofs&&(A._orientationType="orientationType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMediaMetadata"},t.OrientationType=(function(){let i={},e=Object.create(i);return e[i[1]="CENTER"]=1,e[i[2]="LEFT"]=2,e[i[3]="RIGHT"]=3,e})(),t})(),n.BotMemoryFact=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.fact=e.string();break}case 2:{s.factId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMemoryFact)return e;var a=new p.proto.BotMemoryFact;return e.fact!=null&&(a.fact=String(e.fact)),e.factId!=null&&(a.factId=String(e.factId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.fact!=null&&e.hasOwnProperty("fact")&&(A.fact=e.fact,a.oneofs&&(A._fact="fact")),e.factId!=null&&e.hasOwnProperty("factId")&&(A.factId=e.factId,a.oneofs&&(A._factId="factId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMemoryFact"},t})(),n.BotMemoryMetadata=(function(){function t(i){if(this.addedFacts=[],this.removedFacts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.addedFacts&&s.addedFacts.length||(s.addedFacts=[]),s.addedFacts.push(p.proto.BotMemoryFact.decode(e,e.uint32()));break}case 2:{s.removedFacts&&s.removedFacts.length||(s.removedFacts=[]),s.removedFacts.push(p.proto.BotMemoryFact.decode(e,e.uint32()));break}case 3:{s.disclaimer=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMemoryMetadata)return e;var a=new p.proto.BotMemoryMetadata;if(e.addedFacts){if(!Array.isArray(e.addedFacts))throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected");a.addedFacts=[];for(var A=0;A>>3){case 1:{r.faceImages&&r.faceImages.length||(r.faceImages=[]),r.faceImages.push(p.proto.BotMediaMetadata.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotMemuMetadata)return i;var e=new p.proto.BotMemuMetadata;if(i.faceImages){if(!Array.isArray(i.faceImages))throw TypeError(".proto.BotMemuMetadata.faceImages: array expected");e.faceImages=[];for(var a=0;a>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMessageOrigin)return e;var a=new p.proto.BotMessageOrigin;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED":case 0:a.type=0;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.BotMessageOrigin.BotMessageOriginType[e.type]===void 0?e.type:p.proto.BotMessageOrigin.BotMessageOriginType[e.type]:e.type,a.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageOrigin"},t.BotMessageOriginType=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED"]=0,e})(),t})(),n.BotMessageOriginMetadata=(function(){function t(o){if(this.origins=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.origins&&r.origins.length||(r.origins=[]),r.origins.push(p.proto.BotMessageOrigin.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotMessageOriginMetadata)return i;var e=new p.proto.BotMessageOriginMetadata;if(i.origins){if(!Array.isArray(i.origins))throw TypeError(".proto.BotMessageOriginMetadata.origins: array expected");e.origins=[];for(var a=0;a>>3){case 1:{s.botEntryPointOrigin=e.int32();break}case 2:{s.forwardScore=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMessageSharingInfo)return e;var a=new p.proto.BotMessageSharingInfo;switch(e.botEntryPointOrigin){default:if(typeof e.botEntryPointOrigin=="number"){a.botEntryPointOrigin=e.botEntryPointOrigin;break}break;case"UNDEFINED_ENTRY_POINT":case 0:a.botEntryPointOrigin=0;break;case"FAVICON":case 1:a.botEntryPointOrigin=1;break;case"CHATLIST":case 2:a.botEntryPointOrigin=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:a.botEntryPointOrigin=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:a.botEntryPointOrigin=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:a.botEntryPointOrigin=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:a.botEntryPointOrigin=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:a.botEntryPointOrigin=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:a.botEntryPointOrigin=8;break;case"AIVOICE_SEARCH_BAR":case 9:a.botEntryPointOrigin=9;break;case"AIVOICE_FAVICON":case 10:a.botEntryPointOrigin=10;break;case"AISTUDIO":case 11:a.botEntryPointOrigin=11;break;case"DEEPLINK":case 12:a.botEntryPointOrigin=12;break;case"NOTIFICATION":case 13:a.botEntryPointOrigin=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:a.botEntryPointOrigin=14;break;case"FORWARD":case 15:a.botEntryPointOrigin=15;break;case"APP_SHORTCUT":case 16:a.botEntryPointOrigin=16;break;case"FF_FAMILY":case 17:a.botEntryPointOrigin=17;break;case"AI_TAB":case 18:a.botEntryPointOrigin=18;break;case"AI_HOME":case 19:a.botEntryPointOrigin=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:a.botEntryPointOrigin=20;break;case"AI_DEEPLINK":case 21:a.botEntryPointOrigin=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:a.botEntryPointOrigin=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:a.botEntryPointOrigin=23;break;case"NEW_CHAT_AI_STUDIO":case 24:a.botEntryPointOrigin=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:a.botEntryPointOrigin=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:a.botEntryPointOrigin=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:a.botEntryPointOrigin=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:a.botEntryPointOrigin=28;break;case"INVOKE_META_AI_1ON1":case 29:a.botEntryPointOrigin=29;break;case"INVOKE_META_AI_GROUP":case 30:a.botEntryPointOrigin=30;break;case"META_AI_FORWARD":case 31:a.botEntryPointOrigin=31;break;case"NEW_CHAT_AI_CONTACT":case 32:a.botEntryPointOrigin=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:a.botEntryPointOrigin=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:a.botEntryPointOrigin=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:a.botEntryPointOrigin=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:a.botEntryPointOrigin=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:a.botEntryPointOrigin=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:a.botEntryPointOrigin=38;break}return e.forwardScore!=null&&(a.forwardScore=e.forwardScore>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.botEntryPointOrigin!=null&&e.hasOwnProperty("botEntryPointOrigin")&&(A.botEntryPointOrigin=a.enums===String?p.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]===void 0?e.botEntryPointOrigin:p.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]:e.botEntryPointOrigin,a.oneofs&&(A._botEntryPointOrigin="botEntryPointOrigin")),e.forwardScore!=null&&e.hasOwnProperty("forwardScore")&&(A.forwardScore=e.forwardScore,a.oneofs&&(A._forwardScore="forwardScore")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageSharingInfo"},t})(),n.BotMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.avatarMetadata=p.proto.BotAvatarMetadata.decode(e,e.uint32());break}case 2:{s.personaId=e.string();break}case 3:{s.pluginMetadata=p.proto.BotPluginMetadata.decode(e,e.uint32());break}case 4:{s.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.decode(e,e.uint32());break}case 5:{s.invokerJid=e.string();break}case 6:{s.sessionMetadata=p.proto.BotSessionMetadata.decode(e,e.uint32());break}case 7:{s.memuMetadata=p.proto.BotMemuMetadata.decode(e,e.uint32());break}case 8:{s.timezone=e.string();break}case 9:{s.reminderMetadata=p.proto.BotReminderMetadata.decode(e,e.uint32());break}case 10:{s.modelMetadata=p.proto.BotModelMetadata.decode(e,e.uint32());break}case 11:{s.messageDisclaimerText=e.string();break}case 12:{s.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.decode(e,e.uint32());break}case 13:{s.capabilityMetadata=p.proto.BotCapabilityMetadata.decode(e,e.uint32());break}case 14:{s.imagineMetadata=p.proto.BotImagineMetadata.decode(e,e.uint32());break}case 15:{s.memoryMetadata=p.proto.BotMemoryMetadata.decode(e,e.uint32());break}case 16:{s.renderingMetadata=p.proto.BotRenderingMetadata.decode(e,e.uint32());break}case 17:{s.botMetricsMetadata=p.proto.BotMetricsMetadata.decode(e,e.uint32());break}case 18:{s.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.decode(e,e.uint32());break}case 19:{s.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.decode(e,e.uint32());break}case 20:{s.aiConversationContext=e.bytes();break}case 21:{s.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.decode(e,e.uint32());break}case 22:{s.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.decode(e,e.uint32());break}case 23:{s.botQuotaMetadata=p.proto.BotQuotaMetadata.decode(e,e.uint32());break}case 24:{s.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.decode(e,e.uint32());break}case 25:{s.conversationStarterPromptId=e.string();break}case 26:{s.botResponseId=e.string();break}case 27:{s.verificationMetadata=p.proto.BotSignatureVerificationMetadata.decode(e,e.uint32());break}case 28:{s.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.decode(e,e.uint32());break}case 29:{s.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.decode(e,e.uint32());break}case 30:{s.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.decode(e,e.uint32());break}case 31:{s.botThreadInfo=p.proto.AIThreadInfo.decode(e,e.uint32());break}case 32:{s.regenerateMetadata=p.proto.AIRegenerateMetadata.decode(e,e.uint32());break}case 33:{s.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.decode(e,e.uint32());break}case 999:{s.internalMetadata=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMetadata)return e;var a=new p.proto.BotMetadata;if(e.avatarMetadata!=null){if(typeof e.avatarMetadata!="object")throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");a.avatarMetadata=p.proto.BotAvatarMetadata.fromObject(e.avatarMetadata)}if(e.personaId!=null&&(a.personaId=String(e.personaId)),e.pluginMetadata!=null){if(typeof e.pluginMetadata!="object")throw TypeError(".proto.BotMetadata.pluginMetadata: object expected");a.pluginMetadata=p.proto.BotPluginMetadata.fromObject(e.pluginMetadata)}if(e.suggestedPromptMetadata!=null){if(typeof e.suggestedPromptMetadata!="object")throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected");a.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.fromObject(e.suggestedPromptMetadata)}if(e.invokerJid!=null&&(a.invokerJid=String(e.invokerJid)),e.sessionMetadata!=null){if(typeof e.sessionMetadata!="object")throw TypeError(".proto.BotMetadata.sessionMetadata: object expected");a.sessionMetadata=p.proto.BotSessionMetadata.fromObject(e.sessionMetadata)}if(e.memuMetadata!=null){if(typeof e.memuMetadata!="object")throw TypeError(".proto.BotMetadata.memuMetadata: object expected");a.memuMetadata=p.proto.BotMemuMetadata.fromObject(e.memuMetadata)}if(e.timezone!=null&&(a.timezone=String(e.timezone)),e.reminderMetadata!=null){if(typeof e.reminderMetadata!="object")throw TypeError(".proto.BotMetadata.reminderMetadata: object expected");a.reminderMetadata=p.proto.BotReminderMetadata.fromObject(e.reminderMetadata)}if(e.modelMetadata!=null){if(typeof e.modelMetadata!="object")throw TypeError(".proto.BotMetadata.modelMetadata: object expected");a.modelMetadata=p.proto.BotModelMetadata.fromObject(e.modelMetadata)}if(e.messageDisclaimerText!=null&&(a.messageDisclaimerText=String(e.messageDisclaimerText)),e.progressIndicatorMetadata!=null){if(typeof e.progressIndicatorMetadata!="object")throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected");a.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.fromObject(e.progressIndicatorMetadata)}if(e.capabilityMetadata!=null){if(typeof e.capabilityMetadata!="object")throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected");a.capabilityMetadata=p.proto.BotCapabilityMetadata.fromObject(e.capabilityMetadata)}if(e.imagineMetadata!=null){if(typeof e.imagineMetadata!="object")throw TypeError(".proto.BotMetadata.imagineMetadata: object expected");a.imagineMetadata=p.proto.BotImagineMetadata.fromObject(e.imagineMetadata)}if(e.memoryMetadata!=null){if(typeof e.memoryMetadata!="object")throw TypeError(".proto.BotMetadata.memoryMetadata: object expected");a.memoryMetadata=p.proto.BotMemoryMetadata.fromObject(e.memoryMetadata)}if(e.renderingMetadata!=null){if(typeof e.renderingMetadata!="object")throw TypeError(".proto.BotMetadata.renderingMetadata: object expected");a.renderingMetadata=p.proto.BotRenderingMetadata.fromObject(e.renderingMetadata)}if(e.botMetricsMetadata!=null){if(typeof e.botMetricsMetadata!="object")throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected");a.botMetricsMetadata=p.proto.BotMetricsMetadata.fromObject(e.botMetricsMetadata)}if(e.botLinkedAccountsMetadata!=null){if(typeof e.botLinkedAccountsMetadata!="object")throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected");a.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.fromObject(e.botLinkedAccountsMetadata)}if(e.richResponseSourcesMetadata!=null){if(typeof e.richResponseSourcesMetadata!="object")throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected");a.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.fromObject(e.richResponseSourcesMetadata)}if(e.aiConversationContext!=null&&(typeof e.aiConversationContext=="string"?l.base64.decode(e.aiConversationContext,a.aiConversationContext=l.newBuffer(l.base64.length(e.aiConversationContext)),0):e.aiConversationContext.length>=0&&(a.aiConversationContext=e.aiConversationContext)),e.botPromotionMessageMetadata!=null){if(typeof e.botPromotionMessageMetadata!="object")throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected");a.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.fromObject(e.botPromotionMessageMetadata)}if(e.botModeSelectionMetadata!=null){if(typeof e.botModeSelectionMetadata!="object")throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected");a.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.fromObject(e.botModeSelectionMetadata)}if(e.botQuotaMetadata!=null){if(typeof e.botQuotaMetadata!="object")throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected");a.botQuotaMetadata=p.proto.BotQuotaMetadata.fromObject(e.botQuotaMetadata)}if(e.botAgeCollectionMetadata!=null){if(typeof e.botAgeCollectionMetadata!="object")throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected");a.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.fromObject(e.botAgeCollectionMetadata)}if(e.conversationStarterPromptId!=null&&(a.conversationStarterPromptId=String(e.conversationStarterPromptId)),e.botResponseId!=null&&(a.botResponseId=String(e.botResponseId)),e.verificationMetadata!=null){if(typeof e.verificationMetadata!="object")throw TypeError(".proto.BotMetadata.verificationMetadata: object expected");a.verificationMetadata=p.proto.BotSignatureVerificationMetadata.fromObject(e.verificationMetadata)}if(e.unifiedResponseMutation!=null){if(typeof e.unifiedResponseMutation!="object")throw TypeError(".proto.BotMetadata.unifiedResponseMutation: object expected");a.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.fromObject(e.unifiedResponseMutation)}if(e.botMessageOriginMetadata!=null){if(typeof e.botMessageOriginMetadata!="object")throw TypeError(".proto.BotMetadata.botMessageOriginMetadata: object expected");a.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.fromObject(e.botMessageOriginMetadata)}if(e.inThreadSurveyMetadata!=null){if(typeof e.inThreadSurveyMetadata!="object")throw TypeError(".proto.BotMetadata.inThreadSurveyMetadata: object expected");a.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.fromObject(e.inThreadSurveyMetadata)}if(e.botThreadInfo!=null){if(typeof e.botThreadInfo!="object")throw TypeError(".proto.BotMetadata.botThreadInfo: object expected");a.botThreadInfo=p.proto.AIThreadInfo.fromObject(e.botThreadInfo)}if(e.regenerateMetadata!=null){if(typeof e.regenerateMetadata!="object")throw TypeError(".proto.BotMetadata.regenerateMetadata: object expected");a.regenerateMetadata=p.proto.AIRegenerateMetadata.fromObject(e.regenerateMetadata)}if(e.sessionTransparencyMetadata!=null){if(typeof e.sessionTransparencyMetadata!="object")throw TypeError(".proto.BotMetadata.sessionTransparencyMetadata: object expected");a.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.fromObject(e.sessionTransparencyMetadata)}return e.internalMetadata!=null&&(typeof e.internalMetadata=="string"?l.base64.decode(e.internalMetadata,a.internalMetadata=l.newBuffer(l.base64.length(e.internalMetadata)),0):e.internalMetadata.length>=0&&(a.internalMetadata=e.internalMetadata)),a},t.toObject=function(e,a){a||(a={});var A={};return e.avatarMetadata!=null&&e.hasOwnProperty("avatarMetadata")&&(A.avatarMetadata=p.proto.BotAvatarMetadata.toObject(e.avatarMetadata,a),a.oneofs&&(A._avatarMetadata="avatarMetadata")),e.personaId!=null&&e.hasOwnProperty("personaId")&&(A.personaId=e.personaId,a.oneofs&&(A._personaId="personaId")),e.pluginMetadata!=null&&e.hasOwnProperty("pluginMetadata")&&(A.pluginMetadata=p.proto.BotPluginMetadata.toObject(e.pluginMetadata,a),a.oneofs&&(A._pluginMetadata="pluginMetadata")),e.suggestedPromptMetadata!=null&&e.hasOwnProperty("suggestedPromptMetadata")&&(A.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.toObject(e.suggestedPromptMetadata,a),a.oneofs&&(A._suggestedPromptMetadata="suggestedPromptMetadata")),e.invokerJid!=null&&e.hasOwnProperty("invokerJid")&&(A.invokerJid=e.invokerJid,a.oneofs&&(A._invokerJid="invokerJid")),e.sessionMetadata!=null&&e.hasOwnProperty("sessionMetadata")&&(A.sessionMetadata=p.proto.BotSessionMetadata.toObject(e.sessionMetadata,a),a.oneofs&&(A._sessionMetadata="sessionMetadata")),e.memuMetadata!=null&&e.hasOwnProperty("memuMetadata")&&(A.memuMetadata=p.proto.BotMemuMetadata.toObject(e.memuMetadata,a),a.oneofs&&(A._memuMetadata="memuMetadata")),e.timezone!=null&&e.hasOwnProperty("timezone")&&(A.timezone=e.timezone,a.oneofs&&(A._timezone="timezone")),e.reminderMetadata!=null&&e.hasOwnProperty("reminderMetadata")&&(A.reminderMetadata=p.proto.BotReminderMetadata.toObject(e.reminderMetadata,a),a.oneofs&&(A._reminderMetadata="reminderMetadata")),e.modelMetadata!=null&&e.hasOwnProperty("modelMetadata")&&(A.modelMetadata=p.proto.BotModelMetadata.toObject(e.modelMetadata,a),a.oneofs&&(A._modelMetadata="modelMetadata")),e.messageDisclaimerText!=null&&e.hasOwnProperty("messageDisclaimerText")&&(A.messageDisclaimerText=e.messageDisclaimerText,a.oneofs&&(A._messageDisclaimerText="messageDisclaimerText")),e.progressIndicatorMetadata!=null&&e.hasOwnProperty("progressIndicatorMetadata")&&(A.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.toObject(e.progressIndicatorMetadata,a),a.oneofs&&(A._progressIndicatorMetadata="progressIndicatorMetadata")),e.capabilityMetadata!=null&&e.hasOwnProperty("capabilityMetadata")&&(A.capabilityMetadata=p.proto.BotCapabilityMetadata.toObject(e.capabilityMetadata,a),a.oneofs&&(A._capabilityMetadata="capabilityMetadata")),e.imagineMetadata!=null&&e.hasOwnProperty("imagineMetadata")&&(A.imagineMetadata=p.proto.BotImagineMetadata.toObject(e.imagineMetadata,a),a.oneofs&&(A._imagineMetadata="imagineMetadata")),e.memoryMetadata!=null&&e.hasOwnProperty("memoryMetadata")&&(A.memoryMetadata=p.proto.BotMemoryMetadata.toObject(e.memoryMetadata,a),a.oneofs&&(A._memoryMetadata="memoryMetadata")),e.renderingMetadata!=null&&e.hasOwnProperty("renderingMetadata")&&(A.renderingMetadata=p.proto.BotRenderingMetadata.toObject(e.renderingMetadata,a),a.oneofs&&(A._renderingMetadata="renderingMetadata")),e.botMetricsMetadata!=null&&e.hasOwnProperty("botMetricsMetadata")&&(A.botMetricsMetadata=p.proto.BotMetricsMetadata.toObject(e.botMetricsMetadata,a),a.oneofs&&(A._botMetricsMetadata="botMetricsMetadata")),e.botLinkedAccountsMetadata!=null&&e.hasOwnProperty("botLinkedAccountsMetadata")&&(A.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.toObject(e.botLinkedAccountsMetadata,a),a.oneofs&&(A._botLinkedAccountsMetadata="botLinkedAccountsMetadata")),e.richResponseSourcesMetadata!=null&&e.hasOwnProperty("richResponseSourcesMetadata")&&(A.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.toObject(e.richResponseSourcesMetadata,a),a.oneofs&&(A._richResponseSourcesMetadata="richResponseSourcesMetadata")),e.aiConversationContext!=null&&e.hasOwnProperty("aiConversationContext")&&(A.aiConversationContext=a.bytes===String?l.base64.encode(e.aiConversationContext,0,e.aiConversationContext.length):a.bytes===Array?Array.prototype.slice.call(e.aiConversationContext):e.aiConversationContext,a.oneofs&&(A._aiConversationContext="aiConversationContext")),e.botPromotionMessageMetadata!=null&&e.hasOwnProperty("botPromotionMessageMetadata")&&(A.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.toObject(e.botPromotionMessageMetadata,a),a.oneofs&&(A._botPromotionMessageMetadata="botPromotionMessageMetadata")),e.botModeSelectionMetadata!=null&&e.hasOwnProperty("botModeSelectionMetadata")&&(A.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.toObject(e.botModeSelectionMetadata,a),a.oneofs&&(A._botModeSelectionMetadata="botModeSelectionMetadata")),e.botQuotaMetadata!=null&&e.hasOwnProperty("botQuotaMetadata")&&(A.botQuotaMetadata=p.proto.BotQuotaMetadata.toObject(e.botQuotaMetadata,a),a.oneofs&&(A._botQuotaMetadata="botQuotaMetadata")),e.botAgeCollectionMetadata!=null&&e.hasOwnProperty("botAgeCollectionMetadata")&&(A.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.toObject(e.botAgeCollectionMetadata,a),a.oneofs&&(A._botAgeCollectionMetadata="botAgeCollectionMetadata")),e.conversationStarterPromptId!=null&&e.hasOwnProperty("conversationStarterPromptId")&&(A.conversationStarterPromptId=e.conversationStarterPromptId,a.oneofs&&(A._conversationStarterPromptId="conversationStarterPromptId")),e.botResponseId!=null&&e.hasOwnProperty("botResponseId")&&(A.botResponseId=e.botResponseId,a.oneofs&&(A._botResponseId="botResponseId")),e.verificationMetadata!=null&&e.hasOwnProperty("verificationMetadata")&&(A.verificationMetadata=p.proto.BotSignatureVerificationMetadata.toObject(e.verificationMetadata,a),a.oneofs&&(A._verificationMetadata="verificationMetadata")),e.unifiedResponseMutation!=null&&e.hasOwnProperty("unifiedResponseMutation")&&(A.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.toObject(e.unifiedResponseMutation,a),a.oneofs&&(A._unifiedResponseMutation="unifiedResponseMutation")),e.botMessageOriginMetadata!=null&&e.hasOwnProperty("botMessageOriginMetadata")&&(A.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.toObject(e.botMessageOriginMetadata,a),a.oneofs&&(A._botMessageOriginMetadata="botMessageOriginMetadata")),e.inThreadSurveyMetadata!=null&&e.hasOwnProperty("inThreadSurveyMetadata")&&(A.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.toObject(e.inThreadSurveyMetadata,a),a.oneofs&&(A._inThreadSurveyMetadata="inThreadSurveyMetadata")),e.botThreadInfo!=null&&e.hasOwnProperty("botThreadInfo")&&(A.botThreadInfo=p.proto.AIThreadInfo.toObject(e.botThreadInfo,a),a.oneofs&&(A._botThreadInfo="botThreadInfo")),e.regenerateMetadata!=null&&e.hasOwnProperty("regenerateMetadata")&&(A.regenerateMetadata=p.proto.AIRegenerateMetadata.toObject(e.regenerateMetadata,a),a.oneofs&&(A._regenerateMetadata="regenerateMetadata")),e.sessionTransparencyMetadata!=null&&e.hasOwnProperty("sessionTransparencyMetadata")&&(A.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.toObject(e.sessionTransparencyMetadata,a),a.oneofs&&(A._sessionTransparencyMetadata="sessionTransparencyMetadata")),e.internalMetadata!=null&&e.hasOwnProperty("internalMetadata")&&(A.internalMetadata=a.bytes===String?l.base64.encode(e.internalMetadata,0,e.internalMetadata.length):a.bytes===Array?Array.prototype.slice.call(e.internalMetadata):e.internalMetadata,a.oneofs&&(A._internalMetadata="internalMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetadata"},t})(),n.BotMetricsEntryPoint=(function(){let t={},o=Object.create(t);return o[t[0]="UNDEFINED_ENTRY_POINT"]=0,o[t[1]="FAVICON"]=1,o[t[2]="CHATLIST"]=2,o[t[3]="AISEARCH_NULL_STATE_PAPER_PLANE"]=3,o[t[4]="AISEARCH_NULL_STATE_SUGGESTION"]=4,o[t[5]="AISEARCH_TYPE_AHEAD_SUGGESTION"]=5,o[t[6]="AISEARCH_TYPE_AHEAD_PAPER_PLANE"]=6,o[t[7]="AISEARCH_TYPE_AHEAD_RESULT_CHATLIST"]=7,o[t[8]="AISEARCH_TYPE_AHEAD_RESULT_MESSAGES"]=8,o[t[9]="AIVOICE_SEARCH_BAR"]=9,o[t[10]="AIVOICE_FAVICON"]=10,o[t[11]="AISTUDIO"]=11,o[t[12]="DEEPLINK"]=12,o[t[13]="NOTIFICATION"]=13,o[t[14]="PROFILE_MESSAGE_BUTTON"]=14,o[t[15]="FORWARD"]=15,o[t[16]="APP_SHORTCUT"]=16,o[t[17]="FF_FAMILY"]=17,o[t[18]="AI_TAB"]=18,o[t[19]="AI_HOME"]=19,o[t[20]="AI_DEEPLINK_IMMERSIVE"]=20,o[t[21]="AI_DEEPLINK"]=21,o[t[22]="META_AI_CHAT_SHORTCUT_AI_STUDIO"]=22,o[t[23]="UGC_CHAT_SHORTCUT_AI_STUDIO"]=23,o[t[24]="NEW_CHAT_AI_STUDIO"]=24,o[t[25]="AIVOICE_FAVICON_CALL_HISTORY"]=25,o[t[26]="ASK_META_AI_CONTEXT_MENU"]=26,o[t[27]="ASK_META_AI_CONTEXT_MENU_1ON1"]=27,o[t[28]="ASK_META_AI_CONTEXT_MENU_GROUP"]=28,o[t[29]="INVOKE_META_AI_1ON1"]=29,o[t[30]="INVOKE_META_AI_GROUP"]=30,o[t[31]="META_AI_FORWARD"]=31,o[t[32]="NEW_CHAT_AI_CONTACT"]=32,o[t[33]="MESSAGE_QUICK_ACTION_1_ON_1_CHAT"]=33,o[t[34]="MESSAGE_QUICK_ACTION_GROUP_CHAT"]=34,o[t[35]="ATTACHMENT_TRAY_1_ON_1_CHAT"]=35,o[t[36]="ATTACHMENT_TRAY_GROUP_CHAT"]=36,o[t[37]="ASK_META_AI_MEDIA_VIEWER_1ON1"]=37,o[t[38]="ASK_META_AI_MEDIA_VIEWER_GROUP"]=38,o})(),n.BotMetricsMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.destinationId=e.string();break}case 2:{s.destinationEntryPoint=e.int32();break}case 3:{s.threadOrigin=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMetricsMetadata)return e;var a=new p.proto.BotMetricsMetadata;switch(e.destinationId!=null&&(a.destinationId=String(e.destinationId)),e.destinationEntryPoint){default:if(typeof e.destinationEntryPoint=="number"){a.destinationEntryPoint=e.destinationEntryPoint;break}break;case"UNDEFINED_ENTRY_POINT":case 0:a.destinationEntryPoint=0;break;case"FAVICON":case 1:a.destinationEntryPoint=1;break;case"CHATLIST":case 2:a.destinationEntryPoint=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:a.destinationEntryPoint=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:a.destinationEntryPoint=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:a.destinationEntryPoint=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:a.destinationEntryPoint=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:a.destinationEntryPoint=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:a.destinationEntryPoint=8;break;case"AIVOICE_SEARCH_BAR":case 9:a.destinationEntryPoint=9;break;case"AIVOICE_FAVICON":case 10:a.destinationEntryPoint=10;break;case"AISTUDIO":case 11:a.destinationEntryPoint=11;break;case"DEEPLINK":case 12:a.destinationEntryPoint=12;break;case"NOTIFICATION":case 13:a.destinationEntryPoint=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:a.destinationEntryPoint=14;break;case"FORWARD":case 15:a.destinationEntryPoint=15;break;case"APP_SHORTCUT":case 16:a.destinationEntryPoint=16;break;case"FF_FAMILY":case 17:a.destinationEntryPoint=17;break;case"AI_TAB":case 18:a.destinationEntryPoint=18;break;case"AI_HOME":case 19:a.destinationEntryPoint=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:a.destinationEntryPoint=20;break;case"AI_DEEPLINK":case 21:a.destinationEntryPoint=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:a.destinationEntryPoint=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:a.destinationEntryPoint=23;break;case"NEW_CHAT_AI_STUDIO":case 24:a.destinationEntryPoint=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:a.destinationEntryPoint=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:a.destinationEntryPoint=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:a.destinationEntryPoint=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:a.destinationEntryPoint=28;break;case"INVOKE_META_AI_1ON1":case 29:a.destinationEntryPoint=29;break;case"INVOKE_META_AI_GROUP":case 30:a.destinationEntryPoint=30;break;case"META_AI_FORWARD":case 31:a.destinationEntryPoint=31;break;case"NEW_CHAT_AI_CONTACT":case 32:a.destinationEntryPoint=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:a.destinationEntryPoint=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:a.destinationEntryPoint=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:a.destinationEntryPoint=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:a.destinationEntryPoint=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:a.destinationEntryPoint=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:a.destinationEntryPoint=38;break}switch(e.threadOrigin){default:if(typeof e.threadOrigin=="number"){a.threadOrigin=e.threadOrigin;break}break;case"AI_TAB_THREAD":case 1:a.threadOrigin=1;break;case"AI_HOME_THREAD":case 2:a.threadOrigin=2;break;case"AI_DEEPLINK_IMMERSIVE_THREAD":case 3:a.threadOrigin=3;break;case"AI_DEEPLINK_THREAD":case 4:a.threadOrigin=4;break;case"ASK_META_AI_CONTEXT_MENU_THREAD":case 5:a.threadOrigin=5;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.destinationId!=null&&e.hasOwnProperty("destinationId")&&(A.destinationId=e.destinationId,a.oneofs&&(A._destinationId="destinationId")),e.destinationEntryPoint!=null&&e.hasOwnProperty("destinationEntryPoint")&&(A.destinationEntryPoint=a.enums===String?p.proto.BotMetricsEntryPoint[e.destinationEntryPoint]===void 0?e.destinationEntryPoint:p.proto.BotMetricsEntryPoint[e.destinationEntryPoint]:e.destinationEntryPoint,a.oneofs&&(A._destinationEntryPoint="destinationEntryPoint")),e.threadOrigin!=null&&e.hasOwnProperty("threadOrigin")&&(A.threadOrigin=a.enums===String?p.proto.BotMetricsThreadEntryPoint[e.threadOrigin]===void 0?e.threadOrigin:p.proto.BotMetricsThreadEntryPoint[e.threadOrigin]:e.threadOrigin,a.oneofs&&(A._threadOrigin="threadOrigin")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetricsMetadata"},t})(),n.BotMetricsThreadEntryPoint=(function(){let t={},o=Object.create(t);return o[t[1]="AI_TAB_THREAD"]=1,o[t[2]="AI_HOME_THREAD"]=2,o[t[3]="AI_DEEPLINK_IMMERSIVE_THREAD"]=3,o[t[4]="AI_DEEPLINK_THREAD"]=4,o[t[5]="ASK_META_AI_CONTEXT_MENU_THREAD"]=5,o})(),n.BotModeSelectionMetadata=(function(){function t(o){if(this.mode=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{if(r.mode&&r.mode.length||(r.mode=[]),(s&7)===2)for(var g=i.uint32()+i.pos;i.pos>>3){case 1:{s.modelType=e.int32();break}case 2:{s.premiumModelStatus=e.int32();break}case 3:{s.modelNameOverride=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotModelMetadata)return e;var a=new p.proto.BotModelMetadata;switch(e.modelType){default:if(typeof e.modelType=="number"){a.modelType=e.modelType;break}break;case"UNKNOWN_TYPE":case 0:a.modelType=0;break;case"LLAMA_PROD":case 1:a.modelType=1;break;case"LLAMA_PROD_PREMIUM":case 2:a.modelType=2;break}switch(e.premiumModelStatus){default:if(typeof e.premiumModelStatus=="number"){a.premiumModelStatus=e.premiumModelStatus;break}break;case"UNKNOWN_STATUS":case 0:a.premiumModelStatus=0;break;case"AVAILABLE":case 1:a.premiumModelStatus=1;break;case"QUOTA_EXCEED_LIMIT":case 2:a.premiumModelStatus=2;break}return e.modelNameOverride!=null&&(a.modelNameOverride=String(e.modelNameOverride)),a},t.toObject=function(e,a){a||(a={});var A={};return e.modelType!=null&&e.hasOwnProperty("modelType")&&(A.modelType=a.enums===String?p.proto.BotModelMetadata.ModelType[e.modelType]===void 0?e.modelType:p.proto.BotModelMetadata.ModelType[e.modelType]:e.modelType,a.oneofs&&(A._modelType="modelType")),e.premiumModelStatus!=null&&e.hasOwnProperty("premiumModelStatus")&&(A.premiumModelStatus=a.enums===String?p.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]===void 0?e.premiumModelStatus:p.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]:e.premiumModelStatus,a.oneofs&&(A._premiumModelStatus="premiumModelStatus")),e.modelNameOverride!=null&&e.hasOwnProperty("modelNameOverride")&&(A.modelNameOverride=e.modelNameOverride,a.oneofs&&(A._modelNameOverride="modelNameOverride")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotModelMetadata"},t.ModelType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="LLAMA_PROD"]=1,e[i[2]="LLAMA_PROD_PREMIUM"]=2,e})(),t.PremiumModelStatus=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_STATUS"]=0,e[i[1]="AVAILABLE"]=1,e[i[2]="QUOTA_EXCEED_LIMIT"]=2,e})(),t})(),n.BotPluginMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.provider=e.int32();break}case 2:{s.pluginType=e.int32();break}case 3:{s.thumbnailCdnUrl=e.string();break}case 4:{s.profilePhotoCdnUrl=e.string();break}case 5:{s.searchProviderUrl=e.string();break}case 6:{s.referenceIndex=e.uint32();break}case 7:{s.expectedLinksCount=e.uint32();break}case 9:{s.searchQuery=e.string();break}case 10:{s.parentPluginMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 11:{s.deprecatedField=e.int32();break}case 12:{s.parentPluginType=e.int32();break}case 13:{s.faviconCdnUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotPluginMetadata)return e;var a=new p.proto.BotPluginMetadata;switch(e.provider){default:if(typeof e.provider=="number"){a.provider=e.provider;break}break;case"UNKNOWN":case 0:a.provider=0;break;case"BING":case 1:a.provider=1;break;case"GOOGLE":case 2:a.provider=2;break;case"SUPPORT":case 3:a.provider=3;break}switch(e.pluginType){default:if(typeof e.pluginType=="number"){a.pluginType=e.pluginType;break}break;case"UNKNOWN_PLUGIN":case 0:a.pluginType=0;break;case"REELS":case 1:a.pluginType=1;break;case"SEARCH":case 2:a.pluginType=2;break}if(e.thumbnailCdnUrl!=null&&(a.thumbnailCdnUrl=String(e.thumbnailCdnUrl)),e.profilePhotoCdnUrl!=null&&(a.profilePhotoCdnUrl=String(e.profilePhotoCdnUrl)),e.searchProviderUrl!=null&&(a.searchProviderUrl=String(e.searchProviderUrl)),e.referenceIndex!=null&&(a.referenceIndex=e.referenceIndex>>>0),e.expectedLinksCount!=null&&(a.expectedLinksCount=e.expectedLinksCount>>>0),e.searchQuery!=null&&(a.searchQuery=String(e.searchQuery)),e.parentPluginMessageKey!=null){if(typeof e.parentPluginMessageKey!="object")throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected");a.parentPluginMessageKey=p.proto.MessageKey.fromObject(e.parentPluginMessageKey)}switch(e.deprecatedField){default:if(typeof e.deprecatedField=="number"){a.deprecatedField=e.deprecatedField;break}break;case"UNKNOWN_PLUGIN":case 0:a.deprecatedField=0;break;case"REELS":case 1:a.deprecatedField=1;break;case"SEARCH":case 2:a.deprecatedField=2;break}switch(e.parentPluginType){default:if(typeof e.parentPluginType=="number"){a.parentPluginType=e.parentPluginType;break}break;case"UNKNOWN_PLUGIN":case 0:a.parentPluginType=0;break;case"REELS":case 1:a.parentPluginType=1;break;case"SEARCH":case 2:a.parentPluginType=2;break}return e.faviconCdnUrl!=null&&(a.faviconCdnUrl=String(e.faviconCdnUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.provider!=null&&e.hasOwnProperty("provider")&&(A.provider=a.enums===String?p.proto.BotPluginMetadata.SearchProvider[e.provider]===void 0?e.provider:p.proto.BotPluginMetadata.SearchProvider[e.provider]:e.provider,a.oneofs&&(A._provider="provider")),e.pluginType!=null&&e.hasOwnProperty("pluginType")&&(A.pluginType=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.pluginType]===void 0?e.pluginType:p.proto.BotPluginMetadata.PluginType[e.pluginType]:e.pluginType,a.oneofs&&(A._pluginType="pluginType")),e.thumbnailCdnUrl!=null&&e.hasOwnProperty("thumbnailCdnUrl")&&(A.thumbnailCdnUrl=e.thumbnailCdnUrl,a.oneofs&&(A._thumbnailCdnUrl="thumbnailCdnUrl")),e.profilePhotoCdnUrl!=null&&e.hasOwnProperty("profilePhotoCdnUrl")&&(A.profilePhotoCdnUrl=e.profilePhotoCdnUrl,a.oneofs&&(A._profilePhotoCdnUrl="profilePhotoCdnUrl")),e.searchProviderUrl!=null&&e.hasOwnProperty("searchProviderUrl")&&(A.searchProviderUrl=e.searchProviderUrl,a.oneofs&&(A._searchProviderUrl="searchProviderUrl")),e.referenceIndex!=null&&e.hasOwnProperty("referenceIndex")&&(A.referenceIndex=e.referenceIndex,a.oneofs&&(A._referenceIndex="referenceIndex")),e.expectedLinksCount!=null&&e.hasOwnProperty("expectedLinksCount")&&(A.expectedLinksCount=e.expectedLinksCount,a.oneofs&&(A._expectedLinksCount="expectedLinksCount")),e.searchQuery!=null&&e.hasOwnProperty("searchQuery")&&(A.searchQuery=e.searchQuery,a.oneofs&&(A._searchQuery="searchQuery")),e.parentPluginMessageKey!=null&&e.hasOwnProperty("parentPluginMessageKey")&&(A.parentPluginMessageKey=p.proto.MessageKey.toObject(e.parentPluginMessageKey,a),a.oneofs&&(A._parentPluginMessageKey="parentPluginMessageKey")),e.deprecatedField!=null&&e.hasOwnProperty("deprecatedField")&&(A.deprecatedField=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.deprecatedField]===void 0?e.deprecatedField:p.proto.BotPluginMetadata.PluginType[e.deprecatedField]:e.deprecatedField,a.oneofs&&(A._deprecatedField="deprecatedField")),e.parentPluginType!=null&&e.hasOwnProperty("parentPluginType")&&(A.parentPluginType=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.parentPluginType]===void 0?e.parentPluginType:p.proto.BotPluginMetadata.PluginType[e.parentPluginType]:e.parentPluginType,a.oneofs&&(A._parentPluginType="parentPluginType")),e.faviconCdnUrl!=null&&e.hasOwnProperty("faviconCdnUrl")&&(A.faviconCdnUrl=e.faviconCdnUrl,a.oneofs&&(A._faviconCdnUrl="faviconCdnUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPluginMetadata"},t.PluginType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_PLUGIN"]=0,e[i[1]="REELS"]=1,e[i[2]="SEARCH"]=2,e})(),t.SearchProvider=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="BING"]=1,e[i[2]="GOOGLE"]=2,e[i[3]="SUPPORT"]=3,e})(),t})(),n.BotProgressIndicatorMetadata=(function(){function t(i){if(this.stepsMetadata=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.progressDescription=e.string();break}case 2:{s.stepsMetadata&&s.stepsMetadata.length||(s.stepsMetadata=[]),s.stepsMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotProgressIndicatorMetadata)return e;var a=new p.proto.BotProgressIndicatorMetadata;if(e.progressDescription!=null&&(a.progressDescription=String(e.progressDescription)),e.stepsMetadata){if(!Array.isArray(e.stepsMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected");a.stepsMetadata=[];for(var A=0;A>>3){case 1:{c.statusTitle=A.string();break}case 2:{c.statusBody=A.string();break}case 3:{c.sourcesMetadata&&c.sourcesMetadata.length||(c.sourcesMetadata=[]),c.sourcesMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.decode(A,A.uint32()));break}case 4:{c.status=A.int32();break}case 5:{c.isReasoning=A.bool();break}case 6:{c.isEnhancedSearch=A.bool();break}case 7:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata)return A;var r=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata;if(A.statusTitle!=null&&(r.statusTitle=String(A.statusTitle)),A.statusBody!=null&&(r.statusBody=String(A.statusBody)),A.sourcesMetadata){if(!Array.isArray(A.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected");r.sourcesMetadata=[];for(var s=0;s>>3){case 1:{d.title=s.string();break}case 2:{d.provider=s.int32();break}case 3:{d.sourceUrl=s.string();break}case 4:{d.favIconUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata;switch(s.title!=null&&(g.title=String(s.title)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN_PROVIDER":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.favIconUrl!=null&&(g.favIconUrl=String(s.favIconUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]===void 0?s.provider:p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.favIconUrl!=null&&s.hasOwnProperty("favIconUrl")&&(c.favIconUrl=s.favIconUrl,g.oneofs&&(c._favIconUrl="favIconUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata"},a})(),i.BotPlanningSearchSourcesMetadata=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.sourceTitle=s.string();break}case 2:{d.provider=s.int32();break}case 3:{d.sourceUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata;switch(s.sourceTitle!=null&&(g.sourceTitle=String(s.sourceTitle)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.sourceTitle!=null&&s.hasOwnProperty("sourceTitle")&&(c.sourceTitle=s.sourceTitle,g.oneofs&&(c._sourceTitle="sourceTitle")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]===void 0?s.provider:p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata"},a.BotPlanningSearchSourceProvider=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="OTHER"]=1,s[r[2]="GOOGLE"]=2,s[r[3]="BING"]=3,s})(),a})(),i.BotPlanningStepSectionMetadata=(function(){function a(r){if(this.sourcesMetadata=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.sectionTitle=s.string();break}case 2:{d.sectionBody=s.string();break}case 3:{d.sourcesMetadata&&d.sourcesMetadata.length||(d.sourcesMetadata=[]),d.sourcesMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata;if(s.sectionTitle!=null&&(g.sectionTitle=String(s.sectionTitle)),s.sectionBody!=null&&(g.sectionBody=String(s.sectionBody)),s.sourcesMetadata){if(!Array.isArray(s.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected");g.sourcesMetadata=[];for(var c=0;c>>3){case 1:{s.promotionType=e.int32();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotPromotionMessageMetadata)return e;var a=new p.proto.BotPromotionMessageMetadata;switch(e.promotionType){default:if(typeof e.promotionType=="number"){a.promotionType=e.promotionType;break}break;case"UNKNOWN_TYPE":case 0:a.promotionType=0;break;case"C50":case 1:a.promotionType=1;break;case"SURVEY_PLATFORM":case 2:a.promotionType=2;break}return e.buttonTitle!=null&&(a.buttonTitle=String(e.buttonTitle)),a},t.toObject=function(e,a){a||(a={});var A={};return e.promotionType!=null&&e.hasOwnProperty("promotionType")&&(A.promotionType=a.enums===String?p.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]===void 0?e.promotionType:p.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]:e.promotionType,a.oneofs&&(A._promotionType="promotionType")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,a.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromotionMessageMetadata"},t.BotPromotionType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="C50"]=1,e[i[2]="SURVEY_PLATFORM"]=2,e})(),t})(),n.BotPromptSuggestion=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.prompt=e.string();break}case 2:{s.promptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotPromptSuggestion)return e;var a=new p.proto.BotPromptSuggestion;return e.prompt!=null&&(a.prompt=String(e.prompt)),e.promptId!=null&&(a.promptId=String(e.promptId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.prompt!=null&&e.hasOwnProperty("prompt")&&(A.prompt=e.prompt,a.oneofs&&(A._prompt="prompt")),e.promptId!=null&&e.hasOwnProperty("promptId")&&(A.promptId=e.promptId,a.oneofs&&(A._promptId="promptId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromptSuggestion"},t})(),n.BotPromptSuggestions=(function(){function t(o){if(this.suggestions=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(p.proto.BotPromptSuggestion.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotPromptSuggestions)return i;var e=new p.proto.BotPromptSuggestions;if(i.suggestions){if(!Array.isArray(i.suggestions))throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected");e.suggestions=[];for(var a=0;a>>3){case 1:{r.botFeatureQuotaMetadata&&r.botFeatureQuotaMetadata.length||(r.botFeatureQuotaMetadata=[]),r.botFeatureQuotaMetadata.push(p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotQuotaMetadata)return i;var e=new p.proto.BotQuotaMetadata;if(i.botFeatureQuotaMetadata){if(!Array.isArray(i.botFeatureQuotaMetadata))throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected");e.botFeatureQuotaMetadata=[];for(var a=0;a>>3){case 1:{g.featureType=a.int32();break}case 2:{g.remainingQuota=a.uint32();break}case 3:{g.expirationTimestamp=a.uint64();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata)return a;var A=new p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata;switch(a.featureType){default:if(typeof a.featureType=="number"){A.featureType=a.featureType;break}break;case"UNKNOWN_FEATURE":case 0:A.featureType=0;break;case"REASONING_FEATURE":case 1:A.featureType=1;break}return a.remainingQuota!=null&&(A.remainingQuota=a.remainingQuota>>>0),a.expirationTimestamp!=null&&(l.Long?(A.expirationTimestamp=l.Long.fromValue(a.expirationTimestamp)).unsigned=!0:typeof a.expirationTimestamp=="string"?A.expirationTimestamp=parseInt(a.expirationTimestamp,10):typeof a.expirationTimestamp=="number"?A.expirationTimestamp=a.expirationTimestamp:typeof a.expirationTimestamp=="object"&&(A.expirationTimestamp=new l.LongBits(a.expirationTimestamp.low>>>0,a.expirationTimestamp.high>>>0).toNumber(!0))),A},o.toObject=function(a,A){A||(A={});var r={};return a.featureType!=null&&a.hasOwnProperty("featureType")&&(r.featureType=A.enums===String?p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[a.featureType]===void 0?a.featureType:p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[a.featureType]:a.featureType,A.oneofs&&(r._featureType="featureType")),a.remainingQuota!=null&&a.hasOwnProperty("remainingQuota")&&(r.remainingQuota=a.remainingQuota,A.oneofs&&(r._remainingQuota="remainingQuota")),a.expirationTimestamp!=null&&a.hasOwnProperty("expirationTimestamp")&&(typeof a.expirationTimestamp=="number"?r.expirationTimestamp=A.longs===String?String(a.expirationTimestamp):a.expirationTimestamp:r.expirationTimestamp=A.longs===String?ge(a.expirationTimestamp,!0):A.longs===Number?ce(a.expirationTimestamp,!0):a.expirationTimestamp,A.oneofs&&(r._expirationTimestamp="expirationTimestamp")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.BotQuotaMetadata.BotFeatureQuotaMetadata"},o.BotFeatureType=(function(){let e={},a=Object.create(e);return a[e[0]="UNKNOWN_FEATURE"]=0,a[e[1]="REASONING_FEATURE"]=1,a})(),o})(),t})(),n.BotReminderMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.requestMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.action=e.int32();break}case 3:{s.name=e.string();break}case 4:{s.nextTriggerTimestamp=e.uint64();break}case 5:{s.frequency=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotReminderMetadata)return e;var a=new p.proto.BotReminderMetadata;if(e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected");a.requestMessageKey=p.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.action){default:if(typeof e.action=="number"){a.action=e.action;break}break;case"NOTIFY":case 1:a.action=1;break;case"CREATE":case 2:a.action=2;break;case"DELETE":case 3:a.action=3;break;case"UPDATE":case 4:a.action=4;break}switch(e.name!=null&&(a.name=String(e.name)),e.nextTriggerTimestamp!=null&&(l.Long?(a.nextTriggerTimestamp=l.Long.fromValue(e.nextTriggerTimestamp)).unsigned=!0:typeof e.nextTriggerTimestamp=="string"?a.nextTriggerTimestamp=parseInt(e.nextTriggerTimestamp,10):typeof e.nextTriggerTimestamp=="number"?a.nextTriggerTimestamp=e.nextTriggerTimestamp:typeof e.nextTriggerTimestamp=="object"&&(a.nextTriggerTimestamp=new l.LongBits(e.nextTriggerTimestamp.low>>>0,e.nextTriggerTimestamp.high>>>0).toNumber(!0))),e.frequency){default:if(typeof e.frequency=="number"){a.frequency=e.frequency;break}break;case"ONCE":case 1:a.frequency=1;break;case"DAILY":case 2:a.frequency=2;break;case"WEEKLY":case 3:a.frequency=3;break;case"BIWEEKLY":case 4:a.frequency=4;break;case"MONTHLY":case 5:a.frequency=5;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=p.proto.MessageKey.toObject(e.requestMessageKey,a),a.oneofs&&(A._requestMessageKey="requestMessageKey")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=a.enums===String?p.proto.BotReminderMetadata.ReminderAction[e.action]===void 0?e.action:p.proto.BotReminderMetadata.ReminderAction[e.action]:e.action,a.oneofs&&(A._action="action")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,a.oneofs&&(A._name="name")),e.nextTriggerTimestamp!=null&&e.hasOwnProperty("nextTriggerTimestamp")&&(typeof e.nextTriggerTimestamp=="number"?A.nextTriggerTimestamp=a.longs===String?String(e.nextTriggerTimestamp):e.nextTriggerTimestamp:A.nextTriggerTimestamp=a.longs===String?ge(e.nextTriggerTimestamp,!0):a.longs===Number?ce(e.nextTriggerTimestamp,!0):e.nextTriggerTimestamp,a.oneofs&&(A._nextTriggerTimestamp="nextTriggerTimestamp")),e.frequency!=null&&e.hasOwnProperty("frequency")&&(A.frequency=a.enums===String?p.proto.BotReminderMetadata.ReminderFrequency[e.frequency]===void 0?e.frequency:p.proto.BotReminderMetadata.ReminderFrequency[e.frequency]:e.frequency,a.oneofs&&(A._frequency="frequency")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotReminderMetadata"},t.ReminderAction=(function(){let i={},e=Object.create(i);return e[i[1]="NOTIFY"]=1,e[i[2]="CREATE"]=2,e[i[3]="DELETE"]=3,e[i[4]="UPDATE"]=4,e})(),t.ReminderFrequency=(function(){let i={},e=Object.create(i);return e[i[1]="ONCE"]=1,e[i[2]="DAILY"]=2,e[i[3]="WEEKLY"]=3,e[i[4]="BIWEEKLY"]=4,e[i[5]="MONTHLY"]=5,e})(),t})(),n.BotRenderingMetadata=(function(){function t(o){if(this.keywords=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.keywords&&r.keywords.length||(r.keywords=[]),r.keywords.push(p.proto.BotRenderingMetadata.Keyword.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotRenderingMetadata)return i;var e=new p.proto.BotRenderingMetadata;if(i.keywords){if(!Array.isArray(i.keywords))throw TypeError(".proto.BotRenderingMetadata.keywords: array expected");e.keywords=[];for(var a=0;a>>3){case 1:{g.value=a.string();break}case 2:{g.associatedPrompts&&g.associatedPrompts.length||(g.associatedPrompts=[]),g.associatedPrompts.push(a.string());break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotRenderingMetadata.Keyword)return a;var A=new p.proto.BotRenderingMetadata.Keyword;if(a.value!=null&&(A.value=String(a.value)),a.associatedPrompts){if(!Array.isArray(a.associatedPrompts))throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected");A.associatedPrompts=[];for(var r=0;r>>3){case 1:{s.sessionId=e.string();break}case 2:{s.sessionSource=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotSessionMetadata)return e;var a=new p.proto.BotSessionMetadata;switch(e.sessionId!=null&&(a.sessionId=String(e.sessionId)),e.sessionSource){default:if(typeof e.sessionSource=="number"){a.sessionSource=e.sessionSource;break}break;case"NONE":case 0:a.sessionSource=0;break;case"NULL_STATE":case 1:a.sessionSource=1;break;case"TYPEAHEAD":case 2:a.sessionSource=2;break;case"USER_INPUT":case 3:a.sessionSource=3;break;case"EMU_FLASH":case 4:a.sessionSource=4;break;case"EMU_FLASH_FOLLOWUP":case 5:a.sessionSource=5;break;case"VOICE":case 6:a.sessionSource=6;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,a.oneofs&&(A._sessionId="sessionId")),e.sessionSource!=null&&e.hasOwnProperty("sessionSource")&&(A.sessionSource=a.enums===String?p.proto.BotSessionSource[e.sessionSource]===void 0?e.sessionSource:p.proto.BotSessionSource[e.sessionSource]:e.sessionSource,a.oneofs&&(A._sessionSource="sessionSource")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotSessionMetadata"},t})(),n.BotSessionSource=(function(){let t={},o=Object.create(t);return o[t[0]="NONE"]=0,o[t[1]="NULL_STATE"]=1,o[t[2]="TYPEAHEAD"]=2,o[t[3]="USER_INPUT"]=3,o[t[4]="EMU_FLASH"]=4,o[t[5]="EMU_FLASH_FOLLOWUP"]=5,o[t[6]="VOICE"]=6,o})(),n.BotSignatureVerificationMetadata=(function(){function t(o){if(this.proofs=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.proofs&&r.proofs.length||(r.proofs=[]),r.proofs.push(p.proto.BotSignatureVerificationUseCaseProof.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotSignatureVerificationMetadata)return i;var e=new p.proto.BotSignatureVerificationMetadata;if(i.proofs){if(!Array.isArray(i.proofs))throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: array expected");e.proofs=[];for(var a=0;a>>3){case 1:{s.version=e.int32();break}case 2:{s.useCase=e.int32();break}case 3:{s.signature=e.bytes();break}case 4:{s.certificateChain&&s.certificateChain.length||(s.certificateChain=[]),s.certificateChain.push(e.bytes());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotSignatureVerificationUseCaseProof)return e;var a=new p.proto.BotSignatureVerificationUseCaseProof;switch(e.version!=null&&(a.version=e.version|0),e.useCase){default:if(typeof e.useCase=="number"){a.useCase=e.useCase;break}break;case"UNSPECIFIED":case 0:a.useCase=0;break;case"WA_BOT_MSG":case 1:a.useCase=1;break}if(e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.certificateChain){if(!Array.isArray(e.certificateChain))throw TypeError(".proto.BotSignatureVerificationUseCaseProof.certificateChain: array expected");a.certificateChain=[];for(var A=0;A=0&&(a.certificateChain[A]=e.certificateChain[A])}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.certificateChain=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),e.useCase!=null&&e.hasOwnProperty("useCase")&&(A.useCase=a.enums===String?p.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]===void 0?e.useCase:p.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]:e.useCase,a.oneofs&&(A._useCase="useCase")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.certificateChain&&e.certificateChain.length){A.certificateChain=[];for(var r=0;r>>3){case 1:{r.sources&&r.sources.length||(r.sources=[]),r.sources.push(p.proto.BotSourcesMetadata.BotSourceItem.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotSourcesMetadata)return i;var e=new p.proto.BotSourcesMetadata;if(i.sources){if(!Array.isArray(i.sources))throw TypeError(".proto.BotSourcesMetadata.sources: array expected");e.sources=[];for(var a=0;a>>3){case 1:{g.provider=a.int32();break}case 2:{g.thumbnailCdnUrl=a.string();break}case 3:{g.sourceProviderUrl=a.string();break}case 4:{g.sourceQuery=a.string();break}case 5:{g.faviconCdnUrl=a.string();break}case 6:{g.citationNumber=a.uint32();break}case 7:{g.sourceTitle=a.string();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotSourcesMetadata.BotSourceItem)return a;var A=new p.proto.BotSourcesMetadata.BotSourceItem;switch(a.provider){default:if(typeof a.provider=="number"){A.provider=a.provider;break}break;case"UNKNOWN":case 0:A.provider=0;break;case"BING":case 1:A.provider=1;break;case"GOOGLE":case 2:A.provider=2;break;case"SUPPORT":case 3:A.provider=3;break;case"OTHER":case 4:A.provider=4;break}return a.thumbnailCdnUrl!=null&&(A.thumbnailCdnUrl=String(a.thumbnailCdnUrl)),a.sourceProviderUrl!=null&&(A.sourceProviderUrl=String(a.sourceProviderUrl)),a.sourceQuery!=null&&(A.sourceQuery=String(a.sourceQuery)),a.faviconCdnUrl!=null&&(A.faviconCdnUrl=String(a.faviconCdnUrl)),a.citationNumber!=null&&(A.citationNumber=a.citationNumber>>>0),a.sourceTitle!=null&&(A.sourceTitle=String(a.sourceTitle)),A},o.toObject=function(a,A){A||(A={});var r={};return a.provider!=null&&a.hasOwnProperty("provider")&&(r.provider=A.enums===String?p.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[a.provider]===void 0?a.provider:p.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[a.provider]:a.provider,A.oneofs&&(r._provider="provider")),a.thumbnailCdnUrl!=null&&a.hasOwnProperty("thumbnailCdnUrl")&&(r.thumbnailCdnUrl=a.thumbnailCdnUrl,A.oneofs&&(r._thumbnailCdnUrl="thumbnailCdnUrl")),a.sourceProviderUrl!=null&&a.hasOwnProperty("sourceProviderUrl")&&(r.sourceProviderUrl=a.sourceProviderUrl,A.oneofs&&(r._sourceProviderUrl="sourceProviderUrl")),a.sourceQuery!=null&&a.hasOwnProperty("sourceQuery")&&(r.sourceQuery=a.sourceQuery,A.oneofs&&(r._sourceQuery="sourceQuery")),a.faviconCdnUrl!=null&&a.hasOwnProperty("faviconCdnUrl")&&(r.faviconCdnUrl=a.faviconCdnUrl,A.oneofs&&(r._faviconCdnUrl="faviconCdnUrl")),a.citationNumber!=null&&a.hasOwnProperty("citationNumber")&&(r.citationNumber=a.citationNumber,A.oneofs&&(r._citationNumber="citationNumber")),a.sourceTitle!=null&&a.hasOwnProperty("sourceTitle")&&(r.sourceTitle=a.sourceTitle,A.oneofs&&(r._sourceTitle="sourceTitle")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.BotSourcesMetadata.BotSourceItem"},o.SourceProvider=(function(){let e={},a=Object.create(e);return a[e[0]="UNKNOWN"]=0,a[e[1]="BING"]=1,a[e[2]="GOOGLE"]=2,a[e[3]="SUPPORT"]=3,a[e[4]="OTHER"]=4,a})(),o})(),t})(),n.BotSuggestedPromptMetadata=(function(){function t(i){if(this.suggestedPrompts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.suggestedPrompts&&s.suggestedPrompts.length||(s.suggestedPrompts=[]),s.suggestedPrompts.push(e.string());break}case 2:{s.selectedPromptIndex=e.uint32();break}case 3:{s.promptSuggestions=p.proto.BotPromptSuggestions.decode(e,e.uint32());break}case 4:{s.selectedPromptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotSuggestedPromptMetadata)return e;var a=new p.proto.BotSuggestedPromptMetadata;if(e.suggestedPrompts){if(!Array.isArray(e.suggestedPrompts))throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected");a.suggestedPrompts=[];for(var A=0;A>>0),e.promptSuggestions!=null){if(typeof e.promptSuggestions!="object")throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected");a.promptSuggestions=p.proto.BotPromptSuggestions.fromObject(e.promptSuggestions)}return e.selectedPromptId!=null&&(a.selectedPromptId=String(e.selectedPromptId)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.suggestedPrompts=[]),e.suggestedPrompts&&e.suggestedPrompts.length){A.suggestedPrompts=[];for(var r=0;r>>3){case 1:{s.sbsMetadata=p.proto.BotUnifiedResponseMutation.SideBySideMetadata.decode(e,e.uint32());break}case 2:{s.mediaDetailsMetadataList&&s.mediaDetailsMetadataList.length||(s.mediaDetailsMetadataList=[]),s.mediaDetailsMetadataList.push(p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotUnifiedResponseMutation)return e;var a=new p.proto.BotUnifiedResponseMutation;if(e.sbsMetadata!=null){if(typeof e.sbsMetadata!="object")throw TypeError(".proto.BotUnifiedResponseMutation.sbsMetadata: object expected");a.sbsMetadata=p.proto.BotUnifiedResponseMutation.SideBySideMetadata.fromObject(e.sbsMetadata)}if(e.mediaDetailsMetadataList){if(!Array.isArray(e.mediaDetailsMetadataList))throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: array expected");a.mediaDetailsMetadataList=[];for(var A=0;A>>3){case 1:{c.id=A.string();break}case 2:{c.highResMedia=p.proto.BotMediaMetadata.decode(A,A.uint32());break}case 3:{c.previewMedia=p.proto.BotMediaMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata)return A;var r=new p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata;if(A.id!=null&&(r.id=String(A.id)),A.highResMedia!=null){if(typeof A.highResMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.highResMedia: object expected");r.highResMedia=p.proto.BotMediaMetadata.fromObject(A.highResMedia)}if(A.previewMedia!=null){if(typeof A.previewMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.previewMedia: object expected");r.previewMedia=p.proto.BotMediaMetadata.fromObject(A.previewMedia)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),A.highResMedia!=null&&A.hasOwnProperty("highResMedia")&&(s.highResMedia=p.proto.BotMediaMetadata.toObject(A.highResMedia,r),r.oneofs&&(s._highResMedia="highResMedia")),A.previewMedia!=null&&A.hasOwnProperty("previewMedia")&&(s.previewMedia=p.proto.BotMediaMetadata.toObject(A.previewMedia,r),r.oneofs&&(s._previewMedia="previewMedia")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.MediaDetailsMetadata"},i})(),t.SideBySideMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.primaryResponseId=A.string();break}case 2:{c.surveyCtaHasRendered=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotUnifiedResponseMutation.SideBySideMetadata)return A;var r=new p.proto.BotUnifiedResponseMutation.SideBySideMetadata;return A.primaryResponseId!=null&&(r.primaryResponseId=String(A.primaryResponseId)),A.surveyCtaHasRendered!=null&&(r.surveyCtaHasRendered=!!A.surveyCtaHasRendered),r},i.toObject=function(A,r){r||(r={});var s={};return A.primaryResponseId!=null&&A.hasOwnProperty("primaryResponseId")&&(s.primaryResponseId=A.primaryResponseId,r.oneofs&&(s._primaryResponseId="primaryResponseId")),A.surveyCtaHasRendered!=null&&A.hasOwnProperty("surveyCtaHasRendered")&&(s.surveyCtaHasRendered=A.surveyCtaHasRendered,r.oneofs&&(s._surveyCtaHasRendered="surveyCtaHasRendered")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.SideBySideMetadata"},i})(),t})(),n.CallLogRecord=(function(){function t(i){if(this.participants=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.callResult=e.int32();break}case 2:{s.isDndMode=e.bool();break}case 3:{s.silenceReason=e.int32();break}case 4:{s.duration=e.int64();break}case 5:{s.startTime=e.int64();break}case 6:{s.isIncoming=e.bool();break}case 7:{s.isVideo=e.bool();break}case 8:{s.isCallLink=e.bool();break}case 9:{s.callLinkToken=e.string();break}case 10:{s.scheduledCallId=e.string();break}case 11:{s.callId=e.string();break}case 12:{s.callCreatorJid=e.string();break}case 13:{s.groupJid=e.string();break}case 14:{s.participants&&s.participants.length||(s.participants=[]),s.participants.push(p.proto.CallLogRecord.ParticipantInfo.decode(e,e.uint32()));break}case 15:{s.callType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CallLogRecord)return e;var a=new p.proto.CallLogRecord;switch(e.callResult){default:if(typeof e.callResult=="number"){a.callResult=e.callResult;break}break;case"CONNECTED":case 0:a.callResult=0;break;case"REJECTED":case 1:a.callResult=1;break;case"CANCELLED":case 2:a.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:a.callResult=3;break;case"MISSED":case 4:a.callResult=4;break;case"INVALID":case 5:a.callResult=5;break;case"UNAVAILABLE":case 6:a.callResult=6;break;case"UPCOMING":case 7:a.callResult=7;break;case"FAILED":case 8:a.callResult=8;break;case"ABANDONED":case 9:a.callResult=9;break;case"ONGOING":case 10:a.callResult=10;break}switch(e.isDndMode!=null&&(a.isDndMode=!!e.isDndMode),e.silenceReason){default:if(typeof e.silenceReason=="number"){a.silenceReason=e.silenceReason;break}break;case"NONE":case 0:a.silenceReason=0;break;case"SCHEDULED":case 1:a.silenceReason=1;break;case"PRIVACY":case 2:a.silenceReason=2;break;case"LIGHTWEIGHT":case 3:a.silenceReason=3;break}if(e.duration!=null&&(l.Long?(a.duration=l.Long.fromValue(e.duration)).unsigned=!1:typeof e.duration=="string"?a.duration=parseInt(e.duration,10):typeof e.duration=="number"?a.duration=e.duration:typeof e.duration=="object"&&(a.duration=new l.LongBits(e.duration.low>>>0,e.duration.high>>>0).toNumber())),e.startTime!=null&&(l.Long?(a.startTime=l.Long.fromValue(e.startTime)).unsigned=!1:typeof e.startTime=="string"?a.startTime=parseInt(e.startTime,10):typeof e.startTime=="number"?a.startTime=e.startTime:typeof e.startTime=="object"&&(a.startTime=new l.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.isIncoming!=null&&(a.isIncoming=!!e.isIncoming),e.isVideo!=null&&(a.isVideo=!!e.isVideo),e.isCallLink!=null&&(a.isCallLink=!!e.isCallLink),e.callLinkToken!=null&&(a.callLinkToken=String(e.callLinkToken)),e.scheduledCallId!=null&&(a.scheduledCallId=String(e.scheduledCallId)),e.callId!=null&&(a.callId=String(e.callId)),e.callCreatorJid!=null&&(a.callCreatorJid=String(e.callCreatorJid)),e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.participants){if(!Array.isArray(e.participants))throw TypeError(".proto.CallLogRecord.participants: array expected");a.participants=[];for(var A=0;A>>3){case 1:{c.userJid=A.string();break}case 2:{c.callResult=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.CallLogRecord.ParticipantInfo)return A;var r=new p.proto.CallLogRecord.ParticipantInfo;switch(A.userJid!=null&&(r.userJid=String(A.userJid)),A.callResult){default:if(typeof A.callResult=="number"){r.callResult=A.callResult;break}break;case"CONNECTED":case 0:r.callResult=0;break;case"REJECTED":case 1:r.callResult=1;break;case"CANCELLED":case 2:r.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:r.callResult=3;break;case"MISSED":case 4:r.callResult=4;break;case"INVALID":case 5:r.callResult=5;break;case"UNAVAILABLE":case 6:r.callResult=6;break;case"UPCOMING":case 7:r.callResult=7;break;case"FAILED":case 8:r.callResult=8;break;case"ABANDONED":case 9:r.callResult=9;break;case"ONGOING":case 10:r.callResult=10;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.userJid!=null&&A.hasOwnProperty("userJid")&&(s.userJid=A.userJid,r.oneofs&&(s._userJid="userJid")),A.callResult!=null&&A.hasOwnProperty("callResult")&&(s.callResult=r.enums===String?p.proto.CallLogRecord.CallResult[A.callResult]===void 0?A.callResult:p.proto.CallLogRecord.CallResult[A.callResult]:A.callResult,r.oneofs&&(s._callResult="callResult")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CallLogRecord.ParticipantInfo"},i})(),t.SilenceReason=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="SCHEDULED"]=1,e[i[2]="PRIVACY"]=2,e[i[3]="LIGHTWEIGHT"]=3,e})(),t})(),n.CertChain=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.leaf=p.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}case 2:{s.intermediate=p.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CertChain)return e;var a=new p.proto.CertChain;if(e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".proto.CertChain.leaf: object expected");a.leaf=p.proto.CertChain.NoiseCertificate.fromObject(e.leaf)}if(e.intermediate!=null){if(typeof e.intermediate!="object")throw TypeError(".proto.CertChain.intermediate: object expected");a.intermediate=p.proto.CertChain.NoiseCertificate.fromObject(e.intermediate)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.leaf!=null&&e.hasOwnProperty("leaf")&&(A.leaf=p.proto.CertChain.NoiseCertificate.toObject(e.leaf,a),a.oneofs&&(A._leaf="leaf")),e.intermediate!=null&&e.hasOwnProperty("intermediate")&&(A.intermediate=p.proto.CertChain.NoiseCertificate.toObject(e.intermediate,a),a.oneofs&&(A._intermediate="intermediate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CertChain"},t.NoiseCertificate=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.details=A.bytes();break}case 2:{c.signature=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.CertChain.NoiseCertificate)return A;var r=new p.proto.CertChain.NoiseCertificate;return A.details!=null&&(typeof A.details=="string"?l.base64.decode(A.details,r.details=l.newBuffer(l.base64.length(A.details)),0):A.details.length>=0&&(r.details=A.details)),A.signature!=null&&(typeof A.signature=="string"?l.base64.decode(A.signature,r.signature=l.newBuffer(l.base64.length(A.signature)),0):A.signature.length>=0&&(r.signature=A.signature)),r},i.toObject=function(A,r){r||(r={});var s={};return A.details!=null&&A.hasOwnProperty("details")&&(s.details=r.bytes===String?l.base64.encode(A.details,0,A.details.length):r.bytes===Array?Array.prototype.slice.call(A.details):A.details,r.oneofs&&(s._details="details")),A.signature!=null&&A.hasOwnProperty("signature")&&(s.signature=r.bytes===String?l.base64.encode(A.signature,0,A.signature.length):r.bytes===Array?Array.prototype.slice.call(A.signature):A.signature,r.oneofs&&(s._signature="signature")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CertChain.NoiseCertificate"},i.Details=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.serial=s.uint32();break}case 2:{d.issuerSerial=s.uint32();break}case 3:{d.key=s.bytes();break}case 4:{d.notBefore=s.uint64();break}case 5:{d.notAfter=s.uint64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.CertChain.NoiseCertificate.Details)return s;var g=new p.proto.CertChain.NoiseCertificate.Details;return s.serial!=null&&(g.serial=s.serial>>>0),s.issuerSerial!=null&&(g.issuerSerial=s.issuerSerial>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),s.notBefore!=null&&(l.Long?(g.notBefore=l.Long.fromValue(s.notBefore)).unsigned=!0:typeof s.notBefore=="string"?g.notBefore=parseInt(s.notBefore,10):typeof s.notBefore=="number"?g.notBefore=s.notBefore:typeof s.notBefore=="object"&&(g.notBefore=new l.LongBits(s.notBefore.low>>>0,s.notBefore.high>>>0).toNumber(!0))),s.notAfter!=null&&(l.Long?(g.notAfter=l.Long.fromValue(s.notAfter)).unsigned=!0:typeof s.notAfter=="string"?g.notAfter=parseInt(s.notAfter,10):typeof s.notAfter=="number"?g.notAfter=s.notAfter:typeof s.notAfter=="object"&&(g.notAfter=new l.LongBits(s.notAfter.low>>>0,s.notAfter.high>>>0).toNumber(!0))),g},a.toObject=function(s,g){g||(g={});var c={};return s.serial!=null&&s.hasOwnProperty("serial")&&(c.serial=s.serial,g.oneofs&&(c._serial="serial")),s.issuerSerial!=null&&s.hasOwnProperty("issuerSerial")&&(c.issuerSerial=s.issuerSerial,g.oneofs&&(c._issuerSerial="issuerSerial")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),s.notBefore!=null&&s.hasOwnProperty("notBefore")&&(typeof s.notBefore=="number"?c.notBefore=g.longs===String?String(s.notBefore):s.notBefore:c.notBefore=g.longs===String?ge(s.notBefore,!0):g.longs===Number?ce(s.notBefore,!0):s.notBefore,g.oneofs&&(c._notBefore="notBefore")),s.notAfter!=null&&s.hasOwnProperty("notAfter")&&(typeof s.notAfter=="number"?c.notAfter=g.longs===String?String(s.notAfter):s.notAfter:c.notAfter=g.longs===String?ge(s.notAfter,!0):g.longs===Number?ce(s.notAfter,!0):s.notAfter,g.oneofs&&(c._notAfter="notAfter")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.CertChain.NoiseCertificate.Details"},a})(),i})(),t})(),n.ChatLockSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.hideLockedChats=e.bool();break}case 2:{s.secretCode=p.proto.UserPassword.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ChatLockSettings)return e;var a=new p.proto.ChatLockSettings;if(e.hideLockedChats!=null&&(a.hideLockedChats=!!e.hideLockedChats),e.secretCode!=null){if(typeof e.secretCode!="object")throw TypeError(".proto.ChatLockSettings.secretCode: object expected");a.secretCode=p.proto.UserPassword.fromObject(e.secretCode)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.hideLockedChats!=null&&e.hasOwnProperty("hideLockedChats")&&(A.hideLockedChats=e.hideLockedChats,a.oneofs&&(A._hideLockedChats="hideLockedChats")),e.secretCode!=null&&e.hasOwnProperty("secretCode")&&(A.secretCode=p.proto.UserPassword.toObject(e.secretCode,a),a.oneofs&&(A._secretCode="secretCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatLockSettings"},t})(),n.ChatRowOpaqueData=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ChatRowOpaqueData)return e;var a=new p.proto.ChatRowOpaqueData;if(e.draftMessage!=null){if(typeof e.draftMessage!="object")throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected");a.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.fromObject(e.draftMessage)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.draftMessage!=null&&e.hasOwnProperty("draftMessage")&&(A.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.toObject(e.draftMessage,a),a.oneofs&&(A._draftMessage="draftMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatRowOpaqueData"},t.DraftMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.omittedUrl=A.string();break}case 3:{c.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.decode(A,A.uint32());break}case 4:{c.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.decode(A,A.uint32());break}case 5:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ChatRowOpaqueData.DraftMessage)return A;var r=new p.proto.ChatRowOpaqueData.DraftMessage;if(A.text!=null&&(r.text=String(A.text)),A.omittedUrl!=null&&(r.omittedUrl=String(A.omittedUrl)),A.ctwaContextLinkData!=null){if(typeof A.ctwaContextLinkData!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected");r.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(A.ctwaContextLinkData)}if(A.ctwaContext!=null){if(typeof A.ctwaContext!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected");r.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(A.ctwaContext)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.omittedUrl!=null&&A.hasOwnProperty("omittedUrl")&&(s.omittedUrl=A.omittedUrl,r.oneofs&&(s._omittedUrl="omittedUrl")),A.ctwaContextLinkData!=null&&A.hasOwnProperty("ctwaContextLinkData")&&(s.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(A.ctwaContextLinkData,r),r.oneofs&&(s._ctwaContextLinkData="ctwaContextLinkData")),A.ctwaContext!=null&&A.hasOwnProperty("ctwaContext")&&(s.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(A.ctwaContext,r),r.oneofs&&(s._ctwaContext="ctwaContext")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ChatRowOpaqueData.DraftMessage"},i.CtwaContextData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.conversionSource=s.string();break}case 2:{d.conversionData=s.bytes();break}case 3:{d.sourceUrl=s.string();break}case 4:{d.sourceId=s.string();break}case 5:{d.sourceType=s.string();break}case 6:{d.title=s.string();break}case 7:{d.description=s.string();break}case 8:{d.thumbnail=s.string();break}case 9:{d.thumbnailUrl=s.string();break}case 10:{d.mediaType=s.int32();break}case 11:{d.mediaUrl=s.string();break}case 12:{d.isSuspiciousLink=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData)return s;var g=new p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData;switch(s.conversionSource!=null&&(g.conversionSource=String(s.conversionSource)),s.conversionData!=null&&(typeof s.conversionData=="string"?l.base64.decode(s.conversionData,g.conversionData=l.newBuffer(l.base64.length(s.conversionData)),0):s.conversionData.length>=0&&(g.conversionData=s.conversionData)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.sourceId!=null&&(g.sourceId=String(s.sourceId)),s.sourceType!=null&&(g.sourceType=String(s.sourceType)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.thumbnail!=null&&(g.thumbnail=String(s.thumbnail)),s.thumbnailUrl!=null&&(g.thumbnailUrl=String(s.thumbnailUrl)),s.mediaType){default:if(typeof s.mediaType=="number"){g.mediaType=s.mediaType;break}break;case"NONE":case 0:g.mediaType=0;break;case"IMAGE":case 1:g.mediaType=1;break;case"VIDEO":case 2:g.mediaType=2;break}return s.mediaUrl!=null&&(g.mediaUrl=String(s.mediaUrl)),s.isSuspiciousLink!=null&&(g.isSuspiciousLink=!!s.isSuspiciousLink),g},a.toObject=function(s,g){g||(g={});var c={};return s.conversionSource!=null&&s.hasOwnProperty("conversionSource")&&(c.conversionSource=s.conversionSource,g.oneofs&&(c._conversionSource="conversionSource")),s.conversionData!=null&&s.hasOwnProperty("conversionData")&&(c.conversionData=g.bytes===String?l.base64.encode(s.conversionData,0,s.conversionData.length):g.bytes===Array?Array.prototype.slice.call(s.conversionData):s.conversionData,g.oneofs&&(c._conversionData="conversionData")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.sourceId!=null&&s.hasOwnProperty("sourceId")&&(c.sourceId=s.sourceId,g.oneofs&&(c._sourceId="sourceId")),s.sourceType!=null&&s.hasOwnProperty("sourceType")&&(c.sourceType=s.sourceType,g.oneofs&&(c._sourceType="sourceType")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.thumbnail!=null&&s.hasOwnProperty("thumbnail")&&(c.thumbnail=s.thumbnail,g.oneofs&&(c._thumbnail="thumbnail")),s.thumbnailUrl!=null&&s.hasOwnProperty("thumbnailUrl")&&(c.thumbnailUrl=s.thumbnailUrl,g.oneofs&&(c._thumbnailUrl="thumbnailUrl")),s.mediaType!=null&&s.hasOwnProperty("mediaType")&&(c.mediaType=g.enums===String?p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]===void 0?s.mediaType:p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]:s.mediaType,g.oneofs&&(c._mediaType="mediaType")),s.mediaUrl!=null&&s.hasOwnProperty("mediaUrl")&&(c.mediaUrl=s.mediaUrl,g.oneofs&&(c._mediaUrl="mediaUrl")),s.isSuspiciousLink!=null&&s.hasOwnProperty("isSuspiciousLink")&&(c.isSuspiciousLink=s.isSuspiciousLink,g.oneofs&&(c._isSuspiciousLink="isSuspiciousLink")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextData"},a.ContextInfoExternalAdReplyInfoMediaType=(function(){let r={},s=Object.create(r);return s[r[0]="NONE"]=0,s[r[1]="IMAGE"]=1,s[r[2]="VIDEO"]=2,s})(),a})(),i.CtwaContextLinkData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.context=s.string();break}case 2:{d.sourceUrl=s.string();break}case 3:{d.icebreaker=s.string();break}case 4:{d.phone=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData)return s;var g=new p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData;return s.context!=null&&(g.context=String(s.context)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.icebreaker!=null&&(g.icebreaker=String(s.icebreaker)),s.phone!=null&&(g.phone=String(s.phone)),g},a.toObject=function(s,g){g||(g={});var c={};return s.context!=null&&s.hasOwnProperty("context")&&(c.context=s.context,g.oneofs&&(c._context="context")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.icebreaker!=null&&s.hasOwnProperty("icebreaker")&&(c.icebreaker=s.icebreaker,g.oneofs&&(c._icebreaker="icebreaker")),s.phone!=null&&s.hasOwnProperty("phone")&&(c.phone=s.phone,g.oneofs&&(c._phone="phone")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData"},a})(),i})(),t})(),n.Citation=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.title=i.string();break}case 2:{r.subtitle=i.string();break}case 3:{r.cmsId=i.string();break}case 4:{r.imageUrl=i.string();break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.Citation)return i;var e=new p.proto.Citation;return i.title!=null&&(e.title=String(i.title)),i.subtitle!=null&&(e.subtitle=String(i.subtitle)),i.cmsId!=null&&(e.cmsId=String(i.cmsId)),i.imageUrl!=null&&(e.imageUrl=String(i.imageUrl)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.title="",a.subtitle="",a.cmsId="",a.imageUrl=""),i.title!=null&&i.hasOwnProperty("title")&&(a.title=i.title),i.subtitle!=null&&i.hasOwnProperty("subtitle")&&(a.subtitle=i.subtitle),i.cmsId!=null&&i.hasOwnProperty("cmsId")&&(a.cmsId=i.cmsId),i.imageUrl!=null&&i.hasOwnProperty("imageUrl")&&(a.imageUrl=i.imageUrl),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Citation"},t})(),n.ClientPairingProps=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.isChatDbLidMigrated=e.bool();break}case 2:{s.isSyncdPureLidSession=e.bool();break}case 3:{s.isSyncdSnapshotRecoveryEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ClientPairingProps)return e;var a=new p.proto.ClientPairingProps;return e.isChatDbLidMigrated!=null&&(a.isChatDbLidMigrated=!!e.isChatDbLidMigrated),e.isSyncdPureLidSession!=null&&(a.isSyncdPureLidSession=!!e.isSyncdPureLidSession),e.isSyncdSnapshotRecoveryEnabled!=null&&(a.isSyncdSnapshotRecoveryEnabled=!!e.isSyncdSnapshotRecoveryEnabled),a},t.toObject=function(e,a){a||(a={});var A={};return e.isChatDbLidMigrated!=null&&e.hasOwnProperty("isChatDbLidMigrated")&&(A.isChatDbLidMigrated=e.isChatDbLidMigrated,a.oneofs&&(A._isChatDbLidMigrated="isChatDbLidMigrated")),e.isSyncdPureLidSession!=null&&e.hasOwnProperty("isSyncdPureLidSession")&&(A.isSyncdPureLidSession=e.isSyncdPureLidSession,a.oneofs&&(A._isSyncdPureLidSession="isSyncdPureLidSession")),e.isSyncdSnapshotRecoveryEnabled!=null&&e.hasOwnProperty("isSyncdSnapshotRecoveryEnabled")&&(A.isSyncdSnapshotRecoveryEnabled=e.isSyncdSnapshotRecoveryEnabled,a.oneofs&&(A._isSyncdSnapshotRecoveryEnabled="isSyncdSnapshotRecoveryEnabled")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ClientPairingProps"},t})(),n.ClientPayload=(function(){function t(i){if(this.shards=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.username=e.uint64();break}case 3:{s.passive=e.bool();break}case 5:{s.userAgent=p.proto.ClientPayload.UserAgent.decode(e,e.uint32());break}case 6:{s.webInfo=p.proto.ClientPayload.WebInfo.decode(e,e.uint32());break}case 7:{s.pushName=e.string();break}case 9:{s.sessionId=e.sfixed32();break}case 10:{s.shortConnect=e.bool();break}case 12:{s.connectType=e.int32();break}case 13:{s.connectReason=e.int32();break}case 14:{if(s.shards&&s.shards.length||(s.shards=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0,e.username.high>>>0).toNumber(!0))),e.passive!=null&&(a.passive=!!e.passive),e.userAgent!=null){if(typeof e.userAgent!="object")throw TypeError(".proto.ClientPayload.userAgent: object expected");a.userAgent=p.proto.ClientPayload.UserAgent.fromObject(e.userAgent)}if(e.webInfo!=null){if(typeof e.webInfo!="object")throw TypeError(".proto.ClientPayload.webInfo: object expected");a.webInfo=p.proto.ClientPayload.WebInfo.fromObject(e.webInfo)}switch(e.pushName!=null&&(a.pushName=String(e.pushName)),e.sessionId!=null&&(a.sessionId=e.sessionId|0),e.shortConnect!=null&&(a.shortConnect=!!e.shortConnect),e.connectType){default:if(typeof e.connectType=="number"){a.connectType=e.connectType;break}break;case"CELLULAR_UNKNOWN":case 0:a.connectType=0;break;case"WIFI_UNKNOWN":case 1:a.connectType=1;break;case"CELLULAR_EDGE":case 100:a.connectType=100;break;case"CELLULAR_IDEN":case 101:a.connectType=101;break;case"CELLULAR_UMTS":case 102:a.connectType=102;break;case"CELLULAR_EVDO":case 103:a.connectType=103;break;case"CELLULAR_GPRS":case 104:a.connectType=104;break;case"CELLULAR_HSDPA":case 105:a.connectType=105;break;case"CELLULAR_HSUPA":case 106:a.connectType=106;break;case"CELLULAR_HSPA":case 107:a.connectType=107;break;case"CELLULAR_CDMA":case 108:a.connectType=108;break;case"CELLULAR_1XRTT":case 109:a.connectType=109;break;case"CELLULAR_EHRPD":case 110:a.connectType=110;break;case"CELLULAR_LTE":case 111:a.connectType=111;break;case"CELLULAR_HSPAP":case 112:a.connectType=112;break}switch(e.connectReason){default:if(typeof e.connectReason=="number"){a.connectReason=e.connectReason;break}break;case"PUSH":case 0:a.connectReason=0;break;case"USER_ACTIVATED":case 1:a.connectReason=1;break;case"SCHEDULED":case 2:a.connectReason=2;break;case"ERROR_RECONNECT":case 3:a.connectReason=3;break;case"NETWORK_SWITCH":case 4:a.connectReason=4;break;case"PING_RECONNECT":case 5:a.connectReason=5;break;case"UNKNOWN":case 6:a.connectReason=6;break}if(e.shards){if(!Array.isArray(e.shards))throw TypeError(".proto.ClientPayload.shards: array expected");a.shards=[];for(var A=0;A>>0),e.device!=null&&(a.device=e.device>>>0),e.devicePairingData!=null){if(typeof e.devicePairingData!="object")throw TypeError(".proto.ClientPayload.devicePairingData: object expected");a.devicePairingData=p.proto.ClientPayload.DevicePairingRegistrationData.fromObject(e.devicePairingData)}switch(e.product){default:if(typeof e.product=="number"){a.product=e.product;break}break;case"WHATSAPP":case 0:a.product=0;break;case"MESSENGER":case 1:a.product=1;break;case"INTEROP":case 2:a.product=2;break;case"INTEROP_MSGR":case 3:a.product=3;break;case"WHATSAPP_LID":case 4:a.product=4;break}switch(e.fbCat!=null&&(typeof e.fbCat=="string"?l.base64.decode(e.fbCat,a.fbCat=l.newBuffer(l.base64.length(e.fbCat)),0):e.fbCat.length>=0&&(a.fbCat=e.fbCat)),e.fbUserAgent!=null&&(typeof e.fbUserAgent=="string"?l.base64.decode(e.fbUserAgent,a.fbUserAgent=l.newBuffer(l.base64.length(e.fbUserAgent)),0):e.fbUserAgent.length>=0&&(a.fbUserAgent=e.fbUserAgent)),e.oc!=null&&(a.oc=!!e.oc),e.lc!=null&&(a.lc=e.lc|0),e.iosAppExtension){default:if(typeof e.iosAppExtension=="number"){a.iosAppExtension=e.iosAppExtension;break}break;case"SHARE_EXTENSION":case 0:a.iosAppExtension=0;break;case"SERVICE_EXTENSION":case 1:a.iosAppExtension=1;break;case"INTENTS_EXTENSION":case 2:a.iosAppExtension=2;break}if(e.fbAppId!=null&&(l.Long?(a.fbAppId=l.Long.fromValue(e.fbAppId)).unsigned=!0:typeof e.fbAppId=="string"?a.fbAppId=parseInt(e.fbAppId,10):typeof e.fbAppId=="number"?a.fbAppId=e.fbAppId:typeof e.fbAppId=="object"&&(a.fbAppId=new l.LongBits(e.fbAppId.low>>>0,e.fbAppId.high>>>0).toNumber(!0))),e.fbDeviceId!=null&&(typeof e.fbDeviceId=="string"?l.base64.decode(e.fbDeviceId,a.fbDeviceId=l.newBuffer(l.base64.length(e.fbDeviceId)),0):e.fbDeviceId.length>=0&&(a.fbDeviceId=e.fbDeviceId)),e.pull!=null&&(a.pull=!!e.pull),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,a.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(a.paddingBytes=e.paddingBytes)),e.yearClass!=null&&(a.yearClass=e.yearClass|0),e.memClass!=null&&(a.memClass=e.memClass|0),e.interopData!=null){if(typeof e.interopData!="object")throw TypeError(".proto.ClientPayload.interopData: object expected");a.interopData=p.proto.ClientPayload.InteropData.fromObject(e.interopData)}switch(e.trafficAnonymization){default:if(typeof e.trafficAnonymization=="number"){a.trafficAnonymization=e.trafficAnonymization;break}break;case"OFF":case 0:a.trafficAnonymization=0;break;case"STANDARD":case 1:a.trafficAnonymization=1;break}switch(e.lidDbMigrated!=null&&(a.lidDbMigrated=!!e.lidDbMigrated),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"DEFAULT":case 0:a.accountType=0;break;case"GUEST":case 1:a.accountType=1;break}return e.connectionSequenceInfo!=null&&(a.connectionSequenceInfo=e.connectionSequenceInfo|0),e.paaLink!=null&&(a.paaLink=!!e.paaLink),e.preacksCount!=null&&(a.preacksCount=e.preacksCount|0),e.processingQueueSize!=null&&(a.processingQueueSize=e.processingQueueSize|0),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.shards=[]),e.username!=null&&e.hasOwnProperty("username")&&(typeof e.username=="number"?A.username=a.longs===String?String(e.username):e.username:A.username=a.longs===String?ge(e.username,!0):a.longs===Number?ce(e.username,!0):e.username,a.oneofs&&(A._username="username")),e.passive!=null&&e.hasOwnProperty("passive")&&(A.passive=e.passive,a.oneofs&&(A._passive="passive")),e.userAgent!=null&&e.hasOwnProperty("userAgent")&&(A.userAgent=p.proto.ClientPayload.UserAgent.toObject(e.userAgent,a),a.oneofs&&(A._userAgent="userAgent")),e.webInfo!=null&&e.hasOwnProperty("webInfo")&&(A.webInfo=p.proto.ClientPayload.WebInfo.toObject(e.webInfo,a),a.oneofs&&(A._webInfo="webInfo")),e.pushName!=null&&e.hasOwnProperty("pushName")&&(A.pushName=e.pushName,a.oneofs&&(A._pushName="pushName")),e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,a.oneofs&&(A._sessionId="sessionId")),e.shortConnect!=null&&e.hasOwnProperty("shortConnect")&&(A.shortConnect=e.shortConnect,a.oneofs&&(A._shortConnect="shortConnect")),e.connectType!=null&&e.hasOwnProperty("connectType")&&(A.connectType=a.enums===String?p.proto.ClientPayload.ConnectType[e.connectType]===void 0?e.connectType:p.proto.ClientPayload.ConnectType[e.connectType]:e.connectType,a.oneofs&&(A._connectType="connectType")),e.connectReason!=null&&e.hasOwnProperty("connectReason")&&(A.connectReason=a.enums===String?p.proto.ClientPayload.ConnectReason[e.connectReason]===void 0?e.connectReason:p.proto.ClientPayload.ConnectReason[e.connectReason]:e.connectReason,a.oneofs&&(A._connectReason="connectReason")),e.shards&&e.shards.length){A.shards=[];for(var r=0;r>>3){case 15:{c.dnsMethod=A.int32();break}case 16:{c.appCached=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.DNSSource)return A;var r=new p.proto.ClientPayload.DNSSource;switch(A.dnsMethod){default:if(typeof A.dnsMethod=="number"){r.dnsMethod=A.dnsMethod;break}break;case"SYSTEM":case 0:r.dnsMethod=0;break;case"GOOGLE":case 1:r.dnsMethod=1;break;case"HARDCODED":case 2:r.dnsMethod=2;break;case"OVERRIDE":case 3:r.dnsMethod=3;break;case"FALLBACK":case 4:r.dnsMethod=4;break;case"MNS":case 5:r.dnsMethod=5;break}return A.appCached!=null&&(r.appCached=!!A.appCached),r},i.toObject=function(A,r){r||(r={});var s={};return A.dnsMethod!=null&&A.hasOwnProperty("dnsMethod")&&(s.dnsMethod=r.enums===String?p.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]===void 0?A.dnsMethod:p.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]:A.dnsMethod,r.oneofs&&(s._dnsMethod="dnsMethod")),A.appCached!=null&&A.hasOwnProperty("appCached")&&(s.appCached=A.appCached,r.oneofs&&(s._appCached="appCached")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DNSSource"},i.DNSResolutionMethod=(function(){let a={},A=Object.create(a);return A[a[0]="SYSTEM"]=0,A[a[1]="GOOGLE"]=1,A[a[2]="HARDCODED"]=2,A[a[3]="OVERRIDE"]=3,A[a[4]="FALLBACK"]=4,A[a[5]="MNS"]=5,A})(),i})(),t.DevicePairingRegistrationData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.eRegid=A.bytes();break}case 2:{c.eKeytype=A.bytes();break}case 3:{c.eIdent=A.bytes();break}case 4:{c.eSkeyId=A.bytes();break}case 5:{c.eSkeyVal=A.bytes();break}case 6:{c.eSkeySig=A.bytes();break}case 7:{c.buildHash=A.bytes();break}case 8:{c.deviceProps=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.DevicePairingRegistrationData)return A;var r=new p.proto.ClientPayload.DevicePairingRegistrationData;return A.eRegid!=null&&(typeof A.eRegid=="string"?l.base64.decode(A.eRegid,r.eRegid=l.newBuffer(l.base64.length(A.eRegid)),0):A.eRegid.length>=0&&(r.eRegid=A.eRegid)),A.eKeytype!=null&&(typeof A.eKeytype=="string"?l.base64.decode(A.eKeytype,r.eKeytype=l.newBuffer(l.base64.length(A.eKeytype)),0):A.eKeytype.length>=0&&(r.eKeytype=A.eKeytype)),A.eIdent!=null&&(typeof A.eIdent=="string"?l.base64.decode(A.eIdent,r.eIdent=l.newBuffer(l.base64.length(A.eIdent)),0):A.eIdent.length>=0&&(r.eIdent=A.eIdent)),A.eSkeyId!=null&&(typeof A.eSkeyId=="string"?l.base64.decode(A.eSkeyId,r.eSkeyId=l.newBuffer(l.base64.length(A.eSkeyId)),0):A.eSkeyId.length>=0&&(r.eSkeyId=A.eSkeyId)),A.eSkeyVal!=null&&(typeof A.eSkeyVal=="string"?l.base64.decode(A.eSkeyVal,r.eSkeyVal=l.newBuffer(l.base64.length(A.eSkeyVal)),0):A.eSkeyVal.length>=0&&(r.eSkeyVal=A.eSkeyVal)),A.eSkeySig!=null&&(typeof A.eSkeySig=="string"?l.base64.decode(A.eSkeySig,r.eSkeySig=l.newBuffer(l.base64.length(A.eSkeySig)),0):A.eSkeySig.length>=0&&(r.eSkeySig=A.eSkeySig)),A.buildHash!=null&&(typeof A.buildHash=="string"?l.base64.decode(A.buildHash,r.buildHash=l.newBuffer(l.base64.length(A.buildHash)),0):A.buildHash.length>=0&&(r.buildHash=A.buildHash)),A.deviceProps!=null&&(typeof A.deviceProps=="string"?l.base64.decode(A.deviceProps,r.deviceProps=l.newBuffer(l.base64.length(A.deviceProps)),0):A.deviceProps.length>=0&&(r.deviceProps=A.deviceProps)),r},i.toObject=function(A,r){r||(r={});var s={};return A.eRegid!=null&&A.hasOwnProperty("eRegid")&&(s.eRegid=r.bytes===String?l.base64.encode(A.eRegid,0,A.eRegid.length):r.bytes===Array?Array.prototype.slice.call(A.eRegid):A.eRegid,r.oneofs&&(s._eRegid="eRegid")),A.eKeytype!=null&&A.hasOwnProperty("eKeytype")&&(s.eKeytype=r.bytes===String?l.base64.encode(A.eKeytype,0,A.eKeytype.length):r.bytes===Array?Array.prototype.slice.call(A.eKeytype):A.eKeytype,r.oneofs&&(s._eKeytype="eKeytype")),A.eIdent!=null&&A.hasOwnProperty("eIdent")&&(s.eIdent=r.bytes===String?l.base64.encode(A.eIdent,0,A.eIdent.length):r.bytes===Array?Array.prototype.slice.call(A.eIdent):A.eIdent,r.oneofs&&(s._eIdent="eIdent")),A.eSkeyId!=null&&A.hasOwnProperty("eSkeyId")&&(s.eSkeyId=r.bytes===String?l.base64.encode(A.eSkeyId,0,A.eSkeyId.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyId):A.eSkeyId,r.oneofs&&(s._eSkeyId="eSkeyId")),A.eSkeyVal!=null&&A.hasOwnProperty("eSkeyVal")&&(s.eSkeyVal=r.bytes===String?l.base64.encode(A.eSkeyVal,0,A.eSkeyVal.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyVal):A.eSkeyVal,r.oneofs&&(s._eSkeyVal="eSkeyVal")),A.eSkeySig!=null&&A.hasOwnProperty("eSkeySig")&&(s.eSkeySig=r.bytes===String?l.base64.encode(A.eSkeySig,0,A.eSkeySig.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeySig):A.eSkeySig,r.oneofs&&(s._eSkeySig="eSkeySig")),A.buildHash!=null&&A.hasOwnProperty("buildHash")&&(s.buildHash=r.bytes===String?l.base64.encode(A.buildHash,0,A.buildHash.length):r.bytes===Array?Array.prototype.slice.call(A.buildHash):A.buildHash,r.oneofs&&(s._buildHash="buildHash")),A.deviceProps!=null&&A.hasOwnProperty("deviceProps")&&(s.deviceProps=r.bytes===String?l.base64.encode(A.deviceProps,0,A.deviceProps.length):r.bytes===Array?Array.prototype.slice.call(A.deviceProps):A.deviceProps,r.oneofs&&(s._deviceProps="deviceProps")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DevicePairingRegistrationData"},i})(),t.IOSAppExtension=(function(){let i={},e=Object.create(i);return e[i[0]="SHARE_EXTENSION"]=0,e[i[1]="SERVICE_EXTENSION"]=1,e[i[2]="INTENTS_EXTENSION"]=2,e})(),t.InteropData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.accountId=A.uint64();break}case 2:{c.token=A.bytes();break}case 3:{c.enableReadReceipts=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.InteropData)return A;var r=new p.proto.ClientPayload.InteropData;return A.accountId!=null&&(l.Long?(r.accountId=l.Long.fromValue(A.accountId)).unsigned=!0:typeof A.accountId=="string"?r.accountId=parseInt(A.accountId,10):typeof A.accountId=="number"?r.accountId=A.accountId:typeof A.accountId=="object"&&(r.accountId=new l.LongBits(A.accountId.low>>>0,A.accountId.high>>>0).toNumber(!0))),A.token!=null&&(typeof A.token=="string"?l.base64.decode(A.token,r.token=l.newBuffer(l.base64.length(A.token)),0):A.token.length>=0&&(r.token=A.token)),A.enableReadReceipts!=null&&(r.enableReadReceipts=!!A.enableReadReceipts),r},i.toObject=function(A,r){r||(r={});var s={};return A.accountId!=null&&A.hasOwnProperty("accountId")&&(typeof A.accountId=="number"?s.accountId=r.longs===String?String(A.accountId):A.accountId:s.accountId=r.longs===String?ge(A.accountId,!0):r.longs===Number?ce(A.accountId,!0):A.accountId,r.oneofs&&(s._accountId="accountId")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=r.bytes===String?l.base64.encode(A.token,0,A.token.length):r.bytes===Array?Array.prototype.slice.call(A.token):A.token,r.oneofs&&(s._token="token")),A.enableReadReceipts!=null&&A.hasOwnProperty("enableReadReceipts")&&(s.enableReadReceipts=A.enableReadReceipts,r.oneofs&&(s._enableReadReceipts="enableReadReceipts")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.InteropData"},i})(),t.Product=(function(){let i={},e=Object.create(i);return e[i[0]="WHATSAPP"]=0,e[i[1]="MESSENGER"]=1,e[i[2]="INTEROP"]=2,e[i[3]="INTEROP_MSGR"]=3,e[i[4]="WHATSAPP_LID"]=4,e})(),t.TrafficAnonymization=(function(){let i={},e=Object.create(i);return e[i[0]="OFF"]=0,e[i[1]="STANDARD"]=1,e})(),t.UserAgent=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.platform=A.int32();break}case 2:{c.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.decode(A,A.uint32());break}case 3:{c.mcc=A.string();break}case 4:{c.mnc=A.string();break}case 5:{c.osVersion=A.string();break}case 6:{c.manufacturer=A.string();break}case 7:{c.device=A.string();break}case 8:{c.osBuildNumber=A.string();break}case 9:{c.phoneId=A.string();break}case 10:{c.releaseChannel=A.int32();break}case 11:{c.localeLanguageIso6391=A.string();break}case 12:{c.localeCountryIso31661Alpha2=A.string();break}case 13:{c.deviceBoard=A.string();break}case 14:{c.deviceExpId=A.string();break}case 15:{c.deviceType=A.int32();break}case 16:{c.deviceModelType=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.UserAgent)return A;var r=new p.proto.ClientPayload.UserAgent;switch(A.platform){default:if(typeof A.platform=="number"){r.platform=A.platform;break}break;case"ANDROID":case 0:r.platform=0;break;case"IOS":case 1:r.platform=1;break;case"WINDOWS_PHONE":case 2:r.platform=2;break;case"BLACKBERRY":case 3:r.platform=3;break;case"BLACKBERRYX":case 4:r.platform=4;break;case"S40":case 5:r.platform=5;break;case"S60":case 6:r.platform=6;break;case"PYTHON_CLIENT":case 7:r.platform=7;break;case"TIZEN":case 8:r.platform=8;break;case"ENTERPRISE":case 9:r.platform=9;break;case"SMB_ANDROID":case 10:r.platform=10;break;case"KAIOS":case 11:r.platform=11;break;case"SMB_IOS":case 12:r.platform=12;break;case"WINDOWS":case 13:r.platform=13;break;case"WEB":case 14:r.platform=14;break;case"PORTAL":case 15:r.platform=15;break;case"GREEN_ANDROID":case 16:r.platform=16;break;case"GREEN_IPHONE":case 17:r.platform=17;break;case"BLUE_ANDROID":case 18:r.platform=18;break;case"BLUE_IPHONE":case 19:r.platform=19;break;case"FBLITE_ANDROID":case 20:r.platform=20;break;case"MLITE_ANDROID":case 21:r.platform=21;break;case"IGLITE_ANDROID":case 22:r.platform=22;break;case"PAGE":case 23:r.platform=23;break;case"MACOS":case 24:r.platform=24;break;case"OCULUS_MSG":case 25:r.platform=25;break;case"OCULUS_CALL":case 26:r.platform=26;break;case"MILAN":case 27:r.platform=27;break;case"CAPI":case 28:r.platform=28;break;case"WEAROS":case 29:r.platform=29;break;case"ARDEVICE":case 30:r.platform=30;break;case"VRDEVICE":case 31:r.platform=31;break;case"BLUE_WEB":case 32:r.platform=32;break;case"IPAD":case 33:r.platform=33;break;case"TEST":case 34:r.platform=34;break;case"SMART_GLASSES":case 35:r.platform=35;break;case"BLUE_VR":case 36:r.platform=36;break;case"AR_WRIST":case 37:r.platform=37;break}if(A.appVersion!=null){if(typeof A.appVersion!="object")throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected");r.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.fromObject(A.appVersion)}switch(A.mcc!=null&&(r.mcc=String(A.mcc)),A.mnc!=null&&(r.mnc=String(A.mnc)),A.osVersion!=null&&(r.osVersion=String(A.osVersion)),A.manufacturer!=null&&(r.manufacturer=String(A.manufacturer)),A.device!=null&&(r.device=String(A.device)),A.osBuildNumber!=null&&(r.osBuildNumber=String(A.osBuildNumber)),A.phoneId!=null&&(r.phoneId=String(A.phoneId)),A.releaseChannel){default:if(typeof A.releaseChannel=="number"){r.releaseChannel=A.releaseChannel;break}break;case"RELEASE":case 0:r.releaseChannel=0;break;case"BETA":case 1:r.releaseChannel=1;break;case"ALPHA":case 2:r.releaseChannel=2;break;case"DEBUG":case 3:r.releaseChannel=3;break}switch(A.localeLanguageIso6391!=null&&(r.localeLanguageIso6391=String(A.localeLanguageIso6391)),A.localeCountryIso31661Alpha2!=null&&(r.localeCountryIso31661Alpha2=String(A.localeCountryIso31661Alpha2)),A.deviceBoard!=null&&(r.deviceBoard=String(A.deviceBoard)),A.deviceExpId!=null&&(r.deviceExpId=String(A.deviceExpId)),A.deviceType){default:if(typeof A.deviceType=="number"){r.deviceType=A.deviceType;break}break;case"PHONE":case 0:r.deviceType=0;break;case"TABLET":case 1:r.deviceType=1;break;case"DESKTOP":case 2:r.deviceType=2;break;case"WEARABLE":case 3:r.deviceType=3;break;case"VR":case 4:r.deviceType=4;break}return A.deviceModelType!=null&&(r.deviceModelType=String(A.deviceModelType)),r},i.toObject=function(A,r){r||(r={});var s={};return A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=r.enums===String?p.proto.ClientPayload.UserAgent.Platform[A.platform]===void 0?A.platform:p.proto.ClientPayload.UserAgent.Platform[A.platform]:A.platform,r.oneofs&&(s._platform="platform")),A.appVersion!=null&&A.hasOwnProperty("appVersion")&&(s.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.toObject(A.appVersion,r),r.oneofs&&(s._appVersion="appVersion")),A.mcc!=null&&A.hasOwnProperty("mcc")&&(s.mcc=A.mcc,r.oneofs&&(s._mcc="mcc")),A.mnc!=null&&A.hasOwnProperty("mnc")&&(s.mnc=A.mnc,r.oneofs&&(s._mnc="mnc")),A.osVersion!=null&&A.hasOwnProperty("osVersion")&&(s.osVersion=A.osVersion,r.oneofs&&(s._osVersion="osVersion")),A.manufacturer!=null&&A.hasOwnProperty("manufacturer")&&(s.manufacturer=A.manufacturer,r.oneofs&&(s._manufacturer="manufacturer")),A.device!=null&&A.hasOwnProperty("device")&&(s.device=A.device,r.oneofs&&(s._device="device")),A.osBuildNumber!=null&&A.hasOwnProperty("osBuildNumber")&&(s.osBuildNumber=A.osBuildNumber,r.oneofs&&(s._osBuildNumber="osBuildNumber")),A.phoneId!=null&&A.hasOwnProperty("phoneId")&&(s.phoneId=A.phoneId,r.oneofs&&(s._phoneId="phoneId")),A.releaseChannel!=null&&A.hasOwnProperty("releaseChannel")&&(s.releaseChannel=r.enums===String?p.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]===void 0?A.releaseChannel:p.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]:A.releaseChannel,r.oneofs&&(s._releaseChannel="releaseChannel")),A.localeLanguageIso6391!=null&&A.hasOwnProperty("localeLanguageIso6391")&&(s.localeLanguageIso6391=A.localeLanguageIso6391,r.oneofs&&(s._localeLanguageIso6391="localeLanguageIso6391")),A.localeCountryIso31661Alpha2!=null&&A.hasOwnProperty("localeCountryIso31661Alpha2")&&(s.localeCountryIso31661Alpha2=A.localeCountryIso31661Alpha2,r.oneofs&&(s._localeCountryIso31661Alpha2="localeCountryIso31661Alpha2")),A.deviceBoard!=null&&A.hasOwnProperty("deviceBoard")&&(s.deviceBoard=A.deviceBoard,r.oneofs&&(s._deviceBoard="deviceBoard")),A.deviceExpId!=null&&A.hasOwnProperty("deviceExpId")&&(s.deviceExpId=A.deviceExpId,r.oneofs&&(s._deviceExpId="deviceExpId")),A.deviceType!=null&&A.hasOwnProperty("deviceType")&&(s.deviceType=r.enums===String?p.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]===void 0?A.deviceType:p.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]:A.deviceType,r.oneofs&&(s._deviceType="deviceType")),A.deviceModelType!=null&&A.hasOwnProperty("deviceModelType")&&(s.deviceModelType=A.deviceModelType,r.oneofs&&(s._deviceModelType="deviceModelType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.UserAgent"},i.AppVersion=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.primary=s.uint32();break}case 2:{d.secondary=s.uint32();break}case 3:{d.tertiary=s.uint32();break}case 4:{d.quaternary=s.uint32();break}case 5:{d.quinary=s.uint32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ClientPayload.UserAgent.AppVersion)return s;var g=new p.proto.ClientPayload.UserAgent.AppVersion;return s.primary!=null&&(g.primary=s.primary>>>0),s.secondary!=null&&(g.secondary=s.secondary>>>0),s.tertiary!=null&&(g.tertiary=s.tertiary>>>0),s.quaternary!=null&&(g.quaternary=s.quaternary>>>0),s.quinary!=null&&(g.quinary=s.quinary>>>0),g},a.toObject=function(s,g){g||(g={});var c={};return s.primary!=null&&s.hasOwnProperty("primary")&&(c.primary=s.primary,g.oneofs&&(c._primary="primary")),s.secondary!=null&&s.hasOwnProperty("secondary")&&(c.secondary=s.secondary,g.oneofs&&(c._secondary="secondary")),s.tertiary!=null&&s.hasOwnProperty("tertiary")&&(c.tertiary=s.tertiary,g.oneofs&&(c._tertiary="tertiary")),s.quaternary!=null&&s.hasOwnProperty("quaternary")&&(c.quaternary=s.quaternary,g.oneofs&&(c._quaternary="quaternary")),s.quinary!=null&&s.hasOwnProperty("quinary")&&(c.quinary=s.quinary,g.oneofs&&(c._quinary="quinary")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.UserAgent.AppVersion"},a})(),i.DeviceType=(function(){let a={},A=Object.create(a);return A[a[0]="PHONE"]=0,A[a[1]="TABLET"]=1,A[a[2]="DESKTOP"]=2,A[a[3]="WEARABLE"]=3,A[a[4]="VR"]=4,A})(),i.Platform=(function(){let a={},A=Object.create(a);return A[a[0]="ANDROID"]=0,A[a[1]="IOS"]=1,A[a[2]="WINDOWS_PHONE"]=2,A[a[3]="BLACKBERRY"]=3,A[a[4]="BLACKBERRYX"]=4,A[a[5]="S40"]=5,A[a[6]="S60"]=6,A[a[7]="PYTHON_CLIENT"]=7,A[a[8]="TIZEN"]=8,A[a[9]="ENTERPRISE"]=9,A[a[10]="SMB_ANDROID"]=10,A[a[11]="KAIOS"]=11,A[a[12]="SMB_IOS"]=12,A[a[13]="WINDOWS"]=13,A[a[14]="WEB"]=14,A[a[15]="PORTAL"]=15,A[a[16]="GREEN_ANDROID"]=16,A[a[17]="GREEN_IPHONE"]=17,A[a[18]="BLUE_ANDROID"]=18,A[a[19]="BLUE_IPHONE"]=19,A[a[20]="FBLITE_ANDROID"]=20,A[a[21]="MLITE_ANDROID"]=21,A[a[22]="IGLITE_ANDROID"]=22,A[a[23]="PAGE"]=23,A[a[24]="MACOS"]=24,A[a[25]="OCULUS_MSG"]=25,A[a[26]="OCULUS_CALL"]=26,A[a[27]="MILAN"]=27,A[a[28]="CAPI"]=28,A[a[29]="WEAROS"]=29,A[a[30]="ARDEVICE"]=30,A[a[31]="VRDEVICE"]=31,A[a[32]="BLUE_WEB"]=32,A[a[33]="IPAD"]=33,A[a[34]="TEST"]=34,A[a[35]="SMART_GLASSES"]=35,A[a[36]="BLUE_VR"]=36,A[a[37]="AR_WRIST"]=37,A})(),i.ReleaseChannel=(function(){let a={},A=Object.create(a);return A[a[0]="RELEASE"]=0,A[a[1]="BETA"]=1,A[a[2]="ALPHA"]=2,A[a[3]="DEBUG"]=3,A})(),i})(),t.WebInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.refToken=A.string();break}case 2:{c.version=A.string();break}case 3:{c.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.decode(A,A.uint32());break}case 4:{c.webSubPlatform=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.WebInfo)return A;var r=new p.proto.ClientPayload.WebInfo;if(A.refToken!=null&&(r.refToken=String(A.refToken)),A.version!=null&&(r.version=String(A.version)),A.webdPayload!=null){if(typeof A.webdPayload!="object")throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected");r.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.fromObject(A.webdPayload)}switch(A.webSubPlatform){default:if(typeof A.webSubPlatform=="number"){r.webSubPlatform=A.webSubPlatform;break}break;case"WEB_BROWSER":case 0:r.webSubPlatform=0;break;case"APP_STORE":case 1:r.webSubPlatform=1;break;case"WIN_STORE":case 2:r.webSubPlatform=2;break;case"DARWIN":case 3:r.webSubPlatform=3;break;case"WIN32":case 4:r.webSubPlatform=4;break;case"WIN_HYBRID":case 5:r.webSubPlatform=5;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.refToken!=null&&A.hasOwnProperty("refToken")&&(s.refToken=A.refToken,r.oneofs&&(s._refToken="refToken")),A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),A.webdPayload!=null&&A.hasOwnProperty("webdPayload")&&(s.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.toObject(A.webdPayload,r),r.oneofs&&(s._webdPayload="webdPayload")),A.webSubPlatform!=null&&A.hasOwnProperty("webSubPlatform")&&(s.webSubPlatform=r.enums===String?p.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]===void 0?A.webSubPlatform:p.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]:A.webSubPlatform,r.oneofs&&(s._webSubPlatform="webSubPlatform")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.WebInfo"},i.WebSubPlatform=(function(){let a={},A=Object.create(a);return A[a[0]="WEB_BROWSER"]=0,A[a[1]="APP_STORE"]=1,A[a[2]="WIN_STORE"]=2,A[a[3]="DARWIN"]=3,A[a[4]="WIN32"]=4,A[a[5]="WIN_HYBRID"]=5,A})(),i.WebdPayload=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.usesParticipantInKey=s.bool();break}case 2:{d.supportsStarredMessages=s.bool();break}case 3:{d.supportsDocumentMessages=s.bool();break}case 4:{d.supportsUrlMessages=s.bool();break}case 5:{d.supportsMediaRetry=s.bool();break}case 6:{d.supportsE2EImage=s.bool();break}case 7:{d.supportsE2EVideo=s.bool();break}case 8:{d.supportsE2EAudio=s.bool();break}case 9:{d.supportsE2EDocument=s.bool();break}case 10:{d.documentTypes=s.string();break}case 11:{d.features=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ClientPayload.WebInfo.WebdPayload)return s;var g=new p.proto.ClientPayload.WebInfo.WebdPayload;return s.usesParticipantInKey!=null&&(g.usesParticipantInKey=!!s.usesParticipantInKey),s.supportsStarredMessages!=null&&(g.supportsStarredMessages=!!s.supportsStarredMessages),s.supportsDocumentMessages!=null&&(g.supportsDocumentMessages=!!s.supportsDocumentMessages),s.supportsUrlMessages!=null&&(g.supportsUrlMessages=!!s.supportsUrlMessages),s.supportsMediaRetry!=null&&(g.supportsMediaRetry=!!s.supportsMediaRetry),s.supportsE2EImage!=null&&(g.supportsE2EImage=!!s.supportsE2EImage),s.supportsE2EVideo!=null&&(g.supportsE2EVideo=!!s.supportsE2EVideo),s.supportsE2EAudio!=null&&(g.supportsE2EAudio=!!s.supportsE2EAudio),s.supportsE2EDocument!=null&&(g.supportsE2EDocument=!!s.supportsE2EDocument),s.documentTypes!=null&&(g.documentTypes=String(s.documentTypes)),s.features!=null&&(typeof s.features=="string"?l.base64.decode(s.features,g.features=l.newBuffer(l.base64.length(s.features)),0):s.features.length>=0&&(g.features=s.features)),g},a.toObject=function(s,g){g||(g={});var c={};return s.usesParticipantInKey!=null&&s.hasOwnProperty("usesParticipantInKey")&&(c.usesParticipantInKey=s.usesParticipantInKey,g.oneofs&&(c._usesParticipantInKey="usesParticipantInKey")),s.supportsStarredMessages!=null&&s.hasOwnProperty("supportsStarredMessages")&&(c.supportsStarredMessages=s.supportsStarredMessages,g.oneofs&&(c._supportsStarredMessages="supportsStarredMessages")),s.supportsDocumentMessages!=null&&s.hasOwnProperty("supportsDocumentMessages")&&(c.supportsDocumentMessages=s.supportsDocumentMessages,g.oneofs&&(c._supportsDocumentMessages="supportsDocumentMessages")),s.supportsUrlMessages!=null&&s.hasOwnProperty("supportsUrlMessages")&&(c.supportsUrlMessages=s.supportsUrlMessages,g.oneofs&&(c._supportsUrlMessages="supportsUrlMessages")),s.supportsMediaRetry!=null&&s.hasOwnProperty("supportsMediaRetry")&&(c.supportsMediaRetry=s.supportsMediaRetry,g.oneofs&&(c._supportsMediaRetry="supportsMediaRetry")),s.supportsE2EImage!=null&&s.hasOwnProperty("supportsE2EImage")&&(c.supportsE2EImage=s.supportsE2EImage,g.oneofs&&(c._supportsE2EImage="supportsE2EImage")),s.supportsE2EVideo!=null&&s.hasOwnProperty("supportsE2EVideo")&&(c.supportsE2EVideo=s.supportsE2EVideo,g.oneofs&&(c._supportsE2EVideo="supportsE2EVideo")),s.supportsE2EAudio!=null&&s.hasOwnProperty("supportsE2EAudio")&&(c.supportsE2EAudio=s.supportsE2EAudio,g.oneofs&&(c._supportsE2EAudio="supportsE2EAudio")),s.supportsE2EDocument!=null&&s.hasOwnProperty("supportsE2EDocument")&&(c.supportsE2EDocument=s.supportsE2EDocument,g.oneofs&&(c._supportsE2EDocument="supportsE2EDocument")),s.documentTypes!=null&&s.hasOwnProperty("documentTypes")&&(c.documentTypes=s.documentTypes,g.oneofs&&(c._documentTypes="documentTypes")),s.features!=null&&s.hasOwnProperty("features")&&(c.features=g.bytes===String?l.base64.encode(s.features,0,s.features.length):g.bytes===Array?Array.prototype.slice.call(s.features):s.features,g.oneofs&&(c._features="features")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.WebInfo.WebdPayload"},a})(),i})(),t})(),n.CollectionName=(function(){let t={},o=Object.create(t);return o[t[0]="COLLECTION_NAME_UNKNOWN"]=0,o[t[1]="REGULAR"]=1,o[t[2]="REGULAR_LOW"]=2,o[t[3]="REGULAR_HIGH"]=3,o[t[4]="CRITICAL_BLOCK"]=4,o[t[5]="CRITICAL_UNBLOCK_LOW"]=5,o})(),n.CommentMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.commentParentKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.replyCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CommentMetadata)return e;var a=new p.proto.CommentMetadata;if(e.commentParentKey!=null){if(typeof e.commentParentKey!="object")throw TypeError(".proto.CommentMetadata.commentParentKey: object expected");a.commentParentKey=p.proto.MessageKey.fromObject(e.commentParentKey)}return e.replyCount!=null&&(a.replyCount=e.replyCount>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.commentParentKey!=null&&e.hasOwnProperty("commentParentKey")&&(A.commentParentKey=p.proto.MessageKey.toObject(e.commentParentKey,a),a.oneofs&&(A._commentParentKey="commentParentKey")),e.replyCount!=null&&e.hasOwnProperty("replyCount")&&(A.replyCount=e.replyCount,a.oneofs&&(A._replyCount="replyCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CommentMetadata"},t})(),n.CompanionCommitment=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.hash=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CompanionCommitment)return e;var a=new p.proto.CompanionCommitment;return e.hash!=null&&(typeof e.hash=="string"?l.base64.decode(e.hash,a.hash=l.newBuffer(l.base64.length(e.hash)),0):e.hash.length>=0&&(a.hash=e.hash)),a},t.toObject=function(e,a){a||(a={});var A={};return e.hash!=null&&e.hasOwnProperty("hash")&&(A.hash=a.bytes===String?l.base64.encode(e.hash,0,e.hash.length):a.bytes===Array?Array.prototype.slice.call(e.hash):e.hash,a.oneofs&&(A._hash="hash")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionCommitment"},t})(),n.CompanionEphemeralIdentity=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.deviceType=e.int32();break}case 3:{s.ref=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CompanionEphemeralIdentity)return e;var a=new p.proto.CompanionEphemeralIdentity;switch(e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.deviceType){default:if(typeof e.deviceType=="number"){a.deviceType=e.deviceType;break}break;case"UNKNOWN":case 0:a.deviceType=0;break;case"CHROME":case 1:a.deviceType=1;break;case"FIREFOX":case 2:a.deviceType=2;break;case"IE":case 3:a.deviceType=3;break;case"OPERA":case 4:a.deviceType=4;break;case"SAFARI":case 5:a.deviceType=5;break;case"EDGE":case 6:a.deviceType=6;break;case"DESKTOP":case 7:a.deviceType=7;break;case"IPAD":case 8:a.deviceType=8;break;case"ANDROID_TABLET":case 9:a.deviceType=9;break;case"OHANA":case 10:a.deviceType=10;break;case"ALOHA":case 11:a.deviceType=11;break;case"CATALINA":case 12:a.deviceType=12;break;case"TCL_TV":case 13:a.deviceType=13;break;case"IOS_PHONE":case 14:a.deviceType=14;break;case"IOS_CATALYST":case 15:a.deviceType=15;break;case"ANDROID_PHONE":case 16:a.deviceType=16;break;case"ANDROID_AMBIGUOUS":case 17:a.deviceType=17;break;case"WEAR_OS":case 18:a.deviceType=18;break;case"AR_WRIST":case 19:a.deviceType=19;break;case"AR_DEVICE":case 20:a.deviceType=20;break;case"UWP":case 21:a.deviceType=21;break;case"VR":case 22:a.deviceType=22;break;case"CLOUD_API":case 23:a.deviceType=23;break;case"SMARTGLASSES":case 24:a.deviceType=24;break}return e.ref!=null&&(a.ref=String(e.ref)),a},t.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=a.enums===String?p.proto.DeviceProps.PlatformType[e.deviceType]===void 0?e.deviceType:p.proto.DeviceProps.PlatformType[e.deviceType]:e.deviceType,a.oneofs&&(A._deviceType="deviceType")),e.ref!=null&&e.hasOwnProperty("ref")&&(A.ref=e.ref,a.oneofs&&(A._ref="ref")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionEphemeralIdentity"},t})(),n.Config=(function(){function t(i){if(this.field={},i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.field===l.emptyObject&&(s.field={});var d=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=p.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.field[g]=c;break}case 2:{s.version=e.uint32();break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Config)return e;var a=new p.proto.Config;if(e.field){if(typeof e.field!="object")throw TypeError(".proto.Config.field: object expected");a.field={};for(var A=Object.keys(e.field),r=0;r>>0),a},t.toObject=function(e,a){a||(a={});var A={};(a.objects||a.defaults)&&(A.field={});var r;if(e.field&&(r=Object.keys(e.field)).length){A.field={};for(var s=0;s>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.participant=e.string();break}case 3:{s.quotedMessage=p.proto.Message.decode(e,e.uint32());break}case 4:{s.remoteJid=e.string();break}case 15:{s.mentionedJid&&s.mentionedJid.length||(s.mentionedJid=[]),s.mentionedJid.push(e.string());break}case 18:{s.conversionSource=e.string();break}case 19:{s.conversionData=e.bytes();break}case 20:{s.conversionDelaySeconds=e.uint32();break}case 21:{s.forwardingScore=e.uint32();break}case 22:{s.isForwarded=e.bool();break}case 23:{s.quotedAd=p.proto.ContextInfo.AdReplyInfo.decode(e,e.uint32());break}case 24:{s.placeholderKey=p.proto.MessageKey.decode(e,e.uint32());break}case 25:{s.expiration=e.uint32();break}case 26:{s.ephemeralSettingTimestamp=e.int64();break}case 27:{s.ephemeralSharedSecret=e.bytes();break}case 28:{s.externalAdReply=p.proto.ContextInfo.ExternalAdReplyInfo.decode(e,e.uint32());break}case 29:{s.entryPointConversionSource=e.string();break}case 30:{s.entryPointConversionApp=e.string();break}case 31:{s.entryPointConversionDelaySeconds=e.uint32();break}case 32:{s.disappearingMode=p.proto.DisappearingMode.decode(e,e.uint32());break}case 33:{s.actionLink=p.proto.ActionLink.decode(e,e.uint32());break}case 34:{s.groupSubject=e.string();break}case 35:{s.parentGroupJid=e.string();break}case 37:{s.trustBannerType=e.string();break}case 38:{s.trustBannerAction=e.uint32();break}case 39:{s.isSampled=e.bool();break}case 40:{s.groupMentions&&s.groupMentions.length||(s.groupMentions=[]),s.groupMentions.push(p.proto.GroupMention.decode(e,e.uint32()));break}case 41:{s.utm=p.proto.ContextInfo.UTMInfo.decode(e,e.uint32());break}case 43:{s.forwardedNewsletterMessageInfo=p.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 44:{s.businessMessageForwardInfo=p.proto.ContextInfo.BusinessMessageForwardInfo.decode(e,e.uint32());break}case 45:{s.smbClientCampaignId=e.string();break}case 46:{s.smbServerCampaignId=e.string();break}case 47:{s.dataSharingContext=p.proto.ContextInfo.DataSharingContext.decode(e,e.uint32());break}case 48:{s.alwaysShowAdAttribution=e.bool();break}case 49:{s.featureEligibilities=p.proto.ContextInfo.FeatureEligibilities.decode(e,e.uint32());break}case 50:{s.entryPointConversionExternalSource=e.string();break}case 51:{s.entryPointConversionExternalMedium=e.string();break}case 54:{s.ctwaSignals=e.string();break}case 55:{s.ctwaPayload=e.bytes();break}case 56:{s.forwardedAiBotMessageInfo=p.proto.ForwardedAIBotMessageInfo.decode(e,e.uint32());break}case 57:{s.statusAttributionType=e.int32();break}case 58:{s.urlTrackingMap=p.proto.UrlTrackingMap.decode(e,e.uint32());break}case 59:{s.pairedMediaType=e.int32();break}case 60:{s.rankingVersion=e.uint32();break}case 62:{s.memberLabel=p.proto.MemberLabel.decode(e,e.uint32());break}case 63:{s.isQuestion=e.bool();break}case 64:{s.statusSourceType=e.int32();break}case 65:{s.statusAttributions&&s.statusAttributions.length||(s.statusAttributions=[]),s.statusAttributions.push(p.proto.StatusAttribution.decode(e,e.uint32()));break}case 66:{s.isGroupStatus=e.bool();break}case 67:{s.forwardOrigin=e.int32();break}case 68:{s.questionReplyQuotedMessage=p.proto.ContextInfo.QuestionReplyQuotedMessage.decode(e,e.uint32());break}case 69:{s.statusAudienceMetadata=p.proto.ContextInfo.StatusAudienceMetadata.decode(e,e.uint32());break}case 70:{s.nonJidMentions=e.uint32();break}case 71:{s.quotedType=e.int32();break}case 72:{s.botMessageSharingInfo=p.proto.BotMessageSharingInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ContextInfo)return e;var a=new p.proto.ContextInfo;if(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.participant!=null&&(a.participant=String(e.participant)),e.quotedMessage!=null){if(typeof e.quotedMessage!="object")throw TypeError(".proto.ContextInfo.quotedMessage: object expected");a.quotedMessage=p.proto.Message.fromObject(e.quotedMessage)}if(e.remoteJid!=null&&(a.remoteJid=String(e.remoteJid)),e.mentionedJid){if(!Array.isArray(e.mentionedJid))throw TypeError(".proto.ContextInfo.mentionedJid: array expected");a.mentionedJid=[];for(var A=0;A=0&&(a.conversionData=e.conversionData)),e.conversionDelaySeconds!=null&&(a.conversionDelaySeconds=e.conversionDelaySeconds>>>0),e.forwardingScore!=null&&(a.forwardingScore=e.forwardingScore>>>0),e.isForwarded!=null&&(a.isForwarded=!!e.isForwarded),e.quotedAd!=null){if(typeof e.quotedAd!="object")throw TypeError(".proto.ContextInfo.quotedAd: object expected");a.quotedAd=p.proto.ContextInfo.AdReplyInfo.fromObject(e.quotedAd)}if(e.placeholderKey!=null){if(typeof e.placeholderKey!="object")throw TypeError(".proto.ContextInfo.placeholderKey: object expected");a.placeholderKey=p.proto.MessageKey.fromObject(e.placeholderKey)}if(e.expiration!=null&&(a.expiration=e.expiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(a.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?a.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(a.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.ephemeralSharedSecret!=null&&(typeof e.ephemeralSharedSecret=="string"?l.base64.decode(e.ephemeralSharedSecret,a.ephemeralSharedSecret=l.newBuffer(l.base64.length(e.ephemeralSharedSecret)),0):e.ephemeralSharedSecret.length>=0&&(a.ephemeralSharedSecret=e.ephemeralSharedSecret)),e.externalAdReply!=null){if(typeof e.externalAdReply!="object")throw TypeError(".proto.ContextInfo.externalAdReply: object expected");a.externalAdReply=p.proto.ContextInfo.ExternalAdReplyInfo.fromObject(e.externalAdReply)}if(e.entryPointConversionSource!=null&&(a.entryPointConversionSource=String(e.entryPointConversionSource)),e.entryPointConversionApp!=null&&(a.entryPointConversionApp=String(e.entryPointConversionApp)),e.entryPointConversionDelaySeconds!=null&&(a.entryPointConversionDelaySeconds=e.entryPointConversionDelaySeconds>>>0),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.ContextInfo.disappearingMode: object expected");a.disappearingMode=p.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.actionLink!=null){if(typeof e.actionLink!="object")throw TypeError(".proto.ContextInfo.actionLink: object expected");a.actionLink=p.proto.ActionLink.fromObject(e.actionLink)}if(e.groupSubject!=null&&(a.groupSubject=String(e.groupSubject)),e.parentGroupJid!=null&&(a.parentGroupJid=String(e.parentGroupJid)),e.trustBannerType!=null&&(a.trustBannerType=String(e.trustBannerType)),e.trustBannerAction!=null&&(a.trustBannerAction=e.trustBannerAction>>>0),e.isSampled!=null&&(a.isSampled=!!e.isSampled),e.groupMentions){if(!Array.isArray(e.groupMentions))throw TypeError(".proto.ContextInfo.groupMentions: array expected");a.groupMentions=[];for(var A=0;A=0&&(a.ctwaPayload=e.ctwaPayload)),e.forwardedAiBotMessageInfo!=null){if(typeof e.forwardedAiBotMessageInfo!="object")throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected");a.forwardedAiBotMessageInfo=p.proto.ForwardedAIBotMessageInfo.fromObject(e.forwardedAiBotMessageInfo)}switch(e.statusAttributionType){default:if(typeof e.statusAttributionType=="number"){a.statusAttributionType=e.statusAttributionType;break}break;case"NONE":case 0:a.statusAttributionType=0;break;case"RESHARED_FROM_MENTION":case 1:a.statusAttributionType=1;break;case"RESHARED_FROM_POST":case 2:a.statusAttributionType=2;break;case"RESHARED_FROM_POST_MANY_TIMES":case 3:a.statusAttributionType=3;break;case"FORWARDED_FROM_STATUS":case 4:a.statusAttributionType=4;break}if(e.urlTrackingMap!=null){if(typeof e.urlTrackingMap!="object")throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected");a.urlTrackingMap=p.proto.UrlTrackingMap.fromObject(e.urlTrackingMap)}switch(e.pairedMediaType){default:if(typeof e.pairedMediaType=="number"){a.pairedMediaType=e.pairedMediaType;break}break;case"NOT_PAIRED_MEDIA":case 0:a.pairedMediaType=0;break;case"SD_VIDEO_PARENT":case 1:a.pairedMediaType=1;break;case"HD_VIDEO_CHILD":case 2:a.pairedMediaType=2;break;case"SD_IMAGE_PARENT":case 3:a.pairedMediaType=3;break;case"HD_IMAGE_CHILD":case 4:a.pairedMediaType=4;break;case"MOTION_PHOTO_PARENT":case 5:a.pairedMediaType=5;break;case"MOTION_PHOTO_CHILD":case 6:a.pairedMediaType=6;break;case"HEVC_VIDEO_PARENT":case 7:a.pairedMediaType=7;break;case"HEVC_VIDEO_CHILD":case 8:a.pairedMediaType=8;break}if(e.rankingVersion!=null&&(a.rankingVersion=e.rankingVersion>>>0),e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.ContextInfo.memberLabel: object expected");a.memberLabel=p.proto.MemberLabel.fromObject(e.memberLabel)}switch(e.isQuestion!=null&&(a.isQuestion=!!e.isQuestion),e.statusSourceType){default:if(typeof e.statusSourceType=="number"){a.statusSourceType=e.statusSourceType;break}break;case"IMAGE":case 0:a.statusSourceType=0;break;case"VIDEO":case 1:a.statusSourceType=1;break;case"GIF":case 2:a.statusSourceType=2;break;case"AUDIO":case 3:a.statusSourceType=3;break;case"TEXT":case 4:a.statusSourceType=4;break;case"MUSIC_STANDALONE":case 5:a.statusSourceType=5;break}if(e.statusAttributions){if(!Array.isArray(e.statusAttributions))throw TypeError(".proto.ContextInfo.statusAttributions: array expected");a.statusAttributions=[];for(var A=0;A>>0),e.quotedType){default:if(typeof e.quotedType=="number"){a.quotedType=e.quotedType;break}break;case"EXPLICIT":case 0:a.quotedType=0;break;case"AUTO":case 1:a.quotedType=1;break}if(e.botMessageSharingInfo!=null){if(typeof e.botMessageSharingInfo!="object")throw TypeError(".proto.ContextInfo.botMessageSharingInfo: object expected");a.botMessageSharingInfo=p.proto.BotMessageSharingInfo.fromObject(e.botMessageSharingInfo)}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.mentionedJid=[],A.groupMentions=[],A.statusAttributions=[]),e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),e.quotedMessage!=null&&e.hasOwnProperty("quotedMessage")&&(A.quotedMessage=p.proto.Message.toObject(e.quotedMessage,a),a.oneofs&&(A._quotedMessage="quotedMessage")),e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,a.oneofs&&(A._remoteJid="remoteJid")),e.mentionedJid&&e.mentionedJid.length){A.mentionedJid=[];for(var r=0;r>>3){case 1:{c.advertiserName=A.string();break}case 2:{c.mediaType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.AdReplyInfo)return A;var r=new p.proto.ContextInfo.AdReplyInfo;switch(A.advertiserName!=null&&(r.advertiserName=String(A.advertiserName)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),r},i.toObject=function(A,r){r||(r={});var s={};return A.advertiserName!=null&&A.hasOwnProperty("advertiserName")&&(s.advertiserName=A.advertiserName,r.oneofs&&(s._advertiserName="advertiserName")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?p.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.AdReplyInfo"},i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="IMAGE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.BusinessMessageForwardInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.businessOwnerJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.BusinessMessageForwardInfo)return A;var r=new p.proto.ContextInfo.BusinessMessageForwardInfo;return A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),r},i.toObject=function(A,r){r||(r={});var s={};return A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.BusinessMessageForwardInfo"},i})(),t.DataSharingContext=(function(){function i(a){if(this.parameters=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.showMmDisclosure=A.bool();break}case 2:{c.encryptedSignalTokenConsented=A.string();break}case 3:{c.parameters&&c.parameters.length||(c.parameters=[]),c.parameters.push(p.proto.ContextInfo.DataSharingContext.Parameters.decode(A,A.uint32()));break}case 4:{c.dataSharingFlags=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.DataSharingContext)return A;var r=new p.proto.ContextInfo.DataSharingContext;if(A.showMmDisclosure!=null&&(r.showMmDisclosure=!!A.showMmDisclosure),A.encryptedSignalTokenConsented!=null&&(r.encryptedSignalTokenConsented=String(A.encryptedSignalTokenConsented)),A.parameters){if(!Array.isArray(A.parameters))throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected");r.parameters=[];for(var s=0;s>>3){case 1:{d.key=s.string();break}case 2:{d.stringData=s.string();break}case 3:{d.intData=s.int64();break}case 4:{d.floatData=s.float();break}case 5:{d.contents=p.proto.ContextInfo.DataSharingContext.Parameters.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ContextInfo.DataSharingContext.Parameters)return s;var g=new p.proto.ContextInfo.DataSharingContext.Parameters;if(s.key!=null&&(g.key=String(s.key)),s.stringData!=null&&(g.stringData=String(s.stringData)),s.intData!=null&&(l.Long?(g.intData=l.Long.fromValue(s.intData)).unsigned=!1:typeof s.intData=="string"?g.intData=parseInt(s.intData,10):typeof s.intData=="number"?g.intData=s.intData:typeof s.intData=="object"&&(g.intData=new l.LongBits(s.intData.low>>>0,s.intData.high>>>0).toNumber())),s.floatData!=null&&(g.floatData=Number(s.floatData)),s.contents!=null){if(typeof s.contents!="object")throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected");g.contents=p.proto.ContextInfo.DataSharingContext.Parameters.fromObject(s.contents)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.key!=null&&s.hasOwnProperty("key")&&(c.key=s.key,g.oneofs&&(c._key="key")),s.stringData!=null&&s.hasOwnProperty("stringData")&&(c.stringData=s.stringData,g.oneofs&&(c._stringData="stringData")),s.intData!=null&&s.hasOwnProperty("intData")&&(typeof s.intData=="number"?c.intData=g.longs===String?String(s.intData):s.intData:c.intData=g.longs===String?ge(s.intData):g.longs===Number?ce(s.intData):s.intData,g.oneofs&&(c._intData="intData")),s.floatData!=null&&s.hasOwnProperty("floatData")&&(c.floatData=g.json&&!isFinite(s.floatData)?String(s.floatData):s.floatData,g.oneofs&&(c._floatData="floatData")),s.contents!=null&&s.hasOwnProperty("contents")&&(c.contents=p.proto.ContextInfo.DataSharingContext.Parameters.toObject(s.contents,g),g.oneofs&&(c._contents="contents")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ContextInfo.DataSharingContext.Parameters"},a})(),i})(),t.ExternalAdReplyInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.body=A.string();break}case 3:{c.mediaType=A.int32();break}case 4:{c.thumbnailUrl=A.string();break}case 5:{c.mediaUrl=A.string();break}case 6:{c.thumbnail=A.bytes();break}case 7:{c.sourceType=A.string();break}case 8:{c.sourceId=A.string();break}case 9:{c.sourceUrl=A.string();break}case 10:{c.containsAutoReply=A.bool();break}case 11:{c.renderLargerThumbnail=A.bool();break}case 12:{c.showAdAttribution=A.bool();break}case 13:{c.ctwaClid=A.string();break}case 14:{c.ref=A.string();break}case 15:{c.clickToWhatsappCall=A.bool();break}case 16:{c.adContextPreviewDismissed=A.bool();break}case 17:{c.sourceApp=A.string();break}case 18:{c.automatedGreetingMessageShown=A.bool();break}case 19:{c.greetingMessageBody=A.string();break}case 20:{c.ctaPayload=A.string();break}case 21:{c.disableNudge=A.bool();break}case 22:{c.originalImageUrl=A.string();break}case 23:{c.automatedGreetingMessageCtaType=A.string();break}case 24:{c.wtwaAdFormat=A.bool();break}case 25:{c.adType=A.int32();break}case 26:{c.wtwaWebsiteUrl=A.string();break}case 27:{c.adPreviewUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.ExternalAdReplyInfo)return A;var r=new p.proto.ContextInfo.ExternalAdReplyInfo;switch(A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}switch(A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.mediaUrl!=null&&(r.mediaUrl=String(A.mediaUrl)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.sourceType!=null&&(r.sourceType=String(A.sourceType)),A.sourceId!=null&&(r.sourceId=String(A.sourceId)),A.sourceUrl!=null&&(r.sourceUrl=String(A.sourceUrl)),A.containsAutoReply!=null&&(r.containsAutoReply=!!A.containsAutoReply),A.renderLargerThumbnail!=null&&(r.renderLargerThumbnail=!!A.renderLargerThumbnail),A.showAdAttribution!=null&&(r.showAdAttribution=!!A.showAdAttribution),A.ctwaClid!=null&&(r.ctwaClid=String(A.ctwaClid)),A.ref!=null&&(r.ref=String(A.ref)),A.clickToWhatsappCall!=null&&(r.clickToWhatsappCall=!!A.clickToWhatsappCall),A.adContextPreviewDismissed!=null&&(r.adContextPreviewDismissed=!!A.adContextPreviewDismissed),A.sourceApp!=null&&(r.sourceApp=String(A.sourceApp)),A.automatedGreetingMessageShown!=null&&(r.automatedGreetingMessageShown=!!A.automatedGreetingMessageShown),A.greetingMessageBody!=null&&(r.greetingMessageBody=String(A.greetingMessageBody)),A.ctaPayload!=null&&(r.ctaPayload=String(A.ctaPayload)),A.disableNudge!=null&&(r.disableNudge=!!A.disableNudge),A.originalImageUrl!=null&&(r.originalImageUrl=String(A.originalImageUrl)),A.automatedGreetingMessageCtaType!=null&&(r.automatedGreetingMessageCtaType=String(A.automatedGreetingMessageCtaType)),A.wtwaAdFormat!=null&&(r.wtwaAdFormat=!!A.wtwaAdFormat),A.adType){default:if(typeof A.adType=="number"){r.adType=A.adType;break}break;case"CTWA":case 0:r.adType=0;break;case"CAWC":case 1:r.adType=1;break}return A.wtwaWebsiteUrl!=null&&(r.wtwaWebsiteUrl=String(A.wtwaWebsiteUrl)),A.adPreviewUrl!=null&&(r.adPreviewUrl=String(A.adPreviewUrl)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?p.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.mediaUrl!=null&&A.hasOwnProperty("mediaUrl")&&(s.mediaUrl=A.mediaUrl,r.oneofs&&(s._mediaUrl="mediaUrl")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.sourceType!=null&&A.hasOwnProperty("sourceType")&&(s.sourceType=A.sourceType,r.oneofs&&(s._sourceType="sourceType")),A.sourceId!=null&&A.hasOwnProperty("sourceId")&&(s.sourceId=A.sourceId,r.oneofs&&(s._sourceId="sourceId")),A.sourceUrl!=null&&A.hasOwnProperty("sourceUrl")&&(s.sourceUrl=A.sourceUrl,r.oneofs&&(s._sourceUrl="sourceUrl")),A.containsAutoReply!=null&&A.hasOwnProperty("containsAutoReply")&&(s.containsAutoReply=A.containsAutoReply,r.oneofs&&(s._containsAutoReply="containsAutoReply")),A.renderLargerThumbnail!=null&&A.hasOwnProperty("renderLargerThumbnail")&&(s.renderLargerThumbnail=A.renderLargerThumbnail,r.oneofs&&(s._renderLargerThumbnail="renderLargerThumbnail")),A.showAdAttribution!=null&&A.hasOwnProperty("showAdAttribution")&&(s.showAdAttribution=A.showAdAttribution,r.oneofs&&(s._showAdAttribution="showAdAttribution")),A.ctwaClid!=null&&A.hasOwnProperty("ctwaClid")&&(s.ctwaClid=A.ctwaClid,r.oneofs&&(s._ctwaClid="ctwaClid")),A.ref!=null&&A.hasOwnProperty("ref")&&(s.ref=A.ref,r.oneofs&&(s._ref="ref")),A.clickToWhatsappCall!=null&&A.hasOwnProperty("clickToWhatsappCall")&&(s.clickToWhatsappCall=A.clickToWhatsappCall,r.oneofs&&(s._clickToWhatsappCall="clickToWhatsappCall")),A.adContextPreviewDismissed!=null&&A.hasOwnProperty("adContextPreviewDismissed")&&(s.adContextPreviewDismissed=A.adContextPreviewDismissed,r.oneofs&&(s._adContextPreviewDismissed="adContextPreviewDismissed")),A.sourceApp!=null&&A.hasOwnProperty("sourceApp")&&(s.sourceApp=A.sourceApp,r.oneofs&&(s._sourceApp="sourceApp")),A.automatedGreetingMessageShown!=null&&A.hasOwnProperty("automatedGreetingMessageShown")&&(s.automatedGreetingMessageShown=A.automatedGreetingMessageShown,r.oneofs&&(s._automatedGreetingMessageShown="automatedGreetingMessageShown")),A.greetingMessageBody!=null&&A.hasOwnProperty("greetingMessageBody")&&(s.greetingMessageBody=A.greetingMessageBody,r.oneofs&&(s._greetingMessageBody="greetingMessageBody")),A.ctaPayload!=null&&A.hasOwnProperty("ctaPayload")&&(s.ctaPayload=A.ctaPayload,r.oneofs&&(s._ctaPayload="ctaPayload")),A.disableNudge!=null&&A.hasOwnProperty("disableNudge")&&(s.disableNudge=A.disableNudge,r.oneofs&&(s._disableNudge="disableNudge")),A.originalImageUrl!=null&&A.hasOwnProperty("originalImageUrl")&&(s.originalImageUrl=A.originalImageUrl,r.oneofs&&(s._originalImageUrl="originalImageUrl")),A.automatedGreetingMessageCtaType!=null&&A.hasOwnProperty("automatedGreetingMessageCtaType")&&(s.automatedGreetingMessageCtaType=A.automatedGreetingMessageCtaType,r.oneofs&&(s._automatedGreetingMessageCtaType="automatedGreetingMessageCtaType")),A.wtwaAdFormat!=null&&A.hasOwnProperty("wtwaAdFormat")&&(s.wtwaAdFormat=A.wtwaAdFormat,r.oneofs&&(s._wtwaAdFormat="wtwaAdFormat")),A.adType!=null&&A.hasOwnProperty("adType")&&(s.adType=r.enums===String?p.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]===void 0?A.adType:p.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]:A.adType,r.oneofs&&(s._adType="adType")),A.wtwaWebsiteUrl!=null&&A.hasOwnProperty("wtwaWebsiteUrl")&&(s.wtwaWebsiteUrl=A.wtwaWebsiteUrl,r.oneofs&&(s._wtwaWebsiteUrl="wtwaWebsiteUrl")),A.adPreviewUrl!=null&&A.hasOwnProperty("adPreviewUrl")&&(s.adPreviewUrl=A.adPreviewUrl,r.oneofs&&(s._adPreviewUrl="adPreviewUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ExternalAdReplyInfo"},i.AdType=(function(){let a={},A=Object.create(a);return A[a[0]="CTWA"]=0,A[a[1]="CAWC"]=1,A})(),i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="IMAGE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.FeatureEligibilities=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.cannotBeReactedTo=A.bool();break}case 2:{c.cannotBeRanked=A.bool();break}case 3:{c.canRequestFeedback=A.bool();break}case 4:{c.canBeReshared=A.bool();break}case 5:{c.canReceiveMultiReact=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.FeatureEligibilities)return A;var r=new p.proto.ContextInfo.FeatureEligibilities;return A.cannotBeReactedTo!=null&&(r.cannotBeReactedTo=!!A.cannotBeReactedTo),A.cannotBeRanked!=null&&(r.cannotBeRanked=!!A.cannotBeRanked),A.canRequestFeedback!=null&&(r.canRequestFeedback=!!A.canRequestFeedback),A.canBeReshared!=null&&(r.canBeReshared=!!A.canBeReshared),A.canReceiveMultiReact!=null&&(r.canReceiveMultiReact=!!A.canReceiveMultiReact),r},i.toObject=function(A,r){r||(r={});var s={};return A.cannotBeReactedTo!=null&&A.hasOwnProperty("cannotBeReactedTo")&&(s.cannotBeReactedTo=A.cannotBeReactedTo,r.oneofs&&(s._cannotBeReactedTo="cannotBeReactedTo")),A.cannotBeRanked!=null&&A.hasOwnProperty("cannotBeRanked")&&(s.cannotBeRanked=A.cannotBeRanked,r.oneofs&&(s._cannotBeRanked="cannotBeRanked")),A.canRequestFeedback!=null&&A.hasOwnProperty("canRequestFeedback")&&(s.canRequestFeedback=A.canRequestFeedback,r.oneofs&&(s._canRequestFeedback="canRequestFeedback")),A.canBeReshared!=null&&A.hasOwnProperty("canBeReshared")&&(s.canBeReshared=A.canBeReshared,r.oneofs&&(s._canBeReshared="canBeReshared")),A.canReceiveMultiReact!=null&&A.hasOwnProperty("canReceiveMultiReact")&&(s.canReceiveMultiReact=A.canReceiveMultiReact,r.oneofs&&(s._canReceiveMultiReact="canReceiveMultiReact")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.FeatureEligibilities"},i})(),t.ForwardOrigin=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT"]=1,e[i[2]="STATUS"]=2,e[i[3]="CHANNELS"]=3,e[i[4]="META_AI"]=4,e[i[5]="UGC"]=5,e})(),t.ForwardedNewsletterMessageInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.serverMessageId=A.int32();break}case 3:{c.newsletterName=A.string();break}case 4:{c.contentType=A.int32();break}case 5:{c.accessibilityText=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.ForwardedNewsletterMessageInfo)return A;var r=new p.proto.ContextInfo.ForwardedNewsletterMessageInfo;switch(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.serverMessageId!=null&&(r.serverMessageId=A.serverMessageId|0),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.contentType){default:if(typeof A.contentType=="number"){r.contentType=A.contentType;break}break;case"UPDATE":case 1:r.contentType=1;break;case"UPDATE_CARD":case 2:r.contentType=2;break;case"LINK_CARD":case 3:r.contentType=3;break}return A.accessibilityText!=null&&(r.accessibilityText=String(A.accessibilityText)),r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.serverMessageId!=null&&A.hasOwnProperty("serverMessageId")&&(s.serverMessageId=A.serverMessageId,r.oneofs&&(s._serverMessageId="serverMessageId")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.contentType!=null&&A.hasOwnProperty("contentType")&&(s.contentType=r.enums===String?p.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]===void 0?A.contentType:p.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]:A.contentType,r.oneofs&&(s._contentType="contentType")),A.accessibilityText!=null&&A.hasOwnProperty("accessibilityText")&&(s.accessibilityText=A.accessibilityText,r.oneofs&&(s._accessibilityText="accessibilityText")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ForwardedNewsletterMessageInfo"},i.ContentType=(function(){let a={},A=Object.create(a);return A[a[1]="UPDATE"]=1,A[a[2]="UPDATE_CARD"]=2,A[a[3]="LINK_CARD"]=3,A})(),i})(),t.PairedMediaType=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_PAIRED_MEDIA"]=0,e[i[1]="SD_VIDEO_PARENT"]=1,e[i[2]="HD_VIDEO_CHILD"]=2,e[i[3]="SD_IMAGE_PARENT"]=3,e[i[4]="HD_IMAGE_CHILD"]=4,e[i[5]="MOTION_PHOTO_PARENT"]=5,e[i[6]="MOTION_PHOTO_CHILD"]=6,e[i[7]="HEVC_VIDEO_PARENT"]=7,e[i[8]="HEVC_VIDEO_CHILD"]=8,e})(),t.QuestionReplyQuotedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serverQuestionId=A.int32();break}case 2:{c.quotedQuestion=p.proto.Message.decode(A,A.uint32());break}case 3:{c.quotedResponse=p.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.QuestionReplyQuotedMessage)return A;var r=new p.proto.ContextInfo.QuestionReplyQuotedMessage;if(A.serverQuestionId!=null&&(r.serverQuestionId=A.serverQuestionId|0),A.quotedQuestion!=null){if(typeof A.quotedQuestion!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedQuestion: object expected");r.quotedQuestion=p.proto.Message.fromObject(A.quotedQuestion)}if(A.quotedResponse!=null){if(typeof A.quotedResponse!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedResponse: object expected");r.quotedResponse=p.proto.Message.fromObject(A.quotedResponse)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.serverQuestionId!=null&&A.hasOwnProperty("serverQuestionId")&&(s.serverQuestionId=A.serverQuestionId,r.oneofs&&(s._serverQuestionId="serverQuestionId")),A.quotedQuestion!=null&&A.hasOwnProperty("quotedQuestion")&&(s.quotedQuestion=p.proto.Message.toObject(A.quotedQuestion,r),r.oneofs&&(s._quotedQuestion="quotedQuestion")),A.quotedResponse!=null&&A.hasOwnProperty("quotedResponse")&&(s.quotedResponse=p.proto.Message.toObject(A.quotedResponse,r),r.oneofs&&(s._quotedResponse="quotedResponse")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.QuestionReplyQuotedMessage"},i})(),t.QuotedType=(function(){let i={},e=Object.create(i);return e[i[0]="EXPLICIT"]=0,e[i[1]="AUTO"]=1,e})(),t.StatusAttributionType=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="RESHARED_FROM_MENTION"]=1,e[i[2]="RESHARED_FROM_POST"]=2,e[i[3]="RESHARED_FROM_POST_MANY_TIMES"]=3,e[i[4]="FORWARDED_FROM_STATUS"]=4,e})(),t.StatusAudienceMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.audienceType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.StatusAudienceMetadata)return A;var r=new p.proto.ContextInfo.StatusAudienceMetadata;switch(A.audienceType){default:if(typeof A.audienceType=="number"){r.audienceType=A.audienceType;break}break;case"UNKNOWN":case 0:r.audienceType=0;break;case"CLOSE_FRIENDS":case 1:r.audienceType=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.audienceType!=null&&A.hasOwnProperty("audienceType")&&(s.audienceType=r.enums===String?p.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]===void 0?A.audienceType:p.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]:A.audienceType,r.oneofs&&(s._audienceType="audienceType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.StatusAudienceMetadata"},i.AudienceType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CLOSE_FRIENDS"]=1,A})(),i})(),t.StatusSourceType=(function(){let i={},e=Object.create(i);return e[i[0]="IMAGE"]=0,e[i[1]="VIDEO"]=1,e[i[2]="GIF"]=2,e[i[3]="AUDIO"]=3,e[i[4]="TEXT"]=4,e[i[5]="MUSIC_STANDALONE"]=5,e})(),t.UTMInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.utmSource=A.string();break}case 2:{c.utmCampaign=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.UTMInfo)return A;var r=new p.proto.ContextInfo.UTMInfo;return A.utmSource!=null&&(r.utmSource=String(A.utmSource)),A.utmCampaign!=null&&(r.utmCampaign=String(A.utmCampaign)),r},i.toObject=function(A,r){r||(r={});var s={};return A.utmSource!=null&&A.hasOwnProperty("utmSource")&&(s.utmSource=A.utmSource,r.oneofs&&(s._utmSource="utmSource")),A.utmCampaign!=null&&A.hasOwnProperty("utmCampaign")&&(s.utmCampaign=A.utmCampaign,r.oneofs&&(s._utmCampaign="utmCampaign")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.UTMInfo"},i})(),t})(),n.Conversation=(function(){function t(i){if(this.messages=[],this.participant=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.messages&&s.messages.length||(s.messages=[]),s.messages.push(p.proto.HistorySyncMsg.decode(e,e.uint32()));break}case 3:{s.newJid=e.string();break}case 4:{s.oldJid=e.string();break}case 5:{s.lastMsgTimestamp=e.uint64();break}case 6:{s.unreadCount=e.uint32();break}case 7:{s.readOnly=e.bool();break}case 8:{s.endOfHistoryTransfer=e.bool();break}case 9:{s.ephemeralExpiration=e.uint32();break}case 10:{s.ephemeralSettingTimestamp=e.int64();break}case 11:{s.endOfHistoryTransferType=e.int32();break}case 12:{s.conversationTimestamp=e.uint64();break}case 13:{s.name=e.string();break}case 14:{s.pHash=e.string();break}case 15:{s.notSpam=e.bool();break}case 16:{s.archived=e.bool();break}case 17:{s.disappearingMode=p.proto.DisappearingMode.decode(e,e.uint32());break}case 18:{s.unreadMentionCount=e.uint32();break}case 19:{s.markedAsUnread=e.bool();break}case 20:{s.participant&&s.participant.length||(s.participant=[]),s.participant.push(p.proto.GroupParticipant.decode(e,e.uint32()));break}case 21:{s.tcToken=e.bytes();break}case 22:{s.tcTokenTimestamp=e.uint64();break}case 23:{s.contactPrimaryIdentityKey=e.bytes();break}case 24:{s.pinned=e.uint32();break}case 25:{s.muteEndTime=e.uint64();break}case 26:{s.wallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 27:{s.mediaVisibility=e.int32();break}case 28:{s.tcTokenSenderTimestamp=e.uint64();break}case 29:{s.suspended=e.bool();break}case 30:{s.terminated=e.bool();break}case 31:{s.createdAt=e.uint64();break}case 32:{s.createdBy=e.string();break}case 33:{s.description=e.string();break}case 34:{s.support=e.bool();break}case 35:{s.isParentGroup=e.bool();break}case 37:{s.parentGroupId=e.string();break}case 36:{s.isDefaultSubgroup=e.bool();break}case 38:{s.displayName=e.string();break}case 39:{s.pnJid=e.string();break}case 40:{s.shareOwnPn=e.bool();break}case 41:{s.pnhDuplicateLidThread=e.bool();break}case 42:{s.lidJid=e.string();break}case 43:{s.username=e.string();break}case 44:{s.lidOriginType=e.string();break}case 45:{s.commentsCount=e.uint32();break}case 46:{s.locked=e.bool();break}case 47:{s.systemMessageToInsert=e.int32();break}case 48:{s.capiCreatedGroup=e.bool();break}case 49:{s.accountLid=e.string();break}case 50:{s.limitSharing=e.bool();break}case 51:{s.limitSharingSettingTimestamp=e.int64();break}case 52:{s.limitSharingTrigger=e.int32();break}case 53:{s.limitSharingInitiatedByMe=e.bool();break}case 54:{s.maibaAiThreadEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Conversation)return e;var a=new p.proto.Conversation;if(e.id!=null&&(a.id=String(e.id)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".proto.Conversation.messages: array expected");a.messages=[];for(var A=0;A>>0,e.lastMsgTimestamp.high>>>0).toNumber(!0))),e.unreadCount!=null&&(a.unreadCount=e.unreadCount>>>0),e.readOnly!=null&&(a.readOnly=!!e.readOnly),e.endOfHistoryTransfer!=null&&(a.endOfHistoryTransfer=!!e.endOfHistoryTransfer),e.ephemeralExpiration!=null&&(a.ephemeralExpiration=e.ephemeralExpiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(a.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?a.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(a.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.endOfHistoryTransferType){default:if(typeof e.endOfHistoryTransferType=="number"){a.endOfHistoryTransferType=e.endOfHistoryTransferType;break}break;case"COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY":case 0:a.endOfHistoryTransferType=0;break;case"COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY":case 1:a.endOfHistoryTransferType=1;break;case"COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY":case 2:a.endOfHistoryTransferType=2;break}if(e.conversationTimestamp!=null&&(l.Long?(a.conversationTimestamp=l.Long.fromValue(e.conversationTimestamp)).unsigned=!0:typeof e.conversationTimestamp=="string"?a.conversationTimestamp=parseInt(e.conversationTimestamp,10):typeof e.conversationTimestamp=="number"?a.conversationTimestamp=e.conversationTimestamp:typeof e.conversationTimestamp=="object"&&(a.conversationTimestamp=new l.LongBits(e.conversationTimestamp.low>>>0,e.conversationTimestamp.high>>>0).toNumber(!0))),e.name!=null&&(a.name=String(e.name)),e.pHash!=null&&(a.pHash=String(e.pHash)),e.notSpam!=null&&(a.notSpam=!!e.notSpam),e.archived!=null&&(a.archived=!!e.archived),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.Conversation.disappearingMode: object expected");a.disappearingMode=p.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.unreadMentionCount!=null&&(a.unreadMentionCount=e.unreadMentionCount>>>0),e.markedAsUnread!=null&&(a.markedAsUnread=!!e.markedAsUnread),e.participant){if(!Array.isArray(e.participant))throw TypeError(".proto.Conversation.participant: array expected");a.participant=[];for(var A=0;A=0&&(a.tcToken=e.tcToken)),e.tcTokenTimestamp!=null&&(l.Long?(a.tcTokenTimestamp=l.Long.fromValue(e.tcTokenTimestamp)).unsigned=!0:typeof e.tcTokenTimestamp=="string"?a.tcTokenTimestamp=parseInt(e.tcTokenTimestamp,10):typeof e.tcTokenTimestamp=="number"?a.tcTokenTimestamp=e.tcTokenTimestamp:typeof e.tcTokenTimestamp=="object"&&(a.tcTokenTimestamp=new l.LongBits(e.tcTokenTimestamp.low>>>0,e.tcTokenTimestamp.high>>>0).toNumber(!0))),e.contactPrimaryIdentityKey!=null&&(typeof e.contactPrimaryIdentityKey=="string"?l.base64.decode(e.contactPrimaryIdentityKey,a.contactPrimaryIdentityKey=l.newBuffer(l.base64.length(e.contactPrimaryIdentityKey)),0):e.contactPrimaryIdentityKey.length>=0&&(a.contactPrimaryIdentityKey=e.contactPrimaryIdentityKey)),e.pinned!=null&&(a.pinned=e.pinned>>>0),e.muteEndTime!=null&&(l.Long?(a.muteEndTime=l.Long.fromValue(e.muteEndTime)).unsigned=!0:typeof e.muteEndTime=="string"?a.muteEndTime=parseInt(e.muteEndTime,10):typeof e.muteEndTime=="number"?a.muteEndTime=e.muteEndTime:typeof e.muteEndTime=="object"&&(a.muteEndTime=new l.LongBits(e.muteEndTime.low>>>0,e.muteEndTime.high>>>0).toNumber(!0))),e.wallpaper!=null){if(typeof e.wallpaper!="object")throw TypeError(".proto.Conversation.wallpaper: object expected");a.wallpaper=p.proto.WallpaperSettings.fromObject(e.wallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){a.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:a.mediaVisibility=0;break;case"OFF":case 1:a.mediaVisibility=1;break;case"ON":case 2:a.mediaVisibility=2;break}switch(e.tcTokenSenderTimestamp!=null&&(l.Long?(a.tcTokenSenderTimestamp=l.Long.fromValue(e.tcTokenSenderTimestamp)).unsigned=!0:typeof e.tcTokenSenderTimestamp=="string"?a.tcTokenSenderTimestamp=parseInt(e.tcTokenSenderTimestamp,10):typeof e.tcTokenSenderTimestamp=="number"?a.tcTokenSenderTimestamp=e.tcTokenSenderTimestamp:typeof e.tcTokenSenderTimestamp=="object"&&(a.tcTokenSenderTimestamp=new l.LongBits(e.tcTokenSenderTimestamp.low>>>0,e.tcTokenSenderTimestamp.high>>>0).toNumber(!0))),e.suspended!=null&&(a.suspended=!!e.suspended),e.terminated!=null&&(a.terminated=!!e.terminated),e.createdAt!=null&&(l.Long?(a.createdAt=l.Long.fromValue(e.createdAt)).unsigned=!0:typeof e.createdAt=="string"?a.createdAt=parseInt(e.createdAt,10):typeof e.createdAt=="number"?a.createdAt=e.createdAt:typeof e.createdAt=="object"&&(a.createdAt=new l.LongBits(e.createdAt.low>>>0,e.createdAt.high>>>0).toNumber(!0))),e.createdBy!=null&&(a.createdBy=String(e.createdBy)),e.description!=null&&(a.description=String(e.description)),e.support!=null&&(a.support=!!e.support),e.isParentGroup!=null&&(a.isParentGroup=!!e.isParentGroup),e.parentGroupId!=null&&(a.parentGroupId=String(e.parentGroupId)),e.isDefaultSubgroup!=null&&(a.isDefaultSubgroup=!!e.isDefaultSubgroup),e.displayName!=null&&(a.displayName=String(e.displayName)),e.pnJid!=null&&(a.pnJid=String(e.pnJid)),e.shareOwnPn!=null&&(a.shareOwnPn=!!e.shareOwnPn),e.pnhDuplicateLidThread!=null&&(a.pnhDuplicateLidThread=!!e.pnhDuplicateLidThread),e.lidJid!=null&&(a.lidJid=String(e.lidJid)),e.username!=null&&(a.username=String(e.username)),e.lidOriginType!=null&&(a.lidOriginType=String(e.lidOriginType)),e.commentsCount!=null&&(a.commentsCount=e.commentsCount>>>0),e.locked!=null&&(a.locked=!!e.locked),e.systemMessageToInsert){default:if(typeof e.systemMessageToInsert=="number"){a.systemMessageToInsert=e.systemMessageToInsert;break}break;case"E2EE_MSG":case 1:a.systemMessageToInsert=1;break;case"NE2EE_SELF":case 2:a.systemMessageToInsert=2;break;case"NE2EE_OTHER":case 3:a.systemMessageToInsert=3;break}switch(e.capiCreatedGroup!=null&&(a.capiCreatedGroup=!!e.capiCreatedGroup),e.accountLid!=null&&(a.accountLid=String(e.accountLid)),e.limitSharing!=null&&(a.limitSharing=!!e.limitSharing),e.limitSharingSettingTimestamp!=null&&(l.Long?(a.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?a.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?a.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(a.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.limitSharingTrigger){default:if(typeof e.limitSharingTrigger=="number"){a.limitSharingTrigger=e.limitSharingTrigger;break}break;case"UNKNOWN":case 0:a.limitSharingTrigger=0;break;case"CHAT_SETTING":case 1:a.limitSharingTrigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:a.limitSharingTrigger=2;break;case"UNKNOWN_GROUP":case 3:a.limitSharingTrigger=3;break}return e.limitSharingInitiatedByMe!=null&&(a.limitSharingInitiatedByMe=!!e.limitSharingInitiatedByMe),e.maibaAiThreadEnabled!=null&&(a.maibaAiThreadEnabled=!!e.maibaAiThreadEnabled),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.messages=[],A.participant=[]),a.defaults&&(A.id=""),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id),e.messages&&e.messages.length){A.messages=[];for(var r=0;r>>3){case 1:{s.chatLockSupportLevel=e.int32();break}case 2:{s.lidMigration=p.proto.DeviceCapabilities.LIDMigration.decode(e,e.uint32());break}case 3:{s.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.decode(e,e.uint32());break}case 4:{s.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.decode(e,e.uint32());break}case 5:{s.memberNameTagPrimarySupport=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DeviceCapabilities)return e;var a=new p.proto.DeviceCapabilities;switch(e.chatLockSupportLevel){default:if(typeof e.chatLockSupportLevel=="number"){a.chatLockSupportLevel=e.chatLockSupportLevel;break}break;case"NONE":case 0:a.chatLockSupportLevel=0;break;case"MINIMAL":case 1:a.chatLockSupportLevel=1;break;case"FULL":case 2:a.chatLockSupportLevel=2;break}if(e.lidMigration!=null){if(typeof e.lidMigration!="object")throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");a.lidMigration=p.proto.DeviceCapabilities.LIDMigration.fromObject(e.lidMigration)}if(e.businessBroadcast!=null){if(typeof e.businessBroadcast!="object")throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");a.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.fromObject(e.businessBroadcast)}if(e.userHasAvatar!=null){if(typeof e.userHasAvatar!="object")throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");a.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.fromObject(e.userHasAvatar)}switch(e.memberNameTagPrimarySupport){default:if(typeof e.memberNameTagPrimarySupport=="number"){a.memberNameTagPrimarySupport=e.memberNameTagPrimarySupport;break}break;case"DISABLED":case 0:a.memberNameTagPrimarySupport=0;break;case"RECEIVER_ENABLED":case 1:a.memberNameTagPrimarySupport=1;break;case"SENDER_ENABLED":case 2:a.memberNameTagPrimarySupport=2;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.chatLockSupportLevel!=null&&e.hasOwnProperty("chatLockSupportLevel")&&(A.chatLockSupportLevel=a.enums===String?p.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]===void 0?e.chatLockSupportLevel:p.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]:e.chatLockSupportLevel,a.oneofs&&(A._chatLockSupportLevel="chatLockSupportLevel")),e.lidMigration!=null&&e.hasOwnProperty("lidMigration")&&(A.lidMigration=p.proto.DeviceCapabilities.LIDMigration.toObject(e.lidMigration,a),a.oneofs&&(A._lidMigration="lidMigration")),e.businessBroadcast!=null&&e.hasOwnProperty("businessBroadcast")&&(A.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.toObject(e.businessBroadcast,a),a.oneofs&&(A._businessBroadcast="businessBroadcast")),e.userHasAvatar!=null&&e.hasOwnProperty("userHasAvatar")&&(A.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.toObject(e.userHasAvatar,a),a.oneofs&&(A._userHasAvatar="userHasAvatar")),e.memberNameTagPrimarySupport!=null&&e.hasOwnProperty("memberNameTagPrimarySupport")&&(A.memberNameTagPrimarySupport=a.enums===String?p.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]===void 0?e.memberNameTagPrimarySupport:p.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]:e.memberNameTagPrimarySupport,a.oneofs&&(A._memberNameTagPrimarySupport="memberNameTagPrimarySupport")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceCapabilities"},t.BusinessBroadcast=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.importListEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.BusinessBroadcast)return A;var r=new p.proto.DeviceCapabilities.BusinessBroadcast;return A.importListEnabled!=null&&(r.importListEnabled=!!A.importListEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.importListEnabled!=null&&A.hasOwnProperty("importListEnabled")&&(s.importListEnabled=A.importListEnabled,r.oneofs&&(s._importListEnabled="importListEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.BusinessBroadcast"},i})(),t.ChatLockSupportLevel=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="MINIMAL"]=1,e[i[2]="FULL"]=2,e})(),t.LIDMigration=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.chatDbMigrationTimestamp=A.uint64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.LIDMigration)return A;var r=new p.proto.DeviceCapabilities.LIDMigration;return A.chatDbMigrationTimestamp!=null&&(l.Long?(r.chatDbMigrationTimestamp=l.Long.fromValue(A.chatDbMigrationTimestamp)).unsigned=!0:typeof A.chatDbMigrationTimestamp=="string"?r.chatDbMigrationTimestamp=parseInt(A.chatDbMigrationTimestamp,10):typeof A.chatDbMigrationTimestamp=="number"?r.chatDbMigrationTimestamp=A.chatDbMigrationTimestamp:typeof A.chatDbMigrationTimestamp=="object"&&(r.chatDbMigrationTimestamp=new l.LongBits(A.chatDbMigrationTimestamp.low>>>0,A.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),r},i.toObject=function(A,r){r||(r={});var s={};return A.chatDbMigrationTimestamp!=null&&A.hasOwnProperty("chatDbMigrationTimestamp")&&(typeof A.chatDbMigrationTimestamp=="number"?s.chatDbMigrationTimestamp=r.longs===String?String(A.chatDbMigrationTimestamp):A.chatDbMigrationTimestamp:s.chatDbMigrationTimestamp=r.longs===String?ge(A.chatDbMigrationTimestamp,!0):r.longs===Number?ce(A.chatDbMigrationTimestamp,!0):A.chatDbMigrationTimestamp,r.oneofs&&(s._chatDbMigrationTimestamp="chatDbMigrationTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.LIDMigration"},i})(),t.MemberNameTagPrimarySupport=(function(){let i={},e=Object.create(i);return e[i[0]="DISABLED"]=0,e[i[1]="RECEIVER_ENABLED"]=1,e[i[2]="SENDER_ENABLED"]=2,e})(),t.UserHasAvatar=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.userHasAvatar=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.UserHasAvatar)return A;var r=new p.proto.DeviceCapabilities.UserHasAvatar;return A.userHasAvatar!=null&&(r.userHasAvatar=!!A.userHasAvatar),r},i.toObject=function(A,r){r||(r={});var s={};return A.userHasAvatar!=null&&A.hasOwnProperty("userHasAvatar")&&(s.userHasAvatar=A.userHasAvatar,r.oneofs&&(s._userHasAvatar="userHasAvatar")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.UserHasAvatar"},i})(),t})(),n.DeviceConsistencyCodeMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.generation=e.uint32();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DeviceConsistencyCodeMessage)return e;var a=new p.proto.DeviceConsistencyCodeMessage;return e.generation!=null&&(a.generation=e.generation>>>0),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.generation!=null&&e.hasOwnProperty("generation")&&(A.generation=e.generation,a.oneofs&&(A._generation="generation")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceConsistencyCodeMessage"},t})(),n.DeviceListMetadata=(function(){function t(i){if(this.senderKeyIndexes=[],this.recipientKeyIndexes=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.senderKeyHash=e.bytes();break}case 2:{s.senderTimestamp=e.uint64();break}case 3:{if(s.senderKeyIndexes&&s.senderKeyIndexes.length||(s.senderKeyIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos=0&&(a.senderKeyHash=e.senderKeyHash)),e.senderTimestamp!=null&&(l.Long?(a.senderTimestamp=l.Long.fromValue(e.senderTimestamp)).unsigned=!0:typeof e.senderTimestamp=="string"?a.senderTimestamp=parseInt(e.senderTimestamp,10):typeof e.senderTimestamp=="number"?a.senderTimestamp=e.senderTimestamp:typeof e.senderTimestamp=="object"&&(a.senderTimestamp=new l.LongBits(e.senderTimestamp.low>>>0,e.senderTimestamp.high>>>0).toNumber(!0))),e.senderKeyIndexes){if(!Array.isArray(e.senderKeyIndexes))throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected");a.senderKeyIndexes=[];for(var A=0;A>>0}switch(e.senderAccountType){default:if(typeof e.senderAccountType=="number"){a.senderAccountType=e.senderAccountType;break}break;case"E2EE":case 0:a.senderAccountType=0;break;case"HOSTED":case 1:a.senderAccountType=1;break}switch(e.receiverAccountType){default:if(typeof e.receiverAccountType=="number"){a.receiverAccountType=e.receiverAccountType;break}break;case"E2EE":case 0:a.receiverAccountType=0;break;case"HOSTED":case 1:a.receiverAccountType=1;break}if(e.recipientKeyHash!=null&&(typeof e.recipientKeyHash=="string"?l.base64.decode(e.recipientKeyHash,a.recipientKeyHash=l.newBuffer(l.base64.length(e.recipientKeyHash)),0):e.recipientKeyHash.length>=0&&(a.recipientKeyHash=e.recipientKeyHash)),e.recipientTimestamp!=null&&(l.Long?(a.recipientTimestamp=l.Long.fromValue(e.recipientTimestamp)).unsigned=!0:typeof e.recipientTimestamp=="string"?a.recipientTimestamp=parseInt(e.recipientTimestamp,10):typeof e.recipientTimestamp=="number"?a.recipientTimestamp=e.recipientTimestamp:typeof e.recipientTimestamp=="object"&&(a.recipientTimestamp=new l.LongBits(e.recipientTimestamp.low>>>0,e.recipientTimestamp.high>>>0).toNumber(!0))),e.recipientKeyIndexes){if(!Array.isArray(e.recipientKeyIndexes))throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected");a.recipientKeyIndexes=[];for(var A=0;A>>0}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.senderKeyIndexes=[],A.recipientKeyIndexes=[]),e.senderKeyHash!=null&&e.hasOwnProperty("senderKeyHash")&&(A.senderKeyHash=a.bytes===String?l.base64.encode(e.senderKeyHash,0,e.senderKeyHash.length):a.bytes===Array?Array.prototype.slice.call(e.senderKeyHash):e.senderKeyHash,a.oneofs&&(A._senderKeyHash="senderKeyHash")),e.senderTimestamp!=null&&e.hasOwnProperty("senderTimestamp")&&(typeof e.senderTimestamp=="number"?A.senderTimestamp=a.longs===String?String(e.senderTimestamp):e.senderTimestamp:A.senderTimestamp=a.longs===String?ge(e.senderTimestamp,!0):a.longs===Number?ce(e.senderTimestamp,!0):e.senderTimestamp,a.oneofs&&(A._senderTimestamp="senderTimestamp")),e.senderKeyIndexes&&e.senderKeyIndexes.length){A.senderKeyIndexes=[];for(var r=0;r>>3){case 1:{s.os=e.string();break}case 2:{s.version=p.proto.DeviceProps.AppVersion.decode(e,e.uint32());break}case 3:{s.platformType=e.int32();break}case 4:{s.requireFullSync=e.bool();break}case 5:{s.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DeviceProps)return e;var a=new p.proto.DeviceProps;if(e.os!=null&&(a.os=String(e.os)),e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.DeviceProps.version: object expected");a.version=p.proto.DeviceProps.AppVersion.fromObject(e.version)}switch(e.platformType){default:if(typeof e.platformType=="number"){a.platformType=e.platformType;break}break;case"UNKNOWN":case 0:a.platformType=0;break;case"CHROME":case 1:a.platformType=1;break;case"FIREFOX":case 2:a.platformType=2;break;case"IE":case 3:a.platformType=3;break;case"OPERA":case 4:a.platformType=4;break;case"SAFARI":case 5:a.platformType=5;break;case"EDGE":case 6:a.platformType=6;break;case"DESKTOP":case 7:a.platformType=7;break;case"IPAD":case 8:a.platformType=8;break;case"ANDROID_TABLET":case 9:a.platformType=9;break;case"OHANA":case 10:a.platformType=10;break;case"ALOHA":case 11:a.platformType=11;break;case"CATALINA":case 12:a.platformType=12;break;case"TCL_TV":case 13:a.platformType=13;break;case"IOS_PHONE":case 14:a.platformType=14;break;case"IOS_CATALYST":case 15:a.platformType=15;break;case"ANDROID_PHONE":case 16:a.platformType=16;break;case"ANDROID_AMBIGUOUS":case 17:a.platformType=17;break;case"WEAR_OS":case 18:a.platformType=18;break;case"AR_WRIST":case 19:a.platformType=19;break;case"AR_DEVICE":case 20:a.platformType=20;break;case"UWP":case 21:a.platformType=21;break;case"VR":case 22:a.platformType=22;break;case"CLOUD_API":case 23:a.platformType=23;break;case"SMARTGLASSES":case 24:a.platformType=24;break}if(e.requireFullSync!=null&&(a.requireFullSync=!!e.requireFullSync),e.historySyncConfig!=null){if(typeof e.historySyncConfig!="object")throw TypeError(".proto.DeviceProps.historySyncConfig: object expected");a.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.fromObject(e.historySyncConfig)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.os!=null&&e.hasOwnProperty("os")&&(A.os=e.os,a.oneofs&&(A._os="os")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.DeviceProps.AppVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.platformType!=null&&e.hasOwnProperty("platformType")&&(A.platformType=a.enums===String?p.proto.DeviceProps.PlatformType[e.platformType]===void 0?e.platformType:p.proto.DeviceProps.PlatformType[e.platformType]:e.platformType,a.oneofs&&(A._platformType="platformType")),e.requireFullSync!=null&&e.hasOwnProperty("requireFullSync")&&(A.requireFullSync=e.requireFullSync,a.oneofs&&(A._requireFullSync="requireFullSync")),e.historySyncConfig!=null&&e.hasOwnProperty("historySyncConfig")&&(A.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.toObject(e.historySyncConfig,a),a.oneofs&&(A._historySyncConfig="historySyncConfig")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceProps"},t.AppVersion=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.primary=A.uint32();break}case 2:{c.secondary=A.uint32();break}case 3:{c.tertiary=A.uint32();break}case 4:{c.quaternary=A.uint32();break}case 5:{c.quinary=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceProps.AppVersion)return A;var r=new p.proto.DeviceProps.AppVersion;return A.primary!=null&&(r.primary=A.primary>>>0),A.secondary!=null&&(r.secondary=A.secondary>>>0),A.tertiary!=null&&(r.tertiary=A.tertiary>>>0),A.quaternary!=null&&(r.quaternary=A.quaternary>>>0),A.quinary!=null&&(r.quinary=A.quinary>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.primary!=null&&A.hasOwnProperty("primary")&&(s.primary=A.primary,r.oneofs&&(s._primary="primary")),A.secondary!=null&&A.hasOwnProperty("secondary")&&(s.secondary=A.secondary,r.oneofs&&(s._secondary="secondary")),A.tertiary!=null&&A.hasOwnProperty("tertiary")&&(s.tertiary=A.tertiary,r.oneofs&&(s._tertiary="tertiary")),A.quaternary!=null&&A.hasOwnProperty("quaternary")&&(s.quaternary=A.quaternary,r.oneofs&&(s._quaternary="quaternary")),A.quinary!=null&&A.hasOwnProperty("quinary")&&(s.quinary=A.quinary,r.oneofs&&(s._quinary="quinary")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.AppVersion"},i})(),t.HistorySyncConfig=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.fullSyncDaysLimit=A.uint32();break}case 2:{c.fullSyncSizeMbLimit=A.uint32();break}case 3:{c.storageQuotaMb=A.uint32();break}case 4:{c.inlineInitialPayloadInE2EeMsg=A.bool();break}case 5:{c.recentSyncDaysLimit=A.uint32();break}case 6:{c.supportCallLogHistory=A.bool();break}case 7:{c.supportBotUserAgentChatHistory=A.bool();break}case 8:{c.supportCagReactionsAndPolls=A.bool();break}case 9:{c.supportBizHostedMsg=A.bool();break}case 10:{c.supportRecentSyncChunkMessageCountTuning=A.bool();break}case 11:{c.supportHostedGroupMsg=A.bool();break}case 12:{c.supportFbidBotChatHistory=A.bool();break}case 13:{c.supportAddOnHistorySyncMigration=A.bool();break}case 14:{c.supportMessageAssociation=A.bool();break}case 15:{c.supportGroupHistory=A.bool();break}case 16:{c.onDemandReady=A.bool();break}case 17:{c.supportGuestChat=A.bool();break}case 18:{c.completeOnDemandReady=A.bool();break}case 19:{c.thumbnailSyncDaysLimit=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceProps.HistorySyncConfig)return A;var r=new p.proto.DeviceProps.HistorySyncConfig;return A.fullSyncDaysLimit!=null&&(r.fullSyncDaysLimit=A.fullSyncDaysLimit>>>0),A.fullSyncSizeMbLimit!=null&&(r.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit>>>0),A.storageQuotaMb!=null&&(r.storageQuotaMb=A.storageQuotaMb>>>0),A.inlineInitialPayloadInE2EeMsg!=null&&(r.inlineInitialPayloadInE2EeMsg=!!A.inlineInitialPayloadInE2EeMsg),A.recentSyncDaysLimit!=null&&(r.recentSyncDaysLimit=A.recentSyncDaysLimit>>>0),A.supportCallLogHistory!=null&&(r.supportCallLogHistory=!!A.supportCallLogHistory),A.supportBotUserAgentChatHistory!=null&&(r.supportBotUserAgentChatHistory=!!A.supportBotUserAgentChatHistory),A.supportCagReactionsAndPolls!=null&&(r.supportCagReactionsAndPolls=!!A.supportCagReactionsAndPolls),A.supportBizHostedMsg!=null&&(r.supportBizHostedMsg=!!A.supportBizHostedMsg),A.supportRecentSyncChunkMessageCountTuning!=null&&(r.supportRecentSyncChunkMessageCountTuning=!!A.supportRecentSyncChunkMessageCountTuning),A.supportHostedGroupMsg!=null&&(r.supportHostedGroupMsg=!!A.supportHostedGroupMsg),A.supportFbidBotChatHistory!=null&&(r.supportFbidBotChatHistory=!!A.supportFbidBotChatHistory),A.supportAddOnHistorySyncMigration!=null&&(r.supportAddOnHistorySyncMigration=!!A.supportAddOnHistorySyncMigration),A.supportMessageAssociation!=null&&(r.supportMessageAssociation=!!A.supportMessageAssociation),A.supportGroupHistory!=null&&(r.supportGroupHistory=!!A.supportGroupHistory),A.onDemandReady!=null&&(r.onDemandReady=!!A.onDemandReady),A.supportGuestChat!=null&&(r.supportGuestChat=!!A.supportGuestChat),A.completeOnDemandReady!=null&&(r.completeOnDemandReady=!!A.completeOnDemandReady),A.thumbnailSyncDaysLimit!=null&&(r.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.fullSyncDaysLimit!=null&&A.hasOwnProperty("fullSyncDaysLimit")&&(s.fullSyncDaysLimit=A.fullSyncDaysLimit,r.oneofs&&(s._fullSyncDaysLimit="fullSyncDaysLimit")),A.fullSyncSizeMbLimit!=null&&A.hasOwnProperty("fullSyncSizeMbLimit")&&(s.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit,r.oneofs&&(s._fullSyncSizeMbLimit="fullSyncSizeMbLimit")),A.storageQuotaMb!=null&&A.hasOwnProperty("storageQuotaMb")&&(s.storageQuotaMb=A.storageQuotaMb,r.oneofs&&(s._storageQuotaMb="storageQuotaMb")),A.inlineInitialPayloadInE2EeMsg!=null&&A.hasOwnProperty("inlineInitialPayloadInE2EeMsg")&&(s.inlineInitialPayloadInE2EeMsg=A.inlineInitialPayloadInE2EeMsg,r.oneofs&&(s._inlineInitialPayloadInE2EeMsg="inlineInitialPayloadInE2EeMsg")),A.recentSyncDaysLimit!=null&&A.hasOwnProperty("recentSyncDaysLimit")&&(s.recentSyncDaysLimit=A.recentSyncDaysLimit,r.oneofs&&(s._recentSyncDaysLimit="recentSyncDaysLimit")),A.supportCallLogHistory!=null&&A.hasOwnProperty("supportCallLogHistory")&&(s.supportCallLogHistory=A.supportCallLogHistory,r.oneofs&&(s._supportCallLogHistory="supportCallLogHistory")),A.supportBotUserAgentChatHistory!=null&&A.hasOwnProperty("supportBotUserAgentChatHistory")&&(s.supportBotUserAgentChatHistory=A.supportBotUserAgentChatHistory,r.oneofs&&(s._supportBotUserAgentChatHistory="supportBotUserAgentChatHistory")),A.supportCagReactionsAndPolls!=null&&A.hasOwnProperty("supportCagReactionsAndPolls")&&(s.supportCagReactionsAndPolls=A.supportCagReactionsAndPolls,r.oneofs&&(s._supportCagReactionsAndPolls="supportCagReactionsAndPolls")),A.supportBizHostedMsg!=null&&A.hasOwnProperty("supportBizHostedMsg")&&(s.supportBizHostedMsg=A.supportBizHostedMsg,r.oneofs&&(s._supportBizHostedMsg="supportBizHostedMsg")),A.supportRecentSyncChunkMessageCountTuning!=null&&A.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")&&(s.supportRecentSyncChunkMessageCountTuning=A.supportRecentSyncChunkMessageCountTuning,r.oneofs&&(s._supportRecentSyncChunkMessageCountTuning="supportRecentSyncChunkMessageCountTuning")),A.supportHostedGroupMsg!=null&&A.hasOwnProperty("supportHostedGroupMsg")&&(s.supportHostedGroupMsg=A.supportHostedGroupMsg,r.oneofs&&(s._supportHostedGroupMsg="supportHostedGroupMsg")),A.supportFbidBotChatHistory!=null&&A.hasOwnProperty("supportFbidBotChatHistory")&&(s.supportFbidBotChatHistory=A.supportFbidBotChatHistory,r.oneofs&&(s._supportFbidBotChatHistory="supportFbidBotChatHistory")),A.supportAddOnHistorySyncMigration!=null&&A.hasOwnProperty("supportAddOnHistorySyncMigration")&&(s.supportAddOnHistorySyncMigration=A.supportAddOnHistorySyncMigration,r.oneofs&&(s._supportAddOnHistorySyncMigration="supportAddOnHistorySyncMigration")),A.supportMessageAssociation!=null&&A.hasOwnProperty("supportMessageAssociation")&&(s.supportMessageAssociation=A.supportMessageAssociation,r.oneofs&&(s._supportMessageAssociation="supportMessageAssociation")),A.supportGroupHistory!=null&&A.hasOwnProperty("supportGroupHistory")&&(s.supportGroupHistory=A.supportGroupHistory,r.oneofs&&(s._supportGroupHistory="supportGroupHistory")),A.onDemandReady!=null&&A.hasOwnProperty("onDemandReady")&&(s.onDemandReady=A.onDemandReady,r.oneofs&&(s._onDemandReady="onDemandReady")),A.supportGuestChat!=null&&A.hasOwnProperty("supportGuestChat")&&(s.supportGuestChat=A.supportGuestChat,r.oneofs&&(s._supportGuestChat="supportGuestChat")),A.completeOnDemandReady!=null&&A.hasOwnProperty("completeOnDemandReady")&&(s.completeOnDemandReady=A.completeOnDemandReady,r.oneofs&&(s._completeOnDemandReady="completeOnDemandReady")),A.thumbnailSyncDaysLimit!=null&&A.hasOwnProperty("thumbnailSyncDaysLimit")&&(s.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit,r.oneofs&&(s._thumbnailSyncDaysLimit="thumbnailSyncDaysLimit")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.HistorySyncConfig"},i})(),t.PlatformType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHROME"]=1,e[i[2]="FIREFOX"]=2,e[i[3]="IE"]=3,e[i[4]="OPERA"]=4,e[i[5]="SAFARI"]=5,e[i[6]="EDGE"]=6,e[i[7]="DESKTOP"]=7,e[i[8]="IPAD"]=8,e[i[9]="ANDROID_TABLET"]=9,e[i[10]="OHANA"]=10,e[i[11]="ALOHA"]=11,e[i[12]="CATALINA"]=12,e[i[13]="TCL_TV"]=13,e[i[14]="IOS_PHONE"]=14,e[i[15]="IOS_CATALYST"]=15,e[i[16]="ANDROID_PHONE"]=16,e[i[17]="ANDROID_AMBIGUOUS"]=17,e[i[18]="WEAR_OS"]=18,e[i[19]="AR_WRIST"]=19,e[i[20]="AR_DEVICE"]=20,e[i[21]="UWP"]=21,e[i[22]="VR"]=22,e[i[23]="CLOUD_API"]=23,e[i[24]="SMARTGLASSES"]=24,e})(),t})(),n.DisappearingMode=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.initiator=e.int32();break}case 2:{s.trigger=e.int32();break}case 3:{s.initiatorDeviceJid=e.string();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DisappearingMode)return e;var a=new p.proto.DisappearingMode;switch(e.initiator){default:if(typeof e.initiator=="number"){a.initiator=e.initiator;break}break;case"CHANGED_IN_CHAT":case 0:a.initiator=0;break;case"INITIATED_BY_ME":case 1:a.initiator=1;break;case"INITIATED_BY_OTHER":case 2:a.initiator=2;break;case"BIZ_UPGRADE_FB_HOSTING":case 3:a.initiator=3;break}switch(e.trigger){default:if(typeof e.trigger=="number"){a.trigger=e.trigger;break}break;case"UNKNOWN":case 0:a.trigger=0;break;case"CHAT_SETTING":case 1:a.trigger=1;break;case"ACCOUNT_SETTING":case 2:a.trigger=2;break;case"BULK_CHANGE":case 3:a.trigger=3;break;case"BIZ_SUPPORTS_FB_HOSTING":case 4:a.trigger=4;break;case"UNKNOWN_GROUPS":case 5:a.trigger=5;break}return e.initiatorDeviceJid!=null&&(a.initiatorDeviceJid=String(e.initiatorDeviceJid)),e.initiatedByMe!=null&&(a.initiatedByMe=!!e.initiatedByMe),a},t.toObject=function(e,a){a||(a={});var A={};return e.initiator!=null&&e.hasOwnProperty("initiator")&&(A.initiator=a.enums===String?p.proto.DisappearingMode.Initiator[e.initiator]===void 0?e.initiator:p.proto.DisappearingMode.Initiator[e.initiator]:e.initiator,a.oneofs&&(A._initiator="initiator")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=a.enums===String?p.proto.DisappearingMode.Trigger[e.trigger]===void 0?e.trigger:p.proto.DisappearingMode.Trigger[e.trigger]:e.trigger,a.oneofs&&(A._trigger="trigger")),e.initiatorDeviceJid!=null&&e.hasOwnProperty("initiatorDeviceJid")&&(A.initiatorDeviceJid=e.initiatorDeviceJid,a.oneofs&&(A._initiatorDeviceJid="initiatorDeviceJid")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,a.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DisappearingMode"},t.Initiator=(function(){let i={},e=Object.create(i);return e[i[0]="CHANGED_IN_CHAT"]=0,e[i[1]="INITIATED_BY_ME"]=1,e[i[2]="INITIATED_BY_OTHER"]=2,e[i[3]="BIZ_UPGRADE_FB_HOSTING"]=3,e})(),t.Trigger=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT_SETTING"]=1,e[i[2]="ACCOUNT_SETTING"]=2,e[i[3]="BULK_CHANGE"]=3,e[i[4]="BIZ_SUPPORTS_FB_HOSTING"]=4,e[i[5]="UNKNOWN_GROUPS"]=5,e})(),t})(),n.EmbeddedContent=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.embeddedMessage=p.proto.EmbeddedMessage.decode(e,e.uint32());break}case 2:{s.embeddedMusic=p.proto.EmbeddedMusic.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EmbeddedContent)return e;var a=new p.proto.EmbeddedContent;if(e.embeddedMessage!=null){if(typeof e.embeddedMessage!="object")throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected");a.embeddedMessage=p.proto.EmbeddedMessage.fromObject(e.embeddedMessage)}if(e.embeddedMusic!=null){if(typeof e.embeddedMusic!="object")throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected");a.embeddedMusic=p.proto.EmbeddedMusic.fromObject(e.embeddedMusic)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.embeddedMessage!=null&&e.hasOwnProperty("embeddedMessage")&&(A.embeddedMessage=p.proto.EmbeddedMessage.toObject(e.embeddedMessage,a),a.oneofs&&(A.content="embeddedMessage")),e.embeddedMusic!=null&&e.hasOwnProperty("embeddedMusic")&&(A.embeddedMusic=p.proto.EmbeddedMusic.toObject(e.embeddedMusic,a),a.oneofs&&(A.content="embeddedMusic")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedContent"},t})(),n.EmbeddedMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EmbeddedMessage)return e;var a=new p.proto.EmbeddedMessage;if(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.EmbeddedMessage.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMessage"},t})(),n.EmbeddedMusic=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.musicContentMediaId=e.string();break}case 2:{s.songId=e.string();break}case 3:{s.author=e.string();break}case 4:{s.title=e.string();break}case 5:{s.artworkDirectPath=e.string();break}case 6:{s.artworkSha256=e.bytes();break}case 7:{s.artworkEncSha256=e.bytes();break}case 8:{s.artistAttribution=e.string();break}case 9:{s.countryBlocklist=e.bytes();break}case 10:{s.isExplicit=e.bool();break}case 11:{s.artworkMediaKey=e.bytes();break}case 12:{s.musicSongStartTimeInMs=e.int64();break}case 13:{s.derivedContentStartTimeInMs=e.int64();break}case 14:{s.overlapDurationInMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EmbeddedMusic)return e;var a=new p.proto.EmbeddedMusic;return e.musicContentMediaId!=null&&(a.musicContentMediaId=String(e.musicContentMediaId)),e.songId!=null&&(a.songId=String(e.songId)),e.author!=null&&(a.author=String(e.author)),e.title!=null&&(a.title=String(e.title)),e.artworkDirectPath!=null&&(a.artworkDirectPath=String(e.artworkDirectPath)),e.artworkSha256!=null&&(typeof e.artworkSha256=="string"?l.base64.decode(e.artworkSha256,a.artworkSha256=l.newBuffer(l.base64.length(e.artworkSha256)),0):e.artworkSha256.length>=0&&(a.artworkSha256=e.artworkSha256)),e.artworkEncSha256!=null&&(typeof e.artworkEncSha256=="string"?l.base64.decode(e.artworkEncSha256,a.artworkEncSha256=l.newBuffer(l.base64.length(e.artworkEncSha256)),0):e.artworkEncSha256.length>=0&&(a.artworkEncSha256=e.artworkEncSha256)),e.artistAttribution!=null&&(a.artistAttribution=String(e.artistAttribution)),e.countryBlocklist!=null&&(typeof e.countryBlocklist=="string"?l.base64.decode(e.countryBlocklist,a.countryBlocklist=l.newBuffer(l.base64.length(e.countryBlocklist)),0):e.countryBlocklist.length>=0&&(a.countryBlocklist=e.countryBlocklist)),e.isExplicit!=null&&(a.isExplicit=!!e.isExplicit),e.artworkMediaKey!=null&&(typeof e.artworkMediaKey=="string"?l.base64.decode(e.artworkMediaKey,a.artworkMediaKey=l.newBuffer(l.base64.length(e.artworkMediaKey)),0):e.artworkMediaKey.length>=0&&(a.artworkMediaKey=e.artworkMediaKey)),e.musicSongStartTimeInMs!=null&&(l.Long?(a.musicSongStartTimeInMs=l.Long.fromValue(e.musicSongStartTimeInMs)).unsigned=!1:typeof e.musicSongStartTimeInMs=="string"?a.musicSongStartTimeInMs=parseInt(e.musicSongStartTimeInMs,10):typeof e.musicSongStartTimeInMs=="number"?a.musicSongStartTimeInMs=e.musicSongStartTimeInMs:typeof e.musicSongStartTimeInMs=="object"&&(a.musicSongStartTimeInMs=new l.LongBits(e.musicSongStartTimeInMs.low>>>0,e.musicSongStartTimeInMs.high>>>0).toNumber())),e.derivedContentStartTimeInMs!=null&&(l.Long?(a.derivedContentStartTimeInMs=l.Long.fromValue(e.derivedContentStartTimeInMs)).unsigned=!1:typeof e.derivedContentStartTimeInMs=="string"?a.derivedContentStartTimeInMs=parseInt(e.derivedContentStartTimeInMs,10):typeof e.derivedContentStartTimeInMs=="number"?a.derivedContentStartTimeInMs=e.derivedContentStartTimeInMs:typeof e.derivedContentStartTimeInMs=="object"&&(a.derivedContentStartTimeInMs=new l.LongBits(e.derivedContentStartTimeInMs.low>>>0,e.derivedContentStartTimeInMs.high>>>0).toNumber())),e.overlapDurationInMs!=null&&(l.Long?(a.overlapDurationInMs=l.Long.fromValue(e.overlapDurationInMs)).unsigned=!1:typeof e.overlapDurationInMs=="string"?a.overlapDurationInMs=parseInt(e.overlapDurationInMs,10):typeof e.overlapDurationInMs=="number"?a.overlapDurationInMs=e.overlapDurationInMs:typeof e.overlapDurationInMs=="object"&&(a.overlapDurationInMs=new l.LongBits(e.overlapDurationInMs.low>>>0,e.overlapDurationInMs.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.musicContentMediaId!=null&&e.hasOwnProperty("musicContentMediaId")&&(A.musicContentMediaId=e.musicContentMediaId,a.oneofs&&(A._musicContentMediaId="musicContentMediaId")),e.songId!=null&&e.hasOwnProperty("songId")&&(A.songId=e.songId,a.oneofs&&(A._songId="songId")),e.author!=null&&e.hasOwnProperty("author")&&(A.author=e.author,a.oneofs&&(A._author="author")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.artworkDirectPath!=null&&e.hasOwnProperty("artworkDirectPath")&&(A.artworkDirectPath=e.artworkDirectPath,a.oneofs&&(A._artworkDirectPath="artworkDirectPath")),e.artworkSha256!=null&&e.hasOwnProperty("artworkSha256")&&(A.artworkSha256=a.bytes===String?l.base64.encode(e.artworkSha256,0,e.artworkSha256.length):a.bytes===Array?Array.prototype.slice.call(e.artworkSha256):e.artworkSha256,a.oneofs&&(A._artworkSha256="artworkSha256")),e.artworkEncSha256!=null&&e.hasOwnProperty("artworkEncSha256")&&(A.artworkEncSha256=a.bytes===String?l.base64.encode(e.artworkEncSha256,0,e.artworkEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.artworkEncSha256):e.artworkEncSha256,a.oneofs&&(A._artworkEncSha256="artworkEncSha256")),e.artistAttribution!=null&&e.hasOwnProperty("artistAttribution")&&(A.artistAttribution=e.artistAttribution,a.oneofs&&(A._artistAttribution="artistAttribution")),e.countryBlocklist!=null&&e.hasOwnProperty("countryBlocklist")&&(A.countryBlocklist=a.bytes===String?l.base64.encode(e.countryBlocklist,0,e.countryBlocklist.length):a.bytes===Array?Array.prototype.slice.call(e.countryBlocklist):e.countryBlocklist,a.oneofs&&(A._countryBlocklist="countryBlocklist")),e.isExplicit!=null&&e.hasOwnProperty("isExplicit")&&(A.isExplicit=e.isExplicit,a.oneofs&&(A._isExplicit="isExplicit")),e.artworkMediaKey!=null&&e.hasOwnProperty("artworkMediaKey")&&(A.artworkMediaKey=a.bytes===String?l.base64.encode(e.artworkMediaKey,0,e.artworkMediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.artworkMediaKey):e.artworkMediaKey,a.oneofs&&(A._artworkMediaKey="artworkMediaKey")),e.musicSongStartTimeInMs!=null&&e.hasOwnProperty("musicSongStartTimeInMs")&&(typeof e.musicSongStartTimeInMs=="number"?A.musicSongStartTimeInMs=a.longs===String?String(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs:A.musicSongStartTimeInMs=a.longs===String?ge(e.musicSongStartTimeInMs):a.longs===Number?ce(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs,a.oneofs&&(A._musicSongStartTimeInMs="musicSongStartTimeInMs")),e.derivedContentStartTimeInMs!=null&&e.hasOwnProperty("derivedContentStartTimeInMs")&&(typeof e.derivedContentStartTimeInMs=="number"?A.derivedContentStartTimeInMs=a.longs===String?String(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs:A.derivedContentStartTimeInMs=a.longs===String?ge(e.derivedContentStartTimeInMs):a.longs===Number?ce(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs,a.oneofs&&(A._derivedContentStartTimeInMs="derivedContentStartTimeInMs")),e.overlapDurationInMs!=null&&e.hasOwnProperty("overlapDurationInMs")&&(typeof e.overlapDurationInMs=="number"?A.overlapDurationInMs=a.longs===String?String(e.overlapDurationInMs):e.overlapDurationInMs:A.overlapDurationInMs=a.longs===String?ge(e.overlapDurationInMs):a.longs===Number?ce(e.overlapDurationInMs):e.overlapDurationInMs,a.oneofs&&(A._overlapDurationInMs="overlapDurationInMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMusic"},t})(),n.EncryptedPairingRequest=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encryptedPayload=e.bytes();break}case 2:{s.iv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EncryptedPairingRequest)return e;var a=new p.proto.EncryptedPairingRequest;return e.encryptedPayload!=null&&(typeof e.encryptedPayload=="string"?l.base64.decode(e.encryptedPayload,a.encryptedPayload=l.newBuffer(l.base64.length(e.encryptedPayload)),0):e.encryptedPayload.length>=0&&(a.encryptedPayload=e.encryptedPayload)),e.iv!=null&&(typeof e.iv=="string"?l.base64.decode(e.iv,a.iv=l.newBuffer(l.base64.length(e.iv)),0):e.iv.length>=0&&(a.iv=e.iv)),a},t.toObject=function(e,a){a||(a={});var A={};return e.encryptedPayload!=null&&e.hasOwnProperty("encryptedPayload")&&(A.encryptedPayload=a.bytes===String?l.base64.encode(e.encryptedPayload,0,e.encryptedPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encryptedPayload):e.encryptedPayload,a.oneofs&&(A._encryptedPayload="encryptedPayload")),e.iv!=null&&e.hasOwnProperty("iv")&&(A.iv=a.bytes===String?l.base64.encode(e.iv,0,e.iv.length):a.bytes===Array?Array.prototype.slice.call(e.iv):e.iv,a.oneofs&&(A._iv="iv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EncryptedPairingRequest"},t})(),n.EphemeralSetting=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.duration=e.sfixed32();break}case 2:{s.timestamp=e.sfixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EphemeralSetting)return e;var a=new p.proto.EphemeralSetting;return e.duration!=null&&(a.duration=e.duration|0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.duration!=null&&e.hasOwnProperty("duration")&&(A.duration=e.duration,a.oneofs&&(A._duration="duration")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EphemeralSetting"},t})(),n.EventAdditionalMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.isStale=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EventAdditionalMetadata)return e;var a=new p.proto.EventAdditionalMetadata;return e.isStale!=null&&(a.isStale=!!e.isStale),a},t.toObject=function(e,a){a||(a={});var A={};return e.isStale!=null&&e.hasOwnProperty("isStale")&&(A.isStale=e.isStale,a.oneofs&&(A._isStale="isStale")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventAdditionalMetadata"},t})(),n.EventResponse=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.eventResponseMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.timestampMs=e.int64();break}case 3:{s.eventResponseMessage=p.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 4:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EventResponse)return e;var a=new p.proto.EventResponse;if(e.eventResponseMessageKey!=null){if(typeof e.eventResponseMessageKey!="object")throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");a.eventResponseMessageKey=p.proto.MessageKey.fromObject(e.eventResponseMessageKey)}if(e.timestampMs!=null&&(l.Long?(a.timestampMs=l.Long.fromValue(e.timestampMs)).unsigned=!1:typeof e.timestampMs=="string"?a.timestampMs=parseInt(e.timestampMs,10):typeof e.timestampMs=="number"?a.timestampMs=e.timestampMs:typeof e.timestampMs=="object"&&(a.timestampMs=new l.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber())),e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");a.eventResponseMessage=p.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}return e.unread!=null&&(a.unread=!!e.unread),a},t.toObject=function(e,a){a||(a={});var A={};return e.eventResponseMessageKey!=null&&e.hasOwnProperty("eventResponseMessageKey")&&(A.eventResponseMessageKey=p.proto.MessageKey.toObject(e.eventResponseMessageKey,a),a.oneofs&&(A._eventResponseMessageKey="eventResponseMessageKey")),e.timestampMs!=null&&e.hasOwnProperty("timestampMs")&&(typeof e.timestampMs=="number"?A.timestampMs=a.longs===String?String(e.timestampMs):e.timestampMs:A.timestampMs=a.longs===String?ge(e.timestampMs):a.longs===Number?ce(e.timestampMs):e.timestampMs,a.oneofs&&(A._timestampMs="timestampMs")),e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=p.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,a),a.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventResponse"},t})(),n.ExitCode=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.code=e.uint64();break}case 2:{s.text=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ExitCode)return e;var a=new p.proto.ExitCode;return e.code!=null&&(l.Long?(a.code=l.Long.fromValue(e.code)).unsigned=!0:typeof e.code=="string"?a.code=parseInt(e.code,10):typeof e.code=="number"?a.code=e.code:typeof e.code=="object"&&(a.code=new l.LongBits(e.code.low>>>0,e.code.high>>>0).toNumber(!0))),e.text!=null&&(a.text=String(e.text)),a},t.toObject=function(e,a){a||(a={});var A={};return e.code!=null&&e.hasOwnProperty("code")&&(typeof e.code=="number"?A.code=a.longs===String?String(e.code):e.code:A.code=a.longs===String?ge(e.code,!0):a.longs===Number?ce(e.code,!0):e.code,a.oneofs&&(A._code="code")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExitCode"},t})(),n.ExternalBlobReference=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.mediaKey=e.bytes();break}case 2:{s.directPath=e.string();break}case 3:{s.handle=e.string();break}case 4:{s.fileSizeBytes=e.uint64();break}case 5:{s.fileSha256=e.bytes();break}case 6:{s.fileEncSha256=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ExternalBlobReference)return e;var a=new p.proto.ExternalBlobReference;return e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,a.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(a.mediaKey=e.mediaKey)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.handle!=null&&(a.handle=String(e.handle)),e.fileSizeBytes!=null&&(l.Long?(a.fileSizeBytes=l.Long.fromValue(e.fileSizeBytes)).unsigned=!0:typeof e.fileSizeBytes=="string"?a.fileSizeBytes=parseInt(e.fileSizeBytes,10):typeof e.fileSizeBytes=="number"?a.fileSizeBytes=e.fileSizeBytes:typeof e.fileSizeBytes=="object"&&(a.fileSizeBytes=new l.LongBits(e.fileSizeBytes.low>>>0,e.fileSizeBytes.high>>>0).toNumber(!0))),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),a},t.toObject=function(e,a){a||(a={});var A={};return e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=a.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.handle!=null&&e.hasOwnProperty("handle")&&(A.handle=e.handle,a.oneofs&&(A._handle="handle")),e.fileSizeBytes!=null&&e.hasOwnProperty("fileSizeBytes")&&(typeof e.fileSizeBytes=="number"?A.fileSizeBytes=a.longs===String?String(e.fileSizeBytes):e.fileSizeBytes:A.fileSizeBytes=a.longs===String?ge(e.fileSizeBytes,!0):a.longs===Number?ce(e.fileSizeBytes,!0):e.fileSizeBytes,a.oneofs&&(A._fileSizeBytes="fileSizeBytes")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=a.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExternalBlobReference"},t})(),n.Field=(function(){function t(i){if(this.subfield={},i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.isMessage=e.bool();break}case 5:{s.subfield===l.emptyObject&&(s.subfield={});var d=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=p.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.subfield[g]=c;break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Field)return e;var a=new p.proto.Field;if(e.minVersion!=null&&(a.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(a.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(a.notReportableMinVersion=e.notReportableMinVersion>>>0),e.isMessage!=null&&(a.isMessage=!!e.isMessage),e.subfield){if(typeof e.subfield!="object")throw TypeError(".proto.Field.subfield: object expected");a.subfield={};for(var A=Object.keys(e.subfield),r=0;r>>3){case 1:{s.botName=e.string();break}case 2:{s.botJid=e.string();break}case 3:{s.creatorName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ForwardedAIBotMessageInfo)return e;var a=new p.proto.ForwardedAIBotMessageInfo;return e.botName!=null&&(a.botName=String(e.botName)),e.botJid!=null&&(a.botJid=String(e.botJid)),e.creatorName!=null&&(a.creatorName=String(e.creatorName)),a},t.toObject=function(e,a){a||(a={});var A={};return e.botName!=null&&e.hasOwnProperty("botName")&&(A.botName=e.botName,a.oneofs&&(A._botName="botName")),e.botJid!=null&&e.hasOwnProperty("botJid")&&(A.botJid=e.botJid,a.oneofs&&(A._botJid="botJid")),e.creatorName!=null&&e.hasOwnProperty("creatorName")&&(A.creatorName=e.creatorName,a.oneofs&&(A._creatorName="creatorName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ForwardedAIBotMessageInfo"},t})(),n.GlobalSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lightThemeWallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 2:{s.mediaVisibility=e.int32();break}case 3:{s.darkThemeWallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 4:{s.autoDownloadWiFi=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 5:{s.autoDownloadCellular=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 6:{s.autoDownloadRoaming=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 7:{s.showIndividualNotificationsPreview=e.bool();break}case 8:{s.showGroupNotificationsPreview=e.bool();break}case 9:{s.disappearingModeDuration=e.int32();break}case 10:{s.disappearingModeTimestamp=e.int64();break}case 11:{s.avatarUserSettings=p.proto.AvatarUserSettings.decode(e,e.uint32());break}case 12:{s.fontSize=e.int32();break}case 13:{s.securityNotifications=e.bool();break}case 14:{s.autoUnarchiveChats=e.bool();break}case 15:{s.videoQualityMode=e.int32();break}case 16:{s.photoQualityMode=e.int32();break}case 17:{s.individualNotificationSettings=p.proto.NotificationSettings.decode(e,e.uint32());break}case 18:{s.groupNotificationSettings=p.proto.NotificationSettings.decode(e,e.uint32());break}case 19:{s.chatLockSettings=p.proto.ChatLockSettings.decode(e,e.uint32());break}case 20:{s.chatDbLidMigrationTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GlobalSettings)return e;var a=new p.proto.GlobalSettings;if(e.lightThemeWallpaper!=null){if(typeof e.lightThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected");a.lightThemeWallpaper=p.proto.WallpaperSettings.fromObject(e.lightThemeWallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){a.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:a.mediaVisibility=0;break;case"OFF":case 1:a.mediaVisibility=1;break;case"ON":case 2:a.mediaVisibility=2;break}if(e.darkThemeWallpaper!=null){if(typeof e.darkThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected");a.darkThemeWallpaper=p.proto.WallpaperSettings.fromObject(e.darkThemeWallpaper)}if(e.autoDownloadWiFi!=null){if(typeof e.autoDownloadWiFi!="object")throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected");a.autoDownloadWiFi=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadWiFi)}if(e.autoDownloadCellular!=null){if(typeof e.autoDownloadCellular!="object")throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected");a.autoDownloadCellular=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadCellular)}if(e.autoDownloadRoaming!=null){if(typeof e.autoDownloadRoaming!="object")throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected");a.autoDownloadRoaming=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadRoaming)}if(e.showIndividualNotificationsPreview!=null&&(a.showIndividualNotificationsPreview=!!e.showIndividualNotificationsPreview),e.showGroupNotificationsPreview!=null&&(a.showGroupNotificationsPreview=!!e.showGroupNotificationsPreview),e.disappearingModeDuration!=null&&(a.disappearingModeDuration=e.disappearingModeDuration|0),e.disappearingModeTimestamp!=null&&(l.Long?(a.disappearingModeTimestamp=l.Long.fromValue(e.disappearingModeTimestamp)).unsigned=!1:typeof e.disappearingModeTimestamp=="string"?a.disappearingModeTimestamp=parseInt(e.disappearingModeTimestamp,10):typeof e.disappearingModeTimestamp=="number"?a.disappearingModeTimestamp=e.disappearingModeTimestamp:typeof e.disappearingModeTimestamp=="object"&&(a.disappearingModeTimestamp=new l.LongBits(e.disappearingModeTimestamp.low>>>0,e.disappearingModeTimestamp.high>>>0).toNumber())),e.avatarUserSettings!=null){if(typeof e.avatarUserSettings!="object")throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected");a.avatarUserSettings=p.proto.AvatarUserSettings.fromObject(e.avatarUserSettings)}if(e.fontSize!=null&&(a.fontSize=e.fontSize|0),e.securityNotifications!=null&&(a.securityNotifications=!!e.securityNotifications),e.autoUnarchiveChats!=null&&(a.autoUnarchiveChats=!!e.autoUnarchiveChats),e.videoQualityMode!=null&&(a.videoQualityMode=e.videoQualityMode|0),e.photoQualityMode!=null&&(a.photoQualityMode=e.photoQualityMode|0),e.individualNotificationSettings!=null){if(typeof e.individualNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected");a.individualNotificationSettings=p.proto.NotificationSettings.fromObject(e.individualNotificationSettings)}if(e.groupNotificationSettings!=null){if(typeof e.groupNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected");a.groupNotificationSettings=p.proto.NotificationSettings.fromObject(e.groupNotificationSettings)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected");a.chatLockSettings=p.proto.ChatLockSettings.fromObject(e.chatLockSettings)}return e.chatDbLidMigrationTimestamp!=null&&(l.Long?(a.chatDbLidMigrationTimestamp=l.Long.fromValue(e.chatDbLidMigrationTimestamp)).unsigned=!1:typeof e.chatDbLidMigrationTimestamp=="string"?a.chatDbLidMigrationTimestamp=parseInt(e.chatDbLidMigrationTimestamp,10):typeof e.chatDbLidMigrationTimestamp=="number"?a.chatDbLidMigrationTimestamp=e.chatDbLidMigrationTimestamp:typeof e.chatDbLidMigrationTimestamp=="object"&&(a.chatDbLidMigrationTimestamp=new l.LongBits(e.chatDbLidMigrationTimestamp.low>>>0,e.chatDbLidMigrationTimestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.lightThemeWallpaper!=null&&e.hasOwnProperty("lightThemeWallpaper")&&(A.lightThemeWallpaper=p.proto.WallpaperSettings.toObject(e.lightThemeWallpaper,a),a.oneofs&&(A._lightThemeWallpaper="lightThemeWallpaper")),e.mediaVisibility!=null&&e.hasOwnProperty("mediaVisibility")&&(A.mediaVisibility=a.enums===String?p.proto.MediaVisibility[e.mediaVisibility]===void 0?e.mediaVisibility:p.proto.MediaVisibility[e.mediaVisibility]:e.mediaVisibility,a.oneofs&&(A._mediaVisibility="mediaVisibility")),e.darkThemeWallpaper!=null&&e.hasOwnProperty("darkThemeWallpaper")&&(A.darkThemeWallpaper=p.proto.WallpaperSettings.toObject(e.darkThemeWallpaper,a),a.oneofs&&(A._darkThemeWallpaper="darkThemeWallpaper")),e.autoDownloadWiFi!=null&&e.hasOwnProperty("autoDownloadWiFi")&&(A.autoDownloadWiFi=p.proto.AutoDownloadSettings.toObject(e.autoDownloadWiFi,a),a.oneofs&&(A._autoDownloadWiFi="autoDownloadWiFi")),e.autoDownloadCellular!=null&&e.hasOwnProperty("autoDownloadCellular")&&(A.autoDownloadCellular=p.proto.AutoDownloadSettings.toObject(e.autoDownloadCellular,a),a.oneofs&&(A._autoDownloadCellular="autoDownloadCellular")),e.autoDownloadRoaming!=null&&e.hasOwnProperty("autoDownloadRoaming")&&(A.autoDownloadRoaming=p.proto.AutoDownloadSettings.toObject(e.autoDownloadRoaming,a),a.oneofs&&(A._autoDownloadRoaming="autoDownloadRoaming")),e.showIndividualNotificationsPreview!=null&&e.hasOwnProperty("showIndividualNotificationsPreview")&&(A.showIndividualNotificationsPreview=e.showIndividualNotificationsPreview,a.oneofs&&(A._showIndividualNotificationsPreview="showIndividualNotificationsPreview")),e.showGroupNotificationsPreview!=null&&e.hasOwnProperty("showGroupNotificationsPreview")&&(A.showGroupNotificationsPreview=e.showGroupNotificationsPreview,a.oneofs&&(A._showGroupNotificationsPreview="showGroupNotificationsPreview")),e.disappearingModeDuration!=null&&e.hasOwnProperty("disappearingModeDuration")&&(A.disappearingModeDuration=e.disappearingModeDuration,a.oneofs&&(A._disappearingModeDuration="disappearingModeDuration")),e.disappearingModeTimestamp!=null&&e.hasOwnProperty("disappearingModeTimestamp")&&(typeof e.disappearingModeTimestamp=="number"?A.disappearingModeTimestamp=a.longs===String?String(e.disappearingModeTimestamp):e.disappearingModeTimestamp:A.disappearingModeTimestamp=a.longs===String?ge(e.disappearingModeTimestamp):a.longs===Number?ce(e.disappearingModeTimestamp):e.disappearingModeTimestamp,a.oneofs&&(A._disappearingModeTimestamp="disappearingModeTimestamp")),e.avatarUserSettings!=null&&e.hasOwnProperty("avatarUserSettings")&&(A.avatarUserSettings=p.proto.AvatarUserSettings.toObject(e.avatarUserSettings,a),a.oneofs&&(A._avatarUserSettings="avatarUserSettings")),e.fontSize!=null&&e.hasOwnProperty("fontSize")&&(A.fontSize=e.fontSize,a.oneofs&&(A._fontSize="fontSize")),e.securityNotifications!=null&&e.hasOwnProperty("securityNotifications")&&(A.securityNotifications=e.securityNotifications,a.oneofs&&(A._securityNotifications="securityNotifications")),e.autoUnarchiveChats!=null&&e.hasOwnProperty("autoUnarchiveChats")&&(A.autoUnarchiveChats=e.autoUnarchiveChats,a.oneofs&&(A._autoUnarchiveChats="autoUnarchiveChats")),e.videoQualityMode!=null&&e.hasOwnProperty("videoQualityMode")&&(A.videoQualityMode=e.videoQualityMode,a.oneofs&&(A._videoQualityMode="videoQualityMode")),e.photoQualityMode!=null&&e.hasOwnProperty("photoQualityMode")&&(A.photoQualityMode=e.photoQualityMode,a.oneofs&&(A._photoQualityMode="photoQualityMode")),e.individualNotificationSettings!=null&&e.hasOwnProperty("individualNotificationSettings")&&(A.individualNotificationSettings=p.proto.NotificationSettings.toObject(e.individualNotificationSettings,a),a.oneofs&&(A._individualNotificationSettings="individualNotificationSettings")),e.groupNotificationSettings!=null&&e.hasOwnProperty("groupNotificationSettings")&&(A.groupNotificationSettings=p.proto.NotificationSettings.toObject(e.groupNotificationSettings,a),a.oneofs&&(A._groupNotificationSettings="groupNotificationSettings")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=p.proto.ChatLockSettings.toObject(e.chatLockSettings,a),a.oneofs&&(A._chatLockSettings="chatLockSettings")),e.chatDbLidMigrationTimestamp!=null&&e.hasOwnProperty("chatDbLidMigrationTimestamp")&&(typeof e.chatDbLidMigrationTimestamp=="number"?A.chatDbLidMigrationTimestamp=a.longs===String?String(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp:A.chatDbLidMigrationTimestamp=a.longs===String?ge(e.chatDbLidMigrationTimestamp):a.longs===Number?ce(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp,a.oneofs&&(A._chatDbLidMigrationTimestamp="chatDbLidMigrationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GlobalSettings"},t})(),n.GroupHistoryBundleInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 2:{s.processState=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupHistoryBundleInfo)return e;var a=new p.proto.GroupHistoryBundleInfo;if(e.deprecatedMessageHistoryBundle!=null){if(typeof e.deprecatedMessageHistoryBundle!="object")throw TypeError(".proto.GroupHistoryBundleInfo.deprecatedMessageHistoryBundle: object expected");a.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.fromObject(e.deprecatedMessageHistoryBundle)}switch(e.processState){default:if(typeof e.processState=="number"){a.processState=e.processState;break}break;case"NOT_INJECTED":case 0:a.processState=0;break;case"INJECTED":case 1:a.processState=1;break;case"INJECTED_PARTIAL":case 2:a.processState=2;break;case"INJECTION_FAILED":case 3:a.processState=3;break;case"INJECTION_FAILED_NO_RETRY":case 4:a.processState=4;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.deprecatedMessageHistoryBundle!=null&&e.hasOwnProperty("deprecatedMessageHistoryBundle")&&(A.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.toObject(e.deprecatedMessageHistoryBundle,a),a.oneofs&&(A._deprecatedMessageHistoryBundle="deprecatedMessageHistoryBundle")),e.processState!=null&&e.hasOwnProperty("processState")&&(A.processState=a.enums===String?p.proto.GroupHistoryBundleInfo.ProcessState[e.processState]===void 0?e.processState:p.proto.GroupHistoryBundleInfo.ProcessState[e.processState]:e.processState,a.oneofs&&(A._processState="processState")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryBundleInfo"},t.ProcessState=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_INJECTED"]=0,e[i[1]="INJECTED"]=1,e[i[2]="INJECTED_PARTIAL"]=2,e[i[3]="INJECTION_FAILED"]=3,e[i[4]="INJECTION_FAILED_NO_RETRY"]=4,e})(),t})(),n.GroupHistoryIndividualMessageInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.bundleMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.editedAfterReceivedAsHistory=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupHistoryIndividualMessageInfo)return e;var a=new p.proto.GroupHistoryIndividualMessageInfo;if(e.bundleMessageKey!=null){if(typeof e.bundleMessageKey!="object")throw TypeError(".proto.GroupHistoryIndividualMessageInfo.bundleMessageKey: object expected");a.bundleMessageKey=p.proto.MessageKey.fromObject(e.bundleMessageKey)}return e.editedAfterReceivedAsHistory!=null&&(a.editedAfterReceivedAsHistory=!!e.editedAfterReceivedAsHistory),a},t.toObject=function(e,a){a||(a={});var A={};return e.bundleMessageKey!=null&&e.hasOwnProperty("bundleMessageKey")&&(A.bundleMessageKey=p.proto.MessageKey.toObject(e.bundleMessageKey,a),a.oneofs&&(A._bundleMessageKey="bundleMessageKey")),e.editedAfterReceivedAsHistory!=null&&e.hasOwnProperty("editedAfterReceivedAsHistory")&&(A.editedAfterReceivedAsHistory=e.editedAfterReceivedAsHistory,a.oneofs&&(A._editedAfterReceivedAsHistory="editedAfterReceivedAsHistory")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryIndividualMessageInfo"},t})(),n.GroupMention=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.groupJid=e.string();break}case 2:{s.groupSubject=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupMention)return e;var a=new p.proto.GroupMention;return e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.groupSubject!=null&&(a.groupSubject=String(e.groupSubject)),a},t.toObject=function(e,a){a||(a={});var A={};return e.groupJid!=null&&e.hasOwnProperty("groupJid")&&(A.groupJid=e.groupJid,a.oneofs&&(A._groupJid="groupJid")),e.groupSubject!=null&&e.hasOwnProperty("groupSubject")&&(A.groupSubject=e.groupSubject,a.oneofs&&(A._groupSubject="groupSubject")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupMention"},t})(),n.GroupParticipant=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.rank=e.int32();break}case 3:{s.memberLabel=p.proto.MemberLabel.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupParticipant)return e;var a=new p.proto.GroupParticipant;switch(e.userJid!=null&&(a.userJid=String(e.userJid)),e.rank){default:if(typeof e.rank=="number"){a.rank=e.rank;break}break;case"REGULAR":case 0:a.rank=0;break;case"ADMIN":case 1:a.rank=1;break;case"SUPERADMIN":case 2:a.rank=2;break}if(e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.GroupParticipant.memberLabel: object expected");a.memberLabel=p.proto.MemberLabel.fromObject(e.memberLabel)}return a},t.toObject=function(e,a){a||(a={});var A={};return a.defaults&&(A.userJid=""),e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid),e.rank!=null&&e.hasOwnProperty("rank")&&(A.rank=a.enums===String?p.proto.GroupParticipant.Rank[e.rank]===void 0?e.rank:p.proto.GroupParticipant.Rank[e.rank]:e.rank,a.oneofs&&(A._rank="rank")),e.memberLabel!=null&&e.hasOwnProperty("memberLabel")&&(A.memberLabel=p.proto.MemberLabel.toObject(e.memberLabel,a),a.oneofs&&(A._memberLabel="memberLabel")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupParticipant"},t.Rank=(function(){let i={},e=Object.create(i);return e[i[0]="REGULAR"]=0,e[i[1]="ADMIN"]=1,e[i[2]="SUPERADMIN"]=2,e})(),t})(),n.HandshakeMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 2:{s.clientHello=p.proto.HandshakeMessage.ClientHello.decode(e,e.uint32());break}case 3:{s.serverHello=p.proto.HandshakeMessage.ServerHello.decode(e,e.uint32());break}case 4:{s.clientFinish=p.proto.HandshakeMessage.ClientFinish.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HandshakeMessage)return e;var a=new p.proto.HandshakeMessage;if(e.clientHello!=null){if(typeof e.clientHello!="object")throw TypeError(".proto.HandshakeMessage.clientHello: object expected");a.clientHello=p.proto.HandshakeMessage.ClientHello.fromObject(e.clientHello)}if(e.serverHello!=null){if(typeof e.serverHello!="object")throw TypeError(".proto.HandshakeMessage.serverHello: object expected");a.serverHello=p.proto.HandshakeMessage.ServerHello.fromObject(e.serverHello)}if(e.clientFinish!=null){if(typeof e.clientFinish!="object")throw TypeError(".proto.HandshakeMessage.clientFinish: object expected");a.clientFinish=p.proto.HandshakeMessage.ClientFinish.fromObject(e.clientFinish)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.clientHello!=null&&e.hasOwnProperty("clientHello")&&(A.clientHello=p.proto.HandshakeMessage.ClientHello.toObject(e.clientHello,a),a.oneofs&&(A._clientHello="clientHello")),e.serverHello!=null&&e.hasOwnProperty("serverHello")&&(A.serverHello=p.proto.HandshakeMessage.ServerHello.toObject(e.serverHello,a),a.oneofs&&(A._serverHello="serverHello")),e.clientFinish!=null&&e.hasOwnProperty("clientFinish")&&(A.clientFinish=p.proto.HandshakeMessage.ClientFinish.toObject(e.clientFinish,a),a.oneofs&&(A._clientFinish="clientFinish")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HandshakeMessage"},t.ClientFinish=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.static=A.bytes();break}case 2:{c.payload=A.bytes();break}case 3:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ClientFinish)return A;var r=new p.proto.HandshakeMessage.ClientFinish;return A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},i.toObject=function(A,r){r||(r={});var s={};return A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientFinish"},i})(),t.ClientHello=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.useExtended=A.bool();break}case 5:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ClientHello)return A;var r=new p.proto.HandshakeMessage.ClientHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.useExtended!=null&&(r.useExtended=!!A.useExtended),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},i.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.useExtended!=null&&A.hasOwnProperty("useExtended")&&(s.useExtended=A.useExtended,r.oneofs&&(s._useExtended="useExtended")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientHello"},i})(),t.ServerHello=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.extendedStatic=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ServerHello)return A;var r=new p.proto.HandshakeMessage.ServerHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedStatic!=null&&(typeof A.extendedStatic=="string"?l.base64.decode(A.extendedStatic,r.extendedStatic=l.newBuffer(l.base64.length(A.extendedStatic)),0):A.extendedStatic.length>=0&&(r.extendedStatic=A.extendedStatic)),r},i.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedStatic!=null&&A.hasOwnProperty("extendedStatic")&&(s.extendedStatic=r.bytes===String?l.base64.encode(A.extendedStatic,0,A.extendedStatic.length):r.bytes===Array?Array.prototype.slice.call(A.extendedStatic):A.extendedStatic,r.oneofs&&(s._extendedStatic="extendedStatic")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ServerHello"},i})(),t})(),n.HistorySync=(function(){function t(i){if(this.conversations=[],this.statusV3Messages=[],this.pushnames=[],this.recentStickers=[],this.pastParticipants=[],this.callLogRecords=[],this.phoneNumberToLidMappings=[],this.accounts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.syncType=e.int32();break}case 2:{s.conversations&&s.conversations.length||(s.conversations=[]),s.conversations.push(p.proto.Conversation.decode(e,e.uint32()));break}case 3:{s.statusV3Messages&&s.statusV3Messages.length||(s.statusV3Messages=[]),s.statusV3Messages.push(p.proto.WebMessageInfo.decode(e,e.uint32()));break}case 5:{s.chunkOrder=e.uint32();break}case 6:{s.progress=e.uint32();break}case 7:{s.pushnames&&s.pushnames.length||(s.pushnames=[]),s.pushnames.push(p.proto.Pushname.decode(e,e.uint32()));break}case 8:{s.globalSettings=p.proto.GlobalSettings.decode(e,e.uint32());break}case 9:{s.threadIdUserSecret=e.bytes();break}case 10:{s.threadDsTimeframeOffset=e.uint32();break}case 11:{s.recentStickers&&s.recentStickers.length||(s.recentStickers=[]),s.recentStickers.push(p.proto.StickerMetadata.decode(e,e.uint32()));break}case 12:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(p.proto.PastParticipants.decode(e,e.uint32()));break}case 13:{s.callLogRecords&&s.callLogRecords.length||(s.callLogRecords=[]),s.callLogRecords.push(p.proto.CallLogRecord.decode(e,e.uint32()));break}case 14:{s.aiWaitListState=e.int32();break}case 15:{s.phoneNumberToLidMappings&&s.phoneNumberToLidMappings.length||(s.phoneNumberToLidMappings=[]),s.phoneNumberToLidMappings.push(p.proto.PhoneNumberToLIDMapping.decode(e,e.uint32()));break}case 16:{s.companionMetaNonce=e.string();break}case 17:{s.shareableChatIdentifierEncryptionKey=e.bytes();break}case 18:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(p.proto.Account.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HistorySync)return e;var a=new p.proto.HistorySync;switch(e.syncType){default:if(typeof e.syncType=="number"){a.syncType=e.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:a.syncType=0;break;case"INITIAL_STATUS_V3":case 1:a.syncType=1;break;case"FULL":case 2:a.syncType=2;break;case"RECENT":case 3:a.syncType=3;break;case"PUSH_NAME":case 4:a.syncType=4;break;case"NON_BLOCKING_DATA":case 5:a.syncType=5;break;case"ON_DEMAND":case 6:a.syncType=6;break}if(e.conversations){if(!Array.isArray(e.conversations))throw TypeError(".proto.HistorySync.conversations: array expected");a.conversations=[];for(var A=0;A>>0),e.progress!=null&&(a.progress=e.progress>>>0),e.pushnames){if(!Array.isArray(e.pushnames))throw TypeError(".proto.HistorySync.pushnames: array expected");a.pushnames=[];for(var A=0;A=0&&(a.threadIdUserSecret=e.threadIdUserSecret)),e.threadDsTimeframeOffset!=null&&(a.threadDsTimeframeOffset=e.threadDsTimeframeOffset>>>0),e.recentStickers){if(!Array.isArray(e.recentStickers))throw TypeError(".proto.HistorySync.recentStickers: array expected");a.recentStickers=[];for(var A=0;A=0&&(a.shareableChatIdentifierEncryptionKey=e.shareableChatIdentifierEncryptionKey)),e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.HistorySync.accounts: array expected");a.accounts=[];for(var A=0;A>>3){case 1:{s.message=p.proto.WebMessageInfo.decode(e,e.uint32());break}case 2:{s.msgOrderId=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HistorySyncMsg)return e;var a=new p.proto.HistorySyncMsg;if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.HistorySyncMsg.message: object expected");a.message=p.proto.WebMessageInfo.fromObject(e.message)}return e.msgOrderId!=null&&(l.Long?(a.msgOrderId=l.Long.fromValue(e.msgOrderId)).unsigned=!0:typeof e.msgOrderId=="string"?a.msgOrderId=parseInt(e.msgOrderId,10):typeof e.msgOrderId=="number"?a.msgOrderId=e.msgOrderId:typeof e.msgOrderId=="object"&&(a.msgOrderId=new l.LongBits(e.msgOrderId.low>>>0,e.msgOrderId.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.WebMessageInfo.toObject(e.message,a),a.oneofs&&(A._message="message")),e.msgOrderId!=null&&e.hasOwnProperty("msgOrderId")&&(typeof e.msgOrderId=="number"?A.msgOrderId=a.longs===String?String(e.msgOrderId):e.msgOrderId:A.msgOrderId=a.longs===String?ge(e.msgOrderId,!0):a.longs===Number?ce(e.msgOrderId,!0):e.msgOrderId,a.oneofs&&(A._msgOrderId="msgOrderId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HistorySyncMsg"},t})(),n.HydratedTemplateButton=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.decode(e,e.uint32());break}case 3:{s.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HydratedTemplateButton)return e;var a=new p.proto.HydratedTemplateButton;if(e.index!=null&&(a.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected");a.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected");a.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.HydratedTemplateButton.callButton: object expected");a.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.fromObject(e.callButton)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(e.quickReplyButton,a),a.oneofs&&(A.hydratedButton="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.toObject(e.urlButton,a),a.oneofs&&(A.hydratedButton="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.toObject(e.callButton,a),a.oneofs&&(A.hydratedButton="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,a.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HydratedTemplateButton"},t.HydratedCallButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.phoneNumber=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedCallButton)return A;var r=new p.proto.HydratedTemplateButton.HydratedCallButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.phoneNumber!=null&&(r.phoneNumber=String(A.phoneNumber)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=A.phoneNumber,r.oneofs&&(s._phoneNumber="phoneNumber")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedCallButton"},i})(),t.HydratedQuickReplyButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedQuickReplyButton)return A;var r=new p.proto.HydratedTemplateButton.HydratedQuickReplyButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.id!=null&&(r.id=String(A.id)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedQuickReplyButton"},i})(),t.HydratedURLButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.url=A.string();break}case 3:{c.consentedUsersUrl=A.string();break}case 4:{c.webviewPresentation=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedURLButton)return A;var r=new p.proto.HydratedTemplateButton.HydratedURLButton;switch(A.displayText!=null&&(r.displayText=String(A.displayText)),A.url!=null&&(r.url=String(A.url)),A.consentedUsersUrl!=null&&(r.consentedUsersUrl=String(A.consentedUsersUrl)),A.webviewPresentation){default:if(typeof A.webviewPresentation=="number"){r.webviewPresentation=A.webviewPresentation;break}break;case"FULL":case 1:r.webviewPresentation=1;break;case"TALL":case 2:r.webviewPresentation=2;break;case"COMPACT":case 3:r.webviewPresentation=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.consentedUsersUrl!=null&&A.hasOwnProperty("consentedUsersUrl")&&(s.consentedUsersUrl=A.consentedUsersUrl,r.oneofs&&(s._consentedUsersUrl="consentedUsersUrl")),A.webviewPresentation!=null&&A.hasOwnProperty("webviewPresentation")&&(s.webviewPresentation=r.enums===String?p.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]===void 0?A.webviewPresentation:p.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]:A.webviewPresentation,r.oneofs&&(s._webviewPresentation="webviewPresentation")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedURLButton"},i.WebviewPresentationType=(function(){let a={},A=Object.create(a);return A[a[1]="FULL"]=1,A[a[2]="TALL"]=2,A[a[3]="COMPACT"]=3,A})(),i})(),t})(),n.IdentityKeyPairStructure=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.IdentityKeyPairStructure)return e;var a=new p.proto.IdentityKeyPairStructure;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.IdentityKeyPairStructure"},t})(),n.InThreadSurveyMetadata=(function(){function t(i){if(this.questions=[],this.privacyStatementParts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.tessaSessionId=e.string();break}case 2:{s.simonSessionId=e.string();break}case 3:{s.simonSurveyId=e.string();break}case 4:{s.tessaRootId=e.string();break}case 5:{s.requestId=e.string();break}case 6:{s.tessaEvent=e.string();break}case 7:{s.invitationHeaderText=e.string();break}case 8:{s.invitationBodyText=e.string();break}case 9:{s.invitationCtaText=e.string();break}case 10:{s.invitationCtaUrl=e.string();break}case 11:{s.surveyTitle=e.string();break}case 12:{s.questions&&s.questions.length||(s.questions=[]),s.questions.push(p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.decode(e,e.uint32()));break}case 13:{s.surveyContinueButtonText=e.string();break}case 14:{s.surveySubmitButtonText=e.string();break}case 15:{s.privacyStatementFull=e.string();break}case 16:{s.privacyStatementParts&&s.privacyStatementParts.length||(s.privacyStatementParts=[]),s.privacyStatementParts.push(p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.decode(e,e.uint32()));break}case 17:{s.feedbackToastText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.InThreadSurveyMetadata)return e;var a=new p.proto.InThreadSurveyMetadata;if(e.tessaSessionId!=null&&(a.tessaSessionId=String(e.tessaSessionId)),e.simonSessionId!=null&&(a.simonSessionId=String(e.simonSessionId)),e.simonSurveyId!=null&&(a.simonSurveyId=String(e.simonSurveyId)),e.tessaRootId!=null&&(a.tessaRootId=String(e.tessaRootId)),e.requestId!=null&&(a.requestId=String(e.requestId)),e.tessaEvent!=null&&(a.tessaEvent=String(e.tessaEvent)),e.invitationHeaderText!=null&&(a.invitationHeaderText=String(e.invitationHeaderText)),e.invitationBodyText!=null&&(a.invitationBodyText=String(e.invitationBodyText)),e.invitationCtaText!=null&&(a.invitationCtaText=String(e.invitationCtaText)),e.invitationCtaUrl!=null&&(a.invitationCtaUrl=String(e.invitationCtaUrl)),e.surveyTitle!=null&&(a.surveyTitle=String(e.surveyTitle)),e.questions){if(!Array.isArray(e.questions))throw TypeError(".proto.InThreadSurveyMetadata.questions: array expected");a.questions=[];for(var A=0;A>>3){case 1:{c.stringValue=A.string();break}case 2:{c.numericValue=A.uint32();break}case 3:{c.textTranslated=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyOption)return A;var r=new p.proto.InThreadSurveyMetadata.InThreadSurveyOption;return A.stringValue!=null&&(r.stringValue=String(A.stringValue)),A.numericValue!=null&&(r.numericValue=A.numericValue>>>0),A.textTranslated!=null&&(r.textTranslated=String(A.textTranslated)),r},i.toObject=function(A,r){r||(r={});var s={};return A.stringValue!=null&&A.hasOwnProperty("stringValue")&&(s.stringValue=A.stringValue,r.oneofs&&(s._stringValue="stringValue")),A.numericValue!=null&&A.hasOwnProperty("numericValue")&&(s.numericValue=A.numericValue,r.oneofs&&(s._numericValue="numericValue")),A.textTranslated!=null&&A.hasOwnProperty("textTranslated")&&(s.textTranslated=A.textTranslated,r.oneofs&&(s._textTranslated="textTranslated")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyOption"},i})(),t.InThreadSurveyPrivacyStatementPart=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.url=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart)return A;var r=new p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart;return A.text!=null&&(r.text=String(A.text)),A.url!=null&&(r.url=String(A.url)),r},i.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart"},i})(),t.InThreadSurveyQuestion=(function(){function i(a){if(this.questionOptions=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.questionText=A.string();break}case 2:{c.questionId=A.string();break}case 3:{c.questionOptions&&c.questionOptions.length||(c.questionOptions=[]),c.questionOptions.push(p.proto.InThreadSurveyMetadata.InThreadSurveyOption.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion)return A;var r=new p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion;if(A.questionText!=null&&(r.questionText=String(A.questionText)),A.questionId!=null&&(r.questionId=String(A.questionId)),A.questionOptions){if(!Array.isArray(A.questionOptions))throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: array expected");r.questionOptions=[];for(var s=0;s>>3){case 1:{s.polygonVertices&&s.polygonVertices.length||(s.polygonVertices=[]),s.polygonVertices.push(p.proto.Point.decode(e,e.uint32()));break}case 4:{s.shouldSkipConfirmation=e.bool();break}case 5:{s.embeddedContent=p.proto.EmbeddedContent.decode(e,e.uint32());break}case 8:{s.statusLinkType=e.int32();break}case 2:{s.location=p.proto.Location.decode(e,e.uint32());break}case 3:{s.newsletter=p.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 6:{s.embeddedAction=e.bool();break}case 7:{s.tapAction=p.proto.TapLinkAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.InteractiveAnnotation)return e;var a=new p.proto.InteractiveAnnotation;if(e.polygonVertices){if(!Array.isArray(e.polygonVertices))throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected");a.polygonVertices=[];for(var A=0;A>>3){case 1:{s.isGalaxyFlowCompleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.InteractiveMessageAdditionalMetadata)return e;var a=new p.proto.InteractiveMessageAdditionalMetadata;return e.isGalaxyFlowCompleted!=null&&(a.isGalaxyFlowCompleted=!!e.isGalaxyFlowCompleted),a},t.toObject=function(e,a){a||(a={});var A={};return e.isGalaxyFlowCompleted!=null&&e.hasOwnProperty("isGalaxyFlowCompleted")&&(A.isGalaxyFlowCompleted=e.isGalaxyFlowCompleted,a.oneofs&&(A._isGalaxyFlowCompleted="isGalaxyFlowCompleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.InteractiveMessageAdditionalMetadata"},t})(),n.KeepInChat=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.keepType=e.int32();break}case 2:{s.serverTimestamp=e.int64();break}case 3:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 4:{s.deviceJid=e.string();break}case 5:{s.clientTimestampMs=e.int64();break}case 6:{s.serverTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.KeepInChat)return e;var a=new p.proto.KeepInChat;switch(e.keepType){default:if(typeof e.keepType=="number"){a.keepType=e.keepType;break}break;case"UNKNOWN":case 0:a.keepType=0;break;case"KEEP_FOR_ALL":case 1:a.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:a.keepType=2;break}if(e.serverTimestamp!=null&&(l.Long?(a.serverTimestamp=l.Long.fromValue(e.serverTimestamp)).unsigned=!1:typeof e.serverTimestamp=="string"?a.serverTimestamp=parseInt(e.serverTimestamp,10):typeof e.serverTimestamp=="number"?a.serverTimestamp=e.serverTimestamp:typeof e.serverTimestamp=="object"&&(a.serverTimestamp=new l.LongBits(e.serverTimestamp.low>>>0,e.serverTimestamp.high>>>0).toNumber())),e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.KeepInChat.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}return e.deviceJid!=null&&(a.deviceJid=String(e.deviceJid)),e.clientTimestampMs!=null&&(l.Long?(a.clientTimestampMs=l.Long.fromValue(e.clientTimestampMs)).unsigned=!1:typeof e.clientTimestampMs=="string"?a.clientTimestampMs=parseInt(e.clientTimestampMs,10):typeof e.clientTimestampMs=="number"?a.clientTimestampMs=e.clientTimestampMs:typeof e.clientTimestampMs=="object"&&(a.clientTimestampMs=new l.LongBits(e.clientTimestampMs.low>>>0,e.clientTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.keepType!=null&&e.hasOwnProperty("keepType")&&(A.keepType=a.enums===String?p.proto.KeepType[e.keepType]===void 0?e.keepType:p.proto.KeepType[e.keepType]:e.keepType,a.oneofs&&(A._keepType="keepType")),e.serverTimestamp!=null&&e.hasOwnProperty("serverTimestamp")&&(typeof e.serverTimestamp=="number"?A.serverTimestamp=a.longs===String?String(e.serverTimestamp):e.serverTimestamp:A.serverTimestamp=a.longs===String?ge(e.serverTimestamp):a.longs===Number?ce(e.serverTimestamp):e.serverTimestamp,a.oneofs&&(A._serverTimestamp="serverTimestamp")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.deviceJid!=null&&e.hasOwnProperty("deviceJid")&&(A.deviceJid=e.deviceJid,a.oneofs&&(A._deviceJid="deviceJid")),e.clientTimestampMs!=null&&e.hasOwnProperty("clientTimestampMs")&&(typeof e.clientTimestampMs=="number"?A.clientTimestampMs=a.longs===String?String(e.clientTimestampMs):e.clientTimestampMs:A.clientTimestampMs=a.longs===String?ge(e.clientTimestampMs):a.longs===Number?ce(e.clientTimestampMs):e.clientTimestampMs,a.oneofs&&(A._clientTimestampMs="clientTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeepInChat"},t})(),n.KeepType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN"]=0,o[t[1]="KEEP_FOR_ALL"]=1,o[t[2]="UNDO_KEEP_FOR_ALL"]=2,o})(),n.KeyExchangeMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.ratchetKey=e.bytes();break}case 4:{s.identityKey=e.bytes();break}case 5:{s.baseKeySignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.KeyExchangeMessage)return e;var a=new p.proto.KeyExchangeMessage;return e.id!=null&&(a.id=e.id>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,a.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(a.baseKey=e.baseKey)),e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,a.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(a.ratchetKey=e.ratchetKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,a.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(a.identityKey=e.identityKey)),e.baseKeySignature!=null&&(typeof e.baseKeySignature=="string"?l.base64.decode(e.baseKeySignature,a.baseKeySignature=l.newBuffer(l.base64.length(e.baseKeySignature)),0):e.baseKeySignature.length>=0&&(a.baseKeySignature=e.baseKeySignature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=a.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):a.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,a.oneofs&&(A._baseKey="baseKey")),e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=a.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):a.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,a.oneofs&&(A._ratchetKey="ratchetKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=a.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):a.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,a.oneofs&&(A._identityKey="identityKey")),e.baseKeySignature!=null&&e.hasOwnProperty("baseKeySignature")&&(A.baseKeySignature=a.bytes===String?l.base64.encode(e.baseKeySignature,0,e.baseKeySignature.length):a.bytes===Array?Array.prototype.slice.call(e.baseKeySignature):e.baseKeySignature,a.oneofs&&(A._baseKeySignature="baseKeySignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyExchangeMessage"},t})(),n.KeyId=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.KeyId)return e;var a=new p.proto.KeyId;return e.id!=null&&(typeof e.id=="string"?l.base64.decode(e.id,a.id=l.newBuffer(l.base64.length(e.id)),0):e.id.length>=0&&(a.id=e.id)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=a.bytes===String?l.base64.encode(e.id,0,e.id.length):a.bytes===Array?Array.prototype.slice.call(e.id):e.id,a.oneofs&&(A._id="id")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyId"},t})(),n.LIDMigrationMapping=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pn=e.uint64();break}case 2:{s.assignedLid=e.uint64();break}case 3:{s.latestLid=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMapping)return e;var a=new p.proto.LIDMigrationMapping;return e.pn!=null&&(l.Long?(a.pn=l.Long.fromValue(e.pn)).unsigned=!0:typeof e.pn=="string"?a.pn=parseInt(e.pn,10):typeof e.pn=="number"?a.pn=e.pn:typeof e.pn=="object"&&(a.pn=new l.LongBits(e.pn.low>>>0,e.pn.high>>>0).toNumber(!0))),e.assignedLid!=null&&(l.Long?(a.assignedLid=l.Long.fromValue(e.assignedLid)).unsigned=!0:typeof e.assignedLid=="string"?a.assignedLid=parseInt(e.assignedLid,10):typeof e.assignedLid=="number"?a.assignedLid=e.assignedLid:typeof e.assignedLid=="object"&&(a.assignedLid=new l.LongBits(e.assignedLid.low>>>0,e.assignedLid.high>>>0).toNumber(!0))),e.latestLid!=null&&(l.Long?(a.latestLid=l.Long.fromValue(e.latestLid)).unsigned=!0:typeof e.latestLid=="string"?a.latestLid=parseInt(e.latestLid,10):typeof e.latestLid=="number"?a.latestLid=e.latestLid:typeof e.latestLid=="object"&&(a.latestLid=new l.LongBits(e.latestLid.low>>>0,e.latestLid.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};if(a.defaults){if(l.Long){var r=new l.Long(0,0,!0);A.pn=a.longs===String?r.toString():a.longs===Number?r.toNumber():r}else A.pn=a.longs===String?"0":0;if(l.Long){var r=new l.Long(0,0,!0);A.assignedLid=a.longs===String?r.toString():a.longs===Number?r.toNumber():r}else A.assignedLid=a.longs===String?"0":0}return e.pn!=null&&e.hasOwnProperty("pn")&&(typeof e.pn=="number"?A.pn=a.longs===String?String(e.pn):e.pn:A.pn=a.longs===String?ge(e.pn,!0):a.longs===Number?ce(e.pn,!0):e.pn),e.assignedLid!=null&&e.hasOwnProperty("assignedLid")&&(typeof e.assignedLid=="number"?A.assignedLid=a.longs===String?String(e.assignedLid):e.assignedLid:A.assignedLid=a.longs===String?ge(e.assignedLid,!0):a.longs===Number?ce(e.assignedLid,!0):e.assignedLid),e.latestLid!=null&&e.hasOwnProperty("latestLid")&&(typeof e.latestLid=="number"?A.latestLid=a.longs===String?String(e.latestLid):e.latestLid:A.latestLid=a.longs===String?ge(e.latestLid,!0):a.longs===Number?ce(e.latestLid,!0):e.latestLid,a.oneofs&&(A._latestLid="latestLid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMapping"},t})(),n.LIDMigrationMappingSyncMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encodedMappingPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMappingSyncMessage)return e;var a=new p.proto.LIDMigrationMappingSyncMessage;return e.encodedMappingPayload!=null&&(typeof e.encodedMappingPayload=="string"?l.base64.decode(e.encodedMappingPayload,a.encodedMappingPayload=l.newBuffer(l.base64.length(e.encodedMappingPayload)),0):e.encodedMappingPayload.length>=0&&(a.encodedMappingPayload=e.encodedMappingPayload)),a},t.toObject=function(e,a){a||(a={});var A={};return e.encodedMappingPayload!=null&&e.hasOwnProperty("encodedMappingPayload")&&(A.encodedMappingPayload=a.bytes===String?l.base64.encode(e.encodedMappingPayload,0,e.encodedMappingPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encodedMappingPayload):e.encodedMappingPayload,a.oneofs&&(A._encodedMappingPayload="encodedMappingPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMappingSyncMessage"},t})(),n.LIDMigrationMappingSyncPayload=(function(){function t(i){if(this.pnToLidMappings=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pnToLidMappings&&s.pnToLidMappings.length||(s.pnToLidMappings=[]),s.pnToLidMappings.push(p.proto.LIDMigrationMapping.decode(e,e.uint32()));break}case 2:{s.chatDbMigrationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMappingSyncPayload)return e;var a=new p.proto.LIDMigrationMappingSyncPayload;if(e.pnToLidMappings){if(!Array.isArray(e.pnToLidMappings))throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected");a.pnToLidMappings=[];for(var A=0;A>>0,e.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.pnToLidMappings=[]),e.pnToLidMappings&&e.pnToLidMappings.length){A.pnToLidMappings=[];for(var r=0;r>>3){case 1:{s.eventResponseMessage=p.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 2:{s.pollVote=p.proto.Message.PollVoteMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LegacyMessage)return e;var a=new p.proto.LegacyMessage;if(e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected");a.eventResponseMessage=p.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}if(e.pollVote!=null){if(typeof e.pollVote!="object")throw TypeError(".proto.LegacyMessage.pollVote: object expected");a.pollVote=p.proto.Message.PollVoteMessage.fromObject(e.pollVote)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=p.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,a),a.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.pollVote!=null&&e.hasOwnProperty("pollVote")&&(A.pollVote=p.proto.Message.PollVoteMessage.toObject(e.pollVote,a),a.oneofs&&(A._pollVote="pollVote")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LegacyMessage"},t})(),n.LimitSharing=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sharingLimited=e.bool();break}case 2:{s.trigger=e.int32();break}case 3:{s.limitSharingSettingTimestamp=e.int64();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LimitSharing)return e;var a=new p.proto.LimitSharing;switch(e.sharingLimited!=null&&(a.sharingLimited=!!e.sharingLimited),e.trigger){default:if(typeof e.trigger=="number"){a.trigger=e.trigger;break}break;case"UNKNOWN":case 0:a.trigger=0;break;case"CHAT_SETTING":case 1:a.trigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:a.trigger=2;break;case"UNKNOWN_GROUP":case 3:a.trigger=3;break}return e.limitSharingSettingTimestamp!=null&&(l.Long?(a.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?a.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?a.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(a.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.initiatedByMe!=null&&(a.initiatedByMe=!!e.initiatedByMe),a},t.toObject=function(e,a){a||(a={});var A={};return e.sharingLimited!=null&&e.hasOwnProperty("sharingLimited")&&(A.sharingLimited=e.sharingLimited,a.oneofs&&(A._sharingLimited="sharingLimited")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=a.enums===String?p.proto.LimitSharing.TriggerType[e.trigger]===void 0?e.trigger:p.proto.LimitSharing.TriggerType[e.trigger]:e.trigger,a.oneofs&&(A._trigger="trigger")),e.limitSharingSettingTimestamp!=null&&e.hasOwnProperty("limitSharingSettingTimestamp")&&(typeof e.limitSharingSettingTimestamp=="number"?A.limitSharingSettingTimestamp=a.longs===String?String(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp:A.limitSharingSettingTimestamp=a.longs===String?ge(e.limitSharingSettingTimestamp):a.longs===Number?ce(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp,a.oneofs&&(A._limitSharingSettingTimestamp="limitSharingSettingTimestamp")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,a.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LimitSharing"},t.TriggerType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT_SETTING"]=1,e[i[2]="BIZ_SUPPORTS_FB_HOSTING"]=2,e[i[3]="UNKNOWN_GROUP"]=3,e})(),t})(),n.LocalizedName=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lg=e.string();break}case 2:{s.lc=e.string();break}case 3:{s.verifiedName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LocalizedName)return e;var a=new p.proto.LocalizedName;return e.lg!=null&&(a.lg=String(e.lg)),e.lc!=null&&(a.lc=String(e.lc)),e.verifiedName!=null&&(a.verifiedName=String(e.verifiedName)),a},t.toObject=function(e,a){a||(a={});var A={};return e.lg!=null&&e.hasOwnProperty("lg")&&(A.lg=e.lg,a.oneofs&&(A._lg="lg")),e.lc!=null&&e.hasOwnProperty("lc")&&(A.lc=e.lc,a.oneofs&&(A._lc="lc")),e.verifiedName!=null&&e.hasOwnProperty("verifiedName")&&(A.verifiedName=e.verifiedName,a.oneofs&&(A._verifiedName="verifiedName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LocalizedName"},t})(),n.Location=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.degreesLatitude=e.double();break}case 2:{s.degreesLongitude=e.double();break}case 3:{s.name=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Location)return e;var a=new p.proto.Location;return e.degreesLatitude!=null&&(a.degreesLatitude=Number(e.degreesLatitude)),e.degreesLongitude!=null&&(a.degreesLongitude=Number(e.degreesLongitude)),e.name!=null&&(a.name=String(e.name)),a},t.toObject=function(e,a){a||(a={});var A={};return e.degreesLatitude!=null&&e.hasOwnProperty("degreesLatitude")&&(A.degreesLatitude=a.json&&!isFinite(e.degreesLatitude)?String(e.degreesLatitude):e.degreesLatitude,a.oneofs&&(A._degreesLatitude="degreesLatitude")),e.degreesLongitude!=null&&e.hasOwnProperty("degreesLongitude")&&(A.degreesLongitude=a.json&&!isFinite(e.degreesLongitude)?String(e.degreesLongitude):e.degreesLongitude,a.oneofs&&(A._degreesLongitude="degreesLongitude")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,a.oneofs&&(A._name="name")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Location"},t})(),n.MediaData=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.localPath=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MediaData)return e;var a=new p.proto.MediaData;return e.localPath!=null&&(a.localPath=String(e.localPath)),a},t.toObject=function(e,a){a||(a={});var A={};return e.localPath!=null&&e.hasOwnProperty("localPath")&&(A.localPath=e.localPath,a.oneofs&&(A._localPath="localPath")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaData"},t})(),n.MediaNotifyMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.expressPathUrl=e.string();break}case 2:{s.fileEncSha256=e.bytes();break}case 3:{s.fileLength=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MediaNotifyMessage)return e;var a=new p.proto.MediaNotifyMessage;return e.expressPathUrl!=null&&(a.expressPathUrl=String(e.expressPathUrl)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.expressPathUrl!=null&&e.hasOwnProperty("expressPathUrl")&&(A.expressPathUrl=e.expressPathUrl,a.oneofs&&(A._expressPathUrl="expressPathUrl")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?ge(e.fileLength,!0):a.longs===Number?ce(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaNotifyMessage"},t})(),n.MediaRetryNotification=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.directPath=e.string();break}case 3:{s.result=e.int32();break}case 4:{s.messageSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MediaRetryNotification)return e;var a=new p.proto.MediaRetryNotification;switch(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.result){default:if(typeof e.result=="number"){a.result=e.result;break}break;case"GENERAL_ERROR":case 0:a.result=0;break;case"SUCCESS":case 1:a.result=1;break;case"NOT_FOUND":case 2:a.result=2;break;case"DECRYPTION_ERROR":case 3:a.result=3;break}return e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),a},t.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.result!=null&&e.hasOwnProperty("result")&&(A.result=a.enums===String?p.proto.MediaRetryNotification.ResultType[e.result]===void 0?e.result:p.proto.MediaRetryNotification.ResultType[e.result]:e.result,a.oneofs&&(A._result="result")),e.messageSecret!=null&&e.hasOwnProperty("messageSecret")&&(A.messageSecret=a.bytes===String?l.base64.encode(e.messageSecret,0,e.messageSecret.length):a.bytes===Array?Array.prototype.slice.call(e.messageSecret):e.messageSecret,a.oneofs&&(A._messageSecret="messageSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaRetryNotification"},t.ResultType=(function(){let i={},e=Object.create(i);return e[i[0]="GENERAL_ERROR"]=0,e[i[1]="SUCCESS"]=1,e[i[2]="NOT_FOUND"]=2,e[i[3]="DECRYPTION_ERROR"]=3,e})(),t})(),n.MediaVisibility=(function(){let t={},o=Object.create(t);return o[t[0]="DEFAULT"]=0,o[t[1]="OFF"]=1,o[t[2]="ON"]=2,o})(),n.MemberLabel=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.label=e.string();break}case 2:{s.labelTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MemberLabel)return e;var a=new p.proto.MemberLabel;return e.label!=null&&(a.label=String(e.label)),e.labelTimestamp!=null&&(l.Long?(a.labelTimestamp=l.Long.fromValue(e.labelTimestamp)).unsigned=!1:typeof e.labelTimestamp=="string"?a.labelTimestamp=parseInt(e.labelTimestamp,10):typeof e.labelTimestamp=="number"?a.labelTimestamp=e.labelTimestamp:typeof e.labelTimestamp=="object"&&(a.labelTimestamp=new l.LongBits(e.labelTimestamp.low>>>0,e.labelTimestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.label!=null&&e.hasOwnProperty("label")&&(A.label=e.label,a.oneofs&&(A._label="label")),e.labelTimestamp!=null&&e.hasOwnProperty("labelTimestamp")&&(typeof e.labelTimestamp=="number"?A.labelTimestamp=a.longs===String?String(e.labelTimestamp):e.labelTimestamp:A.labelTimestamp=a.longs===String?ge(e.labelTimestamp):a.longs===Number?ce(e.labelTimestamp):e.labelTimestamp,a.oneofs&&(A._labelTimestamp="labelTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MemberLabel"},t})(),n.Message=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.conversation=e.string();break}case 2:{s.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 3:{s.imageMessage=p.proto.Message.ImageMessage.decode(e,e.uint32());break}case 4:{s.contactMessage=p.proto.Message.ContactMessage.decode(e,e.uint32());break}case 5:{s.locationMessage=p.proto.Message.LocationMessage.decode(e,e.uint32());break}case 6:{s.extendedTextMessage=p.proto.Message.ExtendedTextMessage.decode(e,e.uint32());break}case 7:{s.documentMessage=p.proto.Message.DocumentMessage.decode(e,e.uint32());break}case 8:{s.audioMessage=p.proto.Message.AudioMessage.decode(e,e.uint32());break}case 9:{s.videoMessage=p.proto.Message.VideoMessage.decode(e,e.uint32());break}case 10:{s.call=p.proto.Message.Call.decode(e,e.uint32());break}case 11:{s.chat=p.proto.Message.Chat.decode(e,e.uint32());break}case 12:{s.protocolMessage=p.proto.Message.ProtocolMessage.decode(e,e.uint32());break}case 13:{s.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.decode(e,e.uint32());break}case 14:{s.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.decode(e,e.uint32());break}case 15:{s.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 16:{s.sendPaymentMessage=p.proto.Message.SendPaymentMessage.decode(e,e.uint32());break}case 18:{s.liveLocationMessage=p.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 22:{s.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.decode(e,e.uint32());break}case 23:{s.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.decode(e,e.uint32());break}case 24:{s.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.decode(e,e.uint32());break}case 25:{s.templateMessage=p.proto.Message.TemplateMessage.decode(e,e.uint32());break}case 26:{s.stickerMessage=p.proto.Message.StickerMessage.decode(e,e.uint32());break}case 28:{s.groupInviteMessage=p.proto.Message.GroupInviteMessage.decode(e,e.uint32());break}case 29:{s.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.decode(e,e.uint32());break}case 30:{s.productMessage=p.proto.Message.ProductMessage.decode(e,e.uint32());break}case 31:{s.deviceSentMessage=p.proto.Message.DeviceSentMessage.decode(e,e.uint32());break}case 35:{s.messageContextInfo=p.proto.MessageContextInfo.decode(e,e.uint32());break}case 36:{s.listMessage=p.proto.Message.ListMessage.decode(e,e.uint32());break}case 37:{s.viewOnceMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 38:{s.orderMessage=p.proto.Message.OrderMessage.decode(e,e.uint32());break}case 39:{s.listResponseMessage=p.proto.Message.ListResponseMessage.decode(e,e.uint32());break}case 40:{s.ephemeralMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 41:{s.invoiceMessage=p.proto.Message.InvoiceMessage.decode(e,e.uint32());break}case 42:{s.buttonsMessage=p.proto.Message.ButtonsMessage.decode(e,e.uint32());break}case 43:{s.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.decode(e,e.uint32());break}case 44:{s.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.decode(e,e.uint32());break}case 45:{s.interactiveMessage=p.proto.Message.InteractiveMessage.decode(e,e.uint32());break}case 46:{s.reactionMessage=p.proto.Message.ReactionMessage.decode(e,e.uint32());break}case 47:{s.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.decode(e,e.uint32());break}case 48:{s.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.decode(e,e.uint32());break}case 49:{s.pollCreationMessage=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 50:{s.pollUpdateMessage=p.proto.Message.PollUpdateMessage.decode(e,e.uint32());break}case 51:{s.keepInChatMessage=p.proto.Message.KeepInChatMessage.decode(e,e.uint32());break}case 53:{s.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 54:{s.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.decode(e,e.uint32());break}case 55:{s.viewOnceMessageV2=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 56:{s.encReactionMessage=p.proto.Message.EncReactionMessage.decode(e,e.uint32());break}case 58:{s.editedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 59:{s.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 60:{s.pollCreationMessageV2=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 61:{s.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.decode(e,e.uint32());break}case 62:{s.groupMentionedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 63:{s.pinInChatMessage=p.proto.Message.PinInChatMessage.decode(e,e.uint32());break}case 64:{s.pollCreationMessageV3=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 65:{s.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.decode(e,e.uint32());break}case 66:{s.ptvMessage=p.proto.Message.VideoMessage.decode(e,e.uint32());break}case 67:{s.botInvokeMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 69:{s.callLogMesssage=p.proto.Message.CallLogMessage.decode(e,e.uint32());break}case 70:{s.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 71:{s.encCommentMessage=p.proto.Message.EncCommentMessage.decode(e,e.uint32());break}case 72:{s.bcallMessage=p.proto.Message.BCallMessage.decode(e,e.uint32());break}case 74:{s.lottieStickerMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 75:{s.eventMessage=p.proto.Message.EventMessage.decode(e,e.uint32());break}case 76:{s.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.decode(e,e.uint32());break}case 77:{s.commentMessage=p.proto.Message.CommentMessage.decode(e,e.uint32());break}case 78:{s.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.decode(e,e.uint32());break}case 80:{s.placeholderMessage=p.proto.Message.PlaceholderMessage.decode(e,e.uint32());break}case 82:{s.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.decode(e,e.uint32());break}case 83:{s.albumMessage=p.proto.Message.AlbumMessage.decode(e,e.uint32());break}case 85:{s.eventCoverImage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 86:{s.stickerPackMessage=p.proto.Message.StickerPackMessage.decode(e,e.uint32());break}case 87:{s.statusMentionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 88:{s.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}case 90:{s.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 91:{s.associatedChildMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 92:{s.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 93:{s.pollCreationMessageV4=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 95:{s.statusAddYours=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 96:{s.groupStatusMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 97:{s.richResponseMessage=p.proto.AIRichResponseMessage.decode(e,e.uint32());break}case 98:{s.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.decode(e,e.uint32());break}case 99:{s.limitSharingMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 100:{s.botTaskMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 101:{s.questionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 102:{s.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.decode(e,e.uint32());break}case 103:{s.groupStatusMessageV2=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 104:{s.botForwardedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 105:{s.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.decode(e,e.uint32());break}case 106:{s.questionReplyMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 107:{s.questionResponseMessage=p.proto.Message.QuestionResponseMessage.decode(e,e.uint32());break}case 109:{s.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.decode(e,e.uint32());break}case 110:{s.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.decode(e,e.uint32());break}case 111:{s.pollCreationMessageV5=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 113:{s.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.decode(e,e.uint32());break}case 114:{s.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Message)return e;var a=new p.proto.Message;if(e.conversation!=null&&(a.conversation=String(e.conversation)),e.senderKeyDistributionMessage!=null){if(typeof e.senderKeyDistributionMessage!="object")throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected");a.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.fromObject(e.senderKeyDistributionMessage)}if(e.imageMessage!=null){if(typeof e.imageMessage!="object")throw TypeError(".proto.Message.imageMessage: object expected");a.imageMessage=p.proto.Message.ImageMessage.fromObject(e.imageMessage)}if(e.contactMessage!=null){if(typeof e.contactMessage!="object")throw TypeError(".proto.Message.contactMessage: object expected");a.contactMessage=p.proto.Message.ContactMessage.fromObject(e.contactMessage)}if(e.locationMessage!=null){if(typeof e.locationMessage!="object")throw TypeError(".proto.Message.locationMessage: object expected");a.locationMessage=p.proto.Message.LocationMessage.fromObject(e.locationMessage)}if(e.extendedTextMessage!=null){if(typeof e.extendedTextMessage!="object")throw TypeError(".proto.Message.extendedTextMessage: object expected");a.extendedTextMessage=p.proto.Message.ExtendedTextMessage.fromObject(e.extendedTextMessage)}if(e.documentMessage!=null){if(typeof e.documentMessage!="object")throw TypeError(".proto.Message.documentMessage: object expected");a.documentMessage=p.proto.Message.DocumentMessage.fromObject(e.documentMessage)}if(e.audioMessage!=null){if(typeof e.audioMessage!="object")throw TypeError(".proto.Message.audioMessage: object expected");a.audioMessage=p.proto.Message.AudioMessage.fromObject(e.audioMessage)}if(e.videoMessage!=null){if(typeof e.videoMessage!="object")throw TypeError(".proto.Message.videoMessage: object expected");a.videoMessage=p.proto.Message.VideoMessage.fromObject(e.videoMessage)}if(e.call!=null){if(typeof e.call!="object")throw TypeError(".proto.Message.call: object expected");a.call=p.proto.Message.Call.fromObject(e.call)}if(e.chat!=null){if(typeof e.chat!="object")throw TypeError(".proto.Message.chat: object expected");a.chat=p.proto.Message.Chat.fromObject(e.chat)}if(e.protocolMessage!=null){if(typeof e.protocolMessage!="object")throw TypeError(".proto.Message.protocolMessage: object expected");a.protocolMessage=p.proto.Message.ProtocolMessage.fromObject(e.protocolMessage)}if(e.contactsArrayMessage!=null){if(typeof e.contactsArrayMessage!="object")throw TypeError(".proto.Message.contactsArrayMessage: object expected");a.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.fromObject(e.contactsArrayMessage)}if(e.highlyStructuredMessage!=null){if(typeof e.highlyStructuredMessage!="object")throw TypeError(".proto.Message.highlyStructuredMessage: object expected");a.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.fromObject(e.highlyStructuredMessage)}if(e.fastRatchetKeySenderKeyDistributionMessage!=null){if(typeof e.fastRatchetKeySenderKeyDistributionMessage!="object")throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected");a.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.fromObject(e.fastRatchetKeySenderKeyDistributionMessage)}if(e.sendPaymentMessage!=null){if(typeof e.sendPaymentMessage!="object")throw TypeError(".proto.Message.sendPaymentMessage: object expected");a.sendPaymentMessage=p.proto.Message.SendPaymentMessage.fromObject(e.sendPaymentMessage)}if(e.liveLocationMessage!=null){if(typeof e.liveLocationMessage!="object")throw TypeError(".proto.Message.liveLocationMessage: object expected");a.liveLocationMessage=p.proto.Message.LiveLocationMessage.fromObject(e.liveLocationMessage)}if(e.requestPaymentMessage!=null){if(typeof e.requestPaymentMessage!="object")throw TypeError(".proto.Message.requestPaymentMessage: object expected");a.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.fromObject(e.requestPaymentMessage)}if(e.declinePaymentRequestMessage!=null){if(typeof e.declinePaymentRequestMessage!="object")throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected");a.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.fromObject(e.declinePaymentRequestMessage)}if(e.cancelPaymentRequestMessage!=null){if(typeof e.cancelPaymentRequestMessage!="object")throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected");a.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.fromObject(e.cancelPaymentRequestMessage)}if(e.templateMessage!=null){if(typeof e.templateMessage!="object")throw TypeError(".proto.Message.templateMessage: object expected");a.templateMessage=p.proto.Message.TemplateMessage.fromObject(e.templateMessage)}if(e.stickerMessage!=null){if(typeof e.stickerMessage!="object")throw TypeError(".proto.Message.stickerMessage: object expected");a.stickerMessage=p.proto.Message.StickerMessage.fromObject(e.stickerMessage)}if(e.groupInviteMessage!=null){if(typeof e.groupInviteMessage!="object")throw TypeError(".proto.Message.groupInviteMessage: object expected");a.groupInviteMessage=p.proto.Message.GroupInviteMessage.fromObject(e.groupInviteMessage)}if(e.templateButtonReplyMessage!=null){if(typeof e.templateButtonReplyMessage!="object")throw TypeError(".proto.Message.templateButtonReplyMessage: object expected");a.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.fromObject(e.templateButtonReplyMessage)}if(e.productMessage!=null){if(typeof e.productMessage!="object")throw TypeError(".proto.Message.productMessage: object expected");a.productMessage=p.proto.Message.ProductMessage.fromObject(e.productMessage)}if(e.deviceSentMessage!=null){if(typeof e.deviceSentMessage!="object")throw TypeError(".proto.Message.deviceSentMessage: object expected");a.deviceSentMessage=p.proto.Message.DeviceSentMessage.fromObject(e.deviceSentMessage)}if(e.messageContextInfo!=null){if(typeof e.messageContextInfo!="object")throw TypeError(".proto.Message.messageContextInfo: object expected");a.messageContextInfo=p.proto.MessageContextInfo.fromObject(e.messageContextInfo)}if(e.listMessage!=null){if(typeof e.listMessage!="object")throw TypeError(".proto.Message.listMessage: object expected");a.listMessage=p.proto.Message.ListMessage.fromObject(e.listMessage)}if(e.viewOnceMessage!=null){if(typeof e.viewOnceMessage!="object")throw TypeError(".proto.Message.viewOnceMessage: object expected");a.viewOnceMessage=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessage)}if(e.orderMessage!=null){if(typeof e.orderMessage!="object")throw TypeError(".proto.Message.orderMessage: object expected");a.orderMessage=p.proto.Message.OrderMessage.fromObject(e.orderMessage)}if(e.listResponseMessage!=null){if(typeof e.listResponseMessage!="object")throw TypeError(".proto.Message.listResponseMessage: object expected");a.listResponseMessage=p.proto.Message.ListResponseMessage.fromObject(e.listResponseMessage)}if(e.ephemeralMessage!=null){if(typeof e.ephemeralMessage!="object")throw TypeError(".proto.Message.ephemeralMessage: object expected");a.ephemeralMessage=p.proto.Message.FutureProofMessage.fromObject(e.ephemeralMessage)}if(e.invoiceMessage!=null){if(typeof e.invoiceMessage!="object")throw TypeError(".proto.Message.invoiceMessage: object expected");a.invoiceMessage=p.proto.Message.InvoiceMessage.fromObject(e.invoiceMessage)}if(e.buttonsMessage!=null){if(typeof e.buttonsMessage!="object")throw TypeError(".proto.Message.buttonsMessage: object expected");a.buttonsMessage=p.proto.Message.ButtonsMessage.fromObject(e.buttonsMessage)}if(e.buttonsResponseMessage!=null){if(typeof e.buttonsResponseMessage!="object")throw TypeError(".proto.Message.buttonsResponseMessage: object expected");a.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.fromObject(e.buttonsResponseMessage)}if(e.paymentInviteMessage!=null){if(typeof e.paymentInviteMessage!="object")throw TypeError(".proto.Message.paymentInviteMessage: object expected");a.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.fromObject(e.paymentInviteMessage)}if(e.interactiveMessage!=null){if(typeof e.interactiveMessage!="object")throw TypeError(".proto.Message.interactiveMessage: object expected");a.interactiveMessage=p.proto.Message.InteractiveMessage.fromObject(e.interactiveMessage)}if(e.reactionMessage!=null){if(typeof e.reactionMessage!="object")throw TypeError(".proto.Message.reactionMessage: object expected");a.reactionMessage=p.proto.Message.ReactionMessage.fromObject(e.reactionMessage)}if(e.stickerSyncRmrMessage!=null){if(typeof e.stickerSyncRmrMessage!="object")throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected");a.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.fromObject(e.stickerSyncRmrMessage)}if(e.interactiveResponseMessage!=null){if(typeof e.interactiveResponseMessage!="object")throw TypeError(".proto.Message.interactiveResponseMessage: object expected");a.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.fromObject(e.interactiveResponseMessage)}if(e.pollCreationMessage!=null){if(typeof e.pollCreationMessage!="object")throw TypeError(".proto.Message.pollCreationMessage: object expected");a.pollCreationMessage=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessage)}if(e.pollUpdateMessage!=null){if(typeof e.pollUpdateMessage!="object")throw TypeError(".proto.Message.pollUpdateMessage: object expected");a.pollUpdateMessage=p.proto.Message.PollUpdateMessage.fromObject(e.pollUpdateMessage)}if(e.keepInChatMessage!=null){if(typeof e.keepInChatMessage!="object")throw TypeError(".proto.Message.keepInChatMessage: object expected");a.keepInChatMessage=p.proto.Message.KeepInChatMessage.fromObject(e.keepInChatMessage)}if(e.documentWithCaptionMessage!=null){if(typeof e.documentWithCaptionMessage!="object")throw TypeError(".proto.Message.documentWithCaptionMessage: object expected");a.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.fromObject(e.documentWithCaptionMessage)}if(e.requestPhoneNumberMessage!=null){if(typeof e.requestPhoneNumberMessage!="object")throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected");a.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.fromObject(e.requestPhoneNumberMessage)}if(e.viewOnceMessageV2!=null){if(typeof e.viewOnceMessageV2!="object")throw TypeError(".proto.Message.viewOnceMessageV2: object expected");a.viewOnceMessageV2=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2)}if(e.encReactionMessage!=null){if(typeof e.encReactionMessage!="object")throw TypeError(".proto.Message.encReactionMessage: object expected");a.encReactionMessage=p.proto.Message.EncReactionMessage.fromObject(e.encReactionMessage)}if(e.editedMessage!=null){if(typeof e.editedMessage!="object")throw TypeError(".proto.Message.editedMessage: object expected");a.editedMessage=p.proto.Message.FutureProofMessage.fromObject(e.editedMessage)}if(e.viewOnceMessageV2Extension!=null){if(typeof e.viewOnceMessageV2Extension!="object")throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected");a.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2Extension)}if(e.pollCreationMessageV2!=null){if(typeof e.pollCreationMessageV2!="object")throw TypeError(".proto.Message.pollCreationMessageV2: object expected");a.pollCreationMessageV2=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV2)}if(e.scheduledCallCreationMessage!=null){if(typeof e.scheduledCallCreationMessage!="object")throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected");a.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.fromObject(e.scheduledCallCreationMessage)}if(e.groupMentionedMessage!=null){if(typeof e.groupMentionedMessage!="object")throw TypeError(".proto.Message.groupMentionedMessage: object expected");a.groupMentionedMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupMentionedMessage)}if(e.pinInChatMessage!=null){if(typeof e.pinInChatMessage!="object")throw TypeError(".proto.Message.pinInChatMessage: object expected");a.pinInChatMessage=p.proto.Message.PinInChatMessage.fromObject(e.pinInChatMessage)}if(e.pollCreationMessageV3!=null){if(typeof e.pollCreationMessageV3!="object")throw TypeError(".proto.Message.pollCreationMessageV3: object expected");a.pollCreationMessageV3=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV3)}if(e.scheduledCallEditMessage!=null){if(typeof e.scheduledCallEditMessage!="object")throw TypeError(".proto.Message.scheduledCallEditMessage: object expected");a.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.fromObject(e.scheduledCallEditMessage)}if(e.ptvMessage!=null){if(typeof e.ptvMessage!="object")throw TypeError(".proto.Message.ptvMessage: object expected");a.ptvMessage=p.proto.Message.VideoMessage.fromObject(e.ptvMessage)}if(e.botInvokeMessage!=null){if(typeof e.botInvokeMessage!="object")throw TypeError(".proto.Message.botInvokeMessage: object expected");a.botInvokeMessage=p.proto.Message.FutureProofMessage.fromObject(e.botInvokeMessage)}if(e.callLogMesssage!=null){if(typeof e.callLogMesssage!="object")throw TypeError(".proto.Message.callLogMesssage: object expected");a.callLogMesssage=p.proto.Message.CallLogMessage.fromObject(e.callLogMesssage)}if(e.messageHistoryBundle!=null){if(typeof e.messageHistoryBundle!="object")throw TypeError(".proto.Message.messageHistoryBundle: object expected");a.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.fromObject(e.messageHistoryBundle)}if(e.encCommentMessage!=null){if(typeof e.encCommentMessage!="object")throw TypeError(".proto.Message.encCommentMessage: object expected");a.encCommentMessage=p.proto.Message.EncCommentMessage.fromObject(e.encCommentMessage)}if(e.bcallMessage!=null){if(typeof e.bcallMessage!="object")throw TypeError(".proto.Message.bcallMessage: object expected");a.bcallMessage=p.proto.Message.BCallMessage.fromObject(e.bcallMessage)}if(e.lottieStickerMessage!=null){if(typeof e.lottieStickerMessage!="object")throw TypeError(".proto.Message.lottieStickerMessage: object expected");a.lottieStickerMessage=p.proto.Message.FutureProofMessage.fromObject(e.lottieStickerMessage)}if(e.eventMessage!=null){if(typeof e.eventMessage!="object")throw TypeError(".proto.Message.eventMessage: object expected");a.eventMessage=p.proto.Message.EventMessage.fromObject(e.eventMessage)}if(e.encEventResponseMessage!=null){if(typeof e.encEventResponseMessage!="object")throw TypeError(".proto.Message.encEventResponseMessage: object expected");a.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.fromObject(e.encEventResponseMessage)}if(e.commentMessage!=null){if(typeof e.commentMessage!="object")throw TypeError(".proto.Message.commentMessage: object expected");a.commentMessage=p.proto.Message.CommentMessage.fromObject(e.commentMessage)}if(e.newsletterAdminInviteMessage!=null){if(typeof e.newsletterAdminInviteMessage!="object")throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected");a.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.fromObject(e.newsletterAdminInviteMessage)}if(e.placeholderMessage!=null){if(typeof e.placeholderMessage!="object")throw TypeError(".proto.Message.placeholderMessage: object expected");a.placeholderMessage=p.proto.Message.PlaceholderMessage.fromObject(e.placeholderMessage)}if(e.secretEncryptedMessage!=null){if(typeof e.secretEncryptedMessage!="object")throw TypeError(".proto.Message.secretEncryptedMessage: object expected");a.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.fromObject(e.secretEncryptedMessage)}if(e.albumMessage!=null){if(typeof e.albumMessage!="object")throw TypeError(".proto.Message.albumMessage: object expected");a.albumMessage=p.proto.Message.AlbumMessage.fromObject(e.albumMessage)}if(e.eventCoverImage!=null){if(typeof e.eventCoverImage!="object")throw TypeError(".proto.Message.eventCoverImage: object expected");a.eventCoverImage=p.proto.Message.FutureProofMessage.fromObject(e.eventCoverImage)}if(e.stickerPackMessage!=null){if(typeof e.stickerPackMessage!="object")throw TypeError(".proto.Message.stickerPackMessage: object expected");a.stickerPackMessage=p.proto.Message.StickerPackMessage.fromObject(e.stickerPackMessage)}if(e.statusMentionMessage!=null){if(typeof e.statusMentionMessage!="object")throw TypeError(".proto.Message.statusMentionMessage: object expected");a.statusMentionMessage=p.proto.Message.FutureProofMessage.fromObject(e.statusMentionMessage)}if(e.pollResultSnapshotMessage!=null){if(typeof e.pollResultSnapshotMessage!="object")throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected");a.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessage)}if(e.pollCreationOptionImageMessage!=null){if(typeof e.pollCreationOptionImageMessage!="object")throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected");a.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.fromObject(e.pollCreationOptionImageMessage)}if(e.associatedChildMessage!=null){if(typeof e.associatedChildMessage!="object")throw TypeError(".proto.Message.associatedChildMessage: object expected");a.associatedChildMessage=p.proto.Message.FutureProofMessage.fromObject(e.associatedChildMessage)}if(e.groupStatusMentionMessage!=null){if(typeof e.groupStatusMentionMessage!="object")throw TypeError(".proto.Message.groupStatusMentionMessage: object expected");a.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMentionMessage)}if(e.pollCreationMessageV4!=null){if(typeof e.pollCreationMessageV4!="object")throw TypeError(".proto.Message.pollCreationMessageV4: object expected");a.pollCreationMessageV4=p.proto.Message.FutureProofMessage.fromObject(e.pollCreationMessageV4)}if(e.statusAddYours!=null){if(typeof e.statusAddYours!="object")throw TypeError(".proto.Message.statusAddYours: object expected");a.statusAddYours=p.proto.Message.FutureProofMessage.fromObject(e.statusAddYours)}if(e.groupStatusMessage!=null){if(typeof e.groupStatusMessage!="object")throw TypeError(".proto.Message.groupStatusMessage: object expected");a.groupStatusMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessage)}if(e.richResponseMessage!=null){if(typeof e.richResponseMessage!="object")throw TypeError(".proto.Message.richResponseMessage: object expected");a.richResponseMessage=p.proto.AIRichResponseMessage.fromObject(e.richResponseMessage)}if(e.statusNotificationMessage!=null){if(typeof e.statusNotificationMessage!="object")throw TypeError(".proto.Message.statusNotificationMessage: object expected");a.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.fromObject(e.statusNotificationMessage)}if(e.limitSharingMessage!=null){if(typeof e.limitSharingMessage!="object")throw TypeError(".proto.Message.limitSharingMessage: object expected");a.limitSharingMessage=p.proto.Message.FutureProofMessage.fromObject(e.limitSharingMessage)}if(e.botTaskMessage!=null){if(typeof e.botTaskMessage!="object")throw TypeError(".proto.Message.botTaskMessage: object expected");a.botTaskMessage=p.proto.Message.FutureProofMessage.fromObject(e.botTaskMessage)}if(e.questionMessage!=null){if(typeof e.questionMessage!="object")throw TypeError(".proto.Message.questionMessage: object expected");a.questionMessage=p.proto.Message.FutureProofMessage.fromObject(e.questionMessage)}if(e.messageHistoryNotice!=null){if(typeof e.messageHistoryNotice!="object")throw TypeError(".proto.Message.messageHistoryNotice: object expected");a.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.fromObject(e.messageHistoryNotice)}if(e.groupStatusMessageV2!=null){if(typeof e.groupStatusMessageV2!="object")throw TypeError(".proto.Message.groupStatusMessageV2: object expected");a.groupStatusMessageV2=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessageV2)}if(e.botForwardedMessage!=null){if(typeof e.botForwardedMessage!="object")throw TypeError(".proto.Message.botForwardedMessage: object expected");a.botForwardedMessage=p.proto.Message.FutureProofMessage.fromObject(e.botForwardedMessage)}if(e.statusQuestionAnswerMessage!=null){if(typeof e.statusQuestionAnswerMessage!="object")throw TypeError(".proto.Message.statusQuestionAnswerMessage: object expected");a.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.fromObject(e.statusQuestionAnswerMessage)}if(e.questionReplyMessage!=null){if(typeof e.questionReplyMessage!="object")throw TypeError(".proto.Message.questionReplyMessage: object expected");a.questionReplyMessage=p.proto.Message.FutureProofMessage.fromObject(e.questionReplyMessage)}if(e.questionResponseMessage!=null){if(typeof e.questionResponseMessage!="object")throw TypeError(".proto.Message.questionResponseMessage: object expected");a.questionResponseMessage=p.proto.Message.QuestionResponseMessage.fromObject(e.questionResponseMessage)}if(e.statusQuotedMessage!=null){if(typeof e.statusQuotedMessage!="object")throw TypeError(".proto.Message.statusQuotedMessage: object expected");a.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.fromObject(e.statusQuotedMessage)}if(e.statusStickerInteractionMessage!=null){if(typeof e.statusStickerInteractionMessage!="object")throw TypeError(".proto.Message.statusStickerInteractionMessage: object expected");a.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.fromObject(e.statusStickerInteractionMessage)}if(e.pollCreationMessageV5!=null){if(typeof e.pollCreationMessageV5!="object")throw TypeError(".proto.Message.pollCreationMessageV5: object expected");a.pollCreationMessageV5=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV5)}if(e.newsletterFollowerInviteMessageV2!=null){if(typeof e.newsletterFollowerInviteMessageV2!="object")throw TypeError(".proto.Message.newsletterFollowerInviteMessageV2: object expected");a.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.fromObject(e.newsletterFollowerInviteMessageV2)}if(e.pollResultSnapshotMessageV3!=null){if(typeof e.pollResultSnapshotMessageV3!="object")throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");a.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessageV3)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.conversation!=null&&e.hasOwnProperty("conversation")&&(A.conversation=e.conversation,a.oneofs&&(A._conversation="conversation")),e.senderKeyDistributionMessage!=null&&e.hasOwnProperty("senderKeyDistributionMessage")&&(A.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.toObject(e.senderKeyDistributionMessage,a),a.oneofs&&(A._senderKeyDistributionMessage="senderKeyDistributionMessage")),e.imageMessage!=null&&e.hasOwnProperty("imageMessage")&&(A.imageMessage=p.proto.Message.ImageMessage.toObject(e.imageMessage,a),a.oneofs&&(A._imageMessage="imageMessage")),e.contactMessage!=null&&e.hasOwnProperty("contactMessage")&&(A.contactMessage=p.proto.Message.ContactMessage.toObject(e.contactMessage,a),a.oneofs&&(A._contactMessage="contactMessage")),e.locationMessage!=null&&e.hasOwnProperty("locationMessage")&&(A.locationMessage=p.proto.Message.LocationMessage.toObject(e.locationMessage,a),a.oneofs&&(A._locationMessage="locationMessage")),e.extendedTextMessage!=null&&e.hasOwnProperty("extendedTextMessage")&&(A.extendedTextMessage=p.proto.Message.ExtendedTextMessage.toObject(e.extendedTextMessage,a),a.oneofs&&(A._extendedTextMessage="extendedTextMessage")),e.documentMessage!=null&&e.hasOwnProperty("documentMessage")&&(A.documentMessage=p.proto.Message.DocumentMessage.toObject(e.documentMessage,a),a.oneofs&&(A._documentMessage="documentMessage")),e.audioMessage!=null&&e.hasOwnProperty("audioMessage")&&(A.audioMessage=p.proto.Message.AudioMessage.toObject(e.audioMessage,a),a.oneofs&&(A._audioMessage="audioMessage")),e.videoMessage!=null&&e.hasOwnProperty("videoMessage")&&(A.videoMessage=p.proto.Message.VideoMessage.toObject(e.videoMessage,a),a.oneofs&&(A._videoMessage="videoMessage")),e.call!=null&&e.hasOwnProperty("call")&&(A.call=p.proto.Message.Call.toObject(e.call,a),a.oneofs&&(A._call="call")),e.chat!=null&&e.hasOwnProperty("chat")&&(A.chat=p.proto.Message.Chat.toObject(e.chat,a),a.oneofs&&(A._chat="chat")),e.protocolMessage!=null&&e.hasOwnProperty("protocolMessage")&&(A.protocolMessage=p.proto.Message.ProtocolMessage.toObject(e.protocolMessage,a),a.oneofs&&(A._protocolMessage="protocolMessage")),e.contactsArrayMessage!=null&&e.hasOwnProperty("contactsArrayMessage")&&(A.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.toObject(e.contactsArrayMessage,a),a.oneofs&&(A._contactsArrayMessage="contactsArrayMessage")),e.highlyStructuredMessage!=null&&e.hasOwnProperty("highlyStructuredMessage")&&(A.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.toObject(e.highlyStructuredMessage,a),a.oneofs&&(A._highlyStructuredMessage="highlyStructuredMessage")),e.fastRatchetKeySenderKeyDistributionMessage!=null&&e.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")&&(A.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.toObject(e.fastRatchetKeySenderKeyDistributionMessage,a),a.oneofs&&(A._fastRatchetKeySenderKeyDistributionMessage="fastRatchetKeySenderKeyDistributionMessage")),e.sendPaymentMessage!=null&&e.hasOwnProperty("sendPaymentMessage")&&(A.sendPaymentMessage=p.proto.Message.SendPaymentMessage.toObject(e.sendPaymentMessage,a),a.oneofs&&(A._sendPaymentMessage="sendPaymentMessage")),e.liveLocationMessage!=null&&e.hasOwnProperty("liveLocationMessage")&&(A.liveLocationMessage=p.proto.Message.LiveLocationMessage.toObject(e.liveLocationMessage,a),a.oneofs&&(A._liveLocationMessage="liveLocationMessage")),e.requestPaymentMessage!=null&&e.hasOwnProperty("requestPaymentMessage")&&(A.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.toObject(e.requestPaymentMessage,a),a.oneofs&&(A._requestPaymentMessage="requestPaymentMessage")),e.declinePaymentRequestMessage!=null&&e.hasOwnProperty("declinePaymentRequestMessage")&&(A.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.toObject(e.declinePaymentRequestMessage,a),a.oneofs&&(A._declinePaymentRequestMessage="declinePaymentRequestMessage")),e.cancelPaymentRequestMessage!=null&&e.hasOwnProperty("cancelPaymentRequestMessage")&&(A.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.toObject(e.cancelPaymentRequestMessage,a),a.oneofs&&(A._cancelPaymentRequestMessage="cancelPaymentRequestMessage")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=p.proto.Message.TemplateMessage.toObject(e.templateMessage,a),a.oneofs&&(A._templateMessage="templateMessage")),e.stickerMessage!=null&&e.hasOwnProperty("stickerMessage")&&(A.stickerMessage=p.proto.Message.StickerMessage.toObject(e.stickerMessage,a),a.oneofs&&(A._stickerMessage="stickerMessage")),e.groupInviteMessage!=null&&e.hasOwnProperty("groupInviteMessage")&&(A.groupInviteMessage=p.proto.Message.GroupInviteMessage.toObject(e.groupInviteMessage,a),a.oneofs&&(A._groupInviteMessage="groupInviteMessage")),e.templateButtonReplyMessage!=null&&e.hasOwnProperty("templateButtonReplyMessage")&&(A.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.toObject(e.templateButtonReplyMessage,a),a.oneofs&&(A._templateButtonReplyMessage="templateButtonReplyMessage")),e.productMessage!=null&&e.hasOwnProperty("productMessage")&&(A.productMessage=p.proto.Message.ProductMessage.toObject(e.productMessage,a),a.oneofs&&(A._productMessage="productMessage")),e.deviceSentMessage!=null&&e.hasOwnProperty("deviceSentMessage")&&(A.deviceSentMessage=p.proto.Message.DeviceSentMessage.toObject(e.deviceSentMessage,a),a.oneofs&&(A._deviceSentMessage="deviceSentMessage")),e.messageContextInfo!=null&&e.hasOwnProperty("messageContextInfo")&&(A.messageContextInfo=p.proto.MessageContextInfo.toObject(e.messageContextInfo,a),a.oneofs&&(A._messageContextInfo="messageContextInfo")),e.listMessage!=null&&e.hasOwnProperty("listMessage")&&(A.listMessage=p.proto.Message.ListMessage.toObject(e.listMessage,a),a.oneofs&&(A._listMessage="listMessage")),e.viewOnceMessage!=null&&e.hasOwnProperty("viewOnceMessage")&&(A.viewOnceMessage=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessage,a),a.oneofs&&(A._viewOnceMessage="viewOnceMessage")),e.orderMessage!=null&&e.hasOwnProperty("orderMessage")&&(A.orderMessage=p.proto.Message.OrderMessage.toObject(e.orderMessage,a),a.oneofs&&(A._orderMessage="orderMessage")),e.listResponseMessage!=null&&e.hasOwnProperty("listResponseMessage")&&(A.listResponseMessage=p.proto.Message.ListResponseMessage.toObject(e.listResponseMessage,a),a.oneofs&&(A._listResponseMessage="listResponseMessage")),e.ephemeralMessage!=null&&e.hasOwnProperty("ephemeralMessage")&&(A.ephemeralMessage=p.proto.Message.FutureProofMessage.toObject(e.ephemeralMessage,a),a.oneofs&&(A._ephemeralMessage="ephemeralMessage")),e.invoiceMessage!=null&&e.hasOwnProperty("invoiceMessage")&&(A.invoiceMessage=p.proto.Message.InvoiceMessage.toObject(e.invoiceMessage,a),a.oneofs&&(A._invoiceMessage="invoiceMessage")),e.buttonsMessage!=null&&e.hasOwnProperty("buttonsMessage")&&(A.buttonsMessage=p.proto.Message.ButtonsMessage.toObject(e.buttonsMessage,a),a.oneofs&&(A._buttonsMessage="buttonsMessage")),e.buttonsResponseMessage!=null&&e.hasOwnProperty("buttonsResponseMessage")&&(A.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.toObject(e.buttonsResponseMessage,a),a.oneofs&&(A._buttonsResponseMessage="buttonsResponseMessage")),e.paymentInviteMessage!=null&&e.hasOwnProperty("paymentInviteMessage")&&(A.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.toObject(e.paymentInviteMessage,a),a.oneofs&&(A._paymentInviteMessage="paymentInviteMessage")),e.interactiveMessage!=null&&e.hasOwnProperty("interactiveMessage")&&(A.interactiveMessage=p.proto.Message.InteractiveMessage.toObject(e.interactiveMessage,a),a.oneofs&&(A._interactiveMessage="interactiveMessage")),e.reactionMessage!=null&&e.hasOwnProperty("reactionMessage")&&(A.reactionMessage=p.proto.Message.ReactionMessage.toObject(e.reactionMessage,a),a.oneofs&&(A._reactionMessage="reactionMessage")),e.stickerSyncRmrMessage!=null&&e.hasOwnProperty("stickerSyncRmrMessage")&&(A.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.toObject(e.stickerSyncRmrMessage,a),a.oneofs&&(A._stickerSyncRmrMessage="stickerSyncRmrMessage")),e.interactiveResponseMessage!=null&&e.hasOwnProperty("interactiveResponseMessage")&&(A.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.toObject(e.interactiveResponseMessage,a),a.oneofs&&(A._interactiveResponseMessage="interactiveResponseMessage")),e.pollCreationMessage!=null&&e.hasOwnProperty("pollCreationMessage")&&(A.pollCreationMessage=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessage,a),a.oneofs&&(A._pollCreationMessage="pollCreationMessage")),e.pollUpdateMessage!=null&&e.hasOwnProperty("pollUpdateMessage")&&(A.pollUpdateMessage=p.proto.Message.PollUpdateMessage.toObject(e.pollUpdateMessage,a),a.oneofs&&(A._pollUpdateMessage="pollUpdateMessage")),e.keepInChatMessage!=null&&e.hasOwnProperty("keepInChatMessage")&&(A.keepInChatMessage=p.proto.Message.KeepInChatMessage.toObject(e.keepInChatMessage,a),a.oneofs&&(A._keepInChatMessage="keepInChatMessage")),e.documentWithCaptionMessage!=null&&e.hasOwnProperty("documentWithCaptionMessage")&&(A.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.toObject(e.documentWithCaptionMessage,a),a.oneofs&&(A._documentWithCaptionMessage="documentWithCaptionMessage")),e.requestPhoneNumberMessage!=null&&e.hasOwnProperty("requestPhoneNumberMessage")&&(A.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.toObject(e.requestPhoneNumberMessage,a),a.oneofs&&(A._requestPhoneNumberMessage="requestPhoneNumberMessage")),e.viewOnceMessageV2!=null&&e.hasOwnProperty("viewOnceMessageV2")&&(A.viewOnceMessageV2=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2,a),a.oneofs&&(A._viewOnceMessageV2="viewOnceMessageV2")),e.encReactionMessage!=null&&e.hasOwnProperty("encReactionMessage")&&(A.encReactionMessage=p.proto.Message.EncReactionMessage.toObject(e.encReactionMessage,a),a.oneofs&&(A._encReactionMessage="encReactionMessage")),e.editedMessage!=null&&e.hasOwnProperty("editedMessage")&&(A.editedMessage=p.proto.Message.FutureProofMessage.toObject(e.editedMessage,a),a.oneofs&&(A._editedMessage="editedMessage")),e.viewOnceMessageV2Extension!=null&&e.hasOwnProperty("viewOnceMessageV2Extension")&&(A.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2Extension,a),a.oneofs&&(A._viewOnceMessageV2Extension="viewOnceMessageV2Extension")),e.pollCreationMessageV2!=null&&e.hasOwnProperty("pollCreationMessageV2")&&(A.pollCreationMessageV2=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV2,a),a.oneofs&&(A._pollCreationMessageV2="pollCreationMessageV2")),e.scheduledCallCreationMessage!=null&&e.hasOwnProperty("scheduledCallCreationMessage")&&(A.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.toObject(e.scheduledCallCreationMessage,a),a.oneofs&&(A._scheduledCallCreationMessage="scheduledCallCreationMessage")),e.groupMentionedMessage!=null&&e.hasOwnProperty("groupMentionedMessage")&&(A.groupMentionedMessage=p.proto.Message.FutureProofMessage.toObject(e.groupMentionedMessage,a),a.oneofs&&(A._groupMentionedMessage="groupMentionedMessage")),e.pinInChatMessage!=null&&e.hasOwnProperty("pinInChatMessage")&&(A.pinInChatMessage=p.proto.Message.PinInChatMessage.toObject(e.pinInChatMessage,a),a.oneofs&&(A._pinInChatMessage="pinInChatMessage")),e.pollCreationMessageV3!=null&&e.hasOwnProperty("pollCreationMessageV3")&&(A.pollCreationMessageV3=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV3,a),a.oneofs&&(A._pollCreationMessageV3="pollCreationMessageV3")),e.scheduledCallEditMessage!=null&&e.hasOwnProperty("scheduledCallEditMessage")&&(A.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.toObject(e.scheduledCallEditMessage,a),a.oneofs&&(A._scheduledCallEditMessage="scheduledCallEditMessage")),e.ptvMessage!=null&&e.hasOwnProperty("ptvMessage")&&(A.ptvMessage=p.proto.Message.VideoMessage.toObject(e.ptvMessage,a),a.oneofs&&(A._ptvMessage="ptvMessage")),e.botInvokeMessage!=null&&e.hasOwnProperty("botInvokeMessage")&&(A.botInvokeMessage=p.proto.Message.FutureProofMessage.toObject(e.botInvokeMessage,a),a.oneofs&&(A._botInvokeMessage="botInvokeMessage")),e.callLogMesssage!=null&&e.hasOwnProperty("callLogMesssage")&&(A.callLogMesssage=p.proto.Message.CallLogMessage.toObject(e.callLogMesssage,a),a.oneofs&&(A._callLogMesssage="callLogMesssage")),e.messageHistoryBundle!=null&&e.hasOwnProperty("messageHistoryBundle")&&(A.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.toObject(e.messageHistoryBundle,a),a.oneofs&&(A._messageHistoryBundle="messageHistoryBundle")),e.encCommentMessage!=null&&e.hasOwnProperty("encCommentMessage")&&(A.encCommentMessage=p.proto.Message.EncCommentMessage.toObject(e.encCommentMessage,a),a.oneofs&&(A._encCommentMessage="encCommentMessage")),e.bcallMessage!=null&&e.hasOwnProperty("bcallMessage")&&(A.bcallMessage=p.proto.Message.BCallMessage.toObject(e.bcallMessage,a),a.oneofs&&(A._bcallMessage="bcallMessage")),e.lottieStickerMessage!=null&&e.hasOwnProperty("lottieStickerMessage")&&(A.lottieStickerMessage=p.proto.Message.FutureProofMessage.toObject(e.lottieStickerMessage,a),a.oneofs&&(A._lottieStickerMessage="lottieStickerMessage")),e.eventMessage!=null&&e.hasOwnProperty("eventMessage")&&(A.eventMessage=p.proto.Message.EventMessage.toObject(e.eventMessage,a),a.oneofs&&(A._eventMessage="eventMessage")),e.encEventResponseMessage!=null&&e.hasOwnProperty("encEventResponseMessage")&&(A.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.toObject(e.encEventResponseMessage,a),a.oneofs&&(A._encEventResponseMessage="encEventResponseMessage")),e.commentMessage!=null&&e.hasOwnProperty("commentMessage")&&(A.commentMessage=p.proto.Message.CommentMessage.toObject(e.commentMessage,a),a.oneofs&&(A._commentMessage="commentMessage")),e.newsletterAdminInviteMessage!=null&&e.hasOwnProperty("newsletterAdminInviteMessage")&&(A.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.toObject(e.newsletterAdminInviteMessage,a),a.oneofs&&(A._newsletterAdminInviteMessage="newsletterAdminInviteMessage")),e.placeholderMessage!=null&&e.hasOwnProperty("placeholderMessage")&&(A.placeholderMessage=p.proto.Message.PlaceholderMessage.toObject(e.placeholderMessage,a),a.oneofs&&(A._placeholderMessage="placeholderMessage")),e.secretEncryptedMessage!=null&&e.hasOwnProperty("secretEncryptedMessage")&&(A.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.toObject(e.secretEncryptedMessage,a),a.oneofs&&(A._secretEncryptedMessage="secretEncryptedMessage")),e.albumMessage!=null&&e.hasOwnProperty("albumMessage")&&(A.albumMessage=p.proto.Message.AlbumMessage.toObject(e.albumMessage,a),a.oneofs&&(A._albumMessage="albumMessage")),e.eventCoverImage!=null&&e.hasOwnProperty("eventCoverImage")&&(A.eventCoverImage=p.proto.Message.FutureProofMessage.toObject(e.eventCoverImage,a),a.oneofs&&(A._eventCoverImage="eventCoverImage")),e.stickerPackMessage!=null&&e.hasOwnProperty("stickerPackMessage")&&(A.stickerPackMessage=p.proto.Message.StickerPackMessage.toObject(e.stickerPackMessage,a),a.oneofs&&(A._stickerPackMessage="stickerPackMessage")),e.statusMentionMessage!=null&&e.hasOwnProperty("statusMentionMessage")&&(A.statusMentionMessage=p.proto.Message.FutureProofMessage.toObject(e.statusMentionMessage,a),a.oneofs&&(A._statusMentionMessage="statusMentionMessage")),e.pollResultSnapshotMessage!=null&&e.hasOwnProperty("pollResultSnapshotMessage")&&(A.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessage,a),a.oneofs&&(A._pollResultSnapshotMessage="pollResultSnapshotMessage")),e.pollCreationOptionImageMessage!=null&&e.hasOwnProperty("pollCreationOptionImageMessage")&&(A.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.toObject(e.pollCreationOptionImageMessage,a),a.oneofs&&(A._pollCreationOptionImageMessage="pollCreationOptionImageMessage")),e.associatedChildMessage!=null&&e.hasOwnProperty("associatedChildMessage")&&(A.associatedChildMessage=p.proto.Message.FutureProofMessage.toObject(e.associatedChildMessage,a),a.oneofs&&(A._associatedChildMessage="associatedChildMessage")),e.groupStatusMentionMessage!=null&&e.hasOwnProperty("groupStatusMentionMessage")&&(A.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMentionMessage,a),a.oneofs&&(A._groupStatusMentionMessage="groupStatusMentionMessage")),e.pollCreationMessageV4!=null&&e.hasOwnProperty("pollCreationMessageV4")&&(A.pollCreationMessageV4=p.proto.Message.FutureProofMessage.toObject(e.pollCreationMessageV4,a),a.oneofs&&(A._pollCreationMessageV4="pollCreationMessageV4")),e.statusAddYours!=null&&e.hasOwnProperty("statusAddYours")&&(A.statusAddYours=p.proto.Message.FutureProofMessage.toObject(e.statusAddYours,a),a.oneofs&&(A._statusAddYours="statusAddYours")),e.groupStatusMessage!=null&&e.hasOwnProperty("groupStatusMessage")&&(A.groupStatusMessage=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMessage,a),a.oneofs&&(A._groupStatusMessage="groupStatusMessage")),e.richResponseMessage!=null&&e.hasOwnProperty("richResponseMessage")&&(A.richResponseMessage=p.proto.AIRichResponseMessage.toObject(e.richResponseMessage,a),a.oneofs&&(A._richResponseMessage="richResponseMessage")),e.statusNotificationMessage!=null&&e.hasOwnProperty("statusNotificationMessage")&&(A.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.toObject(e.statusNotificationMessage,a),a.oneofs&&(A._statusNotificationMessage="statusNotificationMessage")),e.limitSharingMessage!=null&&e.hasOwnProperty("limitSharingMessage")&&(A.limitSharingMessage=p.proto.Message.FutureProofMessage.toObject(e.limitSharingMessage,a),a.oneofs&&(A._limitSharingMessage="limitSharingMessage")),e.botTaskMessage!=null&&e.hasOwnProperty("botTaskMessage")&&(A.botTaskMessage=p.proto.Message.FutureProofMessage.toObject(e.botTaskMessage,a),a.oneofs&&(A._botTaskMessage="botTaskMessage")),e.questionMessage!=null&&e.hasOwnProperty("questionMessage")&&(A.questionMessage=p.proto.Message.FutureProofMessage.toObject(e.questionMessage,a),a.oneofs&&(A._questionMessage="questionMessage")),e.messageHistoryNotice!=null&&e.hasOwnProperty("messageHistoryNotice")&&(A.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.toObject(e.messageHistoryNotice,a),a.oneofs&&(A._messageHistoryNotice="messageHistoryNotice")),e.groupStatusMessageV2!=null&&e.hasOwnProperty("groupStatusMessageV2")&&(A.groupStatusMessageV2=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMessageV2,a),a.oneofs&&(A._groupStatusMessageV2="groupStatusMessageV2")),e.botForwardedMessage!=null&&e.hasOwnProperty("botForwardedMessage")&&(A.botForwardedMessage=p.proto.Message.FutureProofMessage.toObject(e.botForwardedMessage,a),a.oneofs&&(A._botForwardedMessage="botForwardedMessage")),e.statusQuestionAnswerMessage!=null&&e.hasOwnProperty("statusQuestionAnswerMessage")&&(A.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.toObject(e.statusQuestionAnswerMessage,a),a.oneofs&&(A._statusQuestionAnswerMessage="statusQuestionAnswerMessage")),e.questionReplyMessage!=null&&e.hasOwnProperty("questionReplyMessage")&&(A.questionReplyMessage=p.proto.Message.FutureProofMessage.toObject(e.questionReplyMessage,a),a.oneofs&&(A._questionReplyMessage="questionReplyMessage")),e.questionResponseMessage!=null&&e.hasOwnProperty("questionResponseMessage")&&(A.questionResponseMessage=p.proto.Message.QuestionResponseMessage.toObject(e.questionResponseMessage,a),a.oneofs&&(A._questionResponseMessage="questionResponseMessage")),e.statusQuotedMessage!=null&&e.hasOwnProperty("statusQuotedMessage")&&(A.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.toObject(e.statusQuotedMessage,a),a.oneofs&&(A._statusQuotedMessage="statusQuotedMessage")),e.statusStickerInteractionMessage!=null&&e.hasOwnProperty("statusStickerInteractionMessage")&&(A.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.toObject(e.statusStickerInteractionMessage,a),a.oneofs&&(A._statusStickerInteractionMessage="statusStickerInteractionMessage")),e.pollCreationMessageV5!=null&&e.hasOwnProperty("pollCreationMessageV5")&&(A.pollCreationMessageV5=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV5,a),a.oneofs&&(A._pollCreationMessageV5="pollCreationMessageV5")),e.newsletterFollowerInviteMessageV2!=null&&e.hasOwnProperty("newsletterFollowerInviteMessageV2")&&(A.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.toObject(e.newsletterFollowerInviteMessageV2,a),a.oneofs&&(A._newsletterFollowerInviteMessageV2="newsletterFollowerInviteMessageV2")),e.pollResultSnapshotMessageV3!=null&&e.hasOwnProperty("pollResultSnapshotMessageV3")&&(A.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessageV3,a),a.oneofs&&(A._pollResultSnapshotMessageV3="pollResultSnapshotMessageV3")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Message"},t.AlbumMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 2:{c.expectedImageCount=A.uint32();break}case 3:{c.expectedVideoCount=A.uint32();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AlbumMessage)return A;var r=new p.proto.Message.AlbumMessage;if(A.expectedImageCount!=null&&(r.expectedImageCount=A.expectedImageCount>>>0),A.expectedVideoCount!=null&&(r.expectedVideoCount=A.expectedVideoCount>>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.expectedImageCount!=null&&A.hasOwnProperty("expectedImageCount")&&(s.expectedImageCount=A.expectedImageCount,r.oneofs&&(s._expectedImageCount="expectedImageCount")),A.expectedVideoCount!=null&&A.hasOwnProperty("expectedVideoCount")&&(s.expectedVideoCount=A.expectedVideoCount,r.oneofs&&(s._expectedVideoCount="expectedVideoCount")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AlbumMessage"},i})(),t.AppStateFatalExceptionNotification=(function(){function i(a){if(this.collectionNames=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.collectionNames&&c.collectionNames.length||(c.collectionNames=[]),c.collectionNames.push(A.string());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateFatalExceptionNotification)return A;var r=new p.proto.Message.AppStateFatalExceptionNotification;if(A.collectionNames){if(!Array.isArray(A.collectionNames))throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected");r.collectionNames=[];for(var s=0;s>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.collectionNames=[]),A.collectionNames&&A.collectionNames.length){s.collectionNames=[];for(var g=0;g>>3){case 1:{c.keyId=p.proto.Message.AppStateSyncKeyId.decode(A,A.uint32());break}case 2:{c.keyData=p.proto.Message.AppStateSyncKeyData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKey)return A;var r=new p.proto.Message.AppStateSyncKey;if(A.keyId!=null){if(typeof A.keyId!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected");r.keyId=p.proto.Message.AppStateSyncKeyId.fromObject(A.keyId)}if(A.keyData!=null){if(typeof A.keyData!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected");r.keyData=p.proto.Message.AppStateSyncKeyData.fromObject(A.keyData)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=p.proto.Message.AppStateSyncKeyId.toObject(A.keyId,r),r.oneofs&&(s._keyId="keyId")),A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=p.proto.Message.AppStateSyncKeyData.toObject(A.keyData,r),r.oneofs&&(s._keyData="keyData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKey"},i})(),t.AppStateSyncKeyData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.keyData=A.bytes();break}case 2:{c.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.decode(A,A.uint32());break}case 3:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKeyData)return A;var r=new p.proto.Message.AppStateSyncKeyData;if(A.keyData!=null&&(typeof A.keyData=="string"?l.base64.decode(A.keyData,r.keyData=l.newBuffer(l.base64.length(A.keyData)),0):A.keyData.length>=0&&(r.keyData=A.keyData)),A.fingerprint!=null){if(typeof A.fingerprint!="object")throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected");r.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.fromObject(A.fingerprint)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=r.bytes===String?l.base64.encode(A.keyData,0,A.keyData.length):r.bytes===Array?Array.prototype.slice.call(A.keyData):A.keyData,r.oneofs&&(s._keyData="keyData")),A.fingerprint!=null&&A.hasOwnProperty("fingerprint")&&(s.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.toObject(A.fingerprint,r),r.oneofs&&(s._fingerprint="fingerprint")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyData"},i})(),t.AppStateSyncKeyFingerprint=(function(){function i(a){if(this.deviceIndexes=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.rawId=A.uint32();break}case 2:{c.currentIndex=A.uint32();break}case 3:{if(c.deviceIndexes&&c.deviceIndexes.length||(c.deviceIndexes=[]),(I&7)===2)for(var d=A.uint32()+A.pos;A.pos>>0),A.currentIndex!=null&&(r.currentIndex=A.currentIndex>>>0),A.deviceIndexes){if(!Array.isArray(A.deviceIndexes))throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected");r.deviceIndexes=[];for(var s=0;s>>0}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.deviceIndexes=[]),A.rawId!=null&&A.hasOwnProperty("rawId")&&(s.rawId=A.rawId,r.oneofs&&(s._rawId="rawId")),A.currentIndex!=null&&A.hasOwnProperty("currentIndex")&&(s.currentIndex=A.currentIndex,r.oneofs&&(s._currentIndex="currentIndex")),A.deviceIndexes&&A.deviceIndexes.length){s.deviceIndexes=[];for(var g=0;g>>3){case 1:{c.keyId=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKeyId)return A;var r=new p.proto.Message.AppStateSyncKeyId;return A.keyId!=null&&(typeof A.keyId=="string"?l.base64.decode(A.keyId,r.keyId=l.newBuffer(l.base64.length(A.keyId)),0):A.keyId.length>=0&&(r.keyId=A.keyId)),r},i.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=r.bytes===String?l.base64.encode(A.keyId,0,A.keyId.length):r.bytes===Array?Array.prototype.slice.call(A.keyId):A.keyId,r.oneofs&&(s._keyId="keyId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyId"},i})(),t.AppStateSyncKeyRequest=(function(){function i(e){if(this.keyIds=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.keyIds&&g.keyIds.length||(g.keyIds=[]),g.keyIds.push(p.proto.Message.AppStateSyncKeyId.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.AppStateSyncKeyRequest)return a;var A=new p.proto.Message.AppStateSyncKeyRequest;if(a.keyIds){if(!Array.isArray(a.keyIds))throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected");A.keyIds=[];for(var r=0;r>>3){case 1:{g.keys&&g.keys.length||(g.keys=[]),g.keys.push(p.proto.Message.AppStateSyncKey.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.AppStateSyncKeyShare)return a;var A=new p.proto.Message.AppStateSyncKeyShare;if(a.keys){if(!Array.isArray(a.keys))throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected");A.keys=[];for(var r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.ptt=A.bool();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileEncSha256=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.waveform=A.bytes();break}case 20:{c.backgroundArgb=A.fixed32();break}case 21:{c.viewOnce=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AudioMessage)return A;var r=new p.proto.Message.AudioMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.ptt!=null&&(r.ptt=!!A.ptt),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.waveform!=null&&(typeof A.waveform=="string"?l.base64.decode(A.waveform,r.waveform=l.newBuffer(l.base64.length(A.waveform)),0):A.waveform.length>=0&&(r.waveform=A.waveform)),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.ptt!=null&&A.hasOwnProperty("ptt")&&(s.ptt=A.ptt,r.oneofs&&(s._ptt="ptt")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.streamingSidecar!=null&&A.hasOwnProperty("streamingSidecar")&&(s.streamingSidecar=r.bytes===String?l.base64.encode(A.streamingSidecar,0,A.streamingSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.streamingSidecar):A.streamingSidecar,r.oneofs&&(s._streamingSidecar="streamingSidecar")),A.waveform!=null&&A.hasOwnProperty("waveform")&&(s.waveform=r.bytes===String?l.base64.encode(A.waveform,0,A.waveform.length):r.bytes===Array?Array.prototype.slice.call(A.waveform):A.waveform,r.oneofs&&(s._waveform="waveform")),A.backgroundArgb!=null&&A.hasOwnProperty("backgroundArgb")&&(s.backgroundArgb=A.backgroundArgb,r.oneofs&&(s._backgroundArgb="backgroundArgb")),A.viewOnce!=null&&A.hasOwnProperty("viewOnce")&&(s.viewOnce=A.viewOnce,r.oneofs&&(s._viewOnce="viewOnce")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AudioMessage"},i})(),t.BCallMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.sessionId=A.string();break}case 2:{c.mediaType=A.int32();break}case 3:{c.masterKey=A.bytes();break}case 4:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.BCallMessage)return A;var r=new p.proto.Message.BCallMessage;switch(A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"UNKNOWN":case 0:r.mediaType=0;break;case"AUDIO":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.masterKey!=null&&(typeof A.masterKey=="string"?l.base64.decode(A.masterKey,r.masterKey=l.newBuffer(l.base64.length(A.masterKey)),0):A.masterKey.length>=0&&(r.masterKey=A.masterKey)),A.caption!=null&&(r.caption=String(A.caption)),r},i.toObject=function(A,r){r||(r={});var s={};return A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?p.proto.Message.BCallMessage.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.Message.BCallMessage.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.masterKey!=null&&A.hasOwnProperty("masterKey")&&(s.masterKey=r.bytes===String?l.base64.encode(A.masterKey,0,A.masterKey.length):r.bytes===Array?Array.prototype.slice.call(A.masterKey):A.masterKey,r.oneofs&&(s._masterKey="masterKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.BCallMessage"},i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="AUDIO"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.ButtonsMessage=(function(){function i(a){if(this.buttons=[],a)for(var A=Object.keys(a),r=0;r>>3){case 6:{c.contentText=A.string();break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 9:{c.buttons&&c.buttons.length||(c.buttons=[]),c.buttons.push(p.proto.Message.ButtonsMessage.Button.decode(A,A.uint32()));break}case 10:{c.headerType=A.int32();break}case 1:{c.text=A.string();break}case 2:{c.documentMessage=p.proto.Message.DocumentMessage.decode(A,A.uint32());break}case 3:{c.imageMessage=p.proto.Message.ImageMessage.decode(A,A.uint32());break}case 4:{c.videoMessage=p.proto.Message.VideoMessage.decode(A,A.uint32());break}case 5:{c.locationMessage=p.proto.Message.LocationMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ButtonsMessage)return A;var r=new p.proto.Message.ButtonsMessage;if(A.contentText!=null&&(r.contentText=String(A.contentText)),A.footerText!=null&&(r.footerText=String(A.footerText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.buttons){if(!Array.isArray(A.buttons))throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected");r.buttons=[];for(var s=0;s>>3){case 1:{d.buttonId=s.string();break}case 2:{d.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.decode(s,s.uint32());break}case 3:{d.type=s.int32();break}case 4:{d.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ButtonsMessage.Button)return s;var g=new p.proto.Message.ButtonsMessage.Button;if(s.buttonId!=null&&(g.buttonId=String(s.buttonId)),s.buttonText!=null){if(typeof s.buttonText!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected");g.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(s.buttonText)}switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"UNKNOWN":case 0:g.type=0;break;case"RESPONSE":case 1:g.type=1;break;case"NATIVE_FLOW":case 2:g.type=2;break}if(s.nativeFlowInfo!=null){if(typeof s.nativeFlowInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected");g.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(s.nativeFlowInfo)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.buttonId!=null&&s.hasOwnProperty("buttonId")&&(c.buttonId=s.buttonId,g.oneofs&&(c._buttonId="buttonId")),s.buttonText!=null&&s.hasOwnProperty("buttonText")&&(c.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.toObject(s.buttonText,g),g.oneofs&&(c._buttonText="buttonText")),s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?p.proto.Message.ButtonsMessage.Button.Type[s.type]===void 0?s.type:p.proto.Message.ButtonsMessage.Button.Type[s.type]:s.type,g.oneofs&&(c._type="type")),s.nativeFlowInfo!=null&&s.hasOwnProperty("nativeFlowInfo")&&(c.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(s.nativeFlowInfo,g),g.oneofs&&(c._nativeFlowInfo="nativeFlowInfo")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ButtonsMessage.Button"},a.ButtonText=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.displayText=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.ButtonsMessage.Button.ButtonText)return c;var I=new p.proto.Message.ButtonsMessage.Button.ButtonText;return c.displayText!=null&&(I.displayText=String(c.displayText)),I},r.toObject=function(c,I){I||(I={});var d={};return c.displayText!=null&&c.hasOwnProperty("displayText")&&(d.displayText=c.displayText,I.oneofs&&(d._displayText="displayText")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.ButtonText"},r})(),a.NativeFlowInfo=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.name=c.string();break}case 2:{f.paramsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.ButtonsMessage.Button.NativeFlowInfo)return c;var I=new p.proto.Message.ButtonsMessage.Button.NativeFlowInfo;return c.name!=null&&(I.name=String(c.name)),c.paramsJson!=null&&(I.paramsJson=String(c.paramsJson)),I},r.toObject=function(c,I){I||(I={});var d={};return c.name!=null&&c.hasOwnProperty("name")&&(d.name=c.name,I.oneofs&&(d._name="name")),c.paramsJson!=null&&c.hasOwnProperty("paramsJson")&&(d.paramsJson=c.paramsJson,I.oneofs&&(d._paramsJson="paramsJson")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.NativeFlowInfo"},r})(),a.Type=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="RESPONSE"]=1,s[r[2]="NATIVE_FLOW"]=2,s})(),a})(),i.HeaderType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="EMPTY"]=1,A[a[2]="TEXT"]=2,A[a[3]="DOCUMENT"]=3,A[a[4]="IMAGE"]=4,A[a[5]="VIDEO"]=5,A[a[6]="LOCATION"]=6,A})(),i})(),t.ButtonsResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.selectedButtonId=A.string();break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.type=A.int32();break}case 2:{c.selectedDisplayText=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ButtonsResponseMessage)return A;var r=new p.proto.Message.ButtonsResponseMessage;if(A.selectedButtonId!=null&&(r.selectedButtonId=String(A.selectedButtonId)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DISPLAY_TEXT":case 1:r.type=1;break}return A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),r},i.toObject=function(A,r){r||(r={});var s={};return A.selectedButtonId!=null&&A.hasOwnProperty("selectedButtonId")&&(s.selectedButtonId=A.selectedButtonId,r.oneofs&&(s._selectedButtonId="selectedButtonId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s.response="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.ButtonsResponseMessage.Type[A.type]===void 0?A.type:p.proto.Message.ButtonsResponseMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ButtonsResponseMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="DISPLAY_TEXT"]=1,A})(),i})(),t.Call=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.callKey=A.bytes();break}case 2:{c.conversionSource=A.string();break}case 3:{c.conversionData=A.bytes();break}case 4:{c.conversionDelaySeconds=A.uint32();break}case 5:{c.ctwaSignals=A.string();break}case 6:{c.ctwaPayload=A.bytes();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.nativeFlowCallButtonPayload=A.string();break}case 9:{c.deeplinkPayload=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.Call)return A;var r=new p.proto.Message.Call;if(A.callKey!=null&&(typeof A.callKey=="string"?l.base64.decode(A.callKey,r.callKey=l.newBuffer(l.base64.length(A.callKey)),0):A.callKey.length>=0&&(r.callKey=A.callKey)),A.conversionSource!=null&&(r.conversionSource=String(A.conversionSource)),A.conversionData!=null&&(typeof A.conversionData=="string"?l.base64.decode(A.conversionData,r.conversionData=l.newBuffer(l.base64.length(A.conversionData)),0):A.conversionData.length>=0&&(r.conversionData=A.conversionData)),A.conversionDelaySeconds!=null&&(r.conversionDelaySeconds=A.conversionDelaySeconds>>>0),A.ctwaSignals!=null&&(r.ctwaSignals=String(A.ctwaSignals)),A.ctwaPayload!=null&&(typeof A.ctwaPayload=="string"?l.base64.decode(A.ctwaPayload,r.ctwaPayload=l.newBuffer(l.base64.length(A.ctwaPayload)),0):A.ctwaPayload.length>=0&&(r.ctwaPayload=A.ctwaPayload)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.Call.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.nativeFlowCallButtonPayload!=null&&(r.nativeFlowCallButtonPayload=String(A.nativeFlowCallButtonPayload)),A.deeplinkPayload!=null&&(r.deeplinkPayload=String(A.deeplinkPayload)),r},i.toObject=function(A,r){r||(r={});var s={};return A.callKey!=null&&A.hasOwnProperty("callKey")&&(s.callKey=r.bytes===String?l.base64.encode(A.callKey,0,A.callKey.length):r.bytes===Array?Array.prototype.slice.call(A.callKey):A.callKey,r.oneofs&&(s._callKey="callKey")),A.conversionSource!=null&&A.hasOwnProperty("conversionSource")&&(s.conversionSource=A.conversionSource,r.oneofs&&(s._conversionSource="conversionSource")),A.conversionData!=null&&A.hasOwnProperty("conversionData")&&(s.conversionData=r.bytes===String?l.base64.encode(A.conversionData,0,A.conversionData.length):r.bytes===Array?Array.prototype.slice.call(A.conversionData):A.conversionData,r.oneofs&&(s._conversionData="conversionData")),A.conversionDelaySeconds!=null&&A.hasOwnProperty("conversionDelaySeconds")&&(s.conversionDelaySeconds=A.conversionDelaySeconds,r.oneofs&&(s._conversionDelaySeconds="conversionDelaySeconds")),A.ctwaSignals!=null&&A.hasOwnProperty("ctwaSignals")&&(s.ctwaSignals=A.ctwaSignals,r.oneofs&&(s._ctwaSignals="ctwaSignals")),A.ctwaPayload!=null&&A.hasOwnProperty("ctwaPayload")&&(s.ctwaPayload=r.bytes===String?l.base64.encode(A.ctwaPayload,0,A.ctwaPayload.length):r.bytes===Array?Array.prototype.slice.call(A.ctwaPayload):A.ctwaPayload,r.oneofs&&(s._ctwaPayload="ctwaPayload")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.nativeFlowCallButtonPayload!=null&&A.hasOwnProperty("nativeFlowCallButtonPayload")&&(s.nativeFlowCallButtonPayload=A.nativeFlowCallButtonPayload,r.oneofs&&(s._nativeFlowCallButtonPayload="nativeFlowCallButtonPayload")),A.deeplinkPayload!=null&&A.hasOwnProperty("deeplinkPayload")&&(s.deeplinkPayload=A.deeplinkPayload,r.oneofs&&(s._deeplinkPayload="deeplinkPayload")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Call"},i})(),t.CallLogMessage=(function(){function i(a){if(this.participants=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isVideo=A.bool();break}case 2:{c.callOutcome=A.int32();break}case 3:{c.durationSecs=A.int64();break}case 4:{c.callType=A.int32();break}case 5:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(p.proto.Message.CallLogMessage.CallParticipant.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CallLogMessage)return A;var r=new p.proto.Message.CallLogMessage;switch(A.isVideo!=null&&(r.isVideo=!!A.isVideo),A.callOutcome){default:if(typeof A.callOutcome=="number"){r.callOutcome=A.callOutcome;break}break;case"CONNECTED":case 0:r.callOutcome=0;break;case"MISSED":case 1:r.callOutcome=1;break;case"FAILED":case 2:r.callOutcome=2;break;case"REJECTED":case 3:r.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:r.callOutcome=4;break;case"ONGOING":case 5:r.callOutcome=5;break;case"SILENCED_BY_DND":case 6:r.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:r.callOutcome=7;break}switch(A.durationSecs!=null&&(l.Long?(r.durationSecs=l.Long.fromValue(A.durationSecs)).unsigned=!1:typeof A.durationSecs=="string"?r.durationSecs=parseInt(A.durationSecs,10):typeof A.durationSecs=="number"?r.durationSecs=A.durationSecs:typeof A.durationSecs=="object"&&(r.durationSecs=new l.LongBits(A.durationSecs.low>>>0,A.durationSecs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"REGULAR":case 0:r.callType=0;break;case"SCHEDULED_CALL":case 1:r.callType=1;break;case"VOICE_CHAT":case 2:r.callType=2;break}if(A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.Message.CallLogMessage.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{d.jid=s.string();break}case 2:{d.callOutcome=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.CallLogMessage.CallParticipant)return s;var g=new p.proto.Message.CallLogMessage.CallParticipant;switch(s.jid!=null&&(g.jid=String(s.jid)),s.callOutcome){default:if(typeof s.callOutcome=="number"){g.callOutcome=s.callOutcome;break}break;case"CONNECTED":case 0:g.callOutcome=0;break;case"MISSED":case 1:g.callOutcome=1;break;case"FAILED":case 2:g.callOutcome=2;break;case"REJECTED":case 3:g.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:g.callOutcome=4;break;case"ONGOING":case 5:g.callOutcome=5;break;case"SILENCED_BY_DND":case 6:g.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:g.callOutcome=7;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.jid!=null&&s.hasOwnProperty("jid")&&(c.jid=s.jid,g.oneofs&&(c._jid="jid")),s.callOutcome!=null&&s.hasOwnProperty("callOutcome")&&(c.callOutcome=g.enums===String?p.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]===void 0?s.callOutcome:p.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]:s.callOutcome,g.oneofs&&(c._callOutcome="callOutcome")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CallLogMessage.CallParticipant"},a})(),i.CallType=(function(){let a={},A=Object.create(a);return A[a[0]="REGULAR"]=0,A[a[1]="SCHEDULED_CALL"]=1,A[a[2]="VOICE_CHAT"]=2,A})(),i})(),t.CancelPaymentRequestMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CancelPaymentRequestMessage)return A;var r=new p.proto.Message.CancelPaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CancelPaymentRequestMessage"},i})(),t.Chat=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.Chat)return A;var r=new p.proto.Message.Chat;return A.displayName!=null&&(r.displayName=String(A.displayName)),A.id!=null&&(r.id=String(A.id)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Chat"},i})(),t.CloudAPIThreadControlNotification=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.senderNotificationTimestampMs=A.int64();break}case 3:{c.consumerLid=A.string();break}case 4:{c.consumerPhoneNumber=A.string();break}case 5:{c.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.decode(A,A.uint32());break}case 6:{c.shouldSuppressNotification=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CloudAPIThreadControlNotification)return A;var r=new p.proto.Message.CloudAPIThreadControlNotification;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"UNKNOWN":case 0:r.status=0;break;case"CONTROL_PASSED":case 1:r.status=1;break;case"CONTROL_TAKEN":case 2:r.status=2;break}if(A.senderNotificationTimestampMs!=null&&(l.Long?(r.senderNotificationTimestampMs=l.Long.fromValue(A.senderNotificationTimestampMs)).unsigned=!1:typeof A.senderNotificationTimestampMs=="string"?r.senderNotificationTimestampMs=parseInt(A.senderNotificationTimestampMs,10):typeof A.senderNotificationTimestampMs=="number"?r.senderNotificationTimestampMs=A.senderNotificationTimestampMs:typeof A.senderNotificationTimestampMs=="object"&&(r.senderNotificationTimestampMs=new l.LongBits(A.senderNotificationTimestampMs.low>>>0,A.senderNotificationTimestampMs.high>>>0).toNumber())),A.consumerLid!=null&&(r.consumerLid=String(A.consumerLid)),A.consumerPhoneNumber!=null&&(r.consumerPhoneNumber=String(A.consumerPhoneNumber)),A.notificationContent!=null){if(typeof A.notificationContent!="object")throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected");r.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(A.notificationContent)}return A.shouldSuppressNotification!=null&&(r.shouldSuppressNotification=!!A.shouldSuppressNotification),r},i.toObject=function(A,r){r||(r={});var s={};return A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]===void 0?A.status:p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]:A.status,r.oneofs&&(s._status="status")),A.senderNotificationTimestampMs!=null&&A.hasOwnProperty("senderNotificationTimestampMs")&&(typeof A.senderNotificationTimestampMs=="number"?s.senderNotificationTimestampMs=r.longs===String?String(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs:s.senderNotificationTimestampMs=r.longs===String?ge(A.senderNotificationTimestampMs):r.longs===Number?ce(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs,r.oneofs&&(s._senderNotificationTimestampMs="senderNotificationTimestampMs")),A.consumerLid!=null&&A.hasOwnProperty("consumerLid")&&(s.consumerLid=A.consumerLid,r.oneofs&&(s._consumerLid="consumerLid")),A.consumerPhoneNumber!=null&&A.hasOwnProperty("consumerPhoneNumber")&&(s.consumerPhoneNumber=A.consumerPhoneNumber,r.oneofs&&(s._consumerPhoneNumber="consumerPhoneNumber")),A.notificationContent!=null&&A.hasOwnProperty("notificationContent")&&(s.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(A.notificationContent,r),r.oneofs&&(s._notificationContent="notificationContent")),A.shouldSuppressNotification!=null&&A.hasOwnProperty("shouldSuppressNotification")&&(s.shouldSuppressNotification=A.shouldSuppressNotification,r.oneofs&&(s._shouldSuppressNotification="shouldSuppressNotification")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CloudAPIThreadControlNotification"},i.CloudAPIThreadControl=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CONTROL_PASSED"]=1,A[a[2]="CONTROL_TAKEN"]=2,A})(),i.CloudAPIThreadControlNotificationContent=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.handoffNotificationText=s.string();break}case 2:{d.extraJson=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent)return s;var g=new p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent;return s.handoffNotificationText!=null&&(g.handoffNotificationText=String(s.handoffNotificationText)),s.extraJson!=null&&(g.extraJson=String(s.extraJson)),g},a.toObject=function(s,g){g||(g={});var c={};return s.handoffNotificationText!=null&&s.hasOwnProperty("handoffNotificationText")&&(c.handoffNotificationText=s.handoffNotificationText,g.oneofs&&(c._handoffNotificationText="handoffNotificationText")),s.extraJson!=null&&s.hasOwnProperty("extraJson")&&(c.extraJson=s.extraJson,g.oneofs&&(c._extraJson="extraJson")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent"},a})(),i})(),t.CommentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.message=p.proto.Message.decode(A,A.uint32());break}case 2:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CommentMessage)return A;var r=new p.proto.Message.CommentMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.CommentMessage.message: object expected");r.message=p.proto.Message.fromObject(A.message)}if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CommentMessage"},i})(),t.ContactMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayName=A.string();break}case 16:{c.vcard=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ContactMessage)return A;var r=new p.proto.Message.ContactMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.vcard!=null&&(r.vcard=String(A.vcard)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.vcard!=null&&A.hasOwnProperty("vcard")&&(s.vcard=A.vcard,r.oneofs&&(s._vcard="vcard")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ContactMessage"},i})(),t.ContactsArrayMessage=(function(){function i(a){if(this.contacts=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.contacts&&c.contacts.length||(c.contacts=[]),c.contacts.push(p.proto.Message.ContactMessage.decode(A,A.uint32()));break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ContactsArrayMessage)return A;var r=new p.proto.Message.ContactsArrayMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.contacts){if(!Array.isArray(A.contacts))throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected");r.contacts=[];for(var s=0;s>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DeclinePaymentRequestMessage)return A;var r=new p.proto.Message.DeclinePaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeclinePaymentRequestMessage"},i})(),t.DeviceSentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.destinationJid=A.string();break}case 2:{c.message=p.proto.Message.decode(A,A.uint32());break}case 3:{c.phash=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DeviceSentMessage)return A;var r=new p.proto.Message.DeviceSentMessage;if(A.destinationJid!=null&&(r.destinationJid=String(A.destinationJid)),A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.DeviceSentMessage.message: object expected");r.message=p.proto.Message.fromObject(A.message)}return A.phash!=null&&(r.phash=String(A.phash)),r},i.toObject=function(A,r){r||(r={});var s={};return A.destinationJid!=null&&A.hasOwnProperty("destinationJid")&&(s.destinationJid=A.destinationJid,r.oneofs&&(s._destinationJid="destinationJid")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.phash!=null&&A.hasOwnProperty("phash")&&(s.phash=A.phash,r.oneofs&&(s._phash="phash")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeviceSentMessage"},i})(),t.DocumentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.title=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.pageCount=A.uint32();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileName=A.string();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.directPath=A.string();break}case 11:{c.mediaKeyTimestamp=A.int64();break}case 12:{c.contactVcard=A.bool();break}case 13:{c.thumbnailDirectPath=A.string();break}case 14:{c.thumbnailSha256=A.bytes();break}case 15:{c.thumbnailEncSha256=A.bytes();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.caption=A.string();break}case 21:{c.accessibilityLabel=A.string();break}case 22:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DocumentMessage)return A;var r=new p.proto.Message.DocumentMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.title!=null&&(r.title=String(A.title)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.pageCount!=null&&(r.pageCount=A.pageCount>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileName!=null&&(r.fileName=String(A.fileName)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contactVcard!=null&&(r.contactVcard=!!A.contactVcard),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.pageCount!=null&&A.hasOwnProperty("pageCount")&&(s.pageCount=A.pageCount,r.oneofs&&(s._pageCount="pageCount")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileName!=null&&A.hasOwnProperty("fileName")&&(s.fileName=A.fileName,r.oneofs&&(s._fileName="fileName")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contactVcard!=null&&A.hasOwnProperty("contactVcard")&&(s.contactVcard=A.contactVcard,r.oneofs&&(s._contactVcard="contactVcard")),A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DocumentMessage"},i})(),t.EncCommentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncCommentMessage)return A;var r=new p.proto.Message.EncCommentMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncCommentMessage"},i})(),t.EncEventResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.eventCreationMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncEventResponseMessage)return A;var r=new p.proto.Message.EncEventResponseMessage;if(A.eventCreationMessageKey!=null){if(typeof A.eventCreationMessageKey!="object")throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected");r.eventCreationMessageKey=p.proto.MessageKey.fromObject(A.eventCreationMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.eventCreationMessageKey!=null&&A.hasOwnProperty("eventCreationMessageKey")&&(s.eventCreationMessageKey=p.proto.MessageKey.toObject(A.eventCreationMessageKey,r),r.oneofs&&(s._eventCreationMessageKey="eventCreationMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncEventResponseMessage"},i})(),t.EncReactionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncReactionMessage)return A;var r=new p.proto.Message.EncReactionMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncReactionMessage"},i})(),t.EventMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.isCanceled=A.bool();break}case 3:{c.name=A.string();break}case 4:{c.description=A.string();break}case 5:{c.location=p.proto.Message.LocationMessage.decode(A,A.uint32());break}case 6:{c.joinLink=A.string();break}case 7:{c.startTime=A.int64();break}case 8:{c.endTime=A.int64();break}case 9:{c.extraGuestsAllowed=A.bool();break}case 10:{c.isScheduleCall=A.bool();break}case 11:{c.hasReminder=A.bool();break}case 12:{c.reminderOffsetSec=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EventMessage)return A;var r=new p.proto.Message.EventMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.EventMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.isCanceled!=null&&(r.isCanceled=!!A.isCanceled),A.name!=null&&(r.name=String(A.name)),A.description!=null&&(r.description=String(A.description)),A.location!=null){if(typeof A.location!="object")throw TypeError(".proto.Message.EventMessage.location: object expected");r.location=p.proto.Message.LocationMessage.fromObject(A.location)}return A.joinLink!=null&&(r.joinLink=String(A.joinLink)),A.startTime!=null&&(l.Long?(r.startTime=l.Long.fromValue(A.startTime)).unsigned=!1:typeof A.startTime=="string"?r.startTime=parseInt(A.startTime,10):typeof A.startTime=="number"?r.startTime=A.startTime:typeof A.startTime=="object"&&(r.startTime=new l.LongBits(A.startTime.low>>>0,A.startTime.high>>>0).toNumber())),A.endTime!=null&&(l.Long?(r.endTime=l.Long.fromValue(A.endTime)).unsigned=!1:typeof A.endTime=="string"?r.endTime=parseInt(A.endTime,10):typeof A.endTime=="number"?r.endTime=A.endTime:typeof A.endTime=="object"&&(r.endTime=new l.LongBits(A.endTime.low>>>0,A.endTime.high>>>0).toNumber())),A.extraGuestsAllowed!=null&&(r.extraGuestsAllowed=!!A.extraGuestsAllowed),A.isScheduleCall!=null&&(r.isScheduleCall=!!A.isScheduleCall),A.hasReminder!=null&&(r.hasReminder=!!A.hasReminder),A.reminderOffsetSec!=null&&(l.Long?(r.reminderOffsetSec=l.Long.fromValue(A.reminderOffsetSec)).unsigned=!1:typeof A.reminderOffsetSec=="string"?r.reminderOffsetSec=parseInt(A.reminderOffsetSec,10):typeof A.reminderOffsetSec=="number"?r.reminderOffsetSec=A.reminderOffsetSec:typeof A.reminderOffsetSec=="object"&&(r.reminderOffsetSec=new l.LongBits(A.reminderOffsetSec.low>>>0,A.reminderOffsetSec.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.isCanceled!=null&&A.hasOwnProperty("isCanceled")&&(s.isCanceled=A.isCanceled,r.oneofs&&(s._isCanceled="isCanceled")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),A.location!=null&&A.hasOwnProperty("location")&&(s.location=p.proto.Message.LocationMessage.toObject(A.location,r),r.oneofs&&(s._location="location")),A.joinLink!=null&&A.hasOwnProperty("joinLink")&&(s.joinLink=A.joinLink,r.oneofs&&(s._joinLink="joinLink")),A.startTime!=null&&A.hasOwnProperty("startTime")&&(typeof A.startTime=="number"?s.startTime=r.longs===String?String(A.startTime):A.startTime:s.startTime=r.longs===String?ge(A.startTime):r.longs===Number?ce(A.startTime):A.startTime,r.oneofs&&(s._startTime="startTime")),A.endTime!=null&&A.hasOwnProperty("endTime")&&(typeof A.endTime=="number"?s.endTime=r.longs===String?String(A.endTime):A.endTime:s.endTime=r.longs===String?ge(A.endTime):r.longs===Number?ce(A.endTime):A.endTime,r.oneofs&&(s._endTime="endTime")),A.extraGuestsAllowed!=null&&A.hasOwnProperty("extraGuestsAllowed")&&(s.extraGuestsAllowed=A.extraGuestsAllowed,r.oneofs&&(s._extraGuestsAllowed="extraGuestsAllowed")),A.isScheduleCall!=null&&A.hasOwnProperty("isScheduleCall")&&(s.isScheduleCall=A.isScheduleCall,r.oneofs&&(s._isScheduleCall="isScheduleCall")),A.hasReminder!=null&&A.hasOwnProperty("hasReminder")&&(s.hasReminder=A.hasReminder,r.oneofs&&(s._hasReminder="hasReminder")),A.reminderOffsetSec!=null&&A.hasOwnProperty("reminderOffsetSec")&&(typeof A.reminderOffsetSec=="number"?s.reminderOffsetSec=r.longs===String?String(A.reminderOffsetSec):A.reminderOffsetSec:s.reminderOffsetSec=r.longs===String?ge(A.reminderOffsetSec):r.longs===Number?ce(A.reminderOffsetSec):A.reminderOffsetSec,r.oneofs&&(s._reminderOffsetSec="reminderOffsetSec")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventMessage"},i})(),t.EventResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.response=A.int32();break}case 2:{c.timestampMs=A.int64();break}case 3:{c.extraGuestCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EventResponseMessage)return A;var r=new p.proto.Message.EventResponseMessage;switch(A.response){default:if(typeof A.response=="number"){r.response=A.response;break}break;case"UNKNOWN":case 0:r.response=0;break;case"GOING":case 1:r.response=1;break;case"NOT_GOING":case 2:r.response=2;break;case"MAYBE":case 3:r.response=3;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.extraGuestCount!=null&&(r.extraGuestCount=A.extraGuestCount|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.response!=null&&A.hasOwnProperty("response")&&(s.response=r.enums===String?p.proto.Message.EventResponseMessage.EventResponseType[A.response]===void 0?A.response:p.proto.Message.EventResponseMessage.EventResponseType[A.response]:A.response,r.oneofs&&(s._response="response")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.extraGuestCount!=null&&A.hasOwnProperty("extraGuestCount")&&(s.extraGuestCount=A.extraGuestCount,r.oneofs&&(s._extraGuestCount="extraGuestCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventResponseMessage"},i.EventResponseType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="GOING"]=1,A[a[2]="NOT_GOING"]=2,A[a[3]="MAYBE"]=3,A})(),i})(),t.ExtendedTextMessage=(function(){function i(a){if(this.endCardTiles=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.matchedText=A.string();break}case 5:{c.description=A.string();break}case 6:{c.title=A.string();break}case 7:{c.textArgb=A.fixed32();break}case 8:{c.backgroundArgb=A.fixed32();break}case 9:{c.font=A.int32();break}case 10:{c.previewType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.doNotPlayInline=A.bool();break}case 19:{c.thumbnailDirectPath=A.string();break}case 20:{c.thumbnailSha256=A.bytes();break}case 21:{c.thumbnailEncSha256=A.bytes();break}case 22:{c.mediaKey=A.bytes();break}case 23:{c.mediaKeyTimestamp=A.int64();break}case 24:{c.thumbnailHeight=A.uint32();break}case 25:{c.thumbnailWidth=A.uint32();break}case 26:{c.inviteLinkGroupType=A.int32();break}case 27:{c.inviteLinkParentGroupSubjectV2=A.string();break}case 28:{c.inviteLinkParentGroupThumbnailV2=A.bytes();break}case 29:{c.inviteLinkGroupTypeV2=A.int32();break}case 30:{c.viewOnce=A.bool();break}case 31:{c.videoHeight=A.uint32();break}case 32:{c.videoWidth=A.uint32();break}case 33:{c.faviconMMSMetadata=p.proto.Message.MMSThumbnailMetadata.decode(A,A.uint32());break}case 34:{c.linkPreviewMetadata=p.proto.Message.LinkPreviewMetadata.decode(A,A.uint32());break}case 35:{c.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 36:{c.endCardTiles&&c.endCardTiles.length||(c.endCardTiles=[]),c.endCardTiles.push(p.proto.Message.VideoEndCard.decode(A,A.uint32()));break}case 37:{c.videoContentUrl=A.string();break}case 38:{c.musicMetadata=p.proto.EmbeddedMusic.decode(A,A.uint32());break}case 39:{c.paymentExtendedMetadata=p.proto.Message.PaymentExtendedMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ExtendedTextMessage)return A;var r=new p.proto.Message.ExtendedTextMessage;switch(A.text!=null&&(r.text=String(A.text)),A.matchedText!=null&&(r.matchedText=String(A.matchedText)),A.description!=null&&(r.description=String(A.description)),A.title!=null&&(r.title=String(A.title)),A.textArgb!=null&&(r.textArgb=A.textArgb>>>0),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.font){default:if(typeof A.font=="number"){r.font=A.font;break}break;case"SYSTEM":case 0:r.font=0;break;case"SYSTEM_TEXT":case 1:r.font=1;break;case"FB_SCRIPT":case 2:r.font=2;break;case"SYSTEM_BOLD":case 6:r.font=6;break;case"MORNINGBREEZE_REGULAR":case 7:r.font=7;break;case"CALISTOGA_REGULAR":case 8:r.font=8;break;case"EXO2_EXTRABOLD":case 9:r.font=9;break;case"COURIERPRIME_BOLD":case 10:r.font=10;break}switch(A.previewType){default:if(typeof A.previewType=="number"){r.previewType=A.previewType;break}break;case"NONE":case 0:r.previewType=0;break;case"VIDEO":case 1:r.previewType=1;break;case"PLACEHOLDER":case 4:r.previewType=4;break;case"IMAGE":case 5:r.previewType=5;break;case"PAYMENT_LINKS":case 6:r.previewType=6;break;case"PROFILE":case 7:r.previewType=7;break}if(A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.doNotPlayInline!=null&&(r.doNotPlayInline=!!A.doNotPlayInline),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.inviteLinkGroupType){default:if(typeof A.inviteLinkGroupType=="number"){r.inviteLinkGroupType=A.inviteLinkGroupType;break}break;case"DEFAULT":case 0:r.inviteLinkGroupType=0;break;case"PARENT":case 1:r.inviteLinkGroupType=1;break;case"SUB":case 2:r.inviteLinkGroupType=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupType=3;break}switch(A.inviteLinkParentGroupSubjectV2!=null&&(r.inviteLinkParentGroupSubjectV2=String(A.inviteLinkParentGroupSubjectV2)),A.inviteLinkParentGroupThumbnailV2!=null&&(typeof A.inviteLinkParentGroupThumbnailV2=="string"?l.base64.decode(A.inviteLinkParentGroupThumbnailV2,r.inviteLinkParentGroupThumbnailV2=l.newBuffer(l.base64.length(A.inviteLinkParentGroupThumbnailV2)),0):A.inviteLinkParentGroupThumbnailV2.length>=0&&(r.inviteLinkParentGroupThumbnailV2=A.inviteLinkParentGroupThumbnailV2)),A.inviteLinkGroupTypeV2){default:if(typeof A.inviteLinkGroupTypeV2=="number"){r.inviteLinkGroupTypeV2=A.inviteLinkGroupTypeV2;break}break;case"DEFAULT":case 0:r.inviteLinkGroupTypeV2=0;break;case"PARENT":case 1:r.inviteLinkGroupTypeV2=1;break;case"SUB":case 2:r.inviteLinkGroupTypeV2=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupTypeV2=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.videoHeight!=null&&(r.videoHeight=A.videoHeight>>>0),A.videoWidth!=null&&(r.videoWidth=A.videoWidth>>>0),A.faviconMMSMetadata!=null){if(typeof A.faviconMMSMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected");r.faviconMMSMetadata=p.proto.Message.MMSThumbnailMetadata.fromObject(A.faviconMMSMetadata)}if(A.linkPreviewMetadata!=null){if(typeof A.linkPreviewMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected");r.linkPreviewMetadata=p.proto.Message.LinkPreviewMetadata.fromObject(A.linkPreviewMetadata)}if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected");r.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.endCardTiles){if(!Array.isArray(A.endCardTiles))throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: array expected");r.endCardTiles=[];for(var s=0;s>>3){case 1:{c.requestId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.FullHistorySyncOnDemandRequestMetadata)return A;var r=new p.proto.Message.FullHistorySyncOnDemandRequestMetadata;return A.requestId!=null&&(r.requestId=String(A.requestId)),r},i.toObject=function(A,r){r||(r={});var s={};return A.requestId!=null&&A.hasOwnProperty("requestId")&&(s.requestId=A.requestId,r.oneofs&&(s._requestId="requestId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FullHistorySyncOnDemandRequestMetadata"},i})(),t.FutureProofMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.message=p.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.FutureProofMessage)return A;var r=new p.proto.Message.FutureProofMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.FutureProofMessage.message: object expected");r.message=p.proto.Message.fromObject(A.message)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FutureProofMessage"},i})(),t.GroupInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.groupJid=A.string();break}case 2:{c.inviteCode=A.string();break}case 3:{c.inviteExpiration=A.int64();break}case 4:{c.groupName=A.string();break}case 5:{c.jpegThumbnail=A.bytes();break}case 6:{c.caption=A.string();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.groupType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.GroupInviteMessage)return A;var r=new p.proto.Message.GroupInviteMessage;if(A.groupJid!=null&&(r.groupJid=String(A.groupJid)),A.inviteCode!=null&&(r.inviteCode=String(A.inviteCode)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.groupName!=null&&(r.groupName=String(A.groupName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.groupType){default:if(typeof A.groupType=="number"){r.groupType=A.groupType;break}break;case"DEFAULT":case 0:r.groupType=0;break;case"PARENT":case 1:r.groupType=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.groupJid!=null&&A.hasOwnProperty("groupJid")&&(s.groupJid=A.groupJid,r.oneofs&&(s._groupJid="groupJid")),A.inviteCode!=null&&A.hasOwnProperty("inviteCode")&&(s.inviteCode=A.inviteCode,r.oneofs&&(s._inviteCode="inviteCode")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.groupName!=null&&A.hasOwnProperty("groupName")&&(s.groupName=A.groupName,r.oneofs&&(s._groupName="groupName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.groupType!=null&&A.hasOwnProperty("groupType")&&(s.groupType=r.enums===String?p.proto.Message.GroupInviteMessage.GroupType[A.groupType]===void 0?A.groupType:p.proto.Message.GroupInviteMessage.GroupType[A.groupType]:A.groupType,r.oneofs&&(s._groupType="groupType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.GroupInviteMessage"},i.GroupType=(function(){let a={},A=Object.create(a);return A[a[0]="DEFAULT"]=0,A[a[1]="PARENT"]=1,A})(),i})(),t.HighlyStructuredMessage=(function(){function i(a){if(this.params=[],this.localizableParams=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.namespace=A.string();break}case 2:{c.elementName=A.string();break}case 3:{c.params&&c.params.length||(c.params=[]),c.params.push(A.string());break}case 4:{c.fallbackLg=A.string();break}case 5:{c.fallbackLc=A.string();break}case 6:{c.localizableParams&&c.localizableParams.length||(c.localizableParams=[]),c.localizableParams.push(p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.decode(A,A.uint32()));break}case 7:{c.deterministicLg=A.string();break}case 8:{c.deterministicLc=A.string();break}case 9:{c.hydratedHsm=p.proto.Message.TemplateMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HighlyStructuredMessage)return A;var r=new p.proto.Message.HighlyStructuredMessage;if(A.namespace!=null&&(r.namespace=String(A.namespace)),A.elementName!=null&&(r.elementName=String(A.elementName)),A.params){if(!Array.isArray(A.params))throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected");r.params=[];for(var s=0;s>>3){case 1:{d.default=s.string();break}case 2:{d.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.decode(s,s.uint32());break}case 3:{d.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter)return s;var g=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter;if(s.default!=null&&(g.default=String(s.default)),s.currency!=null){if(typeof s.currency!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected");g.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(s.currency)}if(s.dateTime!=null){if(typeof s.dateTime!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected");g.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(s.dateTime)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.default!=null&&s.hasOwnProperty("default")&&(c.default=s.default,g.oneofs&&(c._default="default")),s.currency!=null&&s.hasOwnProperty("currency")&&(c.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(s.currency,g),g.oneofs&&(c.paramOneof="currency")),s.dateTime!=null&&s.hasOwnProperty("dateTime")&&(c.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(s.dateTime,g),g.oneofs&&(c.paramOneof="dateTime")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter"},a.HSMCurrency=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.currencyCode=c.string();break}case 2:{f.amount1000=c.int64();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency)return c;var I=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency;return c.currencyCode!=null&&(I.currencyCode=String(c.currencyCode)),c.amount1000!=null&&(l.Long?(I.amount1000=l.Long.fromValue(c.amount1000)).unsigned=!1:typeof c.amount1000=="string"?I.amount1000=parseInt(c.amount1000,10):typeof c.amount1000=="number"?I.amount1000=c.amount1000:typeof c.amount1000=="object"&&(I.amount1000=new l.LongBits(c.amount1000.low>>>0,c.amount1000.high>>>0).toNumber())),I},r.toObject=function(c,I){I||(I={});var d={};return c.currencyCode!=null&&c.hasOwnProperty("currencyCode")&&(d.currencyCode=c.currencyCode,I.oneofs&&(d._currencyCode="currencyCode")),c.amount1000!=null&&c.hasOwnProperty("amount1000")&&(typeof c.amount1000=="number"?d.amount1000=I.longs===String?String(c.amount1000):c.amount1000:d.amount1000=I.longs===String?ge(c.amount1000):I.longs===Number?ce(c.amount1000):c.amount1000,I.oneofs&&(d._amount1000="amount1000")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency"},r})(),a.HSMDateTime=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.decode(c,c.uint32());break}case 2:{f.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime)return c;var I=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime;if(c.component!=null){if(typeof c.component!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected");I.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(c.component)}if(c.unixEpoch!=null){if(typeof c.unixEpoch!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected");I.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(c.unixEpoch)}return I},r.toObject=function(c,I){I||(I={});var d={};return c.component!=null&&c.hasOwnProperty("component")&&(d.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(c.component,I),I.oneofs&&(d.datetimeOneof="component")),c.unixEpoch!=null&&c.hasOwnProperty("unixEpoch")&&(d.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(c.unixEpoch,I),I.oneofs&&(d.datetimeOneof="unixEpoch")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime"},r.HSMDateTimeComponent=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.dayOfWeek=d.int32();break}case 2:{y.year=d.uint32();break}case 3:{y.month=d.uint32();break}case 4:{y.dayOfMonth=d.uint32();break}case 5:{y.hour=d.uint32();break}case 6:{y.minute=d.uint32();break}case 7:{y.calendar=d.int32();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent)return d;var B=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent;switch(d.dayOfWeek){default:if(typeof d.dayOfWeek=="number"){B.dayOfWeek=d.dayOfWeek;break}break;case"MONDAY":case 1:B.dayOfWeek=1;break;case"TUESDAY":case 2:B.dayOfWeek=2;break;case"WEDNESDAY":case 3:B.dayOfWeek=3;break;case"THURSDAY":case 4:B.dayOfWeek=4;break;case"FRIDAY":case 5:B.dayOfWeek=5;break;case"SATURDAY":case 6:B.dayOfWeek=6;break;case"SUNDAY":case 7:B.dayOfWeek=7;break}switch(d.year!=null&&(B.year=d.year>>>0),d.month!=null&&(B.month=d.month>>>0),d.dayOfMonth!=null&&(B.dayOfMonth=d.dayOfMonth>>>0),d.hour!=null&&(B.hour=d.hour>>>0),d.minute!=null&&(B.minute=d.minute>>>0),d.calendar){default:if(typeof d.calendar=="number"){B.calendar=d.calendar;break}break;case"GREGORIAN":case 1:B.calendar=1;break;case"SOLAR_HIJRI":case 2:B.calendar=2;break}return B},g.toObject=function(d,B){B||(B={});var f={};return d.dayOfWeek!=null&&d.hasOwnProperty("dayOfWeek")&&(f.dayOfWeek=B.enums===String?p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[d.dayOfWeek]===void 0?d.dayOfWeek:p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[d.dayOfWeek]:d.dayOfWeek,B.oneofs&&(f._dayOfWeek="dayOfWeek")),d.year!=null&&d.hasOwnProperty("year")&&(f.year=d.year,B.oneofs&&(f._year="year")),d.month!=null&&d.hasOwnProperty("month")&&(f.month=d.month,B.oneofs&&(f._month="month")),d.dayOfMonth!=null&&d.hasOwnProperty("dayOfMonth")&&(f.dayOfMonth=d.dayOfMonth,B.oneofs&&(f._dayOfMonth="dayOfMonth")),d.hour!=null&&d.hasOwnProperty("hour")&&(f.hour=d.hour,B.oneofs&&(f._hour="hour")),d.minute!=null&&d.hasOwnProperty("minute")&&(f.minute=d.minute,B.oneofs&&(f._minute="minute")),d.calendar!=null&&d.hasOwnProperty("calendar")&&(f.calendar=B.enums===String?p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[d.calendar]===void 0?d.calendar:p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[d.calendar]:d.calendar,B.oneofs&&(f._calendar="calendar")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent"},g.CalendarType=(function(){let I={},d=Object.create(I);return d[I[1]="GREGORIAN"]=1,d[I[2]="SOLAR_HIJRI"]=2,d})(),g.DayOfWeekType=(function(){let I={},d=Object.create(I);return d[I[1]="MONDAY"]=1,d[I[2]="TUESDAY"]=2,d[I[3]="WEDNESDAY"]=3,d[I[4]="THURSDAY"]=4,d[I[5]="FRIDAY"]=5,d[I[6]="SATURDAY"]=6,d[I[7]="SUNDAY"]=7,d})(),g})(),r.HSMDateTimeUnixEpoch=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.timestamp=d.int64();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch)return d;var B=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch;return d.timestamp!=null&&(l.Long?(B.timestamp=l.Long.fromValue(d.timestamp)).unsigned=!1:typeof d.timestamp=="string"?B.timestamp=parseInt(d.timestamp,10):typeof d.timestamp=="number"?B.timestamp=d.timestamp:typeof d.timestamp=="object"&&(B.timestamp=new l.LongBits(d.timestamp.low>>>0,d.timestamp.high>>>0).toNumber())),B},g.toObject=function(d,B){B||(B={});var f={};return d.timestamp!=null&&d.hasOwnProperty("timestamp")&&(typeof d.timestamp=="number"?f.timestamp=B.longs===String?String(d.timestamp):d.timestamp:f.timestamp=B.longs===String?ge(d.timestamp):B.longs===Number?ce(d.timestamp):d.timestamp,B.oneofs&&(f._timestamp="timestamp")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch"},g})(),r})(),a})(),i})(),t.HistorySyncMessageAccessStatus=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.completeAccessGranted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HistorySyncMessageAccessStatus)return A;var r=new p.proto.Message.HistorySyncMessageAccessStatus;return A.completeAccessGranted!=null&&(r.completeAccessGranted=!!A.completeAccessGranted),r},i.toObject=function(A,r){r||(r={});var s={};return A.completeAccessGranted!=null&&A.hasOwnProperty("completeAccessGranted")&&(s.completeAccessGranted=A.completeAccessGranted,r.oneofs&&(s._completeAccessGranted="completeAccessGranted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncMessageAccessStatus"},i})(),t.HistorySyncNotification=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.fileSha256=A.bytes();break}case 2:{c.fileLength=A.uint64();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.syncType=A.int32();break}case 7:{c.chunkOrder=A.uint32();break}case 8:{c.originalMessageId=A.string();break}case 9:{c.progress=A.uint32();break}case 10:{c.oldestMsgInChunkTimestampSec=A.int64();break}case 11:{c.initialHistBootstrapInlinePayload=A.bytes();break}case 12:{c.peerDataRequestSessionId=A.string();break}case 13:{c.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(A,A.uint32());break}case 14:{c.encHandle=A.string();break}case 15:{c.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HistorySyncNotification)return A;var r=new p.proto.Message.HistorySyncNotification;switch(A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.syncType){default:if(typeof A.syncType=="number"){r.syncType=A.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:r.syncType=0;break;case"INITIAL_STATUS_V3":case 1:r.syncType=1;break;case"FULL":case 2:r.syncType=2;break;case"RECENT":case 3:r.syncType=3;break;case"PUSH_NAME":case 4:r.syncType=4;break;case"NON_BLOCKING_DATA":case 5:r.syncType=5;break;case"ON_DEMAND":case 6:r.syncType=6;break;case"NO_HISTORY":case 7:r.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:r.syncType=8;break}if(A.chunkOrder!=null&&(r.chunkOrder=A.chunkOrder>>>0),A.originalMessageId!=null&&(r.originalMessageId=String(A.originalMessageId)),A.progress!=null&&(r.progress=A.progress>>>0),A.oldestMsgInChunkTimestampSec!=null&&(l.Long?(r.oldestMsgInChunkTimestampSec=l.Long.fromValue(A.oldestMsgInChunkTimestampSec)).unsigned=!1:typeof A.oldestMsgInChunkTimestampSec=="string"?r.oldestMsgInChunkTimestampSec=parseInt(A.oldestMsgInChunkTimestampSec,10):typeof A.oldestMsgInChunkTimestampSec=="number"?r.oldestMsgInChunkTimestampSec=A.oldestMsgInChunkTimestampSec:typeof A.oldestMsgInChunkTimestampSec=="object"&&(r.oldestMsgInChunkTimestampSec=new l.LongBits(A.oldestMsgInChunkTimestampSec.low>>>0,A.oldestMsgInChunkTimestampSec.high>>>0).toNumber())),A.initialHistBootstrapInlinePayload!=null&&(typeof A.initialHistBootstrapInlinePayload=="string"?l.base64.decode(A.initialHistBootstrapInlinePayload,r.initialHistBootstrapInlinePayload=l.newBuffer(l.base64.length(A.initialHistBootstrapInlinePayload)),0):A.initialHistBootstrapInlinePayload.length>=0&&(r.initialHistBootstrapInlinePayload=A.initialHistBootstrapInlinePayload)),A.peerDataRequestSessionId!=null&&(r.peerDataRequestSessionId=String(A.peerDataRequestSessionId)),A.fullHistorySyncOnDemandRequestMetadata!=null){if(typeof A.fullHistorySyncOnDemandRequestMetadata!="object")throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected");r.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(A.fullHistorySyncOnDemandRequestMetadata)}if(A.encHandle!=null&&(r.encHandle=String(A.encHandle)),A.messageAccessStatus!=null){if(typeof A.messageAccessStatus!="object")throw TypeError(".proto.Message.HistorySyncNotification.messageAccessStatus: object expected");r.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.fromObject(A.messageAccessStatus)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.syncType!=null&&A.hasOwnProperty("syncType")&&(s.syncType=r.enums===String?p.proto.Message.HistorySyncType[A.syncType]===void 0?A.syncType:p.proto.Message.HistorySyncType[A.syncType]:A.syncType,r.oneofs&&(s._syncType="syncType")),A.chunkOrder!=null&&A.hasOwnProperty("chunkOrder")&&(s.chunkOrder=A.chunkOrder,r.oneofs&&(s._chunkOrder="chunkOrder")),A.originalMessageId!=null&&A.hasOwnProperty("originalMessageId")&&(s.originalMessageId=A.originalMessageId,r.oneofs&&(s._originalMessageId="originalMessageId")),A.progress!=null&&A.hasOwnProperty("progress")&&(s.progress=A.progress,r.oneofs&&(s._progress="progress")),A.oldestMsgInChunkTimestampSec!=null&&A.hasOwnProperty("oldestMsgInChunkTimestampSec")&&(typeof A.oldestMsgInChunkTimestampSec=="number"?s.oldestMsgInChunkTimestampSec=r.longs===String?String(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec:s.oldestMsgInChunkTimestampSec=r.longs===String?ge(A.oldestMsgInChunkTimestampSec):r.longs===Number?ce(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec,r.oneofs&&(s._oldestMsgInChunkTimestampSec="oldestMsgInChunkTimestampSec")),A.initialHistBootstrapInlinePayload!=null&&A.hasOwnProperty("initialHistBootstrapInlinePayload")&&(s.initialHistBootstrapInlinePayload=r.bytes===String?l.base64.encode(A.initialHistBootstrapInlinePayload,0,A.initialHistBootstrapInlinePayload.length):r.bytes===Array?Array.prototype.slice.call(A.initialHistBootstrapInlinePayload):A.initialHistBootstrapInlinePayload,r.oneofs&&(s._initialHistBootstrapInlinePayload="initialHistBootstrapInlinePayload")),A.peerDataRequestSessionId!=null&&A.hasOwnProperty("peerDataRequestSessionId")&&(s.peerDataRequestSessionId=A.peerDataRequestSessionId,r.oneofs&&(s._peerDataRequestSessionId="peerDataRequestSessionId")),A.fullHistorySyncOnDemandRequestMetadata!=null&&A.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")&&(s.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(A.fullHistorySyncOnDemandRequestMetadata,r),r.oneofs&&(s._fullHistorySyncOnDemandRequestMetadata="fullHistorySyncOnDemandRequestMetadata")),A.encHandle!=null&&A.hasOwnProperty("encHandle")&&(s.encHandle=A.encHandle,r.oneofs&&(s._encHandle="encHandle")),A.messageAccessStatus!=null&&A.hasOwnProperty("messageAccessStatus")&&(s.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.toObject(A.messageAccessStatus,r),r.oneofs&&(s._messageAccessStatus="messageAccessStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncNotification"},i})(),t.HistorySyncType=(function(){let i={},e=Object.create(i);return e[i[0]="INITIAL_BOOTSTRAP"]=0,e[i[1]="INITIAL_STATUS_V3"]=1,e[i[2]="FULL"]=2,e[i[3]="RECENT"]=3,e[i[4]="PUSH_NAME"]=4,e[i[5]="NON_BLOCKING_DATA"]=5,e[i[6]="ON_DEMAND"]=6,e[i[7]="NO_HISTORY"]=7,e[i[8]="MESSAGE_ACCESS_STATUS"]=8,e})(),t.ImageMessage=(function(){function i(a){if(this.interactiveAnnotations=[],this.scanLengths=[],this.annotations=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.caption=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 11:{c.directPath=A.string();break}case 12:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.firstScanSidecar=A.bytes();break}case 19:{c.firstScanLength=A.uint32();break}case 20:{c.experimentGroupId=A.uint32();break}case 21:{c.scansSidecar=A.bytes();break}case 22:{if(c.scanLengths&&c.scanLengths.length||(c.scanLengths=[]),(I&7)===2)for(var d=A.uint32()+A.pos;A.pos=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.firstScanSidecar!=null&&(typeof A.firstScanSidecar=="string"?l.base64.decode(A.firstScanSidecar,r.firstScanSidecar=l.newBuffer(l.base64.length(A.firstScanSidecar)),0):A.firstScanSidecar.length>=0&&(r.firstScanSidecar=A.firstScanSidecar)),A.firstScanLength!=null&&(r.firstScanLength=A.firstScanLength>>>0),A.experimentGroupId!=null&&(r.experimentGroupId=A.experimentGroupId>>>0),A.scansSidecar!=null&&(typeof A.scansSidecar=="string"?l.base64.decode(A.scansSidecar,r.scansSidecar=l.newBuffer(l.base64.length(A.scansSidecar)),0):A.scansSidecar.length>=0&&(r.scansSidecar=A.scansSidecar)),A.scanLengths){if(!Array.isArray(A.scanLengths))throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected");r.scanLengths=[];for(var s=0;s>>0}if(A.midQualityFileSha256!=null&&(typeof A.midQualityFileSha256=="string"?l.base64.decode(A.midQualityFileSha256,r.midQualityFileSha256=l.newBuffer(l.base64.length(A.midQualityFileSha256)),0):A.midQualityFileSha256.length>=0&&(r.midQualityFileSha256=A.midQualityFileSha256)),A.midQualityFileEncSha256!=null&&(typeof A.midQualityFileEncSha256=="string"?l.base64.decode(A.midQualityFileEncSha256,r.midQualityFileEncSha256=l.newBuffer(l.base64.length(A.midQualityFileEncSha256)),0):A.midQualityFileEncSha256.length>=0&&(r.midQualityFileEncSha256=A.midQualityFileEncSha256)),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.ImageMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>3){case 1:{c.securityNotificationEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InitialSecurityNotificationSettingSync)return A;var r=new p.proto.Message.InitialSecurityNotificationSettingSync;return A.securityNotificationEnabled!=null&&(r.securityNotificationEnabled=!!A.securityNotificationEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.securityNotificationEnabled!=null&&A.hasOwnProperty("securityNotificationEnabled")&&(s.securityNotificationEnabled=A.securityNotificationEnabled,r.oneofs&&(s._securityNotificationEnabled="securityNotificationEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InitialSecurityNotificationSettingSync"},i})(),t.InteractiveMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.header=p.proto.Message.InteractiveMessage.Header.decode(A,A.uint32());break}case 2:{c.body=p.proto.Message.InteractiveMessage.Body.decode(A,A.uint32());break}case 3:{c.footer=p.proto.Message.InteractiveMessage.Footer.decode(A,A.uint32());break}case 15:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 16:{c.urlTrackingMap=p.proto.UrlTrackingMap.decode(A,A.uint32());break}case 4:{c.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.decode(A,A.uint32());break}case 5:{c.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.decode(A,A.uint32());break}case 6:{c.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.decode(A,A.uint32());break}case 7:{c.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InteractiveMessage)return A;var r=new p.proto.Message.InteractiveMessage;if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.InteractiveMessage.header: object expected");r.header=p.proto.Message.InteractiveMessage.Header.fromObject(A.header)}if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveMessage.body: object expected");r.body=p.proto.Message.InteractiveMessage.Body.fromObject(A.body)}if(A.footer!=null){if(typeof A.footer!="object")throw TypeError(".proto.Message.InteractiveMessage.footer: object expected");r.footer=p.proto.Message.InteractiveMessage.Footer.fromObject(A.footer)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.urlTrackingMap!=null){if(typeof A.urlTrackingMap!="object")throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected");r.urlTrackingMap=p.proto.UrlTrackingMap.fromObject(A.urlTrackingMap)}if(A.shopStorefrontMessage!=null){if(typeof A.shopStorefrontMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected");r.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.fromObject(A.shopStorefrontMessage)}if(A.collectionMessage!=null){if(typeof A.collectionMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected");r.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.fromObject(A.collectionMessage)}if(A.nativeFlowMessage!=null){if(typeof A.nativeFlowMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected");r.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(A.nativeFlowMessage)}if(A.carouselMessage!=null){if(typeof A.carouselMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected");r.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.fromObject(A.carouselMessage)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.header!=null&&A.hasOwnProperty("header")&&(s.header=p.proto.Message.InteractiveMessage.Header.toObject(A.header,r),r.oneofs&&(s._header="header")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=p.proto.Message.InteractiveMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=p.proto.Message.InteractiveMessage.Footer.toObject(A.footer,r),r.oneofs&&(s._footer="footer")),A.shopStorefrontMessage!=null&&A.hasOwnProperty("shopStorefrontMessage")&&(s.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.toObject(A.shopStorefrontMessage,r),r.oneofs&&(s.interactiveMessage="shopStorefrontMessage")),A.collectionMessage!=null&&A.hasOwnProperty("collectionMessage")&&(s.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.toObject(A.collectionMessage,r),r.oneofs&&(s.interactiveMessage="collectionMessage")),A.nativeFlowMessage!=null&&A.hasOwnProperty("nativeFlowMessage")&&(s.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(A.nativeFlowMessage,r),r.oneofs&&(s.interactiveMessage="nativeFlowMessage")),A.carouselMessage!=null&&A.hasOwnProperty("carouselMessage")&&(s.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.toObject(A.carouselMessage,r),r.oneofs&&(s.interactiveMessage="carouselMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.urlTrackingMap!=null&&A.hasOwnProperty("urlTrackingMap")&&(s.urlTrackingMap=p.proto.UrlTrackingMap.toObject(A.urlTrackingMap,r),r.oneofs&&(s._urlTrackingMap="urlTrackingMap")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveMessage"},i.Body=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.text=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Body)return s;var g=new p.proto.Message.InteractiveMessage.Body;return s.text!=null&&(g.text=String(s.text)),g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Body"},a})(),i.CarouselMessage=(function(){function a(r){if(this.cards=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.cards&&d.cards.length||(d.cards=[]),d.cards.push(p.proto.Message.InteractiveMessage.decode(s,s.uint32()));break}case 2:{d.messageVersion=s.int32();break}case 3:{d.carouselCardType=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.CarouselMessage)return s;var g=new p.proto.Message.InteractiveMessage.CarouselMessage;if(s.cards){if(!Array.isArray(s.cards))throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected");g.cards=[];for(var c=0;c>>3){case 1:{d.bizJid=s.string();break}case 2:{d.id=s.string();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.CollectionMessage)return s;var g=new p.proto.Message.InteractiveMessage.CollectionMessage;return s.bizJid!=null&&(g.bizJid=String(s.bizJid)),s.id!=null&&(g.id=String(s.id)),s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.bizJid!=null&&s.hasOwnProperty("bizJid")&&(c.bizJid=s.bizJid,g.oneofs&&(c._bizJid="bizJid")),s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.CollectionMessage"},a})(),i.Footer=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.text=s.string();break}case 3:{d.hasMediaAttachment=s.bool();break}case 2:{d.audioMessage=p.proto.Message.AudioMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Footer)return s;var g=new p.proto.Message.InteractiveMessage.Footer;if(s.text!=null&&(g.text=String(s.text)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.audioMessage!=null){if(typeof s.audioMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Footer.audioMessage: object expected");g.audioMessage=p.proto.Message.AudioMessage.fromObject(s.audioMessage)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.audioMessage!=null&&s.hasOwnProperty("audioMessage")&&(c.audioMessage=p.proto.Message.AudioMessage.toObject(s.audioMessage,g),g.oneofs&&(c.media="audioMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Footer"},a})(),i.Header=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.title=s.string();break}case 2:{d.subtitle=s.string();break}case 5:{d.hasMediaAttachment=s.bool();break}case 3:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 4:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 6:{d.jpegThumbnail=s.bytes();break}case 7:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 8:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}case 9:{d.productMessage=p.proto.Message.ProductMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Header)return s;var g=new p.proto.Message.InteractiveMessage.Header;if(s.title!=null&&(g.title=String(s.title)),s.subtitle!=null&&(g.subtitle=String(s.subtitle)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.documentMessage!=null){if(typeof s.documentMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected");g.documentMessage=p.proto.Message.DocumentMessage.fromObject(s.documentMessage)}if(s.imageMessage!=null){if(typeof s.imageMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected");g.imageMessage=p.proto.Message.ImageMessage.fromObject(s.imageMessage)}if(s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),s.videoMessage!=null){if(typeof s.videoMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected");g.videoMessage=p.proto.Message.VideoMessage.fromObject(s.videoMessage)}if(s.locationMessage!=null){if(typeof s.locationMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected");g.locationMessage=p.proto.Message.LocationMessage.fromObject(s.locationMessage)}if(s.productMessage!=null){if(typeof s.productMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected");g.productMessage=p.proto.Message.ProductMessage.fromObject(s.productMessage)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.subtitle!=null&&s.hasOwnProperty("subtitle")&&(c.subtitle=s.subtitle,g.oneofs&&(c._subtitle="subtitle")),s.documentMessage!=null&&s.hasOwnProperty("documentMessage")&&(c.documentMessage=p.proto.Message.DocumentMessage.toObject(s.documentMessage,g),g.oneofs&&(c.media="documentMessage")),s.imageMessage!=null&&s.hasOwnProperty("imageMessage")&&(c.imageMessage=p.proto.Message.ImageMessage.toObject(s.imageMessage,g),g.oneofs&&(c.media="imageMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c.media="jpegThumbnail")),s.videoMessage!=null&&s.hasOwnProperty("videoMessage")&&(c.videoMessage=p.proto.Message.VideoMessage.toObject(s.videoMessage,g),g.oneofs&&(c.media="videoMessage")),s.locationMessage!=null&&s.hasOwnProperty("locationMessage")&&(c.locationMessage=p.proto.Message.LocationMessage.toObject(s.locationMessage,g),g.oneofs&&(c.media="locationMessage")),s.productMessage!=null&&s.hasOwnProperty("productMessage")&&(c.productMessage=p.proto.Message.ProductMessage.toObject(s.productMessage,g),g.oneofs&&(c.media="productMessage")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Header"},a})(),i.NativeFlowMessage=(function(){function a(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.buttons&&d.buttons.length||(d.buttons=[]),d.buttons.push(p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.decode(s,s.uint32()));break}case 2:{d.messageParamsJson=s.string();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.NativeFlowMessage)return s;var g=new p.proto.Message.InteractiveMessage.NativeFlowMessage;if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 1:{f.name=c.string();break}case 2:{f.buttonParamsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton)return c;var I=new p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton;return c.name!=null&&(I.name=String(c.name)),c.buttonParamsJson!=null&&(I.buttonParamsJson=String(c.buttonParamsJson)),I},r.toObject=function(c,I){I||(I={});var d={};return c.name!=null&&c.hasOwnProperty("name")&&(d.name=c.name,I.oneofs&&(d._name="name")),c.buttonParamsJson!=null&&c.hasOwnProperty("buttonParamsJson")&&(d.buttonParamsJson=c.buttonParamsJson,I.oneofs&&(d._buttonParamsJson="buttonParamsJson")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton"},r})(),a})(),i.ShopMessage=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.id=s.string();break}case 2:{d.surface=s.int32();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.ShopMessage)return s;var g=new p.proto.Message.InteractiveMessage.ShopMessage;switch(s.id!=null&&(g.id=String(s.id)),s.surface){default:if(typeof s.surface=="number"){g.surface=s.surface;break}break;case"UNKNOWN_SURFACE":case 0:g.surface=0;break;case"FB":case 1:g.surface=1;break;case"IG":case 2:g.surface=2;break;case"WA":case 3:g.surface=3;break}return s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.surface!=null&&s.hasOwnProperty("surface")&&(c.surface=g.enums===String?p.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]===void 0?s.surface:p.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]:s.surface,g.oneofs&&(c._surface="surface")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.ShopMessage"},a.Surface=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN_SURFACE"]=0,s[r[1]="FB"]=1,s[r[2]="IG"]=2,s[r[3]="WA"]=3,s})(),a})(),i})(),t.InteractiveResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.body=p.proto.Message.InteractiveResponseMessage.Body.decode(A,A.uint32());break}case 15:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InteractiveResponseMessage)return A;var r=new p.proto.Message.InteractiveResponseMessage;if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected");r.body=p.proto.Message.InteractiveResponseMessage.Body.fromObject(A.body)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.nativeFlowResponseMessage!=null){if(typeof A.nativeFlowResponseMessage!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected");r.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(A.nativeFlowResponseMessage)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.body!=null&&A.hasOwnProperty("body")&&(s.body=p.proto.Message.InteractiveResponseMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.nativeFlowResponseMessage!=null&&A.hasOwnProperty("nativeFlowResponseMessage")&&(s.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(A.nativeFlowResponseMessage,r),r.oneofs&&(s.interactiveResponseMessage="nativeFlowResponseMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveResponseMessage"},i.Body=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.text=s.string();break}case 2:{d.format=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveResponseMessage.Body)return s;var g=new p.proto.Message.InteractiveResponseMessage.Body;switch(s.text!=null&&(g.text=String(s.text)),s.format){default:if(typeof s.format=="number"){g.format=s.format;break}break;case"DEFAULT":case 0:g.format=0;break;case"EXTENSIONS_1":case 1:g.format=1;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.format!=null&&s.hasOwnProperty("format")&&(c.format=g.enums===String?p.proto.Message.InteractiveResponseMessage.Body.Format[s.format]===void 0?s.format:p.proto.Message.InteractiveResponseMessage.Body.Format[s.format]:s.format,g.oneofs&&(c._format="format")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.Body"},a.Format=(function(){let r={},s=Object.create(r);return s[r[0]="DEFAULT"]=0,s[r[1]="EXTENSIONS_1"]=1,s})(),a})(),i.NativeFlowResponseMessage=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.name=s.string();break}case 2:{d.paramsJson=s.string();break}case 3:{d.version=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage)return s;var g=new p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage;return s.name!=null&&(g.name=String(s.name)),s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),s.version!=null&&(g.version=s.version|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name,g.oneofs&&(c._name="name")),s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),s.version!=null&&s.hasOwnProperty("version")&&(c.version=s.version,g.oneofs&&(c._version="version")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage"},a})(),i})(),t.InvoiceMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.note=A.string();break}case 2:{c.token=A.string();break}case 3:{c.attachmentType=A.int32();break}case 4:{c.attachmentMimetype=A.string();break}case 5:{c.attachmentMediaKey=A.bytes();break}case 6:{c.attachmentMediaKeyTimestamp=A.int64();break}case 7:{c.attachmentFileSha256=A.bytes();break}case 8:{c.attachmentFileEncSha256=A.bytes();break}case 9:{c.attachmentDirectPath=A.string();break}case 10:{c.attachmentJpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InvoiceMessage)return A;var r=new p.proto.Message.InvoiceMessage;switch(A.note!=null&&(r.note=String(A.note)),A.token!=null&&(r.token=String(A.token)),A.attachmentType){default:if(typeof A.attachmentType=="number"){r.attachmentType=A.attachmentType;break}break;case"IMAGE":case 0:r.attachmentType=0;break;case"PDF":case 1:r.attachmentType=1;break}return A.attachmentMimetype!=null&&(r.attachmentMimetype=String(A.attachmentMimetype)),A.attachmentMediaKey!=null&&(typeof A.attachmentMediaKey=="string"?l.base64.decode(A.attachmentMediaKey,r.attachmentMediaKey=l.newBuffer(l.base64.length(A.attachmentMediaKey)),0):A.attachmentMediaKey.length>=0&&(r.attachmentMediaKey=A.attachmentMediaKey)),A.attachmentMediaKeyTimestamp!=null&&(l.Long?(r.attachmentMediaKeyTimestamp=l.Long.fromValue(A.attachmentMediaKeyTimestamp)).unsigned=!1:typeof A.attachmentMediaKeyTimestamp=="string"?r.attachmentMediaKeyTimestamp=parseInt(A.attachmentMediaKeyTimestamp,10):typeof A.attachmentMediaKeyTimestamp=="number"?r.attachmentMediaKeyTimestamp=A.attachmentMediaKeyTimestamp:typeof A.attachmentMediaKeyTimestamp=="object"&&(r.attachmentMediaKeyTimestamp=new l.LongBits(A.attachmentMediaKeyTimestamp.low>>>0,A.attachmentMediaKeyTimestamp.high>>>0).toNumber())),A.attachmentFileSha256!=null&&(typeof A.attachmentFileSha256=="string"?l.base64.decode(A.attachmentFileSha256,r.attachmentFileSha256=l.newBuffer(l.base64.length(A.attachmentFileSha256)),0):A.attachmentFileSha256.length>=0&&(r.attachmentFileSha256=A.attachmentFileSha256)),A.attachmentFileEncSha256!=null&&(typeof A.attachmentFileEncSha256=="string"?l.base64.decode(A.attachmentFileEncSha256,r.attachmentFileEncSha256=l.newBuffer(l.base64.length(A.attachmentFileEncSha256)),0):A.attachmentFileEncSha256.length>=0&&(r.attachmentFileEncSha256=A.attachmentFileEncSha256)),A.attachmentDirectPath!=null&&(r.attachmentDirectPath=String(A.attachmentDirectPath)),A.attachmentJpegThumbnail!=null&&(typeof A.attachmentJpegThumbnail=="string"?l.base64.decode(A.attachmentJpegThumbnail,r.attachmentJpegThumbnail=l.newBuffer(l.base64.length(A.attachmentJpegThumbnail)),0):A.attachmentJpegThumbnail.length>=0&&(r.attachmentJpegThumbnail=A.attachmentJpegThumbnail)),r},i.toObject=function(A,r){r||(r={});var s={};return A.note!=null&&A.hasOwnProperty("note")&&(s.note=A.note,r.oneofs&&(s._note="note")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.attachmentType!=null&&A.hasOwnProperty("attachmentType")&&(s.attachmentType=r.enums===String?p.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]===void 0?A.attachmentType:p.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]:A.attachmentType,r.oneofs&&(s._attachmentType="attachmentType")),A.attachmentMimetype!=null&&A.hasOwnProperty("attachmentMimetype")&&(s.attachmentMimetype=A.attachmentMimetype,r.oneofs&&(s._attachmentMimetype="attachmentMimetype")),A.attachmentMediaKey!=null&&A.hasOwnProperty("attachmentMediaKey")&&(s.attachmentMediaKey=r.bytes===String?l.base64.encode(A.attachmentMediaKey,0,A.attachmentMediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentMediaKey):A.attachmentMediaKey,r.oneofs&&(s._attachmentMediaKey="attachmentMediaKey")),A.attachmentMediaKeyTimestamp!=null&&A.hasOwnProperty("attachmentMediaKeyTimestamp")&&(typeof A.attachmentMediaKeyTimestamp=="number"?s.attachmentMediaKeyTimestamp=r.longs===String?String(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp:s.attachmentMediaKeyTimestamp=r.longs===String?ge(A.attachmentMediaKeyTimestamp):r.longs===Number?ce(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp,r.oneofs&&(s._attachmentMediaKeyTimestamp="attachmentMediaKeyTimestamp")),A.attachmentFileSha256!=null&&A.hasOwnProperty("attachmentFileSha256")&&(s.attachmentFileSha256=r.bytes===String?l.base64.encode(A.attachmentFileSha256,0,A.attachmentFileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileSha256):A.attachmentFileSha256,r.oneofs&&(s._attachmentFileSha256="attachmentFileSha256")),A.attachmentFileEncSha256!=null&&A.hasOwnProperty("attachmentFileEncSha256")&&(s.attachmentFileEncSha256=r.bytes===String?l.base64.encode(A.attachmentFileEncSha256,0,A.attachmentFileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileEncSha256):A.attachmentFileEncSha256,r.oneofs&&(s._attachmentFileEncSha256="attachmentFileEncSha256")),A.attachmentDirectPath!=null&&A.hasOwnProperty("attachmentDirectPath")&&(s.attachmentDirectPath=A.attachmentDirectPath,r.oneofs&&(s._attachmentDirectPath="attachmentDirectPath")),A.attachmentJpegThumbnail!=null&&A.hasOwnProperty("attachmentJpegThumbnail")&&(s.attachmentJpegThumbnail=r.bytes===String?l.base64.encode(A.attachmentJpegThumbnail,0,A.attachmentJpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentJpegThumbnail):A.attachmentJpegThumbnail,r.oneofs&&(s._attachmentJpegThumbnail="attachmentJpegThumbnail")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InvoiceMessage"},i.AttachmentType=(function(){let a={},A=Object.create(a);return A[a[0]="IMAGE"]=0,A[a[1]="PDF"]=1,A})(),i})(),t.KeepInChatMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.keepType=A.int32();break}case 3:{c.timestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.KeepInChatMessage)return A;var r=new p.proto.Message.KeepInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.KeepInChatMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.keepType){default:if(typeof A.keepType=="number"){r.keepType=A.keepType;break}break;case"UNKNOWN":case 0:r.keepType=0;break;case"KEEP_FOR_ALL":case 1:r.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:r.keepType=2;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.keepType!=null&&A.hasOwnProperty("keepType")&&(s.keepType=r.enums===String?p.proto.KeepType[A.keepType]===void 0?A.keepType:p.proto.KeepType[A.keepType]:A.keepType,r.oneofs&&(s._keepType="keepType")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.KeepInChatMessage"},i})(),t.LinkPreviewMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 2:{c.urlMetadata=p.proto.Message.URLMetadata.decode(A,A.uint32());break}case 3:{c.fbExperimentId=A.uint32();break}case 4:{c.linkMediaDuration=A.uint32();break}case 5:{c.socialMediaPostType=A.int32();break}case 6:{c.linkInlineVideoMuted=A.bool();break}case 7:{c.videoContentUrl=A.string();break}case 8:{c.musicMetadata=p.proto.EmbeddedMusic.decode(A,A.uint32());break}case 9:{c.videoContentCaption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LinkPreviewMetadata)return A;var r=new p.proto.Message.LinkPreviewMetadata;if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected");r.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.urlMetadata!=null){if(typeof A.urlMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected");r.urlMetadata=p.proto.Message.URLMetadata.fromObject(A.urlMetadata)}switch(A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),A.linkMediaDuration!=null&&(r.linkMediaDuration=A.linkMediaDuration>>>0),A.socialMediaPostType){default:if(typeof A.socialMediaPostType=="number"){r.socialMediaPostType=A.socialMediaPostType;break}break;case"NONE":case 0:r.socialMediaPostType=0;break;case"REEL":case 1:r.socialMediaPostType=1;break;case"LIVE_VIDEO":case 2:r.socialMediaPostType=2;break;case"LONG_VIDEO":case 3:r.socialMediaPostType=3;break;case"SINGLE_IMAGE":case 4:r.socialMediaPostType=4;break;case"CAROUSEL":case 5:r.socialMediaPostType=5;break}if(A.linkInlineVideoMuted!=null&&(r.linkInlineVideoMuted=!!A.linkInlineVideoMuted),A.videoContentUrl!=null&&(r.videoContentUrl=String(A.videoContentUrl)),A.musicMetadata!=null){if(typeof A.musicMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.musicMetadata: object expected");r.musicMetadata=p.proto.EmbeddedMusic.fromObject(A.musicMetadata)}return A.videoContentCaption!=null&&(r.videoContentCaption=String(A.videoContentCaption)),r},i.toObject=function(A,r){r||(r={});var s={};return A.paymentLinkMetadata!=null&&A.hasOwnProperty("paymentLinkMetadata")&&(s.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.toObject(A.paymentLinkMetadata,r),r.oneofs&&(s._paymentLinkMetadata="paymentLinkMetadata")),A.urlMetadata!=null&&A.hasOwnProperty("urlMetadata")&&(s.urlMetadata=p.proto.Message.URLMetadata.toObject(A.urlMetadata,r),r.oneofs&&(s._urlMetadata="urlMetadata")),A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),A.linkMediaDuration!=null&&A.hasOwnProperty("linkMediaDuration")&&(s.linkMediaDuration=A.linkMediaDuration,r.oneofs&&(s._linkMediaDuration="linkMediaDuration")),A.socialMediaPostType!=null&&A.hasOwnProperty("socialMediaPostType")&&(s.socialMediaPostType=r.enums===String?p.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]===void 0?A.socialMediaPostType:p.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]:A.socialMediaPostType,r.oneofs&&(s._socialMediaPostType="socialMediaPostType")),A.linkInlineVideoMuted!=null&&A.hasOwnProperty("linkInlineVideoMuted")&&(s.linkInlineVideoMuted=A.linkInlineVideoMuted,r.oneofs&&(s._linkInlineVideoMuted="linkInlineVideoMuted")),A.videoContentUrl!=null&&A.hasOwnProperty("videoContentUrl")&&(s.videoContentUrl=A.videoContentUrl,r.oneofs&&(s._videoContentUrl="videoContentUrl")),A.musicMetadata!=null&&A.hasOwnProperty("musicMetadata")&&(s.musicMetadata=p.proto.EmbeddedMusic.toObject(A.musicMetadata,r),r.oneofs&&(s._musicMetadata="musicMetadata")),A.videoContentCaption!=null&&A.hasOwnProperty("videoContentCaption")&&(s.videoContentCaption=A.videoContentCaption,r.oneofs&&(s._videoContentCaption="videoContentCaption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LinkPreviewMetadata"},i.SocialMediaPostType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="REEL"]=1,A[a[2]="LIVE_VIDEO"]=2,A[a[3]="LONG_VIDEO"]=3,A[a[4]="SINGLE_IMAGE"]=4,A[a[5]="CAROUSEL"]=5,A})(),i})(),t.ListMessage=(function(){function i(a){if(this.sections=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.description=A.string();break}case 3:{c.buttonText=A.string();break}case 4:{c.listType=A.int32();break}case 5:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(p.proto.Message.ListMessage.Section.decode(A,A.uint32()));break}case 6:{c.productListInfo=p.proto.Message.ListMessage.ProductListInfo.decode(A,A.uint32());break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ListMessage)return A;var r=new p.proto.Message.ListMessage;switch(A.title!=null&&(r.title=String(A.title)),A.description!=null&&(r.description=String(A.description)),A.buttonText!=null&&(r.buttonText=String(A.buttonText)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break;case"PRODUCT_LIST":case 2:r.listType=2;break}if(A.sections){if(!Array.isArray(A.sections))throw TypeError(".proto.Message.ListMessage.sections: array expected");r.sections=[];for(var s=0;s>>3){case 1:{d.productId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Product)return s;var g=new p.proto.Message.ListMessage.Product;return s.productId!=null&&(g.productId=String(s.productId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Product"},a})(),i.ProductListHeaderImage=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.productId=s.string();break}case 2:{d.jpegThumbnail=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductListHeaderImage)return s;var g=new p.proto.Message.ListMessage.ProductListHeaderImage;return s.productId!=null&&(g.productId=String(s.productId)),s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c._jpegThumbnail="jpegThumbnail")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.ProductListHeaderImage"},a})(),i.ProductListInfo=(function(){function a(r){if(this.productSections=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.productSections&&d.productSections.length||(d.productSections=[]),d.productSections.push(p.proto.Message.ListMessage.ProductSection.decode(s,s.uint32()));break}case 2:{d.headerImage=p.proto.Message.ListMessage.ProductListHeaderImage.decode(s,s.uint32());break}case 3:{d.businessOwnerJid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductListInfo)return s;var g=new p.proto.Message.ListMessage.ProductListInfo;if(s.productSections){if(!Array.isArray(s.productSections))throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected");g.productSections=[];for(var c=0;c>>3){case 1:{d.title=s.string();break}case 2:{d.products&&d.products.length||(d.products=[]),d.products.push(p.proto.Message.ListMessage.Product.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductSection)return s;var g=new p.proto.Message.ListMessage.ProductSection;if(s.title!=null&&(g.title=String(s.title)),s.products){if(!Array.isArray(s.products))throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected");g.products=[];for(var c=0;c>>3){case 1:{d.title=s.string();break}case 2:{d.description=s.string();break}case 3:{d.rowId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Row)return s;var g=new p.proto.Message.ListMessage.Row;return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.rowId!=null&&(g.rowId=String(s.rowId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.rowId!=null&&s.hasOwnProperty("rowId")&&(c.rowId=s.rowId,g.oneofs&&(c._rowId="rowId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Row"},a})(),i.Section=(function(){function a(r){if(this.rows=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.title=s.string();break}case 2:{d.rows&&d.rows.length||(d.rows=[]),d.rows.push(p.proto.Message.ListMessage.Row.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Section)return s;var g=new p.proto.Message.ListMessage.Section;if(s.title!=null&&(g.title=String(s.title)),s.rows){if(!Array.isArray(s.rows))throw TypeError(".proto.Message.ListMessage.Section.rows: array expected");g.rows=[];for(var c=0;c>>3){case 1:{c.title=A.string();break}case 2:{c.listType=A.int32();break}case 3:{c.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.decode(A,A.uint32());break}case 4:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 5:{c.description=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ListResponseMessage)return A;var r=new p.proto.Message.ListResponseMessage;switch(A.title!=null&&(r.title=String(A.title)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break}if(A.singleSelectReply!=null){if(typeof A.singleSelectReply!="object")throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected");r.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(A.singleSelectReply)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.description!=null&&(r.description=String(A.description)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.listType!=null&&A.hasOwnProperty("listType")&&(s.listType=r.enums===String?p.proto.Message.ListResponseMessage.ListType[A.listType]===void 0?A.listType:p.proto.Message.ListResponseMessage.ListType[A.listType]:A.listType,r.oneofs&&(s._listType="listType")),A.singleSelectReply!=null&&A.hasOwnProperty("singleSelectReply")&&(s.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.toObject(A.singleSelectReply,r),r.oneofs&&(s._singleSelectReply="singleSelectReply")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ListResponseMessage"},i.ListType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="SINGLE_SELECT"]=1,A})(),i.SingleSelectReply=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.selectedRowId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListResponseMessage.SingleSelectReply)return s;var g=new p.proto.Message.ListResponseMessage.SingleSelectReply;return s.selectedRowId!=null&&(g.selectedRowId=String(s.selectedRowId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.selectedRowId!=null&&s.hasOwnProperty("selectedRowId")&&(c.selectedRowId=s.selectedRowId,g.oneofs&&(c._selectedRowId="selectedRowId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListResponseMessage.SingleSelectReply"},a})(),i})(),t.LiveLocationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.accuracyInMeters=A.uint32();break}case 4:{c.speedInMps=A.float();break}case 5:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 6:{c.caption=A.string();break}case 7:{c.sequenceNumber=A.int64();break}case 8:{c.timeOffset=A.uint32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LiveLocationMessage)return A;var r=new p.proto.Message.LiveLocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.sequenceNumber!=null&&(l.Long?(r.sequenceNumber=l.Long.fromValue(A.sequenceNumber)).unsigned=!1:typeof A.sequenceNumber=="string"?r.sequenceNumber=parseInt(A.sequenceNumber,10):typeof A.sequenceNumber=="number"?r.sequenceNumber=A.sequenceNumber:typeof A.sequenceNumber=="object"&&(r.sequenceNumber=new l.LongBits(A.sequenceNumber.low>>>0,A.sequenceNumber.high>>>0).toNumber())),A.timeOffset!=null&&(r.timeOffset=A.timeOffset>>>0),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.sequenceNumber!=null&&A.hasOwnProperty("sequenceNumber")&&(typeof A.sequenceNumber=="number"?s.sequenceNumber=r.longs===String?String(A.sequenceNumber):A.sequenceNumber:s.sequenceNumber=r.longs===String?ge(A.sequenceNumber):r.longs===Number?ce(A.sequenceNumber):A.sequenceNumber,r.oneofs&&(s._sequenceNumber="sequenceNumber")),A.timeOffset!=null&&A.hasOwnProperty("timeOffset")&&(s.timeOffset=A.timeOffset,r.oneofs&&(s._timeOffset="timeOffset")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LiveLocationMessage"},i})(),t.LocationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.isLive=A.bool();break}case 7:{c.accuracyInMeters=A.uint32();break}case 8:{c.speedInMps=A.float();break}case 9:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 11:{c.comment=A.string();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LocationMessage)return A;var r=new p.proto.Message.LocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.isLive!=null&&(r.isLive=!!A.isLive),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.comment!=null&&(r.comment=String(A.comment)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.isLive!=null&&A.hasOwnProperty("isLive")&&(s.isLive=A.isLive,r.oneofs&&(s._isLive="isLive")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.comment!=null&&A.hasOwnProperty("comment")&&(s.comment=A.comment,r.oneofs&&(s._comment="comment")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LocationMessage"},i})(),t.MMSThumbnailMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.thumbnailDirectPath=A.string();break}case 2:{c.thumbnailSha256=A.bytes();break}case 3:{c.thumbnailEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mediaKeyTimestamp=A.int64();break}case 6:{c.thumbnailHeight=A.uint32();break}case 7:{c.thumbnailWidth=A.uint32();break}case 8:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MMSThumbnailMetadata)return A;var r=new p.proto.Message.MMSThumbnailMetadata;switch(A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MMSThumbnailMetadata"},i})(),t.MediaKeyDomain=(function(){let i={},e=Object.create(i);return e[i[0]="UNSET"]=0,e[i[1]="E2EE_CHAT"]=1,e[i[2]="STATUS"]=2,e[i[3]="CAPI"]=3,e[i[4]="BOT"]=4,e})(),t.MessageHistoryBundle=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.mimetype=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.mediaKeyTimestamp=A.int64();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryBundle)return A;var r=new p.proto.Message.MessageHistoryBundle;if(A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected");r.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryBundle"},i})(),t.MessageHistoryMetadata=(function(){function i(a){if(this.historyReceivers=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.historyReceivers&&c.historyReceivers.length||(c.historyReceivers=[]),c.historyReceivers.push(A.string());break}case 2:{c.oldestMessageTimestamp=A.int64();break}case 3:{c.messageCount=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryMetadata)return A;var r=new p.proto.Message.MessageHistoryMetadata;if(A.historyReceivers){if(!Array.isArray(A.historyReceivers))throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected");r.historyReceivers=[];for(var s=0;s>>0,A.oldestMessageTimestamp.high>>>0).toNumber())),A.messageCount!=null&&(l.Long?(r.messageCount=l.Long.fromValue(A.messageCount)).unsigned=!1:typeof A.messageCount=="string"?r.messageCount=parseInt(A.messageCount,10):typeof A.messageCount=="number"?r.messageCount=A.messageCount:typeof A.messageCount=="object"&&(r.messageCount=new l.LongBits(A.messageCount.low>>>0,A.messageCount.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.historyReceivers=[]),A.historyReceivers&&A.historyReceivers.length){s.historyReceivers=[];for(var g=0;g>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryNotice)return A;var r=new p.proto.Message.MessageHistoryNotice;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected");r.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryNotice"},i})(),t.NewsletterAdminInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.inviteExpiration=A.int64();break}case 6:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.NewsletterAdminInviteMessage)return A;var r=new p.proto.Message.NewsletterAdminInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterAdminInviteMessage"},i})(),t.NewsletterFollowerInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.NewsletterFollowerInviteMessage)return A;var r=new p.proto.Message.NewsletterFollowerInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterFollowerInviteMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterFollowerInviteMessage"},i})(),t.OrderMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.orderId=A.string();break}case 2:{c.thumbnail=A.bytes();break}case 3:{c.itemCount=A.int32();break}case 4:{c.status=A.int32();break}case 5:{c.surface=A.int32();break}case 6:{c.message=A.string();break}case 7:{c.orderTitle=A.string();break}case 8:{c.sellerJid=A.string();break}case 9:{c.token=A.string();break}case 10:{c.totalAmount1000=A.int64();break}case 11:{c.totalCurrencyCode=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.messageVersion=A.int32();break}case 13:{c.orderRequestMessageId=p.proto.MessageKey.decode(A,A.uint32());break}case 15:{c.catalogType=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.OrderMessage)return A;var r=new p.proto.Message.OrderMessage;switch(A.orderId!=null&&(r.orderId=String(A.orderId)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.itemCount!=null&&(r.itemCount=A.itemCount|0),A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"INQUIRY":case 1:r.status=1;break;case"ACCEPTED":case 2:r.status=2;break;case"DECLINED":case 3:r.status=3;break}switch(A.surface){default:if(typeof A.surface=="number"){r.surface=A.surface;break}break;case"CATALOG":case 1:r.surface=1;break}if(A.message!=null&&(r.message=String(A.message)),A.orderTitle!=null&&(r.orderTitle=String(A.orderTitle)),A.sellerJid!=null&&(r.sellerJid=String(A.sellerJid)),A.token!=null&&(r.token=String(A.token)),A.totalAmount1000!=null&&(l.Long?(r.totalAmount1000=l.Long.fromValue(A.totalAmount1000)).unsigned=!1:typeof A.totalAmount1000=="string"?r.totalAmount1000=parseInt(A.totalAmount1000,10):typeof A.totalAmount1000=="number"?r.totalAmount1000=A.totalAmount1000:typeof A.totalAmount1000=="object"&&(r.totalAmount1000=new l.LongBits(A.totalAmount1000.low>>>0,A.totalAmount1000.high>>>0).toNumber())),A.totalCurrencyCode!=null&&(r.totalCurrencyCode=String(A.totalCurrencyCode)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageVersion!=null&&(r.messageVersion=A.messageVersion|0),A.orderRequestMessageId!=null){if(typeof A.orderRequestMessageId!="object")throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected");r.orderRequestMessageId=p.proto.MessageKey.fromObject(A.orderRequestMessageId)}return A.catalogType!=null&&(r.catalogType=String(A.catalogType)),r},i.toObject=function(A,r){r||(r={});var s={};return A.orderId!=null&&A.hasOwnProperty("orderId")&&(s.orderId=A.orderId,r.oneofs&&(s._orderId="orderId")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.itemCount!=null&&A.hasOwnProperty("itemCount")&&(s.itemCount=A.itemCount,r.oneofs&&(s._itemCount="itemCount")),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?p.proto.Message.OrderMessage.OrderStatus[A.status]===void 0?A.status:p.proto.Message.OrderMessage.OrderStatus[A.status]:A.status,r.oneofs&&(s._status="status")),A.surface!=null&&A.hasOwnProperty("surface")&&(s.surface=r.enums===String?p.proto.Message.OrderMessage.OrderSurface[A.surface]===void 0?A.surface:p.proto.Message.OrderMessage.OrderSurface[A.surface]:A.surface,r.oneofs&&(s._surface="surface")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.orderTitle!=null&&A.hasOwnProperty("orderTitle")&&(s.orderTitle=A.orderTitle,r.oneofs&&(s._orderTitle="orderTitle")),A.sellerJid!=null&&A.hasOwnProperty("sellerJid")&&(s.sellerJid=A.sellerJid,r.oneofs&&(s._sellerJid="sellerJid")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.totalAmount1000!=null&&A.hasOwnProperty("totalAmount1000")&&(typeof A.totalAmount1000=="number"?s.totalAmount1000=r.longs===String?String(A.totalAmount1000):A.totalAmount1000:s.totalAmount1000=r.longs===String?ge(A.totalAmount1000):r.longs===Number?ce(A.totalAmount1000):A.totalAmount1000,r.oneofs&&(s._totalAmount1000="totalAmount1000")),A.totalCurrencyCode!=null&&A.hasOwnProperty("totalCurrencyCode")&&(s.totalCurrencyCode=A.totalCurrencyCode,r.oneofs&&(s._totalCurrencyCode="totalCurrencyCode")),A.messageVersion!=null&&A.hasOwnProperty("messageVersion")&&(s.messageVersion=A.messageVersion,r.oneofs&&(s._messageVersion="messageVersion")),A.orderRequestMessageId!=null&&A.hasOwnProperty("orderRequestMessageId")&&(s.orderRequestMessageId=p.proto.MessageKey.toObject(A.orderRequestMessageId,r),r.oneofs&&(s._orderRequestMessageId="orderRequestMessageId")),A.catalogType!=null&&A.hasOwnProperty("catalogType")&&(s.catalogType=A.catalogType,r.oneofs&&(s._catalogType="catalogType")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.OrderMessage"},i.OrderStatus=(function(){let a={},A=Object.create(a);return A[a[1]="INQUIRY"]=1,A[a[2]="ACCEPTED"]=2,A[a[3]="DECLINED"]=3,A})(),i.OrderSurface=(function(){let a={},A=Object.create(a);return A[a[1]="CATALOG"]=1,A})(),i})(),t.PaymentExtendedMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.uint32();break}case 2:{c.platform=A.string();break}case 3:{c.messageParamsJson=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentExtendedMetadata)return A;var r=new p.proto.Message.PaymentExtendedMetadata;return A.type!=null&&(r.type=A.type>>>0),A.platform!=null&&(r.platform=String(A.platform)),A.messageParamsJson!=null&&(r.messageParamsJson=String(A.messageParamsJson)),r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=A.type,r.oneofs&&(s._type="type")),A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=A.platform,r.oneofs&&(s._platform="platform")),A.messageParamsJson!=null&&A.hasOwnProperty("messageParamsJson")&&(s.messageParamsJson=A.messageParamsJson,r.oneofs&&(s._messageParamsJson="messageParamsJson")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentExtendedMetadata"},i})(),t.PaymentInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serviceType=A.int32();break}case 2:{c.expiryTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentInviteMessage)return A;var r=new p.proto.Message.PaymentInviteMessage;switch(A.serviceType){default:if(typeof A.serviceType=="number"){r.serviceType=A.serviceType;break}break;case"UNKNOWN":case 0:r.serviceType=0;break;case"FBPAY":case 1:r.serviceType=1;break;case"NOVI":case 2:r.serviceType=2;break;case"UPI":case 3:r.serviceType=3;break}return A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.serviceType!=null&&A.hasOwnProperty("serviceType")&&(s.serviceType=r.enums===String?p.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]===void 0?A.serviceType:p.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]:A.serviceType,r.oneofs&&(s._serviceType="serviceType")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentInviteMessage"},i.ServiceType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="FBPAY"]=1,A[a[2]="NOVI"]=2,A[a[3]="UPI"]=3,A})(),i})(),t.PaymentLinkMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.decode(A,A.uint32());break}case 2:{c.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.decode(A,A.uint32());break}case 3:{c.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentLinkMetadata)return A;var r=new p.proto.Message.PaymentLinkMetadata;if(A.button!=null){if(typeof A.button!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected");r.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(A.button)}if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected");r.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(A.header)}if(A.provider!=null){if(typeof A.provider!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.provider: object expected");r.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.fromObject(A.provider)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.button!=null&&A.hasOwnProperty("button")&&(s.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(A.button,r),r.oneofs&&(s._button="button")),A.header!=null&&A.hasOwnProperty("header")&&(s.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(A.header,r),r.oneofs&&(s._header="header")),A.provider!=null&&A.hasOwnProperty("provider")&&(s.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.toObject(A.provider,r),r.oneofs&&(s._provider="provider")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentLinkMetadata"},i.PaymentLinkButton=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.displayText=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkButton)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkButton;return s.displayText!=null&&(g.displayText=String(s.displayText)),g},a.toObject=function(s,g){g||(g={});var c={};return s.displayText!=null&&s.hasOwnProperty("displayText")&&(c.displayText=s.displayText,g.oneofs&&(c._displayText="displayText")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkButton"},a})(),i.PaymentLinkHeader=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.headerType=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader;switch(s.headerType){default:if(typeof s.headerType=="number"){g.headerType=s.headerType;break}break;case"LINK_PREVIEW":case 0:g.headerType=0;break;case"ORDER":case 1:g.headerType=1;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.headerType!=null&&s.hasOwnProperty("headerType")&&(c.headerType=g.enums===String?p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]===void 0?s.headerType:p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]:s.headerType,g.oneofs&&(c._headerType="headerType")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkHeader"},a.PaymentLinkHeaderType=(function(){let r={},s=Object.create(r);return s[r[0]="LINK_PREVIEW"]=0,s[r[1]="ORDER"]=1,s})(),a})(),i.PaymentLinkProvider=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.paramsJson=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider;return s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),g},a.toObject=function(s,g){g||(g={});var c={};return s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkProvider"},a})(),i})(),t.PeerDataOperationRequestMessage=(function(){function i(a){if(this.requestStickerReupload=[],this.requestUrlPreview=[],this.placeholderMessageResendRequest=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.requestStickerReupload&&c.requestStickerReupload.length||(c.requestStickerReupload=[]),c.requestStickerReupload.push(p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.decode(A,A.uint32()));break}case 3:{c.requestUrlPreview&&c.requestUrlPreview.length||(c.requestUrlPreview=[]),c.requestUrlPreview.push(p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(A,A.uint32()));break}case 4:{c.historySyncOnDemandRequest=p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(A,A.uint32());break}case 5:{c.placeholderMessageResendRequest&&c.placeholderMessageResendRequest.length||(c.placeholderMessageResendRequest=[]),c.placeholderMessageResendRequest.push(p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.decode(A,A.uint32()));break}case 6:{c.fullHistorySyncOnDemandRequest=p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.decode(A,A.uint32());break}case 7:{c.syncdCollectionFatalRecoveryRequest=p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.decode(A,A.uint32());break}case 8:{c.historySyncChunkRetryRequest=p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.decode(A,A.uint32());break}case 9:{c.galaxyFlowAction=p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PeerDataOperationRequestMessage)return A;var r=new p.proto.Message.PeerDataOperationRequestMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.requestStickerReupload){if(!Array.isArray(A.requestStickerReupload))throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected");r.requestStickerReupload=[];for(var s=0;s>>3){case 1:{d.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(s,s.uint32());break}case 2:{d.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest;if(s.requestMetadata!=null){if(typeof s.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected");g.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(s.requestMetadata)}if(s.historySyncConfig!=null){if(typeof s.historySyncConfig!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected");g.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.fromObject(s.historySyncConfig)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.requestMetadata!=null&&s.hasOwnProperty("requestMetadata")&&(c.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(s.requestMetadata,g),g.oneofs&&(c._requestMetadata="requestMetadata")),s.historySyncConfig!=null&&s.hasOwnProperty("historySyncConfig")&&(c.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.toObject(s.historySyncConfig,g),g.oneofs&&(c._historySyncConfig="historySyncConfig")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest"},a})(),i.GalaxyFlowAction=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.type=s.int32();break}case 2:{d.flowId=s.string();break}case 3:{d.stanzaId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction;switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"NOTIFY_LAUNCH":case 1:g.type=1;break}return s.flowId!=null&&(g.flowId=String(s.flowId)),s.stanzaId!=null&&(g.stanzaId=String(s.stanzaId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]===void 0?s.type:p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]:s.type,g.oneofs&&(c._type="type")),s.flowId!=null&&s.hasOwnProperty("flowId")&&(c.flowId=s.flowId,g.oneofs&&(c._flowId="flowId")),s.stanzaId!=null&&s.hasOwnProperty("stanzaId")&&(c.stanzaId=s.stanzaId,g.oneofs&&(c._stanzaId="stanzaId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction"},a.GalaxyFlowActionType=(function(){let r={},s=Object.create(r);return s[r[1]="NOTIFY_LAUNCH"]=1,s})(),a})(),i.HistorySyncChunkRetryRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.syncType=s.int32();break}case 2:{d.chunkOrder=s.uint32();break}case 3:{d.chunkNotificationId=s.string();break}case 4:{d.regenerateChunk=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest;switch(s.syncType){default:if(typeof s.syncType=="number"){g.syncType=s.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:g.syncType=0;break;case"INITIAL_STATUS_V3":case 1:g.syncType=1;break;case"FULL":case 2:g.syncType=2;break;case"RECENT":case 3:g.syncType=3;break;case"PUSH_NAME":case 4:g.syncType=4;break;case"NON_BLOCKING_DATA":case 5:g.syncType=5;break;case"ON_DEMAND":case 6:g.syncType=6;break;case"NO_HISTORY":case 7:g.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:g.syncType=8;break}return s.chunkOrder!=null&&(g.chunkOrder=s.chunkOrder>>>0),s.chunkNotificationId!=null&&(g.chunkNotificationId=String(s.chunkNotificationId)),s.regenerateChunk!=null&&(g.regenerateChunk=!!s.regenerateChunk),g},a.toObject=function(s,g){g||(g={});var c={};return s.syncType!=null&&s.hasOwnProperty("syncType")&&(c.syncType=g.enums===String?p.proto.Message.HistorySyncType[s.syncType]===void 0?s.syncType:p.proto.Message.HistorySyncType[s.syncType]:s.syncType,g.oneofs&&(c._syncType="syncType")),s.chunkOrder!=null&&s.hasOwnProperty("chunkOrder")&&(c.chunkOrder=s.chunkOrder,g.oneofs&&(c._chunkOrder="chunkOrder")),s.chunkNotificationId!=null&&s.hasOwnProperty("chunkNotificationId")&&(c.chunkNotificationId=s.chunkNotificationId,g.oneofs&&(c._chunkNotificationId="chunkNotificationId")),s.regenerateChunk!=null&&s.hasOwnProperty("regenerateChunk")&&(c.regenerateChunk=s.regenerateChunk,g.oneofs&&(c._regenerateChunk="regenerateChunk")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest"},a})(),i.HistorySyncOnDemandRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.chatJid=s.string();break}case 2:{d.oldestMsgId=s.string();break}case 3:{d.oldestMsgFromMe=s.bool();break}case 4:{d.onDemandMsgCount=s.int32();break}case 5:{d.oldestMsgTimestampMs=s.int64();break}case 6:{d.accountLid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest;return s.chatJid!=null&&(g.chatJid=String(s.chatJid)),s.oldestMsgId!=null&&(g.oldestMsgId=String(s.oldestMsgId)),s.oldestMsgFromMe!=null&&(g.oldestMsgFromMe=!!s.oldestMsgFromMe),s.onDemandMsgCount!=null&&(g.onDemandMsgCount=s.onDemandMsgCount|0),s.oldestMsgTimestampMs!=null&&(l.Long?(g.oldestMsgTimestampMs=l.Long.fromValue(s.oldestMsgTimestampMs)).unsigned=!1:typeof s.oldestMsgTimestampMs=="string"?g.oldestMsgTimestampMs=parseInt(s.oldestMsgTimestampMs,10):typeof s.oldestMsgTimestampMs=="number"?g.oldestMsgTimestampMs=s.oldestMsgTimestampMs:typeof s.oldestMsgTimestampMs=="object"&&(g.oldestMsgTimestampMs=new l.LongBits(s.oldestMsgTimestampMs.low>>>0,s.oldestMsgTimestampMs.high>>>0).toNumber())),s.accountLid!=null&&(g.accountLid=String(s.accountLid)),g},a.toObject=function(s,g){g||(g={});var c={};return s.chatJid!=null&&s.hasOwnProperty("chatJid")&&(c.chatJid=s.chatJid,g.oneofs&&(c._chatJid="chatJid")),s.oldestMsgId!=null&&s.hasOwnProperty("oldestMsgId")&&(c.oldestMsgId=s.oldestMsgId,g.oneofs&&(c._oldestMsgId="oldestMsgId")),s.oldestMsgFromMe!=null&&s.hasOwnProperty("oldestMsgFromMe")&&(c.oldestMsgFromMe=s.oldestMsgFromMe,g.oneofs&&(c._oldestMsgFromMe="oldestMsgFromMe")),s.onDemandMsgCount!=null&&s.hasOwnProperty("onDemandMsgCount")&&(c.onDemandMsgCount=s.onDemandMsgCount,g.oneofs&&(c._onDemandMsgCount="onDemandMsgCount")),s.oldestMsgTimestampMs!=null&&s.hasOwnProperty("oldestMsgTimestampMs")&&(typeof s.oldestMsgTimestampMs=="number"?c.oldestMsgTimestampMs=g.longs===String?String(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs:c.oldestMsgTimestampMs=g.longs===String?ge(s.oldestMsgTimestampMs):g.longs===Number?ce(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs,g.oneofs&&(c._oldestMsgTimestampMs="oldestMsgTimestampMs")),s.accountLid!=null&&s.hasOwnProperty("accountLid")&&(c.accountLid=s.accountLid,g.oneofs&&(c._accountLid="accountLid")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest"},a})(),i.PlaceholderMessageResendRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.messageKey=p.proto.MessageKey.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest;if(s.messageKey!=null){if(typeof s.messageKey!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected");g.messageKey=p.proto.MessageKey.fromObject(s.messageKey)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.messageKey!=null&&s.hasOwnProperty("messageKey")&&(c.messageKey=p.proto.MessageKey.toObject(s.messageKey,g),g.oneofs&&(c._messageKey="messageKey")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest"},a})(),i.RequestStickerReupload=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.fileSha256=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload;return s.fileSha256!=null&&(g.fileSha256=String(s.fileSha256)),g},a.toObject=function(s,g){g||(g={});var c={};return s.fileSha256!=null&&s.hasOwnProperty("fileSha256")&&(c.fileSha256=s.fileSha256,g.oneofs&&(c._fileSha256="fileSha256")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload"},a})(),i.RequestUrlPreview=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.url=s.string();break}case 2:{d.includeHqThumbnail=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview;return s.url!=null&&(g.url=String(s.url)),s.includeHqThumbnail!=null&&(g.includeHqThumbnail=!!s.includeHqThumbnail),g},a.toObject=function(s,g){g||(g={});var c={};return s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.includeHqThumbnail!=null&&s.hasOwnProperty("includeHqThumbnail")&&(c.includeHqThumbnail=s.includeHqThumbnail,g.oneofs&&(c._includeHqThumbnail="includeHqThumbnail")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview"},a})(),i.SyncDCollectionFatalRecoveryRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.collectionName=s.string();break}case 2:{d.timestamp=s.int64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest;return s.collectionName!=null&&(g.collectionName=String(s.collectionName)),s.timestamp!=null&&(l.Long?(g.timestamp=l.Long.fromValue(s.timestamp)).unsigned=!1:typeof s.timestamp=="string"?g.timestamp=parseInt(s.timestamp,10):typeof s.timestamp=="number"?g.timestamp=s.timestamp:typeof s.timestamp=="object"&&(g.timestamp=new l.LongBits(s.timestamp.low>>>0,s.timestamp.high>>>0).toNumber())),g},a.toObject=function(s,g){g||(g={});var c={};return s.collectionName!=null&&s.hasOwnProperty("collectionName")&&(c.collectionName=s.collectionName,g.oneofs&&(c._collectionName="collectionName")),s.timestamp!=null&&s.hasOwnProperty("timestamp")&&(typeof s.timestamp=="number"?c.timestamp=g.longs===String?String(s.timestamp):s.timestamp:c.timestamp=g.longs===String?ge(s.timestamp):g.longs===Number?ce(s.timestamp):s.timestamp,g.oneofs&&(c._timestamp="timestamp")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest"},a})(),i})(),t.PeerDataOperationRequestResponseMessage=(function(){function i(a){if(this.peerDataOperationResult=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.stanzaId=A.string();break}case 3:{c.peerDataOperationResult&&c.peerDataOperationResult.length||(c.peerDataOperationResult=[]),c.peerDataOperationResult.push(p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PeerDataOperationRequestResponseMessage)return A;var r=new p.proto.Message.PeerDataOperationRequestResponseMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.stanzaId!=null&&(r.stanzaId=String(A.stanzaId)),A.peerDataOperationResult){if(!Array.isArray(A.peerDataOperationResult))throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected");r.peerDataOperationResult=[];for(var s=0;s>>3){case 1:{d.mediaUploadResult=s.int32();break}case 2:{d.stickerMessage=p.proto.Message.StickerMessage.decode(s,s.uint32());break}case 3:{d.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.decode(s,s.uint32());break}case 4:{d.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.decode(s,s.uint32());break}case 5:{d.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.decode(s,s.uint32());break}case 6:{d.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.decode(s,s.uint32());break}case 7:{d.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.decode(s,s.uint32());break}case 8:{d.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.decode(s,s.uint32());break}case 9:{d.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.decode(s,s.uint32());break}case 10:{d.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult)return s;var g=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult;switch(s.mediaUploadResult){default:if(typeof s.mediaUploadResult=="number"){g.mediaUploadResult=s.mediaUploadResult;break}break;case"GENERAL_ERROR":case 0:g.mediaUploadResult=0;break;case"SUCCESS":case 1:g.mediaUploadResult=1;break;case"NOT_FOUND":case 2:g.mediaUploadResult=2;break;case"DECRYPTION_ERROR":case 3:g.mediaUploadResult=3;break}if(s.stickerMessage!=null){if(typeof s.stickerMessage!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected");g.stickerMessage=p.proto.Message.StickerMessage.fromObject(s.stickerMessage)}if(s.linkPreviewResponse!=null){if(typeof s.linkPreviewResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected");g.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(s.linkPreviewResponse)}if(s.placeholderMessageResendResponse!=null){if(typeof s.placeholderMessageResendResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected");g.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(s.placeholderMessageResendResponse)}if(s.waffleNonceFetchRequestResponse!=null){if(typeof s.waffleNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected");g.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(s.waffleNonceFetchRequestResponse)}if(s.fullHistorySyncOnDemandRequestResponse!=null){if(typeof s.fullHistorySyncOnDemandRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected");g.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(s.fullHistorySyncOnDemandRequestResponse)}if(s.companionMetaNonceFetchRequestResponse!=null){if(typeof s.companionMetaNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected");g.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(s.companionMetaNonceFetchRequestResponse)}if(s.syncdSnapshotFatalRecoveryResponse!=null){if(typeof s.syncdSnapshotFatalRecoveryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected");g.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(s.syncdSnapshotFatalRecoveryResponse)}if(s.companionCanonicalUserNonceFetchRequestResponse!=null){if(typeof s.companionCanonicalUserNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionCanonicalUserNonceFetchRequestResponse: object expected");g.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.fromObject(s.companionCanonicalUserNonceFetchRequestResponse)}if(s.historySyncChunkRetryResponse!=null){if(typeof s.historySyncChunkRetryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.historySyncChunkRetryResponse: object expected");g.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.fromObject(s.historySyncChunkRetryResponse)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.mediaUploadResult!=null&&s.hasOwnProperty("mediaUploadResult")&&(c.mediaUploadResult=g.enums===String?p.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]===void 0?s.mediaUploadResult:p.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]:s.mediaUploadResult,g.oneofs&&(c._mediaUploadResult="mediaUploadResult")),s.stickerMessage!=null&&s.hasOwnProperty("stickerMessage")&&(c.stickerMessage=p.proto.Message.StickerMessage.toObject(s.stickerMessage,g),g.oneofs&&(c._stickerMessage="stickerMessage")),s.linkPreviewResponse!=null&&s.hasOwnProperty("linkPreviewResponse")&&(c.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(s.linkPreviewResponse,g),g.oneofs&&(c._linkPreviewResponse="linkPreviewResponse")),s.placeholderMessageResendResponse!=null&&s.hasOwnProperty("placeholderMessageResendResponse")&&(c.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(s.placeholderMessageResendResponse,g),g.oneofs&&(c._placeholderMessageResendResponse="placeholderMessageResendResponse")),s.waffleNonceFetchRequestResponse!=null&&s.hasOwnProperty("waffleNonceFetchRequestResponse")&&(c.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(s.waffleNonceFetchRequestResponse,g),g.oneofs&&(c._waffleNonceFetchRequestResponse="waffleNonceFetchRequestResponse")),s.fullHistorySyncOnDemandRequestResponse!=null&&s.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")&&(c.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(s.fullHistorySyncOnDemandRequestResponse,g),g.oneofs&&(c._fullHistorySyncOnDemandRequestResponse="fullHistorySyncOnDemandRequestResponse")),s.companionMetaNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionMetaNonceFetchRequestResponse")&&(c.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(s.companionMetaNonceFetchRequestResponse,g),g.oneofs&&(c._companionMetaNonceFetchRequestResponse="companionMetaNonceFetchRequestResponse")),s.syncdSnapshotFatalRecoveryResponse!=null&&s.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")&&(c.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(s.syncdSnapshotFatalRecoveryResponse,g),g.oneofs&&(c._syncdSnapshotFatalRecoveryResponse="syncdSnapshotFatalRecoveryResponse")),s.companionCanonicalUserNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionCanonicalUserNonceFetchRequestResponse")&&(c.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.toObject(s.companionCanonicalUserNonceFetchRequestResponse,g),g.oneofs&&(c._companionCanonicalUserNonceFetchRequestResponse="companionCanonicalUserNonceFetchRequestResponse")),s.historySyncChunkRetryResponse!=null&&s.hasOwnProperty("historySyncChunkRetryResponse")&&(c.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.toObject(s.historySyncChunkRetryResponse,g),g.oneofs&&(c._historySyncChunkRetryResponse="historySyncChunkRetryResponse")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult"},a.CompanionCanonicalUserNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waFbid=c.string();break}case 3:{f.forceRefresh=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waFbid!=null&&(I.waFbid=String(c.waFbid)),c.forceRefresh!=null&&(I.forceRefresh=!!c.forceRefresh),I},r.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),c.waFbid!=null&&c.hasOwnProperty("waFbid")&&(d.waFbid=c.waFbid,I.oneofs&&(d._waFbid="waFbid")),c.forceRefresh!=null&&c.hasOwnProperty("forceRefresh")&&(d.forceRefresh=c.forceRefresh,I.oneofs&&(d._forceRefresh="forceRefresh")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse"},r})(),a.CompanionMetaNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),I},r.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse"},r})(),a.FullHistorySyncOnDemandRequestResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(c,c.uint32());break}case 2:{f.responseCode=c.int32();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse;if(c.requestMetadata!=null){if(typeof c.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected");I.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(c.requestMetadata)}switch(c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"REQUEST_SUCCESS":case 0:I.responseCode=0;break;case"REQUEST_TIME_EXPIRED":case 1:I.responseCode=1;break;case"DECLINED_SHARING_HISTORY":case 2:I.responseCode=2;break;case"GENERIC_ERROR":case 3:I.responseCode=3;break;case"ERROR_REQUEST_ON_NON_SMB_PRIMARY":case 4:I.responseCode=4;break;case"ERROR_HOSTED_DEVICE_NOT_CONNECTED":case 5:I.responseCode=5;break;case"ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET":case 6:I.responseCode=6;break}return I},r.toObject=function(c,I){I||(I={});var d={};return c.requestMetadata!=null&&c.hasOwnProperty("requestMetadata")&&(d.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(c.requestMetadata,I),I.oneofs&&(d._requestMetadata="requestMetadata")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(d.responseCode=I.enums===String?p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]===void 0?c.responseCode:p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(d._responseCode="responseCode")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse"},r})(),a.FullHistorySyncOnDemandResponseCode=(function(){let r={},s=Object.create(r);return s[r[0]="REQUEST_SUCCESS"]=0,s[r[1]="REQUEST_TIME_EXPIRED"]=1,s[r[2]="DECLINED_SHARING_HISTORY"]=2,s[r[3]="GENERIC_ERROR"]=3,s[r[4]="ERROR_REQUEST_ON_NON_SMB_PRIMARY"]=4,s[r[5]="ERROR_HOSTED_DEVICE_NOT_CONNECTED"]=5,s[r[6]="ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET"]=6,s})(),a.HistorySyncChunkRetryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.syncType=c.int32();break}case 2:{f.chunkOrder=c.uint32();break}case 3:{f.requestId=c.string();break}case 4:{f.responseCode=c.int32();break}case 5:{f.canRecover=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse;switch(c.syncType){default:if(typeof c.syncType=="number"){I.syncType=c.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:I.syncType=0;break;case"INITIAL_STATUS_V3":case 1:I.syncType=1;break;case"FULL":case 2:I.syncType=2;break;case"RECENT":case 3:I.syncType=3;break;case"PUSH_NAME":case 4:I.syncType=4;break;case"NON_BLOCKING_DATA":case 5:I.syncType=5;break;case"ON_DEMAND":case 6:I.syncType=6;break;case"NO_HISTORY":case 7:I.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:I.syncType=8;break}switch(c.chunkOrder!=null&&(I.chunkOrder=c.chunkOrder>>>0),c.requestId!=null&&(I.requestId=String(c.requestId)),c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"GENERATION_ERROR":case 1:I.responseCode=1;break;case"CHUNK_CONSUMED":case 2:I.responseCode=2;break;case"TIMEOUT":case 3:I.responseCode=3;break;case"SESSION_EXHAUSTED":case 4:I.responseCode=4;break;case"CHUNK_EXHAUSTED":case 5:I.responseCode=5;break;case"DUPLICATED_REQUEST":case 6:I.responseCode=6;break}return c.canRecover!=null&&(I.canRecover=!!c.canRecover),I},r.toObject=function(c,I){I||(I={});var d={};return c.syncType!=null&&c.hasOwnProperty("syncType")&&(d.syncType=I.enums===String?p.proto.Message.HistorySyncType[c.syncType]===void 0?c.syncType:p.proto.Message.HistorySyncType[c.syncType]:c.syncType,I.oneofs&&(d._syncType="syncType")),c.chunkOrder!=null&&c.hasOwnProperty("chunkOrder")&&(d.chunkOrder=c.chunkOrder,I.oneofs&&(d._chunkOrder="chunkOrder")),c.requestId!=null&&c.hasOwnProperty("requestId")&&(d.requestId=c.requestId,I.oneofs&&(d._requestId="requestId")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(d.responseCode=I.enums===String?p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]===void 0?c.responseCode:p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(d._responseCode="responseCode")),c.canRecover!=null&&c.hasOwnProperty("canRecover")&&(d.canRecover=c.canRecover,I.oneofs&&(d._canRecover="canRecover")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse"},r})(),a.HistorySyncChunkRetryResponseCode=(function(){let r={},s=Object.create(r);return s[r[1]="GENERATION_ERROR"]=1,s[r[2]="CHUNK_CONSUMED"]=2,s[r[3]="TIMEOUT"]=3,s[r[4]="SESSION_EXHAUSTED"]=4,s[r[5]="CHUNK_EXHAUSTED"]=5,s[r[6]="DUPLICATED_REQUEST"]=6,s})(),a.LinkPreviewResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.url=c.string();break}case 2:{f.title=c.string();break}case 3:{f.description=c.string();break}case 4:{f.thumbData=c.bytes();break}case 6:{f.matchText=c.string();break}case 7:{f.previewType=c.string();break}case 8:{f.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.decode(c,c.uint32());break}case 9:{f.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse;if(c.url!=null&&(I.url=String(c.url)),c.title!=null&&(I.title=String(c.title)),c.description!=null&&(I.description=String(c.description)),c.thumbData!=null&&(typeof c.thumbData=="string"?l.base64.decode(c.thumbData,I.thumbData=l.newBuffer(l.base64.length(c.thumbData)),0):c.thumbData.length>=0&&(I.thumbData=c.thumbData)),c.matchText!=null&&(I.matchText=String(c.matchText)),c.previewType!=null&&(I.previewType=String(c.previewType)),c.hqThumbnail!=null){if(typeof c.hqThumbnail!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected");I.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(c.hqThumbnail)}if(c.previewMetadata!=null){if(typeof c.previewMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.previewMetadata: object expected");I.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.fromObject(c.previewMetadata)}return I},r.toObject=function(c,I){I||(I={});var d={};return c.url!=null&&c.hasOwnProperty("url")&&(d.url=c.url,I.oneofs&&(d._url="url")),c.title!=null&&c.hasOwnProperty("title")&&(d.title=c.title,I.oneofs&&(d._title="title")),c.description!=null&&c.hasOwnProperty("description")&&(d.description=c.description,I.oneofs&&(d._description="description")),c.thumbData!=null&&c.hasOwnProperty("thumbData")&&(d.thumbData=I.bytes===String?l.base64.encode(c.thumbData,0,c.thumbData.length):I.bytes===Array?Array.prototype.slice.call(c.thumbData):c.thumbData,I.oneofs&&(d._thumbData="thumbData")),c.matchText!=null&&c.hasOwnProperty("matchText")&&(d.matchText=c.matchText,I.oneofs&&(d._matchText="matchText")),c.previewType!=null&&c.hasOwnProperty("previewType")&&(d.previewType=c.previewType,I.oneofs&&(d._previewType="previewType")),c.hqThumbnail!=null&&c.hasOwnProperty("hqThumbnail")&&(d.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(c.hqThumbnail,I),I.oneofs&&(d._hqThumbnail="hqThumbnail")),c.previewMetadata!=null&&c.hasOwnProperty("previewMetadata")&&(d.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.toObject(c.previewMetadata,I),I.oneofs&&(d._previewMetadata="previewMetadata")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse"},r.LinkPreviewHighQualityThumbnail=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.directPath=d.string();break}case 2:{y.thumbHash=d.string();break}case 3:{y.encThumbHash=d.string();break}case 4:{y.mediaKey=d.bytes();break}case 5:{y.mediaKeyTimestampMs=d.int64();break}case 6:{y.thumbWidth=d.int32();break}case 7:{y.thumbHeight=d.int32();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail)return d;var B=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail;return d.directPath!=null&&(B.directPath=String(d.directPath)),d.thumbHash!=null&&(B.thumbHash=String(d.thumbHash)),d.encThumbHash!=null&&(B.encThumbHash=String(d.encThumbHash)),d.mediaKey!=null&&(typeof d.mediaKey=="string"?l.base64.decode(d.mediaKey,B.mediaKey=l.newBuffer(l.base64.length(d.mediaKey)),0):d.mediaKey.length>=0&&(B.mediaKey=d.mediaKey)),d.mediaKeyTimestampMs!=null&&(l.Long?(B.mediaKeyTimestampMs=l.Long.fromValue(d.mediaKeyTimestampMs)).unsigned=!1:typeof d.mediaKeyTimestampMs=="string"?B.mediaKeyTimestampMs=parseInt(d.mediaKeyTimestampMs,10):typeof d.mediaKeyTimestampMs=="number"?B.mediaKeyTimestampMs=d.mediaKeyTimestampMs:typeof d.mediaKeyTimestampMs=="object"&&(B.mediaKeyTimestampMs=new l.LongBits(d.mediaKeyTimestampMs.low>>>0,d.mediaKeyTimestampMs.high>>>0).toNumber())),d.thumbWidth!=null&&(B.thumbWidth=d.thumbWidth|0),d.thumbHeight!=null&&(B.thumbHeight=d.thumbHeight|0),B},g.toObject=function(d,B){B||(B={});var f={};return d.directPath!=null&&d.hasOwnProperty("directPath")&&(f.directPath=d.directPath,B.oneofs&&(f._directPath="directPath")),d.thumbHash!=null&&d.hasOwnProperty("thumbHash")&&(f.thumbHash=d.thumbHash,B.oneofs&&(f._thumbHash="thumbHash")),d.encThumbHash!=null&&d.hasOwnProperty("encThumbHash")&&(f.encThumbHash=d.encThumbHash,B.oneofs&&(f._encThumbHash="encThumbHash")),d.mediaKey!=null&&d.hasOwnProperty("mediaKey")&&(f.mediaKey=B.bytes===String?l.base64.encode(d.mediaKey,0,d.mediaKey.length):B.bytes===Array?Array.prototype.slice.call(d.mediaKey):d.mediaKey,B.oneofs&&(f._mediaKey="mediaKey")),d.mediaKeyTimestampMs!=null&&d.hasOwnProperty("mediaKeyTimestampMs")&&(typeof d.mediaKeyTimestampMs=="number"?f.mediaKeyTimestampMs=B.longs===String?String(d.mediaKeyTimestampMs):d.mediaKeyTimestampMs:f.mediaKeyTimestampMs=B.longs===String?ge(d.mediaKeyTimestampMs):B.longs===Number?ce(d.mediaKeyTimestampMs):d.mediaKeyTimestampMs,B.oneofs&&(f._mediaKeyTimestampMs="mediaKeyTimestampMs")),d.thumbWidth!=null&&d.hasOwnProperty("thumbWidth")&&(f.thumbWidth=d.thumbWidth,B.oneofs&&(f._thumbWidth="thumbWidth")),d.thumbHeight!=null&&d.hasOwnProperty("thumbHeight")&&(f.thumbHeight=d.thumbHeight,B.oneofs&&(f._thumbHeight="thumbHeight")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail"},g})(),r.PaymentLinkPreviewMetadata=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.isBusinessVerified=d.bool();break}case 2:{y.providerName=d.string();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata)return d;var B=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata;return d.isBusinessVerified!=null&&(B.isBusinessVerified=!!d.isBusinessVerified),d.providerName!=null&&(B.providerName=String(d.providerName)),B},g.toObject=function(d,B){B||(B={});var f={};return d.isBusinessVerified!=null&&d.hasOwnProperty("isBusinessVerified")&&(f.isBusinessVerified=d.isBusinessVerified,B.oneofs&&(f._isBusinessVerified="isBusinessVerified")),d.providerName!=null&&d.hasOwnProperty("providerName")&&(f.providerName=d.providerName,B.oneofs&&(f._providerName="providerName")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata"},g})(),r})(),a.PlaceholderMessageResendResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.webMessageInfoBytes=c.bytes();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse;return c.webMessageInfoBytes!=null&&(typeof c.webMessageInfoBytes=="string"?l.base64.decode(c.webMessageInfoBytes,I.webMessageInfoBytes=l.newBuffer(l.base64.length(c.webMessageInfoBytes)),0):c.webMessageInfoBytes.length>=0&&(I.webMessageInfoBytes=c.webMessageInfoBytes)),I},r.toObject=function(c,I){I||(I={});var d={};return c.webMessageInfoBytes!=null&&c.hasOwnProperty("webMessageInfoBytes")&&(d.webMessageInfoBytes=I.bytes===String?l.base64.encode(c.webMessageInfoBytes,0,c.webMessageInfoBytes.length):I.bytes===Array?Array.prototype.slice.call(c.webMessageInfoBytes):c.webMessageInfoBytes,I.oneofs&&(d._webMessageInfoBytes="webMessageInfoBytes")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse"},r})(),a.SyncDSnapshotFatalRecoveryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.collectionSnapshot=c.bytes();break}case 2:{f.isCompressed=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse;return c.collectionSnapshot!=null&&(typeof c.collectionSnapshot=="string"?l.base64.decode(c.collectionSnapshot,I.collectionSnapshot=l.newBuffer(l.base64.length(c.collectionSnapshot)),0):c.collectionSnapshot.length>=0&&(I.collectionSnapshot=c.collectionSnapshot)),c.isCompressed!=null&&(I.isCompressed=!!c.isCompressed),I},r.toObject=function(c,I){I||(I={});var d={};return c.collectionSnapshot!=null&&c.hasOwnProperty("collectionSnapshot")&&(d.collectionSnapshot=I.bytes===String?l.base64.encode(c.collectionSnapshot,0,c.collectionSnapshot.length):I.bytes===Array?Array.prototype.slice.call(c.collectionSnapshot):c.collectionSnapshot,I.oneofs&&(d._collectionSnapshot="collectionSnapshot")),c.isCompressed!=null&&c.hasOwnProperty("isCompressed")&&(d.isCompressed=c.isCompressed,I.oneofs&&(d._isCompressed="isCompressed")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse"},r})(),a.WaffleNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waEntFbid=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waEntFbid!=null&&(I.waEntFbid=String(c.waEntFbid)),I},r.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),c.waEntFbid!=null&&c.hasOwnProperty("waEntFbid")&&(d.waEntFbid=c.waEntFbid,I.oneofs&&(d._waEntFbid="waEntFbid")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse"},r})(),a})(),i})(),t.PeerDataOperationRequestType=(function(){let i={},e=Object.create(i);return e[i[0]="UPLOAD_STICKER"]=0,e[i[1]="SEND_RECENT_STICKER_BOOTSTRAP"]=1,e[i[2]="GENERATE_LINK_PREVIEW"]=2,e[i[3]="HISTORY_SYNC_ON_DEMAND"]=3,e[i[4]="PLACEHOLDER_MESSAGE_RESEND"]=4,e[i[5]="WAFFLE_LINKING_NONCE_FETCH"]=5,e[i[6]="FULL_HISTORY_SYNC_ON_DEMAND"]=6,e[i[7]="COMPANION_META_NONCE_FETCH"]=7,e[i[8]="COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY"]=8,e[i[9]="COMPANION_CANONICAL_USER_NONCE_FETCH"]=9,e[i[10]="HISTORY_SYNC_CHUNK_RETRY"]=10,e[i[11]="GALAXY_FLOW_ACTION"]=11,e})(),t.PinInChatMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 3:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PinInChatMessage)return A;var r=new p.proto.Message.PinInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.PinInChatMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN_TYPE":case 0:r.type=0;break;case"PIN_FOR_ALL":case 1:r.type=1;break;case"UNPIN_FOR_ALL":case 2:r.type=2;break}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.PinInChatMessage.Type[A.type]===void 0?A.type:p.proto.Message.PinInChatMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PinInChatMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN_TYPE"]=0,A[a[1]="PIN_FOR_ALL"]=1,A[a[2]="UNPIN_FOR_ALL"]=2,A})(),i})(),t.PlaceholderMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PlaceholderMessage)return A;var r=new p.proto.Message.PlaceholderMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"MASK_LINKED_DEVICES":case 0:r.type=0;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.PlaceholderMessage.PlaceholderType[A.type]===void 0?A.type:p.proto.Message.PlaceholderMessage.PlaceholderType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PlaceholderMessage"},i.PlaceholderType=(function(){let a={},A=Object.create(a);return A[a[0]="MASK_LINKED_DEVICES"]=0,A})(),i})(),t.PollContentType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="TEXT"]=1,e[i[2]="IMAGE"]=2,e})(),t.PollCreationMessage=(function(){function i(a){if(this.options=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.encKey=A.bytes();break}case 2:{c.name=A.string();break}case 3:{c.options&&c.options.length||(c.options=[]),c.options.push(p.proto.Message.PollCreationMessage.Option.decode(A,A.uint32()));break}case 4:{c.selectableOptionsCount=A.uint32();break}case 5:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 6:{c.pollContentType=A.int32();break}case 7:{c.pollType=A.int32();break}case 8:{c.correctAnswer=p.proto.Message.PollCreationMessage.Option.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollCreationMessage)return A;var r=new p.proto.Message.PollCreationMessage;if(A.encKey!=null&&(typeof A.encKey=="string"?l.base64.decode(A.encKey,r.encKey=l.newBuffer(l.base64.length(A.encKey)),0):A.encKey.length>=0&&(r.encKey=A.encKey)),A.name!=null&&(r.name=String(A.name)),A.options){if(!Array.isArray(A.options))throw TypeError(".proto.Message.PollCreationMessage.options: array expected");r.options=[];for(var s=0;s>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.pollContentType){default:if(typeof A.pollContentType=="number"){r.pollContentType=A.pollContentType;break}break;case"UNKNOWN":case 0:r.pollContentType=0;break;case"TEXT":case 1:r.pollContentType=1;break;case"IMAGE":case 2:r.pollContentType=2;break}switch(A.pollType){default:if(typeof A.pollType=="number"){r.pollType=A.pollType;break}break;case"POLL":case 0:r.pollType=0;break;case"QUIZ":case 1:r.pollType=1;break}if(A.correctAnswer!=null){if(typeof A.correctAnswer!="object")throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");r.correctAnswer=p.proto.Message.PollCreationMessage.Option.fromObject(A.correctAnswer)}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.options=[]),A.encKey!=null&&A.hasOwnProperty("encKey")&&(s.encKey=r.bytes===String?l.base64.encode(A.encKey,0,A.encKey.length):r.bytes===Array?Array.prototype.slice.call(A.encKey):A.encKey,r.oneofs&&(s._encKey="encKey")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.options&&A.options.length){s.options=[];for(var g=0;g>>3){case 1:{d.optionName=s.string();break}case 2:{d.optionHash=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PollCreationMessage.Option)return s;var g=new p.proto.Message.PollCreationMessage.Option;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionHash!=null&&(g.optionHash=String(s.optionHash)),g},a.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionHash!=null&&s.hasOwnProperty("optionHash")&&(c.optionHash=s.optionHash,g.oneofs&&(c._optionHash="optionHash")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollCreationMessage.Option"},a})(),i})(),t.PollEncValue=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.encPayload=A.bytes();break}case 2:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollEncValue)return A;var r=new p.proto.Message.PollEncValue;return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollEncValue"},i})(),t.PollResultSnapshotMessage=(function(){function i(a){if(this.pollVotes=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.pollVotes&&c.pollVotes.length||(c.pollVotes=[]),c.pollVotes.push(p.proto.Message.PollResultSnapshotMessage.PollVote.decode(A,A.uint32()));break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.pollType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollResultSnapshotMessage)return A;var r=new p.proto.Message.PollResultSnapshotMessage;if(A.name!=null&&(r.name=String(A.name)),A.pollVotes){if(!Array.isArray(A.pollVotes))throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected");r.pollVotes=[];for(var s=0;s>>3){case 1:{d.optionName=s.string();break}case 2:{d.optionVoteCount=s.int64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PollResultSnapshotMessage.PollVote)return s;var g=new p.proto.Message.PollResultSnapshotMessage.PollVote;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionVoteCount!=null&&(l.Long?(g.optionVoteCount=l.Long.fromValue(s.optionVoteCount)).unsigned=!1:typeof s.optionVoteCount=="string"?g.optionVoteCount=parseInt(s.optionVoteCount,10):typeof s.optionVoteCount=="number"?g.optionVoteCount=s.optionVoteCount:typeof s.optionVoteCount=="object"&&(g.optionVoteCount=new l.LongBits(s.optionVoteCount.low>>>0,s.optionVoteCount.high>>>0).toNumber())),g},a.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionVoteCount!=null&&s.hasOwnProperty("optionVoteCount")&&(typeof s.optionVoteCount=="number"?c.optionVoteCount=g.longs===String?String(s.optionVoteCount):s.optionVoteCount:c.optionVoteCount=g.longs===String?ge(s.optionVoteCount):g.longs===Number?ce(s.optionVoteCount):s.optionVoteCount,g.oneofs&&(c._optionVoteCount="optionVoteCount")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollResultSnapshotMessage.PollVote"},a})(),i})(),t.PollType=(function(){let i={},e=Object.create(i);return e[i[0]="POLL"]=0,e[i[1]="QUIZ"]=1,e})(),t.PollUpdateMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.pollCreationMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.vote=p.proto.Message.PollEncValue.decode(A,A.uint32());break}case 3:{c.metadata=p.proto.Message.PollUpdateMessageMetadata.decode(A,A.uint32());break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollUpdateMessage)return A;var r=new p.proto.Message.PollUpdateMessage;if(A.pollCreationMessageKey!=null){if(typeof A.pollCreationMessageKey!="object")throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected");r.pollCreationMessageKey=p.proto.MessageKey.fromObject(A.pollCreationMessageKey)}if(A.vote!=null){if(typeof A.vote!="object")throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected");r.vote=p.proto.Message.PollEncValue.fromObject(A.vote)}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected");r.metadata=p.proto.Message.PollUpdateMessageMetadata.fromObject(A.metadata)}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.pollCreationMessageKey!=null&&A.hasOwnProperty("pollCreationMessageKey")&&(s.pollCreationMessageKey=p.proto.MessageKey.toObject(A.pollCreationMessageKey,r),r.oneofs&&(s._pollCreationMessageKey="pollCreationMessageKey")),A.vote!=null&&A.hasOwnProperty("vote")&&(s.vote=p.proto.Message.PollEncValue.toObject(A.vote,r),r.oneofs&&(s._vote="vote")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=p.proto.Message.PollUpdateMessageMetadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollUpdateMessage"},i})(),t.PollUpdateMessageMetadata=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){default:a.skipType(c&7);break}}return g},i.fromObject=function(a){return a instanceof p.proto.Message.PollUpdateMessageMetadata?a:new p.proto.Message.PollUpdateMessageMetadata},i.toObject=function(){return{}},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Message.PollUpdateMessageMetadata"},i})(),t.PollVoteMessage=(function(){function i(e){if(this.selectedOptions=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.selectedOptions&&g.selectedOptions.length||(g.selectedOptions=[]),g.selectedOptions.push(a.bytes());break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.PollVoteMessage)return a;var A=new p.proto.Message.PollVoteMessage;if(a.selectedOptions){if(!Array.isArray(a.selectedOptions))throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected");A.selectedOptions=[];for(var r=0;r=0&&(A.selectedOptions[r]=a.selectedOptions[r])}return A},i.toObject=function(a,A){A||(A={});var r={};if((A.arrays||A.defaults)&&(r.selectedOptions=[]),a.selectedOptions&&a.selectedOptions.length){r.selectedOptions=[];for(var s=0;s>>3){case 1:{c.product=p.proto.Message.ProductMessage.ProductSnapshot.decode(A,A.uint32());break}case 2:{c.businessOwnerJid=A.string();break}case 4:{c.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.decode(A,A.uint32());break}case 5:{c.body=A.string();break}case 6:{c.footer=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ProductMessage)return A;var r=new p.proto.Message.ProductMessage;if(A.product!=null){if(typeof A.product!="object")throw TypeError(".proto.Message.ProductMessage.product: object expected");r.product=p.proto.Message.ProductMessage.ProductSnapshot.fromObject(A.product)}if(A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),A.catalog!=null){if(typeof A.catalog!="object")throw TypeError(".proto.Message.ProductMessage.catalog: object expected");r.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.fromObject(A.catalog)}if(A.body!=null&&(r.body=String(A.body)),A.footer!=null&&(r.footer=String(A.footer)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.product!=null&&A.hasOwnProperty("product")&&(s.product=p.proto.Message.ProductMessage.ProductSnapshot.toObject(A.product,r),r.oneofs&&(s._product="product")),A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),A.catalog!=null&&A.hasOwnProperty("catalog")&&(s.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.toObject(A.catalog,r),r.oneofs&&(s._catalog="catalog")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=A.footer,r.oneofs&&(s._footer="footer")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProductMessage"},i.CatalogSnapshot=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.catalogImage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{d.title=s.string();break}case 3:{d.description=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ProductMessage.CatalogSnapshot)return s;var g=new p.proto.Message.ProductMessage.CatalogSnapshot;if(s.catalogImage!=null){if(typeof s.catalogImage!="object")throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected");g.catalogImage=p.proto.Message.ImageMessage.fromObject(s.catalogImage)}return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),g},a.toObject=function(s,g){g||(g={});var c={};return s.catalogImage!=null&&s.hasOwnProperty("catalogImage")&&(c.catalogImage=p.proto.Message.ImageMessage.toObject(s.catalogImage,g),g.oneofs&&(c._catalogImage="catalogImage")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.CatalogSnapshot"},a})(),i.ProductSnapshot=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.productImage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{d.productId=s.string();break}case 3:{d.title=s.string();break}case 4:{d.description=s.string();break}case 5:{d.currencyCode=s.string();break}case 6:{d.priceAmount1000=s.int64();break}case 7:{d.retailerId=s.string();break}case 8:{d.url=s.string();break}case 9:{d.productImageCount=s.uint32();break}case 11:{d.firstImageId=s.string();break}case 12:{d.salePriceAmount1000=s.int64();break}case 13:{d.signedUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ProductMessage.ProductSnapshot)return s;var g=new p.proto.Message.ProductMessage.ProductSnapshot;if(s.productImage!=null){if(typeof s.productImage!="object")throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected");g.productImage=p.proto.Message.ImageMessage.fromObject(s.productImage)}return s.productId!=null&&(g.productId=String(s.productId)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.currencyCode!=null&&(g.currencyCode=String(s.currencyCode)),s.priceAmount1000!=null&&(l.Long?(g.priceAmount1000=l.Long.fromValue(s.priceAmount1000)).unsigned=!1:typeof s.priceAmount1000=="string"?g.priceAmount1000=parseInt(s.priceAmount1000,10):typeof s.priceAmount1000=="number"?g.priceAmount1000=s.priceAmount1000:typeof s.priceAmount1000=="object"&&(g.priceAmount1000=new l.LongBits(s.priceAmount1000.low>>>0,s.priceAmount1000.high>>>0).toNumber())),s.retailerId!=null&&(g.retailerId=String(s.retailerId)),s.url!=null&&(g.url=String(s.url)),s.productImageCount!=null&&(g.productImageCount=s.productImageCount>>>0),s.firstImageId!=null&&(g.firstImageId=String(s.firstImageId)),s.salePriceAmount1000!=null&&(l.Long?(g.salePriceAmount1000=l.Long.fromValue(s.salePriceAmount1000)).unsigned=!1:typeof s.salePriceAmount1000=="string"?g.salePriceAmount1000=parseInt(s.salePriceAmount1000,10):typeof s.salePriceAmount1000=="number"?g.salePriceAmount1000=s.salePriceAmount1000:typeof s.salePriceAmount1000=="object"&&(g.salePriceAmount1000=new l.LongBits(s.salePriceAmount1000.low>>>0,s.salePriceAmount1000.high>>>0).toNumber())),s.signedUrl!=null&&(g.signedUrl=String(s.signedUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productImage!=null&&s.hasOwnProperty("productImage")&&(c.productImage=p.proto.Message.ImageMessage.toObject(s.productImage,g),g.oneofs&&(c._productImage="productImage")),s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.currencyCode!=null&&s.hasOwnProperty("currencyCode")&&(c.currencyCode=s.currencyCode,g.oneofs&&(c._currencyCode="currencyCode")),s.priceAmount1000!=null&&s.hasOwnProperty("priceAmount1000")&&(typeof s.priceAmount1000=="number"?c.priceAmount1000=g.longs===String?String(s.priceAmount1000):s.priceAmount1000:c.priceAmount1000=g.longs===String?ge(s.priceAmount1000):g.longs===Number?ce(s.priceAmount1000):s.priceAmount1000,g.oneofs&&(c._priceAmount1000="priceAmount1000")),s.retailerId!=null&&s.hasOwnProperty("retailerId")&&(c.retailerId=s.retailerId,g.oneofs&&(c._retailerId="retailerId")),s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.productImageCount!=null&&s.hasOwnProperty("productImageCount")&&(c.productImageCount=s.productImageCount,g.oneofs&&(c._productImageCount="productImageCount")),s.firstImageId!=null&&s.hasOwnProperty("firstImageId")&&(c.firstImageId=s.firstImageId,g.oneofs&&(c._firstImageId="firstImageId")),s.salePriceAmount1000!=null&&s.hasOwnProperty("salePriceAmount1000")&&(typeof s.salePriceAmount1000=="number"?c.salePriceAmount1000=g.longs===String?String(s.salePriceAmount1000):s.salePriceAmount1000:c.salePriceAmount1000=g.longs===String?ge(s.salePriceAmount1000):g.longs===Number?ce(s.salePriceAmount1000):s.salePriceAmount1000,g.oneofs&&(c._salePriceAmount1000="salePriceAmount1000")),s.signedUrl!=null&&s.hasOwnProperty("signedUrl")&&(c.signedUrl=s.signedUrl,g.oneofs&&(c._signedUrl="signedUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.ProductSnapshot"},a})(),i})(),t.ProtocolMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 4:{c.ephemeralExpiration=A.uint32();break}case 5:{c.ephemeralSettingTimestamp=A.int64();break}case 6:{c.historySyncNotification=p.proto.Message.HistorySyncNotification.decode(A,A.uint32());break}case 7:{c.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.decode(A,A.uint32());break}case 8:{c.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.decode(A,A.uint32());break}case 9:{c.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.decode(A,A.uint32());break}case 10:{c.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.decode(A,A.uint32());break}case 11:{c.disappearingMode=p.proto.DisappearingMode.decode(A,A.uint32());break}case 14:{c.editedMessage=p.proto.Message.decode(A,A.uint32());break}case 15:{c.timestampMs=A.int64();break}case 16:{c.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.decode(A,A.uint32());break}case 17:{c.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.decode(A,A.uint32());break}case 18:{c.botFeedbackMessage=p.proto.BotFeedbackMessage.decode(A,A.uint32());break}case 19:{c.invokerJid=A.string();break}case 20:{c.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.decode(A,A.uint32());break}case 21:{c.mediaNotifyMessage=p.proto.MediaNotifyMessage.decode(A,A.uint32());break}case 22:{c.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.decode(A,A.uint32());break}case 23:{c.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.decode(A,A.uint32());break}case 24:{c.limitSharing=p.proto.LimitSharing.decode(A,A.uint32());break}case 25:{c.aiPsiMetadata=A.bytes();break}case 26:{c.aiQueryFanout=p.proto.AIQueryFanout.decode(A,A.uint32());break}case 27:{c.memberLabel=p.proto.MemberLabel.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ProtocolMessage)return A;var r=new p.proto.Message.ProtocolMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ProtocolMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"REVOKE":case 0:r.type=0;break;case"EPHEMERAL_SETTING":case 3:r.type=3;break;case"EPHEMERAL_SYNC_RESPONSE":case 4:r.type=4;break;case"HISTORY_SYNC_NOTIFICATION":case 5:r.type=5;break;case"APP_STATE_SYNC_KEY_SHARE":case 6:r.type=6;break;case"APP_STATE_SYNC_KEY_REQUEST":case 7:r.type=7;break;case"MSG_FANOUT_BACKFILL_REQUEST":case 8:r.type=8;break;case"INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC":case 9:r.type=9;break;case"APP_STATE_FATAL_EXCEPTION_NOTIFICATION":case 10:r.type=10;break;case"SHARE_PHONE_NUMBER":case 11:r.type=11;break;case"MESSAGE_EDIT":case 14:r.type=14;break;case"PEER_DATA_OPERATION_REQUEST_MESSAGE":case 16:r.type=16;break;case"PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE":case 17:r.type=17;break;case"REQUEST_WELCOME_MESSAGE":case 18:r.type=18;break;case"BOT_FEEDBACK_MESSAGE":case 19:r.type=19;break;case"MEDIA_NOTIFY_MESSAGE":case 20:r.type=20;break;case"CLOUD_API_THREAD_CONTROL_NOTIFICATION":case 21:r.type=21;break;case"LID_MIGRATION_MAPPING_SYNC":case 22:r.type=22;break;case"REMINDER_MESSAGE":case 23:r.type=23;break;case"BOT_MEMU_ONBOARDING_MESSAGE":case 24:r.type=24;break;case"STATUS_MENTION_MESSAGE":case 25:r.type=25;break;case"STOP_GENERATION_MESSAGE":case 26:r.type=26;break;case"LIMIT_SHARING":case 27:r.type=27;break;case"AI_PSI_METADATA":case 28:r.type=28;break;case"AI_QUERY_FANOUT":case 29:r.type=29;break;case"GROUP_MEMBER_LABEL_CHANGE":case 30:r.type=30;break}if(A.ephemeralExpiration!=null&&(r.ephemeralExpiration=A.ephemeralExpiration>>>0),A.ephemeralSettingTimestamp!=null&&(l.Long?(r.ephemeralSettingTimestamp=l.Long.fromValue(A.ephemeralSettingTimestamp)).unsigned=!1:typeof A.ephemeralSettingTimestamp=="string"?r.ephemeralSettingTimestamp=parseInt(A.ephemeralSettingTimestamp,10):typeof A.ephemeralSettingTimestamp=="number"?r.ephemeralSettingTimestamp=A.ephemeralSettingTimestamp:typeof A.ephemeralSettingTimestamp=="object"&&(r.ephemeralSettingTimestamp=new l.LongBits(A.ephemeralSettingTimestamp.low>>>0,A.ephemeralSettingTimestamp.high>>>0).toNumber())),A.historySyncNotification!=null){if(typeof A.historySyncNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected");r.historySyncNotification=p.proto.Message.HistorySyncNotification.fromObject(A.historySyncNotification)}if(A.appStateSyncKeyShare!=null){if(typeof A.appStateSyncKeyShare!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected");r.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.fromObject(A.appStateSyncKeyShare)}if(A.appStateSyncKeyRequest!=null){if(typeof A.appStateSyncKeyRequest!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected");r.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.fromObject(A.appStateSyncKeyRequest)}if(A.initialSecurityNotificationSettingSync!=null){if(typeof A.initialSecurityNotificationSettingSync!="object")throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected");r.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.fromObject(A.initialSecurityNotificationSettingSync)}if(A.appStateFatalExceptionNotification!=null){if(typeof A.appStateFatalExceptionNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected");r.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.fromObject(A.appStateFatalExceptionNotification)}if(A.disappearingMode!=null){if(typeof A.disappearingMode!="object")throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected");r.disappearingMode=p.proto.DisappearingMode.fromObject(A.disappearingMode)}if(A.editedMessage!=null){if(typeof A.editedMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected");r.editedMessage=p.proto.Message.fromObject(A.editedMessage)}if(A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.peerDataOperationRequestMessage!=null){if(typeof A.peerDataOperationRequestMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected");r.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.fromObject(A.peerDataOperationRequestMessage)}if(A.peerDataOperationRequestResponseMessage!=null){if(typeof A.peerDataOperationRequestResponseMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected");r.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(A.peerDataOperationRequestResponseMessage)}if(A.botFeedbackMessage!=null){if(typeof A.botFeedbackMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected");r.botFeedbackMessage=p.proto.BotFeedbackMessage.fromObject(A.botFeedbackMessage)}if(A.invokerJid!=null&&(r.invokerJid=String(A.invokerJid)),A.requestWelcomeMessageMetadata!=null){if(typeof A.requestWelcomeMessageMetadata!="object")throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected");r.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.fromObject(A.requestWelcomeMessageMetadata)}if(A.mediaNotifyMessage!=null){if(typeof A.mediaNotifyMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected");r.mediaNotifyMessage=p.proto.MediaNotifyMessage.fromObject(A.mediaNotifyMessage)}if(A.cloudApiThreadControlNotification!=null){if(typeof A.cloudApiThreadControlNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected");r.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.fromObject(A.cloudApiThreadControlNotification)}if(A.lidMigrationMappingSyncMessage!=null){if(typeof A.lidMigrationMappingSyncMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected");r.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.fromObject(A.lidMigrationMappingSyncMessage)}if(A.limitSharing!=null){if(typeof A.limitSharing!="object")throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected");r.limitSharing=p.proto.LimitSharing.fromObject(A.limitSharing)}if(A.aiPsiMetadata!=null&&(typeof A.aiPsiMetadata=="string"?l.base64.decode(A.aiPsiMetadata,r.aiPsiMetadata=l.newBuffer(l.base64.length(A.aiPsiMetadata)),0):A.aiPsiMetadata.length>=0&&(r.aiPsiMetadata=A.aiPsiMetadata)),A.aiQueryFanout!=null){if(typeof A.aiQueryFanout!="object")throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected");r.aiQueryFanout=p.proto.AIQueryFanout.fromObject(A.aiQueryFanout)}if(A.memberLabel!=null){if(typeof A.memberLabel!="object")throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected");r.memberLabel=p.proto.MemberLabel.fromObject(A.memberLabel)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.ProtocolMessage.Type[A.type]===void 0?A.type:p.proto.Message.ProtocolMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.ephemeralExpiration!=null&&A.hasOwnProperty("ephemeralExpiration")&&(s.ephemeralExpiration=A.ephemeralExpiration,r.oneofs&&(s._ephemeralExpiration="ephemeralExpiration")),A.ephemeralSettingTimestamp!=null&&A.hasOwnProperty("ephemeralSettingTimestamp")&&(typeof A.ephemeralSettingTimestamp=="number"?s.ephemeralSettingTimestamp=r.longs===String?String(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp:s.ephemeralSettingTimestamp=r.longs===String?ge(A.ephemeralSettingTimestamp):r.longs===Number?ce(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp,r.oneofs&&(s._ephemeralSettingTimestamp="ephemeralSettingTimestamp")),A.historySyncNotification!=null&&A.hasOwnProperty("historySyncNotification")&&(s.historySyncNotification=p.proto.Message.HistorySyncNotification.toObject(A.historySyncNotification,r),r.oneofs&&(s._historySyncNotification="historySyncNotification")),A.appStateSyncKeyShare!=null&&A.hasOwnProperty("appStateSyncKeyShare")&&(s.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.toObject(A.appStateSyncKeyShare,r),r.oneofs&&(s._appStateSyncKeyShare="appStateSyncKeyShare")),A.appStateSyncKeyRequest!=null&&A.hasOwnProperty("appStateSyncKeyRequest")&&(s.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.toObject(A.appStateSyncKeyRequest,r),r.oneofs&&(s._appStateSyncKeyRequest="appStateSyncKeyRequest")),A.initialSecurityNotificationSettingSync!=null&&A.hasOwnProperty("initialSecurityNotificationSettingSync")&&(s.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.toObject(A.initialSecurityNotificationSettingSync,r),r.oneofs&&(s._initialSecurityNotificationSettingSync="initialSecurityNotificationSettingSync")),A.appStateFatalExceptionNotification!=null&&A.hasOwnProperty("appStateFatalExceptionNotification")&&(s.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.toObject(A.appStateFatalExceptionNotification,r),r.oneofs&&(s._appStateFatalExceptionNotification="appStateFatalExceptionNotification")),A.disappearingMode!=null&&A.hasOwnProperty("disappearingMode")&&(s.disappearingMode=p.proto.DisappearingMode.toObject(A.disappearingMode,r),r.oneofs&&(s._disappearingMode="disappearingMode")),A.editedMessage!=null&&A.hasOwnProperty("editedMessage")&&(s.editedMessage=p.proto.Message.toObject(A.editedMessage,r),r.oneofs&&(s._editedMessage="editedMessage")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.peerDataOperationRequestMessage!=null&&A.hasOwnProperty("peerDataOperationRequestMessage")&&(s.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.toObject(A.peerDataOperationRequestMessage,r),r.oneofs&&(s._peerDataOperationRequestMessage="peerDataOperationRequestMessage")),A.peerDataOperationRequestResponseMessage!=null&&A.hasOwnProperty("peerDataOperationRequestResponseMessage")&&(s.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.toObject(A.peerDataOperationRequestResponseMessage,r),r.oneofs&&(s._peerDataOperationRequestResponseMessage="peerDataOperationRequestResponseMessage")),A.botFeedbackMessage!=null&&A.hasOwnProperty("botFeedbackMessage")&&(s.botFeedbackMessage=p.proto.BotFeedbackMessage.toObject(A.botFeedbackMessage,r),r.oneofs&&(s._botFeedbackMessage="botFeedbackMessage")),A.invokerJid!=null&&A.hasOwnProperty("invokerJid")&&(s.invokerJid=A.invokerJid,r.oneofs&&(s._invokerJid="invokerJid")),A.requestWelcomeMessageMetadata!=null&&A.hasOwnProperty("requestWelcomeMessageMetadata")&&(s.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.toObject(A.requestWelcomeMessageMetadata,r),r.oneofs&&(s._requestWelcomeMessageMetadata="requestWelcomeMessageMetadata")),A.mediaNotifyMessage!=null&&A.hasOwnProperty("mediaNotifyMessage")&&(s.mediaNotifyMessage=p.proto.MediaNotifyMessage.toObject(A.mediaNotifyMessage,r),r.oneofs&&(s._mediaNotifyMessage="mediaNotifyMessage")),A.cloudApiThreadControlNotification!=null&&A.hasOwnProperty("cloudApiThreadControlNotification")&&(s.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.toObject(A.cloudApiThreadControlNotification,r),r.oneofs&&(s._cloudApiThreadControlNotification="cloudApiThreadControlNotification")),A.lidMigrationMappingSyncMessage!=null&&A.hasOwnProperty("lidMigrationMappingSyncMessage")&&(s.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.toObject(A.lidMigrationMappingSyncMessage,r),r.oneofs&&(s._lidMigrationMappingSyncMessage="lidMigrationMappingSyncMessage")),A.limitSharing!=null&&A.hasOwnProperty("limitSharing")&&(s.limitSharing=p.proto.LimitSharing.toObject(A.limitSharing,r),r.oneofs&&(s._limitSharing="limitSharing")),A.aiPsiMetadata!=null&&A.hasOwnProperty("aiPsiMetadata")&&(s.aiPsiMetadata=r.bytes===String?l.base64.encode(A.aiPsiMetadata,0,A.aiPsiMetadata.length):r.bytes===Array?Array.prototype.slice.call(A.aiPsiMetadata):A.aiPsiMetadata,r.oneofs&&(s._aiPsiMetadata="aiPsiMetadata")),A.aiQueryFanout!=null&&A.hasOwnProperty("aiQueryFanout")&&(s.aiQueryFanout=p.proto.AIQueryFanout.toObject(A.aiQueryFanout,r),r.oneofs&&(s._aiQueryFanout="aiQueryFanout")),A.memberLabel!=null&&A.hasOwnProperty("memberLabel")&&(s.memberLabel=p.proto.MemberLabel.toObject(A.memberLabel,r),r.oneofs&&(s._memberLabel="memberLabel")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProtocolMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="REVOKE"]=0,A[a[3]="EPHEMERAL_SETTING"]=3,A[a[4]="EPHEMERAL_SYNC_RESPONSE"]=4,A[a[5]="HISTORY_SYNC_NOTIFICATION"]=5,A[a[6]="APP_STATE_SYNC_KEY_SHARE"]=6,A[a[7]="APP_STATE_SYNC_KEY_REQUEST"]=7,A[a[8]="MSG_FANOUT_BACKFILL_REQUEST"]=8,A[a[9]="INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC"]=9,A[a[10]="APP_STATE_FATAL_EXCEPTION_NOTIFICATION"]=10,A[a[11]="SHARE_PHONE_NUMBER"]=11,A[a[14]="MESSAGE_EDIT"]=14,A[a[16]="PEER_DATA_OPERATION_REQUEST_MESSAGE"]=16,A[a[17]="PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"]=17,A[a[18]="REQUEST_WELCOME_MESSAGE"]=18,A[a[19]="BOT_FEEDBACK_MESSAGE"]=19,A[a[20]="MEDIA_NOTIFY_MESSAGE"]=20,A[a[21]="CLOUD_API_THREAD_CONTROL_NOTIFICATION"]=21,A[a[22]="LID_MIGRATION_MAPPING_SYNC"]=22,A[a[23]="REMINDER_MESSAGE"]=23,A[a[24]="BOT_MEMU_ONBOARDING_MESSAGE"]=24,A[a[25]="STATUS_MENTION_MESSAGE"]=25,A[a[26]="STOP_GENERATION_MESSAGE"]=26,A[a[27]="LIMIT_SHARING"]=27,A[a[28]="AI_PSI_METADATA"]=28,A[a[29]="AI_QUERY_FANOUT"]=29,A[a[30]="GROUP_MEMBER_LABEL_CHANGE"]=30,A})(),i})(),t.QuestionResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.QuestionResponseMessage)return A;var r=new p.proto.Message.QuestionResponseMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.QuestionResponseMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.QuestionResponseMessage"},i})(),t.ReactionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}case 3:{c.groupingKey=A.string();break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ReactionMessage)return A;var r=new p.proto.Message.ReactionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ReactionMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),A.groupingKey!=null&&(r.groupingKey=String(A.groupingKey)),A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.groupingKey!=null&&A.hasOwnProperty("groupingKey")&&(s.groupingKey=A.groupingKey,r.oneofs&&(s._groupingKey="groupingKey")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ReactionMessage"},i})(),t.RequestPaymentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 4:{c.noteMessage=p.proto.Message.decode(A,A.uint32());break}case 1:{c.currencyCodeIso4217=A.string();break}case 2:{c.amount1000=A.uint64();break}case 3:{c.requestFrom=A.string();break}case 5:{c.expiryTimestamp=A.int64();break}case 6:{c.amount=p.proto.Money.decode(A,A.uint32());break}case 7:{c.background=p.proto.PaymentBackground.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestPaymentMessage)return A;var r=new p.proto.Message.RequestPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected");r.noteMessage=p.proto.Message.fromObject(A.noteMessage)}if(A.currencyCodeIso4217!=null&&(r.currencyCodeIso4217=String(A.currencyCodeIso4217)),A.amount1000!=null&&(l.Long?(r.amount1000=l.Long.fromValue(A.amount1000)).unsigned=!0:typeof A.amount1000=="string"?r.amount1000=parseInt(A.amount1000,10):typeof A.amount1000=="number"?r.amount1000=A.amount1000:typeof A.amount1000=="object"&&(r.amount1000=new l.LongBits(A.amount1000.low>>>0,A.amount1000.high>>>0).toNumber(!0))),A.requestFrom!=null&&(r.requestFrom=String(A.requestFrom)),A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),A.amount!=null){if(typeof A.amount!="object")throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected");r.amount=p.proto.Money.fromObject(A.amount)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected");r.background=p.proto.PaymentBackground.fromObject(A.background)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.currencyCodeIso4217!=null&&A.hasOwnProperty("currencyCodeIso4217")&&(s.currencyCodeIso4217=A.currencyCodeIso4217,r.oneofs&&(s._currencyCodeIso4217="currencyCodeIso4217")),A.amount1000!=null&&A.hasOwnProperty("amount1000")&&(typeof A.amount1000=="number"?s.amount1000=r.longs===String?String(A.amount1000):A.amount1000:s.amount1000=r.longs===String?ge(A.amount1000,!0):r.longs===Number?ce(A.amount1000,!0):A.amount1000,r.oneofs&&(s._amount1000="amount1000")),A.requestFrom!=null&&A.hasOwnProperty("requestFrom")&&(s.requestFrom=A.requestFrom,r.oneofs&&(s._requestFrom="requestFrom")),A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=p.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),A.amount!=null&&A.hasOwnProperty("amount")&&(s.amount=p.proto.Money.toObject(A.amount,r),r.oneofs&&(s._amount="amount")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=p.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPaymentMessage"},i})(),t.RequestPhoneNumberMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestPhoneNumberMessage)return A;var r=new p.proto.Message.RequestPhoneNumberMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPhoneNumberMessage"},i})(),t.RequestWelcomeMessageMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.localChatState=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestWelcomeMessageMetadata)return A;var r=new p.proto.Message.RequestWelcomeMessageMetadata;switch(A.localChatState){default:if(typeof A.localChatState=="number"){r.localChatState=A.localChatState;break}break;case"EMPTY":case 0:r.localChatState=0;break;case"NON_EMPTY":case 1:r.localChatState=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.localChatState!=null&&A.hasOwnProperty("localChatState")&&(s.localChatState=r.enums===String?p.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]===void 0?A.localChatState:p.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]:A.localChatState,r.oneofs&&(s._localChatState="localChatState")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestWelcomeMessageMetadata"},i.LocalChatState=(function(){let a={},A=Object.create(a);return A[a[0]="EMPTY"]=0,A[a[1]="NON_EMPTY"]=1,A})(),i})(),t.ScheduledCallCreationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.scheduledTimestampMs=A.int64();break}case 2:{c.callType=A.int32();break}case 3:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ScheduledCallCreationMessage)return A;var r=new p.proto.Message.ScheduledCallCreationMessage;switch(A.scheduledTimestampMs!=null&&(l.Long?(r.scheduledTimestampMs=l.Long.fromValue(A.scheduledTimestampMs)).unsigned=!1:typeof A.scheduledTimestampMs=="string"?r.scheduledTimestampMs=parseInt(A.scheduledTimestampMs,10):typeof A.scheduledTimestampMs=="number"?r.scheduledTimestampMs=A.scheduledTimestampMs:typeof A.scheduledTimestampMs=="object"&&(r.scheduledTimestampMs=new l.LongBits(A.scheduledTimestampMs.low>>>0,A.scheduledTimestampMs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"UNKNOWN":case 0:r.callType=0;break;case"VOICE":case 1:r.callType=1;break;case"VIDEO":case 2:r.callType=2;break}return A.title!=null&&(r.title=String(A.title)),r},i.toObject=function(A,r){r||(r={});var s={};return A.scheduledTimestampMs!=null&&A.hasOwnProperty("scheduledTimestampMs")&&(typeof A.scheduledTimestampMs=="number"?s.scheduledTimestampMs=r.longs===String?String(A.scheduledTimestampMs):A.scheduledTimestampMs:s.scheduledTimestampMs=r.longs===String?ge(A.scheduledTimestampMs):r.longs===Number?ce(A.scheduledTimestampMs):A.scheduledTimestampMs,r.oneofs&&(s._scheduledTimestampMs="scheduledTimestampMs")),A.callType!=null&&A.hasOwnProperty("callType")&&(s.callType=r.enums===String?p.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]===void 0?A.callType:p.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]:A.callType,r.oneofs&&(s._callType="callType")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallCreationMessage"},i.CallType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="VOICE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.ScheduledCallEditMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.editType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ScheduledCallEditMessage)return A;var r=new p.proto.Message.ScheduledCallEditMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.editType){default:if(typeof A.editType=="number"){r.editType=A.editType;break}break;case"UNKNOWN":case 0:r.editType=0;break;case"CANCEL":case 1:r.editType=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.editType!=null&&A.hasOwnProperty("editType")&&(s.editType=r.enums===String?p.proto.Message.ScheduledCallEditMessage.EditType[A.editType]===void 0?A.editType:p.proto.Message.ScheduledCallEditMessage.EditType[A.editType]:A.editType,r.oneofs&&(s._editType="editType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallEditMessage"},i.EditType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CANCEL"]=1,A})(),i})(),t.SecretEncryptedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}case 4:{c.secretEncType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SecretEncryptedMessage)return A;var r=new p.proto.Message.SecretEncryptedMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}switch(A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),A.secretEncType){default:if(typeof A.secretEncType=="number"){r.secretEncType=A.secretEncType;break}break;case"UNKNOWN":case 0:r.secretEncType=0;break;case"EVENT_EDIT":case 1:r.secretEncType=1;break;case"MESSAGE_EDIT":case 2:r.secretEncType=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),A.secretEncType!=null&&A.hasOwnProperty("secretEncType")&&(s.secretEncType=r.enums===String?p.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]===void 0?A.secretEncType:p.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]:A.secretEncType,r.oneofs&&(s._secretEncType="secretEncType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SecretEncryptedMessage"},i.SecretEncType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="EVENT_EDIT"]=1,A[a[2]="MESSAGE_EDIT"]=2,A})(),i})(),t.SendPaymentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 2:{c.noteMessage=p.proto.Message.decode(A,A.uint32());break}case 3:{c.requestMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 4:{c.background=p.proto.PaymentBackground.decode(A,A.uint32());break}case 5:{c.transactionData=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SendPaymentMessage)return A;var r=new p.proto.Message.SendPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected");r.noteMessage=p.proto.Message.fromObject(A.noteMessage)}if(A.requestMessageKey!=null){if(typeof A.requestMessageKey!="object")throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected");r.requestMessageKey=p.proto.MessageKey.fromObject(A.requestMessageKey)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.SendPaymentMessage.background: object expected");r.background=p.proto.PaymentBackground.fromObject(A.background)}return A.transactionData!=null&&(r.transactionData=String(A.transactionData)),r},i.toObject=function(A,r){r||(r={});var s={};return A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=p.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.requestMessageKey!=null&&A.hasOwnProperty("requestMessageKey")&&(s.requestMessageKey=p.proto.MessageKey.toObject(A.requestMessageKey,r),r.oneofs&&(s._requestMessageKey="requestMessageKey")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=p.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),A.transactionData!=null&&A.hasOwnProperty("transactionData")&&(s.transactionData=A.transactionData,r.oneofs&&(s._transactionData="transactionData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SendPaymentMessage"},i})(),t.SenderKeyDistributionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.groupId=A.string();break}case 2:{c.axolotlSenderKeyDistributionMessage=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SenderKeyDistributionMessage)return A;var r=new p.proto.Message.SenderKeyDistributionMessage;return A.groupId!=null&&(r.groupId=String(A.groupId)),A.axolotlSenderKeyDistributionMessage!=null&&(typeof A.axolotlSenderKeyDistributionMessage=="string"?l.base64.decode(A.axolotlSenderKeyDistributionMessage,r.axolotlSenderKeyDistributionMessage=l.newBuffer(l.base64.length(A.axolotlSenderKeyDistributionMessage)),0):A.axolotlSenderKeyDistributionMessage.length>=0&&(r.axolotlSenderKeyDistributionMessage=A.axolotlSenderKeyDistributionMessage)),r},i.toObject=function(A,r){r||(r={});var s={};return A.groupId!=null&&A.hasOwnProperty("groupId")&&(s.groupId=A.groupId,r.oneofs&&(s._groupId="groupId")),A.axolotlSenderKeyDistributionMessage!=null&&A.hasOwnProperty("axolotlSenderKeyDistributionMessage")&&(s.axolotlSenderKeyDistributionMessage=r.bytes===String?l.base64.encode(A.axolotlSenderKeyDistributionMessage,0,A.axolotlSenderKeyDistributionMessage.length):r.bytes===Array?Array.prototype.slice.call(A.axolotlSenderKeyDistributionMessage):A.axolotlSenderKeyDistributionMessage,r.oneofs&&(s._axolotlSenderKeyDistributionMessage="axolotlSenderKeyDistributionMessage")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SenderKeyDistributionMessage"},i})(),t.StatusNotificationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.responseMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.originalMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusNotificationMessage)return A;var r=new p.proto.Message.StatusNotificationMessage;if(A.responseMessageKey!=null){if(typeof A.responseMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected");r.responseMessageKey=p.proto.MessageKey.fromObject(A.responseMessageKey)}if(A.originalMessageKey!=null){if(typeof A.originalMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected");r.originalMessageKey=p.proto.MessageKey.fromObject(A.originalMessageKey)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"STATUS_ADD_YOURS":case 1:r.type=1;break;case"STATUS_RESHARE":case 2:r.type=2;break;case"STATUS_QUESTION_ANSWER_RESHARE":case 3:r.type=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.responseMessageKey!=null&&A.hasOwnProperty("responseMessageKey")&&(s.responseMessageKey=p.proto.MessageKey.toObject(A.responseMessageKey,r),r.oneofs&&(s._responseMessageKey="responseMessageKey")),A.originalMessageKey!=null&&A.hasOwnProperty("originalMessageKey")&&(s.originalMessageKey=p.proto.MessageKey.toObject(A.originalMessageKey,r),r.oneofs&&(s._originalMessageKey="originalMessageKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]===void 0?A.type:p.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusNotificationMessage"},i.StatusNotificationType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="STATUS_ADD_YOURS"]=1,A[a[2]="STATUS_RESHARE"]=2,A[a[3]="STATUS_QUESTION_ANSWER_RESHARE"]=3,A})(),i})(),t.StatusQuestionAnswerMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusQuestionAnswerMessage)return A;var r=new p.proto.Message.StatusQuestionAnswerMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusQuestionAnswerMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuestionAnswerMessage"},i})(),t.StatusQuotedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.text=A.string();break}case 3:{c.thumbnail=A.bytes();break}case 4:{c.originalStatusId=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusQuotedMessage)return A;var r=new p.proto.Message.StatusQuotedMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"QUESTION_ANSWER":case 1:r.type=1;break}if(A.text!=null&&(r.text=String(A.text)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.originalStatusId!=null){if(typeof A.originalStatusId!="object")throw TypeError(".proto.Message.StatusQuotedMessage.originalStatusId: object expected");r.originalStatusId=p.proto.MessageKey.fromObject(A.originalStatusId)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]===void 0?A.type:p.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]:A.type,r.oneofs&&(s._type="type")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.originalStatusId!=null&&A.hasOwnProperty("originalStatusId")&&(s.originalStatusId=p.proto.MessageKey.toObject(A.originalStatusId,r),r.oneofs&&(s._originalStatusId="originalStatusId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuotedMessage"},i.StatusQuotedMessageType=(function(){let a={},A=Object.create(a);return A[a[1]="QUESTION_ANSWER"]=1,A})(),i})(),t.StatusStickerInteractionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.stickerKey=A.string();break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusStickerInteractionMessage)return A;var r=new p.proto.Message.StatusStickerInteractionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusStickerInteractionMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.stickerKey!=null&&(r.stickerKey=String(A.stickerKey)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"REACTION":case 1:r.type=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.stickerKey!=null&&A.hasOwnProperty("stickerKey")&&(s.stickerKey=A.stickerKey,r.oneofs&&(s._stickerKey="stickerKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]===void 0?A.type:p.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusStickerInteractionMessage"},i.StatusStickerType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="REACTION"]=1,A})(),i})(),t.StickerMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.fileEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mimetype=A.string();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.directPath=A.string();break}case 9:{c.fileLength=A.uint64();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 11:{c.firstFrameLength=A.uint32();break}case 12:{c.firstFrameSidecar=A.bytes();break}case 13:{c.isAnimated=A.bool();break}case 16:{c.pngThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.stickerSentTs=A.int64();break}case 19:{c.isAvatar=A.bool();break}case 20:{c.isAiSticker=A.bool();break}case 21:{c.isLottie=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerMessage)return A;var r=new p.proto.Message.StickerMessage;if(A.url!=null&&(r.url=String(A.url)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.firstFrameLength!=null&&(r.firstFrameLength=A.firstFrameLength>>>0),A.firstFrameSidecar!=null&&(typeof A.firstFrameSidecar=="string"?l.base64.decode(A.firstFrameSidecar,r.firstFrameSidecar=l.newBuffer(l.base64.length(A.firstFrameSidecar)),0):A.firstFrameSidecar.length>=0&&(r.firstFrameSidecar=A.firstFrameSidecar)),A.isAnimated!=null&&(r.isAnimated=!!A.isAnimated),A.pngThumbnail!=null&&(typeof A.pngThumbnail=="string"?l.base64.decode(A.pngThumbnail,r.pngThumbnail=l.newBuffer(l.base64.length(A.pngThumbnail)),0):A.pngThumbnail.length>=0&&(r.pngThumbnail=A.pngThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.stickerSentTs!=null&&(l.Long?(r.stickerSentTs=l.Long.fromValue(A.stickerSentTs)).unsigned=!1:typeof A.stickerSentTs=="string"?r.stickerSentTs=parseInt(A.stickerSentTs,10):typeof A.stickerSentTs=="number"?r.stickerSentTs=A.stickerSentTs:typeof A.stickerSentTs=="object"&&(r.stickerSentTs=new l.LongBits(A.stickerSentTs.low>>>0,A.stickerSentTs.high>>>0).toNumber())),A.isAvatar!=null&&(r.isAvatar=!!A.isAvatar),A.isAiSticker!=null&&(r.isAiSticker=!!A.isAiSticker),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.firstFrameLength!=null&&A.hasOwnProperty("firstFrameLength")&&(s.firstFrameLength=A.firstFrameLength,r.oneofs&&(s._firstFrameLength="firstFrameLength")),A.firstFrameSidecar!=null&&A.hasOwnProperty("firstFrameSidecar")&&(s.firstFrameSidecar=r.bytes===String?l.base64.encode(A.firstFrameSidecar,0,A.firstFrameSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.firstFrameSidecar):A.firstFrameSidecar,r.oneofs&&(s._firstFrameSidecar="firstFrameSidecar")),A.isAnimated!=null&&A.hasOwnProperty("isAnimated")&&(s.isAnimated=A.isAnimated,r.oneofs&&(s._isAnimated="isAnimated")),A.pngThumbnail!=null&&A.hasOwnProperty("pngThumbnail")&&(s.pngThumbnail=r.bytes===String?l.base64.encode(A.pngThumbnail,0,A.pngThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.pngThumbnail):A.pngThumbnail,r.oneofs&&(s._pngThumbnail="pngThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.stickerSentTs!=null&&A.hasOwnProperty("stickerSentTs")&&(typeof A.stickerSentTs=="number"?s.stickerSentTs=r.longs===String?String(A.stickerSentTs):A.stickerSentTs:s.stickerSentTs=r.longs===String?ge(A.stickerSentTs):r.longs===Number?ce(A.stickerSentTs):A.stickerSentTs,r.oneofs&&(s._stickerSentTs="stickerSentTs")),A.isAvatar!=null&&A.hasOwnProperty("isAvatar")&&(s.isAvatar=A.isAvatar,r.oneofs&&(s._isAvatar="isAvatar")),A.isAiSticker!=null&&A.hasOwnProperty("isAiSticker")&&(s.isAiSticker=A.isAiSticker,r.oneofs&&(s._isAiSticker="isAiSticker")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StickerMessage"},i})(),t.StickerPackMessage=(function(){function i(a){if(this.stickers=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.stickerPackId=A.string();break}case 2:{c.name=A.string();break}case 3:{c.publisher=A.string();break}case 4:{c.stickers&&c.stickers.length||(c.stickers=[]),c.stickers.push(p.proto.Message.StickerPackMessage.Sticker.decode(A,A.uint32()));break}case 5:{c.fileLength=A.uint64();break}case 6:{c.fileSha256=A.bytes();break}case 7:{c.fileEncSha256=A.bytes();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.caption=A.string();break}case 11:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.packDescription=A.string();break}case 13:{c.mediaKeyTimestamp=A.int64();break}case 14:{c.trayIconFileName=A.string();break}case 15:{c.thumbnailDirectPath=A.string();break}case 16:{c.thumbnailSha256=A.bytes();break}case 17:{c.thumbnailEncSha256=A.bytes();break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.imageDataHash=A.string();break}case 21:{c.stickerPackSize=A.uint64();break}case 22:{c.stickerPackOrigin=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerPackMessage)return A;var r=new p.proto.Message.StickerPackMessage;if(A.stickerPackId!=null&&(r.stickerPackId=String(A.stickerPackId)),A.name!=null&&(r.name=String(A.name)),A.publisher!=null&&(r.publisher=String(A.publisher)),A.stickers){if(!Array.isArray(A.stickers))throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected");r.stickers=[];for(var s=0;s>>0,A.fileLength.high>>>0).toNumber(!0))),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.packDescription!=null&&(r.packDescription=String(A.packDescription)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.trayIconFileName!=null&&(r.trayIconFileName=String(A.trayIconFileName)),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.imageDataHash!=null&&(r.imageDataHash=String(A.imageDataHash)),A.stickerPackSize!=null&&(l.Long?(r.stickerPackSize=l.Long.fromValue(A.stickerPackSize)).unsigned=!0:typeof A.stickerPackSize=="string"?r.stickerPackSize=parseInt(A.stickerPackSize,10):typeof A.stickerPackSize=="number"?r.stickerPackSize=A.stickerPackSize:typeof A.stickerPackSize=="object"&&(r.stickerPackSize=new l.LongBits(A.stickerPackSize.low>>>0,A.stickerPackSize.high>>>0).toNumber(!0))),A.stickerPackOrigin){default:if(typeof A.stickerPackOrigin=="number"){r.stickerPackOrigin=A.stickerPackOrigin;break}break;case"FIRST_PARTY":case 0:r.stickerPackOrigin=0;break;case"THIRD_PARTY":case 1:r.stickerPackOrigin=1;break;case"USER_CREATED":case 2:r.stickerPackOrigin=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.stickers=[]),A.stickerPackId!=null&&A.hasOwnProperty("stickerPackId")&&(s.stickerPackId=A.stickerPackId,r.oneofs&&(s._stickerPackId="stickerPackId")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.publisher!=null&&A.hasOwnProperty("publisher")&&(s.publisher=A.publisher,r.oneofs&&(s._publisher="publisher")),A.stickers&&A.stickers.length){s.stickers=[];for(var g=0;g>>3){case 1:{d.fileName=s.string();break}case 2:{d.isAnimated=s.bool();break}case 3:{d.emojis&&d.emojis.length||(d.emojis=[]),d.emojis.push(s.string());break}case 4:{d.accessibilityLabel=s.string();break}case 5:{d.isLottie=s.bool();break}case 6:{d.mimetype=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.StickerPackMessage.Sticker)return s;var g=new p.proto.Message.StickerPackMessage.Sticker;if(s.fileName!=null&&(g.fileName=String(s.fileName)),s.isAnimated!=null&&(g.isAnimated=!!s.isAnimated),s.emojis){if(!Array.isArray(s.emojis))throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected");g.emojis=[];for(var c=0;c>>3){case 1:{c.filehash&&c.filehash.length||(c.filehash=[]),c.filehash.push(A.string());break}case 2:{c.rmrSource=A.string();break}case 3:{c.requestTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerSyncRMRMessage)return A;var r=new p.proto.Message.StickerSyncRMRMessage;if(A.filehash){if(!Array.isArray(A.filehash))throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected");r.filehash=[];for(var s=0;s>>0,A.requestTimestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.filehash=[]),A.filehash&&A.filehash.length){s.filehash=[];for(var g=0;g>>3){case 1:{c.selectedId=A.string();break}case 2:{c.selectedDisplayText=A.string();break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.selectedIndex=A.uint32();break}case 5:{c.selectedCarouselCardIndex=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.TemplateButtonReplyMessage)return A;var r=new p.proto.Message.TemplateButtonReplyMessage;if(A.selectedId!=null&&(r.selectedId=String(A.selectedId)),A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.selectedIndex!=null&&(r.selectedIndex=A.selectedIndex>>>0),A.selectedCarouselCardIndex!=null&&(r.selectedCarouselCardIndex=A.selectedCarouselCardIndex>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.selectedId!=null&&A.hasOwnProperty("selectedId")&&(s.selectedId=A.selectedId,r.oneofs&&(s._selectedId="selectedId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s._selectedDisplayText="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.selectedIndex!=null&&A.hasOwnProperty("selectedIndex")&&(s.selectedIndex=A.selectedIndex,r.oneofs&&(s._selectedIndex="selectedIndex")),A.selectedCarouselCardIndex!=null&&A.hasOwnProperty("selectedCarouselCardIndex")&&(s.selectedCarouselCardIndex=A.selectedCarouselCardIndex,r.oneofs&&(s._selectedCarouselCardIndex="selectedCarouselCardIndex")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateButtonReplyMessage"},i})(),t.TemplateMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 9:{c.templateId=A.string();break}case 1:{c.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.decode(A,A.uint32());break}case 2:{c.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 5:{c.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.TemplateMessage)return A;var r=new p.proto.Message.TemplateMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.hydratedTemplate!=null){if(typeof A.hydratedTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected");r.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedTemplate)}if(A.templateId!=null&&(r.templateId=String(A.templateId)),A.fourRowTemplate!=null){if(typeof A.fourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected");r.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.fromObject(A.fourRowTemplate)}if(A.hydratedFourRowTemplate!=null){if(typeof A.hydratedFourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected");r.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedFourRowTemplate)}if(A.interactiveMessageTemplate!=null){if(typeof A.interactiveMessageTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected");r.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.fromObject(A.interactiveMessageTemplate)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.fourRowTemplate!=null&&A.hasOwnProperty("fourRowTemplate")&&(s.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.toObject(A.fourRowTemplate,r),r.oneofs&&(s.format="fourRowTemplate")),A.hydratedFourRowTemplate!=null&&A.hasOwnProperty("hydratedFourRowTemplate")&&(s.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedFourRowTemplate,r),r.oneofs&&(s.format="hydratedFourRowTemplate")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.hydratedTemplate!=null&&A.hasOwnProperty("hydratedTemplate")&&(s.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedTemplate,r),r.oneofs&&(s._hydratedTemplate="hydratedTemplate")),A.interactiveMessageTemplate!=null&&A.hasOwnProperty("interactiveMessageTemplate")&&(s.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.toObject(A.interactiveMessageTemplate,r),r.oneofs&&(s.format="interactiveMessageTemplate")),A.templateId!=null&&A.hasOwnProperty("templateId")&&(s.templateId=A.templateId,r.oneofs&&(s._templateId="templateId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateMessage"},i.FourRowTemplate=(function(){function a(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 6:{d.content=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 7:{d.footer=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 8:{d.buttons&&d.buttons.length||(d.buttons=[]),d.buttons.push(p.proto.TemplateButton.decode(s,s.uint32()));break}case 1:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{d.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 3:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.TemplateMessage.FourRowTemplate)return s;var g=new p.proto.Message.TemplateMessage.FourRowTemplate;if(s.content!=null){if(typeof s.content!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected");g.content=p.proto.Message.HighlyStructuredMessage.fromObject(s.content)}if(s.footer!=null){if(typeof s.footer!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected");g.footer=p.proto.Message.HighlyStructuredMessage.fromObject(s.footer)}if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 6:{d.hydratedContentText=s.string();break}case 7:{d.hydratedFooterText=s.string();break}case 8:{d.hydratedButtons&&d.hydratedButtons.length||(d.hydratedButtons=[]),d.hydratedButtons.push(p.proto.HydratedTemplateButton.decode(s,s.uint32()));break}case 9:{d.templateId=s.string();break}case 10:{d.maskLinkedDevices=s.bool();break}case 1:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{d.hydratedTitleText=s.string();break}case 3:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.TemplateMessage.HydratedFourRowTemplate)return s;var g=new p.proto.Message.TemplateMessage.HydratedFourRowTemplate;if(s.hydratedContentText!=null&&(g.hydratedContentText=String(s.hydratedContentText)),s.hydratedFooterText!=null&&(g.hydratedFooterText=String(s.hydratedFooterText)),s.hydratedButtons){if(!Array.isArray(s.hydratedButtons))throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected");g.hydratedButtons=[];for(var c=0;c>>3){case 1:{c.fbExperimentId=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.URLMetadata)return A;var r=new p.proto.Message.URLMetadata;return A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.URLMetadata"},i})(),t.VideoEndCard=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.username=a.string();break}case 2:{g.caption=a.string();break}case 3:{g.thumbnailImageUrl=a.string();break}case 4:{g.profilePictureUrl=a.string();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.VideoEndCard)return a;var A=new p.proto.Message.VideoEndCard;return a.username!=null&&(A.username=String(a.username)),a.caption!=null&&(A.caption=String(a.caption)),a.thumbnailImageUrl!=null&&(A.thumbnailImageUrl=String(a.thumbnailImageUrl)),a.profilePictureUrl!=null&&(A.profilePictureUrl=String(a.profilePictureUrl)),A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.username="",r.caption="",r.thumbnailImageUrl="",r.profilePictureUrl=""),a.username!=null&&a.hasOwnProperty("username")&&(r.username=a.username),a.caption!=null&&a.hasOwnProperty("caption")&&(r.caption=a.caption),a.thumbnailImageUrl!=null&&a.hasOwnProperty("thumbnailImageUrl")&&(r.thumbnailImageUrl=a.thumbnailImageUrl),a.profilePictureUrl!=null&&a.hasOwnProperty("profilePictureUrl")&&(r.profilePictureUrl=a.profilePictureUrl),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Message.VideoEndCard"},i})(),t.VideoMessage=(function(){function i(a){if(this.interactiveAnnotations=[],this.annotations=[],this.processedVideos=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.mediaKey=A.bytes();break}case 7:{c.caption=A.string();break}case 8:{c.gifPlayback=A.bool();break}case 9:{c.height=A.uint32();break}case 10:{c.width=A.uint32();break}case 11:{c.fileEncSha256=A.bytes();break}case 12:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 13:{c.directPath=A.string();break}case 14:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.gifAttribution=A.int32();break}case 20:{c.viewOnce=A.bool();break}case 21:{c.thumbnailDirectPath=A.string();break}case 22:{c.thumbnailSha256=A.bytes();break}case 23:{c.thumbnailEncSha256=A.bytes();break}case 24:{c.staticUrl=A.string();break}case 25:{c.annotations&&c.annotations.length||(c.annotations=[]),c.annotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 26:{c.accessibilityLabel=A.string();break}case 27:{c.processedVideos&&c.processedVideos.length||(c.processedVideos=[]),c.processedVideos.push(p.proto.ProcessedVideo.decode(A,A.uint32()));break}case 28:{c.externalShareFullVideoDurationInSeconds=A.uint32();break}case 29:{c.motionPhotoPresentationOffsetMs=A.uint64();break}case 30:{c.metadataUrl=A.string();break}case 31:{c.videoSourceType=A.int32();break}case 32:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.VideoMessage)return A;var r=new p.proto.Message.VideoMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.caption!=null&&(r.caption=String(A.caption)),A.gifPlayback!=null&&(r.gifPlayback=!!A.gifPlayback),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.gifAttribution){default:if(typeof A.gifAttribution=="number"){r.gifAttribution=A.gifAttribution;break}break;case"NONE":case 0:r.gifAttribution=0;break;case"GIPHY":case 1:r.gifAttribution=1;break;case"TENOR":case 2:r.gifAttribution=2;break;case"KLIPY":case 3:r.gifAttribution=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.VideoMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>0),A.motionPhotoPresentationOffsetMs!=null&&(l.Long?(r.motionPhotoPresentationOffsetMs=l.Long.fromValue(A.motionPhotoPresentationOffsetMs)).unsigned=!0:typeof A.motionPhotoPresentationOffsetMs=="string"?r.motionPhotoPresentationOffsetMs=parseInt(A.motionPhotoPresentationOffsetMs,10):typeof A.motionPhotoPresentationOffsetMs=="number"?r.motionPhotoPresentationOffsetMs=A.motionPhotoPresentationOffsetMs:typeof A.motionPhotoPresentationOffsetMs=="object"&&(r.motionPhotoPresentationOffsetMs=new l.LongBits(A.motionPhotoPresentationOffsetMs.low>>>0,A.motionPhotoPresentationOffsetMs.high>>>0).toNumber(!0))),A.metadataUrl!=null&&(r.metadataUrl=String(A.metadataUrl)),A.videoSourceType){default:if(typeof A.videoSourceType=="number"){r.videoSourceType=A.videoSourceType;break}break;case"USER_VIDEO":case 0:r.videoSourceType=0;break;case"AI_GENERATED":case 1:r.videoSourceType=1;break}switch(A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.interactiveAnnotations=[],s.annotations=[],s.processedVideos=[]),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.gifPlayback!=null&&A.hasOwnProperty("gifPlayback")&&(s.gifPlayback=A.gifPlayback,r.oneofs&&(s._gifPlayback="gifPlayback")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.interactiveAnnotations&&A.interactiveAnnotations.length){s.interactiveAnnotations=[];for(var g=0;g>>3){case 1:{s.messageAddOnType=e.int32();break}case 2:{s.messageAddOn=p.proto.Message.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.status=e.int32();break}case 6:{s.addOnContextInfo=p.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}case 7:{s.messageAddOnKey=p.proto.MessageKey.decode(e,e.uint32());break}case 8:{s.legacyMessage=p.proto.LegacyMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageAddOn)return e;var a=new p.proto.MessageAddOn;switch(e.messageAddOnType){default:if(typeof e.messageAddOnType=="number"){a.messageAddOnType=e.messageAddOnType;break}break;case"UNDEFINED":case 0:a.messageAddOnType=0;break;case"REACTION":case 1:a.messageAddOnType=1;break;case"EVENT_RESPONSE":case 2:a.messageAddOnType=2;break;case"POLL_UPDATE":case 3:a.messageAddOnType=3;break;case"PIN_IN_CHAT":case 4:a.messageAddOnType=4;break}if(e.messageAddOn!=null){if(typeof e.messageAddOn!="object")throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");a.messageAddOn=p.proto.Message.fromObject(e.messageAddOn)}switch(e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"ERROR":case 0:a.status=0;break;case"PENDING":case 1:a.status=1;break;case"SERVER_ACK":case 2:a.status=2;break;case"DELIVERY_ACK":case 3:a.status=3;break;case"READ":case 4:a.status=4;break;case"PLAYED":case 5:a.status=5;break}if(e.addOnContextInfo!=null){if(typeof e.addOnContextInfo!="object")throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");a.addOnContextInfo=p.proto.MessageAddOnContextInfo.fromObject(e.addOnContextInfo)}if(e.messageAddOnKey!=null){if(typeof e.messageAddOnKey!="object")throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");a.messageAddOnKey=p.proto.MessageKey.fromObject(e.messageAddOnKey)}if(e.legacyMessage!=null){if(typeof e.legacyMessage!="object")throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");a.legacyMessage=p.proto.LegacyMessage.fromObject(e.legacyMessage)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageAddOnType!=null&&e.hasOwnProperty("messageAddOnType")&&(A.messageAddOnType=a.enums===String?p.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]===void 0?e.messageAddOnType:p.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]:e.messageAddOnType,a.oneofs&&(A._messageAddOnType="messageAddOnType")),e.messageAddOn!=null&&e.hasOwnProperty("messageAddOn")&&(A.messageAddOn=p.proto.Message.toObject(e.messageAddOn,a),a.oneofs&&(A._messageAddOn="messageAddOn")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=a.enums===String?p.proto.WebMessageInfo.Status[e.status]===void 0?e.status:p.proto.WebMessageInfo.Status[e.status]:e.status,a.oneofs&&(A._status="status")),e.addOnContextInfo!=null&&e.hasOwnProperty("addOnContextInfo")&&(A.addOnContextInfo=p.proto.MessageAddOnContextInfo.toObject(e.addOnContextInfo,a),a.oneofs&&(A._addOnContextInfo="addOnContextInfo")),e.messageAddOnKey!=null&&e.hasOwnProperty("messageAddOnKey")&&(A.messageAddOnKey=p.proto.MessageKey.toObject(e.messageAddOnKey,a),a.oneofs&&(A._messageAddOnKey="messageAddOnKey")),e.legacyMessage!=null&&e.hasOwnProperty("legacyMessage")&&(A.legacyMessage=p.proto.LegacyMessage.toObject(e.legacyMessage,a),a.oneofs&&(A._legacyMessage="legacyMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOn"},t.MessageAddOnType=(function(){let i={},e=Object.create(i);return e[i[0]="UNDEFINED"]=0,e[i[1]="REACTION"]=1,e[i[2]="EVENT_RESPONSE"]=2,e[i[3]="POLL_UPDATE"]=3,e[i[4]="PIN_IN_CHAT"]=4,e})(),t})(),n.MessageAddOnContextInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageAddOnDurationInSecs=e.uint32();break}case 2:{s.messageAddOnExpiryType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageAddOnContextInfo)return e;var a=new p.proto.MessageAddOnContextInfo;switch(e.messageAddOnDurationInSecs!=null&&(a.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){a.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:a.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:a.messageAddOnExpiryType=2;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageAddOnDurationInSecs!=null&&e.hasOwnProperty("messageAddOnDurationInSecs")&&(A.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs,a.oneofs&&(A._messageAddOnDurationInSecs="messageAddOnDurationInSecs")),e.messageAddOnExpiryType!=null&&e.hasOwnProperty("messageAddOnExpiryType")&&(A.messageAddOnExpiryType=a.enums===String?p.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]===void 0?e.messageAddOnExpiryType:p.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]:e.messageAddOnExpiryType,a.oneofs&&(A._messageAddOnExpiryType="messageAddOnExpiryType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOnContextInfo"},t})(),n.MessageAssociation=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.associationType=e.int32();break}case 2:{s.parentMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.messageIndex=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageAssociation)return e;var a=new p.proto.MessageAssociation;switch(e.associationType){default:if(typeof e.associationType=="number"){a.associationType=e.associationType;break}break;case"UNKNOWN":case 0:a.associationType=0;break;case"MEDIA_ALBUM":case 1:a.associationType=1;break;case"BOT_PLUGIN":case 2:a.associationType=2;break;case"EVENT_COVER_IMAGE":case 3:a.associationType=3;break;case"STATUS_POLL":case 4:a.associationType=4;break;case"HD_VIDEO_DUAL_UPLOAD":case 5:a.associationType=5;break;case"STATUS_EXTERNAL_RESHARE":case 6:a.associationType=6;break;case"MEDIA_POLL":case 7:a.associationType=7;break;case"STATUS_ADD_YOURS":case 8:a.associationType=8;break;case"STATUS_NOTIFICATION":case 9:a.associationType=9;break;case"HD_IMAGE_DUAL_UPLOAD":case 10:a.associationType=10;break;case"STICKER_ANNOTATION":case 11:a.associationType=11;break;case"MOTION_PHOTO":case 12:a.associationType=12;break;case"STATUS_LINK_ACTION":case 13:a.associationType=13;break;case"VIEW_ALL_REPLIES":case 14:a.associationType=14;break;case"STATUS_ADD_YOURS_AI_IMAGINE":case 15:a.associationType=15;break;case"STATUS_QUESTION":case 16:a.associationType=16;break;case"STATUS_ADD_YOURS_DIWALI":case 17:a.associationType=17;break;case"STATUS_REACTION":case 18:a.associationType=18;break;case"HEVC_VIDEO_DUAL_UPLOAD":case 19:a.associationType=19;break}if(e.parentMessageKey!=null){if(typeof e.parentMessageKey!="object")throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");a.parentMessageKey=p.proto.MessageKey.fromObject(e.parentMessageKey)}return e.messageIndex!=null&&(a.messageIndex=e.messageIndex|0),a},t.toObject=function(e,a){a||(a={});var A={};return e.associationType!=null&&e.hasOwnProperty("associationType")&&(A.associationType=a.enums===String?p.proto.MessageAssociation.AssociationType[e.associationType]===void 0?e.associationType:p.proto.MessageAssociation.AssociationType[e.associationType]:e.associationType,a.oneofs&&(A._associationType="associationType")),e.parentMessageKey!=null&&e.hasOwnProperty("parentMessageKey")&&(A.parentMessageKey=p.proto.MessageKey.toObject(e.parentMessageKey,a),a.oneofs&&(A._parentMessageKey="parentMessageKey")),e.messageIndex!=null&&e.hasOwnProperty("messageIndex")&&(A.messageIndex=e.messageIndex,a.oneofs&&(A._messageIndex="messageIndex")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAssociation"},t.AssociationType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="MEDIA_ALBUM"]=1,e[i[2]="BOT_PLUGIN"]=2,e[i[3]="EVENT_COVER_IMAGE"]=3,e[i[4]="STATUS_POLL"]=4,e[i[5]="HD_VIDEO_DUAL_UPLOAD"]=5,e[i[6]="STATUS_EXTERNAL_RESHARE"]=6,e[i[7]="MEDIA_POLL"]=7,e[i[8]="STATUS_ADD_YOURS"]=8,e[i[9]="STATUS_NOTIFICATION"]=9,e[i[10]="HD_IMAGE_DUAL_UPLOAD"]=10,e[i[11]="STICKER_ANNOTATION"]=11,e[i[12]="MOTION_PHOTO"]=12,e[i[13]="STATUS_LINK_ACTION"]=13,e[i[14]="VIEW_ALL_REPLIES"]=14,e[i[15]="STATUS_ADD_YOURS_AI_IMAGINE"]=15,e[i[16]="STATUS_QUESTION"]=16,e[i[17]="STATUS_ADD_YOURS_DIWALI"]=17,e[i[18]="STATUS_REACTION"]=18,e[i[19]="HEVC_VIDEO_DUAL_UPLOAD"]=19,e})(),t})(),n.MessageContextInfo=(function(){function t(i){if(this.threadId=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.deviceListMetadata=p.proto.DeviceListMetadata.decode(e,e.uint32());break}case 2:{s.deviceListMetadataVersion=e.int32();break}case 3:{s.messageSecret=e.bytes();break}case 4:{s.paddingBytes=e.bytes();break}case 5:{s.messageAddOnDurationInSecs=e.uint32();break}case 6:{s.botMessageSecret=e.bytes();break}case 7:{s.botMetadata=p.proto.BotMetadata.decode(e,e.uint32());break}case 8:{s.reportingTokenVersion=e.int32();break}case 9:{s.messageAddOnExpiryType=e.int32();break}case 10:{s.messageAssociation=p.proto.MessageAssociation.decode(e,e.uint32());break}case 11:{s.capiCreatedGroup=e.bool();break}case 12:{s.supportPayload=e.string();break}case 13:{s.limitSharing=p.proto.LimitSharing.decode(e,e.uint32());break}case 14:{s.limitSharingV2=p.proto.LimitSharing.decode(e,e.uint32());break}case 15:{s.threadId&&s.threadId.length||(s.threadId=[]),s.threadId.push(p.proto.ThreadID.decode(e,e.uint32()));break}case 16:{s.weblinkRenderConfig=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageContextInfo)return e;var a=new p.proto.MessageContextInfo;if(e.deviceListMetadata!=null){if(typeof e.deviceListMetadata!="object")throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected");a.deviceListMetadata=p.proto.DeviceListMetadata.fromObject(e.deviceListMetadata)}if(e.deviceListMetadataVersion!=null&&(a.deviceListMetadataVersion=e.deviceListMetadataVersion|0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,a.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(a.paddingBytes=e.paddingBytes)),e.messageAddOnDurationInSecs!=null&&(a.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,a.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(a.botMessageSecret=e.botMessageSecret)),e.botMetadata!=null){if(typeof e.botMetadata!="object")throw TypeError(".proto.MessageContextInfo.botMetadata: object expected");a.botMetadata=p.proto.BotMetadata.fromObject(e.botMetadata)}switch(e.reportingTokenVersion!=null&&(a.reportingTokenVersion=e.reportingTokenVersion|0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){a.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:a.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:a.messageAddOnExpiryType=2;break}if(e.messageAssociation!=null){if(typeof e.messageAssociation!="object")throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected");a.messageAssociation=p.proto.MessageAssociation.fromObject(e.messageAssociation)}if(e.capiCreatedGroup!=null&&(a.capiCreatedGroup=!!e.capiCreatedGroup),e.supportPayload!=null&&(a.supportPayload=String(e.supportPayload)),e.limitSharing!=null){if(typeof e.limitSharing!="object")throw TypeError(".proto.MessageContextInfo.limitSharing: object expected");a.limitSharing=p.proto.LimitSharing.fromObject(e.limitSharing)}if(e.limitSharingV2!=null){if(typeof e.limitSharingV2!="object")throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected");a.limitSharingV2=p.proto.LimitSharing.fromObject(e.limitSharingV2)}if(e.threadId){if(!Array.isArray(e.threadId))throw TypeError(".proto.MessageContextInfo.threadId: array expected");a.threadId=[];for(var A=0;A>>3){case 1:{s.remoteJid=e.string();break}case 2:{s.fromMe=e.bool();break}case 3:{s.id=e.string();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageKey)return e;var a=new p.proto.MessageKey;return e.remoteJid!=null&&(a.remoteJid=String(e.remoteJid)),e.fromMe!=null&&(a.fromMe=!!e.fromMe),e.id!=null&&(a.id=String(e.id)),e.participant!=null&&(a.participant=String(e.participant)),a},t.toObject=function(e,a){a||(a={});var A={};return e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,a.oneofs&&(A._remoteJid="remoteJid")),e.fromMe!=null&&e.hasOwnProperty("fromMe")&&(A.fromMe=e.fromMe,a.oneofs&&(A._fromMe="fromMe")),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageKey"},t})(),n.MessageSecretMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=e.sfixed32();break}case 2:{s.encIv=e.bytes();break}case 3:{s.encPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageSecretMessage)return e;var a=new p.proto.MessageSecretMessage;return e.version!=null&&(a.version=e.version|0),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),a},t.toObject=function(e,a){a||(a={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=a.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):a.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,a.oneofs&&(A._encIv="encIv")),e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=a.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,a.oneofs&&(A._encPayload="encPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageSecretMessage"},t})(),n.Money=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.value=e.int64();break}case 2:{s.offset=e.uint32();break}case 3:{s.currencyCode=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Money)return e;var a=new p.proto.Money;return e.value!=null&&(l.Long?(a.value=l.Long.fromValue(e.value)).unsigned=!1:typeof e.value=="string"?a.value=parseInt(e.value,10):typeof e.value=="number"?a.value=e.value:typeof e.value=="object"&&(a.value=new l.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),e.offset!=null&&(a.offset=e.offset>>>0),e.currencyCode!=null&&(a.currencyCode=String(e.currencyCode)),a},t.toObject=function(e,a){a||(a={});var A={};return e.value!=null&&e.hasOwnProperty("value")&&(typeof e.value=="number"?A.value=a.longs===String?String(e.value):e.value:A.value=a.longs===String?ge(e.value):a.longs===Number?ce(e.value):e.value,a.oneofs&&(A._value="value")),e.offset!=null&&e.hasOwnProperty("offset")&&(A.offset=e.offset,a.oneofs&&(A._offset="offset")),e.currencyCode!=null&&e.hasOwnProperty("currencyCode")&&(A.currencyCode=e.currencyCode,a.oneofs&&(A._currencyCode="currencyCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Money"},t})(),n.MsgOpaqueData=(function(){function t(i){if(this.pollOptions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.body=e.string();break}case 3:{s.caption=e.string();break}case 5:{s.lng=e.double();break}case 6:{s.isLive=e.bool();break}case 7:{s.lat=e.double();break}case 8:{s.paymentAmount1000=e.int32();break}case 9:{s.paymentNoteMsgBody=e.string();break}case 11:{s.matchedText=e.string();break}case 12:{s.title=e.string();break}case 13:{s.description=e.string();break}case 14:{s.futureproofBuffer=e.bytes();break}case 15:{s.clientUrl=e.string();break}case 16:{s.loc=e.string();break}case 17:{s.pollName=e.string();break}case 18:{s.pollOptions&&s.pollOptions.length||(s.pollOptions=[]),s.pollOptions.push(p.proto.MsgOpaqueData.PollOption.decode(e,e.uint32()));break}case 20:{s.pollSelectableOptionsCount=e.uint32();break}case 21:{s.messageSecret=e.bytes();break}case 51:{s.originalSelfAuthor=e.string();break}case 22:{s.senderTimestampMs=e.int64();break}case 23:{s.pollUpdateParentKey=e.string();break}case 24:{s.encPollVote=p.proto.PollEncValue.decode(e,e.uint32());break}case 28:{s.isSentCagPollCreation=e.bool();break}case 42:{s.pollContentType=e.int32();break}case 46:{s.pollType=e.int32();break}case 47:{s.correctOptionIndex=e.int32();break}case 41:{s.pollVotesSnapshot=p.proto.MsgOpaqueData.PollVotesSnapshot.decode(e,e.uint32());break}case 25:{s.encReactionTargetMessageKey=e.string();break}case 26:{s.encReactionEncPayload=e.bytes();break}case 27:{s.encReactionEncIv=e.bytes();break}case 29:{s.botMessageSecret=e.bytes();break}case 30:{s.targetMessageKey=e.string();break}case 31:{s.encPayload=e.bytes();break}case 32:{s.encIv=e.bytes();break}case 33:{s.eventName=e.string();break}case 34:{s.isEventCanceled=e.bool();break}case 35:{s.eventDescription=e.string();break}case 36:{s.eventJoinLink=e.string();break}case 37:{s.eventStartTime=e.int64();break}case 38:{s.eventLocation=p.proto.MsgOpaqueData.EventLocation.decode(e,e.uint32());break}case 40:{s.eventEndTime=e.int64();break}case 44:{s.eventIsScheduledCall=e.bool();break}case 45:{s.eventExtraGuestsAllowed=e.bool();break}case 43:{s.plainProtobufBytes=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MsgOpaqueData)return e;var a=new p.proto.MsgOpaqueData;if(e.body!=null&&(a.body=String(e.body)),e.caption!=null&&(a.caption=String(e.caption)),e.lng!=null&&(a.lng=Number(e.lng)),e.isLive!=null&&(a.isLive=!!e.isLive),e.lat!=null&&(a.lat=Number(e.lat)),e.paymentAmount1000!=null&&(a.paymentAmount1000=e.paymentAmount1000|0),e.paymentNoteMsgBody!=null&&(a.paymentNoteMsgBody=String(e.paymentNoteMsgBody)),e.matchedText!=null&&(a.matchedText=String(e.matchedText)),e.title!=null&&(a.title=String(e.title)),e.description!=null&&(a.description=String(e.description)),e.futureproofBuffer!=null&&(typeof e.futureproofBuffer=="string"?l.base64.decode(e.futureproofBuffer,a.futureproofBuffer=l.newBuffer(l.base64.length(e.futureproofBuffer)),0):e.futureproofBuffer.length>=0&&(a.futureproofBuffer=e.futureproofBuffer)),e.clientUrl!=null&&(a.clientUrl=String(e.clientUrl)),e.loc!=null&&(a.loc=String(e.loc)),e.pollName!=null&&(a.pollName=String(e.pollName)),e.pollOptions){if(!Array.isArray(e.pollOptions))throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected");a.pollOptions=[];for(var A=0;A>>0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),e.originalSelfAuthor!=null&&(a.originalSelfAuthor=String(e.originalSelfAuthor)),e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.pollUpdateParentKey!=null&&(a.pollUpdateParentKey=String(e.pollUpdateParentKey)),e.encPollVote!=null){if(typeof e.encPollVote!="object")throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected");a.encPollVote=p.proto.PollEncValue.fromObject(e.encPollVote)}switch(e.isSentCagPollCreation!=null&&(a.isSentCagPollCreation=!!e.isSentCagPollCreation),e.pollContentType){default:if(typeof e.pollContentType=="number"){a.pollContentType=e.pollContentType;break}break;case"UNKNOWN":case 0:a.pollContentType=0;break;case"TEXT":case 1:a.pollContentType=1;break;case"IMAGE":case 2:a.pollContentType=2;break}switch(e.pollType){default:if(typeof e.pollType=="number"){a.pollType=e.pollType;break}break;case"POLL":case 0:a.pollType=0;break;case"QUIZ":case 1:a.pollType=1;break}if(e.correctOptionIndex!=null&&(a.correctOptionIndex=e.correctOptionIndex|0),e.pollVotesSnapshot!=null){if(typeof e.pollVotesSnapshot!="object")throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected");a.pollVotesSnapshot=p.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(e.pollVotesSnapshot)}if(e.encReactionTargetMessageKey!=null&&(a.encReactionTargetMessageKey=String(e.encReactionTargetMessageKey)),e.encReactionEncPayload!=null&&(typeof e.encReactionEncPayload=="string"?l.base64.decode(e.encReactionEncPayload,a.encReactionEncPayload=l.newBuffer(l.base64.length(e.encReactionEncPayload)),0):e.encReactionEncPayload.length>=0&&(a.encReactionEncPayload=e.encReactionEncPayload)),e.encReactionEncIv!=null&&(typeof e.encReactionEncIv=="string"?l.base64.decode(e.encReactionEncIv,a.encReactionEncIv=l.newBuffer(l.base64.length(e.encReactionEncIv)),0):e.encReactionEncIv.length>=0&&(a.encReactionEncIv=e.encReactionEncIv)),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,a.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(a.botMessageSecret=e.botMessageSecret)),e.targetMessageKey!=null&&(a.targetMessageKey=String(e.targetMessageKey)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),e.eventName!=null&&(a.eventName=String(e.eventName)),e.isEventCanceled!=null&&(a.isEventCanceled=!!e.isEventCanceled),e.eventDescription!=null&&(a.eventDescription=String(e.eventDescription)),e.eventJoinLink!=null&&(a.eventJoinLink=String(e.eventJoinLink)),e.eventStartTime!=null&&(l.Long?(a.eventStartTime=l.Long.fromValue(e.eventStartTime)).unsigned=!1:typeof e.eventStartTime=="string"?a.eventStartTime=parseInt(e.eventStartTime,10):typeof e.eventStartTime=="number"?a.eventStartTime=e.eventStartTime:typeof e.eventStartTime=="object"&&(a.eventStartTime=new l.LongBits(e.eventStartTime.low>>>0,e.eventStartTime.high>>>0).toNumber())),e.eventLocation!=null){if(typeof e.eventLocation!="object")throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected");a.eventLocation=p.proto.MsgOpaqueData.EventLocation.fromObject(e.eventLocation)}return e.eventEndTime!=null&&(l.Long?(a.eventEndTime=l.Long.fromValue(e.eventEndTime)).unsigned=!1:typeof e.eventEndTime=="string"?a.eventEndTime=parseInt(e.eventEndTime,10):typeof e.eventEndTime=="number"?a.eventEndTime=e.eventEndTime:typeof e.eventEndTime=="object"&&(a.eventEndTime=new l.LongBits(e.eventEndTime.low>>>0,e.eventEndTime.high>>>0).toNumber())),e.eventIsScheduledCall!=null&&(a.eventIsScheduledCall=!!e.eventIsScheduledCall),e.eventExtraGuestsAllowed!=null&&(a.eventExtraGuestsAllowed=!!e.eventExtraGuestsAllowed),e.plainProtobufBytes!=null&&(typeof e.plainProtobufBytes=="string"?l.base64.decode(e.plainProtobufBytes,a.plainProtobufBytes=l.newBuffer(l.base64.length(e.plainProtobufBytes)),0):e.plainProtobufBytes.length>=0&&(a.plainProtobufBytes=e.plainProtobufBytes)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.pollOptions=[]),e.body!=null&&e.hasOwnProperty("body")&&(A.body=e.body,a.oneofs&&(A._body="body")),e.caption!=null&&e.hasOwnProperty("caption")&&(A.caption=e.caption,a.oneofs&&(A._caption="caption")),e.lng!=null&&e.hasOwnProperty("lng")&&(A.lng=a.json&&!isFinite(e.lng)?String(e.lng):e.lng,a.oneofs&&(A._lng="lng")),e.isLive!=null&&e.hasOwnProperty("isLive")&&(A.isLive=e.isLive,a.oneofs&&(A._isLive="isLive")),e.lat!=null&&e.hasOwnProperty("lat")&&(A.lat=a.json&&!isFinite(e.lat)?String(e.lat):e.lat,a.oneofs&&(A._lat="lat")),e.paymentAmount1000!=null&&e.hasOwnProperty("paymentAmount1000")&&(A.paymentAmount1000=e.paymentAmount1000,a.oneofs&&(A._paymentAmount1000="paymentAmount1000")),e.paymentNoteMsgBody!=null&&e.hasOwnProperty("paymentNoteMsgBody")&&(A.paymentNoteMsgBody=e.paymentNoteMsgBody,a.oneofs&&(A._paymentNoteMsgBody="paymentNoteMsgBody")),e.matchedText!=null&&e.hasOwnProperty("matchedText")&&(A.matchedText=e.matchedText,a.oneofs&&(A._matchedText="matchedText")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.description!=null&&e.hasOwnProperty("description")&&(A.description=e.description,a.oneofs&&(A._description="description")),e.futureproofBuffer!=null&&e.hasOwnProperty("futureproofBuffer")&&(A.futureproofBuffer=a.bytes===String?l.base64.encode(e.futureproofBuffer,0,e.futureproofBuffer.length):a.bytes===Array?Array.prototype.slice.call(e.futureproofBuffer):e.futureproofBuffer,a.oneofs&&(A._futureproofBuffer="futureproofBuffer")),e.clientUrl!=null&&e.hasOwnProperty("clientUrl")&&(A.clientUrl=e.clientUrl,a.oneofs&&(A._clientUrl="clientUrl")),e.loc!=null&&e.hasOwnProperty("loc")&&(A.loc=e.loc,a.oneofs&&(A._loc="loc")),e.pollName!=null&&e.hasOwnProperty("pollName")&&(A.pollName=e.pollName,a.oneofs&&(A._pollName="pollName")),e.pollOptions&&e.pollOptions.length){A.pollOptions=[];for(var r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.jpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.EventLocation)return A;var r=new p.proto.MsgOpaqueData.EventLocation;return A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),r},i.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.EventLocation"},i})(),t.PollContentType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="TEXT"]=1,e[i[2]="IMAGE"]=2,e})(),t.PollOption=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.hash=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.PollOption)return A;var r=new p.proto.MsgOpaqueData.PollOption;return A.name!=null&&(r.name=String(A.name)),A.hash!=null&&(r.hash=String(A.hash)),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.hash!=null&&A.hasOwnProperty("hash")&&(s.hash=A.hash,r.oneofs&&(s._hash="hash")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollOption"},i})(),t.PollType=(function(){let i={},e=Object.create(i);return e[i[0]="POLL"]=0,e[i[1]="QUIZ"]=1,e})(),t.PollVoteSnapshot=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.option=p.proto.MsgOpaqueData.PollOption.decode(A,A.uint32());break}case 2:{c.optionVoteCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.PollVoteSnapshot)return A;var r=new p.proto.MsgOpaqueData.PollVoteSnapshot;if(A.option!=null){if(typeof A.option!="object")throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected");r.option=p.proto.MsgOpaqueData.PollOption.fromObject(A.option)}return A.optionVoteCount!=null&&(r.optionVoteCount=A.optionVoteCount|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.option!=null&&A.hasOwnProperty("option")&&(s.option=p.proto.MsgOpaqueData.PollOption.toObject(A.option,r),r.oneofs&&(s._option="option")),A.optionVoteCount!=null&&A.hasOwnProperty("optionVoteCount")&&(s.optionVoteCount=A.optionVoteCount,r.oneofs&&(s._optionVoteCount="optionVoteCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollVoteSnapshot"},i})(),t.PollVotesSnapshot=(function(){function i(e){if(this.pollVotes=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.pollVotes&&g.pollVotes.length||(g.pollVotes=[]),g.pollVotes.push(p.proto.MsgOpaqueData.PollVoteSnapshot.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.MsgOpaqueData.PollVotesSnapshot)return a;var A=new p.proto.MsgOpaqueData.PollVotesSnapshot;if(a.pollVotes){if(!Array.isArray(a.pollVotes))throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected");A.pollVotes=[];for(var r=0;r>>3){case 1:{s.currentMsg=p.proto.MsgOpaqueData.decode(e,e.uint32());break}case 2:{s.quotedMsg=p.proto.MsgOpaqueData.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MsgRowOpaqueData)return e;var a=new p.proto.MsgRowOpaqueData;if(e.currentMsg!=null){if(typeof e.currentMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected");a.currentMsg=p.proto.MsgOpaqueData.fromObject(e.currentMsg)}if(e.quotedMsg!=null){if(typeof e.quotedMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected");a.quotedMsg=p.proto.MsgOpaqueData.fromObject(e.quotedMsg)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.currentMsg!=null&&e.hasOwnProperty("currentMsg")&&(A.currentMsg=p.proto.MsgOpaqueData.toObject(e.currentMsg,a),a.oneofs&&(A._currentMsg="currentMsg")),e.quotedMsg!=null&&e.hasOwnProperty("quotedMsg")&&(A.quotedMsg=p.proto.MsgOpaqueData.toObject(e.quotedMsg,a),a.oneofs&&(A._quotedMsg="quotedMsg")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MsgRowOpaqueData"},t})(),n.MutationProps=(function(){let t={},o=Object.create(t);return o[t[2]="STAR_ACTION"]=2,o[t[3]="CONTACT_ACTION"]=3,o[t[4]="MUTE_ACTION"]=4,o[t[5]="PIN_ACTION"]=5,o[t[6]="SECURITY_NOTIFICATION_SETTING"]=6,o[t[7]="PUSH_NAME_SETTING"]=7,o[t[8]="QUICK_REPLY_ACTION"]=8,o[t[11]="RECENT_EMOJI_WEIGHTS_ACTION"]=11,o[t[13]="LABEL_MESSAGE_ACTION"]=13,o[t[14]="LABEL_EDIT_ACTION"]=14,o[t[15]="LABEL_ASSOCIATION_ACTION"]=15,o[t[16]="LOCALE_SETTING"]=16,o[t[17]="ARCHIVE_CHAT_ACTION"]=17,o[t[18]="DELETE_MESSAGE_FOR_ME_ACTION"]=18,o[t[19]="KEY_EXPIRATION"]=19,o[t[20]="MARK_CHAT_AS_READ_ACTION"]=20,o[t[21]="CLEAR_CHAT_ACTION"]=21,o[t[22]="DELETE_CHAT_ACTION"]=22,o[t[23]="UNARCHIVE_CHATS_SETTING"]=23,o[t[24]="PRIMARY_FEATURE"]=24,o[t[26]="ANDROID_UNSUPPORTED_ACTIONS"]=26,o[t[27]="AGENT_ACTION"]=27,o[t[28]="SUBSCRIPTION_ACTION"]=28,o[t[29]="USER_STATUS_MUTE_ACTION"]=29,o[t[30]="TIME_FORMAT_ACTION"]=30,o[t[31]="NUX_ACTION"]=31,o[t[32]="PRIMARY_VERSION_ACTION"]=32,o[t[33]="STICKER_ACTION"]=33,o[t[34]="REMOVE_RECENT_STICKER_ACTION"]=34,o[t[35]="CHAT_ASSIGNMENT"]=35,o[t[36]="CHAT_ASSIGNMENT_OPENED_STATUS"]=36,o[t[37]="PN_FOR_LID_CHAT_ACTION"]=37,o[t[38]="MARKETING_MESSAGE_ACTION"]=38,o[t[39]="MARKETING_MESSAGE_BROADCAST_ACTION"]=39,o[t[40]="EXTERNAL_WEB_BETA_ACTION"]=40,o[t[41]="PRIVACY_SETTING_RELAY_ALL_CALLS"]=41,o[t[42]="CALL_LOG_ACTION"]=42,o[t[43]="UGC_BOT"]=43,o[t[44]="STATUS_PRIVACY"]=44,o[t[45]="BOT_WELCOME_REQUEST_ACTION"]=45,o[t[46]="DELETE_INDIVIDUAL_CALL_LOG"]=46,o[t[47]="LABEL_REORDERING_ACTION"]=47,o[t[48]="PAYMENT_INFO_ACTION"]=48,o[t[49]="CUSTOM_PAYMENT_METHODS_ACTION"]=49,o[t[50]="LOCK_CHAT_ACTION"]=50,o[t[51]="CHAT_LOCK_SETTINGS"]=51,o[t[52]="WAMO_USER_IDENTIFIER_ACTION"]=52,o[t[53]="PRIVACY_SETTING_DISABLE_LINK_PREVIEWS_ACTION"]=53,o[t[54]="DEVICE_CAPABILITIES"]=54,o[t[55]="NOTE_EDIT_ACTION"]=55,o[t[56]="FAVORITES_ACTION"]=56,o[t[57]="MERCHANT_PAYMENT_PARTNER_ACTION"]=57,o[t[58]="WAFFLE_ACCOUNT_LINK_STATE_ACTION"]=58,o[t[59]="USERNAME_CHAT_START_MODE"]=59,o[t[60]="NOTIFICATION_ACTIVITY_SETTING_ACTION"]=60,o[t[61]="LID_CONTACT_ACTION"]=61,o[t[62]="CTWA_PER_CUSTOMER_DATA_SHARING_ACTION"]=62,o[t[63]="PAYMENT_TOS_ACTION"]=63,o[t[64]="PRIVACY_SETTING_CHANNELS_PERSONALISED_RECOMMENDATION_ACTION"]=64,o[t[65]="BUSINESS_BROADCAST_ASSOCIATION_ACTION"]=65,o[t[66]="DETECTED_OUTCOMES_STATUS_ACTION"]=66,o[t[68]="MAIBA_AI_FEATURES_CONTROL_ACTION"]=68,o[t[69]="BUSINESS_BROADCAST_LIST_ACTION"]=69,o[t[70]="MUSIC_USER_ID_ACTION"]=70,o[t[71]="STATUS_POST_OPT_IN_NOTIFICATION_PREFERENCES_ACTION"]=71,o[t[72]="AVATAR_UPDATED_ACTION"]=72,o[t[73]="GALAXY_FLOW_ACTION"]=73,o[t[74]="PRIVATE_PROCESSING_SETTING_ACTION"]=74,o[t[75]="NEWSLETTER_SAVED_INTERESTS_ACTION"]=75,o[t[76]="AI_THREAD_RENAME_ACTION"]=76,o[t[77]="INTERACTIVE_MESSAGE_ACTION"]=77,o[t[10001]="SHARE_OWN_PN"]=10001,o[t[10002]="BUSINESS_BROADCAST_ACTION"]=10002,o})(),n.NoiseCertificate=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.NoiseCertificate)return e;var a=new p.proto.NoiseCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NoiseCertificate"},t.Details=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serial=A.uint32();break}case 2:{c.issuer=A.string();break}case 3:{c.expires=A.uint64();break}case 4:{c.subject=A.string();break}case 5:{c.key=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.NoiseCertificate.Details)return A;var r=new p.proto.NoiseCertificate.Details;return A.serial!=null&&(r.serial=A.serial>>>0),A.issuer!=null&&(r.issuer=String(A.issuer)),A.expires!=null&&(l.Long?(r.expires=l.Long.fromValue(A.expires)).unsigned=!0:typeof A.expires=="string"?r.expires=parseInt(A.expires,10):typeof A.expires=="number"?r.expires=A.expires:typeof A.expires=="object"&&(r.expires=new l.LongBits(A.expires.low>>>0,A.expires.high>>>0).toNumber(!0))),A.subject!=null&&(r.subject=String(A.subject)),A.key!=null&&(typeof A.key=="string"?l.base64.decode(A.key,r.key=l.newBuffer(l.base64.length(A.key)),0):A.key.length>=0&&(r.key=A.key)),r},i.toObject=function(A,r){r||(r={});var s={};return A.serial!=null&&A.hasOwnProperty("serial")&&(s.serial=A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.expires!=null&&A.hasOwnProperty("expires")&&(typeof A.expires=="number"?s.expires=r.longs===String?String(A.expires):A.expires:s.expires=r.longs===String?ge(A.expires,!0):r.longs===Number?ce(A.expires,!0):A.expires,r.oneofs&&(s._expires="expires")),A.subject!=null&&A.hasOwnProperty("subject")&&(s.subject=A.subject,r.oneofs&&(s._subject="subject")),A.key!=null&&A.hasOwnProperty("key")&&(s.key=r.bytes===String?l.base64.encode(A.key,0,A.key.length):r.bytes===Array?Array.prototype.slice.call(A.key):A.key,r.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.NoiseCertificate.Details"},i})(),t})(),n.NotificationMessageInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.NotificationMessageInfo)return e;var a=new p.proto.NotificationMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.NotificationMessageInfo.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.NotificationMessageInfo.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return e.messageTimestamp!=null&&(l.Long?(a.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?a.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?a.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(a.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.participant!=null&&(a.participant=String(e.participant)),a},t.toObject=function(e,a){a||(a={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),e.messageTimestamp!=null&&e.hasOwnProperty("messageTimestamp")&&(typeof e.messageTimestamp=="number"?A.messageTimestamp=a.longs===String?String(e.messageTimestamp):e.messageTimestamp:A.messageTimestamp=a.longs===String?ge(e.messageTimestamp,!0):a.longs===Number?ce(e.messageTimestamp,!0):e.messageTimestamp,a.oneofs&&(A._messageTimestamp="messageTimestamp")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationMessageInfo"},t})(),n.NotificationSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageVibrate=e.string();break}case 2:{s.messagePopup=e.string();break}case 3:{s.messageLight=e.string();break}case 4:{s.lowPriorityNotifications=e.bool();break}case 5:{s.reactionsMuted=e.bool();break}case 6:{s.callVibrate=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.NotificationSettings)return e;var a=new p.proto.NotificationSettings;return e.messageVibrate!=null&&(a.messageVibrate=String(e.messageVibrate)),e.messagePopup!=null&&(a.messagePopup=String(e.messagePopup)),e.messageLight!=null&&(a.messageLight=String(e.messageLight)),e.lowPriorityNotifications!=null&&(a.lowPriorityNotifications=!!e.lowPriorityNotifications),e.reactionsMuted!=null&&(a.reactionsMuted=!!e.reactionsMuted),e.callVibrate!=null&&(a.callVibrate=String(e.callVibrate)),a},t.toObject=function(e,a){a||(a={});var A={};return e.messageVibrate!=null&&e.hasOwnProperty("messageVibrate")&&(A.messageVibrate=e.messageVibrate,a.oneofs&&(A._messageVibrate="messageVibrate")),e.messagePopup!=null&&e.hasOwnProperty("messagePopup")&&(A.messagePopup=e.messagePopup,a.oneofs&&(A._messagePopup="messagePopup")),e.messageLight!=null&&e.hasOwnProperty("messageLight")&&(A.messageLight=e.messageLight,a.oneofs&&(A._messageLight="messageLight")),e.lowPriorityNotifications!=null&&e.hasOwnProperty("lowPriorityNotifications")&&(A.lowPriorityNotifications=e.lowPriorityNotifications,a.oneofs&&(A._lowPriorityNotifications="lowPriorityNotifications")),e.reactionsMuted!=null&&e.hasOwnProperty("reactionsMuted")&&(A.reactionsMuted=e.reactionsMuted,a.oneofs&&(A._reactionsMuted="reactionsMuted")),e.callVibrate!=null&&e.hasOwnProperty("callVibrate")&&(A.callVibrate=e.callVibrate,a.oneofs&&(A._callVibrate="callVibrate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationSettings"},t})(),n.PairingRequest=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.companionPublicKey=e.bytes();break}case 2:{s.companionIdentityKey=e.bytes();break}case 3:{s.advSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PairingRequest)return e;var a=new p.proto.PairingRequest;return e.companionPublicKey!=null&&(typeof e.companionPublicKey=="string"?l.base64.decode(e.companionPublicKey,a.companionPublicKey=l.newBuffer(l.base64.length(e.companionPublicKey)),0):e.companionPublicKey.length>=0&&(a.companionPublicKey=e.companionPublicKey)),e.companionIdentityKey!=null&&(typeof e.companionIdentityKey=="string"?l.base64.decode(e.companionIdentityKey,a.companionIdentityKey=l.newBuffer(l.base64.length(e.companionIdentityKey)),0):e.companionIdentityKey.length>=0&&(a.companionIdentityKey=e.companionIdentityKey)),e.advSecret!=null&&(typeof e.advSecret=="string"?l.base64.decode(e.advSecret,a.advSecret=l.newBuffer(l.base64.length(e.advSecret)),0):e.advSecret.length>=0&&(a.advSecret=e.advSecret)),a},t.toObject=function(e,a){a||(a={});var A={};return e.companionPublicKey!=null&&e.hasOwnProperty("companionPublicKey")&&(A.companionPublicKey=a.bytes===String?l.base64.encode(e.companionPublicKey,0,e.companionPublicKey.length):a.bytes===Array?Array.prototype.slice.call(e.companionPublicKey):e.companionPublicKey,a.oneofs&&(A._companionPublicKey="companionPublicKey")),e.companionIdentityKey!=null&&e.hasOwnProperty("companionIdentityKey")&&(A.companionIdentityKey=a.bytes===String?l.base64.encode(e.companionIdentityKey,0,e.companionIdentityKey.length):a.bytes===Array?Array.prototype.slice.call(e.companionIdentityKey):e.companionIdentityKey,a.oneofs&&(A._companionIdentityKey="companionIdentityKey")),e.advSecret!=null&&e.hasOwnProperty("advSecret")&&(A.advSecret=a.bytes===String?l.base64.encode(e.advSecret,0,e.advSecret.length):a.bytes===Array?Array.prototype.slice.call(e.advSecret):e.advSecret,a.oneofs&&(A._advSecret="advSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PairingRequest"},t})(),n.PastParticipant=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.leaveReason=e.int32();break}case 3:{s.leaveTs=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PastParticipant)return e;var a=new p.proto.PastParticipant;switch(e.userJid!=null&&(a.userJid=String(e.userJid)),e.leaveReason){default:if(typeof e.leaveReason=="number"){a.leaveReason=e.leaveReason;break}break;case"LEFT":case 0:a.leaveReason=0;break;case"REMOVED":case 1:a.leaveReason=1;break}return e.leaveTs!=null&&(l.Long?(a.leaveTs=l.Long.fromValue(e.leaveTs)).unsigned=!0:typeof e.leaveTs=="string"?a.leaveTs=parseInt(e.leaveTs,10):typeof e.leaveTs=="number"?a.leaveTs=e.leaveTs:typeof e.leaveTs=="object"&&(a.leaveTs=new l.LongBits(e.leaveTs.low>>>0,e.leaveTs.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid,a.oneofs&&(A._userJid="userJid")),e.leaveReason!=null&&e.hasOwnProperty("leaveReason")&&(A.leaveReason=a.enums===String?p.proto.PastParticipant.LeaveReason[e.leaveReason]===void 0?e.leaveReason:p.proto.PastParticipant.LeaveReason[e.leaveReason]:e.leaveReason,a.oneofs&&(A._leaveReason="leaveReason")),e.leaveTs!=null&&e.hasOwnProperty("leaveTs")&&(typeof e.leaveTs=="number"?A.leaveTs=a.longs===String?String(e.leaveTs):e.leaveTs:A.leaveTs=a.longs===String?ge(e.leaveTs,!0):a.longs===Number?ce(e.leaveTs,!0):e.leaveTs,a.oneofs&&(A._leaveTs="leaveTs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PastParticipant"},t.LeaveReason=(function(){let i={},e=Object.create(i);return e[i[0]="LEFT"]=0,e[i[1]="REMOVED"]=1,e})(),t})(),n.PastParticipants=(function(){function t(i){if(this.pastParticipants=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.groupJid=e.string();break}case 2:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(p.proto.PastParticipant.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PastParticipants)return e;var a=new p.proto.PastParticipants;if(e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.pastParticipants){if(!Array.isArray(e.pastParticipants))throw TypeError(".proto.PastParticipants.pastParticipants: array expected");a.pastParticipants=[];for(var A=0;A>>3){case 1:{s.currentLthash=e.bytes();break}case 2:{s.newLthash=e.bytes();break}case 3:{s.patchVersion=e.bytes();break}case 4:{s.collectionName=e.bytes();break}case 5:{s.firstFourBytesFromAHashOfSnapshotMacKey=e.bytes();break}case 6:{s.newLthashSubtract=e.bytes();break}case 7:{s.numberAdd=e.int32();break}case 8:{s.numberRemove=e.int32();break}case 9:{s.numberOverride=e.int32();break}case 10:{s.senderPlatform=e.int32();break}case 11:{s.isSenderPrimary=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PatchDebugData)return e;var a=new p.proto.PatchDebugData;switch(e.currentLthash!=null&&(typeof e.currentLthash=="string"?l.base64.decode(e.currentLthash,a.currentLthash=l.newBuffer(l.base64.length(e.currentLthash)),0):e.currentLthash.length>=0&&(a.currentLthash=e.currentLthash)),e.newLthash!=null&&(typeof e.newLthash=="string"?l.base64.decode(e.newLthash,a.newLthash=l.newBuffer(l.base64.length(e.newLthash)),0):e.newLthash.length>=0&&(a.newLthash=e.newLthash)),e.patchVersion!=null&&(typeof e.patchVersion=="string"?l.base64.decode(e.patchVersion,a.patchVersion=l.newBuffer(l.base64.length(e.patchVersion)),0):e.patchVersion.length>=0&&(a.patchVersion=e.patchVersion)),e.collectionName!=null&&(typeof e.collectionName=="string"?l.base64.decode(e.collectionName,a.collectionName=l.newBuffer(l.base64.length(e.collectionName)),0):e.collectionName.length>=0&&(a.collectionName=e.collectionName)),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&(typeof e.firstFourBytesFromAHashOfSnapshotMacKey=="string"?l.base64.decode(e.firstFourBytesFromAHashOfSnapshotMacKey,a.firstFourBytesFromAHashOfSnapshotMacKey=l.newBuffer(l.base64.length(e.firstFourBytesFromAHashOfSnapshotMacKey)),0):e.firstFourBytesFromAHashOfSnapshotMacKey.length>=0&&(a.firstFourBytesFromAHashOfSnapshotMacKey=e.firstFourBytesFromAHashOfSnapshotMacKey)),e.newLthashSubtract!=null&&(typeof e.newLthashSubtract=="string"?l.base64.decode(e.newLthashSubtract,a.newLthashSubtract=l.newBuffer(l.base64.length(e.newLthashSubtract)),0):e.newLthashSubtract.length>=0&&(a.newLthashSubtract=e.newLthashSubtract)),e.numberAdd!=null&&(a.numberAdd=e.numberAdd|0),e.numberRemove!=null&&(a.numberRemove=e.numberRemove|0),e.numberOverride!=null&&(a.numberOverride=e.numberOverride|0),e.senderPlatform){default:if(typeof e.senderPlatform=="number"){a.senderPlatform=e.senderPlatform;break}break;case"ANDROID":case 0:a.senderPlatform=0;break;case"SMBA":case 1:a.senderPlatform=1;break;case"IPHONE":case 2:a.senderPlatform=2;break;case"SMBI":case 3:a.senderPlatform=3;break;case"WEB":case 4:a.senderPlatform=4;break;case"UWP":case 5:a.senderPlatform=5;break;case"DARWIN":case 6:a.senderPlatform=6;break;case"IPAD":case 7:a.senderPlatform=7;break;case"WEAROS":case 8:a.senderPlatform=8;break;case"WASG":case 9:a.senderPlatform=9;break;case"WEARM":case 10:a.senderPlatform=10;break;case"CAPI":case 11:a.senderPlatform=11;break}return e.isSenderPrimary!=null&&(a.isSenderPrimary=!!e.isSenderPrimary),a},t.toObject=function(e,a){a||(a={});var A={};return e.currentLthash!=null&&e.hasOwnProperty("currentLthash")&&(A.currentLthash=a.bytes===String?l.base64.encode(e.currentLthash,0,e.currentLthash.length):a.bytes===Array?Array.prototype.slice.call(e.currentLthash):e.currentLthash,a.oneofs&&(A._currentLthash="currentLthash")),e.newLthash!=null&&e.hasOwnProperty("newLthash")&&(A.newLthash=a.bytes===String?l.base64.encode(e.newLthash,0,e.newLthash.length):a.bytes===Array?Array.prototype.slice.call(e.newLthash):e.newLthash,a.oneofs&&(A._newLthash="newLthash")),e.patchVersion!=null&&e.hasOwnProperty("patchVersion")&&(A.patchVersion=a.bytes===String?l.base64.encode(e.patchVersion,0,e.patchVersion.length):a.bytes===Array?Array.prototype.slice.call(e.patchVersion):e.patchVersion,a.oneofs&&(A._patchVersion="patchVersion")),e.collectionName!=null&&e.hasOwnProperty("collectionName")&&(A.collectionName=a.bytes===String?l.base64.encode(e.collectionName,0,e.collectionName.length):a.bytes===Array?Array.prototype.slice.call(e.collectionName):e.collectionName,a.oneofs&&(A._collectionName="collectionName")),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&e.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")&&(A.firstFourBytesFromAHashOfSnapshotMacKey=a.bytes===String?l.base64.encode(e.firstFourBytesFromAHashOfSnapshotMacKey,0,e.firstFourBytesFromAHashOfSnapshotMacKey.length):a.bytes===Array?Array.prototype.slice.call(e.firstFourBytesFromAHashOfSnapshotMacKey):e.firstFourBytesFromAHashOfSnapshotMacKey,a.oneofs&&(A._firstFourBytesFromAHashOfSnapshotMacKey="firstFourBytesFromAHashOfSnapshotMacKey")),e.newLthashSubtract!=null&&e.hasOwnProperty("newLthashSubtract")&&(A.newLthashSubtract=a.bytes===String?l.base64.encode(e.newLthashSubtract,0,e.newLthashSubtract.length):a.bytes===Array?Array.prototype.slice.call(e.newLthashSubtract):e.newLthashSubtract,a.oneofs&&(A._newLthashSubtract="newLthashSubtract")),e.numberAdd!=null&&e.hasOwnProperty("numberAdd")&&(A.numberAdd=e.numberAdd,a.oneofs&&(A._numberAdd="numberAdd")),e.numberRemove!=null&&e.hasOwnProperty("numberRemove")&&(A.numberRemove=e.numberRemove,a.oneofs&&(A._numberRemove="numberRemove")),e.numberOverride!=null&&e.hasOwnProperty("numberOverride")&&(A.numberOverride=e.numberOverride,a.oneofs&&(A._numberOverride="numberOverride")),e.senderPlatform!=null&&e.hasOwnProperty("senderPlatform")&&(A.senderPlatform=a.enums===String?p.proto.PatchDebugData.Platform[e.senderPlatform]===void 0?e.senderPlatform:p.proto.PatchDebugData.Platform[e.senderPlatform]:e.senderPlatform,a.oneofs&&(A._senderPlatform="senderPlatform")),e.isSenderPrimary!=null&&e.hasOwnProperty("isSenderPrimary")&&(A.isSenderPrimary=e.isSenderPrimary,a.oneofs&&(A._isSenderPrimary="isSenderPrimary")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PatchDebugData"},t.Platform=(function(){let i={},e=Object.create(i);return e[i[0]="ANDROID"]=0,e[i[1]="SMBA"]=1,e[i[2]="IPHONE"]=2,e[i[3]="SMBI"]=3,e[i[4]="WEB"]=4,e[i[5]="UWP"]=5,e[i[6]="DARWIN"]=6,e[i[7]="IPAD"]=7,e[i[8]="WEAROS"]=8,e[i[9]="WASG"]=9,e[i[10]="WEARM"]=10,e[i[11]="CAPI"]=11,e})(),t})(),n.PaymentBackground=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.fileLength=e.uint64();break}case 3:{s.width=e.uint32();break}case 4:{s.height=e.uint32();break}case 5:{s.mimetype=e.string();break}case 6:{s.placeholderArgb=e.fixed32();break}case 7:{s.textArgb=e.fixed32();break}case 8:{s.subtextArgb=e.fixed32();break}case 9:{s.mediaData=p.proto.PaymentBackground.MediaData.decode(e,e.uint32());break}case 10:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PaymentBackground)return e;var a=new p.proto.PaymentBackground;if(e.id!=null&&(a.id=String(e.id)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.width!=null&&(a.width=e.width>>>0),e.height!=null&&(a.height=e.height>>>0),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.placeholderArgb!=null&&(a.placeholderArgb=e.placeholderArgb>>>0),e.textArgb!=null&&(a.textArgb=e.textArgb>>>0),e.subtextArgb!=null&&(a.subtextArgb=e.subtextArgb>>>0),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.PaymentBackground.mediaData: object expected");a.mediaData=p.proto.PaymentBackground.MediaData.fromObject(e.mediaData)}switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN":case 0:a.type=0;break;case"DEFAULT":case 1:a.type=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?ge(e.fileLength,!0):a.longs===Number?ce(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,a.oneofs&&(A._width="width")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,a.oneofs&&(A._height="height")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.placeholderArgb!=null&&e.hasOwnProperty("placeholderArgb")&&(A.placeholderArgb=e.placeholderArgb,a.oneofs&&(A._placeholderArgb="placeholderArgb")),e.textArgb!=null&&e.hasOwnProperty("textArgb")&&(A.textArgb=e.textArgb,a.oneofs&&(A._textArgb="textArgb")),e.subtextArgb!=null&&e.hasOwnProperty("subtextArgb")&&(A.subtextArgb=e.subtextArgb,a.oneofs&&(A._subtextArgb="subtextArgb")),e.mediaData!=null&&e.hasOwnProperty("mediaData")&&(A.mediaData=p.proto.PaymentBackground.MediaData.toObject(e.mediaData,a),a.oneofs&&(A._mediaData="mediaData")),e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.PaymentBackground.Type[e.type]===void 0?e.type:p.proto.PaymentBackground.Type[e.type]:e.type,a.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentBackground"},t.MediaData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.mediaKey=A.bytes();break}case 2:{c.mediaKeyTimestamp=A.int64();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.PaymentBackground.MediaData)return A;var r=new p.proto.PaymentBackground.MediaData;return A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),r},i.toObject=function(A,r){r||(r={});var s={};return A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.PaymentBackground.MediaData"},i})(),t.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="DEFAULT"]=1,e})(),t})(),n.PaymentInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.currencyDeprecated=e.int32();break}case 2:{s.amount1000=e.uint64();break}case 3:{s.receiverJid=e.string();break}case 4:{s.status=e.int32();break}case 5:{s.transactionTimestamp=e.uint64();break}case 6:{s.requestMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 7:{s.expiryTimestamp=e.uint64();break}case 8:{s.futureproofed=e.bool();break}case 9:{s.currency=e.string();break}case 10:{s.txnStatus=e.int32();break}case 11:{s.useNoviFiatFormat=e.bool();break}case 12:{s.primaryAmount=p.proto.Money.decode(e,e.uint32());break}case 13:{s.exchangeAmount=p.proto.Money.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PaymentInfo)return e;var a=new p.proto.PaymentInfo;switch(e.currencyDeprecated){default:if(typeof e.currencyDeprecated=="number"){a.currencyDeprecated=e.currencyDeprecated;break}break;case"UNKNOWN_CURRENCY":case 0:a.currencyDeprecated=0;break;case"INR":case 1:a.currencyDeprecated=1;break}switch(e.amount1000!=null&&(l.Long?(a.amount1000=l.Long.fromValue(e.amount1000)).unsigned=!0:typeof e.amount1000=="string"?a.amount1000=parseInt(e.amount1000,10):typeof e.amount1000=="number"?a.amount1000=e.amount1000:typeof e.amount1000=="object"&&(a.amount1000=new l.LongBits(e.amount1000.low>>>0,e.amount1000.high>>>0).toNumber(!0))),e.receiverJid!=null&&(a.receiverJid=String(e.receiverJid)),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"UNKNOWN_STATUS":case 0:a.status=0;break;case"PROCESSING":case 1:a.status=1;break;case"SENT":case 2:a.status=2;break;case"NEED_TO_ACCEPT":case 3:a.status=3;break;case"COMPLETE":case 4:a.status=4;break;case"COULD_NOT_COMPLETE":case 5:a.status=5;break;case"REFUNDED":case 6:a.status=6;break;case"EXPIRED":case 7:a.status=7;break;case"REJECTED":case 8:a.status=8;break;case"CANCELLED":case 9:a.status=9;break;case"WAITING_FOR_PAYER":case 10:a.status=10;break;case"WAITING":case 11:a.status=11;break}if(e.transactionTimestamp!=null&&(l.Long?(a.transactionTimestamp=l.Long.fromValue(e.transactionTimestamp)).unsigned=!0:typeof e.transactionTimestamp=="string"?a.transactionTimestamp=parseInt(e.transactionTimestamp,10):typeof e.transactionTimestamp=="number"?a.transactionTimestamp=e.transactionTimestamp:typeof e.transactionTimestamp=="object"&&(a.transactionTimestamp=new l.LongBits(e.transactionTimestamp.low>>>0,e.transactionTimestamp.high>>>0).toNumber(!0))),e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected");a.requestMessageKey=p.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.expiryTimestamp!=null&&(l.Long?(a.expiryTimestamp=l.Long.fromValue(e.expiryTimestamp)).unsigned=!0:typeof e.expiryTimestamp=="string"?a.expiryTimestamp=parseInt(e.expiryTimestamp,10):typeof e.expiryTimestamp=="number"?a.expiryTimestamp=e.expiryTimestamp:typeof e.expiryTimestamp=="object"&&(a.expiryTimestamp=new l.LongBits(e.expiryTimestamp.low>>>0,e.expiryTimestamp.high>>>0).toNumber(!0))),e.futureproofed!=null&&(a.futureproofed=!!e.futureproofed),e.currency!=null&&(a.currency=String(e.currency)),e.txnStatus){default:if(typeof e.txnStatus=="number"){a.txnStatus=e.txnStatus;break}break;case"UNKNOWN":case 0:a.txnStatus=0;break;case"PENDING_SETUP":case 1:a.txnStatus=1;break;case"PENDING_RECEIVER_SETUP":case 2:a.txnStatus=2;break;case"INIT":case 3:a.txnStatus=3;break;case"SUCCESS":case 4:a.txnStatus=4;break;case"COMPLETED":case 5:a.txnStatus=5;break;case"FAILED":case 6:a.txnStatus=6;break;case"FAILED_RISK":case 7:a.txnStatus=7;break;case"FAILED_PROCESSING":case 8:a.txnStatus=8;break;case"FAILED_RECEIVER_PROCESSING":case 9:a.txnStatus=9;break;case"FAILED_DA":case 10:a.txnStatus=10;break;case"FAILED_DA_FINAL":case 11:a.txnStatus=11;break;case"REFUNDED_TXN":case 12:a.txnStatus=12;break;case"REFUND_FAILED":case 13:a.txnStatus=13;break;case"REFUND_FAILED_PROCESSING":case 14:a.txnStatus=14;break;case"REFUND_FAILED_DA":case 15:a.txnStatus=15;break;case"EXPIRED_TXN":case 16:a.txnStatus=16;break;case"AUTH_CANCELED":case 17:a.txnStatus=17;break;case"AUTH_CANCEL_FAILED_PROCESSING":case 18:a.txnStatus=18;break;case"AUTH_CANCEL_FAILED":case 19:a.txnStatus=19;break;case"COLLECT_INIT":case 20:a.txnStatus=20;break;case"COLLECT_SUCCESS":case 21:a.txnStatus=21;break;case"COLLECT_FAILED":case 22:a.txnStatus=22;break;case"COLLECT_FAILED_RISK":case 23:a.txnStatus=23;break;case"COLLECT_REJECTED":case 24:a.txnStatus=24;break;case"COLLECT_EXPIRED":case 25:a.txnStatus=25;break;case"COLLECT_CANCELED":case 26:a.txnStatus=26;break;case"COLLECT_CANCELLING":case 27:a.txnStatus=27;break;case"IN_REVIEW":case 28:a.txnStatus=28;break;case"REVERSAL_SUCCESS":case 29:a.txnStatus=29;break;case"REVERSAL_PENDING":case 30:a.txnStatus=30;break;case"REFUND_PENDING":case 31:a.txnStatus=31;break}if(e.useNoviFiatFormat!=null&&(a.useNoviFiatFormat=!!e.useNoviFiatFormat),e.primaryAmount!=null){if(typeof e.primaryAmount!="object")throw TypeError(".proto.PaymentInfo.primaryAmount: object expected");a.primaryAmount=p.proto.Money.fromObject(e.primaryAmount)}if(e.exchangeAmount!=null){if(typeof e.exchangeAmount!="object")throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected");a.exchangeAmount=p.proto.Money.fromObject(e.exchangeAmount)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.currencyDeprecated!=null&&e.hasOwnProperty("currencyDeprecated")&&(A.currencyDeprecated=a.enums===String?p.proto.PaymentInfo.Currency[e.currencyDeprecated]===void 0?e.currencyDeprecated:p.proto.PaymentInfo.Currency[e.currencyDeprecated]:e.currencyDeprecated,a.oneofs&&(A._currencyDeprecated="currencyDeprecated")),e.amount1000!=null&&e.hasOwnProperty("amount1000")&&(typeof e.amount1000=="number"?A.amount1000=a.longs===String?String(e.amount1000):e.amount1000:A.amount1000=a.longs===String?ge(e.amount1000,!0):a.longs===Number?ce(e.amount1000,!0):e.amount1000,a.oneofs&&(A._amount1000="amount1000")),e.receiverJid!=null&&e.hasOwnProperty("receiverJid")&&(A.receiverJid=e.receiverJid,a.oneofs&&(A._receiverJid="receiverJid")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=a.enums===String?p.proto.PaymentInfo.Status[e.status]===void 0?e.status:p.proto.PaymentInfo.Status[e.status]:e.status,a.oneofs&&(A._status="status")),e.transactionTimestamp!=null&&e.hasOwnProperty("transactionTimestamp")&&(typeof e.transactionTimestamp=="number"?A.transactionTimestamp=a.longs===String?String(e.transactionTimestamp):e.transactionTimestamp:A.transactionTimestamp=a.longs===String?ge(e.transactionTimestamp,!0):a.longs===Number?ce(e.transactionTimestamp,!0):e.transactionTimestamp,a.oneofs&&(A._transactionTimestamp="transactionTimestamp")),e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=p.proto.MessageKey.toObject(e.requestMessageKey,a),a.oneofs&&(A._requestMessageKey="requestMessageKey")),e.expiryTimestamp!=null&&e.hasOwnProperty("expiryTimestamp")&&(typeof e.expiryTimestamp=="number"?A.expiryTimestamp=a.longs===String?String(e.expiryTimestamp):e.expiryTimestamp:A.expiryTimestamp=a.longs===String?ge(e.expiryTimestamp,!0):a.longs===Number?ce(e.expiryTimestamp,!0):e.expiryTimestamp,a.oneofs&&(A._expiryTimestamp="expiryTimestamp")),e.futureproofed!=null&&e.hasOwnProperty("futureproofed")&&(A.futureproofed=e.futureproofed,a.oneofs&&(A._futureproofed="futureproofed")),e.currency!=null&&e.hasOwnProperty("currency")&&(A.currency=e.currency,a.oneofs&&(A._currency="currency")),e.txnStatus!=null&&e.hasOwnProperty("txnStatus")&&(A.txnStatus=a.enums===String?p.proto.PaymentInfo.TxnStatus[e.txnStatus]===void 0?e.txnStatus:p.proto.PaymentInfo.TxnStatus[e.txnStatus]:e.txnStatus,a.oneofs&&(A._txnStatus="txnStatus")),e.useNoviFiatFormat!=null&&e.hasOwnProperty("useNoviFiatFormat")&&(A.useNoviFiatFormat=e.useNoviFiatFormat,a.oneofs&&(A._useNoviFiatFormat="useNoviFiatFormat")),e.primaryAmount!=null&&e.hasOwnProperty("primaryAmount")&&(A.primaryAmount=p.proto.Money.toObject(e.primaryAmount,a),a.oneofs&&(A._primaryAmount="primaryAmount")),e.exchangeAmount!=null&&e.hasOwnProperty("exchangeAmount")&&(A.exchangeAmount=p.proto.Money.toObject(e.exchangeAmount,a),a.oneofs&&(A._exchangeAmount="exchangeAmount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentInfo"},t.Currency=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_CURRENCY"]=0,e[i[1]="INR"]=1,e})(),t.Status=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_STATUS"]=0,e[i[1]="PROCESSING"]=1,e[i[2]="SENT"]=2,e[i[3]="NEED_TO_ACCEPT"]=3,e[i[4]="COMPLETE"]=4,e[i[5]="COULD_NOT_COMPLETE"]=5,e[i[6]="REFUNDED"]=6,e[i[7]="EXPIRED"]=7,e[i[8]="REJECTED"]=8,e[i[9]="CANCELLED"]=9,e[i[10]="WAITING_FOR_PAYER"]=10,e[i[11]="WAITING"]=11,e})(),t.TxnStatus=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="PENDING_SETUP"]=1,e[i[2]="PENDING_RECEIVER_SETUP"]=2,e[i[3]="INIT"]=3,e[i[4]="SUCCESS"]=4,e[i[5]="COMPLETED"]=5,e[i[6]="FAILED"]=6,e[i[7]="FAILED_RISK"]=7,e[i[8]="FAILED_PROCESSING"]=8,e[i[9]="FAILED_RECEIVER_PROCESSING"]=9,e[i[10]="FAILED_DA"]=10,e[i[11]="FAILED_DA_FINAL"]=11,e[i[12]="REFUNDED_TXN"]=12,e[i[13]="REFUND_FAILED"]=13,e[i[14]="REFUND_FAILED_PROCESSING"]=14,e[i[15]="REFUND_FAILED_DA"]=15,e[i[16]="EXPIRED_TXN"]=16,e[i[17]="AUTH_CANCELED"]=17,e[i[18]="AUTH_CANCEL_FAILED_PROCESSING"]=18,e[i[19]="AUTH_CANCEL_FAILED"]=19,e[i[20]="COLLECT_INIT"]=20,e[i[21]="COLLECT_SUCCESS"]=21,e[i[22]="COLLECT_FAILED"]=22,e[i[23]="COLLECT_FAILED_RISK"]=23,e[i[24]="COLLECT_REJECTED"]=24,e[i[25]="COLLECT_EXPIRED"]=25,e[i[26]="COLLECT_CANCELED"]=26,e[i[27]="COLLECT_CANCELLING"]=27,e[i[28]="IN_REVIEW"]=28,e[i[29]="REVERSAL_SUCCESS"]=29,e[i[30]="REVERSAL_PENDING"]=30,e[i[31]="REFUND_PENDING"]=31,e})(),t})(),n.PhoneNumberToLIDMapping=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pnJid=e.string();break}case 2:{s.lidJid=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PhoneNumberToLIDMapping)return e;var a=new p.proto.PhoneNumberToLIDMapping;return e.pnJid!=null&&(a.pnJid=String(e.pnJid)),e.lidJid!=null&&(a.lidJid=String(e.lidJid)),a},t.toObject=function(e,a){a||(a={});var A={};return e.pnJid!=null&&e.hasOwnProperty("pnJid")&&(A.pnJid=e.pnJid,a.oneofs&&(A._pnJid="pnJid")),e.lidJid!=null&&e.hasOwnProperty("lidJid")&&(A.lidJid=e.lidJid,a.oneofs&&(A._lidJid="lidJid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhoneNumberToLIDMapping"},t})(),n.PhotoChange=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.oldPhoto=e.bytes();break}case 2:{s.newPhoto=e.bytes();break}case 3:{s.newPhotoId=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PhotoChange)return e;var a=new p.proto.PhotoChange;return e.oldPhoto!=null&&(typeof e.oldPhoto=="string"?l.base64.decode(e.oldPhoto,a.oldPhoto=l.newBuffer(l.base64.length(e.oldPhoto)),0):e.oldPhoto.length>=0&&(a.oldPhoto=e.oldPhoto)),e.newPhoto!=null&&(typeof e.newPhoto=="string"?l.base64.decode(e.newPhoto,a.newPhoto=l.newBuffer(l.base64.length(e.newPhoto)),0):e.newPhoto.length>=0&&(a.newPhoto=e.newPhoto)),e.newPhotoId!=null&&(a.newPhotoId=e.newPhotoId>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.oldPhoto!=null&&e.hasOwnProperty("oldPhoto")&&(A.oldPhoto=a.bytes===String?l.base64.encode(e.oldPhoto,0,e.oldPhoto.length):a.bytes===Array?Array.prototype.slice.call(e.oldPhoto):e.oldPhoto,a.oneofs&&(A._oldPhoto="oldPhoto")),e.newPhoto!=null&&e.hasOwnProperty("newPhoto")&&(A.newPhoto=a.bytes===String?l.base64.encode(e.newPhoto,0,e.newPhoto.length):a.bytes===Array?Array.prototype.slice.call(e.newPhoto):e.newPhoto,a.oneofs&&(A._newPhoto="newPhoto")),e.newPhotoId!=null&&e.hasOwnProperty("newPhotoId")&&(A.newPhotoId=e.newPhotoId,a.oneofs&&(A._newPhotoId="newPhotoId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhotoChange"},t})(),n.PinInChat=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PinInChat)return e;var a=new p.proto.PinInChat;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN_TYPE":case 0:a.type=0;break;case"PIN_FOR_ALL":case 1:a.type=1;break;case"UNPIN_FOR_ALL":case 2:a.type=2;break}if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.PinInChat.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.messageAddOnContextInfo!=null){if(typeof e.messageAddOnContextInfo!="object")throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected");a.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.fromObject(e.messageAddOnContextInfo)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.PinInChat.Type[e.type]===void 0?e.type:p.proto.PinInChat.Type[e.type]:e.type,a.oneofs&&(A._type="type")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.messageAddOnContextInfo!=null&&e.hasOwnProperty("messageAddOnContextInfo")&&(A.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.toObject(e.messageAddOnContextInfo,a),a.oneofs&&(A._messageAddOnContextInfo="messageAddOnContextInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PinInChat"},t.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="PIN_FOR_ALL"]=1,e[i[2]="UNPIN_FOR_ALL"]=2,e})(),t})(),n.Point=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.xDeprecated=e.int32();break}case 2:{s.yDeprecated=e.int32();break}case 3:{s.x=e.double();break}case 4:{s.y=e.double();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Point)return e;var a=new p.proto.Point;return e.xDeprecated!=null&&(a.xDeprecated=e.xDeprecated|0),e.yDeprecated!=null&&(a.yDeprecated=e.yDeprecated|0),e.x!=null&&(a.x=Number(e.x)),e.y!=null&&(a.y=Number(e.y)),a},t.toObject=function(e,a){a||(a={});var A={};return e.xDeprecated!=null&&e.hasOwnProperty("xDeprecated")&&(A.xDeprecated=e.xDeprecated,a.oneofs&&(A._xDeprecated="xDeprecated")),e.yDeprecated!=null&&e.hasOwnProperty("yDeprecated")&&(A.yDeprecated=e.yDeprecated,a.oneofs&&(A._yDeprecated="yDeprecated")),e.x!=null&&e.hasOwnProperty("x")&&(A.x=a.json&&!isFinite(e.x)?String(e.x):e.x,a.oneofs&&(A._x="x")),e.y!=null&&e.hasOwnProperty("y")&&(A.y=a.json&&!isFinite(e.y)?String(e.y):e.y,a.oneofs&&(A._y="y")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Point"},t})(),n.PollAdditionalMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pollInvalidated=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PollAdditionalMetadata)return e;var a=new p.proto.PollAdditionalMetadata;return e.pollInvalidated!=null&&(a.pollInvalidated=!!e.pollInvalidated),a},t.toObject=function(e,a){a||(a={});var A={};return e.pollInvalidated!=null&&e.hasOwnProperty("pollInvalidated")&&(A.pollInvalidated=e.pollInvalidated,a.oneofs&&(A._pollInvalidated="pollInvalidated")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollAdditionalMetadata"},t})(),n.PollEncValue=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encPayload=e.bytes();break}case 2:{s.encIv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PollEncValue)return e;var a=new p.proto.PollEncValue;return e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),a},t.toObject=function(e,a){a||(a={});var A={};return e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=a.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,a.oneofs&&(A._encPayload="encPayload")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=a.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):a.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,a.oneofs&&(A._encIv="encIv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollEncValue"},t})(),n.PollUpdate=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pollUpdateMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.vote=p.proto.Message.PollVoteMessage.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PollUpdate)return e;var a=new p.proto.PollUpdate;if(e.pollUpdateMessageKey!=null){if(typeof e.pollUpdateMessageKey!="object")throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected");a.pollUpdateMessageKey=p.proto.MessageKey.fromObject(e.pollUpdateMessageKey)}if(e.vote!=null){if(typeof e.vote!="object")throw TypeError(".proto.PollUpdate.vote: object expected");a.vote=p.proto.Message.PollVoteMessage.fromObject(e.vote)}return e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.unread!=null&&(a.unread=!!e.unread),a},t.toObject=function(e,a){a||(a={});var A={};return e.pollUpdateMessageKey!=null&&e.hasOwnProperty("pollUpdateMessageKey")&&(A.pollUpdateMessageKey=p.proto.MessageKey.toObject(e.pollUpdateMessageKey,a),a.oneofs&&(A._pollUpdateMessageKey="pollUpdateMessageKey")),e.vote!=null&&e.hasOwnProperty("vote")&&(A.vote=p.proto.Message.PollVoteMessage.toObject(e.vote,a),a.oneofs&&(A._vote="vote")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollUpdate"},t})(),n.PreKeyRecordStructure=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PreKeyRecordStructure)return e;var a=new p.proto.PreKeyRecordStructure;return e.id!=null&&(a.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeyRecordStructure"},t})(),n.PreKeySignalMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 5:{s.registrationId=e.uint32();break}case 1:{s.preKeyId=e.uint32();break}case 6:{s.signedPreKeyId=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.identityKey=e.bytes();break}case 4:{s.message=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PreKeySignalMessage)return e;var a=new p.proto.PreKeySignalMessage;return e.registrationId!=null&&(a.registrationId=e.registrationId>>>0),e.preKeyId!=null&&(a.preKeyId=e.preKeyId>>>0),e.signedPreKeyId!=null&&(a.signedPreKeyId=e.signedPreKeyId>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,a.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(a.baseKey=e.baseKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,a.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(a.identityKey=e.identityKey)),e.message!=null&&(typeof e.message=="string"?l.base64.decode(e.message,a.message=l.newBuffer(l.base64.length(e.message)),0):e.message.length>=0&&(a.message=e.message)),a},t.toObject=function(e,a){a||(a={});var A={};return e.preKeyId!=null&&e.hasOwnProperty("preKeyId")&&(A.preKeyId=e.preKeyId,a.oneofs&&(A._preKeyId="preKeyId")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=a.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):a.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,a.oneofs&&(A._baseKey="baseKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=a.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):a.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,a.oneofs&&(A._identityKey="identityKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=a.bytes===String?l.base64.encode(e.message,0,e.message.length):a.bytes===Array?Array.prototype.slice.call(e.message):e.message,a.oneofs&&(A._message="message")),e.registrationId!=null&&e.hasOwnProperty("registrationId")&&(A.registrationId=e.registrationId,a.oneofs&&(A._registrationId="registrationId")),e.signedPreKeyId!=null&&e.hasOwnProperty("signedPreKeyId")&&(A.signedPreKeyId=e.signedPreKeyId,a.oneofs&&(A._signedPreKeyId="signedPreKeyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeySignalMessage"},t})(),n.PremiumMessageInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.serverCampaignId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PremiumMessageInfo)return e;var a=new p.proto.PremiumMessageInfo;return e.serverCampaignId!=null&&(a.serverCampaignId=String(e.serverCampaignId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.serverCampaignId!=null&&e.hasOwnProperty("serverCampaignId")&&(A.serverCampaignId=e.serverCampaignId,a.oneofs&&(A._serverCampaignId="serverCampaignId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PremiumMessageInfo"},t})(),n.PrimaryEphemeralIdentity=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.nonce=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PrimaryEphemeralIdentity)return e;var a=new p.proto.PrimaryEphemeralIdentity;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.nonce!=null&&(typeof e.nonce=="string"?l.base64.decode(e.nonce,a.nonce=l.newBuffer(l.base64.length(e.nonce)),0):e.nonce.length>=0&&(a.nonce=e.nonce)),a},t.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.nonce!=null&&e.hasOwnProperty("nonce")&&(A.nonce=a.bytes===String?l.base64.encode(e.nonce,0,e.nonce.length):a.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce,a.oneofs&&(A._nonce="nonce")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PrimaryEphemeralIdentity"},t})(),n.PrivacySystemMessage=(function(){let t={},o=Object.create(t);return o[t[1]="E2EE_MSG"]=1,o[t[2]="NE2EE_SELF"]=2,o[t[3]="NE2EE_OTHER"]=3,o})(),n.ProcessedVideo=(function(){function t(i){if(this.capabilities=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.directPath=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.height=e.uint32();break}case 4:{s.width=e.uint32();break}case 5:{s.fileLength=e.uint64();break}case 6:{s.bitrate=e.uint32();break}case 7:{s.quality=e.int32();break}case 8:{s.capabilities&&s.capabilities.length||(s.capabilities=[]),s.capabilities.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ProcessedVideo)return e;var a=new p.proto.ProcessedVideo;switch(e.directPath!=null&&(a.directPath=String(e.directPath)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.height!=null&&(a.height=e.height>>>0),e.width!=null&&(a.width=e.width>>>0),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.bitrate!=null&&(a.bitrate=e.bitrate>>>0),e.quality){default:if(typeof e.quality=="number"){a.quality=e.quality;break}break;case"UNDEFINED":case 0:a.quality=0;break;case"LOW":case 1:a.quality=1;break;case"MID":case 2:a.quality=2;break;case"HIGH":case 3:a.quality=3;break}if(e.capabilities){if(!Array.isArray(e.capabilities))throw TypeError(".proto.ProcessedVideo.capabilities: array expected");a.capabilities=[];for(var A=0;A>>3){case 1:{s.companionEphemeralIdentity=e.bytes();break}case 2:{s.commitment=p.proto.CompanionCommitment.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ProloguePayload)return e;var a=new p.proto.ProloguePayload;if(e.companionEphemeralIdentity!=null&&(typeof e.companionEphemeralIdentity=="string"?l.base64.decode(e.companionEphemeralIdentity,a.companionEphemeralIdentity=l.newBuffer(l.base64.length(e.companionEphemeralIdentity)),0):e.companionEphemeralIdentity.length>=0&&(a.companionEphemeralIdentity=e.companionEphemeralIdentity)),e.commitment!=null){if(typeof e.commitment!="object")throw TypeError(".proto.ProloguePayload.commitment: object expected");a.commitment=p.proto.CompanionCommitment.fromObject(e.commitment)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.companionEphemeralIdentity!=null&&e.hasOwnProperty("companionEphemeralIdentity")&&(A.companionEphemeralIdentity=a.bytes===String?l.base64.encode(e.companionEphemeralIdentity,0,e.companionEphemeralIdentity.length):a.bytes===Array?Array.prototype.slice.call(e.companionEphemeralIdentity):e.companionEphemeralIdentity,a.oneofs&&(A._companionEphemeralIdentity="companionEphemeralIdentity")),e.commitment!=null&&e.hasOwnProperty("commitment")&&(A.commitment=p.proto.CompanionCommitment.toObject(e.commitment,a),a.oneofs&&(A._commitment="commitment")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ProloguePayload"},t})(),n.Pushname=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.pushname=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Pushname)return e;var a=new p.proto.Pushname;return e.id!=null&&(a.id=String(e.id)),e.pushname!=null&&(a.pushname=String(e.pushname)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.pushname!=null&&e.hasOwnProperty("pushname")&&(A.pushname=e.pushname,a.oneofs&&(A._pushname="pushname")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Pushname"},t})(),n.QuarantinedMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.originalData=e.bytes();break}case 2:{s.extractedText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.QuarantinedMessage)return e;var a=new p.proto.QuarantinedMessage;return e.originalData!=null&&(typeof e.originalData=="string"?l.base64.decode(e.originalData,a.originalData=l.newBuffer(l.base64.length(e.originalData)),0):e.originalData.length>=0&&(a.originalData=e.originalData)),e.extractedText!=null&&(a.extractedText=String(e.extractedText)),a},t.toObject=function(e,a){a||(a={});var A={};return e.originalData!=null&&e.hasOwnProperty("originalData")&&(A.originalData=a.bytes===String?l.base64.encode(e.originalData,0,e.originalData.length):a.bytes===Array?Array.prototype.slice.call(e.originalData):e.originalData,a.oneofs&&(A._originalData="originalData")),e.extractedText!=null&&e.hasOwnProperty("extractedText")&&(A.extractedText=e.extractedText,a.oneofs&&(A._extractedText="extractedText")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.QuarantinedMessage"},t})(),n.Reaction=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.text=e.string();break}case 3:{s.groupingKey=e.string();break}case 4:{s.senderTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Reaction)return e;var a=new p.proto.Reaction;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.Reaction.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}return e.text!=null&&(a.text=String(e.text)),e.groupingKey!=null&&(a.groupingKey=String(e.groupingKey)),e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.unread!=null&&(a.unread=!!e.unread),a},t.toObject=function(e,a){a||(a={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),e.groupingKey!=null&&e.hasOwnProperty("groupingKey")&&(A.groupingKey=e.groupingKey,a.oneofs&&(A._groupingKey="groupingKey")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reaction"},t})(),n.RecentEmojiWeight=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.emoji=e.string();break}case 2:{s.weight=e.float();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.RecentEmojiWeight)return e;var a=new p.proto.RecentEmojiWeight;return e.emoji!=null&&(a.emoji=String(e.emoji)),e.weight!=null&&(a.weight=Number(e.weight)),a},t.toObject=function(e,a){a||(a={});var A={};return e.emoji!=null&&e.hasOwnProperty("emoji")&&(A.emoji=e.emoji,a.oneofs&&(A._emoji="emoji")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=a.json&&!isFinite(e.weight)?String(e.weight):e.weight,a.oneofs&&(A._weight="weight")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.RecentEmojiWeight"},t})(),n.RecordStructure=(function(){function t(i){if(this.previousSessions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.currentSession=p.proto.SessionStructure.decode(e,e.uint32());break}case 2:{s.previousSessions&&s.previousSessions.length||(s.previousSessions=[]),s.previousSessions.push(p.proto.SessionStructure.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.RecordStructure)return e;var a=new p.proto.RecordStructure;if(e.currentSession!=null){if(typeof e.currentSession!="object")throw TypeError(".proto.RecordStructure.currentSession: object expected");a.currentSession=p.proto.SessionStructure.fromObject(e.currentSession)}if(e.previousSessions){if(!Array.isArray(e.previousSessions))throw TypeError(".proto.RecordStructure.previousSessions: array expected");a.previousSessions=[];for(var A=0;A>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.never=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Reportable)return e;var a=new p.proto.Reportable;return e.minVersion!=null&&(a.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(a.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(a.notReportableMinVersion=e.notReportableMinVersion>>>0),e.never!=null&&(a.never=!!e.never),a},t.toObject=function(e,a){a||(a={});var A={};return e.minVersion!=null&&e.hasOwnProperty("minVersion")&&(A.minVersion=e.minVersion,a.oneofs&&(A._minVersion="minVersion")),e.maxVersion!=null&&e.hasOwnProperty("maxVersion")&&(A.maxVersion=e.maxVersion,a.oneofs&&(A._maxVersion="maxVersion")),e.notReportableMinVersion!=null&&e.hasOwnProperty("notReportableMinVersion")&&(A.notReportableMinVersion=e.notReportableMinVersion,a.oneofs&&(A._notReportableMinVersion="notReportableMinVersion")),e.never!=null&&e.hasOwnProperty("never")&&(A.never=e.never,a.oneofs&&(A._never="never")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reportable"},t})(),n.ReportingTokenInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.reportingTag=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ReportingTokenInfo)return e;var a=new p.proto.ReportingTokenInfo;return e.reportingTag!=null&&(typeof e.reportingTag=="string"?l.base64.decode(e.reportingTag,a.reportingTag=l.newBuffer(l.base64.length(e.reportingTag)),0):e.reportingTag.length>=0&&(a.reportingTag=e.reportingTag)),a},t.toObject=function(e,a){a||(a={});var A={};return e.reportingTag!=null&&e.hasOwnProperty("reportingTag")&&(A.reportingTag=a.bytes===String?l.base64.encode(e.reportingTag,0,e.reportingTag.length):a.bytes===Array?Array.prototype.slice.call(e.reportingTag):e.reportingTag,a.oneofs&&(A._reportingTag="reportingTag")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ReportingTokenInfo"},t})(),n.SenderKeyDistributionMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.chainKey=e.bytes();break}case 4:{s.signingKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SenderKeyDistributionMessage)return e;var a=new p.proto.SenderKeyDistributionMessage;return e.id!=null&&(a.id=e.id>>>0),e.iteration!=null&&(a.iteration=e.iteration>>>0),e.chainKey!=null&&(typeof e.chainKey=="string"?l.base64.decode(e.chainKey,a.chainKey=l.newBuffer(l.base64.length(e.chainKey)),0):e.chainKey.length>=0&&(a.chainKey=e.chainKey)),e.signingKey!=null&&(typeof e.signingKey=="string"?l.base64.decode(e.signingKey,a.signingKey=l.newBuffer(l.base64.length(e.signingKey)),0):e.signingKey.length>=0&&(a.signingKey=e.signingKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,a.oneofs&&(A._iteration="iteration")),e.chainKey!=null&&e.hasOwnProperty("chainKey")&&(A.chainKey=a.bytes===String?l.base64.encode(e.chainKey,0,e.chainKey.length):a.bytes===Array?Array.prototype.slice.call(e.chainKey):e.chainKey,a.oneofs&&(A._chainKey="chainKey")),e.signingKey!=null&&e.hasOwnProperty("signingKey")&&(A.signingKey=a.bytes===String?l.base64.encode(e.signingKey,0,e.signingKey.length):a.bytes===Array?Array.prototype.slice.call(e.signingKey):e.signingKey,a.oneofs&&(A._signingKey="signingKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyDistributionMessage"},t})(),n.SenderKeyMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SenderKeyMessage)return e;var a=new p.proto.SenderKeyMessage;return e.id!=null&&(a.id=e.id>>>0),e.iteration!=null&&(a.iteration=e.iteration>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,a.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(a.ciphertext=e.ciphertext)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,a.oneofs&&(A._iteration="iteration")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=a.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):a.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,a.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyMessage"},t})(),n.SenderKeyRecordStructure=(function(){function t(o){if(this.senderKeyStates=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.senderKeyStates&&r.senderKeyStates.length||(r.senderKeyStates=[]),r.senderKeyStates.push(p.proto.SenderKeyStateStructure.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.SenderKeyRecordStructure)return i;var e=new p.proto.SenderKeyRecordStructure;if(i.senderKeyStates){if(!Array.isArray(i.senderKeyStates))throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected");e.senderKeyStates=[];for(var a=0;a>>3){case 1:{s.senderKeyId=e.uint32();break}case 2:{s.senderChainKey=p.proto.SenderKeyStateStructure.SenderChainKey.decode(e,e.uint32());break}case 3:{s.senderSigningKey=p.proto.SenderKeyStateStructure.SenderSigningKey.decode(e,e.uint32());break}case 4:{s.senderMessageKeys&&s.senderMessageKeys.length||(s.senderMessageKeys=[]),s.senderMessageKeys.push(p.proto.SenderKeyStateStructure.SenderMessageKey.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SenderKeyStateStructure)return e;var a=new p.proto.SenderKeyStateStructure;if(e.senderKeyId!=null&&(a.senderKeyId=e.senderKeyId>>>0),e.senderChainKey!=null){if(typeof e.senderChainKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected");a.senderChainKey=p.proto.SenderKeyStateStructure.SenderChainKey.fromObject(e.senderChainKey)}if(e.senderSigningKey!=null){if(typeof e.senderSigningKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected");a.senderSigningKey=p.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(e.senderSigningKey)}if(e.senderMessageKeys){if(!Array.isArray(e.senderMessageKeys))throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected");a.senderMessageKeys=[];for(var A=0;A>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderChainKey)return A;var r=new p.proto.SenderKeyStateStructure.SenderChainKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},i.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderChainKey"},i})(),t.SenderMessageKey=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderMessageKey)return A;var r=new p.proto.SenderKeyStateStructure.SenderMessageKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},i.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderMessageKey"},i})(),t.SenderSigningKey=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.public=A.bytes();break}case 2:{c.private=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderSigningKey)return A;var r=new p.proto.SenderKeyStateStructure.SenderSigningKey;return A.public!=null&&(typeof A.public=="string"?l.base64.decode(A.public,r.public=l.newBuffer(l.base64.length(A.public)),0):A.public.length>=0&&(r.public=A.public)),A.private!=null&&(typeof A.private=="string"?l.base64.decode(A.private,r.private=l.newBuffer(l.base64.length(A.private)),0):A.private.length>=0&&(r.private=A.private)),r},i.toObject=function(A,r){r||(r={});var s={};return A.public!=null&&A.hasOwnProperty("public")&&(s.public=r.bytes===String?l.base64.encode(A.public,0,A.public.length):r.bytes===Array?Array.prototype.slice.call(A.public):A.public,r.oneofs&&(s._public="public")),A.private!=null&&A.hasOwnProperty("private")&&(s.private=r.bytes===String?l.base64.encode(A.private,0,A.private.length):r.bytes===Array?Array.prototype.slice.call(A.private):A.private,r.oneofs&&(s._private="private")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderSigningKey"},i})(),t})(),n.ServerErrorReceipt=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ServerErrorReceipt)return e;var a=new p.proto.ServerErrorReceipt;return e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ServerErrorReceipt"},t})(),n.SessionStructure=(function(){function t(i){if(this.receiverChains=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sessionVersion=e.uint32();break}case 2:{s.localIdentityPublic=e.bytes();break}case 3:{s.remoteIdentityPublic=e.bytes();break}case 4:{s.rootKey=e.bytes();break}case 5:{s.previousCounter=e.uint32();break}case 6:{s.senderChain=p.proto.SessionStructure.Chain.decode(e,e.uint32());break}case 7:{s.receiverChains&&s.receiverChains.length||(s.receiverChains=[]),s.receiverChains.push(p.proto.SessionStructure.Chain.decode(e,e.uint32()));break}case 8:{s.pendingKeyExchange=p.proto.SessionStructure.PendingKeyExchange.decode(e,e.uint32());break}case 9:{s.pendingPreKey=p.proto.SessionStructure.PendingPreKey.decode(e,e.uint32());break}case 10:{s.remoteRegistrationId=e.uint32();break}case 11:{s.localRegistrationId=e.uint32();break}case 12:{s.needsRefresh=e.bool();break}case 13:{s.aliceBaseKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SessionStructure)return e;var a=new p.proto.SessionStructure;if(e.sessionVersion!=null&&(a.sessionVersion=e.sessionVersion>>>0),e.localIdentityPublic!=null&&(typeof e.localIdentityPublic=="string"?l.base64.decode(e.localIdentityPublic,a.localIdentityPublic=l.newBuffer(l.base64.length(e.localIdentityPublic)),0):e.localIdentityPublic.length>=0&&(a.localIdentityPublic=e.localIdentityPublic)),e.remoteIdentityPublic!=null&&(typeof e.remoteIdentityPublic=="string"?l.base64.decode(e.remoteIdentityPublic,a.remoteIdentityPublic=l.newBuffer(l.base64.length(e.remoteIdentityPublic)),0):e.remoteIdentityPublic.length>=0&&(a.remoteIdentityPublic=e.remoteIdentityPublic)),e.rootKey!=null&&(typeof e.rootKey=="string"?l.base64.decode(e.rootKey,a.rootKey=l.newBuffer(l.base64.length(e.rootKey)),0):e.rootKey.length>=0&&(a.rootKey=e.rootKey)),e.previousCounter!=null&&(a.previousCounter=e.previousCounter>>>0),e.senderChain!=null){if(typeof e.senderChain!="object")throw TypeError(".proto.SessionStructure.senderChain: object expected");a.senderChain=p.proto.SessionStructure.Chain.fromObject(e.senderChain)}if(e.receiverChains){if(!Array.isArray(e.receiverChains))throw TypeError(".proto.SessionStructure.receiverChains: array expected");a.receiverChains=[];for(var A=0;A>>0),e.localRegistrationId!=null&&(a.localRegistrationId=e.localRegistrationId>>>0),e.needsRefresh!=null&&(a.needsRefresh=!!e.needsRefresh),e.aliceBaseKey!=null&&(typeof e.aliceBaseKey=="string"?l.base64.decode(e.aliceBaseKey,a.aliceBaseKey=l.newBuffer(l.base64.length(e.aliceBaseKey)),0):e.aliceBaseKey.length>=0&&(a.aliceBaseKey=e.aliceBaseKey)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.receiverChains=[]),e.sessionVersion!=null&&e.hasOwnProperty("sessionVersion")&&(A.sessionVersion=e.sessionVersion,a.oneofs&&(A._sessionVersion="sessionVersion")),e.localIdentityPublic!=null&&e.hasOwnProperty("localIdentityPublic")&&(A.localIdentityPublic=a.bytes===String?l.base64.encode(e.localIdentityPublic,0,e.localIdentityPublic.length):a.bytes===Array?Array.prototype.slice.call(e.localIdentityPublic):e.localIdentityPublic,a.oneofs&&(A._localIdentityPublic="localIdentityPublic")),e.remoteIdentityPublic!=null&&e.hasOwnProperty("remoteIdentityPublic")&&(A.remoteIdentityPublic=a.bytes===String?l.base64.encode(e.remoteIdentityPublic,0,e.remoteIdentityPublic.length):a.bytes===Array?Array.prototype.slice.call(e.remoteIdentityPublic):e.remoteIdentityPublic,a.oneofs&&(A._remoteIdentityPublic="remoteIdentityPublic")),e.rootKey!=null&&e.hasOwnProperty("rootKey")&&(A.rootKey=a.bytes===String?l.base64.encode(e.rootKey,0,e.rootKey.length):a.bytes===Array?Array.prototype.slice.call(e.rootKey):e.rootKey,a.oneofs&&(A._rootKey="rootKey")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,a.oneofs&&(A._previousCounter="previousCounter")),e.senderChain!=null&&e.hasOwnProperty("senderChain")&&(A.senderChain=p.proto.SessionStructure.Chain.toObject(e.senderChain,a),a.oneofs&&(A._senderChain="senderChain")),e.receiverChains&&e.receiverChains.length){A.receiverChains=[];for(var r=0;r>>3){case 1:{c.senderRatchetKey=A.bytes();break}case 2:{c.senderRatchetKeyPrivate=A.bytes();break}case 3:{c.chainKey=p.proto.SessionStructure.Chain.ChainKey.decode(A,A.uint32());break}case 4:{c.messageKeys&&c.messageKeys.length||(c.messageKeys=[]),c.messageKeys.push(p.proto.SessionStructure.Chain.MessageKey.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.Chain)return A;var r=new p.proto.SessionStructure.Chain;if(A.senderRatchetKey!=null&&(typeof A.senderRatchetKey=="string"?l.base64.decode(A.senderRatchetKey,r.senderRatchetKey=l.newBuffer(l.base64.length(A.senderRatchetKey)),0):A.senderRatchetKey.length>=0&&(r.senderRatchetKey=A.senderRatchetKey)),A.senderRatchetKeyPrivate!=null&&(typeof A.senderRatchetKeyPrivate=="string"?l.base64.decode(A.senderRatchetKeyPrivate,r.senderRatchetKeyPrivate=l.newBuffer(l.base64.length(A.senderRatchetKeyPrivate)),0):A.senderRatchetKeyPrivate.length>=0&&(r.senderRatchetKeyPrivate=A.senderRatchetKeyPrivate)),A.chainKey!=null){if(typeof A.chainKey!="object")throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");r.chainKey=p.proto.SessionStructure.Chain.ChainKey.fromObject(A.chainKey)}if(A.messageKeys){if(!Array.isArray(A.messageKeys))throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");r.messageKeys=[];for(var s=0;s>>3){case 1:{d.index=s.uint32();break}case 2:{d.key=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.SessionStructure.Chain.ChainKey)return s;var g=new p.proto.SessionStructure.Chain.ChainKey;return s.index!=null&&(g.index=s.index>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),g},a.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.ChainKey"},a})(),i.MessageKey=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.index=s.uint32();break}case 2:{d.cipherKey=s.bytes();break}case 3:{d.macKey=s.bytes();break}case 4:{d.iv=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.SessionStructure.Chain.MessageKey)return s;var g=new p.proto.SessionStructure.Chain.MessageKey;return s.index!=null&&(g.index=s.index>>>0),s.cipherKey!=null&&(typeof s.cipherKey=="string"?l.base64.decode(s.cipherKey,g.cipherKey=l.newBuffer(l.base64.length(s.cipherKey)),0):s.cipherKey.length>=0&&(g.cipherKey=s.cipherKey)),s.macKey!=null&&(typeof s.macKey=="string"?l.base64.decode(s.macKey,g.macKey=l.newBuffer(l.base64.length(s.macKey)),0):s.macKey.length>=0&&(g.macKey=s.macKey)),s.iv!=null&&(typeof s.iv=="string"?l.base64.decode(s.iv,g.iv=l.newBuffer(l.base64.length(s.iv)),0):s.iv.length>=0&&(g.iv=s.iv)),g},a.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.cipherKey!=null&&s.hasOwnProperty("cipherKey")&&(c.cipherKey=g.bytes===String?l.base64.encode(s.cipherKey,0,s.cipherKey.length):g.bytes===Array?Array.prototype.slice.call(s.cipherKey):s.cipherKey,g.oneofs&&(c._cipherKey="cipherKey")),s.macKey!=null&&s.hasOwnProperty("macKey")&&(c.macKey=g.bytes===String?l.base64.encode(s.macKey,0,s.macKey.length):g.bytes===Array?Array.prototype.slice.call(s.macKey):s.macKey,g.oneofs&&(c._macKey="macKey")),s.iv!=null&&s.hasOwnProperty("iv")&&(c.iv=g.bytes===String?l.base64.encode(s.iv,0,s.iv.length):g.bytes===Array?Array.prototype.slice.call(s.iv):s.iv,g.oneofs&&(c._iv="iv")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.MessageKey"},a})(),i})(),t.PendingKeyExchange=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.sequence=A.uint32();break}case 2:{c.localBaseKey=A.bytes();break}case 3:{c.localBaseKeyPrivate=A.bytes();break}case 4:{c.localRatchetKey=A.bytes();break}case 5:{c.localRatchetKeyPrivate=A.bytes();break}case 7:{c.localIdentityKey=A.bytes();break}case 8:{c.localIdentityKeyPrivate=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.PendingKeyExchange)return A;var r=new p.proto.SessionStructure.PendingKeyExchange;return A.sequence!=null&&(r.sequence=A.sequence>>>0),A.localBaseKey!=null&&(typeof A.localBaseKey=="string"?l.base64.decode(A.localBaseKey,r.localBaseKey=l.newBuffer(l.base64.length(A.localBaseKey)),0):A.localBaseKey.length>=0&&(r.localBaseKey=A.localBaseKey)),A.localBaseKeyPrivate!=null&&(typeof A.localBaseKeyPrivate=="string"?l.base64.decode(A.localBaseKeyPrivate,r.localBaseKeyPrivate=l.newBuffer(l.base64.length(A.localBaseKeyPrivate)),0):A.localBaseKeyPrivate.length>=0&&(r.localBaseKeyPrivate=A.localBaseKeyPrivate)),A.localRatchetKey!=null&&(typeof A.localRatchetKey=="string"?l.base64.decode(A.localRatchetKey,r.localRatchetKey=l.newBuffer(l.base64.length(A.localRatchetKey)),0):A.localRatchetKey.length>=0&&(r.localRatchetKey=A.localRatchetKey)),A.localRatchetKeyPrivate!=null&&(typeof A.localRatchetKeyPrivate=="string"?l.base64.decode(A.localRatchetKeyPrivate,r.localRatchetKeyPrivate=l.newBuffer(l.base64.length(A.localRatchetKeyPrivate)),0):A.localRatchetKeyPrivate.length>=0&&(r.localRatchetKeyPrivate=A.localRatchetKeyPrivate)),A.localIdentityKey!=null&&(typeof A.localIdentityKey=="string"?l.base64.decode(A.localIdentityKey,r.localIdentityKey=l.newBuffer(l.base64.length(A.localIdentityKey)),0):A.localIdentityKey.length>=0&&(r.localIdentityKey=A.localIdentityKey)),A.localIdentityKeyPrivate!=null&&(typeof A.localIdentityKeyPrivate=="string"?l.base64.decode(A.localIdentityKeyPrivate,r.localIdentityKeyPrivate=l.newBuffer(l.base64.length(A.localIdentityKeyPrivate)),0):A.localIdentityKeyPrivate.length>=0&&(r.localIdentityKeyPrivate=A.localIdentityKeyPrivate)),r},i.toObject=function(A,r){r||(r={});var s={};return A.sequence!=null&&A.hasOwnProperty("sequence")&&(s.sequence=A.sequence,r.oneofs&&(s._sequence="sequence")),A.localBaseKey!=null&&A.hasOwnProperty("localBaseKey")&&(s.localBaseKey=r.bytes===String?l.base64.encode(A.localBaseKey,0,A.localBaseKey.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKey):A.localBaseKey,r.oneofs&&(s._localBaseKey="localBaseKey")),A.localBaseKeyPrivate!=null&&A.hasOwnProperty("localBaseKeyPrivate")&&(s.localBaseKeyPrivate=r.bytes===String?l.base64.encode(A.localBaseKeyPrivate,0,A.localBaseKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKeyPrivate):A.localBaseKeyPrivate,r.oneofs&&(s._localBaseKeyPrivate="localBaseKeyPrivate")),A.localRatchetKey!=null&&A.hasOwnProperty("localRatchetKey")&&(s.localRatchetKey=r.bytes===String?l.base64.encode(A.localRatchetKey,0,A.localRatchetKey.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKey):A.localRatchetKey,r.oneofs&&(s._localRatchetKey="localRatchetKey")),A.localRatchetKeyPrivate!=null&&A.hasOwnProperty("localRatchetKeyPrivate")&&(s.localRatchetKeyPrivate=r.bytes===String?l.base64.encode(A.localRatchetKeyPrivate,0,A.localRatchetKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKeyPrivate):A.localRatchetKeyPrivate,r.oneofs&&(s._localRatchetKeyPrivate="localRatchetKeyPrivate")),A.localIdentityKey!=null&&A.hasOwnProperty("localIdentityKey")&&(s.localIdentityKey=r.bytes===String?l.base64.encode(A.localIdentityKey,0,A.localIdentityKey.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKey):A.localIdentityKey,r.oneofs&&(s._localIdentityKey="localIdentityKey")),A.localIdentityKeyPrivate!=null&&A.hasOwnProperty("localIdentityKeyPrivate")&&(s.localIdentityKeyPrivate=r.bytes===String?l.base64.encode(A.localIdentityKeyPrivate,0,A.localIdentityKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKeyPrivate):A.localIdentityKeyPrivate,r.oneofs&&(s._localIdentityKeyPrivate="localIdentityKeyPrivate")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingKeyExchange"},i})(),t.PendingPreKey=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.preKeyId=A.uint32();break}case 3:{c.signedPreKeyId=A.int32();break}case 2:{c.baseKey=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.PendingPreKey)return A;var r=new p.proto.SessionStructure.PendingPreKey;return A.preKeyId!=null&&(r.preKeyId=A.preKeyId>>>0),A.signedPreKeyId!=null&&(r.signedPreKeyId=A.signedPreKeyId|0),A.baseKey!=null&&(typeof A.baseKey=="string"?l.base64.decode(A.baseKey,r.baseKey=l.newBuffer(l.base64.length(A.baseKey)),0):A.baseKey.length>=0&&(r.baseKey=A.baseKey)),r},i.toObject=function(A,r){r||(r={});var s={};return A.preKeyId!=null&&A.hasOwnProperty("preKeyId")&&(s.preKeyId=A.preKeyId,r.oneofs&&(s._preKeyId="preKeyId")),A.baseKey!=null&&A.hasOwnProperty("baseKey")&&(s.baseKey=r.bytes===String?l.base64.encode(A.baseKey,0,A.baseKey.length):r.bytes===Array?Array.prototype.slice.call(A.baseKey):A.baseKey,r.oneofs&&(s._baseKey="baseKey")),A.signedPreKeyId!=null&&A.hasOwnProperty("signedPreKeyId")&&(s.signedPreKeyId=A.signedPreKeyId,r.oneofs&&(s._signedPreKeyId="signedPreKeyId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingPreKey"},i})(),t})(),n.SessionTransparencyMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.disclaimerText=e.string();break}case 2:{s.hcaId=e.string();break}case 3:{s.sessionTransparencyType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SessionTransparencyMetadata)return e;var a=new p.proto.SessionTransparencyMetadata;switch(e.disclaimerText!=null&&(a.disclaimerText=String(e.disclaimerText)),e.hcaId!=null&&(a.hcaId=String(e.hcaId)),e.sessionTransparencyType){default:if(typeof e.sessionTransparencyType=="number"){a.sessionTransparencyType=e.sessionTransparencyType;break}break;case"UNKNOWN_TYPE":case 0:a.sessionTransparencyType=0;break;case"NY_AI_SAFETY_DISCLAIMER":case 1:a.sessionTransparencyType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.disclaimerText!=null&&e.hasOwnProperty("disclaimerText")&&(A.disclaimerText=e.disclaimerText,a.oneofs&&(A._disclaimerText="disclaimerText")),e.hcaId!=null&&e.hasOwnProperty("hcaId")&&(A.hcaId=e.hcaId,a.oneofs&&(A._hcaId="hcaId")),e.sessionTransparencyType!=null&&e.hasOwnProperty("sessionTransparencyType")&&(A.sessionTransparencyType=a.enums===String?p.proto.SessionTransparencyType[e.sessionTransparencyType]===void 0?e.sessionTransparencyType:p.proto.SessionTransparencyType[e.sessionTransparencyType]:e.sessionTransparencyType,a.oneofs&&(A._sessionTransparencyType="sessionTransparencyType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SessionTransparencyMetadata"},t})(),n.SessionTransparencyType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN_TYPE"]=0,o[t[1]="NY_AI_SAFETY_DISCLAIMER"]=1,o})(),n.SignalMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.ratchetKey=e.bytes();break}case 2:{s.counter=e.uint32();break}case 3:{s.previousCounter=e.uint32();break}case 4:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SignalMessage)return e;var a=new p.proto.SignalMessage;return e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,a.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(a.ratchetKey=e.ratchetKey)),e.counter!=null&&(a.counter=e.counter>>>0),e.previousCounter!=null&&(a.previousCounter=e.previousCounter>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,a.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(a.ciphertext=e.ciphertext)),a},t.toObject=function(e,a){a||(a={});var A={};return e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=a.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):a.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,a.oneofs&&(A._ratchetKey="ratchetKey")),e.counter!=null&&e.hasOwnProperty("counter")&&(A.counter=e.counter,a.oneofs&&(A._counter="counter")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,a.oneofs&&(A._previousCounter="previousCounter")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=a.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):a.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,a.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignalMessage"},t})(),n.SignedPreKeyRecordStructure=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}case 4:{s.signature=e.bytes();break}case 5:{s.timestamp=e.fixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SignedPreKeyRecordStructure)return e;var a=new p.proto.SignedPreKeyRecordStructure;return e.id!=null&&(a.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignedPreKeyRecordStructure"},t})(),n.StatusAttribution=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.actionUrl=e.string();break}case 3:{s.statusReshare=p.proto.StatusAttribution.StatusReshare.decode(e,e.uint32());break}case 4:{s.externalShare=p.proto.StatusAttribution.ExternalShare.decode(e,e.uint32());break}case 5:{s.music=p.proto.StatusAttribution.Music.decode(e,e.uint32());break}case 6:{s.groupStatus=p.proto.StatusAttribution.GroupStatus.decode(e,e.uint32());break}case 7:{s.rlAttribution=p.proto.StatusAttribution.RLAttribution.decode(e,e.uint32());break}case 8:{s.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StatusAttribution)return e;var a=new p.proto.StatusAttribution;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN":case 0:a.type=0;break;case"RESHARE":case 1:a.type=1;break;case"EXTERNAL_SHARE":case 2:a.type=2;break;case"MUSIC":case 3:a.type=3;break;case"STATUS_MENTION":case 4:a.type=4;break;case"GROUP_STATUS":case 5:a.type=5;break;case"RL_ATTRIBUTION":case 6:a.type=6;break;case"AI_CREATED":case 7:a.type=7;break;case"LAYOUTS":case 8:a.type=8;break}if(e.actionUrl!=null&&(a.actionUrl=String(e.actionUrl)),e.statusReshare!=null){if(typeof e.statusReshare!="object")throw TypeError(".proto.StatusAttribution.statusReshare: object expected");a.statusReshare=p.proto.StatusAttribution.StatusReshare.fromObject(e.statusReshare)}if(e.externalShare!=null){if(typeof e.externalShare!="object")throw TypeError(".proto.StatusAttribution.externalShare: object expected");a.externalShare=p.proto.StatusAttribution.ExternalShare.fromObject(e.externalShare)}if(e.music!=null){if(typeof e.music!="object")throw TypeError(".proto.StatusAttribution.music: object expected");a.music=p.proto.StatusAttribution.Music.fromObject(e.music)}if(e.groupStatus!=null){if(typeof e.groupStatus!="object")throw TypeError(".proto.StatusAttribution.groupStatus: object expected");a.groupStatus=p.proto.StatusAttribution.GroupStatus.fromObject(e.groupStatus)}if(e.rlAttribution!=null){if(typeof e.rlAttribution!="object")throw TypeError(".proto.StatusAttribution.rlAttribution: object expected");a.rlAttribution=p.proto.StatusAttribution.RLAttribution.fromObject(e.rlAttribution)}if(e.aiCreatedAttribution!=null){if(typeof e.aiCreatedAttribution!="object")throw TypeError(".proto.StatusAttribution.aiCreatedAttribution: object expected");a.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.fromObject(e.aiCreatedAttribution)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.StatusAttribution.Type[e.type]===void 0?e.type:p.proto.StatusAttribution.Type[e.type]:e.type,a.oneofs&&(A._type="type")),e.actionUrl!=null&&e.hasOwnProperty("actionUrl")&&(A.actionUrl=e.actionUrl,a.oneofs&&(A._actionUrl="actionUrl")),e.statusReshare!=null&&e.hasOwnProperty("statusReshare")&&(A.statusReshare=p.proto.StatusAttribution.StatusReshare.toObject(e.statusReshare,a),a.oneofs&&(A.attributionData="statusReshare")),e.externalShare!=null&&e.hasOwnProperty("externalShare")&&(A.externalShare=p.proto.StatusAttribution.ExternalShare.toObject(e.externalShare,a),a.oneofs&&(A.attributionData="externalShare")),e.music!=null&&e.hasOwnProperty("music")&&(A.music=p.proto.StatusAttribution.Music.toObject(e.music,a),a.oneofs&&(A.attributionData="music")),e.groupStatus!=null&&e.hasOwnProperty("groupStatus")&&(A.groupStatus=p.proto.StatusAttribution.GroupStatus.toObject(e.groupStatus,a),a.oneofs&&(A.attributionData="groupStatus")),e.rlAttribution!=null&&e.hasOwnProperty("rlAttribution")&&(A.rlAttribution=p.proto.StatusAttribution.RLAttribution.toObject(e.rlAttribution,a),a.oneofs&&(A.attributionData="rlAttribution")),e.aiCreatedAttribution!=null&&e.hasOwnProperty("aiCreatedAttribution")&&(A.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.toObject(e.aiCreatedAttribution,a),a.oneofs&&(A.attributionData="aiCreatedAttribution")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusAttribution"},t.AiCreatedAttribution=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.AiCreatedAttribution)return A;var r=new p.proto.StatusAttribution.AiCreatedAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"STATUS_MIMICRY":case 1:r.source=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.AiCreatedAttribution"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="STATUS_MIMICRY"]=1,A})(),i})(),t.ExternalShare=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.actionUrl=A.string();break}case 2:{c.source=A.int32();break}case 3:{c.duration=A.int32();break}case 4:{c.actionFallbackUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.ExternalShare)return A;var r=new p.proto.StatusAttribution.ExternalShare;switch(A.actionUrl!=null&&(r.actionUrl=String(A.actionUrl)),A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INSTAGRAM":case 1:r.source=1;break;case"FACEBOOK":case 2:r.source=2;break;case"MESSENGER":case 3:r.source=3;break;case"SPOTIFY":case 4:r.source=4;break;case"YOUTUBE":case 5:r.source=5;break;case"PINTEREST":case 6:r.source=6;break;case"THREADS":case 7:r.source=7;break;case"APPLE_MUSIC":case 8:r.source=8;break;case"SHARECHAT":case 9:r.source=9;break;case"GOOGLE_PHOTOS":case 10:r.source=10;break}return A.duration!=null&&(r.duration=A.duration|0),A.actionFallbackUrl!=null&&(r.actionFallbackUrl=String(A.actionFallbackUrl)),r},i.toObject=function(A,r){r||(r={});var s={};return A.actionUrl!=null&&A.hasOwnProperty("actionUrl")&&(s.actionUrl=A.actionUrl,r.oneofs&&(s._actionUrl="actionUrl")),A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.ExternalShare.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.ExternalShare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.duration!=null&&A.hasOwnProperty("duration")&&(s.duration=A.duration,r.oneofs&&(s._duration="duration")),A.actionFallbackUrl!=null&&A.hasOwnProperty("actionFallbackUrl")&&(s.actionFallbackUrl=A.actionFallbackUrl,r.oneofs&&(s._actionFallbackUrl="actionFallbackUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.ExternalShare"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="INSTAGRAM"]=1,A[a[2]="FACEBOOK"]=2,A[a[3]="MESSENGER"]=3,A[a[4]="SPOTIFY"]=4,A[a[5]="YOUTUBE"]=5,A[a[6]="PINTEREST"]=6,A[a[7]="THREADS"]=7,A[a[8]="APPLE_MUSIC"]=8,A[a[9]="SHARECHAT"]=9,A[a[10]="GOOGLE_PHOTOS"]=10,A})(),i})(),t.GroupStatus=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.authorJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.GroupStatus)return A;var r=new p.proto.StatusAttribution.GroupStatus;return A.authorJid!=null&&(r.authorJid=String(A.authorJid)),r},i.toObject=function(A,r){r||(r={});var s={};return A.authorJid!=null&&A.hasOwnProperty("authorJid")&&(s.authorJid=A.authorJid,r.oneofs&&(s._authorJid="authorJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.GroupStatus"},i})(),t.Music=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.authorName=A.string();break}case 2:{c.songId=A.string();break}case 3:{c.title=A.string();break}case 4:{c.author=A.string();break}case 5:{c.artistAttribution=A.string();break}case 6:{c.isExplicit=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.Music)return A;var r=new p.proto.StatusAttribution.Music;return A.authorName!=null&&(r.authorName=String(A.authorName)),A.songId!=null&&(r.songId=String(A.songId)),A.title!=null&&(r.title=String(A.title)),A.author!=null&&(r.author=String(A.author)),A.artistAttribution!=null&&(r.artistAttribution=String(A.artistAttribution)),A.isExplicit!=null&&(r.isExplicit=!!A.isExplicit),r},i.toObject=function(A,r){r||(r={});var s={};return A.authorName!=null&&A.hasOwnProperty("authorName")&&(s.authorName=A.authorName,r.oneofs&&(s._authorName="authorName")),A.songId!=null&&A.hasOwnProperty("songId")&&(s.songId=A.songId,r.oneofs&&(s._songId="songId")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.author!=null&&A.hasOwnProperty("author")&&(s.author=A.author,r.oneofs&&(s._author="author")),A.artistAttribution!=null&&A.hasOwnProperty("artistAttribution")&&(s.artistAttribution=A.artistAttribution,r.oneofs&&(s._artistAttribution="artistAttribution")),A.isExplicit!=null&&A.hasOwnProperty("isExplicit")&&(s.isExplicit=A.isExplicit,r.oneofs&&(s._isExplicit="isExplicit")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.Music"},i})(),t.RLAttribution=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.RLAttribution)return A;var r=new p.proto.StatusAttribution.RLAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"RAY_BAN_META_GLASSES":case 1:r.source=1;break;case"OAKLEY_META_GLASSES":case 2:r.source=2;break;case"HYPERNOVA_GLASSES":case 3:r.source=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.RLAttribution.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.RLAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.RLAttribution"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="RAY_BAN_META_GLASSES"]=1,A[a[2]="OAKLEY_META_GLASSES"]=2,A[a[3]="HYPERNOVA_GLASSES"]=3,A})(),i})(),t.StatusReshare=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.source=A.int32();break}case 2:{c.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.StatusReshare)return A;var r=new p.proto.StatusAttribution.StatusReshare;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INTERNAL_RESHARE":case 1:r.source=1;break;case"MENTION_RESHARE":case 2:r.source=2;break;case"CHANNEL_RESHARE":case 3:r.source=3;break;case"FORWARD":case 4:r.source=4;break}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.StatusAttribution.StatusReshare.metadata: object expected");r.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.fromObject(A.metadata)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.StatusReshare.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.StatusReshare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.StatusReshare"},i.Metadata=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.duration=s.int32();break}case 2:{d.channelJid=s.string();break}case 3:{d.channelMessageId=s.int32();break}case 4:{d.hasMultipleReshares=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.StatusAttribution.StatusReshare.Metadata)return s;var g=new p.proto.StatusAttribution.StatusReshare.Metadata;return s.duration!=null&&(g.duration=s.duration|0),s.channelJid!=null&&(g.channelJid=String(s.channelJid)),s.channelMessageId!=null&&(g.channelMessageId=s.channelMessageId|0),s.hasMultipleReshares!=null&&(g.hasMultipleReshares=!!s.hasMultipleReshares),g},a.toObject=function(s,g){g||(g={});var c={};return s.duration!=null&&s.hasOwnProperty("duration")&&(c.duration=s.duration,g.oneofs&&(c._duration="duration")),s.channelJid!=null&&s.hasOwnProperty("channelJid")&&(c.channelJid=s.channelJid,g.oneofs&&(c._channelJid="channelJid")),s.channelMessageId!=null&&s.hasOwnProperty("channelMessageId")&&(c.channelMessageId=s.channelMessageId,g.oneofs&&(c._channelMessageId="channelMessageId")),s.hasMultipleReshares!=null&&s.hasOwnProperty("hasMultipleReshares")&&(c.hasMultipleReshares=s.hasMultipleReshares,g.oneofs&&(c._hasMultipleReshares="hasMultipleReshares")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.StatusAttribution.StatusReshare.Metadata"},a})(),i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="INTERNAL_RESHARE"]=1,A[a[2]="MENTION_RESHARE"]=2,A[a[3]="CHANNEL_RESHARE"]=3,A[a[4]="FORWARD"]=4,A})(),i})(),t.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="RESHARE"]=1,e[i[2]="EXTERNAL_SHARE"]=2,e[i[3]="MUSIC"]=3,e[i[4]="STATUS_MENTION"]=4,e[i[5]="GROUP_STATUS"]=5,e[i[6]="RL_ATTRIBUTION"]=6,e[i[7]="AI_CREATED"]=7,e[i[8]="LAYOUTS"]=8,e})(),t})(),n.StatusMentionMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.quotedStatus=p.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StatusMentionMessage)return e;var a=new p.proto.StatusMentionMessage;if(e.quotedStatus!=null){if(typeof e.quotedStatus!="object")throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected");a.quotedStatus=p.proto.Message.fromObject(e.quotedStatus)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.quotedStatus!=null&&e.hasOwnProperty("quotedStatus")&&(A.quotedStatus=p.proto.Message.toObject(e.quotedStatus,a),a.oneofs&&(A._quotedStatus="quotedStatus")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusMentionMessage"},t})(),n.StatusPSA=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 44:{s.campaignId=e.uint64();break}case 45:{s.campaignExpirationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StatusPSA)return e;var a=new p.proto.StatusPSA;return e.campaignId!=null&&(l.Long?(a.campaignId=l.Long.fromValue(e.campaignId)).unsigned=!0:typeof e.campaignId=="string"?a.campaignId=parseInt(e.campaignId,10):typeof e.campaignId=="number"?a.campaignId=e.campaignId:typeof e.campaignId=="object"&&(a.campaignId=new l.LongBits(e.campaignId.low>>>0,e.campaignId.high>>>0).toNumber(!0))),e.campaignExpirationTimestamp!=null&&(l.Long?(a.campaignExpirationTimestamp=l.Long.fromValue(e.campaignExpirationTimestamp)).unsigned=!0:typeof e.campaignExpirationTimestamp=="string"?a.campaignExpirationTimestamp=parseInt(e.campaignExpirationTimestamp,10):typeof e.campaignExpirationTimestamp=="number"?a.campaignExpirationTimestamp=e.campaignExpirationTimestamp:typeof e.campaignExpirationTimestamp=="object"&&(a.campaignExpirationTimestamp=new l.LongBits(e.campaignExpirationTimestamp.low>>>0,e.campaignExpirationTimestamp.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};if(a.defaults)if(l.Long){var r=new l.Long(0,0,!0);A.campaignId=a.longs===String?r.toString():a.longs===Number?r.toNumber():r}else A.campaignId=a.longs===String?"0":0;return e.campaignId!=null&&e.hasOwnProperty("campaignId")&&(typeof e.campaignId=="number"?A.campaignId=a.longs===String?String(e.campaignId):e.campaignId:A.campaignId=a.longs===String?ge(e.campaignId,!0):a.longs===Number?ce(e.campaignId,!0):e.campaignId),e.campaignExpirationTimestamp!=null&&e.hasOwnProperty("campaignExpirationTimestamp")&&(typeof e.campaignExpirationTimestamp=="number"?A.campaignExpirationTimestamp=a.longs===String?String(e.campaignExpirationTimestamp):e.campaignExpirationTimestamp:A.campaignExpirationTimestamp=a.longs===String?ge(e.campaignExpirationTimestamp,!0):a.longs===Number?ce(e.campaignExpirationTimestamp,!0):e.campaignExpirationTimestamp,a.oneofs&&(A._campaignExpirationTimestamp="campaignExpirationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusPSA"},t})(),n.StickerMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.url=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.fileEncSha256=e.bytes();break}case 4:{s.mediaKey=e.bytes();break}case 5:{s.mimetype=e.string();break}case 6:{s.height=e.uint32();break}case 7:{s.width=e.uint32();break}case 8:{s.directPath=e.string();break}case 9:{s.fileLength=e.uint64();break}case 10:{s.weight=e.float();break}case 11:{s.lastStickerSentTs=e.int64();break}case 12:{s.isLottie=e.bool();break}case 13:{s.imageHash=e.string();break}case 14:{s.isAvatarSticker=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StickerMetadata)return e;var a=new p.proto.StickerMetadata;return e.url!=null&&(a.url=String(e.url)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,a.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(a.mediaKey=e.mediaKey)),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.height!=null&&(a.height=e.height>>>0),e.width!=null&&(a.width=e.width>>>0),e.directPath!=null&&(a.directPath=String(e.directPath)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.weight!=null&&(a.weight=Number(e.weight)),e.lastStickerSentTs!=null&&(l.Long?(a.lastStickerSentTs=l.Long.fromValue(e.lastStickerSentTs)).unsigned=!1:typeof e.lastStickerSentTs=="string"?a.lastStickerSentTs=parseInt(e.lastStickerSentTs,10):typeof e.lastStickerSentTs=="number"?a.lastStickerSentTs=e.lastStickerSentTs:typeof e.lastStickerSentTs=="object"&&(a.lastStickerSentTs=new l.LongBits(e.lastStickerSentTs.low>>>0,e.lastStickerSentTs.high>>>0).toNumber())),e.isLottie!=null&&(a.isLottie=!!e.isLottie),e.imageHash!=null&&(a.imageHash=String(e.imageHash)),e.isAvatarSticker!=null&&(a.isAvatarSticker=!!e.isAvatarSticker),a},t.toObject=function(e,a){a||(a={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=a.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=a.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,a.oneofs&&(A._height="height")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,a.oneofs&&(A._width="width")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?ge(e.fileLength,!0):a.longs===Number?ce(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=a.json&&!isFinite(e.weight)?String(e.weight):e.weight,a.oneofs&&(A._weight="weight")),e.lastStickerSentTs!=null&&e.hasOwnProperty("lastStickerSentTs")&&(typeof e.lastStickerSentTs=="number"?A.lastStickerSentTs=a.longs===String?String(e.lastStickerSentTs):e.lastStickerSentTs:A.lastStickerSentTs=a.longs===String?ge(e.lastStickerSentTs):a.longs===Number?ce(e.lastStickerSentTs):e.lastStickerSentTs,a.oneofs&&(A._lastStickerSentTs="lastStickerSentTs")),e.isLottie!=null&&e.hasOwnProperty("isLottie")&&(A.isLottie=e.isLottie,a.oneofs&&(A._isLottie="isLottie")),e.imageHash!=null&&e.hasOwnProperty("imageHash")&&(A.imageHash=e.imageHash,a.oneofs&&(A._imageHash="imageHash")),e.isAvatarSticker!=null&&e.hasOwnProperty("isAvatarSticker")&&(A.isAvatarSticker=e.isAvatarSticker,a.oneofs&&(A._isAvatarSticker="isAvatarSticker")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StickerMetadata"},t})(),n.SyncActionData=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.index=e.bytes();break}case 2:{s.value=p.proto.SyncActionValue.decode(e,e.uint32());break}case 3:{s.padding=e.bytes();break}case 4:{s.version=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncActionData)return e;var a=new p.proto.SyncActionData;if(e.index!=null&&(typeof e.index=="string"?l.base64.decode(e.index,a.index=l.newBuffer(l.base64.length(e.index)),0):e.index.length>=0&&(a.index=e.index)),e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncActionData.value: object expected");a.value=p.proto.SyncActionValue.fromObject(e.value)}return e.padding!=null&&(typeof e.padding=="string"?l.base64.decode(e.padding,a.padding=l.newBuffer(l.base64.length(e.padding)),0):e.padding.length>=0&&(a.padding=e.padding)),e.version!=null&&(a.version=e.version|0),a},t.toObject=function(e,a){a||(a={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=a.bytes===String?l.base64.encode(e.index,0,e.index.length):a.bytes===Array?Array.prototype.slice.call(e.index):e.index,a.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=p.proto.SyncActionValue.toObject(e.value,a),a.oneofs&&(A._value="value")),e.padding!=null&&e.hasOwnProperty("padding")&&(A.padding=a.bytes===String?l.base64.encode(e.padding,0,e.padding.length):a.bytes===Array?Array.prototype.slice.call(e.padding):e.padding,a.oneofs&&(A._padding="padding")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionData"},t})(),n.SyncActionValue=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.timestamp=e.int64();break}case 2:{s.starAction=p.proto.SyncActionValue.StarAction.decode(e,e.uint32());break}case 3:{s.contactAction=p.proto.SyncActionValue.ContactAction.decode(e,e.uint32());break}case 4:{s.muteAction=p.proto.SyncActionValue.MuteAction.decode(e,e.uint32());break}case 5:{s.pinAction=p.proto.SyncActionValue.PinAction.decode(e,e.uint32());break}case 7:{s.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.decode(e,e.uint32());break}case 8:{s.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.decode(e,e.uint32());break}case 11:{s.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.decode(e,e.uint32());break}case 14:{s.labelEditAction=p.proto.SyncActionValue.LabelEditAction.decode(e,e.uint32());break}case 15:{s.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.decode(e,e.uint32());break}case 16:{s.localeSetting=p.proto.SyncActionValue.LocaleSetting.decode(e,e.uint32());break}case 17:{s.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.decode(e,e.uint32());break}case 18:{s.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.decode(e,e.uint32());break}case 19:{s.keyExpiration=p.proto.SyncActionValue.KeyExpiration.decode(e,e.uint32());break}case 20:{s.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.decode(e,e.uint32());break}case 21:{s.clearChatAction=p.proto.SyncActionValue.ClearChatAction.decode(e,e.uint32());break}case 22:{s.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.decode(e,e.uint32());break}case 23:{s.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.decode(e,e.uint32());break}case 24:{s.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.decode(e,e.uint32());break}case 26:{s.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.decode(e,e.uint32());break}case 27:{s.agentAction=p.proto.SyncActionValue.AgentAction.decode(e,e.uint32());break}case 28:{s.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.decode(e,e.uint32());break}case 29:{s.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.decode(e,e.uint32());break}case 30:{s.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.decode(e,e.uint32());break}case 31:{s.nuxAction=p.proto.SyncActionValue.NuxAction.decode(e,e.uint32());break}case 32:{s.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.decode(e,e.uint32());break}case 33:{s.stickerAction=p.proto.SyncActionValue.StickerAction.decode(e,e.uint32());break}case 34:{s.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.decode(e,e.uint32());break}case 35:{s.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.decode(e,e.uint32());break}case 36:{s.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(e,e.uint32());break}case 37:{s.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.decode(e,e.uint32());break}case 38:{s.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.decode(e,e.uint32());break}case 39:{s.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.decode(e,e.uint32());break}case 40:{s.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.decode(e,e.uint32());break}case 41:{s.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.decode(e,e.uint32());break}case 42:{s.callLogAction=p.proto.SyncActionValue.CallLogAction.decode(e,e.uint32());break}case 43:{s.ugcBot=p.proto.SyncActionValue.UGCBot.decode(e,e.uint32());break}case 44:{s.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.decode(e,e.uint32());break}case 45:{s.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.decode(e,e.uint32());break}case 46:{s.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.decode(e,e.uint32());break}case 47:{s.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.decode(e,e.uint32());break}case 48:{s.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.decode(e,e.uint32());break}case 49:{s.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.decode(e,e.uint32());break}case 50:{s.lockChatAction=p.proto.SyncActionValue.LockChatAction.decode(e,e.uint32());break}case 51:{s.chatLockSettings=p.proto.ChatLockSettings.decode(e,e.uint32());break}case 52:{s.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.decode(e,e.uint32());break}case 53:{s.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.decode(e,e.uint32());break}case 54:{s.deviceCapabilities=p.proto.DeviceCapabilities.decode(e,e.uint32());break}case 55:{s.noteEditAction=p.proto.SyncActionValue.NoteEditAction.decode(e,e.uint32());break}case 56:{s.favoritesAction=p.proto.SyncActionValue.FavoritesAction.decode(e,e.uint32());break}case 57:{s.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.decode(e,e.uint32());break}case 58:{s.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.decode(e,e.uint32());break}case 59:{s.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.decode(e,e.uint32());break}case 60:{s.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.decode(e,e.uint32());break}case 61:{s.lidContactAction=p.proto.SyncActionValue.LidContactAction.decode(e,e.uint32());break}case 62:{s.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.decode(e,e.uint32());break}case 63:{s.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.decode(e,e.uint32());break}case 64:{s.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.decode(e,e.uint32());break}case 65:{s.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.decode(e,e.uint32());break}case 66:{s.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.decode(e,e.uint32());break}case 68:{s.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.decode(e,e.uint32());break}case 69:{s.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.decode(e,e.uint32());break}case 70:{s.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.decode(e,e.uint32());break}case 71:{s.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.decode(e,e.uint32());break}case 72:{s.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.decode(e,e.uint32());break}case 74:{s.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.decode(e,e.uint32());break}case 75:{s.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.decode(e,e.uint32());break}case 76:{s.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.decode(e,e.uint32());break}case 77:{s.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncActionValue)return e;var a=new p.proto.SyncActionValue;if(e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.starAction!=null){if(typeof e.starAction!="object")throw TypeError(".proto.SyncActionValue.starAction: object expected");a.starAction=p.proto.SyncActionValue.StarAction.fromObject(e.starAction)}if(e.contactAction!=null){if(typeof e.contactAction!="object")throw TypeError(".proto.SyncActionValue.contactAction: object expected");a.contactAction=p.proto.SyncActionValue.ContactAction.fromObject(e.contactAction)}if(e.muteAction!=null){if(typeof e.muteAction!="object")throw TypeError(".proto.SyncActionValue.muteAction: object expected");a.muteAction=p.proto.SyncActionValue.MuteAction.fromObject(e.muteAction)}if(e.pinAction!=null){if(typeof e.pinAction!="object")throw TypeError(".proto.SyncActionValue.pinAction: object expected");a.pinAction=p.proto.SyncActionValue.PinAction.fromObject(e.pinAction)}if(e.pushNameSetting!=null){if(typeof e.pushNameSetting!="object")throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected");a.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.fromObject(e.pushNameSetting)}if(e.quickReplyAction!=null){if(typeof e.quickReplyAction!="object")throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected");a.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.fromObject(e.quickReplyAction)}if(e.recentEmojiWeightsAction!=null){if(typeof e.recentEmojiWeightsAction!="object")throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected");a.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(e.recentEmojiWeightsAction)}if(e.labelEditAction!=null){if(typeof e.labelEditAction!="object")throw TypeError(".proto.SyncActionValue.labelEditAction: object expected");a.labelEditAction=p.proto.SyncActionValue.LabelEditAction.fromObject(e.labelEditAction)}if(e.labelAssociationAction!=null){if(typeof e.labelAssociationAction!="object")throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected");a.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.fromObject(e.labelAssociationAction)}if(e.localeSetting!=null){if(typeof e.localeSetting!="object")throw TypeError(".proto.SyncActionValue.localeSetting: object expected");a.localeSetting=p.proto.SyncActionValue.LocaleSetting.fromObject(e.localeSetting)}if(e.archiveChatAction!=null){if(typeof e.archiveChatAction!="object")throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected");a.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.fromObject(e.archiveChatAction)}if(e.deleteMessageForMeAction!=null){if(typeof e.deleteMessageForMeAction!="object")throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected");a.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(e.deleteMessageForMeAction)}if(e.keyExpiration!=null){if(typeof e.keyExpiration!="object")throw TypeError(".proto.SyncActionValue.keyExpiration: object expected");a.keyExpiration=p.proto.SyncActionValue.KeyExpiration.fromObject(e.keyExpiration)}if(e.markChatAsReadAction!=null){if(typeof e.markChatAsReadAction!="object")throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected");a.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.fromObject(e.markChatAsReadAction)}if(e.clearChatAction!=null){if(typeof e.clearChatAction!="object")throw TypeError(".proto.SyncActionValue.clearChatAction: object expected");a.clearChatAction=p.proto.SyncActionValue.ClearChatAction.fromObject(e.clearChatAction)}if(e.deleteChatAction!=null){if(typeof e.deleteChatAction!="object")throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected");a.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.fromObject(e.deleteChatAction)}if(e.unarchiveChatsSetting!=null){if(typeof e.unarchiveChatsSetting!="object")throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected");a.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(e.unarchiveChatsSetting)}if(e.primaryFeature!=null){if(typeof e.primaryFeature!="object")throw TypeError(".proto.SyncActionValue.primaryFeature: object expected");a.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.fromObject(e.primaryFeature)}if(e.androidUnsupportedActions!=null){if(typeof e.androidUnsupportedActions!="object")throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected");a.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(e.androidUnsupportedActions)}if(e.agentAction!=null){if(typeof e.agentAction!="object")throw TypeError(".proto.SyncActionValue.agentAction: object expected");a.agentAction=p.proto.SyncActionValue.AgentAction.fromObject(e.agentAction)}if(e.subscriptionAction!=null){if(typeof e.subscriptionAction!="object")throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected");a.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.fromObject(e.subscriptionAction)}if(e.userStatusMuteAction!=null){if(typeof e.userStatusMuteAction!="object")throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected");a.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.fromObject(e.userStatusMuteAction)}if(e.timeFormatAction!=null){if(typeof e.timeFormatAction!="object")throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected");a.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.fromObject(e.timeFormatAction)}if(e.nuxAction!=null){if(typeof e.nuxAction!="object")throw TypeError(".proto.SyncActionValue.nuxAction: object expected");a.nuxAction=p.proto.SyncActionValue.NuxAction.fromObject(e.nuxAction)}if(e.primaryVersionAction!=null){if(typeof e.primaryVersionAction!="object")throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected");a.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.fromObject(e.primaryVersionAction)}if(e.stickerAction!=null){if(typeof e.stickerAction!="object")throw TypeError(".proto.SyncActionValue.stickerAction: object expected");a.stickerAction=p.proto.SyncActionValue.StickerAction.fromObject(e.stickerAction)}if(e.removeRecentStickerAction!=null){if(typeof e.removeRecentStickerAction!="object")throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected");a.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(e.removeRecentStickerAction)}if(e.chatAssignment!=null){if(typeof e.chatAssignment!="object")throw TypeError(".proto.SyncActionValue.chatAssignment: object expected");a.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.fromObject(e.chatAssignment)}if(e.chatAssignmentOpenedStatus!=null){if(typeof e.chatAssignmentOpenedStatus!="object")throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected");a.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(e.chatAssignmentOpenedStatus)}if(e.pnForLidChatAction!=null){if(typeof e.pnForLidChatAction!="object")throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected");a.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.fromObject(e.pnForLidChatAction)}if(e.marketingMessageAction!=null){if(typeof e.marketingMessageAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected");a.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.fromObject(e.marketingMessageAction)}if(e.marketingMessageBroadcastAction!=null){if(typeof e.marketingMessageBroadcastAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected");a.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(e.marketingMessageBroadcastAction)}if(e.externalWebBetaAction!=null){if(typeof e.externalWebBetaAction!="object")throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected");a.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.fromObject(e.externalWebBetaAction)}if(e.privacySettingRelayAllCalls!=null){if(typeof e.privacySettingRelayAllCalls!="object")throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected");a.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(e.privacySettingRelayAllCalls)}if(e.callLogAction!=null){if(typeof e.callLogAction!="object")throw TypeError(".proto.SyncActionValue.callLogAction: object expected");a.callLogAction=p.proto.SyncActionValue.CallLogAction.fromObject(e.callLogAction)}if(e.ugcBot!=null){if(typeof e.ugcBot!="object")throw TypeError(".proto.SyncActionValue.ugcBot: object expected");a.ugcBot=p.proto.SyncActionValue.UGCBot.fromObject(e.ugcBot)}if(e.statusPrivacy!=null){if(typeof e.statusPrivacy!="object")throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected");a.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.fromObject(e.statusPrivacy)}if(e.botWelcomeRequestAction!=null){if(typeof e.botWelcomeRequestAction!="object")throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected");a.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(e.botWelcomeRequestAction)}if(e.deleteIndividualCallLog!=null){if(typeof e.deleteIndividualCallLog!="object")throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected");a.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(e.deleteIndividualCallLog)}if(e.labelReorderingAction!=null){if(typeof e.labelReorderingAction!="object")throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected");a.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.fromObject(e.labelReorderingAction)}if(e.paymentInfoAction!=null){if(typeof e.paymentInfoAction!="object")throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected");a.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.fromObject(e.paymentInfoAction)}if(e.customPaymentMethodsAction!=null){if(typeof e.customPaymentMethodsAction!="object")throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected");a.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(e.customPaymentMethodsAction)}if(e.lockChatAction!=null){if(typeof e.lockChatAction!="object")throw TypeError(".proto.SyncActionValue.lockChatAction: object expected");a.lockChatAction=p.proto.SyncActionValue.LockChatAction.fromObject(e.lockChatAction)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected");a.chatLockSettings=p.proto.ChatLockSettings.fromObject(e.chatLockSettings)}if(e.wamoUserIdentifierAction!=null){if(typeof e.wamoUserIdentifierAction!="object")throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected");a.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(e.wamoUserIdentifierAction)}if(e.privacySettingDisableLinkPreviewsAction!=null){if(typeof e.privacySettingDisableLinkPreviewsAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected");a.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(e.privacySettingDisableLinkPreviewsAction)}if(e.deviceCapabilities!=null){if(typeof e.deviceCapabilities!="object")throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected");a.deviceCapabilities=p.proto.DeviceCapabilities.fromObject(e.deviceCapabilities)}if(e.noteEditAction!=null){if(typeof e.noteEditAction!="object")throw TypeError(".proto.SyncActionValue.noteEditAction: object expected");a.noteEditAction=p.proto.SyncActionValue.NoteEditAction.fromObject(e.noteEditAction)}if(e.favoritesAction!=null){if(typeof e.favoritesAction!="object")throw TypeError(".proto.SyncActionValue.favoritesAction: object expected");a.favoritesAction=p.proto.SyncActionValue.FavoritesAction.fromObject(e.favoritesAction)}if(e.merchantPaymentPartnerAction!=null){if(typeof e.merchantPaymentPartnerAction!="object")throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected");a.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(e.merchantPaymentPartnerAction)}if(e.waffleAccountLinkStateAction!=null){if(typeof e.waffleAccountLinkStateAction!="object")throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected");a.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(e.waffleAccountLinkStateAction)}if(e.usernameChatStartMode!=null){if(typeof e.usernameChatStartMode!="object")throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected");a.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(e.usernameChatStartMode)}if(e.notificationActivitySettingAction!=null){if(typeof e.notificationActivitySettingAction!="object")throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected");a.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(e.notificationActivitySettingAction)}if(e.lidContactAction!=null){if(typeof e.lidContactAction!="object")throw TypeError(".proto.SyncActionValue.lidContactAction: object expected");a.lidContactAction=p.proto.SyncActionValue.LidContactAction.fromObject(e.lidContactAction)}if(e.ctwaPerCustomerDataSharingAction!=null){if(typeof e.ctwaPerCustomerDataSharingAction!="object")throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected");a.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(e.ctwaPerCustomerDataSharingAction)}if(e.paymentTosAction!=null){if(typeof e.paymentTosAction!="object")throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected");a.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.fromObject(e.paymentTosAction)}if(e.privacySettingChannelsPersonalisedRecommendationAction!=null){if(typeof e.privacySettingChannelsPersonalisedRecommendationAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingChannelsPersonalisedRecommendationAction: object expected");a.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.fromObject(e.privacySettingChannelsPersonalisedRecommendationAction)}if(e.businessBroadcastAssociationAction!=null){if(typeof e.businessBroadcastAssociationAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastAssociationAction: object expected");a.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.fromObject(e.businessBroadcastAssociationAction)}if(e.detectedOutcomesStatusAction!=null){if(typeof e.detectedOutcomesStatusAction!="object")throw TypeError(".proto.SyncActionValue.detectedOutcomesStatusAction: object expected");a.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.fromObject(e.detectedOutcomesStatusAction)}if(e.maibaAiFeaturesControlAction!=null){if(typeof e.maibaAiFeaturesControlAction!="object")throw TypeError(".proto.SyncActionValue.maibaAiFeaturesControlAction: object expected");a.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.fromObject(e.maibaAiFeaturesControlAction)}if(e.businessBroadcastListAction!=null){if(typeof e.businessBroadcastListAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastListAction: object expected");a.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.fromObject(e.businessBroadcastListAction)}if(e.musicUserIdAction!=null){if(typeof e.musicUserIdAction!="object")throw TypeError(".proto.SyncActionValue.musicUserIdAction: object expected");a.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.fromObject(e.musicUserIdAction)}if(e.statusPostOptInNotificationPreferencesAction!=null){if(typeof e.statusPostOptInNotificationPreferencesAction!="object")throw TypeError(".proto.SyncActionValue.statusPostOptInNotificationPreferencesAction: object expected");a.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.fromObject(e.statusPostOptInNotificationPreferencesAction)}if(e.avatarUpdatedAction!=null){if(typeof e.avatarUpdatedAction!="object")throw TypeError(".proto.SyncActionValue.avatarUpdatedAction: object expected");a.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.fromObject(e.avatarUpdatedAction)}if(e.privateProcessingSettingAction!=null){if(typeof e.privateProcessingSettingAction!="object")throw TypeError(".proto.SyncActionValue.privateProcessingSettingAction: object expected");a.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.fromObject(e.privateProcessingSettingAction)}if(e.newsletterSavedInterestsAction!=null){if(typeof e.newsletterSavedInterestsAction!="object")throw TypeError(".proto.SyncActionValue.newsletterSavedInterestsAction: object expected");a.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.fromObject(e.newsletterSavedInterestsAction)}if(e.aiThreadRenameAction!=null){if(typeof e.aiThreadRenameAction!="object")throw TypeError(".proto.SyncActionValue.aiThreadRenameAction: object expected");a.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.fromObject(e.aiThreadRenameAction)}if(e.interactiveMessageAction!=null){if(typeof e.interactiveMessageAction!="object")throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");a.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.fromObject(e.interactiveMessageAction)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.starAction!=null&&e.hasOwnProperty("starAction")&&(A.starAction=p.proto.SyncActionValue.StarAction.toObject(e.starAction,a),a.oneofs&&(A._starAction="starAction")),e.contactAction!=null&&e.hasOwnProperty("contactAction")&&(A.contactAction=p.proto.SyncActionValue.ContactAction.toObject(e.contactAction,a),a.oneofs&&(A._contactAction="contactAction")),e.muteAction!=null&&e.hasOwnProperty("muteAction")&&(A.muteAction=p.proto.SyncActionValue.MuteAction.toObject(e.muteAction,a),a.oneofs&&(A._muteAction="muteAction")),e.pinAction!=null&&e.hasOwnProperty("pinAction")&&(A.pinAction=p.proto.SyncActionValue.PinAction.toObject(e.pinAction,a),a.oneofs&&(A._pinAction="pinAction")),e.pushNameSetting!=null&&e.hasOwnProperty("pushNameSetting")&&(A.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.toObject(e.pushNameSetting,a),a.oneofs&&(A._pushNameSetting="pushNameSetting")),e.quickReplyAction!=null&&e.hasOwnProperty("quickReplyAction")&&(A.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.toObject(e.quickReplyAction,a),a.oneofs&&(A._quickReplyAction="quickReplyAction")),e.recentEmojiWeightsAction!=null&&e.hasOwnProperty("recentEmojiWeightsAction")&&(A.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(e.recentEmojiWeightsAction,a),a.oneofs&&(A._recentEmojiWeightsAction="recentEmojiWeightsAction")),e.labelEditAction!=null&&e.hasOwnProperty("labelEditAction")&&(A.labelEditAction=p.proto.SyncActionValue.LabelEditAction.toObject(e.labelEditAction,a),a.oneofs&&(A._labelEditAction="labelEditAction")),e.labelAssociationAction!=null&&e.hasOwnProperty("labelAssociationAction")&&(A.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.toObject(e.labelAssociationAction,a),a.oneofs&&(A._labelAssociationAction="labelAssociationAction")),e.localeSetting!=null&&e.hasOwnProperty("localeSetting")&&(A.localeSetting=p.proto.SyncActionValue.LocaleSetting.toObject(e.localeSetting,a),a.oneofs&&(A._localeSetting="localeSetting")),e.archiveChatAction!=null&&e.hasOwnProperty("archiveChatAction")&&(A.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.toObject(e.archiveChatAction,a),a.oneofs&&(A._archiveChatAction="archiveChatAction")),e.deleteMessageForMeAction!=null&&e.hasOwnProperty("deleteMessageForMeAction")&&(A.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.toObject(e.deleteMessageForMeAction,a),a.oneofs&&(A._deleteMessageForMeAction="deleteMessageForMeAction")),e.keyExpiration!=null&&e.hasOwnProperty("keyExpiration")&&(A.keyExpiration=p.proto.SyncActionValue.KeyExpiration.toObject(e.keyExpiration,a),a.oneofs&&(A._keyExpiration="keyExpiration")),e.markChatAsReadAction!=null&&e.hasOwnProperty("markChatAsReadAction")&&(A.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.toObject(e.markChatAsReadAction,a),a.oneofs&&(A._markChatAsReadAction="markChatAsReadAction")),e.clearChatAction!=null&&e.hasOwnProperty("clearChatAction")&&(A.clearChatAction=p.proto.SyncActionValue.ClearChatAction.toObject(e.clearChatAction,a),a.oneofs&&(A._clearChatAction="clearChatAction")),e.deleteChatAction!=null&&e.hasOwnProperty("deleteChatAction")&&(A.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.toObject(e.deleteChatAction,a),a.oneofs&&(A._deleteChatAction="deleteChatAction")),e.unarchiveChatsSetting!=null&&e.hasOwnProperty("unarchiveChatsSetting")&&(A.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.toObject(e.unarchiveChatsSetting,a),a.oneofs&&(A._unarchiveChatsSetting="unarchiveChatsSetting")),e.primaryFeature!=null&&e.hasOwnProperty("primaryFeature")&&(A.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.toObject(e.primaryFeature,a),a.oneofs&&(A._primaryFeature="primaryFeature")),e.androidUnsupportedActions!=null&&e.hasOwnProperty("androidUnsupportedActions")&&(A.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.toObject(e.androidUnsupportedActions,a),a.oneofs&&(A._androidUnsupportedActions="androidUnsupportedActions")),e.agentAction!=null&&e.hasOwnProperty("agentAction")&&(A.agentAction=p.proto.SyncActionValue.AgentAction.toObject(e.agentAction,a),a.oneofs&&(A._agentAction="agentAction")),e.subscriptionAction!=null&&e.hasOwnProperty("subscriptionAction")&&(A.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.toObject(e.subscriptionAction,a),a.oneofs&&(A._subscriptionAction="subscriptionAction")),e.userStatusMuteAction!=null&&e.hasOwnProperty("userStatusMuteAction")&&(A.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.toObject(e.userStatusMuteAction,a),a.oneofs&&(A._userStatusMuteAction="userStatusMuteAction")),e.timeFormatAction!=null&&e.hasOwnProperty("timeFormatAction")&&(A.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.toObject(e.timeFormatAction,a),a.oneofs&&(A._timeFormatAction="timeFormatAction")),e.nuxAction!=null&&e.hasOwnProperty("nuxAction")&&(A.nuxAction=p.proto.SyncActionValue.NuxAction.toObject(e.nuxAction,a),a.oneofs&&(A._nuxAction="nuxAction")),e.primaryVersionAction!=null&&e.hasOwnProperty("primaryVersionAction")&&(A.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.toObject(e.primaryVersionAction,a),a.oneofs&&(A._primaryVersionAction="primaryVersionAction")),e.stickerAction!=null&&e.hasOwnProperty("stickerAction")&&(A.stickerAction=p.proto.SyncActionValue.StickerAction.toObject(e.stickerAction,a),a.oneofs&&(A._stickerAction="stickerAction")),e.removeRecentStickerAction!=null&&e.hasOwnProperty("removeRecentStickerAction")&&(A.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.toObject(e.removeRecentStickerAction,a),a.oneofs&&(A._removeRecentStickerAction="removeRecentStickerAction")),e.chatAssignment!=null&&e.hasOwnProperty("chatAssignment")&&(A.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.toObject(e.chatAssignment,a),a.oneofs&&(A._chatAssignment="chatAssignment")),e.chatAssignmentOpenedStatus!=null&&e.hasOwnProperty("chatAssignmentOpenedStatus")&&(A.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(e.chatAssignmentOpenedStatus,a),a.oneofs&&(A._chatAssignmentOpenedStatus="chatAssignmentOpenedStatus")),e.pnForLidChatAction!=null&&e.hasOwnProperty("pnForLidChatAction")&&(A.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.toObject(e.pnForLidChatAction,a),a.oneofs&&(A._pnForLidChatAction="pnForLidChatAction")),e.marketingMessageAction!=null&&e.hasOwnProperty("marketingMessageAction")&&(A.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.toObject(e.marketingMessageAction,a),a.oneofs&&(A._marketingMessageAction="marketingMessageAction")),e.marketingMessageBroadcastAction!=null&&e.hasOwnProperty("marketingMessageBroadcastAction")&&(A.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(e.marketingMessageBroadcastAction,a),a.oneofs&&(A._marketingMessageBroadcastAction="marketingMessageBroadcastAction")),e.externalWebBetaAction!=null&&e.hasOwnProperty("externalWebBetaAction")&&(A.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.toObject(e.externalWebBetaAction,a),a.oneofs&&(A._externalWebBetaAction="externalWebBetaAction")),e.privacySettingRelayAllCalls!=null&&e.hasOwnProperty("privacySettingRelayAllCalls")&&(A.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(e.privacySettingRelayAllCalls,a),a.oneofs&&(A._privacySettingRelayAllCalls="privacySettingRelayAllCalls")),e.callLogAction!=null&&e.hasOwnProperty("callLogAction")&&(A.callLogAction=p.proto.SyncActionValue.CallLogAction.toObject(e.callLogAction,a),a.oneofs&&(A._callLogAction="callLogAction")),e.ugcBot!=null&&e.hasOwnProperty("ugcBot")&&(A.ugcBot=p.proto.SyncActionValue.UGCBot.toObject(e.ugcBot,a),a.oneofs&&(A._ugcBot="ugcBot")),e.statusPrivacy!=null&&e.hasOwnProperty("statusPrivacy")&&(A.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.toObject(e.statusPrivacy,a),a.oneofs&&(A._statusPrivacy="statusPrivacy")),e.botWelcomeRequestAction!=null&&e.hasOwnProperty("botWelcomeRequestAction")&&(A.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.toObject(e.botWelcomeRequestAction,a),a.oneofs&&(A._botWelcomeRequestAction="botWelcomeRequestAction")),e.deleteIndividualCallLog!=null&&e.hasOwnProperty("deleteIndividualCallLog")&&(A.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(e.deleteIndividualCallLog,a),a.oneofs&&(A._deleteIndividualCallLog="deleteIndividualCallLog")),e.labelReorderingAction!=null&&e.hasOwnProperty("labelReorderingAction")&&(A.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.toObject(e.labelReorderingAction,a),a.oneofs&&(A._labelReorderingAction="labelReorderingAction")),e.paymentInfoAction!=null&&e.hasOwnProperty("paymentInfoAction")&&(A.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.toObject(e.paymentInfoAction,a),a.oneofs&&(A._paymentInfoAction="paymentInfoAction")),e.customPaymentMethodsAction!=null&&e.hasOwnProperty("customPaymentMethodsAction")&&(A.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(e.customPaymentMethodsAction,a),a.oneofs&&(A._customPaymentMethodsAction="customPaymentMethodsAction")),e.lockChatAction!=null&&e.hasOwnProperty("lockChatAction")&&(A.lockChatAction=p.proto.SyncActionValue.LockChatAction.toObject(e.lockChatAction,a),a.oneofs&&(A._lockChatAction="lockChatAction")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=p.proto.ChatLockSettings.toObject(e.chatLockSettings,a),a.oneofs&&(A._chatLockSettings="chatLockSettings")),e.wamoUserIdentifierAction!=null&&e.hasOwnProperty("wamoUserIdentifierAction")&&(A.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.toObject(e.wamoUserIdentifierAction,a),a.oneofs&&(A._wamoUserIdentifierAction="wamoUserIdentifierAction")),e.privacySettingDisableLinkPreviewsAction!=null&&e.hasOwnProperty("privacySettingDisableLinkPreviewsAction")&&(A.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(e.privacySettingDisableLinkPreviewsAction,a),a.oneofs&&(A._privacySettingDisableLinkPreviewsAction="privacySettingDisableLinkPreviewsAction")),e.deviceCapabilities!=null&&e.hasOwnProperty("deviceCapabilities")&&(A.deviceCapabilities=p.proto.DeviceCapabilities.toObject(e.deviceCapabilities,a),a.oneofs&&(A._deviceCapabilities="deviceCapabilities")),e.noteEditAction!=null&&e.hasOwnProperty("noteEditAction")&&(A.noteEditAction=p.proto.SyncActionValue.NoteEditAction.toObject(e.noteEditAction,a),a.oneofs&&(A._noteEditAction="noteEditAction")),e.favoritesAction!=null&&e.hasOwnProperty("favoritesAction")&&(A.favoritesAction=p.proto.SyncActionValue.FavoritesAction.toObject(e.favoritesAction,a),a.oneofs&&(A._favoritesAction="favoritesAction")),e.merchantPaymentPartnerAction!=null&&e.hasOwnProperty("merchantPaymentPartnerAction")&&(A.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(e.merchantPaymentPartnerAction,a),a.oneofs&&(A._merchantPaymentPartnerAction="merchantPaymentPartnerAction")),e.waffleAccountLinkStateAction!=null&&e.hasOwnProperty("waffleAccountLinkStateAction")&&(A.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(e.waffleAccountLinkStateAction,a),a.oneofs&&(A._waffleAccountLinkStateAction="waffleAccountLinkStateAction")),e.usernameChatStartMode!=null&&e.hasOwnProperty("usernameChatStartMode")&&(A.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.toObject(e.usernameChatStartMode,a),a.oneofs&&(A._usernameChatStartMode="usernameChatStartMode")),e.notificationActivitySettingAction!=null&&e.hasOwnProperty("notificationActivitySettingAction")&&(A.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.toObject(e.notificationActivitySettingAction,a),a.oneofs&&(A._notificationActivitySettingAction="notificationActivitySettingAction")),e.lidContactAction!=null&&e.hasOwnProperty("lidContactAction")&&(A.lidContactAction=p.proto.SyncActionValue.LidContactAction.toObject(e.lidContactAction,a),a.oneofs&&(A._lidContactAction="lidContactAction")),e.ctwaPerCustomerDataSharingAction!=null&&e.hasOwnProperty("ctwaPerCustomerDataSharingAction")&&(A.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(e.ctwaPerCustomerDataSharingAction,a),a.oneofs&&(A._ctwaPerCustomerDataSharingAction="ctwaPerCustomerDataSharingAction")),e.paymentTosAction!=null&&e.hasOwnProperty("paymentTosAction")&&(A.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.toObject(e.paymentTosAction,a),a.oneofs&&(A._paymentTosAction="paymentTosAction")),e.privacySettingChannelsPersonalisedRecommendationAction!=null&&e.hasOwnProperty("privacySettingChannelsPersonalisedRecommendationAction")&&(A.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.toObject(e.privacySettingChannelsPersonalisedRecommendationAction,a),a.oneofs&&(A._privacySettingChannelsPersonalisedRecommendationAction="privacySettingChannelsPersonalisedRecommendationAction")),e.businessBroadcastAssociationAction!=null&&e.hasOwnProperty("businessBroadcastAssociationAction")&&(A.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.toObject(e.businessBroadcastAssociationAction,a),a.oneofs&&(A._businessBroadcastAssociationAction="businessBroadcastAssociationAction")),e.detectedOutcomesStatusAction!=null&&e.hasOwnProperty("detectedOutcomesStatusAction")&&(A.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.toObject(e.detectedOutcomesStatusAction,a),a.oneofs&&(A._detectedOutcomesStatusAction="detectedOutcomesStatusAction")),e.maibaAiFeaturesControlAction!=null&&e.hasOwnProperty("maibaAiFeaturesControlAction")&&(A.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.toObject(e.maibaAiFeaturesControlAction,a),a.oneofs&&(A._maibaAiFeaturesControlAction="maibaAiFeaturesControlAction")),e.businessBroadcastListAction!=null&&e.hasOwnProperty("businessBroadcastListAction")&&(A.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.toObject(e.businessBroadcastListAction,a),a.oneofs&&(A._businessBroadcastListAction="businessBroadcastListAction")),e.musicUserIdAction!=null&&e.hasOwnProperty("musicUserIdAction")&&(A.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.toObject(e.musicUserIdAction,a),a.oneofs&&(A._musicUserIdAction="musicUserIdAction")),e.statusPostOptInNotificationPreferencesAction!=null&&e.hasOwnProperty("statusPostOptInNotificationPreferencesAction")&&(A.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.toObject(e.statusPostOptInNotificationPreferencesAction,a),a.oneofs&&(A._statusPostOptInNotificationPreferencesAction="statusPostOptInNotificationPreferencesAction")),e.avatarUpdatedAction!=null&&e.hasOwnProperty("avatarUpdatedAction")&&(A.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.toObject(e.avatarUpdatedAction,a),a.oneofs&&(A._avatarUpdatedAction="avatarUpdatedAction")),e.privateProcessingSettingAction!=null&&e.hasOwnProperty("privateProcessingSettingAction")&&(A.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.toObject(e.privateProcessingSettingAction,a),a.oneofs&&(A._privateProcessingSettingAction="privateProcessingSettingAction")),e.newsletterSavedInterestsAction!=null&&e.hasOwnProperty("newsletterSavedInterestsAction")&&(A.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.toObject(e.newsletterSavedInterestsAction,a),a.oneofs&&(A._newsletterSavedInterestsAction="newsletterSavedInterestsAction")),e.aiThreadRenameAction!=null&&e.hasOwnProperty("aiThreadRenameAction")&&(A.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.toObject(e.aiThreadRenameAction,a),a.oneofs&&(A._aiThreadRenameAction="aiThreadRenameAction")),e.interactiveMessageAction!=null&&e.hasOwnProperty("interactiveMessageAction")&&(A.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.toObject(e.interactiveMessageAction,a),a.oneofs&&(A._interactiveMessageAction="interactiveMessageAction")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionValue"},t.AgentAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.deviceID=A.int32();break}case 3:{c.isDeleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AgentAction)return A;var r=new p.proto.SyncActionValue.AgentAction;return A.name!=null&&(r.name=String(A.name)),A.deviceID!=null&&(r.deviceID=A.deviceID|0),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.deviceID!=null&&A.hasOwnProperty("deviceID")&&(s.deviceID=A.deviceID,r.oneofs&&(s._deviceID="deviceID")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AgentAction"},i})(),t.AiThreadRenameAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newTitle=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AiThreadRenameAction)return A;var r=new p.proto.SyncActionValue.AiThreadRenameAction;return A.newTitle!=null&&(r.newTitle=String(A.newTitle)),r},i.toObject=function(A,r){r||(r={});var s={};return A.newTitle!=null&&A.hasOwnProperty("newTitle")&&(s.newTitle=A.newTitle,r.oneofs&&(s._newTitle="newTitle")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AiThreadRenameAction"},i})(),t.AndroidUnsupportedActions=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.allowed=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AndroidUnsupportedActions)return A;var r=new p.proto.SyncActionValue.AndroidUnsupportedActions;return A.allowed!=null&&(r.allowed=!!A.allowed),r},i.toObject=function(A,r){r||(r={});var s={};return A.allowed!=null&&A.hasOwnProperty("allowed")&&(s.allowed=A.allowed,r.oneofs&&(s._allowed="allowed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AndroidUnsupportedActions"},i})(),t.ArchiveChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.archived=A.bool();break}case 2:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ArchiveChatAction)return A;var r=new p.proto.SyncActionValue.ArchiveChatAction;if(A.archived!=null&&(r.archived=!!A.archived),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.archived!=null&&A.hasOwnProperty("archived")&&(s.archived=A.archived,r.oneofs&&(s._archived="archived")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ArchiveChatAction"},i})(),t.AvatarUpdatedAction=(function(){function i(a){if(this.recentAvatarStickers=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.eventType=A.int32();break}case 2:{c.recentAvatarStickers&&c.recentAvatarStickers.length||(c.recentAvatarStickers=[]),c.recentAvatarStickers.push(p.proto.SyncActionValue.StickerAction.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AvatarUpdatedAction)return A;var r=new p.proto.SyncActionValue.AvatarUpdatedAction;switch(A.eventType){default:if(typeof A.eventType=="number"){r.eventType=A.eventType;break}break;case"UPDATED":case 0:r.eventType=0;break;case"CREATED":case 1:r.eventType=1;break;case"DELETED":case 2:r.eventType=2;break}if(A.recentAvatarStickers){if(!Array.isArray(A.recentAvatarStickers))throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: array expected");r.recentAvatarStickers=[];for(var s=0;s>>3){case 1:{c.isSent=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BotWelcomeRequestAction)return A;var r=new p.proto.SyncActionValue.BotWelcomeRequestAction;return A.isSent!=null&&(r.isSent=!!A.isSent),r},i.toObject=function(A,r){r||(r={});var s={};return A.isSent!=null&&A.hasOwnProperty("isSent")&&(s.isSent=A.isSent,r.oneofs&&(s._isSent="isSent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BotWelcomeRequestAction"},i})(),t.BroadcastListParticipant=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.lidJid=A.string();break}case 2:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BroadcastListParticipant)return A;var r=new p.proto.SyncActionValue.BroadcastListParticipant;return A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},i.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.lidJid=""),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BroadcastListParticipant"},i})(),t.BusinessBroadcastAssociationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BusinessBroadcastAssociationAction)return A;var r=new p.proto.SyncActionValue.BusinessBroadcastAssociationAction;return A.deleted!=null&&(r.deleted=!!A.deleted),r},i.toObject=function(A,r){r||(r={});var s={};return A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BusinessBroadcastAssociationAction"},i})(),t.BusinessBroadcastListAction=(function(){function i(a){if(this.participants=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deleted=A.bool();break}case 2:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(p.proto.SyncActionValue.BroadcastListParticipant.decode(A,A.uint32()));break}case 3:{c.listName=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BusinessBroadcastListAction)return A;var r=new p.proto.SyncActionValue.BusinessBroadcastListAction;if(A.deleted!=null&&(r.deleted=!!A.deleted),A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{c.callLogRecord=p.proto.CallLogRecord.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.CallLogAction)return A;var r=new p.proto.SyncActionValue.CallLogAction;if(A.callLogRecord!=null){if(typeof A.callLogRecord!="object")throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected");r.callLogRecord=p.proto.CallLogRecord.fromObject(A.callLogRecord)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.callLogRecord!=null&&A.hasOwnProperty("callLogRecord")&&(s.callLogRecord=p.proto.CallLogRecord.toObject(A.callLogRecord,r),r.oneofs&&(s._callLogRecord="callLogRecord")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CallLogAction"},i})(),t.ChatAssignmentAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deviceAgentID=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ChatAssignmentAction)return A;var r=new p.proto.SyncActionValue.ChatAssignmentAction;return A.deviceAgentID!=null&&(r.deviceAgentID=String(A.deviceAgentID)),r},i.toObject=function(A,r){r||(r={});var s={};return A.deviceAgentID!=null&&A.hasOwnProperty("deviceAgentID")&&(s.deviceAgentID=A.deviceAgentID,r.oneofs&&(s._deviceAgentID="deviceAgentID")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentAction"},i})(),t.ChatAssignmentOpenedStatusAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.chatOpened=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction)return A;var r=new p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction;return A.chatOpened!=null&&(r.chatOpened=!!A.chatOpened),r},i.toObject=function(A,r){r||(r={});var s={};return A.chatOpened!=null&&A.hasOwnProperty("chatOpened")&&(s.chatOpened=A.chatOpened,r.oneofs&&(s._chatOpened="chatOpened")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentOpenedStatusAction"},i})(),t.ClearChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ClearChatAction)return A;var r=new p.proto.SyncActionValue.ClearChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ClearChatAction"},i})(),t.ContactAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.lidJid=A.string();break}case 4:{c.saveOnPrimaryAddressbook=A.bool();break}case 5:{c.pnJid=A.string();break}case 6:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ContactAction)return A;var r=new p.proto.SyncActionValue.ContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.saveOnPrimaryAddressbook!=null&&(r.saveOnPrimaryAddressbook=!!A.saveOnPrimaryAddressbook),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),A.username!=null&&(r.username=String(A.username)),r},i.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid,r.oneofs&&(s._lidJid="lidJid")),A.saveOnPrimaryAddressbook!=null&&A.hasOwnProperty("saveOnPrimaryAddressbook")&&(s.saveOnPrimaryAddressbook=A.saveOnPrimaryAddressbook,r.oneofs&&(s._saveOnPrimaryAddressbook="saveOnPrimaryAddressbook")),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ContactAction"},i})(),t.CtwaPerCustomerDataSharingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isCtwaPerCustomerDataSharingEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction)return A;var r=new p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction;return A.isCtwaPerCustomerDataSharingEnabled!=null&&(r.isCtwaPerCustomerDataSharingEnabled=!!A.isCtwaPerCustomerDataSharingEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isCtwaPerCustomerDataSharingEnabled!=null&&A.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")&&(s.isCtwaPerCustomerDataSharingEnabled=A.isCtwaPerCustomerDataSharingEnabled,r.oneofs&&(s._isCtwaPerCustomerDataSharingEnabled="isCtwaPerCustomerDataSharingEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CtwaPerCustomerDataSharingAction"},i})(),t.CustomPaymentMethod=(function(){function i(e){if(this.metadata=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.credentialId=a.string();break}case 2:{g.country=a.string();break}case 3:{g.type=a.string();break}case 4:{g.metadata&&g.metadata.length||(g.metadata=[]),g.metadata.push(p.proto.SyncActionValue.CustomPaymentMethodMetadata.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethod)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethod;if(a.credentialId!=null&&(A.credentialId=String(a.credentialId)),a.country!=null&&(A.country=String(a.country)),a.type!=null&&(A.type=String(a.type)),a.metadata){if(!Array.isArray(a.metadata))throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected");A.metadata=[];for(var r=0;r>>3){case 1:{g.key=a.string();break}case 2:{g.value=a.string();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethodMetadata)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethodMetadata;return a.key!=null&&(A.key=String(a.key)),a.value!=null&&(A.value=String(a.value)),A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.key="",r.value=""),a.key!=null&&a.hasOwnProperty("key")&&(r.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(r.value=a.value),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.CustomPaymentMethodMetadata"},i})(),t.CustomPaymentMethodsAction=(function(){function i(e){if(this.customPaymentMethods=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.customPaymentMethods&&g.customPaymentMethods.length||(g.customPaymentMethods=[]),g.customPaymentMethods.push(p.proto.SyncActionValue.CustomPaymentMethod.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethodsAction)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethodsAction;if(a.customPaymentMethods){if(!Array.isArray(a.customPaymentMethods))throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected");A.customPaymentMethods=[];for(var r=0;r>>3){case 1:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteChatAction)return A;var r=new p.proto.SyncActionValue.DeleteChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteChatAction"},i})(),t.DeleteIndividualCallLogAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.peerJid=A.string();break}case 2:{c.isIncoming=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteIndividualCallLogAction)return A;var r=new p.proto.SyncActionValue.DeleteIndividualCallLogAction;return A.peerJid!=null&&(r.peerJid=String(A.peerJid)),A.isIncoming!=null&&(r.isIncoming=!!A.isIncoming),r},i.toObject=function(A,r){r||(r={});var s={};return A.peerJid!=null&&A.hasOwnProperty("peerJid")&&(s.peerJid=A.peerJid,r.oneofs&&(s._peerJid="peerJid")),A.isIncoming!=null&&A.hasOwnProperty("isIncoming")&&(s.isIncoming=A.isIncoming,r.oneofs&&(s._isIncoming="isIncoming")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteIndividualCallLogAction"},i})(),t.DeleteMessageForMeAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deleteMedia=A.bool();break}case 2:{c.messageTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteMessageForMeAction)return A;var r=new p.proto.SyncActionValue.DeleteMessageForMeAction;return A.deleteMedia!=null&&(r.deleteMedia=!!A.deleteMedia),A.messageTimestamp!=null&&(l.Long?(r.messageTimestamp=l.Long.fromValue(A.messageTimestamp)).unsigned=!1:typeof A.messageTimestamp=="string"?r.messageTimestamp=parseInt(A.messageTimestamp,10):typeof A.messageTimestamp=="number"?r.messageTimestamp=A.messageTimestamp:typeof A.messageTimestamp=="object"&&(r.messageTimestamp=new l.LongBits(A.messageTimestamp.low>>>0,A.messageTimestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.deleteMedia!=null&&A.hasOwnProperty("deleteMedia")&&(s.deleteMedia=A.deleteMedia,r.oneofs&&(s._deleteMedia="deleteMedia")),A.messageTimestamp!=null&&A.hasOwnProperty("messageTimestamp")&&(typeof A.messageTimestamp=="number"?s.messageTimestamp=r.longs===String?String(A.messageTimestamp):A.messageTimestamp:s.messageTimestamp=r.longs===String?ge(A.messageTimestamp):r.longs===Number?ce(A.messageTimestamp):A.messageTimestamp,r.oneofs&&(s._messageTimestamp="messageTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteMessageForMeAction"},i})(),t.DetectedOutcomesStatusAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DetectedOutcomesStatusAction)return A;var r=new p.proto.SyncActionValue.DetectedOutcomesStatusAction;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DetectedOutcomesStatusAction"},i})(),t.ExternalWebBetaAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isOptIn=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ExternalWebBetaAction)return A;var r=new p.proto.SyncActionValue.ExternalWebBetaAction;return A.isOptIn!=null&&(r.isOptIn=!!A.isOptIn),r},i.toObject=function(A,r){r||(r={});var s={};return A.isOptIn!=null&&A.hasOwnProperty("isOptIn")&&(s.isOptIn=A.isOptIn,r.oneofs&&(s._isOptIn="isOptIn")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ExternalWebBetaAction"},i})(),t.FavoritesAction=(function(){function i(e){if(this.favorites=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.favorites&&g.favorites.length||(g.favorites=[]),g.favorites.push(p.proto.SyncActionValue.FavoritesAction.Favorite.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.FavoritesAction)return a;var A=new p.proto.SyncActionValue.FavoritesAction;if(a.favorites){if(!Array.isArray(a.favorites))throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected");A.favorites=[];for(var r=0;r>>3){case 1:{I.id=r.string();break}default:r.skipType(d&7);break}}return I},e.fromObject=function(r){if(r instanceof p.proto.SyncActionValue.FavoritesAction.Favorite)return r;var s=new p.proto.SyncActionValue.FavoritesAction.Favorite;return r.id!=null&&(s.id=String(r.id)),s},e.toObject=function(r,s){s||(s={});var g={};return r.id!=null&&r.hasOwnProperty("id")&&(g.id=r.id,s.oneofs&&(g._id="id")),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},e.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/proto.SyncActionValue.FavoritesAction.Favorite"},e})(),i})(),t.InteractiveMessageAction=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.type=a.int32();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.InteractiveMessageAction)return a;var A=new p.proto.SyncActionValue.InteractiveMessageAction;switch(a.type){default:if(typeof a.type=="number"){A.type=a.type;break}break;case"DISABLE_CTA":case 1:A.type=1;break}return A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.type=A.enums===String?"DISABLE_CTA":1),a.type!=null&&a.hasOwnProperty("type")&&(r.type=A.enums===String?p.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[a.type]===void 0?a.type:p.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[a.type]:a.type),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.InteractiveMessageAction"},i.InteractiveMessageActionMode=(function(){let e={},a=Object.create(e);return a[e[1]="DISABLE_CTA"]=1,a})(),i})(),t.KeyExpiration=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.expiredKeyEpoch=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.KeyExpiration)return A;var r=new p.proto.SyncActionValue.KeyExpiration;return A.expiredKeyEpoch!=null&&(r.expiredKeyEpoch=A.expiredKeyEpoch|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.expiredKeyEpoch!=null&&A.hasOwnProperty("expiredKeyEpoch")&&(s.expiredKeyEpoch=A.expiredKeyEpoch,r.oneofs&&(s._expiredKeyEpoch="expiredKeyEpoch")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.KeyExpiration"},i})(),t.LabelAssociationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.labeled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LabelAssociationAction)return A;var r=new p.proto.SyncActionValue.LabelAssociationAction;return A.labeled!=null&&(r.labeled=!!A.labeled),r},i.toObject=function(A,r){r||(r={});var s={};return A.labeled!=null&&A.hasOwnProperty("labeled")&&(s.labeled=A.labeled,r.oneofs&&(s._labeled="labeled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelAssociationAction"},i})(),t.LabelEditAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.color=A.int32();break}case 3:{c.predefinedId=A.int32();break}case 4:{c.deleted=A.bool();break}case 5:{c.orderIndex=A.int32();break}case 6:{c.isActive=A.bool();break}case 7:{c.type=A.int32();break}case 8:{c.isImmutable=A.bool();break}case 9:{c.muteEndTimeMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LabelEditAction)return A;var r=new p.proto.SyncActionValue.LabelEditAction;switch(A.name!=null&&(r.name=String(A.name)),A.color!=null&&(r.color=A.color|0),A.predefinedId!=null&&(r.predefinedId=A.predefinedId|0),A.deleted!=null&&(r.deleted=!!A.deleted),A.orderIndex!=null&&(r.orderIndex=A.orderIndex|0),A.isActive!=null&&(r.isActive=!!A.isActive),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"NONE":case 0:r.type=0;break;case"UNREAD":case 1:r.type=1;break;case"GROUPS":case 2:r.type=2;break;case"FAVORITES":case 3:r.type=3;break;case"PREDEFINED":case 4:r.type=4;break;case"CUSTOM":case 5:r.type=5;break;case"COMMUNITY":case 6:r.type=6;break;case"SERVER_ASSIGNED":case 7:r.type=7;break;case"DRAFTED":case 8:r.type=8;break;case"AI_HANDOFF":case 9:r.type=9;break}return A.isImmutable!=null&&(r.isImmutable=!!A.isImmutable),A.muteEndTimeMs!=null&&(l.Long?(r.muteEndTimeMs=l.Long.fromValue(A.muteEndTimeMs)).unsigned=!1:typeof A.muteEndTimeMs=="string"?r.muteEndTimeMs=parseInt(A.muteEndTimeMs,10):typeof A.muteEndTimeMs=="number"?r.muteEndTimeMs=A.muteEndTimeMs:typeof A.muteEndTimeMs=="object"&&(r.muteEndTimeMs=new l.LongBits(A.muteEndTimeMs.low>>>0,A.muteEndTimeMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.color!=null&&A.hasOwnProperty("color")&&(s.color=A.color,r.oneofs&&(s._color="color")),A.predefinedId!=null&&A.hasOwnProperty("predefinedId")&&(s.predefinedId=A.predefinedId,r.oneofs&&(s._predefinedId="predefinedId")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.orderIndex!=null&&A.hasOwnProperty("orderIndex")&&(s.orderIndex=A.orderIndex,r.oneofs&&(s._orderIndex="orderIndex")),A.isActive!=null&&A.hasOwnProperty("isActive")&&(s.isActive=A.isActive,r.oneofs&&(s._isActive="isActive")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.SyncActionValue.LabelEditAction.ListType[A.type]===void 0?A.type:p.proto.SyncActionValue.LabelEditAction.ListType[A.type]:A.type,r.oneofs&&(s._type="type")),A.isImmutable!=null&&A.hasOwnProperty("isImmutable")&&(s.isImmutable=A.isImmutable,r.oneofs&&(s._isImmutable="isImmutable")),A.muteEndTimeMs!=null&&A.hasOwnProperty("muteEndTimeMs")&&(typeof A.muteEndTimeMs=="number"?s.muteEndTimeMs=r.longs===String?String(A.muteEndTimeMs):A.muteEndTimeMs:s.muteEndTimeMs=r.longs===String?ge(A.muteEndTimeMs):r.longs===Number?ce(A.muteEndTimeMs):A.muteEndTimeMs,r.oneofs&&(s._muteEndTimeMs="muteEndTimeMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelEditAction"},i.ListType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="UNREAD"]=1,A[a[2]="GROUPS"]=2,A[a[3]="FAVORITES"]=3,A[a[4]="PREDEFINED"]=4,A[a[5]="CUSTOM"]=5,A[a[6]="COMMUNITY"]=6,A[a[7]="SERVER_ASSIGNED"]=7,A[a[8]="DRAFTED"]=8,A[a[9]="AI_HANDOFF"]=9,A})(),i})(),t.LabelReorderingAction=(function(){function i(e){if(this.sortedLabelIds=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{if(g.sortedLabelIds&&g.sortedLabelIds.length||(g.sortedLabelIds=[]),(c&7)===2)for(var I=a.uint32()+a.pos;a.pos>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LidContactAction)return A;var r=new p.proto.SyncActionValue.LidContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.username!=null&&(r.username=String(A.username)),r},i.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LidContactAction"},i})(),t.LocaleSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.locale=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LocaleSetting)return A;var r=new p.proto.SyncActionValue.LocaleSetting;return A.locale!=null&&(r.locale=String(A.locale)),r},i.toObject=function(A,r){r||(r={});var s={};return A.locale!=null&&A.hasOwnProperty("locale")&&(s.locale=A.locale,r.oneofs&&(s._locale="locale")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LocaleSetting"},i})(),t.LockChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.locked=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LockChatAction)return A;var r=new p.proto.SyncActionValue.LockChatAction;return A.locked!=null&&(r.locked=!!A.locked),r},i.toObject=function(A,r){r||(r={});var s={};return A.locked!=null&&A.hasOwnProperty("locked")&&(s.locked=A.locked,r.oneofs&&(s._locked="locked")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LockChatAction"},i})(),t.MaibaAIFeaturesControlAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.aiFeatureStatus=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MaibaAIFeaturesControlAction)return A;var r=new p.proto.SyncActionValue.MaibaAIFeaturesControlAction;switch(A.aiFeatureStatus){default:if(typeof A.aiFeatureStatus=="number"){r.aiFeatureStatus=A.aiFeatureStatus;break}break;case"ENABLED":case 0:r.aiFeatureStatus=0;break;case"ENABLED_HAS_LEARNING":case 1:r.aiFeatureStatus=1;break;case"DISABLED":case 2:r.aiFeatureStatus=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.aiFeatureStatus!=null&&A.hasOwnProperty("aiFeatureStatus")&&(s.aiFeatureStatus=r.enums===String?p.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]===void 0?A.aiFeatureStatus:p.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]:A.aiFeatureStatus,r.oneofs&&(s._aiFeatureStatus="aiFeatureStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MaibaAIFeaturesControlAction"},i.MaibaAIFeatureStatus=(function(){let a={},A=Object.create(a);return A[a[0]="ENABLED"]=0,A[a[1]="ENABLED_HAS_LEARNING"]=1,A[a[2]="DISABLED"]=2,A})(),i})(),t.MarkChatAsReadAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.read=A.bool();break}case 2:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarkChatAsReadAction)return A;var r=new p.proto.SyncActionValue.MarkChatAsReadAction;if(A.read!=null&&(r.read=!!A.read),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.read!=null&&A.hasOwnProperty("read")&&(s.read=A.read,r.oneofs&&(s._read="read")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarkChatAsReadAction"},i})(),t.MarketingMessageAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.message=A.string();break}case 3:{c.type=A.int32();break}case 4:{c.createdAt=A.int64();break}case 5:{c.lastSentAt=A.int64();break}case 6:{c.isDeleted=A.bool();break}case 7:{c.mediaId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarketingMessageAction)return A;var r=new p.proto.SyncActionValue.MarketingMessageAction;switch(A.name!=null&&(r.name=String(A.name)),A.message!=null&&(r.message=String(A.message)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PERSONALIZED":case 0:r.type=0;break}return A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.lastSentAt!=null&&(l.Long?(r.lastSentAt=l.Long.fromValue(A.lastSentAt)).unsigned=!1:typeof A.lastSentAt=="string"?r.lastSentAt=parseInt(A.lastSentAt,10):typeof A.lastSentAt=="number"?r.lastSentAt=A.lastSentAt:typeof A.lastSentAt=="object"&&(r.lastSentAt=new l.LongBits(A.lastSentAt.low>>>0,A.lastSentAt.high>>>0).toNumber())),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),A.mediaId!=null&&(r.mediaId=String(A.mediaId)),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]===void 0?A.type:p.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]:A.type,r.oneofs&&(s._type="type")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.lastSentAt!=null&&A.hasOwnProperty("lastSentAt")&&(typeof A.lastSentAt=="number"?s.lastSentAt=r.longs===String?String(A.lastSentAt):A.lastSentAt:s.lastSentAt=r.longs===String?ge(A.lastSentAt):r.longs===Number?ce(A.lastSentAt):A.lastSentAt,r.oneofs&&(s._lastSentAt="lastSentAt")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),A.mediaId!=null&&A.hasOwnProperty("mediaId")&&(s.mediaId=A.mediaId,r.oneofs&&(s._mediaId="mediaId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageAction"},i.MarketingMessagePrototypeType=(function(){let a={},A=Object.create(a);return A[a[0]="PERSONALIZED"]=0,A})(),i})(),t.MarketingMessageBroadcastAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.repliedCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarketingMessageBroadcastAction)return A;var r=new p.proto.SyncActionValue.MarketingMessageBroadcastAction;return A.repliedCount!=null&&(r.repliedCount=A.repliedCount|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.repliedCount!=null&&A.hasOwnProperty("repliedCount")&&(s.repliedCount=A.repliedCount,r.oneofs&&(s._repliedCount="repliedCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageBroadcastAction"},i})(),t.MerchantPaymentPartnerAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.country=A.string();break}case 3:{c.gatewayName=A.string();break}case 4:{c.credentialId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MerchantPaymentPartnerAction)return A;var r=new p.proto.SyncActionValue.MerchantPaymentPartnerAction;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"ACTIVE":case 0:r.status=0;break;case"INACTIVE":case 1:r.status=1;break}return A.country!=null&&(r.country=String(A.country)),A.gatewayName!=null&&(r.gatewayName=String(A.gatewayName)),A.credentialId!=null&&(r.credentialId=String(A.credentialId)),r},i.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.status=r.enums===String?"ACTIVE":0,s.country=""),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?p.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]===void 0?A.status:p.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]:A.status),A.country!=null&&A.hasOwnProperty("country")&&(s.country=A.country),A.gatewayName!=null&&A.hasOwnProperty("gatewayName")&&(s.gatewayName=A.gatewayName,r.oneofs&&(s._gatewayName="gatewayName")),A.credentialId!=null&&A.hasOwnProperty("credentialId")&&(s.credentialId=A.credentialId,r.oneofs&&(s._credentialId="credentialId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MerchantPaymentPartnerAction"},i.Status=(function(){let a={},A=Object.create(a);return A[a[0]="ACTIVE"]=0,A[a[1]="INACTIVE"]=1,A})(),i})(),t.MusicUserIdAction=(function(){function i(a){if(this.musicUserIdMap={},a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.musicUserId=A.string();break}case 2:{c.musicUserIdMap===l.emptyObject&&(c.musicUserIdMap={});var f=A.uint32()+A.pos;for(I="",d="";A.pos>>3){case 1:I=A.string();break;case 2:d=A.string();break;default:A.skipType(Q&7);break}}c.musicUserIdMap[I]=d;break}default:A.skipType(B&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MusicUserIdAction)return A;var r=new p.proto.SyncActionValue.MusicUserIdAction;if(A.musicUserId!=null&&(r.musicUserId=String(A.musicUserId)),A.musicUserIdMap){if(typeof A.musicUserIdMap!="object")throw TypeError(".proto.SyncActionValue.MusicUserIdAction.musicUserIdMap: object expected");r.musicUserIdMap={};for(var s=Object.keys(A.musicUserIdMap),g=0;g>>3){case 1:{c.muted=A.bool();break}case 2:{c.muteEndTimestamp=A.int64();break}case 3:{c.autoMuted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MuteAction)return A;var r=new p.proto.SyncActionValue.MuteAction;return A.muted!=null&&(r.muted=!!A.muted),A.muteEndTimestamp!=null&&(l.Long?(r.muteEndTimestamp=l.Long.fromValue(A.muteEndTimestamp)).unsigned=!1:typeof A.muteEndTimestamp=="string"?r.muteEndTimestamp=parseInt(A.muteEndTimestamp,10):typeof A.muteEndTimestamp=="number"?r.muteEndTimestamp=A.muteEndTimestamp:typeof A.muteEndTimestamp=="object"&&(r.muteEndTimestamp=new l.LongBits(A.muteEndTimestamp.low>>>0,A.muteEndTimestamp.high>>>0).toNumber())),A.autoMuted!=null&&(r.autoMuted=!!A.autoMuted),r},i.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),A.muteEndTimestamp!=null&&A.hasOwnProperty("muteEndTimestamp")&&(typeof A.muteEndTimestamp=="number"?s.muteEndTimestamp=r.longs===String?String(A.muteEndTimestamp):A.muteEndTimestamp:s.muteEndTimestamp=r.longs===String?ge(A.muteEndTimestamp):r.longs===Number?ce(A.muteEndTimestamp):A.muteEndTimestamp,r.oneofs&&(s._muteEndTimestamp="muteEndTimestamp")),A.autoMuted!=null&&A.hasOwnProperty("autoMuted")&&(s.autoMuted=A.autoMuted,r.oneofs&&(s._autoMuted="autoMuted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MuteAction"},i})(),t.NewsletterSavedInterestsAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterSavedInterests=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NewsletterSavedInterestsAction)return A;var r=new p.proto.SyncActionValue.NewsletterSavedInterestsAction;return A.newsletterSavedInterests!=null&&(r.newsletterSavedInterests=String(A.newsletterSavedInterests)),r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterSavedInterests!=null&&A.hasOwnProperty("newsletterSavedInterests")&&(s.newsletterSavedInterests=A.newsletterSavedInterests,r.oneofs&&(s._newsletterSavedInterests="newsletterSavedInterests")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NewsletterSavedInterestsAction"},i})(),t.NoteEditAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.chatJid=A.string();break}case 3:{c.createdAt=A.int64();break}case 4:{c.deleted=A.bool();break}case 5:{c.unstructuredContent=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NoteEditAction)return A;var r=new p.proto.SyncActionValue.NoteEditAction;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNSTRUCTURED":case 1:r.type=1;break;case"STRUCTURED":case 2:r.type=2;break}return A.chatJid!=null&&(r.chatJid=String(A.chatJid)),A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.deleted!=null&&(r.deleted=!!A.deleted),A.unstructuredContent!=null&&(r.unstructuredContent=String(A.unstructuredContent)),r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.SyncActionValue.NoteEditAction.NoteType[A.type]===void 0?A.type:p.proto.SyncActionValue.NoteEditAction.NoteType[A.type]:A.type,r.oneofs&&(s._type="type")),A.chatJid!=null&&A.hasOwnProperty("chatJid")&&(s.chatJid=A.chatJid,r.oneofs&&(s._chatJid="chatJid")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.unstructuredContent!=null&&A.hasOwnProperty("unstructuredContent")&&(s.unstructuredContent=A.unstructuredContent,r.oneofs&&(s._unstructuredContent="unstructuredContent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NoteEditAction"},i.NoteType=(function(){let a={},A=Object.create(a);return A[a[1]="UNSTRUCTURED"]=1,A[a[2]="STRUCTURED"]=2,A})(),i})(),t.NotificationActivitySettingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.notificationActivitySetting=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NotificationActivitySettingAction)return A;var r=new p.proto.SyncActionValue.NotificationActivitySettingAction;switch(A.notificationActivitySetting){default:if(typeof A.notificationActivitySetting=="number"){r.notificationActivitySetting=A.notificationActivitySetting;break}break;case"DEFAULT_ALL_MESSAGES":case 0:r.notificationActivitySetting=0;break;case"ALL_MESSAGES":case 1:r.notificationActivitySetting=1;break;case"HIGHLIGHTS":case 2:r.notificationActivitySetting=2;break;case"DEFAULT_HIGHLIGHTS":case 3:r.notificationActivitySetting=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.notificationActivitySetting!=null&&A.hasOwnProperty("notificationActivitySetting")&&(s.notificationActivitySetting=r.enums===String?p.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]===void 0?A.notificationActivitySetting:p.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]:A.notificationActivitySetting,r.oneofs&&(s._notificationActivitySetting="notificationActivitySetting")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NotificationActivitySettingAction"},i.NotificationActivitySetting=(function(){let a={},A=Object.create(a);return A[a[0]="DEFAULT_ALL_MESSAGES"]=0,A[a[1]="ALL_MESSAGES"]=1,A[a[2]="HIGHLIGHTS"]=2,A[a[3]="DEFAULT_HIGHLIGHTS"]=3,A})(),i})(),t.NuxAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.acknowledged=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NuxAction)return A;var r=new p.proto.SyncActionValue.NuxAction;return A.acknowledged!=null&&(r.acknowledged=!!A.acknowledged),r},i.toObject=function(A,r){r||(r={});var s={};return A.acknowledged!=null&&A.hasOwnProperty("acknowledged")&&(s.acknowledged=A.acknowledged,r.oneofs&&(s._acknowledged="acknowledged")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NuxAction"},i})(),t.PaymentInfoAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.cpi=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PaymentInfoAction)return A;var r=new p.proto.SyncActionValue.PaymentInfoAction;return A.cpi!=null&&(r.cpi=String(A.cpi)),r},i.toObject=function(A,r){r||(r={});var s={};return A.cpi!=null&&A.hasOwnProperty("cpi")&&(s.cpi=A.cpi,r.oneofs&&(s._cpi="cpi")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PaymentInfoAction"},i})(),t.PaymentTosAction=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.paymentNotice=a.int32();break}case 2:{g.accepted=a.bool();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.PaymentTosAction)return a;var A=new p.proto.SyncActionValue.PaymentTosAction;switch(a.paymentNotice){default:if(typeof a.paymentNotice=="number"){A.paymentNotice=a.paymentNotice;break}break;case"BR_PAY_PRIVACY_POLICY":case 0:A.paymentNotice=0;break}return a.accepted!=null&&(A.accepted=!!a.accepted),A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.paymentNotice=A.enums===String?"BR_PAY_PRIVACY_POLICY":0,r.accepted=!1),a.paymentNotice!=null&&a.hasOwnProperty("paymentNotice")&&(r.paymentNotice=A.enums===String?p.proto.SyncActionValue.PaymentTosAction.PaymentNotice[a.paymentNotice]===void 0?a.paymentNotice:p.proto.SyncActionValue.PaymentTosAction.PaymentNotice[a.paymentNotice]:a.paymentNotice),a.accepted!=null&&a.hasOwnProperty("accepted")&&(r.accepted=a.accepted),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.PaymentTosAction"},i.PaymentNotice=(function(){let e={},a=Object.create(e);return a[e[0]="BR_PAY_PRIVACY_POLICY"]=0,a})(),i})(),t.PinAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.pinned=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PinAction)return A;var r=new p.proto.SyncActionValue.PinAction;return A.pinned!=null&&(r.pinned=!!A.pinned),r},i.toObject=function(A,r){r||(r={});var s={};return A.pinned!=null&&A.hasOwnProperty("pinned")&&(s.pinned=A.pinned,r.oneofs&&(s._pinned="pinned")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PinAction"},i})(),t.PnForLidChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PnForLidChatAction)return A;var r=new p.proto.SyncActionValue.PnForLidChatAction;return A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},i.toObject=function(A,r){r||(r={});var s={};return A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PnForLidChatAction"},i})(),t.PrimaryFeature=(function(){function i(e){if(this.flags=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.flags&&g.flags.length||(g.flags=[]),g.flags.push(a.string());break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.PrimaryFeature)return a;var A=new p.proto.SyncActionValue.PrimaryFeature;if(a.flags){if(!Array.isArray(a.flags))throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected");A.flags=[];for(var r=0;r>>3){case 1:{c.version=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrimaryVersionAction)return A;var r=new p.proto.SyncActionValue.PrimaryVersionAction;return A.version!=null&&(r.version=String(A.version)),r},i.toObject=function(A,r){r||(r={});var s={};return A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrimaryVersionAction"},i})(),t.PrivacySettingChannelsPersonalisedRecommendationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isUserOptedOut=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction)return A;var r=new p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction;return A.isUserOptedOut!=null&&(r.isUserOptedOut=!!A.isUserOptedOut),r},i.toObject=function(A,r){r||(r={});var s={};return A.isUserOptedOut!=null&&A.hasOwnProperty("isUserOptedOut")&&(s.isUserOptedOut=A.isUserOptedOut,r.oneofs&&(s._isUserOptedOut="isUserOptedOut")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction"},i})(),t.PrivacySettingDisableLinkPreviewsAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isPreviewsDisabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction)return A;var r=new p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction;return A.isPreviewsDisabled!=null&&(r.isPreviewsDisabled=!!A.isPreviewsDisabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isPreviewsDisabled!=null&&A.hasOwnProperty("isPreviewsDisabled")&&(s.isPreviewsDisabled=A.isPreviewsDisabled,r.oneofs&&(s._isPreviewsDisabled="isPreviewsDisabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction"},i})(),t.PrivacySettingRelayAllCalls=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingRelayAllCalls)return A;var r=new p.proto.SyncActionValue.PrivacySettingRelayAllCalls;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingRelayAllCalls"},i})(),t.PrivateProcessingSettingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.privateProcessingStatus=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivateProcessingSettingAction)return A;var r=new p.proto.SyncActionValue.PrivateProcessingSettingAction;switch(A.privateProcessingStatus){default:if(typeof A.privateProcessingStatus=="number"){r.privateProcessingStatus=A.privateProcessingStatus;break}break;case"UNDEFINED":case 0:r.privateProcessingStatus=0;break;case"ENABLED":case 1:r.privateProcessingStatus=1;break;case"DISABLED":case 2:r.privateProcessingStatus=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.privateProcessingStatus!=null&&A.hasOwnProperty("privateProcessingStatus")&&(s.privateProcessingStatus=r.enums===String?p.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]===void 0?A.privateProcessingStatus:p.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]:A.privateProcessingStatus,r.oneofs&&(s._privateProcessingStatus="privateProcessingStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivateProcessingSettingAction"},i.PrivateProcessingStatus=(function(){let a={},A=Object.create(a);return A[a[0]="UNDEFINED"]=0,A[a[1]="ENABLED"]=1,A[a[2]="DISABLED"]=2,A})(),i})(),t.PushNameSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PushNameSetting)return A;var r=new p.proto.SyncActionValue.PushNameSetting;return A.name!=null&&(r.name=String(A.name)),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PushNameSetting"},i})(),t.QuickReplyAction=(function(){function i(a){if(this.keywords=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.shortcut=A.string();break}case 2:{c.message=A.string();break}case 3:{c.keywords&&c.keywords.length||(c.keywords=[]),c.keywords.push(A.string());break}case 4:{c.count=A.int32();break}case 5:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.QuickReplyAction)return A;var r=new p.proto.SyncActionValue.QuickReplyAction;if(A.shortcut!=null&&(r.shortcut=String(A.shortcut)),A.message!=null&&(r.message=String(A.message)),A.keywords){if(!Array.isArray(A.keywords))throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected");r.keywords=[];for(var s=0;s>>3){case 1:{g.weights&&g.weights.length||(g.weights=[]),g.weights.push(p.proto.RecentEmojiWeight.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.RecentEmojiWeightsAction)return a;var A=new p.proto.SyncActionValue.RecentEmojiWeightsAction;if(a.weights){if(!Array.isArray(a.weights))throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected");A.weights=[];for(var r=0;r>>3){case 1:{c.lastStickerSentTs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.RemoveRecentStickerAction)return A;var r=new p.proto.SyncActionValue.RemoveRecentStickerAction;return A.lastStickerSentTs!=null&&(l.Long?(r.lastStickerSentTs=l.Long.fromValue(A.lastStickerSentTs)).unsigned=!1:typeof A.lastStickerSentTs=="string"?r.lastStickerSentTs=parseInt(A.lastStickerSentTs,10):typeof A.lastStickerSentTs=="number"?r.lastStickerSentTs=A.lastStickerSentTs:typeof A.lastStickerSentTs=="object"&&(r.lastStickerSentTs=new l.LongBits(A.lastStickerSentTs.low>>>0,A.lastStickerSentTs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.lastStickerSentTs!=null&&A.hasOwnProperty("lastStickerSentTs")&&(typeof A.lastStickerSentTs=="number"?s.lastStickerSentTs=r.longs===String?String(A.lastStickerSentTs):A.lastStickerSentTs:s.lastStickerSentTs=r.longs===String?ge(A.lastStickerSentTs):r.longs===Number?ce(A.lastStickerSentTs):A.lastStickerSentTs,r.oneofs&&(s._lastStickerSentTs="lastStickerSentTs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.RemoveRecentStickerAction"},i})(),t.StarAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.starred=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StarAction)return A;var r=new p.proto.SyncActionValue.StarAction;return A.starred!=null&&(r.starred=!!A.starred),r},i.toObject=function(A,r){r||(r={});var s={};return A.starred!=null&&A.hasOwnProperty("starred")&&(s.starred=A.starred,r.oneofs&&(s._starred="starred")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StarAction"},i})(),t.StatusPostOptInNotificationPreferencesAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.enabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction)return A;var r=new p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction;return A.enabled!=null&&(r.enabled=!!A.enabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.enabled!=null&&A.hasOwnProperty("enabled")&&(s.enabled=A.enabled,r.oneofs&&(s._enabled="enabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction"},i})(),t.StatusPrivacyAction=(function(){function i(a){if(this.userJid=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.mode=A.int32();break}case 2:{c.userJid&&c.userJid.length||(c.userJid=[]),c.userJid.push(A.string());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StatusPrivacyAction)return A;var r=new p.proto.SyncActionValue.StatusPrivacyAction;switch(A.mode){default:if(typeof A.mode=="number"){r.mode=A.mode;break}break;case"ALLOW_LIST":case 0:r.mode=0;break;case"DENY_LIST":case 1:r.mode=1;break;case"CONTACTS":case 2:r.mode=2;break;case"CLOSE_FRIENDS":case 3:r.mode=3;break}if(A.userJid){if(!Array.isArray(A.userJid))throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected");r.userJid=[];for(var s=0;s>>3){case 1:{c.url=A.string();break}case 2:{c.fileEncSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.mimetype=A.string();break}case 5:{c.height=A.uint32();break}case 6:{c.width=A.uint32();break}case 7:{c.directPath=A.string();break}case 8:{c.fileLength=A.uint64();break}case 9:{c.isFavorite=A.bool();break}case 10:{c.deviceIdHint=A.uint32();break}case 11:{c.isLottie=A.bool();break}case 12:{c.imageHash=A.string();break}case 13:{c.isAvatarSticker=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StickerAction)return A;var r=new p.proto.SyncActionValue.StickerAction;return A.url!=null&&(r.url=String(A.url)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.isFavorite!=null&&(r.isFavorite=!!A.isFavorite),A.deviceIdHint!=null&&(r.deviceIdHint=A.deviceIdHint>>>0),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.imageHash!=null&&(r.imageHash=String(A.imageHash)),A.isAvatarSticker!=null&&(r.isAvatarSticker=!!A.isAvatarSticker),r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.isFavorite!=null&&A.hasOwnProperty("isFavorite")&&(s.isFavorite=A.isFavorite,r.oneofs&&(s._isFavorite="isFavorite")),A.deviceIdHint!=null&&A.hasOwnProperty("deviceIdHint")&&(s.deviceIdHint=A.deviceIdHint,r.oneofs&&(s._deviceIdHint="deviceIdHint")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.imageHash!=null&&A.hasOwnProperty("imageHash")&&(s.imageHash=A.imageHash,r.oneofs&&(s._imageHash="imageHash")),A.isAvatarSticker!=null&&A.hasOwnProperty("isAvatarSticker")&&(s.isAvatarSticker=A.isAvatarSticker,r.oneofs&&(s._isAvatarSticker="isAvatarSticker")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StickerAction"},i})(),t.SubscriptionAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isDeactivated=A.bool();break}case 2:{c.isAutoRenewing=A.bool();break}case 3:{c.expirationDate=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SubscriptionAction)return A;var r=new p.proto.SyncActionValue.SubscriptionAction;return A.isDeactivated!=null&&(r.isDeactivated=!!A.isDeactivated),A.isAutoRenewing!=null&&(r.isAutoRenewing=!!A.isAutoRenewing),A.expirationDate!=null&&(l.Long?(r.expirationDate=l.Long.fromValue(A.expirationDate)).unsigned=!1:typeof A.expirationDate=="string"?r.expirationDate=parseInt(A.expirationDate,10):typeof A.expirationDate=="number"?r.expirationDate=A.expirationDate:typeof A.expirationDate=="object"&&(r.expirationDate=new l.LongBits(A.expirationDate.low>>>0,A.expirationDate.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.isDeactivated!=null&&A.hasOwnProperty("isDeactivated")&&(s.isDeactivated=A.isDeactivated,r.oneofs&&(s._isDeactivated="isDeactivated")),A.isAutoRenewing!=null&&A.hasOwnProperty("isAutoRenewing")&&(s.isAutoRenewing=A.isAutoRenewing,r.oneofs&&(s._isAutoRenewing="isAutoRenewing")),A.expirationDate!=null&&A.hasOwnProperty("expirationDate")&&(typeof A.expirationDate=="number"?s.expirationDate=r.longs===String?String(A.expirationDate):A.expirationDate:s.expirationDate=r.longs===String?ge(A.expirationDate):r.longs===Number?ce(A.expirationDate):A.expirationDate,r.oneofs&&(s._expirationDate="expirationDate")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SubscriptionAction"},i})(),t.SyncActionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SyncActionMessage)return A;var r=new p.proto.SyncActionValue.SyncActionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SyncActionMessage"},i})(),t.SyncActionMessageRange=(function(){function i(a){if(this.messages=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.lastMessageTimestamp=A.int64();break}case 2:{c.lastSystemMessageTimestamp=A.int64();break}case 3:{c.messages&&c.messages.length||(c.messages=[]),c.messages.push(p.proto.SyncActionValue.SyncActionMessage.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SyncActionMessageRange)return A;var r=new p.proto.SyncActionValue.SyncActionMessageRange;if(A.lastMessageTimestamp!=null&&(l.Long?(r.lastMessageTimestamp=l.Long.fromValue(A.lastMessageTimestamp)).unsigned=!1:typeof A.lastMessageTimestamp=="string"?r.lastMessageTimestamp=parseInt(A.lastMessageTimestamp,10):typeof A.lastMessageTimestamp=="number"?r.lastMessageTimestamp=A.lastMessageTimestamp:typeof A.lastMessageTimestamp=="object"&&(r.lastMessageTimestamp=new l.LongBits(A.lastMessageTimestamp.low>>>0,A.lastMessageTimestamp.high>>>0).toNumber())),A.lastSystemMessageTimestamp!=null&&(l.Long?(r.lastSystemMessageTimestamp=l.Long.fromValue(A.lastSystemMessageTimestamp)).unsigned=!1:typeof A.lastSystemMessageTimestamp=="string"?r.lastSystemMessageTimestamp=parseInt(A.lastSystemMessageTimestamp,10):typeof A.lastSystemMessageTimestamp=="number"?r.lastSystemMessageTimestamp=A.lastSystemMessageTimestamp:typeof A.lastSystemMessageTimestamp=="object"&&(r.lastSystemMessageTimestamp=new l.LongBits(A.lastSystemMessageTimestamp.low>>>0,A.lastSystemMessageTimestamp.high>>>0).toNumber())),A.messages){if(!Array.isArray(A.messages))throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected");r.messages=[];for(var s=0;s>>3){case 1:{c.isTwentyFourHourFormatEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.TimeFormatAction)return A;var r=new p.proto.SyncActionValue.TimeFormatAction;return A.isTwentyFourHourFormatEnabled!=null&&(r.isTwentyFourHourFormatEnabled=!!A.isTwentyFourHourFormatEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isTwentyFourHourFormatEnabled!=null&&A.hasOwnProperty("isTwentyFourHourFormatEnabled")&&(s.isTwentyFourHourFormatEnabled=A.isTwentyFourHourFormatEnabled,r.oneofs&&(s._isTwentyFourHourFormatEnabled="isTwentyFourHourFormatEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.TimeFormatAction"},i})(),t.UGCBot=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.definition=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UGCBot)return A;var r=new p.proto.SyncActionValue.UGCBot;return A.definition!=null&&(typeof A.definition=="string"?l.base64.decode(A.definition,r.definition=l.newBuffer(l.base64.length(A.definition)),0):A.definition.length>=0&&(r.definition=A.definition)),r},i.toObject=function(A,r){r||(r={});var s={};return A.definition!=null&&A.hasOwnProperty("definition")&&(s.definition=r.bytes===String?l.base64.encode(A.definition,0,A.definition.length):r.bytes===Array?Array.prototype.slice.call(A.definition):A.definition,r.oneofs&&(s._definition="definition")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UGCBot"},i})(),t.UnarchiveChatsSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.unarchiveChats=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UnarchiveChatsSetting)return A;var r=new p.proto.SyncActionValue.UnarchiveChatsSetting;return A.unarchiveChats!=null&&(r.unarchiveChats=!!A.unarchiveChats),r},i.toObject=function(A,r){r||(r={});var s={};return A.unarchiveChats!=null&&A.hasOwnProperty("unarchiveChats")&&(s.unarchiveChats=A.unarchiveChats,r.oneofs&&(s._unarchiveChats="unarchiveChats")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UnarchiveChatsSetting"},i})(),t.UserStatusMuteAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.muted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UserStatusMuteAction)return A;var r=new p.proto.SyncActionValue.UserStatusMuteAction;return A.muted!=null&&(r.muted=!!A.muted),r},i.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UserStatusMuteAction"},i})(),t.UsernameChatStartModeAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.chatStartMode=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UsernameChatStartModeAction)return A;var r=new p.proto.SyncActionValue.UsernameChatStartModeAction;switch(A.chatStartMode){default:if(typeof A.chatStartMode=="number"){r.chatStartMode=A.chatStartMode;break}break;case"LID":case 1:r.chatStartMode=1;break;case"PN":case 2:r.chatStartMode=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.chatStartMode!=null&&A.hasOwnProperty("chatStartMode")&&(s.chatStartMode=r.enums===String?p.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]===void 0?A.chatStartMode:p.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]:A.chatStartMode,r.oneofs&&(s._chatStartMode="chatStartMode")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UsernameChatStartModeAction"},i.ChatStartMode=(function(){let a={},A=Object.create(a);return A[a[1]="LID"]=1,A[a[2]="PN"]=2,A})(),i})(),t.WaffleAccountLinkStateAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 2:{c.linkState=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.WaffleAccountLinkStateAction)return A;var r=new p.proto.SyncActionValue.WaffleAccountLinkStateAction;switch(A.linkState){default:if(typeof A.linkState=="number"){r.linkState=A.linkState;break}break;case"ACTIVE":case 0:r.linkState=0;break;case"PAUSED":case 1:r.linkState=1;break;case"UNLINKED":case 2:r.linkState=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.linkState!=null&&A.hasOwnProperty("linkState")&&(s.linkState=r.enums===String?p.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]===void 0?A.linkState:p.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]:A.linkState,r.oneofs&&(s._linkState="linkState")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WaffleAccountLinkStateAction"},i.AccountLinkState=(function(){let a={},A=Object.create(a);return A[a[0]="ACTIVE"]=0,A[a[1]="PAUSED"]=1,A[a[2]="UNLINKED"]=2,A})(),i})(),t.WamoUserIdentifierAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.identifier=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.WamoUserIdentifierAction)return A;var r=new p.proto.SyncActionValue.WamoUserIdentifierAction;return A.identifier!=null&&(r.identifier=String(A.identifier)),r},i.toObject=function(A,r){r||(r={});var s={};return A.identifier!=null&&A.hasOwnProperty("identifier")&&(s.identifier=A.identifier,r.oneofs&&(s._identifier="identifier")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WamoUserIdentifierAction"},i})(),t})(),n.SyncdIndex=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdIndex)return e;var a=new p.proto.SyncdIndex;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,a.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(a.blob=e.blob)),a},t.toObject=function(e,a){a||(a={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=a.bytes===String?l.base64.encode(e.blob,0,e.blob.length):a.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,a.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdIndex"},t})(),n.SyncdMutation=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.operation=e.int32();break}case 2:{s.record=p.proto.SyncdRecord.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdMutation)return e;var a=new p.proto.SyncdMutation;switch(e.operation){default:if(typeof e.operation=="number"){a.operation=e.operation;break}break;case"SET":case 0:a.operation=0;break;case"REMOVE":case 1:a.operation=1;break}if(e.record!=null){if(typeof e.record!="object")throw TypeError(".proto.SyncdMutation.record: object expected");a.record=p.proto.SyncdRecord.fromObject(e.record)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.operation!=null&&e.hasOwnProperty("operation")&&(A.operation=a.enums===String?p.proto.SyncdMutation.SyncdOperation[e.operation]===void 0?e.operation:p.proto.SyncdMutation.SyncdOperation[e.operation]:e.operation,a.oneofs&&(A._operation="operation")),e.record!=null&&e.hasOwnProperty("record")&&(A.record=p.proto.SyncdRecord.toObject(e.record,a),a.oneofs&&(A._record="record")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdMutation"},t.SyncdOperation=(function(){let i={},e=Object.create(i);return e[i[0]="SET"]=0,e[i[1]="REMOVE"]=1,e})(),t})(),n.SyncdMutations=(function(){function t(o){if(this.mutations=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.mutations&&r.mutations.length||(r.mutations=[]),r.mutations.push(p.proto.SyncdMutation.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.SyncdMutations)return i;var e=new p.proto.SyncdMutations;if(i.mutations){if(!Array.isArray(i.mutations))throw TypeError(".proto.SyncdMutations.mutations: array expected");e.mutations=[];for(var a=0;a>>3){case 1:{s.version=p.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.mutations&&s.mutations.length||(s.mutations=[]),s.mutations.push(p.proto.SyncdMutation.decode(e,e.uint32()));break}case 3:{s.externalMutations=p.proto.ExternalBlobReference.decode(e,e.uint32());break}case 4:{s.snapshotMac=e.bytes();break}case 5:{s.patchMac=e.bytes();break}case 6:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}case 7:{s.exitCode=p.proto.ExitCode.decode(e,e.uint32());break}case 8:{s.deviceIndex=e.uint32();break}case 9:{s.clientDebugData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdPatch)return e;var a=new p.proto.SyncdPatch;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdPatch.version: object expected");a.version=p.proto.SyncdVersion.fromObject(e.version)}if(e.mutations){if(!Array.isArray(e.mutations))throw TypeError(".proto.SyncdPatch.mutations: array expected");a.mutations=[];for(var A=0;A=0&&(a.snapshotMac=e.snapshotMac)),e.patchMac!=null&&(typeof e.patchMac=="string"?l.base64.decode(e.patchMac,a.patchMac=l.newBuffer(l.base64.length(e.patchMac)),0):e.patchMac.length>=0&&(a.patchMac=e.patchMac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdPatch.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}if(e.exitCode!=null){if(typeof e.exitCode!="object")throw TypeError(".proto.SyncdPatch.exitCode: object expected");a.exitCode=p.proto.ExitCode.fromObject(e.exitCode)}return e.deviceIndex!=null&&(a.deviceIndex=e.deviceIndex>>>0),e.clientDebugData!=null&&(typeof e.clientDebugData=="string"?l.base64.decode(e.clientDebugData,a.clientDebugData=l.newBuffer(l.base64.length(e.clientDebugData)),0):e.clientDebugData.length>=0&&(a.clientDebugData=e.clientDebugData)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.mutations=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.SyncdVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.mutations&&e.mutations.length){A.mutations=[];for(var r=0;r>>3){case 1:{s.index=p.proto.SyncdIndex.decode(e,e.uint32());break}case 2:{s.value=p.proto.SyncdValue.decode(e,e.uint32());break}case 3:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdRecord)return e;var a=new p.proto.SyncdRecord;if(e.index!=null){if(typeof e.index!="object")throw TypeError(".proto.SyncdRecord.index: object expected");a.index=p.proto.SyncdIndex.fromObject(e.index)}if(e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncdRecord.value: object expected");a.value=p.proto.SyncdValue.fromObject(e.value)}if(e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdRecord.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=p.proto.SyncdIndex.toObject(e.index,a),a.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=p.proto.SyncdValue.toObject(e.value,a),a.oneofs&&(A._value="value")),e.keyId!=null&&e.hasOwnProperty("keyId")&&(A.keyId=p.proto.KeyId.toObject(e.keyId,a),a.oneofs&&(A._keyId="keyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdRecord"},t})(),n.SyncdSnapshot=(function(){function t(i){if(this.records=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=p.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.records&&s.records.length||(s.records=[]),s.records.push(p.proto.SyncdRecord.decode(e,e.uint32()));break}case 3:{s.mac=e.bytes();break}case 4:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdSnapshot)return e;var a=new p.proto.SyncdSnapshot;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdSnapshot.version: object expected");a.version=p.proto.SyncdVersion.fromObject(e.version)}if(e.records){if(!Array.isArray(e.records))throw TypeError(".proto.SyncdSnapshot.records: array expected");a.records=[];for(var A=0;A=0&&(a.mac=e.mac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdSnapshot.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.records=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.SyncdVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.records&&e.records.length){A.records=[];for(var r=0;r>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdValue)return e;var a=new p.proto.SyncdValue;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,a.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(a.blob=e.blob)),a},t.toObject=function(e,a){a||(a={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=a.bytes===String?l.base64.encode(e.blob,0,e.blob.length):a.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,a.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdValue"},t})(),n.SyncdVersion=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdVersion)return e;var a=new p.proto.SyncdVersion;return e.version!=null&&(l.Long?(a.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?a.version=parseInt(e.version,10):typeof e.version=="number"?a.version=e.version:typeof e.version=="object"&&(a.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=a.longs===String?String(e.version):e.version:A.version=a.longs===String?ge(e.version,!0):a.longs===Number?ce(e.version,!0):e.version,a.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdVersion"},t})(),n.TapLinkAction=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.title=e.string();break}case 2:{s.tapUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.TapLinkAction)return e;var a=new p.proto.TapLinkAction;return e.title!=null&&(a.title=String(e.title)),e.tapUrl!=null&&(a.tapUrl=String(e.tapUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.tapUrl!=null&&e.hasOwnProperty("tapUrl")&&(A.tapUrl=e.tapUrl,a.oneofs&&(A._tapUrl="tapUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TapLinkAction"},t})(),n.TemplateButton=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=p.proto.TemplateButton.URLButton.decode(e,e.uint32());break}case 3:{s.callButton=p.proto.TemplateButton.CallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.TemplateButton)return e;var a=new p.proto.TemplateButton;if(e.index!=null&&(a.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.TemplateButton.quickReplyButton: object expected");a.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.TemplateButton.urlButton: object expected");a.urlButton=p.proto.TemplateButton.URLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.TemplateButton.callButton: object expected");a.callButton=p.proto.TemplateButton.CallButton.fromObject(e.callButton)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.toObject(e.quickReplyButton,a),a.oneofs&&(A.button="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=p.proto.TemplateButton.URLButton.toObject(e.urlButton,a),a.oneofs&&(A.button="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=p.proto.TemplateButton.CallButton.toObject(e.callButton,a),a.oneofs&&(A.button="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,a.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TemplateButton"},t.CallButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.phoneNumber=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.CallButton)return A;var r=new p.proto.TemplateButton.CallButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected");r.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.phoneNumber!=null){if(typeof A.phoneNumber!="object")throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected");r.phoneNumber=p.proto.Message.HighlyStructuredMessage.fromObject(A.phoneNumber)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=p.proto.Message.HighlyStructuredMessage.toObject(A.phoneNumber,r),r.oneofs&&(s._phoneNumber="phoneNumber")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.CallButton"},i})(),t.QuickReplyButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.QuickReplyButton)return A;var r=new p.proto.TemplateButton.QuickReplyButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected");r.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}return A.id!=null&&(r.id=String(A.id)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.QuickReplyButton"},i})(),t.URLButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.url=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.URLButton)return A;var r=new p.proto.TemplateButton.URLButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected");r.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.url!=null){if(typeof A.url!="object")throw TypeError(".proto.TemplateButton.URLButton.url: object expected");r.url=p.proto.Message.HighlyStructuredMessage.fromObject(A.url)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=p.proto.Message.HighlyStructuredMessage.toObject(A.url,r),r.oneofs&&(s._url="url")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.URLButton"},i})(),t})(),n.ThreadID=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.threadType=e.int32();break}case 2:{s.threadKey=p.proto.MessageKey.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ThreadID)return e;var a=new p.proto.ThreadID;switch(e.threadType){default:if(typeof e.threadType=="number"){a.threadType=e.threadType;break}break;case"UNKNOWN":case 0:a.threadType=0;break;case"VIEW_REPLIES":case 1:a.threadType=1;break;case"AI_THREAD":case 2:a.threadType=2;break}if(e.threadKey!=null){if(typeof e.threadKey!="object")throw TypeError(".proto.ThreadID.threadKey: object expected");a.threadKey=p.proto.MessageKey.fromObject(e.threadKey)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.threadType!=null&&e.hasOwnProperty("threadType")&&(A.threadType=a.enums===String?p.proto.ThreadID.ThreadType[e.threadType]===void 0?e.threadType:p.proto.ThreadID.ThreadType[e.threadType]:e.threadType,a.oneofs&&(A._threadType="threadType")),e.threadKey!=null&&e.hasOwnProperty("threadKey")&&(A.threadKey=p.proto.MessageKey.toObject(e.threadKey,a),a.oneofs&&(A._threadKey="threadKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ThreadID"},t.ThreadType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="VIEW_REPLIES"]=1,e[i[2]="AI_THREAD"]=2,e})(),t})(),n.UrlTrackingMap=(function(){function t(o){if(this.urlTrackingMapElements=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.urlTrackingMapElements&&r.urlTrackingMapElements.length||(r.urlTrackingMapElements=[]),r.urlTrackingMapElements.push(p.proto.UrlTrackingMap.UrlTrackingMapElement.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.UrlTrackingMap)return i;var e=new p.proto.UrlTrackingMap;if(i.urlTrackingMapElements){if(!Array.isArray(i.urlTrackingMapElements))throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected");e.urlTrackingMapElements=[];for(var a=0;a>>3){case 1:{g.originalUrl=a.string();break}case 2:{g.unconsentedUsersUrl=a.string();break}case 3:{g.consentedUsersUrl=a.string();break}case 4:{g.cardIndex=a.uint32();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.UrlTrackingMap.UrlTrackingMapElement)return a;var A=new p.proto.UrlTrackingMap.UrlTrackingMapElement;return a.originalUrl!=null&&(A.originalUrl=String(a.originalUrl)),a.unconsentedUsersUrl!=null&&(A.unconsentedUsersUrl=String(a.unconsentedUsersUrl)),a.consentedUsersUrl!=null&&(A.consentedUsersUrl=String(a.consentedUsersUrl)),a.cardIndex!=null&&(A.cardIndex=a.cardIndex>>>0),A},o.toObject=function(a,A){A||(A={});var r={};return a.originalUrl!=null&&a.hasOwnProperty("originalUrl")&&(r.originalUrl=a.originalUrl,A.oneofs&&(r._originalUrl="originalUrl")),a.unconsentedUsersUrl!=null&&a.hasOwnProperty("unconsentedUsersUrl")&&(r.unconsentedUsersUrl=a.unconsentedUsersUrl,A.oneofs&&(r._unconsentedUsersUrl="unconsentedUsersUrl")),a.consentedUsersUrl!=null&&a.hasOwnProperty("consentedUsersUrl")&&(r.consentedUsersUrl=a.consentedUsersUrl,A.oneofs&&(r._consentedUsersUrl="consentedUsersUrl")),a.cardIndex!=null&&a.hasOwnProperty("cardIndex")&&(r.cardIndex=a.cardIndex,A.oneofs&&(r._cardIndex="cardIndex")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.UrlTrackingMap.UrlTrackingMapElement"},o})(),t})(),n.UserPassword=(function(){function t(i){if(this.transformerArg=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encoding=e.int32();break}case 2:{s.transformer=e.int32();break}case 3:{s.transformerArg&&s.transformerArg.length||(s.transformerArg=[]),s.transformerArg.push(p.proto.UserPassword.TransformerArg.decode(e,e.uint32()));break}case 4:{s.transformedData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.UserPassword)return e;var a=new p.proto.UserPassword;switch(e.encoding){default:if(typeof e.encoding=="number"){a.encoding=e.encoding;break}break;case"UTF8":case 0:a.encoding=0;break;case"UTF8_BROKEN":case 1:a.encoding=1;break}switch(e.transformer){default:if(typeof e.transformer=="number"){a.transformer=e.transformer;break}break;case"NONE":case 0:a.transformer=0;break;case"PBKDF2_HMAC_SHA512":case 1:a.transformer=1;break;case"PBKDF2_HMAC_SHA384":case 2:a.transformer=2;break}if(e.transformerArg){if(!Array.isArray(e.transformerArg))throw TypeError(".proto.UserPassword.transformerArg: array expected");a.transformerArg=[];for(var A=0;A=0&&(a.transformedData=e.transformedData)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.transformerArg=[]),e.encoding!=null&&e.hasOwnProperty("encoding")&&(A.encoding=a.enums===String?p.proto.UserPassword.Encoding[e.encoding]===void 0?e.encoding:p.proto.UserPassword.Encoding[e.encoding]:e.encoding,a.oneofs&&(A._encoding="encoding")),e.transformer!=null&&e.hasOwnProperty("transformer")&&(A.transformer=a.enums===String?p.proto.UserPassword.Transformer[e.transformer]===void 0?e.transformer:p.proto.UserPassword.Transformer[e.transformer]:e.transformer,a.oneofs&&(A._transformer="transformer")),e.transformerArg&&e.transformerArg.length){A.transformerArg=[];for(var r=0;r>>3){case 1:{c.key=A.string();break}case 2:{c.value=p.proto.UserPassword.TransformerArg.Value.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.UserPassword.TransformerArg)return A;var r=new p.proto.UserPassword.TransformerArg;if(A.key!=null&&(r.key=String(A.key)),A.value!=null){if(typeof A.value!="object")throw TypeError(".proto.UserPassword.TransformerArg.value: object expected");r.value=p.proto.UserPassword.TransformerArg.Value.fromObject(A.value)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=A.key,r.oneofs&&(s._key="key")),A.value!=null&&A.hasOwnProperty("value")&&(s.value=p.proto.UserPassword.TransformerArg.Value.toObject(A.value,r),r.oneofs&&(s._value="value")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.UserPassword.TransformerArg"},i.Value=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.asBlob=s.bytes();break}case 2:{d.asUnsignedInteger=s.uint32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.UserPassword.TransformerArg.Value)return s;var g=new p.proto.UserPassword.TransformerArg.Value;return s.asBlob!=null&&(typeof s.asBlob=="string"?l.base64.decode(s.asBlob,g.asBlob=l.newBuffer(l.base64.length(s.asBlob)),0):s.asBlob.length>=0&&(g.asBlob=s.asBlob)),s.asUnsignedInteger!=null&&(g.asUnsignedInteger=s.asUnsignedInteger>>>0),g},a.toObject=function(s,g){g||(g={});var c={};return s.asBlob!=null&&s.hasOwnProperty("asBlob")&&(c.asBlob=g.bytes===String?l.base64.encode(s.asBlob,0,s.asBlob.length):g.bytes===Array?Array.prototype.slice.call(s.asBlob):s.asBlob,g.oneofs&&(c.value="asBlob")),s.asUnsignedInteger!=null&&s.hasOwnProperty("asUnsignedInteger")&&(c.asUnsignedInteger=s.asUnsignedInteger,g.oneofs&&(c.value="asUnsignedInteger")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.UserPassword.TransformerArg.Value"},a})(),i})(),t})(),n.UserReceipt=(function(){function t(i){if(this.pendingDeviceJid=[],this.deliveredDeviceJid=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.receiptTimestamp=e.int64();break}case 3:{s.readTimestamp=e.int64();break}case 4:{s.playedTimestamp=e.int64();break}case 5:{s.pendingDeviceJid&&s.pendingDeviceJid.length||(s.pendingDeviceJid=[]),s.pendingDeviceJid.push(e.string());break}case 6:{s.deliveredDeviceJid&&s.deliveredDeviceJid.length||(s.deliveredDeviceJid=[]),s.deliveredDeviceJid.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.UserReceipt)return e;var a=new p.proto.UserReceipt;if(e.userJid!=null&&(a.userJid=String(e.userJid)),e.receiptTimestamp!=null&&(l.Long?(a.receiptTimestamp=l.Long.fromValue(e.receiptTimestamp)).unsigned=!1:typeof e.receiptTimestamp=="string"?a.receiptTimestamp=parseInt(e.receiptTimestamp,10):typeof e.receiptTimestamp=="number"?a.receiptTimestamp=e.receiptTimestamp:typeof e.receiptTimestamp=="object"&&(a.receiptTimestamp=new l.LongBits(e.receiptTimestamp.low>>>0,e.receiptTimestamp.high>>>0).toNumber())),e.readTimestamp!=null&&(l.Long?(a.readTimestamp=l.Long.fromValue(e.readTimestamp)).unsigned=!1:typeof e.readTimestamp=="string"?a.readTimestamp=parseInt(e.readTimestamp,10):typeof e.readTimestamp=="number"?a.readTimestamp=e.readTimestamp:typeof e.readTimestamp=="object"&&(a.readTimestamp=new l.LongBits(e.readTimestamp.low>>>0,e.readTimestamp.high>>>0).toNumber())),e.playedTimestamp!=null&&(l.Long?(a.playedTimestamp=l.Long.fromValue(e.playedTimestamp)).unsigned=!1:typeof e.playedTimestamp=="string"?a.playedTimestamp=parseInt(e.playedTimestamp,10):typeof e.playedTimestamp=="number"?a.playedTimestamp=e.playedTimestamp:typeof e.playedTimestamp=="object"&&(a.playedTimestamp=new l.LongBits(e.playedTimestamp.low>>>0,e.playedTimestamp.high>>>0).toNumber())),e.pendingDeviceJid){if(!Array.isArray(e.pendingDeviceJid))throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected");a.pendingDeviceJid=[];for(var A=0;A>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}case 3:{s.serverSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.VerifiedNameCertificate)return e;var a=new p.proto.VerifiedNameCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.serverSignature!=null&&(typeof e.serverSignature=="string"?l.base64.decode(e.serverSignature,a.serverSignature=l.newBuffer(l.base64.length(e.serverSignature)),0):e.serverSignature.length>=0&&(a.serverSignature=e.serverSignature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.serverSignature!=null&&e.hasOwnProperty("serverSignature")&&(A.serverSignature=a.bytes===String?l.base64.encode(e.serverSignature,0,e.serverSignature.length):a.bytes===Array?Array.prototype.slice.call(e.serverSignature):e.serverSignature,a.oneofs&&(A._serverSignature="serverSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.VerifiedNameCertificate"},t.Details=(function(){function i(a){if(this.localizedNames=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serial=A.uint64();break}case 2:{c.issuer=A.string();break}case 4:{c.verifiedName=A.string();break}case 8:{c.localizedNames&&c.localizedNames.length||(c.localizedNames=[]),c.localizedNames.push(p.proto.LocalizedName.decode(A,A.uint32()));break}case 10:{c.issueTime=A.uint64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.VerifiedNameCertificate.Details)return A;var r=new p.proto.VerifiedNameCertificate.Details;if(A.serial!=null&&(l.Long?(r.serial=l.Long.fromValue(A.serial)).unsigned=!0:typeof A.serial=="string"?r.serial=parseInt(A.serial,10):typeof A.serial=="number"?r.serial=A.serial:typeof A.serial=="object"&&(r.serial=new l.LongBits(A.serial.low>>>0,A.serial.high>>>0).toNumber(!0))),A.issuer!=null&&(r.issuer=String(A.issuer)),A.verifiedName!=null&&(r.verifiedName=String(A.verifiedName)),A.localizedNames){if(!Array.isArray(A.localizedNames))throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected");r.localizedNames=[];for(var s=0;s>>0,A.issueTime.high>>>0).toNumber(!0))),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.localizedNames=[]),A.serial!=null&&A.hasOwnProperty("serial")&&(typeof A.serial=="number"?s.serial=r.longs===String?String(A.serial):A.serial:s.serial=r.longs===String?ge(A.serial,!0):r.longs===Number?ce(A.serial,!0):A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.verifiedName!=null&&A.hasOwnProperty("verifiedName")&&(s.verifiedName=A.verifiedName,r.oneofs&&(s._verifiedName="verifiedName")),A.localizedNames&&A.localizedNames.length){s.localizedNames=[];for(var g=0;g>>3){case 1:{s.filename=e.string();break}case 2:{s.opacity=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WallpaperSettings)return e;var a=new p.proto.WallpaperSettings;return e.filename!=null&&(a.filename=String(e.filename)),e.opacity!=null&&(a.opacity=e.opacity>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.filename!=null&&e.hasOwnProperty("filename")&&(A.filename=e.filename,a.oneofs&&(A._filename="filename")),e.opacity!=null&&e.hasOwnProperty("opacity")&&(A.opacity=e.opacity,a.oneofs&&(A._opacity="opacity")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WallpaperSettings"},t})(),n.WebFeatures=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.labelsDisplay=e.int32();break}case 2:{s.voipIndividualOutgoing=e.int32();break}case 3:{s.groupsV3=e.int32();break}case 4:{s.groupsV3Create=e.int32();break}case 5:{s.changeNumberV2=e.int32();break}case 6:{s.queryStatusV3Thumbnail=e.int32();break}case 7:{s.liveLocations=e.int32();break}case 8:{s.queryVname=e.int32();break}case 9:{s.voipIndividualIncoming=e.int32();break}case 10:{s.quickRepliesQuery=e.int32();break}case 11:{s.payments=e.int32();break}case 12:{s.stickerPackQuery=e.int32();break}case 13:{s.liveLocationsFinal=e.int32();break}case 14:{s.labelsEdit=e.int32();break}case 15:{s.mediaUpload=e.int32();break}case 18:{s.mediaUploadRichQuickReplies=e.int32();break}case 19:{s.vnameV2=e.int32();break}case 20:{s.videoPlaybackUrl=e.int32();break}case 21:{s.statusRanking=e.int32();break}case 22:{s.voipIndividualVideo=e.int32();break}case 23:{s.thirdPartyStickers=e.int32();break}case 24:{s.frequentlyForwardedSetting=e.int32();break}case 25:{s.groupsV4JoinPermission=e.int32();break}case 26:{s.recentStickers=e.int32();break}case 27:{s.catalog=e.int32();break}case 28:{s.starredStickers=e.int32();break}case 29:{s.voipGroupCall=e.int32();break}case 30:{s.templateMessage=e.int32();break}case 31:{s.templateMessageInteractivity=e.int32();break}case 32:{s.ephemeralMessages=e.int32();break}case 33:{s.e2ENotificationSync=e.int32();break}case 34:{s.recentStickersV2=e.int32();break}case 36:{s.recentStickersV3=e.int32();break}case 37:{s.userNotice=e.int32();break}case 39:{s.support=e.int32();break}case 40:{s.groupUiiCleanup=e.int32();break}case 41:{s.groupDogfoodingInternalOnly=e.int32();break}case 42:{s.settingsSync=e.int32();break}case 43:{s.archiveV2=e.int32();break}case 44:{s.ephemeralAllowGroupMembers=e.int32();break}case 45:{s.ephemeral24HDuration=e.int32();break}case 46:{s.mdForceUpgrade=e.int32();break}case 47:{s.disappearingMode=e.int32();break}case 48:{s.externalMdOptInAvailable=e.int32();break}case 49:{s.noDeleteMessageTimeLimit=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WebFeatures)return e;var a=new p.proto.WebFeatures;switch(e.labelsDisplay){default:if(typeof e.labelsDisplay=="number"){a.labelsDisplay=e.labelsDisplay;break}break;case"NOT_STARTED":case 0:a.labelsDisplay=0;break;case"FORCE_UPGRADE":case 1:a.labelsDisplay=1;break;case"DEVELOPMENT":case 2:a.labelsDisplay=2;break;case"PRODUCTION":case 3:a.labelsDisplay=3;break}switch(e.voipIndividualOutgoing){default:if(typeof e.voipIndividualOutgoing=="number"){a.voipIndividualOutgoing=e.voipIndividualOutgoing;break}break;case"NOT_STARTED":case 0:a.voipIndividualOutgoing=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualOutgoing=1;break;case"DEVELOPMENT":case 2:a.voipIndividualOutgoing=2;break;case"PRODUCTION":case 3:a.voipIndividualOutgoing=3;break}switch(e.groupsV3){default:if(typeof e.groupsV3=="number"){a.groupsV3=e.groupsV3;break}break;case"NOT_STARTED":case 0:a.groupsV3=0;break;case"FORCE_UPGRADE":case 1:a.groupsV3=1;break;case"DEVELOPMENT":case 2:a.groupsV3=2;break;case"PRODUCTION":case 3:a.groupsV3=3;break}switch(e.groupsV3Create){default:if(typeof e.groupsV3Create=="number"){a.groupsV3Create=e.groupsV3Create;break}break;case"NOT_STARTED":case 0:a.groupsV3Create=0;break;case"FORCE_UPGRADE":case 1:a.groupsV3Create=1;break;case"DEVELOPMENT":case 2:a.groupsV3Create=2;break;case"PRODUCTION":case 3:a.groupsV3Create=3;break}switch(e.changeNumberV2){default:if(typeof e.changeNumberV2=="number"){a.changeNumberV2=e.changeNumberV2;break}break;case"NOT_STARTED":case 0:a.changeNumberV2=0;break;case"FORCE_UPGRADE":case 1:a.changeNumberV2=1;break;case"DEVELOPMENT":case 2:a.changeNumberV2=2;break;case"PRODUCTION":case 3:a.changeNumberV2=3;break}switch(e.queryStatusV3Thumbnail){default:if(typeof e.queryStatusV3Thumbnail=="number"){a.queryStatusV3Thumbnail=e.queryStatusV3Thumbnail;break}break;case"NOT_STARTED":case 0:a.queryStatusV3Thumbnail=0;break;case"FORCE_UPGRADE":case 1:a.queryStatusV3Thumbnail=1;break;case"DEVELOPMENT":case 2:a.queryStatusV3Thumbnail=2;break;case"PRODUCTION":case 3:a.queryStatusV3Thumbnail=3;break}switch(e.liveLocations){default:if(typeof e.liveLocations=="number"){a.liveLocations=e.liveLocations;break}break;case"NOT_STARTED":case 0:a.liveLocations=0;break;case"FORCE_UPGRADE":case 1:a.liveLocations=1;break;case"DEVELOPMENT":case 2:a.liveLocations=2;break;case"PRODUCTION":case 3:a.liveLocations=3;break}switch(e.queryVname){default:if(typeof e.queryVname=="number"){a.queryVname=e.queryVname;break}break;case"NOT_STARTED":case 0:a.queryVname=0;break;case"FORCE_UPGRADE":case 1:a.queryVname=1;break;case"DEVELOPMENT":case 2:a.queryVname=2;break;case"PRODUCTION":case 3:a.queryVname=3;break}switch(e.voipIndividualIncoming){default:if(typeof e.voipIndividualIncoming=="number"){a.voipIndividualIncoming=e.voipIndividualIncoming;break}break;case"NOT_STARTED":case 0:a.voipIndividualIncoming=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualIncoming=1;break;case"DEVELOPMENT":case 2:a.voipIndividualIncoming=2;break;case"PRODUCTION":case 3:a.voipIndividualIncoming=3;break}switch(e.quickRepliesQuery){default:if(typeof e.quickRepliesQuery=="number"){a.quickRepliesQuery=e.quickRepliesQuery;break}break;case"NOT_STARTED":case 0:a.quickRepliesQuery=0;break;case"FORCE_UPGRADE":case 1:a.quickRepliesQuery=1;break;case"DEVELOPMENT":case 2:a.quickRepliesQuery=2;break;case"PRODUCTION":case 3:a.quickRepliesQuery=3;break}switch(e.payments){default:if(typeof e.payments=="number"){a.payments=e.payments;break}break;case"NOT_STARTED":case 0:a.payments=0;break;case"FORCE_UPGRADE":case 1:a.payments=1;break;case"DEVELOPMENT":case 2:a.payments=2;break;case"PRODUCTION":case 3:a.payments=3;break}switch(e.stickerPackQuery){default:if(typeof e.stickerPackQuery=="number"){a.stickerPackQuery=e.stickerPackQuery;break}break;case"NOT_STARTED":case 0:a.stickerPackQuery=0;break;case"FORCE_UPGRADE":case 1:a.stickerPackQuery=1;break;case"DEVELOPMENT":case 2:a.stickerPackQuery=2;break;case"PRODUCTION":case 3:a.stickerPackQuery=3;break}switch(e.liveLocationsFinal){default:if(typeof e.liveLocationsFinal=="number"){a.liveLocationsFinal=e.liveLocationsFinal;break}break;case"NOT_STARTED":case 0:a.liveLocationsFinal=0;break;case"FORCE_UPGRADE":case 1:a.liveLocationsFinal=1;break;case"DEVELOPMENT":case 2:a.liveLocationsFinal=2;break;case"PRODUCTION":case 3:a.liveLocationsFinal=3;break}switch(e.labelsEdit){default:if(typeof e.labelsEdit=="number"){a.labelsEdit=e.labelsEdit;break}break;case"NOT_STARTED":case 0:a.labelsEdit=0;break;case"FORCE_UPGRADE":case 1:a.labelsEdit=1;break;case"DEVELOPMENT":case 2:a.labelsEdit=2;break;case"PRODUCTION":case 3:a.labelsEdit=3;break}switch(e.mediaUpload){default:if(typeof e.mediaUpload=="number"){a.mediaUpload=e.mediaUpload;break}break;case"NOT_STARTED":case 0:a.mediaUpload=0;break;case"FORCE_UPGRADE":case 1:a.mediaUpload=1;break;case"DEVELOPMENT":case 2:a.mediaUpload=2;break;case"PRODUCTION":case 3:a.mediaUpload=3;break}switch(e.mediaUploadRichQuickReplies){default:if(typeof e.mediaUploadRichQuickReplies=="number"){a.mediaUploadRichQuickReplies=e.mediaUploadRichQuickReplies;break}break;case"NOT_STARTED":case 0:a.mediaUploadRichQuickReplies=0;break;case"FORCE_UPGRADE":case 1:a.mediaUploadRichQuickReplies=1;break;case"DEVELOPMENT":case 2:a.mediaUploadRichQuickReplies=2;break;case"PRODUCTION":case 3:a.mediaUploadRichQuickReplies=3;break}switch(e.vnameV2){default:if(typeof e.vnameV2=="number"){a.vnameV2=e.vnameV2;break}break;case"NOT_STARTED":case 0:a.vnameV2=0;break;case"FORCE_UPGRADE":case 1:a.vnameV2=1;break;case"DEVELOPMENT":case 2:a.vnameV2=2;break;case"PRODUCTION":case 3:a.vnameV2=3;break}switch(e.videoPlaybackUrl){default:if(typeof e.videoPlaybackUrl=="number"){a.videoPlaybackUrl=e.videoPlaybackUrl;break}break;case"NOT_STARTED":case 0:a.videoPlaybackUrl=0;break;case"FORCE_UPGRADE":case 1:a.videoPlaybackUrl=1;break;case"DEVELOPMENT":case 2:a.videoPlaybackUrl=2;break;case"PRODUCTION":case 3:a.videoPlaybackUrl=3;break}switch(e.statusRanking){default:if(typeof e.statusRanking=="number"){a.statusRanking=e.statusRanking;break}break;case"NOT_STARTED":case 0:a.statusRanking=0;break;case"FORCE_UPGRADE":case 1:a.statusRanking=1;break;case"DEVELOPMENT":case 2:a.statusRanking=2;break;case"PRODUCTION":case 3:a.statusRanking=3;break}switch(e.voipIndividualVideo){default:if(typeof e.voipIndividualVideo=="number"){a.voipIndividualVideo=e.voipIndividualVideo;break}break;case"NOT_STARTED":case 0:a.voipIndividualVideo=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualVideo=1;break;case"DEVELOPMENT":case 2:a.voipIndividualVideo=2;break;case"PRODUCTION":case 3:a.voipIndividualVideo=3;break}switch(e.thirdPartyStickers){default:if(typeof e.thirdPartyStickers=="number"){a.thirdPartyStickers=e.thirdPartyStickers;break}break;case"NOT_STARTED":case 0:a.thirdPartyStickers=0;break;case"FORCE_UPGRADE":case 1:a.thirdPartyStickers=1;break;case"DEVELOPMENT":case 2:a.thirdPartyStickers=2;break;case"PRODUCTION":case 3:a.thirdPartyStickers=3;break}switch(e.frequentlyForwardedSetting){default:if(typeof e.frequentlyForwardedSetting=="number"){a.frequentlyForwardedSetting=e.frequentlyForwardedSetting;break}break;case"NOT_STARTED":case 0:a.frequentlyForwardedSetting=0;break;case"FORCE_UPGRADE":case 1:a.frequentlyForwardedSetting=1;break;case"DEVELOPMENT":case 2:a.frequentlyForwardedSetting=2;break;case"PRODUCTION":case 3:a.frequentlyForwardedSetting=3;break}switch(e.groupsV4JoinPermission){default:if(typeof e.groupsV4JoinPermission=="number"){a.groupsV4JoinPermission=e.groupsV4JoinPermission;break}break;case"NOT_STARTED":case 0:a.groupsV4JoinPermission=0;break;case"FORCE_UPGRADE":case 1:a.groupsV4JoinPermission=1;break;case"DEVELOPMENT":case 2:a.groupsV4JoinPermission=2;break;case"PRODUCTION":case 3:a.groupsV4JoinPermission=3;break}switch(e.recentStickers){default:if(typeof e.recentStickers=="number"){a.recentStickers=e.recentStickers;break}break;case"NOT_STARTED":case 0:a.recentStickers=0;break;case"FORCE_UPGRADE":case 1:a.recentStickers=1;break;case"DEVELOPMENT":case 2:a.recentStickers=2;break;case"PRODUCTION":case 3:a.recentStickers=3;break}switch(e.catalog){default:if(typeof e.catalog=="number"){a.catalog=e.catalog;break}break;case"NOT_STARTED":case 0:a.catalog=0;break;case"FORCE_UPGRADE":case 1:a.catalog=1;break;case"DEVELOPMENT":case 2:a.catalog=2;break;case"PRODUCTION":case 3:a.catalog=3;break}switch(e.starredStickers){default:if(typeof e.starredStickers=="number"){a.starredStickers=e.starredStickers;break}break;case"NOT_STARTED":case 0:a.starredStickers=0;break;case"FORCE_UPGRADE":case 1:a.starredStickers=1;break;case"DEVELOPMENT":case 2:a.starredStickers=2;break;case"PRODUCTION":case 3:a.starredStickers=3;break}switch(e.voipGroupCall){default:if(typeof e.voipGroupCall=="number"){a.voipGroupCall=e.voipGroupCall;break}break;case"NOT_STARTED":case 0:a.voipGroupCall=0;break;case"FORCE_UPGRADE":case 1:a.voipGroupCall=1;break;case"DEVELOPMENT":case 2:a.voipGroupCall=2;break;case"PRODUCTION":case 3:a.voipGroupCall=3;break}switch(e.templateMessage){default:if(typeof e.templateMessage=="number"){a.templateMessage=e.templateMessage;break}break;case"NOT_STARTED":case 0:a.templateMessage=0;break;case"FORCE_UPGRADE":case 1:a.templateMessage=1;break;case"DEVELOPMENT":case 2:a.templateMessage=2;break;case"PRODUCTION":case 3:a.templateMessage=3;break}switch(e.templateMessageInteractivity){default:if(typeof e.templateMessageInteractivity=="number"){a.templateMessageInteractivity=e.templateMessageInteractivity;break}break;case"NOT_STARTED":case 0:a.templateMessageInteractivity=0;break;case"FORCE_UPGRADE":case 1:a.templateMessageInteractivity=1;break;case"DEVELOPMENT":case 2:a.templateMessageInteractivity=2;break;case"PRODUCTION":case 3:a.templateMessageInteractivity=3;break}switch(e.ephemeralMessages){default:if(typeof e.ephemeralMessages=="number"){a.ephemeralMessages=e.ephemeralMessages;break}break;case"NOT_STARTED":case 0:a.ephemeralMessages=0;break;case"FORCE_UPGRADE":case 1:a.ephemeralMessages=1;break;case"DEVELOPMENT":case 2:a.ephemeralMessages=2;break;case"PRODUCTION":case 3:a.ephemeralMessages=3;break}switch(e.e2ENotificationSync){default:if(typeof e.e2ENotificationSync=="number"){a.e2ENotificationSync=e.e2ENotificationSync;break}break;case"NOT_STARTED":case 0:a.e2ENotificationSync=0;break;case"FORCE_UPGRADE":case 1:a.e2ENotificationSync=1;break;case"DEVELOPMENT":case 2:a.e2ENotificationSync=2;break;case"PRODUCTION":case 3:a.e2ENotificationSync=3;break}switch(e.recentStickersV2){default:if(typeof e.recentStickersV2=="number"){a.recentStickersV2=e.recentStickersV2;break}break;case"NOT_STARTED":case 0:a.recentStickersV2=0;break;case"FORCE_UPGRADE":case 1:a.recentStickersV2=1;break;case"DEVELOPMENT":case 2:a.recentStickersV2=2;break;case"PRODUCTION":case 3:a.recentStickersV2=3;break}switch(e.recentStickersV3){default:if(typeof e.recentStickersV3=="number"){a.recentStickersV3=e.recentStickersV3;break}break;case"NOT_STARTED":case 0:a.recentStickersV3=0;break;case"FORCE_UPGRADE":case 1:a.recentStickersV3=1;break;case"DEVELOPMENT":case 2:a.recentStickersV3=2;break;case"PRODUCTION":case 3:a.recentStickersV3=3;break}switch(e.userNotice){default:if(typeof e.userNotice=="number"){a.userNotice=e.userNotice;break}break;case"NOT_STARTED":case 0:a.userNotice=0;break;case"FORCE_UPGRADE":case 1:a.userNotice=1;break;case"DEVELOPMENT":case 2:a.userNotice=2;break;case"PRODUCTION":case 3:a.userNotice=3;break}switch(e.support){default:if(typeof e.support=="number"){a.support=e.support;break}break;case"NOT_STARTED":case 0:a.support=0;break;case"FORCE_UPGRADE":case 1:a.support=1;break;case"DEVELOPMENT":case 2:a.support=2;break;case"PRODUCTION":case 3:a.support=3;break}switch(e.groupUiiCleanup){default:if(typeof e.groupUiiCleanup=="number"){a.groupUiiCleanup=e.groupUiiCleanup;break}break;case"NOT_STARTED":case 0:a.groupUiiCleanup=0;break;case"FORCE_UPGRADE":case 1:a.groupUiiCleanup=1;break;case"DEVELOPMENT":case 2:a.groupUiiCleanup=2;break;case"PRODUCTION":case 3:a.groupUiiCleanup=3;break}switch(e.groupDogfoodingInternalOnly){default:if(typeof e.groupDogfoodingInternalOnly=="number"){a.groupDogfoodingInternalOnly=e.groupDogfoodingInternalOnly;break}break;case"NOT_STARTED":case 0:a.groupDogfoodingInternalOnly=0;break;case"FORCE_UPGRADE":case 1:a.groupDogfoodingInternalOnly=1;break;case"DEVELOPMENT":case 2:a.groupDogfoodingInternalOnly=2;break;case"PRODUCTION":case 3:a.groupDogfoodingInternalOnly=3;break}switch(e.settingsSync){default:if(typeof e.settingsSync=="number"){a.settingsSync=e.settingsSync;break}break;case"NOT_STARTED":case 0:a.settingsSync=0;break;case"FORCE_UPGRADE":case 1:a.settingsSync=1;break;case"DEVELOPMENT":case 2:a.settingsSync=2;break;case"PRODUCTION":case 3:a.settingsSync=3;break}switch(e.archiveV2){default:if(typeof e.archiveV2=="number"){a.archiveV2=e.archiveV2;break}break;case"NOT_STARTED":case 0:a.archiveV2=0;break;case"FORCE_UPGRADE":case 1:a.archiveV2=1;break;case"DEVELOPMENT":case 2:a.archiveV2=2;break;case"PRODUCTION":case 3:a.archiveV2=3;break}switch(e.ephemeralAllowGroupMembers){default:if(typeof e.ephemeralAllowGroupMembers=="number"){a.ephemeralAllowGroupMembers=e.ephemeralAllowGroupMembers;break}break;case"NOT_STARTED":case 0:a.ephemeralAllowGroupMembers=0;break;case"FORCE_UPGRADE":case 1:a.ephemeralAllowGroupMembers=1;break;case"DEVELOPMENT":case 2:a.ephemeralAllowGroupMembers=2;break;case"PRODUCTION":case 3:a.ephemeralAllowGroupMembers=3;break}switch(e.ephemeral24HDuration){default:if(typeof e.ephemeral24HDuration=="number"){a.ephemeral24HDuration=e.ephemeral24HDuration;break}break;case"NOT_STARTED":case 0:a.ephemeral24HDuration=0;break;case"FORCE_UPGRADE":case 1:a.ephemeral24HDuration=1;break;case"DEVELOPMENT":case 2:a.ephemeral24HDuration=2;break;case"PRODUCTION":case 3:a.ephemeral24HDuration=3;break}switch(e.mdForceUpgrade){default:if(typeof e.mdForceUpgrade=="number"){a.mdForceUpgrade=e.mdForceUpgrade;break}break;case"NOT_STARTED":case 0:a.mdForceUpgrade=0;break;case"FORCE_UPGRADE":case 1:a.mdForceUpgrade=1;break;case"DEVELOPMENT":case 2:a.mdForceUpgrade=2;break;case"PRODUCTION":case 3:a.mdForceUpgrade=3;break}switch(e.disappearingMode){default:if(typeof e.disappearingMode=="number"){a.disappearingMode=e.disappearingMode;break}break;case"NOT_STARTED":case 0:a.disappearingMode=0;break;case"FORCE_UPGRADE":case 1:a.disappearingMode=1;break;case"DEVELOPMENT":case 2:a.disappearingMode=2;break;case"PRODUCTION":case 3:a.disappearingMode=3;break}switch(e.externalMdOptInAvailable){default:if(typeof e.externalMdOptInAvailable=="number"){a.externalMdOptInAvailable=e.externalMdOptInAvailable;break}break;case"NOT_STARTED":case 0:a.externalMdOptInAvailable=0;break;case"FORCE_UPGRADE":case 1:a.externalMdOptInAvailable=1;break;case"DEVELOPMENT":case 2:a.externalMdOptInAvailable=2;break;case"PRODUCTION":case 3:a.externalMdOptInAvailable=3;break}switch(e.noDeleteMessageTimeLimit){default:if(typeof e.noDeleteMessageTimeLimit=="number"){a.noDeleteMessageTimeLimit=e.noDeleteMessageTimeLimit;break}break;case"NOT_STARTED":case 0:a.noDeleteMessageTimeLimit=0;break;case"FORCE_UPGRADE":case 1:a.noDeleteMessageTimeLimit=1;break;case"DEVELOPMENT":case 2:a.noDeleteMessageTimeLimit=2;break;case"PRODUCTION":case 3:a.noDeleteMessageTimeLimit=3;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.labelsDisplay!=null&&e.hasOwnProperty("labelsDisplay")&&(A.labelsDisplay=a.enums===String?p.proto.WebFeatures.Flag[e.labelsDisplay]===void 0?e.labelsDisplay:p.proto.WebFeatures.Flag[e.labelsDisplay]:e.labelsDisplay,a.oneofs&&(A._labelsDisplay="labelsDisplay")),e.voipIndividualOutgoing!=null&&e.hasOwnProperty("voipIndividualOutgoing")&&(A.voipIndividualOutgoing=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualOutgoing]===void 0?e.voipIndividualOutgoing:p.proto.WebFeatures.Flag[e.voipIndividualOutgoing]:e.voipIndividualOutgoing,a.oneofs&&(A._voipIndividualOutgoing="voipIndividualOutgoing")),e.groupsV3!=null&&e.hasOwnProperty("groupsV3")&&(A.groupsV3=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV3]===void 0?e.groupsV3:p.proto.WebFeatures.Flag[e.groupsV3]:e.groupsV3,a.oneofs&&(A._groupsV3="groupsV3")),e.groupsV3Create!=null&&e.hasOwnProperty("groupsV3Create")&&(A.groupsV3Create=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV3Create]===void 0?e.groupsV3Create:p.proto.WebFeatures.Flag[e.groupsV3Create]:e.groupsV3Create,a.oneofs&&(A._groupsV3Create="groupsV3Create")),e.changeNumberV2!=null&&e.hasOwnProperty("changeNumberV2")&&(A.changeNumberV2=a.enums===String?p.proto.WebFeatures.Flag[e.changeNumberV2]===void 0?e.changeNumberV2:p.proto.WebFeatures.Flag[e.changeNumberV2]:e.changeNumberV2,a.oneofs&&(A._changeNumberV2="changeNumberV2")),e.queryStatusV3Thumbnail!=null&&e.hasOwnProperty("queryStatusV3Thumbnail")&&(A.queryStatusV3Thumbnail=a.enums===String?p.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]===void 0?e.queryStatusV3Thumbnail:p.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]:e.queryStatusV3Thumbnail,a.oneofs&&(A._queryStatusV3Thumbnail="queryStatusV3Thumbnail")),e.liveLocations!=null&&e.hasOwnProperty("liveLocations")&&(A.liveLocations=a.enums===String?p.proto.WebFeatures.Flag[e.liveLocations]===void 0?e.liveLocations:p.proto.WebFeatures.Flag[e.liveLocations]:e.liveLocations,a.oneofs&&(A._liveLocations="liveLocations")),e.queryVname!=null&&e.hasOwnProperty("queryVname")&&(A.queryVname=a.enums===String?p.proto.WebFeatures.Flag[e.queryVname]===void 0?e.queryVname:p.proto.WebFeatures.Flag[e.queryVname]:e.queryVname,a.oneofs&&(A._queryVname="queryVname")),e.voipIndividualIncoming!=null&&e.hasOwnProperty("voipIndividualIncoming")&&(A.voipIndividualIncoming=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualIncoming]===void 0?e.voipIndividualIncoming:p.proto.WebFeatures.Flag[e.voipIndividualIncoming]:e.voipIndividualIncoming,a.oneofs&&(A._voipIndividualIncoming="voipIndividualIncoming")),e.quickRepliesQuery!=null&&e.hasOwnProperty("quickRepliesQuery")&&(A.quickRepliesQuery=a.enums===String?p.proto.WebFeatures.Flag[e.quickRepliesQuery]===void 0?e.quickRepliesQuery:p.proto.WebFeatures.Flag[e.quickRepliesQuery]:e.quickRepliesQuery,a.oneofs&&(A._quickRepliesQuery="quickRepliesQuery")),e.payments!=null&&e.hasOwnProperty("payments")&&(A.payments=a.enums===String?p.proto.WebFeatures.Flag[e.payments]===void 0?e.payments:p.proto.WebFeatures.Flag[e.payments]:e.payments,a.oneofs&&(A._payments="payments")),e.stickerPackQuery!=null&&e.hasOwnProperty("stickerPackQuery")&&(A.stickerPackQuery=a.enums===String?p.proto.WebFeatures.Flag[e.stickerPackQuery]===void 0?e.stickerPackQuery:p.proto.WebFeatures.Flag[e.stickerPackQuery]:e.stickerPackQuery,a.oneofs&&(A._stickerPackQuery="stickerPackQuery")),e.liveLocationsFinal!=null&&e.hasOwnProperty("liveLocationsFinal")&&(A.liveLocationsFinal=a.enums===String?p.proto.WebFeatures.Flag[e.liveLocationsFinal]===void 0?e.liveLocationsFinal:p.proto.WebFeatures.Flag[e.liveLocationsFinal]:e.liveLocationsFinal,a.oneofs&&(A._liveLocationsFinal="liveLocationsFinal")),e.labelsEdit!=null&&e.hasOwnProperty("labelsEdit")&&(A.labelsEdit=a.enums===String?p.proto.WebFeatures.Flag[e.labelsEdit]===void 0?e.labelsEdit:p.proto.WebFeatures.Flag[e.labelsEdit]:e.labelsEdit,a.oneofs&&(A._labelsEdit="labelsEdit")),e.mediaUpload!=null&&e.hasOwnProperty("mediaUpload")&&(A.mediaUpload=a.enums===String?p.proto.WebFeatures.Flag[e.mediaUpload]===void 0?e.mediaUpload:p.proto.WebFeatures.Flag[e.mediaUpload]:e.mediaUpload,a.oneofs&&(A._mediaUpload="mediaUpload")),e.mediaUploadRichQuickReplies!=null&&e.hasOwnProperty("mediaUploadRichQuickReplies")&&(A.mediaUploadRichQuickReplies=a.enums===String?p.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]===void 0?e.mediaUploadRichQuickReplies:p.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]:e.mediaUploadRichQuickReplies,a.oneofs&&(A._mediaUploadRichQuickReplies="mediaUploadRichQuickReplies")),e.vnameV2!=null&&e.hasOwnProperty("vnameV2")&&(A.vnameV2=a.enums===String?p.proto.WebFeatures.Flag[e.vnameV2]===void 0?e.vnameV2:p.proto.WebFeatures.Flag[e.vnameV2]:e.vnameV2,a.oneofs&&(A._vnameV2="vnameV2")),e.videoPlaybackUrl!=null&&e.hasOwnProperty("videoPlaybackUrl")&&(A.videoPlaybackUrl=a.enums===String?p.proto.WebFeatures.Flag[e.videoPlaybackUrl]===void 0?e.videoPlaybackUrl:p.proto.WebFeatures.Flag[e.videoPlaybackUrl]:e.videoPlaybackUrl,a.oneofs&&(A._videoPlaybackUrl="videoPlaybackUrl")),e.statusRanking!=null&&e.hasOwnProperty("statusRanking")&&(A.statusRanking=a.enums===String?p.proto.WebFeatures.Flag[e.statusRanking]===void 0?e.statusRanking:p.proto.WebFeatures.Flag[e.statusRanking]:e.statusRanking,a.oneofs&&(A._statusRanking="statusRanking")),e.voipIndividualVideo!=null&&e.hasOwnProperty("voipIndividualVideo")&&(A.voipIndividualVideo=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualVideo]===void 0?e.voipIndividualVideo:p.proto.WebFeatures.Flag[e.voipIndividualVideo]:e.voipIndividualVideo,a.oneofs&&(A._voipIndividualVideo="voipIndividualVideo")),e.thirdPartyStickers!=null&&e.hasOwnProperty("thirdPartyStickers")&&(A.thirdPartyStickers=a.enums===String?p.proto.WebFeatures.Flag[e.thirdPartyStickers]===void 0?e.thirdPartyStickers:p.proto.WebFeatures.Flag[e.thirdPartyStickers]:e.thirdPartyStickers,a.oneofs&&(A._thirdPartyStickers="thirdPartyStickers")),e.frequentlyForwardedSetting!=null&&e.hasOwnProperty("frequentlyForwardedSetting")&&(A.frequentlyForwardedSetting=a.enums===String?p.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]===void 0?e.frequentlyForwardedSetting:p.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]:e.frequentlyForwardedSetting,a.oneofs&&(A._frequentlyForwardedSetting="frequentlyForwardedSetting")),e.groupsV4JoinPermission!=null&&e.hasOwnProperty("groupsV4JoinPermission")&&(A.groupsV4JoinPermission=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV4JoinPermission]===void 0?e.groupsV4JoinPermission:p.proto.WebFeatures.Flag[e.groupsV4JoinPermission]:e.groupsV4JoinPermission,a.oneofs&&(A._groupsV4JoinPermission="groupsV4JoinPermission")),e.recentStickers!=null&&e.hasOwnProperty("recentStickers")&&(A.recentStickers=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickers]===void 0?e.recentStickers:p.proto.WebFeatures.Flag[e.recentStickers]:e.recentStickers,a.oneofs&&(A._recentStickers="recentStickers")),e.catalog!=null&&e.hasOwnProperty("catalog")&&(A.catalog=a.enums===String?p.proto.WebFeatures.Flag[e.catalog]===void 0?e.catalog:p.proto.WebFeatures.Flag[e.catalog]:e.catalog,a.oneofs&&(A._catalog="catalog")),e.starredStickers!=null&&e.hasOwnProperty("starredStickers")&&(A.starredStickers=a.enums===String?p.proto.WebFeatures.Flag[e.starredStickers]===void 0?e.starredStickers:p.proto.WebFeatures.Flag[e.starredStickers]:e.starredStickers,a.oneofs&&(A._starredStickers="starredStickers")),e.voipGroupCall!=null&&e.hasOwnProperty("voipGroupCall")&&(A.voipGroupCall=a.enums===String?p.proto.WebFeatures.Flag[e.voipGroupCall]===void 0?e.voipGroupCall:p.proto.WebFeatures.Flag[e.voipGroupCall]:e.voipGroupCall,a.oneofs&&(A._voipGroupCall="voipGroupCall")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=a.enums===String?p.proto.WebFeatures.Flag[e.templateMessage]===void 0?e.templateMessage:p.proto.WebFeatures.Flag[e.templateMessage]:e.templateMessage,a.oneofs&&(A._templateMessage="templateMessage")),e.templateMessageInteractivity!=null&&e.hasOwnProperty("templateMessageInteractivity")&&(A.templateMessageInteractivity=a.enums===String?p.proto.WebFeatures.Flag[e.templateMessageInteractivity]===void 0?e.templateMessageInteractivity:p.proto.WebFeatures.Flag[e.templateMessageInteractivity]:e.templateMessageInteractivity,a.oneofs&&(A._templateMessageInteractivity="templateMessageInteractivity")),e.ephemeralMessages!=null&&e.hasOwnProperty("ephemeralMessages")&&(A.ephemeralMessages=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeralMessages]===void 0?e.ephemeralMessages:p.proto.WebFeatures.Flag[e.ephemeralMessages]:e.ephemeralMessages,a.oneofs&&(A._ephemeralMessages="ephemeralMessages")),e.e2ENotificationSync!=null&&e.hasOwnProperty("e2ENotificationSync")&&(A.e2ENotificationSync=a.enums===String?p.proto.WebFeatures.Flag[e.e2ENotificationSync]===void 0?e.e2ENotificationSync:p.proto.WebFeatures.Flag[e.e2ENotificationSync]:e.e2ENotificationSync,a.oneofs&&(A._e2ENotificationSync="e2ENotificationSync")),e.recentStickersV2!=null&&e.hasOwnProperty("recentStickersV2")&&(A.recentStickersV2=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickersV2]===void 0?e.recentStickersV2:p.proto.WebFeatures.Flag[e.recentStickersV2]:e.recentStickersV2,a.oneofs&&(A._recentStickersV2="recentStickersV2")),e.recentStickersV3!=null&&e.hasOwnProperty("recentStickersV3")&&(A.recentStickersV3=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickersV3]===void 0?e.recentStickersV3:p.proto.WebFeatures.Flag[e.recentStickersV3]:e.recentStickersV3,a.oneofs&&(A._recentStickersV3="recentStickersV3")),e.userNotice!=null&&e.hasOwnProperty("userNotice")&&(A.userNotice=a.enums===String?p.proto.WebFeatures.Flag[e.userNotice]===void 0?e.userNotice:p.proto.WebFeatures.Flag[e.userNotice]:e.userNotice,a.oneofs&&(A._userNotice="userNotice")),e.support!=null&&e.hasOwnProperty("support")&&(A.support=a.enums===String?p.proto.WebFeatures.Flag[e.support]===void 0?e.support:p.proto.WebFeatures.Flag[e.support]:e.support,a.oneofs&&(A._support="support")),e.groupUiiCleanup!=null&&e.hasOwnProperty("groupUiiCleanup")&&(A.groupUiiCleanup=a.enums===String?p.proto.WebFeatures.Flag[e.groupUiiCleanup]===void 0?e.groupUiiCleanup:p.proto.WebFeatures.Flag[e.groupUiiCleanup]:e.groupUiiCleanup,a.oneofs&&(A._groupUiiCleanup="groupUiiCleanup")),e.groupDogfoodingInternalOnly!=null&&e.hasOwnProperty("groupDogfoodingInternalOnly")&&(A.groupDogfoodingInternalOnly=a.enums===String?p.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]===void 0?e.groupDogfoodingInternalOnly:p.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]:e.groupDogfoodingInternalOnly,a.oneofs&&(A._groupDogfoodingInternalOnly="groupDogfoodingInternalOnly")),e.settingsSync!=null&&e.hasOwnProperty("settingsSync")&&(A.settingsSync=a.enums===String?p.proto.WebFeatures.Flag[e.settingsSync]===void 0?e.settingsSync:p.proto.WebFeatures.Flag[e.settingsSync]:e.settingsSync,a.oneofs&&(A._settingsSync="settingsSync")),e.archiveV2!=null&&e.hasOwnProperty("archiveV2")&&(A.archiveV2=a.enums===String?p.proto.WebFeatures.Flag[e.archiveV2]===void 0?e.archiveV2:p.proto.WebFeatures.Flag[e.archiveV2]:e.archiveV2,a.oneofs&&(A._archiveV2="archiveV2")),e.ephemeralAllowGroupMembers!=null&&e.hasOwnProperty("ephemeralAllowGroupMembers")&&(A.ephemeralAllowGroupMembers=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]===void 0?e.ephemeralAllowGroupMembers:p.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]:e.ephemeralAllowGroupMembers,a.oneofs&&(A._ephemeralAllowGroupMembers="ephemeralAllowGroupMembers")),e.ephemeral24HDuration!=null&&e.hasOwnProperty("ephemeral24HDuration")&&(A.ephemeral24HDuration=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeral24HDuration]===void 0?e.ephemeral24HDuration:p.proto.WebFeatures.Flag[e.ephemeral24HDuration]:e.ephemeral24HDuration,a.oneofs&&(A._ephemeral24HDuration="ephemeral24HDuration")),e.mdForceUpgrade!=null&&e.hasOwnProperty("mdForceUpgrade")&&(A.mdForceUpgrade=a.enums===String?p.proto.WebFeatures.Flag[e.mdForceUpgrade]===void 0?e.mdForceUpgrade:p.proto.WebFeatures.Flag[e.mdForceUpgrade]:e.mdForceUpgrade,a.oneofs&&(A._mdForceUpgrade="mdForceUpgrade")),e.disappearingMode!=null&&e.hasOwnProperty("disappearingMode")&&(A.disappearingMode=a.enums===String?p.proto.WebFeatures.Flag[e.disappearingMode]===void 0?e.disappearingMode:p.proto.WebFeatures.Flag[e.disappearingMode]:e.disappearingMode,a.oneofs&&(A._disappearingMode="disappearingMode")),e.externalMdOptInAvailable!=null&&e.hasOwnProperty("externalMdOptInAvailable")&&(A.externalMdOptInAvailable=a.enums===String?p.proto.WebFeatures.Flag[e.externalMdOptInAvailable]===void 0?e.externalMdOptInAvailable:p.proto.WebFeatures.Flag[e.externalMdOptInAvailable]:e.externalMdOptInAvailable,a.oneofs&&(A._externalMdOptInAvailable="externalMdOptInAvailable")),e.noDeleteMessageTimeLimit!=null&&e.hasOwnProperty("noDeleteMessageTimeLimit")&&(A.noDeleteMessageTimeLimit=a.enums===String?p.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]===void 0?e.noDeleteMessageTimeLimit:p.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]:e.noDeleteMessageTimeLimit,a.oneofs&&(A._noDeleteMessageTimeLimit="noDeleteMessageTimeLimit")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WebFeatures"},t.Flag=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_STARTED"]=0,e[i[1]="FORCE_UPGRADE"]=1,e[i[2]="DEVELOPMENT"]=2,e[i[3]="PRODUCTION"]=3,e})(),t})(),n.WebLinkRenderConfig=(function(){let t={},o=Object.create(t);return o[t[0]="WEBVIEW"]=0,o[t[1]="SYSTEM"]=1,o})(),n.WebMessageInfo=(function(){function t(i){if(this.messageStubParameters=[],this.labels=[],this.userReceipt=[],this.reactions=[],this.pollUpdates=[],this.eventResponses=[],this.statusMentions=[],this.messageAddOns=[],this.statusMentionSources=[],this.supportAiCitations=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.status=e.int32();break}case 5:{s.participant=e.string();break}case 6:{s.messageC2STimestamp=e.uint64();break}case 16:{s.ignore=e.bool();break}case 17:{s.starred=e.bool();break}case 18:{s.broadcast=e.bool();break}case 19:{s.pushName=e.string();break}case 20:{s.mediaCiphertextSha256=e.bytes();break}case 21:{s.multicast=e.bool();break}case 22:{s.urlText=e.bool();break}case 23:{s.urlNumber=e.bool();break}case 24:{s.messageStubType=e.int32();break}case 25:{s.clearMedia=e.bool();break}case 26:{s.messageStubParameters&&s.messageStubParameters.length||(s.messageStubParameters=[]),s.messageStubParameters.push(e.string());break}case 27:{s.duration=e.uint32();break}case 28:{s.labels&&s.labels.length||(s.labels=[]),s.labels.push(e.string());break}case 29:{s.paymentInfo=p.proto.PaymentInfo.decode(e,e.uint32());break}case 30:{s.finalLiveLocation=p.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 31:{s.quotedPaymentInfo=p.proto.PaymentInfo.decode(e,e.uint32());break}case 32:{s.ephemeralStartTimestamp=e.uint64();break}case 33:{s.ephemeralDuration=e.uint32();break}case 34:{s.ephemeralOffToOn=e.bool();break}case 35:{s.ephemeralOutOfSync=e.bool();break}case 36:{s.bizPrivacyStatus=e.int32();break}case 37:{s.verifiedBizName=e.string();break}case 38:{s.mediaData=p.proto.MediaData.decode(e,e.uint32());break}case 39:{s.photoChange=p.proto.PhotoChange.decode(e,e.uint32());break}case 40:{s.userReceipt&&s.userReceipt.length||(s.userReceipt=[]),s.userReceipt.push(p.proto.UserReceipt.decode(e,e.uint32()));break}case 41:{s.reactions&&s.reactions.length||(s.reactions=[]),s.reactions.push(p.proto.Reaction.decode(e,e.uint32()));break}case 42:{s.quotedStickerData=p.proto.MediaData.decode(e,e.uint32());break}case 43:{s.futureproofData=e.bytes();break}case 44:{s.statusPsa=p.proto.StatusPSA.decode(e,e.uint32());break}case 45:{s.pollUpdates&&s.pollUpdates.length||(s.pollUpdates=[]),s.pollUpdates.push(p.proto.PollUpdate.decode(e,e.uint32()));break}case 46:{s.pollAdditionalMetadata=p.proto.PollAdditionalMetadata.decode(e,e.uint32());break}case 47:{s.agentId=e.string();break}case 48:{s.statusAlreadyViewed=e.bool();break}case 49:{s.messageSecret=e.bytes();break}case 50:{s.keepInChat=p.proto.KeepInChat.decode(e,e.uint32());break}case 51:{s.originalSelfAuthorUserJidString=e.string();break}case 52:{s.revokeMessageTimestamp=e.uint64();break}case 54:{s.pinInChat=p.proto.PinInChat.decode(e,e.uint32());break}case 55:{s.premiumMessageInfo=p.proto.PremiumMessageInfo.decode(e,e.uint32());break}case 56:{s.is1PBizBotMessage=e.bool();break}case 57:{s.isGroupHistoryMessage=e.bool();break}case 58:{s.botMessageInvokerJid=e.string();break}case 59:{s.commentMetadata=p.proto.CommentMetadata.decode(e,e.uint32());break}case 61:{s.eventResponses&&s.eventResponses.length||(s.eventResponses=[]),s.eventResponses.push(p.proto.EventResponse.decode(e,e.uint32()));break}case 62:{s.reportingTokenInfo=p.proto.ReportingTokenInfo.decode(e,e.uint32());break}case 63:{s.newsletterServerId=e.uint64();break}case 64:{s.eventAdditionalMetadata=p.proto.EventAdditionalMetadata.decode(e,e.uint32());break}case 65:{s.isMentionedInStatus=e.bool();break}case 66:{s.statusMentions&&s.statusMentions.length||(s.statusMentions=[]),s.statusMentions.push(e.string());break}case 67:{s.targetMessageId=p.proto.MessageKey.decode(e,e.uint32());break}case 68:{s.messageAddOns&&s.messageAddOns.length||(s.messageAddOns=[]),s.messageAddOns.push(p.proto.MessageAddOn.decode(e,e.uint32()));break}case 69:{s.statusMentionMessageInfo=p.proto.StatusMentionMessage.decode(e,e.uint32());break}case 70:{s.isSupportAiMessage=e.bool();break}case 71:{s.statusMentionSources&&s.statusMentionSources.length||(s.statusMentionSources=[]),s.statusMentionSources.push(e.string());break}case 72:{s.supportAiCitations&&s.supportAiCitations.length||(s.supportAiCitations=[]),s.supportAiCitations.push(p.proto.Citation.decode(e,e.uint32()));break}case 73:{s.botTargetId=e.string();break}case 74:{s.groupHistoryIndividualMessageInfo=p.proto.GroupHistoryIndividualMessageInfo.decode(e,e.uint32());break}case 75:{s.groupHistoryBundleInfo=p.proto.GroupHistoryBundleInfo.decode(e,e.uint32());break}case 76:{s.interactiveMessageAdditionalMetadata=p.proto.InteractiveMessageAdditionalMetadata.decode(e,e.uint32());break}case 77:{s.quarantinedMessage=p.proto.QuarantinedMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WebMessageInfo)return e;var a=new p.proto.WebMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.WebMessageInfo.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.WebMessageInfo.message: object expected");a.message=p.proto.Message.fromObject(e.message)}switch(e.messageTimestamp!=null&&(l.Long?(a.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?a.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?a.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(a.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"ERROR":case 0:a.status=0;break;case"PENDING":case 1:a.status=1;break;case"SERVER_ACK":case 2:a.status=2;break;case"DELIVERY_ACK":case 3:a.status=3;break;case"READ":case 4:a.status=4;break;case"PLAYED":case 5:a.status=5;break}switch(e.participant!=null&&(a.participant=String(e.participant)),e.messageC2STimestamp!=null&&(l.Long?(a.messageC2STimestamp=l.Long.fromValue(e.messageC2STimestamp)).unsigned=!0:typeof e.messageC2STimestamp=="string"?a.messageC2STimestamp=parseInt(e.messageC2STimestamp,10):typeof e.messageC2STimestamp=="number"?a.messageC2STimestamp=e.messageC2STimestamp:typeof e.messageC2STimestamp=="object"&&(a.messageC2STimestamp=new l.LongBits(e.messageC2STimestamp.low>>>0,e.messageC2STimestamp.high>>>0).toNumber(!0))),e.ignore!=null&&(a.ignore=!!e.ignore),e.starred!=null&&(a.starred=!!e.starred),e.broadcast!=null&&(a.broadcast=!!e.broadcast),e.pushName!=null&&(a.pushName=String(e.pushName)),e.mediaCiphertextSha256!=null&&(typeof e.mediaCiphertextSha256=="string"?l.base64.decode(e.mediaCiphertextSha256,a.mediaCiphertextSha256=l.newBuffer(l.base64.length(e.mediaCiphertextSha256)),0):e.mediaCiphertextSha256.length>=0&&(a.mediaCiphertextSha256=e.mediaCiphertextSha256)),e.multicast!=null&&(a.multicast=!!e.multicast),e.urlText!=null&&(a.urlText=!!e.urlText),e.urlNumber!=null&&(a.urlNumber=!!e.urlNumber),e.messageStubType){default:if(typeof e.messageStubType=="number"){a.messageStubType=e.messageStubType;break}break;case"UNKNOWN":case 0:a.messageStubType=0;break;case"REVOKE":case 1:a.messageStubType=1;break;case"CIPHERTEXT":case 2:a.messageStubType=2;break;case"FUTUREPROOF":case 3:a.messageStubType=3;break;case"NON_VERIFIED_TRANSITION":case 4:a.messageStubType=4;break;case"UNVERIFIED_TRANSITION":case 5:a.messageStubType=5;break;case"VERIFIED_TRANSITION":case 6:a.messageStubType=6;break;case"VERIFIED_LOW_UNKNOWN":case 7:a.messageStubType=7;break;case"VERIFIED_HIGH":case 8:a.messageStubType=8;break;case"VERIFIED_INITIAL_UNKNOWN":case 9:a.messageStubType=9;break;case"VERIFIED_INITIAL_LOW":case 10:a.messageStubType=10;break;case"VERIFIED_INITIAL_HIGH":case 11:a.messageStubType=11;break;case"VERIFIED_TRANSITION_ANY_TO_NONE":case 12:a.messageStubType=12;break;case"VERIFIED_TRANSITION_ANY_TO_HIGH":case 13:a.messageStubType=13;break;case"VERIFIED_TRANSITION_HIGH_TO_LOW":case 14:a.messageStubType=14;break;case"VERIFIED_TRANSITION_HIGH_TO_UNKNOWN":case 15:a.messageStubType=15;break;case"VERIFIED_TRANSITION_UNKNOWN_TO_LOW":case 16:a.messageStubType=16;break;case"VERIFIED_TRANSITION_LOW_TO_UNKNOWN":case 17:a.messageStubType=17;break;case"VERIFIED_TRANSITION_NONE_TO_LOW":case 18:a.messageStubType=18;break;case"VERIFIED_TRANSITION_NONE_TO_UNKNOWN":case 19:a.messageStubType=19;break;case"GROUP_CREATE":case 20:a.messageStubType=20;break;case"GROUP_CHANGE_SUBJECT":case 21:a.messageStubType=21;break;case"GROUP_CHANGE_ICON":case 22:a.messageStubType=22;break;case"GROUP_CHANGE_INVITE_LINK":case 23:a.messageStubType=23;break;case"GROUP_CHANGE_DESCRIPTION":case 24:a.messageStubType=24;break;case"GROUP_CHANGE_RESTRICT":case 25:a.messageStubType=25;break;case"GROUP_CHANGE_ANNOUNCE":case 26:a.messageStubType=26;break;case"GROUP_PARTICIPANT_ADD":case 27:a.messageStubType=27;break;case"GROUP_PARTICIPANT_REMOVE":case 28:a.messageStubType=28;break;case"GROUP_PARTICIPANT_PROMOTE":case 29:a.messageStubType=29;break;case"GROUP_PARTICIPANT_DEMOTE":case 30:a.messageStubType=30;break;case"GROUP_PARTICIPANT_INVITE":case 31:a.messageStubType=31;break;case"GROUP_PARTICIPANT_LEAVE":case 32:a.messageStubType=32;break;case"GROUP_PARTICIPANT_CHANGE_NUMBER":case 33:a.messageStubType=33;break;case"BROADCAST_CREATE":case 34:a.messageStubType=34;break;case"BROADCAST_ADD":case 35:a.messageStubType=35;break;case"BROADCAST_REMOVE":case 36:a.messageStubType=36;break;case"GENERIC_NOTIFICATION":case 37:a.messageStubType=37;break;case"E2E_IDENTITY_CHANGED":case 38:a.messageStubType=38;break;case"E2E_ENCRYPTED":case 39:a.messageStubType=39;break;case"CALL_MISSED_VOICE":case 40:a.messageStubType=40;break;case"CALL_MISSED_VIDEO":case 41:a.messageStubType=41;break;case"INDIVIDUAL_CHANGE_NUMBER":case 42:a.messageStubType=42;break;case"GROUP_DELETE":case 43:a.messageStubType=43;break;case"GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE":case 44:a.messageStubType=44;break;case"CALL_MISSED_GROUP_VOICE":case 45:a.messageStubType=45;break;case"CALL_MISSED_GROUP_VIDEO":case 46:a.messageStubType=46;break;case"PAYMENT_CIPHERTEXT":case 47:a.messageStubType=47;break;case"PAYMENT_FUTUREPROOF":case 48:a.messageStubType=48;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED":case 49:a.messageStubType=49;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED":case 50:a.messageStubType=50;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED":case 51:a.messageStubType=51;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP":case 52:a.messageStubType=52;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP":case 53:a.messageStubType=53;break;case"PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER":case 54:a.messageStubType=54;break;case"PAYMENT_ACTION_SEND_PAYMENT_REMINDER":case 55:a.messageStubType=55;break;case"PAYMENT_ACTION_SEND_PAYMENT_INVITATION":case 56:a.messageStubType=56;break;case"PAYMENT_ACTION_REQUEST_DECLINED":case 57:a.messageStubType=57;break;case"PAYMENT_ACTION_REQUEST_EXPIRED":case 58:a.messageStubType=58;break;case"PAYMENT_ACTION_REQUEST_CANCELLED":case 59:a.messageStubType=59;break;case"BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM":case 60:a.messageStubType=60;break;case"BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP":case 61:a.messageStubType=61;break;case"BIZ_INTRO_TOP":case 62:a.messageStubType=62;break;case"BIZ_INTRO_BOTTOM":case 63:a.messageStubType=63;break;case"BIZ_NAME_CHANGE":case 64:a.messageStubType=64;break;case"BIZ_MOVE_TO_CONSUMER_APP":case 65:a.messageStubType=65;break;case"BIZ_TWO_TIER_MIGRATION_TOP":case 66:a.messageStubType=66;break;case"BIZ_TWO_TIER_MIGRATION_BOTTOM":case 67:a.messageStubType=67;break;case"OVERSIZED":case 68:a.messageStubType=68;break;case"GROUP_CHANGE_NO_FREQUENTLY_FORWARDED":case 69:a.messageStubType=69;break;case"GROUP_V4_ADD_INVITE_SENT":case 70:a.messageStubType=70;break;case"GROUP_PARTICIPANT_ADD_REQUEST_JOIN":case 71:a.messageStubType=71;break;case"CHANGE_EPHEMERAL_SETTING":case 72:a.messageStubType=72;break;case"E2E_DEVICE_CHANGED":case 73:a.messageStubType=73;break;case"VIEWED_ONCE":case 74:a.messageStubType=74;break;case"E2E_ENCRYPTED_NOW":case 75:a.messageStubType=75;break;case"BLUE_MSG_BSP_FB_TO_BSP_PREMISE":case 76:a.messageStubType=76;break;case"BLUE_MSG_BSP_FB_TO_SELF_FB":case 77:a.messageStubType=77;break;case"BLUE_MSG_BSP_FB_TO_SELF_PREMISE":case 78:a.messageStubType=78;break;case"BLUE_MSG_BSP_FB_UNVERIFIED":case 79:a.messageStubType=79;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 80:a.messageStubType=80;break;case"BLUE_MSG_BSP_FB_VERIFIED":case 81:a.messageStubType=81;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 82:a.messageStubType=82;break;case"BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE":case 83:a.messageStubType=83;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED":case 84:a.messageStubType=84;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 85:a.messageStubType=85;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED":case 86:a.messageStubType=86;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 87:a.messageStubType=87;break;case"BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED":case 88:a.messageStubType=88;break;case"BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED":case 89:a.messageStubType=89;break;case"BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED":case 90:a.messageStubType=90;break;case"BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED":case 91:a.messageStubType=91;break;case"BLUE_MSG_SELF_FB_TO_BSP_PREMISE":case 92:a.messageStubType=92;break;case"BLUE_MSG_SELF_FB_TO_SELF_PREMISE":case 93:a.messageStubType=93;break;case"BLUE_MSG_SELF_FB_UNVERIFIED":case 94:a.messageStubType=94;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 95:a.messageStubType=95;break;case"BLUE_MSG_SELF_FB_VERIFIED":case 96:a.messageStubType=96;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 97:a.messageStubType=97;break;case"BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE":case 98:a.messageStubType=98;break;case"BLUE_MSG_SELF_PREMISE_UNVERIFIED":case 99:a.messageStubType=99;break;case"BLUE_MSG_SELF_PREMISE_VERIFIED":case 100:a.messageStubType=100;break;case"BLUE_MSG_TO_BSP_FB":case 101:a.messageStubType=101;break;case"BLUE_MSG_TO_CONSUMER":case 102:a.messageStubType=102;break;case"BLUE_MSG_TO_SELF_FB":case 103:a.messageStubType=103;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED":case 104:a.messageStubType=104;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 105:a.messageStubType=105;break;case"BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED":case 106:a.messageStubType=106;break;case"BLUE_MSG_UNVERIFIED_TO_VERIFIED":case 107:a.messageStubType=107;break;case"BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED":case 108:a.messageStubType=108;break;case"BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 109:a.messageStubType=109;break;case"BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED":case 110:a.messageStubType=110;break;case"BLUE_MSG_VERIFIED_TO_UNVERIFIED":case 111:a.messageStubType=111;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 112:a.messageStubType=112;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED":case 113:a.messageStubType=113;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 114:a.messageStubType=114;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED":case 115:a.messageStubType=115;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 116:a.messageStubType=116;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 117:a.messageStubType=117;break;case"E2E_IDENTITY_UNAVAILABLE":case 118:a.messageStubType=118;break;case"GROUP_CREATING":case 119:a.messageStubType=119;break;case"GROUP_CREATE_FAILED":case 120:a.messageStubType=120;break;case"GROUP_BOUNCED":case 121:a.messageStubType=121;break;case"BLOCK_CONTACT":case 122:a.messageStubType=122;break;case"EPHEMERAL_SETTING_NOT_APPLIED":case 123:a.messageStubType=123;break;case"SYNC_FAILED":case 124:a.messageStubType=124;break;case"SYNCING":case 125:a.messageStubType=125;break;case"BIZ_PRIVACY_MODE_INIT_FB":case 126:a.messageStubType=126;break;case"BIZ_PRIVACY_MODE_INIT_BSP":case 127:a.messageStubType=127;break;case"BIZ_PRIVACY_MODE_TO_FB":case 128:a.messageStubType=128;break;case"BIZ_PRIVACY_MODE_TO_BSP":case 129:a.messageStubType=129;break;case"DISAPPEARING_MODE":case 130:a.messageStubType=130;break;case"E2E_DEVICE_FETCH_FAILED":case 131:a.messageStubType=131;break;case"ADMIN_REVOKE":case 132:a.messageStubType=132;break;case"GROUP_INVITE_LINK_GROWTH_LOCKED":case 133:a.messageStubType=133;break;case"COMMUNITY_LINK_PARENT_GROUP":case 134:a.messageStubType=134;break;case"COMMUNITY_LINK_SIBLING_GROUP":case 135:a.messageStubType=135;break;case"COMMUNITY_LINK_SUB_GROUP":case 136:a.messageStubType=136;break;case"COMMUNITY_UNLINK_PARENT_GROUP":case 137:a.messageStubType=137;break;case"COMMUNITY_UNLINK_SIBLING_GROUP":case 138:a.messageStubType=138;break;case"COMMUNITY_UNLINK_SUB_GROUP":case 139:a.messageStubType=139;break;case"GROUP_PARTICIPANT_ACCEPT":case 140:a.messageStubType=140;break;case"GROUP_PARTICIPANT_LINKED_GROUP_JOIN":case 141:a.messageStubType=141;break;case"COMMUNITY_CREATE":case 142:a.messageStubType=142;break;case"EPHEMERAL_KEEP_IN_CHAT":case 143:a.messageStubType=143;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST":case 144:a.messageStubType=144;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE":case 145:a.messageStubType=145;break;case"INTEGRITY_UNLINK_PARENT_GROUP":case 146:a.messageStubType=146;break;case"COMMUNITY_PARTICIPANT_PROMOTE":case 147:a.messageStubType=147;break;case"COMMUNITY_PARTICIPANT_DEMOTE":case 148:a.messageStubType=148;break;case"COMMUNITY_PARENT_GROUP_DELETED":case 149:a.messageStubType=149;break;case"COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL":case 150:a.messageStubType=150;break;case"GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP":case 151:a.messageStubType=151;break;case"MASKED_THREAD_CREATED":case 152:a.messageStubType=152;break;case"MASKED_THREAD_UNMASKED":case 153:a.messageStubType=153;break;case"BIZ_CHAT_ASSIGNMENT":case 154:a.messageStubType=154;break;case"CHAT_PSA":case 155:a.messageStubType=155;break;case"CHAT_POLL_CREATION_MESSAGE":case 156:a.messageStubType=156;break;case"CAG_MASKED_THREAD_CREATED":case 157:a.messageStubType=157;break;case"COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED":case 158:a.messageStubType=158;break;case"CAG_INVITE_AUTO_ADD":case 159:a.messageStubType=159;break;case"BIZ_CHAT_ASSIGNMENT_UNASSIGN":case 160:a.messageStubType=160;break;case"CAG_INVITE_AUTO_JOINED":case 161:a.messageStubType=161;break;case"SCHEDULED_CALL_START_MESSAGE":case 162:a.messageStubType=162;break;case"COMMUNITY_INVITE_RICH":case 163:a.messageStubType=163;break;case"COMMUNITY_INVITE_AUTO_ADD_RICH":case 164:a.messageStubType=164;break;case"SUB_GROUP_INVITE_RICH":case 165:a.messageStubType=165;break;case"SUB_GROUP_PARTICIPANT_ADD_RICH":case 166:a.messageStubType=166;break;case"COMMUNITY_LINK_PARENT_GROUP_RICH":case 167:a.messageStubType=167;break;case"COMMUNITY_PARTICIPANT_ADD_RICH":case 168:a.messageStubType=168;break;case"SILENCED_UNKNOWN_CALLER_AUDIO":case 169:a.messageStubType=169;break;case"SILENCED_UNKNOWN_CALLER_VIDEO":case 170:a.messageStubType=170;break;case"GROUP_MEMBER_ADD_MODE":case 171:a.messageStubType=171;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD":case 172:a.messageStubType=172;break;case"COMMUNITY_CHANGE_DESCRIPTION":case 173:a.messageStubType=173;break;case"SENDER_INVITE":case 174:a.messageStubType=174;break;case"RECEIVER_INVITE":case 175:a.messageStubType=175;break;case"COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS":case 176:a.messageStubType=176;break;case"PINNED_MESSAGE_IN_CHAT":case 177:a.messageStubType=177;break;case"PAYMENT_INVITE_SETUP_INVITER":case 178:a.messageStubType=178;break;case"PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY":case 179:a.messageStubType=179;break;case"PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE":case 180:a.messageStubType=180;break;case"LINKED_GROUP_CALL_START":case 181:a.messageStubType=181;break;case"REPORT_TO_ADMIN_ENABLED_STATUS":case 182:a.messageStubType=182;break;case"EMPTY_SUBGROUP_CREATE":case 183:a.messageStubType=183;break;case"SCHEDULED_CALL_CANCEL":case 184:a.messageStubType=184;break;case"SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH":case 185:a.messageStubType=185;break;case"GROUP_CHANGE_RECENT_HISTORY_SHARING":case 186:a.messageStubType=186;break;case"PAID_MESSAGE_SERVER_CAMPAIGN_ID":case 187:a.messageStubType=187;break;case"GENERAL_CHAT_CREATE":case 188:a.messageStubType=188;break;case"GENERAL_CHAT_ADD":case 189:a.messageStubType=189;break;case"GENERAL_CHAT_AUTO_ADD_DISABLED":case 190:a.messageStubType=190;break;case"SUGGESTED_SUBGROUP_ANNOUNCE":case 191:a.messageStubType=191;break;case"BIZ_BOT_1P_MESSAGING_ENABLED":case 192:a.messageStubType=192;break;case"CHANGE_USERNAME":case 193:a.messageStubType=193;break;case"BIZ_COEX_PRIVACY_INIT_SELF":case 194:a.messageStubType=194;break;case"BIZ_COEX_PRIVACY_TRANSITION_SELF":case 195:a.messageStubType=195;break;case"SUPPORT_AI_EDUCATION":case 196:a.messageStubType=196;break;case"BIZ_BOT_3P_MESSAGING_ENABLED":case 197:a.messageStubType=197;break;case"REMINDER_SETUP_MESSAGE":case 198:a.messageStubType=198;break;case"REMINDER_SENT_MESSAGE":case 199:a.messageStubType=199;break;case"REMINDER_CANCEL_MESSAGE":case 200:a.messageStubType=200;break;case"BIZ_COEX_PRIVACY_INIT":case 201:a.messageStubType=201;break;case"BIZ_COEX_PRIVACY_TRANSITION":case 202:a.messageStubType=202;break;case"GROUP_DEACTIVATED":case 203:a.messageStubType=203;break;case"COMMUNITY_DEACTIVATE_SIBLING_GROUP":case 204:a.messageStubType=204;break;case"EVENT_UPDATED":case 205:a.messageStubType=205;break;case"EVENT_CANCELED":case 206:a.messageStubType=206;break;case"COMMUNITY_OWNER_UPDATED":case 207:a.messageStubType=207;break;case"COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN":case 208:a.messageStubType=208;break;case"CAPI_GROUP_NE2EE_SYSTEM_MESSAGE":case 209:a.messageStubType=209;break;case"STATUS_MENTION":case 210:a.messageStubType=210;break;case"USER_CONTROLS_SYSTEM_MESSAGE":case 211:a.messageStubType=211;break;case"SUPPORT_SYSTEM_MESSAGE":case 212:a.messageStubType=212;break;case"CHANGE_LID":case 213:a.messageStubType=213;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE":case 214:a.messageStubType=214;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE":case 215:a.messageStubType=215;break;case"CHANGE_LIMIT_SHARING":case 216:a.messageStubType=216;break;case"GROUP_MEMBER_LINK_MODE":case 217:a.messageStubType=217;break;case"BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE":case 218:a.messageStubType=218;break;case"PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE":case 219:a.messageStubType=219;break;case"QUARANTINED_MESSAGE":case 220:a.messageStubType=220;break;case"GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE":case 221:a.messageStubType=221;break}if(e.clearMedia!=null&&(a.clearMedia=!!e.clearMedia),e.messageStubParameters){if(!Array.isArray(e.messageStubParameters))throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected");a.messageStubParameters=[];for(var A=0;A>>0),e.labels){if(!Array.isArray(e.labels))throw TypeError(".proto.WebMessageInfo.labels: array expected");a.labels=[];for(var A=0;A>>0,e.ephemeralStartTimestamp.high>>>0).toNumber(!0))),e.ephemeralDuration!=null&&(a.ephemeralDuration=e.ephemeralDuration>>>0),e.ephemeralOffToOn!=null&&(a.ephemeralOffToOn=!!e.ephemeralOffToOn),e.ephemeralOutOfSync!=null&&(a.ephemeralOutOfSync=!!e.ephemeralOutOfSync),e.bizPrivacyStatus){default:if(typeof e.bizPrivacyStatus=="number"){a.bizPrivacyStatus=e.bizPrivacyStatus;break}break;case"E2EE":case 0:a.bizPrivacyStatus=0;break;case"FB":case 2:a.bizPrivacyStatus=2;break;case"BSP":case 1:a.bizPrivacyStatus=1;break;case"BSP_AND_FB":case 3:a.bizPrivacyStatus=3;break}if(e.verifiedBizName!=null&&(a.verifiedBizName=String(e.verifiedBizName)),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.WebMessageInfo.mediaData: object expected");a.mediaData=p.proto.MediaData.fromObject(e.mediaData)}if(e.photoChange!=null){if(typeof e.photoChange!="object")throw TypeError(".proto.WebMessageInfo.photoChange: object expected");a.photoChange=p.proto.PhotoChange.fromObject(e.photoChange)}if(e.userReceipt){if(!Array.isArray(e.userReceipt))throw TypeError(".proto.WebMessageInfo.userReceipt: array expected");a.userReceipt=[];for(var A=0;A=0&&(a.futureproofData=e.futureproofData)),e.statusPsa!=null){if(typeof e.statusPsa!="object")throw TypeError(".proto.WebMessageInfo.statusPsa: object expected");a.statusPsa=p.proto.StatusPSA.fromObject(e.statusPsa)}if(e.pollUpdates){if(!Array.isArray(e.pollUpdates))throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected");a.pollUpdates=[];for(var A=0;A=0&&(a.messageSecret=e.messageSecret)),e.keepInChat!=null){if(typeof e.keepInChat!="object")throw TypeError(".proto.WebMessageInfo.keepInChat: object expected");a.keepInChat=p.proto.KeepInChat.fromObject(e.keepInChat)}if(e.originalSelfAuthorUserJidString!=null&&(a.originalSelfAuthorUserJidString=String(e.originalSelfAuthorUserJidString)),e.revokeMessageTimestamp!=null&&(l.Long?(a.revokeMessageTimestamp=l.Long.fromValue(e.revokeMessageTimestamp)).unsigned=!0:typeof e.revokeMessageTimestamp=="string"?a.revokeMessageTimestamp=parseInt(e.revokeMessageTimestamp,10):typeof e.revokeMessageTimestamp=="number"?a.revokeMessageTimestamp=e.revokeMessageTimestamp:typeof e.revokeMessageTimestamp=="object"&&(a.revokeMessageTimestamp=new l.LongBits(e.revokeMessageTimestamp.low>>>0,e.revokeMessageTimestamp.high>>>0).toNumber(!0))),e.pinInChat!=null){if(typeof e.pinInChat!="object")throw TypeError(".proto.WebMessageInfo.pinInChat: object expected");a.pinInChat=p.proto.PinInChat.fromObject(e.pinInChat)}if(e.premiumMessageInfo!=null){if(typeof e.premiumMessageInfo!="object")throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected");a.premiumMessageInfo=p.proto.PremiumMessageInfo.fromObject(e.premiumMessageInfo)}if(e.is1PBizBotMessage!=null&&(a.is1PBizBotMessage=!!e.is1PBizBotMessage),e.isGroupHistoryMessage!=null&&(a.isGroupHistoryMessage=!!e.isGroupHistoryMessage),e.botMessageInvokerJid!=null&&(a.botMessageInvokerJid=String(e.botMessageInvokerJid)),e.commentMetadata!=null){if(typeof e.commentMetadata!="object")throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected");a.commentMetadata=p.proto.CommentMetadata.fromObject(e.commentMetadata)}if(e.eventResponses){if(!Array.isArray(e.eventResponses))throw TypeError(".proto.WebMessageInfo.eventResponses: array expected");a.eventResponses=[];for(var A=0;A>>0,e.newsletterServerId.high>>>0).toNumber(!0))),e.eventAdditionalMetadata!=null){if(typeof e.eventAdditionalMetadata!="object")throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected");a.eventAdditionalMetadata=p.proto.EventAdditionalMetadata.fromObject(e.eventAdditionalMetadata)}if(e.isMentionedInStatus!=null&&(a.isMentionedInStatus=!!e.isMentionedInStatus),e.statusMentions){if(!Array.isArray(e.statusMentions))throw TypeError(".proto.WebMessageInfo.statusMentions: array expected");a.statusMentions=[];for(var A=0;A>>3){case 2:{s.timestamp=e.uint64();break}case 3:{s.unreadChats=e.uint32();break}case 4:{s.notifyMessageCount=e.uint32();break}case 5:{s.notifyMessages&&s.notifyMessages.length||(s.notifyMessages=[]),s.notifyMessages.push(p.proto.WebMessageInfo.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WebNotificationsInfo)return e;var a=new p.proto.WebNotificationsInfo;if(e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.unreadChats!=null&&(a.unreadChats=e.unreadChats>>>0),e.notifyMessageCount!=null&&(a.notifyMessageCount=e.notifyMessageCount>>>0),e.notifyMessages){if(!Array.isArray(e.notifyMessages))throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected");a.notifyMessages=[];for(var A=0;ASa.hasSubscribers||BB.hasSubscribers,AX=new Set,eX=typeof process=="object"&&process?process:{},QUe=(n,t,o,i)=>{typeof eX.emitWarning=="function"?eX.emitWarning(n,t,o,i):console.error(`[${o}] ${t}: ${n}`)},yUe=n=>!AX.has(n),qc=n=>!!n&&n===Math.floor(n)&&n>0&&isFinite(n),tX=n=>qc(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Xw:null:null,Xw=class extends Array{constructor(n){super(n),this.fill(0)}},mUe=class fB{heap;length;static#e=!1;static create(t){let o=tX(t);if(!o)return[];fB.#e=!0;let i=new fB(t,o);return fB.#e=!1,i}constructor(t,o){if(!fB.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Gg=class rX{#e;#A;#t;#r;#l;#o;#i;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#s;#p;#c;#g;#I;#d;#h;#C;#u;#B;#f;#Q;#S;#y;#m;#D;#E;#N;static unsafeExposeInternals(t){return{starts:t.#Q,ttls:t.#S,autopurgeTimers:t.#y,sizes:t.#f,keyMap:t.#p,keyList:t.#c,valList:t.#g,next:t.#I,prev:t.#d,get head(){return t.#h},get tail(){return t.#C},free:t.#u,isBackgroundFetch:o=>t.#M(o),backgroundFetch:(o,i,e,a)=>t.#z(o,i,e,a),moveToTail:o=>t.#Y(o),indexes:o=>t.#H(o),rindexes:o=>t.#U(o),isStale:o=>t.#_(o)}}get max(){return this.#e}get maxSize(){return this.#A}get calculatedSize(){return this.#s}get size(){return this.#n}get fetchMethod(){return this.#o}get memoMethod(){return this.#i}get dispose(){return this.#t}get onInsert(){return this.#r}get disposeAfter(){return this.#l}constructor(t){let{max:o=0,ttl:i,ttlResolution:e=1,ttlAutopurge:a,updateAgeOnGet:A,updateAgeOnHas:r,allowStale:s,dispose:g,onInsert:c,disposeAfter:I,noDisposeOnSet:d,noUpdateTTL:B,maxSize:f=0,maxEntrySize:Q=0,sizeCalculation:y,fetchMethod:m,memoMethod:T,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:K,allowStaleOnFetchAbort:L,ignoreFetchAbort:F,backgroundFetchSize:q=1,perf:V}=t;if(this.backgroundFetchSize=q,V!==void 0&&typeof V?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=V??fUe,o!==0&&!qc(o))throw new TypeError("max option must be a nonnegative integer");let x=o?tX(o):Array;if(!x)throw new Error("invalid max value: "+o);if(this.#e=o,this.#A=f,this.maxEntrySize=Q||this.#A,this.sizeCalculation=y,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#i=T,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=m,this.#D=!!m,this.#p=new Map,this.#c=Array.from({length:o}).fill(void 0),this.#g=Array.from({length:o}).fill(void 0),this.#I=new x(o),this.#d=new x(o),this.#h=0,this.#C=0,this.#u=mUe.create(o),this.#n=0,this.#s=0,typeof g=="function"&&(this.#t=g),typeof c=="function"&&(this.#r=c),typeof I=="function"?(this.#l=I,this.#B=[]):(this.#l=void 0,this.#B=void 0),this.#m=!!this.#t,this.#N=!!this.#r,this.#E=!!this.#l,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!K,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(this.#A!==0&&!qc(this.#A))throw new TypeError("maxSize must be a positive integer if specified");if(!qc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!A,this.updateAgeOnHas=!!r,this.ttlResolution=qc(e)||e===0?e:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!qc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#e===0&&this.ttl===0&&this.#A===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#A){let G="LRU_CACHE_UNBOUNDED";yUe(G)&&(AX.add(G),QUe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,rX))}}getRemainingTTL(t){return this.#p.has(t)?1/0:0}#T(){let t=new Xw(this.#e),o=new Xw(this.#e);this.#S=t,this.#Q=o;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#y=i,this.#R=(s,g,c=this.#a.now())=>{o[s]=g!==0?c:0,t[s]=g,e(s,g)},this.#O=s=>{o[s]=t[s]!==0?this.#a.now():0,e(s,t[s])};let e=this.ttlAutopurge?(s,g)=>{if(i?.[s]&&(clearTimeout(i[s]),i[s]=void 0),g&&g!==0&&i){let c=setTimeout(()=>{this.#_(s)?(this.#J(this.#c[s],"expire"),i[s]=void 0):e(s,r(s))},g+1);c.unref&&c.unref(),i[s]=c}}:()=>{};this.#w=(s,g)=>{if(t[g]){let c=t[g],I=o[g];if(!c||!I)return;s.ttl=c,s.start=I,s.now=a||A();let d=s.now-I;s.remainingTTL=c-d}};let a=0,A=()=>{let s=this.#a.now();if(this.ttlResolution>0){a=s;let g=setTimeout(()=>a=0,this.ttlResolution);g.unref&&g.unref()}return s};this.getRemainingTTL=s=>{let g=this.#p.get(s);return g===void 0?0:r(g)};let r=s=>{let g=t[s],c=o[s];if(!g||!c)return 1/0;let I=(a||A())-c;return g-I};this.#_=s=>{let g=o[s],c=t[s];return!!c&&!!g&&(a||A())-g>c}}#O=()=>{};#w=()=>{};#R=()=>{};#_=()=>!1;#G(){let t=new Xw(this.#e);this.#s=0,this.#f=t,this.#k=o=>{this.#s-=t[o],t[o]=0},this.#P=(o,i,e,a)=>{if(!qc(e)){if(this.#M(i))return this.backgroundFetchSize;if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(e=a(i,o),!qc(e))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return e},this.#F=(o,i,e)=>{if(t[o]=i,this.#A){let a=this.#A-t[o];for(;this.#s>a;)this.#K(!0)}this.#s+=t[o],e&&(e.entrySize=i,e.totalCalculatedSize=this.#s)}}#k=t=>{};#F=(t,o,i)=>{};#P=(t,o,i,e)=>{if(i||e)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#H({allowStale:t=this.allowStale}={}){if(this.#n)for(let o=this.#C;this.#L(o)&&((t||!this.#_(o))&&(yield o),o!==this.#h);)o=this.#d[o]}*#U({allowStale:t=this.allowStale}={}){if(this.#n)for(let o=this.#h;this.#L(o)&&((t||!this.#_(o))&&(yield o),o!==this.#C);)o=this.#I[o]}#L(t){return t!==void 0&&this.#p.get(this.#c[t])===t}*entries(){for(let t of this.#H())this.#g[t]!==void 0&&this.#c[t]!==void 0&&!this.#M(this.#g[t])&&(yield[this.#c[t],this.#g[t]])}*rentries(){for(let t of this.#U())this.#g[t]!==void 0&&this.#c[t]!==void 0&&!this.#M(this.#g[t])&&(yield[this.#c[t],this.#g[t]])}*keys(){for(let t of this.#H()){let o=this.#c[t];o!==void 0&&!this.#M(this.#g[t])&&(yield o)}}*rkeys(){for(let t of this.#U()){let o=this.#c[t];o!==void 0&&!this.#M(this.#g[t])&&(yield o)}}*values(){for(let t of this.#H())this.#g[t]!==void 0&&!this.#M(this.#g[t])&&(yield this.#g[t])}*rvalues(){for(let t of this.#U())this.#g[t]!==void 0&&!this.#M(this.#g[t])&&(yield this.#g[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,o={}){for(let i of this.#H()){let e=this.#g[i],a=this.#M(e)?e.__staleWhileFetching:e;if(a!==void 0&&t(a,this.#c[i],this))return this.#Z(this.#c[i],o)}}forEach(t,o=this){for(let i of this.#H()){let e=this.#g[i],a=this.#M(e)?e.__staleWhileFetching:e;a!==void 0&&t.call(o,a,this.#c[i],this)}}rforEach(t,o=this){for(let i of this.#U()){let e=this.#g[i],a=this.#M(e)?e.__staleWhileFetching:e;a!==void 0&&t.call(o,a,this.#c[i],this)}}purgeStale(){let t=!1;for(let o of this.#U({allowStale:!0}))this.#_(o)&&(this.#J(this.#c[o],"expire"),t=!0);return t}info(t){let o=this.#p.get(t);if(o===void 0)return;let i=this.#g[o],e=this.#M(i)?i.__staleWhileFetching:i;if(e===void 0)return;let a={value:e};if(this.#S&&this.#Q){let A=this.#S[o],r=this.#Q[o];if(A&&r){let s=A-(this.#a.now()-r);a.ttl=s,a.start=Date.now()}}return this.#f&&(a.size=this.#f[o]),a}dump(){let t=[];for(let o of this.#H({allowStale:!0})){let i=this.#c[o],e=this.#g[o],a=this.#M(e)?e.__staleWhileFetching:e;if(a===void 0||i===void 0)continue;let A={value:a};if(this.#S&&this.#Q){A.ttl=this.#S[o];let r=this.#a.now()-this.#Q[o];A.start=Math.floor(Date.now()-r)}this.#f&&(A.size=this.#f[o]),t.unshift([i,A])}return t}load(t){this.clear();for(let[o,i]of t){if(i.start){let e=Date.now()-i.start;i.start=this.#a.now()-e}this.#v(o,i.value,i)}}set(t,o,i={}){let{status:e=Sa.hasSubscribers?{}:void 0}=i;i.status=e,e&&(e.op="set",e.key=t,o!==void 0&&(e.value=o),e.cache=this);let a=this.#v(t,o,i);return e&&Sa.hasSubscribers&&Sa.publish(e),a}#v(t,o,i,e){let{ttl:a=this.ttl,start:A,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:g}=i,c=this.#M(o);if(o===void 0)return g&&(g.set="deleted"),this.delete(t),this;let{noUpdateTTL:I=this.noUpdateTTL}=i;g&&!c&&(g.value=o);let d=this.#P(t,o,i.size||0,s,g);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#J(t,"set"),g&&(g.set="miss",g.maxEntrySizeExceeded=!0),this;let B=this.#n===0?void 0:this.#p.get(t);if(B===void 0)B=this.#n===0?this.#C:this.#u.length!==0?this.#u.pop():this.#n===this.#e?this.#K(!1):this.#n,this.#c[B]=t,this.#g[B]=o,this.#p.set(t,B),this.#I[this.#C]=B,this.#d[B]=this.#C,this.#C=B,this.#n++,this.#F(B,d,g),g&&(g.set="add"),I=!1,this.#N&&!c&&this.#r?.(o,t,"add");else{this.#Y(B);let f=this.#g[B];if(o!==f){if(!r)if(this.#M(f)){f!==e&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Q}=f;Q!==void 0&&Q!==o&&(this.#m&&this.#t?.(Q,t,"set"),this.#E&&this.#B?.push([Q,t,"set"]))}else this.#m&&this.#t?.(f,t,"set"),this.#E&&this.#B?.push([f,t,"set"]);if(this.#k(B),this.#F(B,d,g),this.#g[B]=o,!c){let Q=f&&this.#M(f)?f.__staleWhileFetching:f,y=Q===void 0?"add":o!==Q?"replace":"update";g&&(g.set=y,Q!==void 0&&(g.oldValue=Q)),this.#N&&this.onInsert?.(o,t,y)}}else c||(g&&(g.set="update"),this.#N&&this.onInsert?.(o,t,"update"))}if(a!==0&&!this.#S&&this.#T(),this.#S&&(I||this.#R(B,a,A),g&&this.#w(g,B)),!r&&this.#E&&this.#B){let f=this.#B,Q;for(;Q=f?.shift();)this.#l?.(...Q)}return this}pop(){try{for(;this.#n;){let t=this.#g[this.#h];if(this.#K(!0),this.#M(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#E&&this.#B){let t=this.#B,o;for(;o=t?.shift();)this.#l?.(...o)}}}#K(t){let o=this.#h,i=this.#c[o],e=this.#g[o],a=this.#M(e);a&&e.__abortController.abort(new Error("evicted"));let A=a?e.__staleWhileFetching:e;return(this.#m||this.#E)&&A!==void 0&&(this.#m&&this.#t?.(A,i,"evict"),this.#E&&this.#B?.push([A,i,"evict"])),this.#k(o),this.#y?.[o]&&(clearTimeout(this.#y[o]),this.#y[o]=void 0),t&&(this.#c[o]=void 0,this.#g[o]=void 0,this.#u.push(o)),this.#n===1?(this.#h=this.#C=0,this.#u.length=0):this.#h=this.#I[o],this.#p.delete(i),this.#n--,o}has(t,o={}){let{status:i=Sa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="has",i.key=t,i.cache=this);let e=this.#q(t,o);return Sa.hasSubscribers&&Sa.publish(i),e}#q(t,o={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:e}=o,a=this.#p.get(t);if(a!==void 0){let A=this.#g[a];if(this.#M(A)&&A.__staleWhileFetching===void 0)return!1;if(this.#_(a))e&&(e.has="stale",this.#w(e,a));else return i&&this.#O(a),e&&(e.has="hit",this.#w(e,a)),!0}else e&&(e.has="miss");return!1}peek(t,o={}){let{status:i=bF()?{}:void 0}=o;i&&(i.op="peek",i.key=t,i.cache=this),o.status=i;let e=this.#W(t,o);return Sa.hasSubscribers&&Sa.publish(i),e}#W(t,o){let{status:i,allowStale:e=this.allowStale}=o,a=this.#p.get(t);if(a===void 0||!e&&this.#_(a)){i&&(i.peek=a===void 0?"miss":"stale");return}let A=this.#g[a],r=this.#M(A)?A.__staleWhileFetching:A;return i&&(r!==void 0?(i.peek="hit",i.value=r):i.peek="miss"),r}#z(t,o,i,e){let a=o===void 0?void 0:this.#g[o];if(this.#M(a))return a;let A=new AbortController,{signal:r}=i;r?.addEventListener("abort",()=>A.abort(r.reason),{signal:A.signal});let s={signal:A.signal,options:i,context:e},g=(Q,y=!1)=>{let{aborted:m}=A.signal,T=i.ignoreFetchAbort&&Q!==void 0,_=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&Q!==void 0);if(i.status&&(m&&!y?(i.status.fetchAborted=!0,i.status.fetchError=A.signal.reason,T&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),m&&!T&&!y)return I(A.signal.reason,_);let R=B,K=this.#g[o];return(K===B||K===void 0&&T&&y)&&(Q===void 0?R.__staleWhileFetching!==void 0?this.#g[o]=R.__staleWhileFetching:this.#J(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#v(t,Q,s.options,R))),Q},c=Q=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=Q),I(Q,!1)),I=(Q,y)=>{let{aborted:m}=A.signal,T=m&&i.allowStaleOnFetchAbort,_=T||i.allowStaleOnFetchRejection,R=_||i.noDeleteOnFetchRejection,K=B;if(this.#g[o]===B&&(!R||!y&&K.__staleWhileFetching===void 0?this.#J(t,"fetch"):T||(this.#g[o]=K.__staleWhileFetching)),_)return i.status&&K.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),K.__staleWhileFetching;if(K.__returned===K)throw Q},d=(Q,y)=>{let m=this.#o?.(t,a,s);A.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(Q(void 0),i.allowStaleOnFetchAbort&&(Q=T=>g(T,!0)))}),m&&m instanceof Promise?m.then(T=>Q(T===void 0?void 0:T),y):m!==void 0&&Q(m)};i.status&&(i.status.fetchDispatched=!0);let B=new Promise(d).then(g,c),f=Object.assign(B,{__abortController:A,__staleWhileFetching:a,__returned:void 0});return o===void 0?(this.#v(t,f,{...s.options,status:void 0}),o=this.#p.get(t)):this.#g[o]=f,f}#M(t){if(!this.#D)return!1;let o=t;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController}fetch(t,o={}){let i=BB.hasSubscribers,{status:e=bF()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let a=this.#j(t,o);return e&&i&&(e.trace=!0,BB.tracePromise(()=>a,e).catch(()=>{})),a}async#j(t,o={}){let{allowStale:i=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:A=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:s=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:I=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:Q,forceRefresh:y=!1,status:m,signal:T}=o;if(m&&(m.op="fetch",m.key=t,y&&(m.forceRefresh=!0),m.cache=this),!this.#D)return m&&(m.fetch="get"),this.#Z(t,{allowStale:i,updateAgeOnGet:e,noDeleteOnStaleGet:a,status:m});let _={allowStale:i,updateAgeOnGet:e,noDeleteOnStaleGet:a,ttl:A,noDisposeOnSet:r,size:s,sizeCalculation:g,noUpdateTTL:c,noDeleteOnFetchRejection:I,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:f,ignoreFetchAbort:B,status:m,signal:T},R=this.#p.get(t);if(R===void 0){m&&(m.fetch="miss");let K=this.#z(t,R,_,Q);return K.__returned=K}else{let K=this.#g[R];if(this.#M(K)){let V=i&&K.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",V&&(m.returnedStale=!0)),V?K.__staleWhileFetching:K.__returned=K}let L=this.#_(R);if(!y&&!L)return m&&(m.fetch="hit"),this.#Y(R),e&&this.#O(R),m&&this.#w(m,R),K;let F=this.#z(t,R,_,Q),q=F.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=L?"stale":"refresh",q&&L&&(m.returnedStale=!0)),q?F.__staleWhileFetching:F.__returned=F}}forceFetch(t,o={}){let i=BB.hasSubscribers,{status:e=bF()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let a=this.#ee(t,o);return e&&i&&(e.trace=!0,BB.tracePromise(()=>a,e).catch(()=>{})),a}async#ee(t,o={}){let i=await this.#j(t,o);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,o={}){let{status:i=Sa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="memo",i.key=t,o.context&&(i.context=o.context),i.cache=this);let e=this.#ie(t,o);return i&&(i.value=e),Sa.hasSubscribers&&Sa.publish(i),e}#ie(t,o={}){let i=this.#i;if(!i)throw new Error("no memoMethod provided to constructor");let{context:e,status:a,forceRefresh:A,...r}=o;a&&A&&(a.forceRefresh=!0);let s=this.#Z(t,r),g=A||s===void 0;if(a&&(a.memo=g?"miss":"hit",g||(a.value=s)),!g)return s;let c=i(t,s,{options:r,context:e});return a&&(a.value=c),this.#v(t,c,r),c}get(t,o={}){let{status:i=Sa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="get",i.key=t,i.cache=this);let e=this.#Z(t,o);return i&&(e!==void 0&&(i.value=e),Sa.hasSubscribers&&Sa.publish(i)),e}#Z(t,o={}){let{allowStale:i=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:A}=o,r=this.#p.get(t);if(r===void 0){A&&(A.get="miss");return}let s=this.#g[r],g=this.#M(s);return A&&this.#w(A,r),this.#_(r)?g?(A&&(A.get="stale-fetching"),i&&s.__staleWhileFetching!==void 0?(A&&(A.returnedStale=!0),s.__staleWhileFetching):void 0):(a||this.#J(t,"expire"),A&&(A.get="stale"),i?(A&&(A.returnedStale=!0),s):void 0):(A&&(A.get=g?"fetching":"hit"),this.#Y(r),e&&this.#O(r),g?s.__staleWhileFetching:s)}#te(t,o){this.#d[o]=t,this.#I[t]=o}#Y(t){t!==this.#C&&(t===this.#h?this.#h=this.#I[t]:this.#te(this.#d[t],this.#I[t]),this.#te(this.#C,t),this.#C=t)}delete(t){return this.#J(t,"delete")}#J(t,o){Sa.hasSubscribers&&Sa.publish({op:"delete",delete:o,key:t,cache:this});let i=!1;if(this.#n!==0){let e=this.#p.get(t);if(e!==void 0)if(this.#y?.[e]&&(clearTimeout(this.#y[e]),this.#y[e]=void 0),i=!0,this.#n===1)this.#x(o);else{this.#k(e);let a=this.#g[e];if(this.#M(a)?a.__abortController.abort(new Error("deleted")):(this.#m||this.#E)&&(this.#m&&this.#t?.(a,t,o),this.#E&&this.#B?.push([a,t,o])),this.#p.delete(t),this.#c[e]=void 0,this.#g[e]=void 0,e===this.#C)this.#C=this.#d[e];else if(e===this.#h)this.#h=this.#I[e];else{let A=this.#d[e];this.#I[A]=this.#I[e];let r=this.#I[e];this.#d[r]=this.#d[e]}this.#n--,this.#u.push(e)}}if(this.#E&&this.#B?.length){let e=this.#B,a;for(;a=e?.shift();)this.#l?.(...a)}return i}clear(){return this.#x("delete")}#x(t){for(let o of this.#U({allowStale:!0})){let i=this.#g[o];if(this.#M(i))i.__abortController.abort(new Error("deleted"));else{let e=this.#c[o];this.#m&&this.#t?.(i,e,t),this.#E&&this.#B?.push([i,e,t])}}if(this.#p.clear(),this.#g.fill(void 0),this.#c.fill(void 0),this.#S&&this.#Q){this.#S.fill(0),this.#Q.fill(0);for(let o of this.#y??[])o!==void 0&&clearTimeout(o);this.#y?.fill(void 0)}if(this.#f&&this.#f.fill(0),this.#h=0,this.#C=0,this.#u.length=0,this.#s=0,this.#n=0,this.#E&&this.#B){let o=this.#B,i;for(;i=o?.shift();)this.#l?.(...i)}}};var ED=qe(Kr(),1);import{createHash as nHe,randomBytes as NB}from"crypto";var $X=["critical_block","critical_unblock_low","regular_high","regular_low","regular"];var ZfA=qe(Kr(),1),ga;(function(n){n[n.Connecting=0]="Connecting",n[n.AwaitingInitialSync=1]="AwaitingInitialSync",n[n.Syncing=2]="Syncing",n[n.Online=3]="Online"})(ga||(ga={}));var Vc;(function(n){n.BIZ_COMMERCE_VIOLATION_ALCOHOL="BIZ_COMMERCE_VIOLATION_ALCOHOL",n.BIZ_COMMERCE_VIOLATION_ADULT="BIZ_COMMERCE_VIOLATION_ADULT",n.BIZ_COMMERCE_VIOLATION_ANIMALS="BIZ_COMMERCE_VIOLATION_ANIMALS",n.BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS="BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS",n.BIZ_COMMERCE_VIOLATION_DATING="BIZ_COMMERCE_VIOLATION_DATING",n.BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS="BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS",n.BIZ_COMMERCE_VIOLATION_DRUGS="BIZ_COMMERCE_VIOLATION_DRUGS",n.BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC="BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC",n.BIZ_COMMERCE_VIOLATION_GAMBLING="BIZ_COMMERCE_VIOLATION_GAMBLING",n.BIZ_COMMERCE_VIOLATION_HEALTHCARE="BIZ_COMMERCE_VIOLATION_HEALTHCARE",n.BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY="BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY",n.BIZ_COMMERCE_VIOLATION_SUPPLEMENTS="BIZ_COMMERCE_VIOLATION_SUPPLEMENTS",n.BIZ_COMMERCE_VIOLATION_TOBACCO="BIZ_COMMERCE_VIOLATION_TOBACCO",n.BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT="BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT",n.BIZ_COMMERCE_VIOLATION_WEAPONS="BIZ_COMMERCE_VIOLATION_WEAPONS",n.BIZ_QUALITY="BIZ_QUALITY",n.DEFAULT="DEFAULT",n.WEB_COMPANION_ONLY="WEB_COMPANION_ONLY"})(Vc||(Vc={}));var e7;(function(n){n.NONE="NONE",n.FIRST_WARNING="FIRST_WARNING",n.SECOND_WARNING="SECOND_WARNING",n.CAPPED="CAPPED"})(e7||(e7={}));var A7;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.NOT_ACTIVE="NOT_ACTIVE",n.ACTIVE="ACTIVE",n.ACTIVE_UPGRADE_AVAILABLE="ACTIVE_UPGRADE_AVAILABLE"})(A7||(A7={}));var t7;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.ELIGIBLE="ELIGIBLE",n.ACTIVE_IN_CURRENT_CYCLE="ACTIVE_IN_CURRENT_CYCLE",n.EXHAUSTED="EXHAUSTED"})(t7||(t7={}));var RA=oe.WebMessageInfo.StubType,Ih=oe.WebMessageInfo.Status,yB;(function(n){n.PN="pn",n.LID="lid"})(yB||(yB={}));var wa;(function(n){n.xwa2_newsletter_create="xwa2_newsletter_create",n.xwa2_newsletter_subscribers="xwa2_newsletter_subscribers",n.xwa2_newsletter_view="xwa2_newsletter_view",n.xwa2_newsletter_metadata="xwa2_newsletter",n.xwa2_newsletter_admin_count="xwa2_newsletter_admin",n.xwa2_newsletter_mute_v2="xwa2_newsletter_mute_v2",n.xwa2_newsletter_unmute_v2="xwa2_newsletter_unmute_v2",n.xwa2_newsletter_follow="xwa2_newsletter_follow",n.xwa2_newsletter_unfollow="xwa2_newsletter_unfollow",n.xwa2_newsletter_join_v2="xwa2_newsletter_join_v2",n.xwa2_newsletter_leave_v2="xwa2_newsletter_leave_v2",n.xwa2_newsletter_change_owner="xwa2_newsletter_change_owner",n.xwa2_newsletter_demote="xwa2_newsletter_demote",n.xwa2_newsletter_delete_v2="xwa2_newsletter_delete_v2",n.xwa2_fetch_account_reachout_timelock="xwa2_fetch_account_reachout_timelock",n.xwa2_message_capping_info="xwa2_message_capping_info"})(wa||(wa={}));var ca;(function(n){n.CREATE="8823471724422422",n.UPDATE_METADATA="24250201037901610",n.METADATA="6563316087068696",n.SUBSCRIBERS="9783111038412085",n.FOLLOW="24404358912487870",n.UNFOLLOW="9767147403369991",n.MUTE="29766401636284406",n.UNMUTE="9864994326891137",n.ADMIN_COUNT="7130823597031706",n.CHANGE_OWNER="7341777602580933",n.DEMOTE="6551828931592903",n.DELETE="30062808666639665",n.REACHOUT_TIMELOCK="23983697327930364",n.MESSAGE_CAPPING_INFO="24503548349331633"})(ca||(ca={}));var $t;(function(n){n[n.connectionClosed=428]="connectionClosed",n[n.connectionLost=408]="connectionLost",n[n.connectionReplaced=440]="connectionReplaced",n[n.timedOut=408]="timedOut",n[n.loggedOut=401]="loggedOut",n[n.badSession=500]="badSession",n[n.restartRequired=515]="restartRequired",n[n.multideviceMismatch=411]="multideviceMismatch",n[n.forbidden=403]="forbidden",n[n.unavailableService=503]="unavailableService"})($t||($t={}));var mB={};Fr(mB,{DOUBLE_BYTE_TOKENS:()=>r7,SINGLE_BYTE_TOKENS:()=>a7,TAGS:()=>PUe,TOKEN_MAP:()=>LF});var PUe={LIST_EMPTY:0,DICTIONARY_0:236,DICTIONARY_1:237,DICTIONARY_2:238,DICTIONARY_3:239,INTEROP_JID:245,FB_JID:246,AD_JID:247,LIST_8:248,LIST_16:249,JID_PAIR:250,HEX_8:251,BINARY_8:252,BINARY_20:253,BINARY_32:254,NIBBLE_8:255,PACKED_MAX:127},r7=[["read-self","active","fbns","protocol","reaction","screen_width","heartbeat","deviceid","2:47DEQpj8","uploadfieldstat","voip_settings","retry","priority","longitude","conflict","false","ig_professional","replaced","preaccept","cover_photo","uncompressed","encopt","ppic","04","passive","status-revoke-drop","keygen","540","offer","rate","opus","latitude","w:gp2","ver","4","business_profile","medium","sender","prev_v_id","email","website","invited","sign_credential","05","transport","skey","reason","peer_abtest_bucket","America/Sao_Paulo","appid","refresh","100","06","404","101","104","107","102","109","103","member_add_mode","105","transaction-id","110","106","outgoing","108","111","tokens","followers","ig_handle","self_pid","tue","dec","thu","joinable","peer_pid","mon","features","wed","peer_device_presence","pn","delete","07","fri","audio_duration","admin","connected","delta","rcat","disable","collection","08","480","sat","phash","all","invite","accept","critical_unblock_low","group_update","signed_credential","blinded_credential","eph_setting","net","09","background_location","refresh_id","Asia/Kolkata","privacy_mode_ts","account_sync","voip_payload_type","service_areas","acs_public_key","v_id","0a","fallback_class","relay","actual_actors","metadata","w:biz","5","connected-limit","notice","0b","host_storage","fb_page","subject","privatestats","invis","groupadd","010","note.m4r","uuid","0c","8000","sun","372","1020","stage","1200","720","canonical","fb","011","video_duration","0d","1140","superadmin","012","Opening.m4r","keystore_attestation","dleq_proof","013","timestamp","ab_key","w:sync:app:state","0e","vertical","600","p_v_id","6","likes","014","500","1260","creator","0f","rte","destination","group","group_info","syncd_anti_tampering_fatal_exception_enabled","015","dl_bw","Asia/Jakarta","vp8/h.264","online","1320","fb:multiway","10","timeout","016","nse_retry","urn:xmpp:whatsapp:dirty","017","a_v_id","web_shops_chat_header_button_enabled","nse_call","inactive-upgrade","none","web","groups","2250","mms_hot_content_timespan_in_seconds","contact_blacklist","nse_read","suspended_group_deletion_notification","binary_version","018","https://www.whatsapp.com/otp/copy/","reg_push","shops_hide_catalog_attachment_entrypoint","server_sync",".","ephemeral_messages_allowed_values","019","mms_vcache_aggregation_enabled","iphone","America/Argentina/Buenos_Aires","01a","mms_vcard_autodownload_size_kb","nse_ver","shops_header_dropdown_menu_item","dhash","catalog_status","communities_mvp_new_iqs_serverprop","blocklist","default","11","ephemeral_messages_enabled","01b","original_dimensions","8","mms4_media_retry_notification_encryption_enabled","mms4_server_error_receipt_encryption_enabled","original_image_url","sync","multiway","420","companion_enc_static","shops_profile_drawer_entrypoint","01c","vcard_as_document_size_kb","status_video_max_duration","request_image_url","01d","regular_high","s_t","abt","share_ext_min_preliminary_image_quality","01e","32","syncd_key_rotation_enabled","data_namespace","md_downgrade_read_receipts2","patch","polltype","ephemeral_messages_setting","userrate","15","partial_pjpeg_bw_threshold","played-self","catalog_exists","01f","mute_v2"],["reject","dirty","announcement","020","13","9","status_video_max_bitrate","fb:thrift_iq","offline_batch","022","full","ctwa_first_business_reply_logging","h.264","smax_id","group_description_length","https://www.whatsapp.com/otp/code","status_image_max_edge","smb_upsell_business_profile_enabled","021","web_upgrade_to_md_modal","14","023","s_o","smaller_video_thumbs_status_enabled","media_max_autodownload","960","blocking_status","peer_msg","joinable_group_call_client_version","group_call_video_maximization_enabled","return_snapshot","high","America/Mexico_City","entry_point_block_logging_enabled","pop","024","1050","16","1380","one_tap_calling_in_group_chat_size","regular_low","inline_joinable_education_enabled","hq_image_max_edge","locked","America/Bogota","smb_biztools_deeplink_enabled","status_image_quality","1088","025","payments_upi_intent_transaction_limit","voip","w:g2","027","md_pin_chat_enabled","026","multi_scan_pjpeg_download_enabled","shops_product_grid","transaction_id","ctwa_context_enabled","20","fna","hq_image_quality","alt_jpeg_doc_detection_quality","group_call_max_participants","pkey","America/Belem","image_max_kbytes","web_cart_v1_1_order_message_changes_enabled","ctwa_context_enterprise_enabled","urn:xmpp:whatsapp:account","840","Asia/Kuala_Lumpur","max_participants","video_remux_after_repair_enabled","stella_addressbook_restriction_type","660","900","780","context_menu_ios13_enabled","mute-state","ref","payments_request_messages","029","frskmsg","vcard_max_size_kb","sample_buffer_gif_player_enabled","match_last_seen","510","4983","video_max_bitrate","028","w:comms:chat","17","frequently_forwarded_max","groups_privacy_blacklist","Asia/Karachi","02a","web_download_document_thumb_mms_enabled","02b","hist_sync","biz_block_reasons_version","1024","18","web_is_direct_connection_for_plm_transparent","view_once_write","file_max_size","paid_convo_id","online_privacy_setting","video_max_edge","view_once_read","enhanced_storage_management","multi_scan_pjpeg_encoding_enabled","ctwa_context_forward_enabled","video_transcode_downgrade_enable","template_doc_mime_types","hq_image_bw_threshold","30","body","u_aud_limit_sil_restarts_ctrl","other","participating","w:biz:directory","1110","vp8","4018","meta","doc_detection_image_max_edge","image_quality","1170","02c","smb_upsell_chat_banner_enabled","key_expiry_time_second","pid","stella_interop_enabled","19","linked_device_max_count","md_device_sync_enabled","02d","02e","360","enhanced_block_enabled","ephemeral_icon_in_forwarding","paid_convo_status","gif_provider","project_name","server-error","canonical_url_validation_enabled","wallpapers_v2","syncd_clear_chat_delete_chat_enabled","medianotify","02f","shops_required_tos_version","vote","reset_skey_on_id_change","030","image_max_edge","multicast_limit_global","ul_bw","21","25","5000","poll","570","22","031","1280","WhatsApp","032","bloks_shops_enabled","50","upload_host_switching_enabled","web_ctwa_context_compose_enabled","ptt_forwarded_features_enabled","unblocked","partial_pjpeg_enabled","fbid:devices","height","ephemeral_group_query_ts","group_join_permissions","order","033","alt_jpeg_status_quality","migrate","popular-bank","win_uwp_deprecation_killswitch_enabled","web_download_status_thumb_mms_enabled","blocking","url_text","035","web_forwarding_limit_to_groups","1600","val","1000","syncd_msg_date_enabled","bank-ref-id","max_subject","payments_web_enabled","web_upload_document_thumb_mms_enabled","size","request","ephemeral","24","receipt_agg","ptt_remember_play_position","sampling_weight","enc_rekey","mute_always","037","034","23","036","action","click_to_chat_qr_enabled","width","disabled","038","md_blocklist_v2","played_self_enabled","web_buttons_message_enabled","flow_id","clear","450","fbid:thread","bloks_session_state","America/Lima","attachment_picker_refresh","download_host_switching_enabled","1792","u_aud_limit_sil_restarts_test2","custom_urls","device_fanout","optimistic_upload","2000","key_cipher_suite","web_smb_upsell_in_biz_profile_enabled","e","039","siri_post_status_shortcut","pair-device","lg","lc","stream_attribution_url","model","mspjpeg_phash_gen","catalog_send_all","new_multi_vcards_ui","share_biz_vcard_enabled","-","clean","200","md_blocklist_v2_server","03b","03a","web_md_migration_experience","ptt_conversation_waveform","u_aud_limit_sil_restarts_test1"],["64","ptt_playback_speed_enabled","web_product_list_message_enabled","paid_convo_ts","27","manufacturer","psp-routing","grp_uii_cleanup","ptt_draft_enabled","03c","business_initiated","web_catalog_products_onoff","web_upload_link_thumb_mms_enabled","03e","mediaretry","35","hfm_string_changes","28","America/Fortaleza","max_keys","md_mhfs_days","streaming_upload_chunk_size","5541","040","03d","2675","03f","...","512","mute","48","041","alt_jpeg_quality","60","042","md_smb_quick_reply","5183","c","1343","40","1230","043","044","mms_cat_v1_forward_hot_override_enabled","user_notice","ptt_waveform_send","047","Asia/Calcutta","250","md_privacy_v2","31","29","128","md_messaging_enabled","046","crypto","690","045","enc_iv","75","failure","ptt_oot_playback","AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk","w","048","2201","web_large_files_ui","Asia/Makassar","812","status_collapse_muted","1334","257","2HP4dm","049","patches","1290","43cY6T","America/Caracas","web_sticker_maker","campaign","ptt_pausable_enabled","33","42","attestation","biz","04b","query_linked","s","125","04a","810","availability","1411","responsiveness_v2_m1","catalog_not_created","34","America/Santiago","1465","enc_p","04d","status_info","04f","key_version","..","04c","04e","md_group_notification","1598","1215","web_cart_enabled","37","630","1920","2394","-1","vcard","38","elapsed","36","828","peer","pricing_category","1245","invalid","stella_ios_enabled","2687","45","1528","39","u_is_redial_audio_1104_ctrl","1025","1455","58","2524","2603","054","bsp_system_message_enabled","web_pip_redesign","051","verify_apps","1974","1272","1322","1755","052","70","050","1063","1135","1361","80","1096","1828","1851","1251","1921","key_config_id","1254","1566","1252","2525","critical_block","1669","max_available","w:auth:backup:token","product","2530","870","1022","participant_uuid","web_cart_on_off","1255","1432","1867","41","1415","1440","240","1204","1608","1690","1846","1483","1687","1749","69","url_number","053","1325","1040","365","59","Asia/Riyadh","1177","test_recommended","057","1612","43","1061","1518","1635","055","1034","1375","750","1430","event_code","1682","503","55","865","78","1309","1365","44","America/Guayaquil","535","LIMITED","1377","1613","1420","1599","1822","05a","1681","password","1111","1214","1376","1478","47","1082","4282","Europe/Istanbul","1307","46","058","1124","256","rate-overlimit","retail","u_a_socket_err_fix_succ_test","1292","1370","1388","520","861","psa","regular","1181","1766","05b","1183","1213","1304","1537"],["1724","profile_picture","1071","1314","1605","407","990","1710","746","pricing_model","056","059","061","1119","6027","65","877","1607","05d","917","seen","1516","49","470","973","1037","1350","1394","1480","1796","keys","794","1536","1594","2378","1333","1524","1825","116","309","52","808","827","909","495","1660","361","957","google","1357","1565","1967","996","1775","586","736","1052","1670","bank","177","1416","2194","2222","1454","1839","1275","53","997","1629","6028","smba","1378","1410","05c","1849","727","create","1559","536","1106","1310","1944","670","1297","1316","1762","en","1148","1295","1551","1853","1890","1208","1784","7200","05f","178","1283","1332","381","643","1056","1238","2024","2387","179","981","1547","1705","05e","290","903","1069","1285","2436","062","251","560","582","719","56","1700","2321","325","448","613","777","791","51","488","902","Asia/Almaty","is_hidden","1398","1527","1893","1999","2367","2642","237","busy","065","067","233","590","993","1511","54","723","860","363","487","522","605","995","1321","1691","1865","2447","2462","NON_TRANSACTIONAL","433","871","432","1004","1207","2032","2050","2379","2446","279","636","703","904","248","370","691","700","1068","1655","2334","060","063","364","533","534","567","1191","1210","1473","1827","069","701","2531","514","prev_dhash","064","496","790","1046","1139","1505","1521","1108","207","544","637","final","1173","1293","1694","1939","1951","1993","2353","2515","504","601","857","modify","spam_request","p_121_aa_1101_test4","866","1427","1502","1638","1744","2153","068","382","725","1704","1864","1990","2003","Asia/Dubai","508","531","1387","1474","1632","2307","2386","819","2014","066","387","1468","1706","2186","2261","471","728","1147","1372","1961"]],a7=["","xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","notification","disappearing_mode","status","jid","broadcast","user","devices","device_hash","to","offline","message","result","class","xmlns","duration","notify","iq","t","ack","g.us","enc","urn:xmpp:whatsapp:push","presence","config_value","picture","verified_name","config_code","key-index-list","contact","mediatype","routing_info","edge_routing","get","read","urn:xmpp:ping","fallback_hostname","0","chatstate","business_hours_config","unavailable","download_buckets","skmsg","verified_level","composing","handshake","device-list","media","text","fallback_ip4","media_conn","device","creation","location","config","item","fallback_ip6","count","w:profile:picture","image","business","2","hostname","call-creator","display_name","relaylatency","platform","abprops","success","msg","offline_preview","prop","key-index","v","day_of_week","pkmsg","version","1","ping","w:p","download","video","set","specific_hours","props","primary","unknown","hash","commerce_experience","last","subscribe","max_buckets","call","profile","member_since_text","close_time","call-id","sticker","mode","participants","value","query","profile_options","open_time","code","list","host","ts","contacts","upload","lid","preview","update","usync","w:stats","delivery","auth_ttl","context","fail","cart_enabled","appdata","category","atn","direct_connection","decrypt-fail","relay_id","mmg-fallback.whatsapp.net","target","available","name","last_id","mmg.whatsapp.net","categories","401","is_new","index","tctoken","ip4","token_id","latency","recipient","edit","ip6","add","thumbnail-document","26","paused","true","identity","stream:error","key","sidelist","background","audio","3","thumbnail-image","biz-cover-photo","cat","gcm","thumbnail-video","error","auth","deny","serial","in","registration","thumbnail-link","remove","00","gif","thumbnail-gif","tag","capability","multicast","item-not-found","description","business_hours","config_expo_key","md-app-state","expiration","fallback","ttl","300","md-msg-hist","device_orientation","out","w:m","open_24h","side_list","token","inactive","01","document","te2","played","encrypt","msgr","hide","direct_path","12","state","not-authorized","url","terminate","signature","status-revoke-delay","02","te","linked_accounts","trusted_contact","timezone","ptt","kyc-id","privacy_token","readreceipts","appointment_only","address","expected_ts","privacy","7","android","interactive","device-identity","enabled","attribute_padding","1080","03","screen_height"],LF={};for(let[n,t]of a7.entries())LF[t]={index:n};for(let[n,t]of r7.entries())for(let[o,i]of t.entries())LF[i]={dict:n,index:o};var OA="@s.whatsapp.net";var i7="0@c.us";var Jt;(function(n){n[n.WHATSAPP=0]="WHATSAPP",n[n.LID=1]="LID",n[n.HOSTED=128]="HOSTED",n[n.HOSTED_LID=129]="HOSTED_LID"})(Jt||(Jt={}));var o7=(n,t)=>{switch(t){case Jt.LID:return"lid";case Jt.HOSTED:return"hosted";case Jt.HOSTED_LID:return"hosted.lid";case Jt.WHATSAPP:default:return n}},yr=(n,t,o,i)=>`${n||""}${i?`_${i}`:""}${o?`:${o}`:""}@${t}`,fA=n=>{let t=typeof n=="string"?n.indexOf("@"):-1;if(t<0)return;let o=n.slice(t+1),i=n.slice(0,t),[e,a]=i.split(":"),[A,r]=e.split("_"),s=Jt.WHATSAPP;return o==="lid"?s=Jt.LID:o==="hosted"?s=Jt.HOSTED:o==="hosted.lid"?s=Jt.HOSTED_LID:r&&(s=parseInt(r)),{server:o,user:A,domainType:s,device:a?+a:void 0}},Nt=(n,t)=>fA(n)?.user===fA(t)?.user,lh=n=>n?.endsWith("@bot"),_t=n=>n?.endsWith("@s.whatsapp.net"),qA=n=>n?.endsWith("@lid"),SB=n=>n?.endsWith("@broadcast"),xr=n=>n?.endsWith("@g.us"),Lg=n=>n==="status@broadcast",Wc=n=>n?.endsWith("@newsletter"),mr=n=>n?.endsWith("@hosted"),Ia=n=>n?.endsWith("@hosted.lid"),GUe=/^1313555\d{4}$|^131655500\d{2}$/,n7=n=>n&&GUe.test(n.split("@")[0])&&n.endsWith("@c.us"),uA=n=>{let t=fA(n);if(!t)return"";let{user:o,server:i}=t;return yr(o,i==="c.us"?"s.whatsapp.net":i)},s7=(n,t)=>{let i=fA(n)?.device||0,{server:e,user:a}=fA(t);return yr(a,e,i)};var g7=(n,t=mB,o=[0])=>{let i=c7(n,t,o);return Buffer.from(i)},c7=({tag:n,attrs:t,content:o},i,e)=>{let{TAGS:a,TOKEN_MAP:A}=i,r=F=>e.push(F&255),s=(F,q,V=!1)=>{for(let x=0;x>G*8&255)}},g=F=>{for(let q of F)e.push(q)},c=F=>{g([F>>8&255,F&255])},I=F=>g([F>>16&15,F>>8&255,F&255]),d=F=>{if(F>=4294967296)throw new Error("string too large to encode: "+F);F>=1<<20?(r(a.BINARY_32),s(F,4)):F>=256?(r(a.BINARY_20),I(F)):(r(a.BINARY_8),r(F))},B=F=>{let q=Buffer.from(F,"utf-8");d(q.length),g(q)},f=({domainType:F,device:q,user:V,server:x})=>{typeof q<"u"?(r(a.AD_JID),r(F||0),r(q||0),R(V)):(r(a.JID_PAIR),V.length?R(V):r(a.LIST_EMPTY),R(x))},Q=F=>{switch(F){case"-":return 10;case".":return 11;case"\0":return 15;default:if(F>="0"&&F<="9")return F.charCodeAt(0)-48;throw new Error(`invalid byte for nibble "${F}"`)}},y=F=>{if(F>="0"&&F<="9")return F.charCodeAt(0)-48;if(F>="A"&&F<="F")return 10+F.charCodeAt(0)-65;if(F>="a"&&F<="f")return 10+F.charCodeAt(0)-97;if(F==="\0")return 15;throw new Error(`Invalid hex char "${F}"`)},m=(F,q)=>{if(F.length>a.PACKED_MAX)throw new Error("Too many bytes to pack");r(q==="nibble"?a.NIBBLE_8:a.HEX_8);let V=Math.ceil(F.length/2);F.length%2!==0&&(V|=128),r(V);let x=q==="nibble"?Q:y,G=(U,N)=>x(U)<<4|x(N),J=Math.floor(F.length/2);for(let U=0;U{if(!F||F.length>a.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&q!=="-"&&q!==".")return!1;return!0},_=F=>{if(!F||F.length>a.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&!(q>="A"&&q<="F"))return!1;return!0},R=F=>{if(F==null){r(a.LIST_EMPTY);return}if(F===""){B(F);return}let q=A[F];if(q)typeof q.dict=="number"&&r(a.DICTIONARY_0+q.dict),r(q.index);else if(T(F))m(F,"nibble");else if(_(F))m(F,"hex");else{let V=fA(F);V?f(V):B(F)}},K=F=>{F===0?r(a.LIST_EMPTY):F<256?g([a.LIST_8,F]):(r(a.LIST_16),c(F))};if(!n)throw new Error("Invalid node: tag cannot be undefined");let L=Object.keys(t||{}).filter(F=>typeof t[F]<"u"&&t[F]!==null);K(2*L.length+1+(typeof o<"u"?1:0)),R(n);for(let F of L)typeof t[F]=="string"&&(R(F),R(t[F]));if(typeof o=="string")R(o);else if(Buffer.isBuffer(o)||o instanceof Uint8Array)d(o.length),g(o);else if(Array.isArray(o)){let F=o.filter(q=>q&&(q.tag||Buffer.isBuffer(q)||q instanceof Uint8Array||typeof q=="string"));K(F.length);for(let q of F)c7(q,i,e)}else if(!(typeof o>"u"))throw new Error(`invalid children for header "${n}": ${o} (${typeof o})`);return e};import{promisify as FUe}from"util";import{inflate as LUe}from"zlib";var UUe=FUe(LUe),HUe=async n=>(2&n.readUInt8()?n=await UUe(n.slice(1)):n=n.slice(1),n),I7=(n,t,o={index:0})=>{let{DOUBLE_BYTE_TOKENS:i,SINGLE_BYTE_TOKENS:e,TAGS:a}=t,A=k=>{if(o.index+k>n.length)throw new Error("end of stream")},r=()=>{let k=n[o.index];return o.index+=1,k},s=()=>(A(1),r()),g=k=>{A(k);let z=n.slice(o.index,o.index+k);return o.index+=k,z},c=k=>g(k).toString("utf-8"),I=(k,z=!1)=>{A(k);let Ae=0;for(let ie=0;ie(A(3),((r()&15)<<16)+(r()<<8)+r()),B=k=>{if(k>=0&&k<16)return k<10?48+k:65+k-10;throw new Error("invalid hex: "+k)},f=k=>{if(k>=0&&k<=9)return 48+k;switch(k){case 10:return 45;case 11:return 46;case 15:return 0;default:throw new Error("invalid nibble: "+k)}},Q=(k,z)=>{if(k===a.NIBBLE_8)return f(z);if(k===a.HEX_8)return B(z);throw new Error("unknown tag: "+k)},y=k=>{let z=s(),Ae="";for(let ie=0;ie<(z&127);ie++){let we=s();Ae+=String.fromCharCode(Q(k,(we&240)>>4)),Ae+=String.fromCharCode(Q(k,we&15))}return z>>7!==0&&(Ae=Ae.slice(0,-1)),Ae},m=k=>k===a.LIST_EMPTY||k===a.LIST_8||k===a.LIST_16,T=k=>{switch(k){case a.LIST_EMPTY:return 0;case a.LIST_8:return s();case a.LIST_16:return I(2);default:throw new Error("invalid tag for list size: "+k)}},_=()=>{let k=F(s()),z=F(s());if(z)return(k||"")+"@"+z;throw new Error("invalid jid pair: "+k+", "+z)},R=()=>{let k=s(),z=Number(k),Ae=s(),ie=F(s()),we="s.whatsapp.net";return z===Jt.LID?we="lid":z===Jt.HOSTED?we="hosted":z===Jt.HOSTED_LID&&(we="hosted.lid"),yr(ie,we,Ae)},K=()=>{let k=F(s()),z=I(2),Ae=F(s());return`${k}:${z}@${Ae}`},L=()=>{let k=F(s()),z=I(2),Ae=I(2),ie="interop",we=o.index;try{ie=F(s())}catch{o.index=we}return`${Ae}-${k}:${z}@${ie}`},F=k=>{if(k>=1&&k{let z=[],Ae=T(k);for(let ie=0;ie{let Ae=i[k];if(!Ae)throw new Error(`Invalid double token dict (${k})`);let ie=Ae[z];if(typeof ie>"u")throw new Error(`Invalid double token (${z})`);return ie},x=T(s()),G=F(s());if(!x||!G.length)throw new Error("invalid node");let J={},U;if(x===0||!G)throw new Error("invalid node");let N=x-1>>1;for(let k=0;k{let t=await HUe(n);return I7(t,mB)};var d7=qe(Kr(),1);var p7=new WeakMap,PA=(n,t)=>{if(!n||!Array.isArray(n.content))return[];let o=p7.get(n);if(!o){o=new Map;for(let i of n.content){let e=o.get(i.tag);e||o.set(i.tag,e=[]),e.push(i)}p7.set(n,o)}return o.get(t)||[]},le=(n,t)=>PA(n,t)[0],_s=({content:n})=>Array.isArray(n)?n:[],Da=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return o},jA=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return Buffer.from(o).toString("utf-8");if(typeof o=="string")return o},Zc=(n,t,o)=>{let i=Da(n,t);if(i)return KUe(i,o)},Ji=n=>{let t=le(n,"error");if(t)throw new d7.Boom(t.attrs.text||"Unknown error",{data:+t.attrs.code})},UF=(n,t)=>PA(n,t).reduce((e,{attrs:a})=>(typeof a.name=="string"?e[a.name]=a.value||a.config_value:e[a.config_code]=a.value||a.config_value,e),{});function KUe(n,t){let o=0;for(let i=0;i" ".repeat(n);function Gn(n,t=0){if(!n)return n;if(typeof n=="string")return iD(t)+n;if(n instanceof Uint8Array)return iD(t)+Buffer.from(n).toString("hex");if(Array.isArray(n))return n.map(a=>iD(t+1)+Gn(a,t+1)).join(` +${B}`:dt(m),s,g),I||await this.#o.markSeen(A)}catch(T){this.#s.error?.("[dsh-weixin] failed to send the safe error reply:",T)}}}async#P(t,o,i,e){this.#I?.throwIfAborted();let a=this.#h.get(i),A=e.claimedReplyMessageId===o;if(!a||a!==e||a.submitting)return A&&(!a||a!==e)?this.#v(t,o):this.#R(t,o,i,{releaseMessageId:!1});if(this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString();let r=Or(Ml(t)),s=Or(t?.context_token)??void 0,g=Or(t?.run_id)??void 0;if(!r||sB(t)){await this.#M(e.actor,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),s,g);return}let c=this.#h.get(i);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#M(e.actor,ww(),s,g);return}return this.#R(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.contextToken=s,c.runId=g,c.needsPresentation){try{await this.#L(c)}catch{this.#n.lastError=w("\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to retry an interaction question"),c.interaction.reconnect?.();return}let d=this.#h.get(i);if(!d||d!==e||d.submitting){if(A&&(!d||d!==e)){await this.#M(e.actor,ww(),s,g).catch(()=>{});return}return this.#R(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(wi(I,r)),c.index+=1,c.index{});return}if(this.#h.get(i)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#n.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to answer a Harness interaction"),await this.#M(c.actor,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002"),c.contextToken,c.runId).catch(()=>{})}}}async#H(t,{key:o,actor:i,contextToken:e,runId:a}){if(t?.kind==="approval")return this.#Q.handleRequested(t,{key:o,actor:i,send:c=>this.#M(i,c,e,a)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!mi(c))){this.#s.warn?.("[dsh-weixin] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#M(i,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),e,a).catch(()=>{});return}let s=this.#h.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#L(s);return}if(this.#C.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:i,questions:A,answers:[],index:0,contextToken:e,runId:a,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#h.set(o,g),this.#C.set(r,o),await this.#L(g)}async#U(t){if(t?.kind==="approval"){await this.#Q.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let i=this.#C.get(o);i&&this.#q(i,o)}#L(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let i=this.#M(t.actor,Si(o,t.index,t.questions.length),t.contextToken,t.runId).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===i&&(t.presentationPromise=null)});return t.presentationPromise=i,i}async#v(t,o){this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),await this.#M(Or(t?.from_user_id),ww(),Or(t?.context_token)??void 0,Or(t?.run_id)??void 0).catch(()=>{}))}#K(t,o){let i=this.#h.get(t);return!i||o!==void 0&&i.interactionId!==o?null:(this.#h.delete(t),this.#C.delete(i.interactionId),i)}#q(t,o){return this.#K(t,o)!==null}async#W(t){let o=this.#K(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Weixin interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#s.warn?.("[dsh-weixin] failed to cancel a pending Harness interaction")}}async#z(t,o,i){if(this.#I?.aborted)return;this.#n.lastError=i?.message??String(i);let e=At(this.#n,i);this.#s.error?.(`[dsh-weixin] failed to process an interaction reply [${e.referenceId}]:`,i),this.#o.hasSeen(o)||await this.#o.markSeen(o).catch(()=>{}),await this.#M(Or(t?.from_user_id),dt(e),Or(t?.context_token)??void 0,Or(t?.run_id)??void 0).catch(()=>{})}async#M(t,o,i,e){await this.#Z();let a=[],A=WZ(o,this.#c);for(let r=0;r{}).then(t);return this.#N=o.catch(()=>{}),o}async#ie(t,o){let i=Or(t);if(!i||this.#T||this.#I?.aborted||Date.now(){if(e!==this.#E||this.#T)return!1;let a=this.#y;if(!a){let A=await this.#e.getConfig({baseUrl:this.#A,token:this.#t,toUserId:i,contextToken:o,signal:this.#I});if(a=Or(A?.typingTicket),!a)return this.#O=Date.now()+XG,!1;if(e!==this.#E||this.#T)return!1;this.#y=a,this.#O=0}return this.#m=i,await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:i,typingTicket:a,status:1,signal:this.#I}),e!==this.#E||this.#T?!1:(this.#w=!1,this.#O=0,this.#te(e),!0)})}catch(a){return e===this.#E&&(this.#Y(),this.#w=!!(this.#m&&this.#y),this.#O=Date.now()+XG),!this.#I?.aborted&&!this.#T&&this.#s.warn?.("[dsh-weixin] typing indicator failed:",a),!1}}async#Z({signal:t=AbortSignal.timeout(5e3)}={}){++this.#E,this.#Y();let o=this.#m,i=this.#y,e=this.#w;if(this.#m=null,typeof this.#e.sendTyping!="function")return!1;try{return await this.#ee(async()=>{if(!o||!i)return!1;try{await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:o,typingTicket:i,status:2,signal:t})}finally{e&&this.#y===i&&(this.#y=null),this.#w=!1}return!0})}catch(a){return t?.aborted||this.#s.warn?.("[dsh-weixin] typing cancellation failed:",a),!1}}#te(t){if(this.#Y(),t!==this.#E||!this.#m||this.#T)return;let o=setTimeout(()=>{this.#D===o&&(this.#D=null),this.#ee(async()=>t!==this.#E||!this.#m||this.#T?!1:(await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:this.#m,typingTicket:this.#y,status:1,signal:this.#I}),!0)).then(i=>{i&&this.#te(t)}).catch(i=>{t===this.#E&&(this.#w=!!(this.#m&&this.#y),this.#O=Date.now()+XG,!this.#I?.aborted&&!this.#T&&this.#s.warn?.("[dsh-weixin] typing keepalive failed:",i))})},this.#g);o.unref?.(),this.#D=o}#Y(){this.#D&&clearTimeout(this.#D),this.#D=null}#J(t,o,i){return this.#h.has(t)||this.#Q.hasPending(t)?Promise.resolve(!1):this.#ie(o,i)}async#x(t,o,i,e,a,A){let r=(g,c)=>this.#e[g]({baseUrl:this.#A,token:this.#t,toUserId:t,file:c,contextToken:e,runId:a,signal:this.#I}),s=await vo({artifacts:i,baseReceipt:A,deliveryId:o,aggregatePresentation:A?"weixin-text-and-files":"weixin-files",channelKey:"weixin",signal:this.#I,sendImage:typeof this.#e.sendImage=="function"?g=>r("sendImage",g):void 0,sendFile:typeof this.#e.sendFile=="function"?g=>r("sendFile",g):void 0,onFailure:(g,c)=>At(this.#n,c,{userMessage:r2e(g?.fileName,c),reason:c?.code}),sendFailureNotice:(g,c,I)=>this.#M(t,dt(I),e,a),logger:this.#s});return this.#n.artifactsSent=(this.#n.artifactsSent??0)+s.artifactsSent,this.#n.artifactSendErrors=(this.#n.artifactSendErrors??0)+s.artifactSendErrors,{receipt:s.receipt,userVisible:s.userVisible,artifactSendErrors:s.artifactSendErrors}}};var a2e=Object.freeze([250,1e3,3e3]),i2e=new Set(["harness-connect-failed","harness-timeout","harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden","harness-api-not-found","harness-http-failed","harness-response-invalid","harness-rpc-rejected"]);function o2e(n){if(n===void 0)return[...a2e];if(!Array.isArray(n))throw new TypeError("startRetryDelaysMs must be an array");return n.map(t=>{if(!Number.isFinite(t)||t<0)throw new TypeError("startRetryDelaysMs must contain non-negative delays");return t})}function n2e(n){return n instanceof NA?n.code==="network-error"||n.code==="timeout"?!0:n.code==="http-error"&&(n.status===408||n.status===425||n.status===429||n.status>=500):!1}function s2e(n,t){let o=new Error(`Weixin runtime failed during ${n}`,{cause:t});return o.name="WeixinRuntimeStartError",o.code=n,o}function g2e(n){let t=i2e.has(n?.code)?n.code:"harness-check-unknown-failed";return s2e(t,n)}function n9(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let a=setTimeout(()=>{t?.removeEventListener("abort",A),o()},n),A=()=>{clearTimeout(a),t?.removeEventListener("abort",A),i(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",A,{once:!0})})}function c2e(n){if(!Array.isArray(n)||n.length<2)return Array.isArray(n)?n:[];let t=["seq","create_time_ms"].find(o=>n.every(i=>typeof i?.[o]=="number"&&Number.isFinite(i[o])||typeof i?.[o]=="string"&&i[o].trim()&&Number.isFinite(Number(i[o]))));return t?n.map((o,i)=>({message:o,index:i,order:Number(o[t])})).sort((o,i)=>o.order-i.order||o.index-i.index).map(({message:o})=>o):n}function I2e(){return{startedAt:null,ready:!1,weixinConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastError:null,...$G()}}var IB=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=I2e();#g=null;#I=null;#d=null;#h=null;constructor({api:t,config:o,token:i,harness:e,state:a,contextEnhancement:A,accessPolicy:r,logger:s=console,replyTimeoutMs:g=6e5,maxMessageChars:c=bl,startRetryDelaysMs:I}){if(!t||!o||!i||!e||!a)throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,this.#s=c,this.#p=o2e(I)}get status(){return structuredClone(this.#c)}async start(){return this.#c.ready&&this.#d?this.status:this.#h?this.#h:(this.#h=this.#C().finally(()=>{this.#h=null}),this.#h)}async#C(){await this.stop(),this.#c.startedAt=new Date().toISOString(),this.#c.weixinConnectionState="connecting",this.#c.lastError=null;try{try{await this.#r.ensureRunning()}catch(o){throw g2e(o)}this.#c.harnessReachable=!0,await this.#u(),this.#I=new AbortController;let t=this.#I.signal;return this.#g=new Dw({api:this.#e,baseUrl:this.#A.baseUrl,token:this.#t,ownerUserId:this.#A.ownerUserId,harness:this.#r,state:this.#l,contextEnhancement:this.#o,accessPolicy:this.#i,status:this.#c,logger:this.#a,replyTimeoutMs:this.#n,maxMessageChars:this.#s,signal:t}),this.#c.ready=!0,this.#c.weixinConnectionState="connected",this.#c.lastCheckedAt=Date.now(),this.#d=this.#B(t).catch(o=>{t.aborted||(this.#c.ready=!1,this.#c.weixinConnectionState="failed",this.#c.lastError=o?.message??String(o),this.#a.error?.(`[dsh-weixin] account ${this.#A.botId} monitor stopped:`,o))}),this.status}catch(t){throw this.#I?.abort(),this.#I=null,this.#g=null,this.#c.ready=!1,this.#c.weixinConnectionState="failed",this.#c.lastError=t?.message??String(t),t}}async#u(){for(let t=0;;t+=1)try{return await this.#e.notifyStart({baseUrl:this.#A.baseUrl,token:this.#t})}catch(o){let i=this.#p[t];if(i===void 0||!n2e(o))throw o;this.#a.warn?.(`[dsh-weixin] account ${this.#A.botId} start request failed; retrying in ${i}ms:`,o),await n9(i)}}async#B(t){let o=0;for(;!t.aborted;)try{let i=await this.#e.getUpdates({baseUrl:this.#A.baseUrl,token:this.#t,getUpdatesBuf:this.#l.getUpdatesBuf(),signal:t});if(t.aborted)return;if(i?.ret!==void 0&&i.ret!==0||i?.errcode!==void 0&&i.errcode!==0){let a=i.errcode??i.ret;throw new NA(a===-14?"stale-token":"updates-rejected",a===-14?w("\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002"))}o=0,this.#c.ready=!0,this.#c.weixinConnectionState="connected",this.#c.lastCheckedAt=Date.now(),this.#c.lastError=null;for(let a of c2e(i?.msgs))this.#g.accept(a).catch(A=>{t.aborted||this.#a.error?.(`[dsh-weixin] account ${this.#A.botId} message handling failed:`,A)});typeof i?.get_updates_buf=="string"&&i.get_updates_buf&&await this.#l.setGetUpdatesBuf(i.get_updates_buf)}catch(i){if(t.aborted)return;if(o+=1,this.#c.lastError=i?.message??String(i),this.#a.warn?.(`[dsh-weixin] account ${this.#A.botId} poll failed (${o}/3):`,i),i instanceof NA&&i.code==="stale-token"||o>=3)throw i;await n9(Math.min(2e3*2**(o-1),1e4),t)}}async stop(){let t=this.#d,o=this.#g,i=!!(this.#I||t||this.#c.ready);if(this.#I?.abort(),this.#I=null,this.#d=null,await o?.close?.(),await t?.catch(()=>{}),await o?.waitForIdle(),this.#g=null,i)try{await this.#e.notifyStop({baseUrl:this.#A.baseUrl,token:this.#t,signal:AbortSignal.timeout(1e4)})}catch(e){this.#a.warn?.(`[dsh-weixin] account ${this.#A.botId} stop notification failed:`,e)}return this.#c.ready=!1,this.#c.weixinConnectionState="idle",this.status}async sendConnectionTest(t){let o=vE(this.#l),i=typeof o?.toUserId=="string"&&o.toUserId.trim()?o.toUserId.trim():typeof this.#A.ownerUserId=="string"&&this.#A.ownerUserId.trim()?this.#A.ownerUserId.trim():null;if(!i)throw Cr(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));if(!this.#c.ready||!this.#I)throw new Error("Weixin runtime is not connected");return await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:i,text:t,signal:this.#I.signal}),{sent:!0}}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.toUserId=="string"?t.route.toUserId.trim():"";if(t?.kind!=="user"||!e){let a=new TypeError("Invalid Weixin proactive delivery target");throw a.code="invalid-target",a}if(!this.#c.ready||!this.#I){let a=new Error("Weixin runtime is not connected");throw a.code="bot-not-connected",a}return i?.throwIfAborted(),await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:e,text:o,signal:i??this.#I.signal}),{sent:!0}}};var s9=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function l2e(n){if(!Array.isArray(n)||n.length===0)return[...s9];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...s9]}var Ow=class{#e;#A;#t;#r;#l;#o;#i;#a=null;#n=null;#s=0;#p=!1;#c=!1;#g;#I;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=l2e(e),this.#l=Number.isFinite(a)&&a>=0?a:15e3,this.#o=A,this.#i=r,this.#g=new Promise(s=>{this.#I=s})}get ready(){return this.#g}start(){return this.#c||this.#p?this:(this.#c=!0,this.#d(0),this)}async close(){this.#p||(this.#p=!0,this.#a!==null&&this.#i(this.#a),this.#a=null,await this.#n?.catch(()=>{}),this.#I?.(null),this.#I=null)}#d(t){this.#p||(this.#a=this.#o(()=>{this.#a=null,this.#h()},t),this.#a?.unref?.())}async#h(){if(this.#p||this.#n)return;let t=this.#C();this.#n=t;try{await t}finally{this.#n===t&&(this.#n=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#I?.(t),this.#I=null;let{configured:o,connected:i}=t.totals;if(iLa(n),B=h2e(t),f=await new e(B.config).load(),Q=_l(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("weixin",k)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=new Map,K=k=>_l(B.accounts,k,"state.json"),L=async k=>{let z=R.get(k);return z||(z=await new a(K(k)).load(),R.set(k,z)),z},F=ja(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:V,fileIngressExecutor:x}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new A({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...V?{sessionMaintenanceExecutor:V}:{},...x?{fileIngressExecutor:x}:{}}),J=new r({api:g,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:k,config:z,token:Ae})=>{let ie=await L(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("weixin",z)});let we=Ka(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:d});return new s({api:g,config:z,token:Ae,harness:we.harness,state:we.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:qa(m,k,{channel:"weixin",config:z}),replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??bl,logger:{error:(...se)=>I.error?.(`[${k}]`,...se),warn:(...se)=>I.warn?.(`[${k}]`,...se),info:(...se)=>I.info?.(`[${k}]`,...se),debug:(...se)=>I.debug?.(`[${k}]`,...se)}})},deleteState:async({botId:k})=>{let z=R.get(k);if(R.delete(k),z&&typeof z.remove=="function")await z.remove();else try{await p2e(K(k))}catch(Ae){if(Ae?.code!=="ENOENT")throw Ae}}}),U=xa(J,{workspaces:m,stateFor:L,agentPresetCatalog:d}),N=c({controller:U,harness:G,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:U,deliveryAdapter:Ya({channel:"weixin",workspaces:m,coreController:J,stateFor:L}),ready:N.ready,async close(){await N.close(),await U.close(),G.stopManagedProcess()}}}import E2e from"qrcode";var g9="/weixin",lr=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",submitVerification:"provision.verify",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki,setAccessPolicy:Va}),c9=Object.freeze(Object.values(lr));function I9(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function rh(n,t){return I9(n)&&Object.keys(n).every(o=>t.includes(o))}function bw(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function C2e(n,t){return I9(t)?n===lr.status?rh(t,[])?null:"connection.status does not accept fields.":n===lr.beginProvisioning?rh(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[lr.pollProvisioning,lr.cancelProvisioning].includes(n)?rh(t,["attemptId"])&&bw(t.attemptId)?null:`${n} requires an attemptId.`:n===lr.submitVerification?rh(t,["attemptId","verifyCode"])&&bw(t.attemptId)&&typeof t.verifyCode=="string"&&/^\d{4,8}$/.test(t.verifyCode)?null:"provision.verify requires an attemptId and a 4-to-8-digit code.":n===lr.reconnectBot?rh(t,["botId","sendTest"])&&bw(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===lr.deleteBot?rh(t,["botId","confirm"])&&bw(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===lr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===lr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===lr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===lr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":"Unknown Weixin endpoint.":"Payload must be an object."}function Mw(n){return{ok:!1,error:{code:"bad-request",message:n}}}function pB(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function u2e(){return{ok:!1,error:{code:"weixin-operation-failed",message:"\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}async function B2e(n){return E2e.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function _w(n,t){return!n||!n.verificationUrl?n:{...n,qrCodeDataUrl:await t(n.verificationUrl)}}async function Tl(n,t){let o=structuredClone(n);return o.provisioning&&(o.provisioning=await _w(o.provisioning,t)),o}function f2e(n){if(!n||typeof n.status!="function"||typeof n.startProvisioning!="function"||typeof n.registrationStatus!="function"||typeof n.submitVerification!="function"||typeof n.cancelProvisioning!="function"||typeof n.reconnectBot!="function"||typeof n.deleteBot!="function")throw new TypeError("A complete Weixin controller is required")}function l9(n,{encodeQr:t=B2e}={}){f2e(n);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return pB();if(!c9.includes(e))return Mw("Unknown Weixin endpoint.");let r=C2e(e,a);if(r)return Mw(r);try{let s;if(e===lr.status)s=await Tl(await n.status(),i);else if(e===lr.beginProvisioning){let g=await n.startProvisioning();if(A?.aborted)return await n.cancelProvisioning(g.attemptId),pB();s=await _w(g,i)}else if(e===lr.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return Mw("The provisioning attempt no longer exists.");s=await _w(g,i)}else if(e===lr.submitVerification)s=await _w(await n.submitVerification(a.attemptId,a.verifyCode),i);else if(e===lr.cancelProvisioning){if(s=await n.cancelProvisioning(a.attemptId),!s)return Mw("The provisioning attempt no longer exists.")}else if(e===lr.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return pB();let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=or(Cr("\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=or()}catch(d){c=or(d)}s=await Tl({...g,...c?{testMessage:c}:{}},i)}else if(e===lr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Tl(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===lr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Tl(g,i))}else if(e===lr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Tl(g,i))}else if(e===lr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Tl(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await Tl(await n.deleteBot(a.botId),i);return A?.aborted?pB():{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?pB():g?{ok:!1,error:g}:u2e()}}}function Tw(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(g9,l9(t,o),{authority:fr(i)})}async function p9(n,t={}){if(t?.controller)return Tw(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await AF(n,t,t.internals),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Tw(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-weixin: close account connections"),e}import{rm as SZe,unlink as wZe}from"node:fs/promises";import{homedir as DZe}from"node:os";import{join as ME,resolve as ic}from"node:path";import{createHash as Q2e}from"node:crypto";import{mkdir as y2e,readFile as m2e,rename as S2e,unlink as w2e,writeFile as D2e}from"node:fs/promises";import{dirname as O2e}from"node:path";var tF=Object.freeze({version:2,bots:Object.freeze([])}),d9=/^whatsapp_[a-f0-9]{24}$/,b2e=/^[a-f0-9-]{36}$/,M2e=/^[1-9]\d{4,14}$/,rF=Object.freeze({selfOnly:"self-only",privateAllowlist:"private-allowlist",open:"open"});function ah(n){return typeof n=="string"&&n.trim()?n.trim():null}function Nw(n){let t=ah(n)?.toLowerCase();return/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(t??"")?t:null}function aF(n){let t=Nw(n);if(!t)throw new TypeError("A valid WhatsApp account JID is required");return`whatsapp_${Q2e("sha256").update(t).digest("hex").slice(0,24)}`}function iF(n){let t=Nw(n)?.split("@")[0]??"";return t?t.length<=7?`${t.slice(0,2)}\u2022\u2022\u2022${t.slice(-2)}`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("WhatsApp\u8D26\u53F7")}function _2e(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedNumbers must be an array of WhatsApp phone numbers");let t=n.map(o=>{let i=typeof o=="string"?o.trim().replace(/^\+/,""):"";if(!M2e.test(i))throw new TypeError("allowedNumbers contains an invalid WhatsApp phone number");return i});return Object.freeze([...new Set(t)])}function kw(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("WhatsApp access policy must be an object");let t=n.accessMode??rF.selfOnly;if(!Object.values(rF).includes(t))throw new TypeError("WhatsApp accessMode is invalid");return Object.freeze({accessMode:t,allowedNumbers:_2e(n.allowedNumbers)})}var Rw=class{#e;#A=tF;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#l(JSON.parse(await m2e(this.#e,"utf8")));if(!t)throw new Error("dsh-im WhatsApp config contains invalid account data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=tF}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByAccountJid(t){let o=Nw(t),i=this.#A.bots.find(e=>e.accountJid===o);return i?structuredClone(i):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete WhatsApp account data");return this.#o(i=>{let e=i.find(r=>r.accountJid===o.accountJid&&r.botId!==o.botId),a=i.find(r=>r.authDirectory===o.authDirectory&&r.botId!==o.botId);if(e||a)throw new Error("Duplicate WhatsApp account identity");let A=i.findIndex(r=>r.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(t){if(!d9.test(t))throw new TypeError("Invalid WhatsApp bot id");return this.#o(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await w2e(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=tF});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=Nw(t.accountJid),i=ah(t.botId),e=ah(t.authDirectory),a=ah(t.name);if(!o||!i||!e||!a||!d9.test(i)||!b2e.test(e)||aF(o)!==i)return null;let A;try{A=kw(t)}catch{return null}return Object.freeze({botId:i,accountJid:o,authDirectory:e,name:a,createdAt:ah(t.createdAt)??new Date().toISOString(),connectedAt:ah(t.connectedAt),...A})}#l(t){if(!t||t.version!==2||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.accountJid)||a.has(A.authDirectory))return null;i.add(A.botId),e.add(A.accountJid),a.add(A.authDirectory)}return Object.freeze({version:2,bots:Object.freeze(o)})}async#o(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:2,bots:Object.freeze(e)});await this.#i(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#i(t){await y2e(O2e(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await D2e(o,`${JSON.stringify(t,null,2)} +`,{encoding:"utf8",mode:384}),await S2e(o,this.#e)}};var vw=class extends ur{constructor(t){super({...t,rpcIdPrefix:"whatsapp",logPrefix:"dsh-whatsapp"})}};var Pw=class extends gs{};import{randomUUID as T2e}from"node:crypto";var h9=new Set(["starting","pending","connecting"]),Gw=new Set(["connected","failed","cancelled"]),N2e=6e4;function Uc(n,t){return Object.freeze({code:n,message:t})}function Fw(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.qrValue?{qrValue:n.qrValue}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var dB=class{#e;#A;#t;#r;#l;#o;#i;#a=new Map;#n=new Map;#s=new Map;#p=new Map;#c=null;#g=0;#I=!1;constructor({configStore:t,authPath:o,createSession:i,createRuntime:e,deleteAuth:a=async()=>{},deleteState:A=async()=>{},logger:r=console}){if(!t||typeof t.list!="function"||typeof t.save!="function"||typeof t.remove!="function")throw new TypeError("WhatsappController requires a config store");if(typeof o!="function"||typeof i!="function"||typeof e!="function")throw new TypeError("WhatsappController dependencies are incomplete");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r}async initialize(){if(this.#I)return this.status();for(let t of this.#e.list())await this.#B(t.botId,async()=>{if(!(this.#I||this.#a.get(t.botId)?.status?.ready))try{await this.#C(t),this.#n.delete(t.botId)}catch(o){this.#n.set(t.botId,Uc(o?.code==="relink-required"?"relink-required":"connection-failed",o?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#i.warn?.(`[dsh-im:whatsapp] bot ${t.botId} failed to initialize`)}finally{this.#f()}});return this.status()}async startProvisioning(){if(this.#I)throw new Error("WhatsApp controller is closed");this.#c&&await this.cancelProvisioning(this.#c);let t,o,i=!1,e=new Promise((r,s)=>{t=()=>{i||(i=!0,r())},o=g=>{i||(i=!0,s(g))}}),a=T2e(),A={id:a,state:"starting",authDirectory:a,createdAt:Date.now(),expiresAt:null,qrRevision:0,qrValue:null,controller:new AbortController,session:null,task:null,error:null,botId:null};this.#s.set(a,A),this.#c=a,this.#f();try{let r=await this.#t({authDir:this.#A(A.authDirectory),signal:A.controller.signal,logger:this.#i,onQr:s=>{A.controller.signal.aborted||Gw.has(A.state)||typeof s!="string"||!s||(A.qrValue=s,A.qrRevision+=1,A.expiresAt=Date.now()+N2e,A.state="pending",this.#f(),t())}});return A.session=r,A.task=r.ready.then(s=>this.#d(A,s)).catch(s=>this.#h(A,s,o)),await e,Fw(A)}catch(r){throw await this.#h(A,r,o),r}}registrationStatus(t){return Fw(this.#s.get(t))}async cancelProvisioning(t){let o=this.#s.get(t);return o?(Gw.has(o.state)||(o.controller.abort(),await o.session?.close().catch(()=>{}),await o.task?.catch(()=>{}),Gw.has(o.state)||(o.state="cancelled",o.error=Uc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),await this.#l(o.authDirectory).catch(()=>{})),this.#c===o.id&&(this.#c=null),this.#f(),Fw(o)):null}async reconnectBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{try{await this.#C(o),this.#n.delete(t)}catch(i){throw this.#n.set(t,Uc(i?.code==="relink-required"?"relink-required":"connection-failed",i?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),i}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let i=this.#a.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let e=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return i.sendConnectionTest(Ra(`${o.name}\uFF08${iF(o.accountJid)}\uFF09`,w("WhatsApp\u673A\u5668\u4EBA")))})}async sendProactiveText(t,o,i,e={}){if(!this.#e.get(t))throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let A=this.#a.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,i,e)})}async setAccessPolicy(t,o){if(this.#I)throw new Error("WhatsApp controller is closed");let i=kw(o);return await this.#B(t,async()=>{if(this.#I)throw new Error("WhatsApp controller is closed");let e=this.#e.get(t);if(!e)throw new Error("Unknown WhatsApp bot");let a=await this.#e.save({...e,...i});this.#a.get(t)?.setAccessPolicy?.(a),this.#f()}),this.status()}async deleteBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{await this.#u(t);try{await this.#e.remove(t)}catch(i){throw await this.#C(o).catch(()=>{}),i}await Promise.allSettled([this.#l(o.authDirectory),this.#o({botId:t,config:o})]),this.#n.delete(t),this.#f()}),this.status()}status(){let t=this.#e.list().map(e=>{let a=this.#a.get(e.botId)?.status??null,A=a?.ready===!0&&a.connectionState==="connected"&&a.harnessReachable===!0,r=A?"connected":a?.connectionState==="connecting"?"connecting":this.#n.has(e.botId)||a?.connectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:e.name,idMasked:iF(e.accountJid)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA"):w("WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null,lastConnectedAt:a?.lastConnectedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:Xr(a?.lastMessageError),accessPolicy:kw(e),error:structuredClone(this.#n.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,i=this.#c?this.#s.get(this.#c):null;return{schemaVersion:1,revision:this.#g,state:i&&h9.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&h9.has(i.state)?{provisioning:Fw(i)}:{}}}async close(){this.#I||(this.#I=!0,this.#c&&await this.cancelProvisioning(this.#c),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#a.keys()].map(t=>this.#u(t))))}async#d(t,o){if(t.controller.signal.aborted||this.#I)return;t.state="connecting",t.qrValue=null,t.expiresAt=null,this.#f();let i=aF(o.accountJid);t.botId=i,await t.session?.close();let e=this.#e.get(i),a={botId:i,accountJid:o.accountJid,authDirectory:t.authDirectory,name:o.name,createdAt:e?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString(),accessMode:e?.accessMode,allowedNumbers:e?.allowedNumbers};try{if(t.controller.signal.aborted||this.#I)throw Object.assign(new Error,{name:"AbortError"});if(await this.#e.save(a),t.controller.signal.aborted||this.#I)throw Object.assign(new Error,{name:"AbortError"});try{await this.#C(a),this.#n.delete(i)}catch{this.#n.set(i,Uc("connection-failed",w("WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#i.warn?.(`[dsh-im:whatsapp] bot ${i} did not reconnect after QR binding`)}e?.authDirectory&&e.authDirectory!==a.authDirectory&&await this.#l(e.authDirectory).catch(()=>{}),t.state="connected",t.error=null}catch(A){t.controller.signal.aborted||this.#I||A?.name==="AbortError"?(await this.#u(i),e?await this.#e.save(e).catch(()=>{}):await this.#e.remove(i).catch(()=>null)&&await this.#o({botId:i,config:a}).catch(s=>{this.#i.warn?.("[dsh-im:whatsapp] cancelled bot state cleanup failed:",s)}),await this.#l(t.authDirectory).catch(()=>{}),e&&await this.#C(e).catch(()=>{}),t.state="cancelled",t.error=Uc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(await this.#l(t.authDirectory).catch(()=>{}),t.state="failed",t.error=Uc("activation-failed",w("WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002")),this.#i.error?.("[dsh-im:whatsapp] unable to persist linked-device session"))}finally{this.#c===t.id&&(this.#c=null),this.#f()}}async#h(t,o,i=()=>{}){Gw.has(t.state)||(t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=Uc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Uc("qr-connect-failed",w("\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"))),this.#c===t.id&&(this.#c=null),await t.session?.close().catch(()=>{}),await this.#l(t.authDirectory).catch(()=>{}),this.#f(),i(o))}async#C(t){if(this.#I)throw new Error("WhatsApp controller is closed");if(await this.#u(t.botId),this.#I)throw new Error("WhatsApp controller is closed");let o=await this.#r({botId:t.botId,config:t,authDir:this.#A(t.authDirectory)});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("createRuntime returned an invalid WhatsApp runtime");this.#a.set(t.botId,o);try{await o.start()}catch(i){throw await o.stop().catch(()=>{}),this.#a.delete(t.botId),i}}async#u(t){let o=this.#a.get(t);this.#a.delete(t),await o?.stop().catch(()=>{})}#B(t,o){let a=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===a&&this.#p.delete(t)});return this.#p.set(t,a),a}#f(){this.#g+=1}};import{createHash as sZe,randomBytes as Wce}from"node:crypto";var v=qe(Rm(),1),D=v.default.Reader,P=v.default.Writer,l=v.default.util,p=v.default.roots.default||(v.default.roots.default={});function ge(n,t){if(typeof n=="string")return n;if(typeof n=="number")return String(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?(e-(1n<<64n)).toString():e.toString()}return String(n)}function ce(n,t){if(typeof n=="number")return n;if(typeof n=="string")return Number(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?Number(e-(1n<<64n)):Number(e)}return Number(n)}var oe=p.proto=(()=>{let n={};return n.ADVDeviceIdentity=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.keyIndex=e.uint32();break}case 4:{s.accountType=e.int32();break}case 5:{s.deviceType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVDeviceIdentity)return e;var a=new p.proto.ADVDeviceIdentity;switch(e.rawId!=null&&(a.rawId=e.rawId>>>0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.keyIndex!=null&&(a.keyIndex=e.keyIndex>>>0),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}switch(e.deviceType){default:if(typeof e.deviceType=="number"){a.deviceType=e.deviceType;break}break;case"E2EE":case 0:a.deviceType=0;break;case"HOSTED":case 1:a.deviceType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,a.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp,!0):a.longs===Number?ce(e.timestamp,!0):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.keyIndex!=null&&e.hasOwnProperty("keyIndex")&&(A.keyIndex=e.keyIndex,a.oneofs&&(A._keyIndex="keyIndex")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:p.proto.ADVEncryptionType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=a.enums===String?p.proto.ADVEncryptionType[e.deviceType]===void 0?e.deviceType:p.proto.ADVEncryptionType[e.deviceType]:e.deviceType,a.oneofs&&(A._deviceType="deviceType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVDeviceIdentity"},t})(),n.ADVEncryptionType=(function(){let t={},o=Object.create(t);return o[t[0]="E2EE"]=0,o[t[1]="HOSTED"]=1,o})(),n.ADVKeyIndexList=(function(){function t(i){if(this.validIndexes=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.currentIndex=e.uint32();break}case 4:{if(s.validIndexes&&s.validIndexes.length||(s.validIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.currentIndex!=null&&(a.currentIndex=e.currentIndex>>>0),e.validIndexes){if(!Array.isArray(e.validIndexes))throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected");a.validIndexes=[];for(var A=0;A>>0}switch(e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.validIndexes=[]),e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,a.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp,!0):a.longs===Number?ce(e.timestamp,!0):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.currentIndex!=null&&e.hasOwnProperty("currentIndex")&&(A.currentIndex=e.currentIndex,a.oneofs&&(A._currentIndex="currentIndex")),e.validIndexes&&e.validIndexes.length){A.validIndexes=[];for(var r=0;r>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignatureKey=e.bytes();break}case 3:{s.accountSignature=e.bytes();break}case 4:{s.deviceSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVSignedDeviceIdentity)return e;var a=new p.proto.ADVSignedDeviceIdentity;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,a.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(a.accountSignatureKey=e.accountSignatureKey)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,a.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(a.accountSignature=e.accountSignature)),e.deviceSignature!=null&&(typeof e.deviceSignature=="string"?l.base64.decode(e.deviceSignature,a.deviceSignature=l.newBuffer(l.base64.length(e.deviceSignature)),0):e.deviceSignature.length>=0&&(a.deviceSignature=e.deviceSignature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=a.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,a.oneofs&&(A._accountSignatureKey="accountSignatureKey")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=a.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,a.oneofs&&(A._accountSignature="accountSignature")),e.deviceSignature!=null&&e.hasOwnProperty("deviceSignature")&&(A.deviceSignature=a.bytes===String?l.base64.encode(e.deviceSignature,0,e.deviceSignature.length):a.bytes===Array?Array.prototype.slice.call(e.deviceSignature):e.deviceSignature,a.oneofs&&(A._deviceSignature="deviceSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentity"},t})(),n.ADVSignedDeviceIdentityHMAC=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.hmac=e.bytes();break}case 3:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVSignedDeviceIdentityHMAC)return e;var a=new p.proto.ADVSignedDeviceIdentityHMAC;switch(e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.hmac!=null&&(typeof e.hmac=="string"?l.base64.decode(e.hmac,a.hmac=l.newBuffer(l.base64.length(e.hmac)),0):e.hmac.length>=0&&(a.hmac=e.hmac)),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.hmac!=null&&e.hasOwnProperty("hmac")&&(A.hmac=a.bytes===String?l.base64.encode(e.hmac,0,e.hmac.length):a.bytes===Array?Array.prototype.slice.call(e.hmac):e.hmac,a.oneofs&&(A._hmac="hmac")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:p.proto.ADVEncryptionType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentityHMAC"},t})(),n.ADVSignedKeyIndexList=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignature=e.bytes();break}case 3:{s.accountSignatureKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ADVSignedKeyIndexList)return e;var a=new p.proto.ADVSignedKeyIndexList;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,a.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(a.accountSignature=e.accountSignature)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,a.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(a.accountSignatureKey=e.accountSignatureKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=a.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,a.oneofs&&(A._accountSignature="accountSignature")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=a.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,a.oneofs&&(A._accountSignatureKey="accountSignatureKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedKeyIndexList"},t})(),n.AIHomeState=(function(){function t(i){if(this.capabilityOptions=[],this.conversationOptions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lastFetchTime=e.int64();break}case 2:{s.capabilityOptions&&s.capabilityOptions.length||(s.capabilityOptions=[]),s.capabilityOptions.push(p.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}case 3:{s.conversationOptions&&s.conversationOptions.length||(s.conversationOptions=[]),s.conversationOptions.push(p.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIHomeState)return e;var a=new p.proto.AIHomeState;if(e.lastFetchTime!=null&&(l.Long?(a.lastFetchTime=l.Long.fromValue(e.lastFetchTime)).unsigned=!1:typeof e.lastFetchTime=="string"?a.lastFetchTime=parseInt(e.lastFetchTime,10):typeof e.lastFetchTime=="number"?a.lastFetchTime=e.lastFetchTime:typeof e.lastFetchTime=="object"&&(a.lastFetchTime=new l.LongBits(e.lastFetchTime.low>>>0,e.lastFetchTime.high>>>0).toNumber())),e.capabilityOptions){if(!Array.isArray(e.capabilityOptions))throw TypeError(".proto.AIHomeState.capabilityOptions: array expected");a.capabilityOptions=[];for(var A=0;A>>3){case 1:{c.type=A.int32();break}case 2:{c.title=A.string();break}case 3:{c.promptText=A.string();break}case 4:{c.sessionId=A.string();break}case 5:{c.imageWdsIdentifier=A.string();break}case 6:{c.imageTintColor=A.string();break}case 7:{c.imageBackgroundColor=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIHomeState.AIHomeOption)return A;var r=new p.proto.AIHomeState.AIHomeOption;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PROMPT":case 0:r.type=0;break;case"CREATE_IMAGE":case 1:r.type=1;break;case"ANIMATE_PHOTO":case 2:r.type=2;break;case"ANALYZE_FILE":case 3:r.type=3;break}return A.title!=null&&(r.title=String(A.title)),A.promptText!=null&&(r.promptText=String(A.promptText)),A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.imageWdsIdentifier!=null&&(r.imageWdsIdentifier=String(A.imageWdsIdentifier)),A.imageTintColor!=null&&(r.imageTintColor=String(A.imageTintColor)),A.imageBackgroundColor!=null&&(r.imageBackgroundColor=String(A.imageBackgroundColor)),r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]===void 0?A.type:p.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]:A.type,r.oneofs&&(s._type="type")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.promptText!=null&&A.hasOwnProperty("promptText")&&(s.promptText=A.promptText,r.oneofs&&(s._promptText="promptText")),A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.imageWdsIdentifier!=null&&A.hasOwnProperty("imageWdsIdentifier")&&(s.imageWdsIdentifier=A.imageWdsIdentifier,r.oneofs&&(s._imageWdsIdentifier="imageWdsIdentifier")),A.imageTintColor!=null&&A.hasOwnProperty("imageTintColor")&&(s.imageTintColor=A.imageTintColor,r.oneofs&&(s._imageTintColor="imageTintColor")),A.imageBackgroundColor!=null&&A.hasOwnProperty("imageBackgroundColor")&&(s.imageBackgroundColor=A.imageBackgroundColor,r.oneofs&&(s._imageBackgroundColor="imageBackgroundColor")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIHomeState.AIHomeOption"},i.AIHomeActionType=(function(){let a={},A=Object.create(a);return A[a[0]="PROMPT"]=0,A[a[1]="CREATE_IMAGE"]=1,A[a[2]="ANIMATE_PHOTO"]=2,A[a[3]="ANALYZE_FILE"]=3,A})(),i})(),t})(),n.AIQueryFanout=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.timestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIQueryFanout)return e;var a=new p.proto.AIQueryFanout;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIQueryFanout.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.AIQueryFanout.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIQueryFanout"},t})(),n.AIRegenerateMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.responseTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRegenerateMetadata)return e;var a=new p.proto.AIRegenerateMetadata;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIRegenerateMetadata.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}return e.responseTimestampMs!=null&&(l.Long?(a.responseTimestampMs=l.Long.fromValue(e.responseTimestampMs)).unsigned=!1:typeof e.responseTimestampMs=="string"?a.responseTimestampMs=parseInt(e.responseTimestampMs,10):typeof e.responseTimestampMs=="number"?a.responseTimestampMs=e.responseTimestampMs:typeof e.responseTimestampMs=="object"&&(a.responseTimestampMs=new l.LongBits(e.responseTimestampMs.low>>>0,e.responseTimestampMs.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.responseTimestampMs!=null&&e.hasOwnProperty("responseTimestampMs")&&(typeof e.responseTimestampMs=="number"?A.responseTimestampMs=a.longs===String?String(e.responseTimestampMs):e.responseTimestampMs:A.responseTimestampMs=a.longs===String?ge(e.responseTimestampMs):a.longs===Number?ce(e.responseTimestampMs):e.responseTimestampMs,a.oneofs&&(A._responseTimestampMs="responseTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRegenerateMetadata"},t})(),n.AIRichResponseCodeMetadata=(function(){function t(i){if(this.codeBlocks=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.codeLanguage=e.string();break}case 2:{s.codeBlocks&&s.codeBlocks.length||(s.codeBlocks=[]),s.codeBlocks.push(p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseCodeMetadata)return e;var a=new p.proto.AIRichResponseCodeMetadata;if(e.codeLanguage!=null&&(a.codeLanguage=String(e.codeLanguage)),e.codeBlocks){if(!Array.isArray(e.codeBlocks))throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: array expected");a.codeBlocks=[];for(var A=0;A>>3){case 1:{c.highlightType=A.int32();break}case 2:{c.codeContent=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock)return A;var r=new p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock;switch(A.highlightType){default:if(typeof A.highlightType=="number"){r.highlightType=A.highlightType;break}break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT":case 0:r.highlightType=0;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD":case 1:r.highlightType=1;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD":case 2:r.highlightType=2;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING":case 3:r.highlightType=3;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER":case 4:r.highlightType=4;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT":case 5:r.highlightType=5;break}return A.codeContent!=null&&(r.codeContent=String(A.codeContent)),r},i.toObject=function(A,r){r||(r={});var s={};return A.highlightType!=null&&A.hasOwnProperty("highlightType")&&(s.highlightType=r.enums===String?p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]===void 0?A.highlightType:p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]:A.highlightType,r.oneofs&&(s._highlightType="highlightType")),A.codeContent!=null&&A.hasOwnProperty("codeContent")&&(s.codeContent=A.codeContent,r.oneofs&&(s._codeContent="codeContent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock"},i})(),t.AIRichResponseCodeHighlightType=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT"]=0,e[i[1]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD"]=1,e[i[2]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD"]=2,e[i[3]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING"]=3,e[i[4]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER"]=4,e[i[5]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT"]=5,e})(),t})(),n.AIRichResponseContentItemsMetadata=(function(){function t(i){if(this.itemsMetadata=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.itemsMetadata&&s.itemsMetadata.length||(s.itemsMetadata=[]),s.itemsMetadata.push(p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.decode(e,e.uint32()));break}case 2:{s.contentType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseContentItemsMetadata)return e;var a=new p.proto.AIRichResponseContentItemsMetadata;if(e.itemsMetadata){if(!Array.isArray(e.itemsMetadata))throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: array expected");a.itemsMetadata=[];for(var A=0;A>>3){case 1:{c.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata)return A;var r=new p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata;if(A.reelItem!=null){if(typeof A.reelItem!="object")throw TypeError(".proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected");r.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(A.reelItem)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.reelItem!=null&&A.hasOwnProperty("reelItem")&&(s.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(A.reelItem,r),r.oneofs&&(s.aIRichResponseContentItem="reelItem")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata"},i})(),t.AIRichResponseReelItem=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.profileIconUrl=A.string();break}case 3:{c.thumbnailUrl=A.string();break}case 4:{c.videoUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem)return A;var r=new p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem;return A.title!=null&&(r.title=String(A.title)),A.profileIconUrl!=null&&(r.profileIconUrl=String(A.profileIconUrl)),A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.videoUrl!=null&&(r.videoUrl=String(A.videoUrl)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.profileIconUrl!=null&&A.hasOwnProperty("profileIconUrl")&&(s.profileIconUrl=A.profileIconUrl,r.oneofs&&(s._profileIconUrl="profileIconUrl")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.videoUrl!=null&&A.hasOwnProperty("videoUrl")&&(s.videoUrl=A.videoUrl,r.oneofs&&(s._videoUrl="videoUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem"},i})(),t.ContentType=(function(){let i={},e=Object.create(i);return e[i[0]="DEFAULT"]=0,e[i[1]="CAROUSEL"]=1,e})(),t})(),n.AIRichResponseDynamicMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.version=e.uint64();break}case 3:{s.url=e.string();break}case 4:{s.loopCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseDynamicMetadata)return e;var a=new p.proto.AIRichResponseDynamicMetadata;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN":case 0:a.type=0;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE":case 1:a.type=1;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF":case 2:a.type=2;break}return e.version!=null&&(l.Long?(a.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?a.version=parseInt(e.version,10):typeof e.version=="number"?a.version=e.version:typeof e.version=="object"&&(a.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),e.url!=null&&(a.url=String(e.url)),e.loopCount!=null&&(a.loopCount=e.loopCount>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]===void 0?e.type:p.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]:e.type,a.oneofs&&(A._type="type")),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=a.longs===String?String(e.version):e.version:A.version=a.longs===String?ge(e.version,!0):a.longs===Number?ce(e.version,!0):e.version,a.oneofs&&(A._version="version")),e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.loopCount!=null&&e.hasOwnProperty("loopCount")&&(A.loopCount=e.loopCount,a.oneofs&&(A._loopCount="loopCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseDynamicMetadata"},t.AIRichResponseDynamicMetadataType=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN"]=0,e[i[1]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE"]=1,e[i[2]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF"]=2,e})(),t})(),n.AIRichResponseGridImageMetadata=(function(){function t(i){if(this.imageUrls=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.gridImageUrl=p.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageUrls&&s.imageUrls.length||(s.imageUrls=[]),s.imageUrls.push(p.proto.AIRichResponseImageURL.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseGridImageMetadata)return e;var a=new p.proto.AIRichResponseGridImageMetadata;if(e.gridImageUrl!=null){if(typeof e.gridImageUrl!="object")throw TypeError(".proto.AIRichResponseGridImageMetadata.gridImageUrl: object expected");a.gridImageUrl=p.proto.AIRichResponseImageURL.fromObject(e.gridImageUrl)}if(e.imageUrls){if(!Array.isArray(e.imageUrls))throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: array expected");a.imageUrls=[];for(var A=0;A>>3){case 1:{s.imagePreviewUrl=e.string();break}case 2:{s.imageHighResUrl=e.string();break}case 3:{s.sourceUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseImageURL)return e;var a=new p.proto.AIRichResponseImageURL;return e.imagePreviewUrl!=null&&(a.imagePreviewUrl=String(e.imagePreviewUrl)),e.imageHighResUrl!=null&&(a.imageHighResUrl=String(e.imageHighResUrl)),e.sourceUrl!=null&&(a.sourceUrl=String(e.sourceUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.imagePreviewUrl!=null&&e.hasOwnProperty("imagePreviewUrl")&&(A.imagePreviewUrl=e.imagePreviewUrl,a.oneofs&&(A._imagePreviewUrl="imagePreviewUrl")),e.imageHighResUrl!=null&&e.hasOwnProperty("imageHighResUrl")&&(A.imageHighResUrl=e.imageHighResUrl,a.oneofs&&(A._imageHighResUrl="imageHighResUrl")),e.sourceUrl!=null&&e.hasOwnProperty("sourceUrl")&&(A.sourceUrl=e.sourceUrl,a.oneofs&&(A._sourceUrl="sourceUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseImageURL"},t})(),n.AIRichResponseInlineImageMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.imageUrl=p.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageText=e.string();break}case 3:{s.alignment=e.int32();break}case 4:{s.tapLinkUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseInlineImageMetadata)return e;var a=new p.proto.AIRichResponseInlineImageMetadata;if(e.imageUrl!=null){if(typeof e.imageUrl!="object")throw TypeError(".proto.AIRichResponseInlineImageMetadata.imageUrl: object expected");a.imageUrl=p.proto.AIRichResponseImageURL.fromObject(e.imageUrl)}switch(e.imageText!=null&&(a.imageText=String(e.imageText)),e.alignment){default:if(typeof e.alignment=="number"){a.alignment=e.alignment;break}break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED":case 0:a.alignment=0;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED":case 1:a.alignment=1;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED":case 2:a.alignment=2;break}return e.tapLinkUrl!=null&&(a.tapLinkUrl=String(e.tapLinkUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.imageUrl!=null&&e.hasOwnProperty("imageUrl")&&(A.imageUrl=p.proto.AIRichResponseImageURL.toObject(e.imageUrl,a),a.oneofs&&(A._imageUrl="imageUrl")),e.imageText!=null&&e.hasOwnProperty("imageText")&&(A.imageText=e.imageText,a.oneofs&&(A._imageText="imageText")),e.alignment!=null&&e.hasOwnProperty("alignment")&&(A.alignment=a.enums===String?p.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]===void 0?e.alignment:p.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]:e.alignment,a.oneofs&&(A._alignment="alignment")),e.tapLinkUrl!=null&&e.hasOwnProperty("tapLinkUrl")&&(A.tapLinkUrl=e.tapLinkUrl,a.oneofs&&(A._tapLinkUrl="tapLinkUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseInlineImageMetadata"},t.AIRichResponseImageAlignment=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED"]=0,e[i[1]="AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED"]=1,e[i[2]="AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED"]=2,e})(),t})(),n.AIRichResponseLatexMetadata=(function(){function t(i){if(this.expressions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.text=e.string();break}case 2:{s.expressions&&s.expressions.length||(s.expressions=[]),s.expressions.push(p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseLatexMetadata)return e;var a=new p.proto.AIRichResponseLatexMetadata;if(e.text!=null&&(a.text=String(e.text)),e.expressions){if(!Array.isArray(e.expressions))throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: array expected");a.expressions=[];for(var A=0;A>>3){case 1:{c.latexExpression=A.string();break}case 2:{c.url=A.string();break}case 3:{c.width=A.double();break}case 4:{c.height=A.double();break}case 5:{c.fontHeight=A.double();break}case 6:{c.imageTopPadding=A.double();break}case 7:{c.imageLeadingPadding=A.double();break}case 8:{c.imageBottomPadding=A.double();break}case 9:{c.imageTrailingPadding=A.double();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression)return A;var r=new p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression;return A.latexExpression!=null&&(r.latexExpression=String(A.latexExpression)),A.url!=null&&(r.url=String(A.url)),A.width!=null&&(r.width=Number(A.width)),A.height!=null&&(r.height=Number(A.height)),A.fontHeight!=null&&(r.fontHeight=Number(A.fontHeight)),A.imageTopPadding!=null&&(r.imageTopPadding=Number(A.imageTopPadding)),A.imageLeadingPadding!=null&&(r.imageLeadingPadding=Number(A.imageLeadingPadding)),A.imageBottomPadding!=null&&(r.imageBottomPadding=Number(A.imageBottomPadding)),A.imageTrailingPadding!=null&&(r.imageTrailingPadding=Number(A.imageTrailingPadding)),r},i.toObject=function(A,r){r||(r={});var s={};return A.latexExpression!=null&&A.hasOwnProperty("latexExpression")&&(s.latexExpression=A.latexExpression,r.oneofs&&(s._latexExpression="latexExpression")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=r.json&&!isFinite(A.width)?String(A.width):A.width,r.oneofs&&(s._width="width")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=r.json&&!isFinite(A.height)?String(A.height):A.height,r.oneofs&&(s._height="height")),A.fontHeight!=null&&A.hasOwnProperty("fontHeight")&&(s.fontHeight=r.json&&!isFinite(A.fontHeight)?String(A.fontHeight):A.fontHeight,r.oneofs&&(s._fontHeight="fontHeight")),A.imageTopPadding!=null&&A.hasOwnProperty("imageTopPadding")&&(s.imageTopPadding=r.json&&!isFinite(A.imageTopPadding)?String(A.imageTopPadding):A.imageTopPadding,r.oneofs&&(s._imageTopPadding="imageTopPadding")),A.imageLeadingPadding!=null&&A.hasOwnProperty("imageLeadingPadding")&&(s.imageLeadingPadding=r.json&&!isFinite(A.imageLeadingPadding)?String(A.imageLeadingPadding):A.imageLeadingPadding,r.oneofs&&(s._imageLeadingPadding="imageLeadingPadding")),A.imageBottomPadding!=null&&A.hasOwnProperty("imageBottomPadding")&&(s.imageBottomPadding=r.json&&!isFinite(A.imageBottomPadding)?String(A.imageBottomPadding):A.imageBottomPadding,r.oneofs&&(s._imageBottomPadding="imageBottomPadding")),A.imageTrailingPadding!=null&&A.hasOwnProperty("imageTrailingPadding")&&(s.imageTrailingPadding=r.json&&!isFinite(A.imageTrailingPadding)?String(A.imageTrailingPadding):A.imageTrailingPadding,r.oneofs&&(s._imageTrailingPadding="imageTrailingPadding")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression"},i})(),t})(),n.AIRichResponseMapMetadata=(function(){function t(i){if(this.annotations=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.centerLatitude=e.double();break}case 2:{s.centerLongitude=e.double();break}case 3:{s.latitudeDelta=e.double();break}case 4:{s.longitudeDelta=e.double();break}case 5:{s.annotations&&s.annotations.length||(s.annotations=[]),s.annotations.push(p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.decode(e,e.uint32()));break}case 6:{s.showInfoList=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseMapMetadata)return e;var a=new p.proto.AIRichResponseMapMetadata;if(e.centerLatitude!=null&&(a.centerLatitude=Number(e.centerLatitude)),e.centerLongitude!=null&&(a.centerLongitude=Number(e.centerLongitude)),e.latitudeDelta!=null&&(a.latitudeDelta=Number(e.latitudeDelta)),e.longitudeDelta!=null&&(a.longitudeDelta=Number(e.longitudeDelta)),e.annotations){if(!Array.isArray(e.annotations))throw TypeError(".proto.AIRichResponseMapMetadata.annotations: array expected");a.annotations=[];for(var A=0;A>>3){case 1:{c.annotationNumber=A.uint32();break}case 2:{c.latitude=A.double();break}case 3:{c.longitude=A.double();break}case 4:{c.title=A.string();break}case 5:{c.body=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation)return A;var r=new p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation;return A.annotationNumber!=null&&(r.annotationNumber=A.annotationNumber>>>0),A.latitude!=null&&(r.latitude=Number(A.latitude)),A.longitude!=null&&(r.longitude=Number(A.longitude)),A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),r},i.toObject=function(A,r){r||(r={});var s={};return A.annotationNumber!=null&&A.hasOwnProperty("annotationNumber")&&(s.annotationNumber=A.annotationNumber,r.oneofs&&(s._annotationNumber="annotationNumber")),A.latitude!=null&&A.hasOwnProperty("latitude")&&(s.latitude=r.json&&!isFinite(A.latitude)?String(A.latitude):A.latitude,r.oneofs&&(s._latitude="latitude")),A.longitude!=null&&A.hasOwnProperty("longitude")&&(s.longitude=r.json&&!isFinite(A.longitude)?String(A.longitude):A.longitude,r.oneofs&&(s._longitude="longitude")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation"},i})(),t})(),n.AIRichResponseMessage=(function(){function t(i){if(this.submessages=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageType=e.int32();break}case 2:{s.submessages&&s.submessages.length||(s.submessages=[]),s.submessages.push(p.proto.AIRichResponseSubMessage.decode(e,e.uint32()));break}case 3:{s.unifiedResponse=p.proto.AIRichResponseUnifiedResponse.decode(e,e.uint32());break}case 4:{s.contextInfo=p.proto.ContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseMessage)return e;var a=new p.proto.AIRichResponseMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){a.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_TYPE_UNKNOWN":case 0:a.messageType=0;break;case"AI_RICH_RESPONSE_TYPE_STANDARD":case 1:a.messageType=1;break}if(e.submessages){if(!Array.isArray(e.submessages))throw TypeError(".proto.AIRichResponseMessage.submessages: array expected");a.submessages=[];for(var A=0;A>>3){case 1:{s.messageType=e.int32();break}case 2:{s.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.decode(e,e.uint32());break}case 3:{s.messageText=e.string();break}case 4:{s.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.decode(e,e.uint32());break}case 5:{s.codeMetadata=p.proto.AIRichResponseCodeMetadata.decode(e,e.uint32());break}case 6:{s.tableMetadata=p.proto.AIRichResponseTableMetadata.decode(e,e.uint32());break}case 7:{s.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.decode(e,e.uint32());break}case 8:{s.latexMetadata=p.proto.AIRichResponseLatexMetadata.decode(e,e.uint32());break}case 9:{s.mapMetadata=p.proto.AIRichResponseMapMetadata.decode(e,e.uint32());break}case 10:{s.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseSubMessage)return e;var a=new p.proto.AIRichResponseSubMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){a.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_UNKNOWN":case 0:a.messageType=0;break;case"AI_RICH_RESPONSE_GRID_IMAGE":case 1:a.messageType=1;break;case"AI_RICH_RESPONSE_TEXT":case 2:a.messageType=2;break;case"AI_RICH_RESPONSE_INLINE_IMAGE":case 3:a.messageType=3;break;case"AI_RICH_RESPONSE_TABLE":case 4:a.messageType=4;break;case"AI_RICH_RESPONSE_CODE":case 5:a.messageType=5;break;case"AI_RICH_RESPONSE_DYNAMIC":case 6:a.messageType=6;break;case"AI_RICH_RESPONSE_MAP":case 7:a.messageType=7;break;case"AI_RICH_RESPONSE_LATEX":case 8:a.messageType=8;break;case"AI_RICH_RESPONSE_CONTENT_ITEMS":case 9:a.messageType=9;break}if(e.gridImageMetadata!=null){if(typeof e.gridImageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.gridImageMetadata: object expected");a.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.fromObject(e.gridImageMetadata)}if(e.messageText!=null&&(a.messageText=String(e.messageText)),e.imageMetadata!=null){if(typeof e.imageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.imageMetadata: object expected");a.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.fromObject(e.imageMetadata)}if(e.codeMetadata!=null){if(typeof e.codeMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.codeMetadata: object expected");a.codeMetadata=p.proto.AIRichResponseCodeMetadata.fromObject(e.codeMetadata)}if(e.tableMetadata!=null){if(typeof e.tableMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.tableMetadata: object expected");a.tableMetadata=p.proto.AIRichResponseTableMetadata.fromObject(e.tableMetadata)}if(e.dynamicMetadata!=null){if(typeof e.dynamicMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.dynamicMetadata: object expected");a.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.fromObject(e.dynamicMetadata)}if(e.latexMetadata!=null){if(typeof e.latexMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.latexMetadata: object expected");a.latexMetadata=p.proto.AIRichResponseLatexMetadata.fromObject(e.latexMetadata)}if(e.mapMetadata!=null){if(typeof e.mapMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.mapMetadata: object expected");a.mapMetadata=p.proto.AIRichResponseMapMetadata.fromObject(e.mapMetadata)}if(e.contentItemsMetadata!=null){if(typeof e.contentItemsMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.contentItemsMetadata: object expected");a.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.fromObject(e.contentItemsMetadata)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageType!=null&&e.hasOwnProperty("messageType")&&(A.messageType=a.enums===String?p.proto.AIRichResponseSubMessageType[e.messageType]===void 0?e.messageType:p.proto.AIRichResponseSubMessageType[e.messageType]:e.messageType,a.oneofs&&(A._messageType="messageType")),e.gridImageMetadata!=null&&e.hasOwnProperty("gridImageMetadata")&&(A.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.toObject(e.gridImageMetadata,a),a.oneofs&&(A._gridImageMetadata="gridImageMetadata")),e.messageText!=null&&e.hasOwnProperty("messageText")&&(A.messageText=e.messageText,a.oneofs&&(A._messageText="messageText")),e.imageMetadata!=null&&e.hasOwnProperty("imageMetadata")&&(A.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.toObject(e.imageMetadata,a),a.oneofs&&(A._imageMetadata="imageMetadata")),e.codeMetadata!=null&&e.hasOwnProperty("codeMetadata")&&(A.codeMetadata=p.proto.AIRichResponseCodeMetadata.toObject(e.codeMetadata,a),a.oneofs&&(A._codeMetadata="codeMetadata")),e.tableMetadata!=null&&e.hasOwnProperty("tableMetadata")&&(A.tableMetadata=p.proto.AIRichResponseTableMetadata.toObject(e.tableMetadata,a),a.oneofs&&(A._tableMetadata="tableMetadata")),e.dynamicMetadata!=null&&e.hasOwnProperty("dynamicMetadata")&&(A.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.toObject(e.dynamicMetadata,a),a.oneofs&&(A._dynamicMetadata="dynamicMetadata")),e.latexMetadata!=null&&e.hasOwnProperty("latexMetadata")&&(A.latexMetadata=p.proto.AIRichResponseLatexMetadata.toObject(e.latexMetadata,a),a.oneofs&&(A._latexMetadata="latexMetadata")),e.mapMetadata!=null&&e.hasOwnProperty("mapMetadata")&&(A.mapMetadata=p.proto.AIRichResponseMapMetadata.toObject(e.mapMetadata,a),a.oneofs&&(A._mapMetadata="mapMetadata")),e.contentItemsMetadata!=null&&e.hasOwnProperty("contentItemsMetadata")&&(A.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.toObject(e.contentItemsMetadata,a),a.oneofs&&(A._contentItemsMetadata="contentItemsMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseSubMessage"},t})(),n.AIRichResponseSubMessageType=(function(){let t={},o=Object.create(t);return o[t[0]="AI_RICH_RESPONSE_UNKNOWN"]=0,o[t[1]="AI_RICH_RESPONSE_GRID_IMAGE"]=1,o[t[2]="AI_RICH_RESPONSE_TEXT"]=2,o[t[3]="AI_RICH_RESPONSE_INLINE_IMAGE"]=3,o[t[4]="AI_RICH_RESPONSE_TABLE"]=4,o[t[5]="AI_RICH_RESPONSE_CODE"]=5,o[t[6]="AI_RICH_RESPONSE_DYNAMIC"]=6,o[t[7]="AI_RICH_RESPONSE_MAP"]=7,o[t[8]="AI_RICH_RESPONSE_LATEX"]=8,o[t[9]="AI_RICH_RESPONSE_CONTENT_ITEMS"]=9,o})(),n.AIRichResponseTableMetadata=(function(){function t(i){if(this.rows=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rows&&s.rows.length||(s.rows=[]),s.rows.push(p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.decode(e,e.uint32()));break}case 2:{s.title=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseTableMetadata)return e;var a=new p.proto.AIRichResponseTableMetadata;if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".proto.AIRichResponseTableMetadata.rows: array expected");a.rows=[];for(var A=0;A>>3){case 1:{c.items&&c.items.length||(c.items=[]),c.items.push(A.string());break}case 2:{c.isHeading=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow)return A;var r=new p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow;if(A.items){if(!Array.isArray(A.items))throw TypeError(".proto.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected");r.items=[];for(var s=0;s>>3){case 1:{s.data=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIRichResponseUnifiedResponse)return e;var a=new p.proto.AIRichResponseUnifiedResponse;return e.data!=null&&(typeof e.data=="string"?l.base64.decode(e.data,a.data=l.newBuffer(l.base64.length(e.data)),0):e.data.length>=0&&(a.data=e.data)),a},t.toObject=function(e,a){a||(a={});var A={};return e.data!=null&&e.hasOwnProperty("data")&&(A.data=a.bytes===String?l.base64.encode(e.data,0,e.data.length):a.bytes===Array?Array.prototype.slice.call(e.data):e.data,a.oneofs&&(A._data="data")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseUnifiedResponse"},t})(),n.AIThreadInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.decode(e,e.uint32());break}case 2:{s.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AIThreadInfo)return e;var a=new p.proto.AIThreadInfo;if(e.serverInfo!=null){if(typeof e.serverInfo!="object")throw TypeError(".proto.AIThreadInfo.serverInfo: object expected");a.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.fromObject(e.serverInfo)}if(e.clientInfo!=null){if(typeof e.clientInfo!="object")throw TypeError(".proto.AIThreadInfo.clientInfo: object expected");a.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.fromObject(e.clientInfo)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.serverInfo!=null&&e.hasOwnProperty("serverInfo")&&(A.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.toObject(e.serverInfo,a),a.oneofs&&(A._serverInfo="serverInfo")),e.clientInfo!=null&&e.hasOwnProperty("clientInfo")&&(A.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.toObject(e.clientInfo,a),a.oneofs&&(A._clientInfo="clientInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIThreadInfo"},t.AIThreadClientInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIThreadInfo.AIThreadClientInfo)return A;var r=new p.proto.AIThreadInfo.AIThreadClientInfo;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DEFAULT":case 1:r.type=1;break;case"INCOGNITO":case 2:r.type=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]===void 0?A.type:p.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadClientInfo"},i.AIThreadType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="DEFAULT"]=1,A[a[2]="INCOGNITO"]=2,A})(),i})(),t.AIThreadServerInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIThreadInfo.AIThreadServerInfo)return A;var r=new p.proto.AIThreadInfo.AIThreadServerInfo;return A.title!=null&&(r.title=String(A.title)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadServerInfo"},i})(),t})(),n.Account=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lid=e.string();break}case 2:{s.username=e.string();break}case 3:{s.countryCode=e.string();break}case 4:{s.isUsernameDeleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Account)return e;var a=new p.proto.Account;return e.lid!=null&&(a.lid=String(e.lid)),e.username!=null&&(a.username=String(e.username)),e.countryCode!=null&&(a.countryCode=String(e.countryCode)),e.isUsernameDeleted!=null&&(a.isUsernameDeleted=!!e.isUsernameDeleted),a},t.toObject=function(e,a){a||(a={});var A={};return e.lid!=null&&e.hasOwnProperty("lid")&&(A.lid=e.lid,a.oneofs&&(A._lid="lid")),e.username!=null&&e.hasOwnProperty("username")&&(A.username=e.username,a.oneofs&&(A._username="username")),e.countryCode!=null&&e.hasOwnProperty("countryCode")&&(A.countryCode=e.countryCode,a.oneofs&&(A._countryCode="countryCode")),e.isUsernameDeleted!=null&&e.hasOwnProperty("isUsernameDeleted")&&(A.isUsernameDeleted=e.isUsernameDeleted,a.oneofs&&(A._isUsernameDeleted="isUsernameDeleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Account"},t})(),n.ActionLink=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.url=e.string();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ActionLink)return e;var a=new p.proto.ActionLink;return e.url!=null&&(a.url=String(e.url)),e.buttonTitle!=null&&(a.buttonTitle=String(e.buttonTitle)),a},t.toObject=function(e,a){a||(a={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,a.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ActionLink"},t})(),n.AutoDownloadSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.downloadImages=e.bool();break}case 2:{s.downloadAudio=e.bool();break}case 3:{s.downloadVideo=e.bool();break}case 4:{s.downloadDocuments=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AutoDownloadSettings)return e;var a=new p.proto.AutoDownloadSettings;return e.downloadImages!=null&&(a.downloadImages=!!e.downloadImages),e.downloadAudio!=null&&(a.downloadAudio=!!e.downloadAudio),e.downloadVideo!=null&&(a.downloadVideo=!!e.downloadVideo),e.downloadDocuments!=null&&(a.downloadDocuments=!!e.downloadDocuments),a},t.toObject=function(e,a){a||(a={});var A={};return e.downloadImages!=null&&e.hasOwnProperty("downloadImages")&&(A.downloadImages=e.downloadImages,a.oneofs&&(A._downloadImages="downloadImages")),e.downloadAudio!=null&&e.hasOwnProperty("downloadAudio")&&(A.downloadAudio=e.downloadAudio,a.oneofs&&(A._downloadAudio="downloadAudio")),e.downloadVideo!=null&&e.hasOwnProperty("downloadVideo")&&(A.downloadVideo=e.downloadVideo,a.oneofs&&(A._downloadVideo="downloadVideo")),e.downloadDocuments!=null&&e.hasOwnProperty("downloadDocuments")&&(A.downloadDocuments=e.downloadDocuments,a.oneofs&&(A._downloadDocuments="downloadDocuments")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AutoDownloadSettings"},t})(),n.AvatarUserSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.fbid=e.string();break}case 2:{s.password=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.AvatarUserSettings)return e;var a=new p.proto.AvatarUserSettings;return e.fbid!=null&&(a.fbid=String(e.fbid)),e.password!=null&&(a.password=String(e.password)),a},t.toObject=function(e,a){a||(a={});var A={};return e.fbid!=null&&e.hasOwnProperty("fbid")&&(A.fbid=e.fbid,a.oneofs&&(A._fbid="fbid")),e.password!=null&&e.hasOwnProperty("password")&&(A.password=e.password,a.oneofs&&(A._password="password")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AvatarUserSettings"},t})(),n.BizAccountLinkInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.whatsappBizAcctFbid=e.uint64();break}case 2:{s.whatsappAcctNumber=e.string();break}case 3:{s.issueTime=e.uint64();break}case 4:{s.hostStorage=e.int32();break}case 5:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BizAccountLinkInfo)return e;var a=new p.proto.BizAccountLinkInfo;switch(e.whatsappBizAcctFbid!=null&&(l.Long?(a.whatsappBizAcctFbid=l.Long.fromValue(e.whatsappBizAcctFbid)).unsigned=!0:typeof e.whatsappBizAcctFbid=="string"?a.whatsappBizAcctFbid=parseInt(e.whatsappBizAcctFbid,10):typeof e.whatsappBizAcctFbid=="number"?a.whatsappBizAcctFbid=e.whatsappBizAcctFbid:typeof e.whatsappBizAcctFbid=="object"&&(a.whatsappBizAcctFbid=new l.LongBits(e.whatsappBizAcctFbid.low>>>0,e.whatsappBizAcctFbid.high>>>0).toNumber(!0))),e.whatsappAcctNumber!=null&&(a.whatsappAcctNumber=String(e.whatsappAcctNumber)),e.issueTime!=null&&(l.Long?(a.issueTime=l.Long.fromValue(e.issueTime)).unsigned=!0:typeof e.issueTime=="string"?a.issueTime=parseInt(e.issueTime,10):typeof e.issueTime=="number"?a.issueTime=e.issueTime:typeof e.issueTime=="object"&&(a.issueTime=new l.LongBits(e.issueTime.low>>>0,e.issueTime.high>>>0).toNumber(!0))),e.hostStorage){default:if(typeof e.hostStorage=="number"){a.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:a.hostStorage=0;break;case"FACEBOOK":case 1:a.hostStorage=1;break}switch(e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"ENTERPRISE":case 0:a.accountType=0;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.whatsappBizAcctFbid!=null&&e.hasOwnProperty("whatsappBizAcctFbid")&&(typeof e.whatsappBizAcctFbid=="number"?A.whatsappBizAcctFbid=a.longs===String?String(e.whatsappBizAcctFbid):e.whatsappBizAcctFbid:A.whatsappBizAcctFbid=a.longs===String?ge(e.whatsappBizAcctFbid,!0):a.longs===Number?ce(e.whatsappBizAcctFbid,!0):e.whatsappBizAcctFbid,a.oneofs&&(A._whatsappBizAcctFbid="whatsappBizAcctFbid")),e.whatsappAcctNumber!=null&&e.hasOwnProperty("whatsappAcctNumber")&&(A.whatsappAcctNumber=e.whatsappAcctNumber,a.oneofs&&(A._whatsappAcctNumber="whatsappAcctNumber")),e.issueTime!=null&&e.hasOwnProperty("issueTime")&&(typeof e.issueTime=="number"?A.issueTime=a.longs===String?String(e.issueTime):e.issueTime:A.issueTime=a.longs===String?ge(e.issueTime,!0):a.longs===Number?ce(e.issueTime,!0):e.issueTime,a.oneofs&&(A._issueTime="issueTime")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=a.enums===String?p.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:p.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]:e.hostStorage,a.oneofs&&(A._hostStorage="hostStorage")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.BizAccountLinkInfo.AccountType[e.accountType]===void 0?e.accountType:p.proto.BizAccountLinkInfo.AccountType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountLinkInfo"},t.AccountType=(function(){let i={},e=Object.create(i);return e[i[0]="ENTERPRISE"]=0,e})(),t.HostStorageType=(function(){let i={},e=Object.create(i);return e[i[0]="ON_PREMISE"]=0,e[i[1]="FACEBOOK"]=1,e})(),t})(),n.BizAccountPayload=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.vnameCert=p.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 2:{s.bizAcctLinkInfo=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BizAccountPayload)return e;var a=new p.proto.BizAccountPayload;if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizAccountPayload.vnameCert: object expected");a.vnameCert=p.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}return e.bizAcctLinkInfo!=null&&(typeof e.bizAcctLinkInfo=="string"?l.base64.decode(e.bizAcctLinkInfo,a.bizAcctLinkInfo=l.newBuffer(l.base64.length(e.bizAcctLinkInfo)),0):e.bizAcctLinkInfo.length>=0&&(a.bizAcctLinkInfo=e.bizAcctLinkInfo)),a},t.toObject=function(e,a){a||(a={});var A={};return e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=p.proto.VerifiedNameCertificate.toObject(e.vnameCert,a),a.oneofs&&(A._vnameCert="vnameCert")),e.bizAcctLinkInfo!=null&&e.hasOwnProperty("bizAcctLinkInfo")&&(A.bizAcctLinkInfo=a.bytes===String?l.base64.encode(e.bizAcctLinkInfo,0,e.bizAcctLinkInfo.length):a.bytes===Array?Array.prototype.slice.call(e.bizAcctLinkInfo):e.bizAcctLinkInfo,a.oneofs&&(A._bizAcctLinkInfo="bizAcctLinkInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountPayload"},t})(),n.BizIdentityInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.vlevel=e.int32();break}case 2:{s.vnameCert=p.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 3:{s.signed=e.bool();break}case 4:{s.revoked=e.bool();break}case 5:{s.hostStorage=e.int32();break}case 6:{s.actualActors=e.int32();break}case 7:{s.privacyModeTs=e.uint64();break}case 8:{s.featureControls=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BizIdentityInfo)return e;var a=new p.proto.BizIdentityInfo;switch(e.vlevel){default:if(typeof e.vlevel=="number"){a.vlevel=e.vlevel;break}break;case"UNKNOWN":case 0:a.vlevel=0;break;case"LOW":case 1:a.vlevel=1;break;case"HIGH":case 2:a.vlevel=2;break}if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected");a.vnameCert=p.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}switch(e.signed!=null&&(a.signed=!!e.signed),e.revoked!=null&&(a.revoked=!!e.revoked),e.hostStorage){default:if(typeof e.hostStorage=="number"){a.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:a.hostStorage=0;break;case"FACEBOOK":case 1:a.hostStorage=1;break}switch(e.actualActors){default:if(typeof e.actualActors=="number"){a.actualActors=e.actualActors;break}break;case"SELF":case 0:a.actualActors=0;break;case"BSP":case 1:a.actualActors=1;break}return e.privacyModeTs!=null&&(l.Long?(a.privacyModeTs=l.Long.fromValue(e.privacyModeTs)).unsigned=!0:typeof e.privacyModeTs=="string"?a.privacyModeTs=parseInt(e.privacyModeTs,10):typeof e.privacyModeTs=="number"?a.privacyModeTs=e.privacyModeTs:typeof e.privacyModeTs=="object"&&(a.privacyModeTs=new l.LongBits(e.privacyModeTs.low>>>0,e.privacyModeTs.high>>>0).toNumber(!0))),e.featureControls!=null&&(l.Long?(a.featureControls=l.Long.fromValue(e.featureControls)).unsigned=!0:typeof e.featureControls=="string"?a.featureControls=parseInt(e.featureControls,10):typeof e.featureControls=="number"?a.featureControls=e.featureControls:typeof e.featureControls=="object"&&(a.featureControls=new l.LongBits(e.featureControls.low>>>0,e.featureControls.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.vlevel!=null&&e.hasOwnProperty("vlevel")&&(A.vlevel=a.enums===String?p.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]===void 0?e.vlevel:p.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]:e.vlevel,a.oneofs&&(A._vlevel="vlevel")),e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=p.proto.VerifiedNameCertificate.toObject(e.vnameCert,a),a.oneofs&&(A._vnameCert="vnameCert")),e.signed!=null&&e.hasOwnProperty("signed")&&(A.signed=e.signed,a.oneofs&&(A._signed="signed")),e.revoked!=null&&e.hasOwnProperty("revoked")&&(A.revoked=e.revoked,a.oneofs&&(A._revoked="revoked")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=a.enums===String?p.proto.BizIdentityInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:p.proto.BizIdentityInfo.HostStorageType[e.hostStorage]:e.hostStorage,a.oneofs&&(A._hostStorage="hostStorage")),e.actualActors!=null&&e.hasOwnProperty("actualActors")&&(A.actualActors=a.enums===String?p.proto.BizIdentityInfo.ActualActorsType[e.actualActors]===void 0?e.actualActors:p.proto.BizIdentityInfo.ActualActorsType[e.actualActors]:e.actualActors,a.oneofs&&(A._actualActors="actualActors")),e.privacyModeTs!=null&&e.hasOwnProperty("privacyModeTs")&&(typeof e.privacyModeTs=="number"?A.privacyModeTs=a.longs===String?String(e.privacyModeTs):e.privacyModeTs:A.privacyModeTs=a.longs===String?ge(e.privacyModeTs,!0):a.longs===Number?ce(e.privacyModeTs,!0):e.privacyModeTs,a.oneofs&&(A._privacyModeTs="privacyModeTs")),e.featureControls!=null&&e.hasOwnProperty("featureControls")&&(typeof e.featureControls=="number"?A.featureControls=a.longs===String?String(e.featureControls):e.featureControls:A.featureControls=a.longs===String?ge(e.featureControls,!0):a.longs===Number?ce(e.featureControls,!0):e.featureControls,a.oneofs&&(A._featureControls="featureControls")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizIdentityInfo"},t.ActualActorsType=(function(){let i={},e=Object.create(i);return e[i[0]="SELF"]=0,e[i[1]="BSP"]=1,e})(),t.HostStorageType=(function(){let i={},e=Object.create(i);return e[i[0]="ON_PREMISE"]=0,e[i[1]="FACEBOOK"]=1,e})(),t.VerifiedLevelValue=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="LOW"]=1,e[i[2]="HIGH"]=2,e})(),t})(),n.BotAgeCollectionMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.ageCollectionEligible=e.bool();break}case 2:{s.shouldTriggerAgeCollectionOnClient=e.bool();break}case 3:{s.ageCollectionType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotAgeCollectionMetadata)return e;var a=new p.proto.BotAgeCollectionMetadata;switch(e.ageCollectionEligible!=null&&(a.ageCollectionEligible=!!e.ageCollectionEligible),e.shouldTriggerAgeCollectionOnClient!=null&&(a.shouldTriggerAgeCollectionOnClient=!!e.shouldTriggerAgeCollectionOnClient),e.ageCollectionType){default:if(typeof e.ageCollectionType=="number"){a.ageCollectionType=e.ageCollectionType;break}break;case"O18_BINARY":case 0:a.ageCollectionType=0;break;case"WAFFLE":case 1:a.ageCollectionType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.ageCollectionEligible!=null&&e.hasOwnProperty("ageCollectionEligible")&&(A.ageCollectionEligible=e.ageCollectionEligible,a.oneofs&&(A._ageCollectionEligible="ageCollectionEligible")),e.shouldTriggerAgeCollectionOnClient!=null&&e.hasOwnProperty("shouldTriggerAgeCollectionOnClient")&&(A.shouldTriggerAgeCollectionOnClient=e.shouldTriggerAgeCollectionOnClient,a.oneofs&&(A._shouldTriggerAgeCollectionOnClient="shouldTriggerAgeCollectionOnClient")),e.ageCollectionType!=null&&e.hasOwnProperty("ageCollectionType")&&(A.ageCollectionType=a.enums===String?p.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]===void 0?e.ageCollectionType:p.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]:e.ageCollectionType,a.oneofs&&(A._ageCollectionType="ageCollectionType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAgeCollectionMetadata"},t.AgeCollectionType=(function(){let i={},e=Object.create(i);return e[i[0]="O18_BINARY"]=0,e[i[1]="WAFFLE"]=1,e})(),t})(),n.BotAvatarMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sentiment=e.uint32();break}case 2:{s.behaviorGraph=e.string();break}case 3:{s.action=e.uint32();break}case 4:{s.intensity=e.uint32();break}case 5:{s.wordCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotAvatarMetadata)return e;var a=new p.proto.BotAvatarMetadata;return e.sentiment!=null&&(a.sentiment=e.sentiment>>>0),e.behaviorGraph!=null&&(a.behaviorGraph=String(e.behaviorGraph)),e.action!=null&&(a.action=e.action>>>0),e.intensity!=null&&(a.intensity=e.intensity>>>0),e.wordCount!=null&&(a.wordCount=e.wordCount>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.sentiment!=null&&e.hasOwnProperty("sentiment")&&(A.sentiment=e.sentiment,a.oneofs&&(A._sentiment="sentiment")),e.behaviorGraph!=null&&e.hasOwnProperty("behaviorGraph")&&(A.behaviorGraph=e.behaviorGraph,a.oneofs&&(A._behaviorGraph="behaviorGraph")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=e.action,a.oneofs&&(A._action="action")),e.intensity!=null&&e.hasOwnProperty("intensity")&&(A.intensity=e.intensity,a.oneofs&&(A._intensity="intensity")),e.wordCount!=null&&e.hasOwnProperty("wordCount")&&(A.wordCount=e.wordCount,a.oneofs&&(A._wordCount="wordCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAvatarMetadata"},t})(),n.BotCapabilityMetadata=(function(){function t(o){if(this.capabilities=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{if(r.capabilities&&r.capabilities.length||(r.capabilities=[]),(s&7)===2)for(var g=i.uint32()+i.pos;i.pos>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.kind=e.int32();break}case 3:{s.text=e.string();break}case 4:{s.kindNegative=e.uint64();break}case 5:{s.kindPositive=e.uint64();break}case 6:{s.kindReport=e.int32();break}case 7:{s.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotFeedbackMessage)return e;var a=new p.proto.BotFeedbackMessage;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.BotFeedbackMessage.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}switch(e.kind){default:if(typeof e.kind=="number"){a.kind=e.kind;break}break;case"BOT_FEEDBACK_POSITIVE":case 0:a.kind=0;break;case"BOT_FEEDBACK_NEGATIVE_GENERIC":case 1:a.kind=1;break;case"BOT_FEEDBACK_NEGATIVE_HELPFUL":case 2:a.kind=2;break;case"BOT_FEEDBACK_NEGATIVE_INTERESTING":case 3:a.kind=3;break;case"BOT_FEEDBACK_NEGATIVE_ACCURATE":case 4:a.kind=4;break;case"BOT_FEEDBACK_NEGATIVE_SAFE":case 5:a.kind=5;break;case"BOT_FEEDBACK_NEGATIVE_OTHER":case 6:a.kind=6;break;case"BOT_FEEDBACK_NEGATIVE_REFUSED":case 7:a.kind=7;break;case"BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING":case 8:a.kind=8;break;case"BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT":case 9:a.kind=9;break;case"BOT_FEEDBACK_NEGATIVE_PERSONALIZED":case 10:a.kind=10;break;case"BOT_FEEDBACK_NEGATIVE_CLARITY":case 11:a.kind=11;break;case"BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON":case 12:a.kind=12;break;case"BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY":case 13:a.kind=13;break;case"BOT_FEEDBACK_NEGATIVE":case 14:a.kind=14;break}switch(e.text!=null&&(a.text=String(e.text)),e.kindNegative!=null&&(l.Long?(a.kindNegative=l.Long.fromValue(e.kindNegative)).unsigned=!0:typeof e.kindNegative=="string"?a.kindNegative=parseInt(e.kindNegative,10):typeof e.kindNegative=="number"?a.kindNegative=e.kindNegative:typeof e.kindNegative=="object"&&(a.kindNegative=new l.LongBits(e.kindNegative.low>>>0,e.kindNegative.high>>>0).toNumber(!0))),e.kindPositive!=null&&(l.Long?(a.kindPositive=l.Long.fromValue(e.kindPositive)).unsigned=!0:typeof e.kindPositive=="string"?a.kindPositive=parseInt(e.kindPositive,10):typeof e.kindPositive=="number"?a.kindPositive=e.kindPositive:typeof e.kindPositive=="object"&&(a.kindPositive=new l.LongBits(e.kindPositive.low>>>0,e.kindPositive.high>>>0).toNumber(!0))),e.kindReport){default:if(typeof e.kindReport=="number"){a.kindReport=e.kindReport;break}break;case"NONE":case 0:a.kindReport=0;break;case"GENERIC":case 1:a.kindReport=1;break}if(e.sideBySideSurveyMetadata!=null){if(typeof e.sideBySideSurveyMetadata!="object")throw TypeError(".proto.BotFeedbackMessage.sideBySideSurveyMetadata: object expected");a.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.fromObject(e.sideBySideSurveyMetadata)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.kind!=null&&e.hasOwnProperty("kind")&&(A.kind=a.enums===String?p.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]===void 0?e.kind:p.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]:e.kind,a.oneofs&&(A._kind="kind")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),e.kindNegative!=null&&e.hasOwnProperty("kindNegative")&&(typeof e.kindNegative=="number"?A.kindNegative=a.longs===String?String(e.kindNegative):e.kindNegative:A.kindNegative=a.longs===String?ge(e.kindNegative,!0):a.longs===Number?ce(e.kindNegative,!0):e.kindNegative,a.oneofs&&(A._kindNegative="kindNegative")),e.kindPositive!=null&&e.hasOwnProperty("kindPositive")&&(typeof e.kindPositive=="number"?A.kindPositive=a.longs===String?String(e.kindPositive):e.kindPositive:A.kindPositive=a.longs===String?ge(e.kindPositive,!0):a.longs===Number?ce(e.kindPositive,!0):e.kindPositive,a.oneofs&&(A._kindPositive="kindPositive")),e.kindReport!=null&&e.hasOwnProperty("kindReport")&&(A.kindReport=a.enums===String?p.proto.BotFeedbackMessage.ReportKind[e.kindReport]===void 0?e.kindReport:p.proto.BotFeedbackMessage.ReportKind[e.kindReport]:e.kindReport,a.oneofs&&(A._kindReport="kindReport")),e.sideBySideSurveyMetadata!=null&&e.hasOwnProperty("sideBySideSurveyMetadata")&&(A.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.toObject(e.sideBySideSurveyMetadata,a),a.oneofs&&(A._sideBySideSurveyMetadata="sideBySideSurveyMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotFeedbackMessage"},t.BotFeedbackKind=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_FEEDBACK_POSITIVE"]=0,e[i[1]="BOT_FEEDBACK_NEGATIVE_GENERIC"]=1,e[i[2]="BOT_FEEDBACK_NEGATIVE_HELPFUL"]=2,e[i[3]="BOT_FEEDBACK_NEGATIVE_INTERESTING"]=3,e[i[4]="BOT_FEEDBACK_NEGATIVE_ACCURATE"]=4,e[i[5]="BOT_FEEDBACK_NEGATIVE_SAFE"]=5,e[i[6]="BOT_FEEDBACK_NEGATIVE_OTHER"]=6,e[i[7]="BOT_FEEDBACK_NEGATIVE_REFUSED"]=7,e[i[8]="BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING"]=8,e[i[9]="BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=9,e[i[10]="BOT_FEEDBACK_NEGATIVE_PERSONALIZED"]=10,e[i[11]="BOT_FEEDBACK_NEGATIVE_CLARITY"]=11,e[i[12]="BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON"]=12,e[i[13]="BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY"]=13,e[i[14]="BOT_FEEDBACK_NEGATIVE"]=14,e})(),t.BotFeedbackKindMultipleNegative=(function(){let i={},e=Object.create(i);return e[i[1]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC"]=1,e[i[2]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL"]=2,e[i[4]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING"]=4,e[i[8]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE"]=8,e[i[16]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE"]=16,e[i[32]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER"]=32,e[i[64]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED"]=64,e[i[128]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING"]=128,e[i[256]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=256,e})(),t.BotFeedbackKindMultiplePositive=(function(){let i={},e=Object.create(i);return e[i[1]="BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC"]=1,e})(),t.ReportKind=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="GENERIC"]=1,e})(),t.SideBySideSurveyMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.selectedRequestId=A.string();break}case 2:{c.surveyId=A.uint32();break}case 3:{c.simonSessionFbid=A.string();break}case 4:{c.responseOtid=A.string();break}case 5:{c.responseTimestampMsString=A.string();break}case 6:{c.isSelectedResponsePrimary=A.bool();break}case 7:{c.messageIdToEdit=A.string();break}case 8:{c.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.decode(A,A.uint32());break}case 9:{c.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata)return A;var r=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata;if(A.selectedRequestId!=null&&(r.selectedRequestId=String(A.selectedRequestId)),A.surveyId!=null&&(r.surveyId=A.surveyId>>>0),A.simonSessionFbid!=null&&(r.simonSessionFbid=String(A.simonSessionFbid)),A.responseOtid!=null&&(r.responseOtid=String(A.responseOtid)),A.responseTimestampMsString!=null&&(r.responseTimestampMsString=String(A.responseTimestampMsString)),A.isSelectedResponsePrimary!=null&&(r.isSelectedResponsePrimary=!!A.isSelectedResponsePrimary),A.messageIdToEdit!=null&&(r.messageIdToEdit=String(A.messageIdToEdit)),A.analyticsData!=null){if(typeof A.analyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.analyticsData: object expected");r.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.fromObject(A.analyticsData)}if(A.metaAiAnalyticsData!=null){if(typeof A.metaAiAnalyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.metaAiAnalyticsData: object expected");r.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.fromObject(A.metaAiAnalyticsData)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.selectedRequestId!=null&&A.hasOwnProperty("selectedRequestId")&&(s.selectedRequestId=A.selectedRequestId,r.oneofs&&(s._selectedRequestId="selectedRequestId")),A.surveyId!=null&&A.hasOwnProperty("surveyId")&&(s.surveyId=A.surveyId,r.oneofs&&(s._surveyId="surveyId")),A.simonSessionFbid!=null&&A.hasOwnProperty("simonSessionFbid")&&(s.simonSessionFbid=A.simonSessionFbid,r.oneofs&&(s._simonSessionFbid="simonSessionFbid")),A.responseOtid!=null&&A.hasOwnProperty("responseOtid")&&(s.responseOtid=A.responseOtid,r.oneofs&&(s._responseOtid="responseOtid")),A.responseTimestampMsString!=null&&A.hasOwnProperty("responseTimestampMsString")&&(s.responseTimestampMsString=A.responseTimestampMsString,r.oneofs&&(s._responseTimestampMsString="responseTimestampMsString")),A.isSelectedResponsePrimary!=null&&A.hasOwnProperty("isSelectedResponsePrimary")&&(s.isSelectedResponsePrimary=A.isSelectedResponsePrimary,r.oneofs&&(s._isSelectedResponsePrimary="isSelectedResponsePrimary")),A.messageIdToEdit!=null&&A.hasOwnProperty("messageIdToEdit")&&(s.messageIdToEdit=A.messageIdToEdit,r.oneofs&&(s._messageIdToEdit="messageIdToEdit")),A.analyticsData!=null&&A.hasOwnProperty("analyticsData")&&(s.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.toObject(A.analyticsData,r),r.oneofs&&(s._analyticsData="analyticsData")),A.metaAiAnalyticsData!=null&&A.hasOwnProperty("metaAiAnalyticsData")&&(s.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.toObject(A.metaAiAnalyticsData,r),r.oneofs&&(s._metaAiAnalyticsData="metaAiAnalyticsData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata"},i.SideBySideSurveyAnalyticsData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.tessaEvent=s.string();break}case 2:{d.tessaSessionFbid=s.string();break}case 3:{d.simonSessionFbid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData)return s;var g=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData;return s.tessaEvent!=null&&(g.tessaEvent=String(s.tessaEvent)),s.tessaSessionFbid!=null&&(g.tessaSessionFbid=String(s.tessaSessionFbid)),s.simonSessionFbid!=null&&(g.simonSessionFbid=String(s.simonSessionFbid)),g},a.toObject=function(s,g){g||(g={});var c={};return s.tessaEvent!=null&&s.hasOwnProperty("tessaEvent")&&(c.tessaEvent=s.tessaEvent,g.oneofs&&(c._tessaEvent="tessaEvent")),s.tessaSessionFbid!=null&&s.hasOwnProperty("tessaSessionFbid")&&(c.tessaSessionFbid=s.tessaSessionFbid,g.oneofs&&(c._tessaSessionFbid="tessaSessionFbid")),s.simonSessionFbid!=null&&s.hasOwnProperty("simonSessionFbid")&&(c.simonSessionFbid=s.simonSessionFbid,g.oneofs&&(c._simonSessionFbid="simonSessionFbid")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData"},a})(),i.SidebySideSurveyMetaAiAnalyticsData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.surveyId=s.uint32();break}case 2:{d.primaryResponseId=s.string();break}case 3:{d.testArmName=s.string();break}case 4:{d.timestampMsString=s.string();break}case 5:{d.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.decode(s,s.uint32());break}case 6:{d.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.decode(s,s.uint32());break}case 7:{d.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.decode(s,s.uint32());break}case 8:{d.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.decode(s,s.uint32());break}case 9:{d.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData)return s;var g=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData;if(s.surveyId!=null&&(g.surveyId=s.surveyId>>>0),s.primaryResponseId!=null&&(g.primaryResponseId=String(s.primaryResponseId)),s.testArmName!=null&&(g.testArmName=String(s.testArmName)),s.timestampMsString!=null&&(g.timestampMsString=String(s.timestampMsString)),s.ctaImpressionEvent!=null){if(typeof s.ctaImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaImpressionEvent: object expected");g.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.fromObject(s.ctaImpressionEvent)}if(s.ctaClickEvent!=null){if(typeof s.ctaClickEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaClickEvent: object expected");g.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.fromObject(s.ctaClickEvent)}if(s.cardImpressionEvent!=null){if(typeof s.cardImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.cardImpressionEvent: object expected");g.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.fromObject(s.cardImpressionEvent)}if(s.responseEvent!=null){if(typeof s.responseEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.responseEvent: object expected");g.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.fromObject(s.responseEvent)}if(s.abandonEvent!=null){if(typeof s.abandonEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.abandonEvent: object expected");g.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.fromObject(s.abandonEvent)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.surveyId!=null&&s.hasOwnProperty("surveyId")&&(c.surveyId=s.surveyId,g.oneofs&&(c._surveyId="surveyId")),s.primaryResponseId!=null&&s.hasOwnProperty("primaryResponseId")&&(c.primaryResponseId=s.primaryResponseId,g.oneofs&&(c._primaryResponseId="primaryResponseId")),s.testArmName!=null&&s.hasOwnProperty("testArmName")&&(c.testArmName=s.testArmName,g.oneofs&&(c._testArmName="testArmName")),s.timestampMsString!=null&&s.hasOwnProperty("timestampMsString")&&(c.timestampMsString=s.timestampMsString,g.oneofs&&(c._timestampMsString="timestampMsString")),s.ctaImpressionEvent!=null&&s.hasOwnProperty("ctaImpressionEvent")&&(c.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.toObject(s.ctaImpressionEvent,g),g.oneofs&&(c._ctaImpressionEvent="ctaImpressionEvent")),s.ctaClickEvent!=null&&s.hasOwnProperty("ctaClickEvent")&&(c.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.toObject(s.ctaClickEvent,g),g.oneofs&&(c._ctaClickEvent="ctaClickEvent")),s.cardImpressionEvent!=null&&s.hasOwnProperty("cardImpressionEvent")&&(c.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.toObject(s.cardImpressionEvent,g),g.oneofs&&(c._cardImpressionEvent="cardImpressionEvent")),s.responseEvent!=null&&s.hasOwnProperty("responseEvent")&&(c.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.toObject(s.responseEvent,g),g.oneofs&&(c._responseEvent="responseEvent")),s.abandonEvent!=null&&s.hasOwnProperty("abandonEvent")&&(c.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.toObject(s.abandonEvent,g),g.oneofs&&(c._abandonEvent="abandonEvent")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData"},a.SideBySideSurveyAbandonEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.abandonDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData;return c.abandonDwellTimeMsString!=null&&(I.abandonDwellTimeMsString=String(c.abandonDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var d={};return c.abandonDwellTimeMsString!=null&&c.hasOwnProperty("abandonDwellTimeMsString")&&(d.abandonDwellTimeMsString=c.abandonDwellTimeMsString,I.oneofs&&(d._abandonDwellTimeMsString="abandonDwellTimeMsString")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData"},r})(),a.SideBySideSurveyCTAClickEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}case 2:{f.clickDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),c.clickDwellTimeMsString!=null&&(I.clickDwellTimeMsString=String(c.clickDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var d={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(d.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(d._isSurveyExpired="isSurveyExpired")),c.clickDwellTimeMsString!=null&&c.hasOwnProperty("clickDwellTimeMsString")&&(d.clickDwellTimeMsString=c.clickDwellTimeMsString,I.oneofs&&(d._clickDwellTimeMsString="clickDwellTimeMsString")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData"},r})(),a.SideBySideSurveyCTAImpressionEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),I},r.toObject=function(c,I){I||(I={});var d={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(d.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(d._isSurveyExpired="isSurveyExpired")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData"},r})(),a.SideBySideSurveyCardImpressionEventData=(function(){function r(s){if(s)for(var g=Object.keys(s),c=0;c>>3){default:g.skipType(f&7);break}}return B},r.fromObject=function(g){return g instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData?g:new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData},r.toObject=function(){return{}},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(g){return g===void 0&&(g="type.googleapis.com"),g+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData"},r})(),a.SideBySideSurveyResponseEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.responseDwellTimeMsString=c.string();break}case 2:{f.selectedResponseId=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData;return c.responseDwellTimeMsString!=null&&(I.responseDwellTimeMsString=String(c.responseDwellTimeMsString)),c.selectedResponseId!=null&&(I.selectedResponseId=String(c.selectedResponseId)),I},r.toObject=function(c,I){I||(I={});var d={};return c.responseDwellTimeMsString!=null&&c.hasOwnProperty("responseDwellTimeMsString")&&(d.responseDwellTimeMsString=c.responseDwellTimeMsString,I.oneofs&&(d._responseDwellTimeMsString="responseDwellTimeMsString")),c.selectedResponseId!=null&&c.hasOwnProperty("selectedResponseId")&&(d.selectedResponseId=c.selectedResponseId,I.oneofs&&(d._selectedResponseId="selectedResponseId")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData"},r})(),a})(),i})(),t})(),n.BotImagineMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.imagineType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotImagineMetadata)return e;var a=new p.proto.BotImagineMetadata;switch(e.imagineType){default:if(typeof e.imagineType=="number"){a.imagineType=e.imagineType;break}break;case"UNKNOWN":case 0:a.imagineType=0;break;case"IMAGINE":case 1:a.imagineType=1;break;case"MEMU":case 2:a.imagineType=2;break;case"FLASH":case 3:a.imagineType=3;break;case"EDIT":case 4:a.imagineType=4;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.imagineType!=null&&e.hasOwnProperty("imagineType")&&(A.imagineType=a.enums===String?p.proto.BotImagineMetadata.ImagineType[e.imagineType]===void 0?e.imagineType:p.proto.BotImagineMetadata.ImagineType[e.imagineType]:e.imagineType,a.oneofs&&(A._imagineType="imagineType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotImagineMetadata"},t.ImagineType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="IMAGINE"]=1,e[i[2]="MEMU"]=2,e[i[3]="FLASH"]=3,e[i[4]="EDIT"]=4,e})(),t})(),n.BotLinkedAccount=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotLinkedAccount)return e;var a=new p.proto.BotLinkedAccount;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"BOT_LINKED_ACCOUNT_TYPE_1P":case 0:a.type=0;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.BotLinkedAccount.BotLinkedAccountType[e.type]===void 0?e.type:p.proto.BotLinkedAccount.BotLinkedAccountType[e.type]:e.type,a.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotLinkedAccount"},t.BotLinkedAccountType=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_LINKED_ACCOUNT_TYPE_1P"]=0,e})(),t})(),n.BotLinkedAccountsMetadata=(function(){function t(i){if(this.accounts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(p.proto.BotLinkedAccount.decode(e,e.uint32()));break}case 2:{s.acAuthTokens=e.bytes();break}case 3:{s.acErrorCode=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotLinkedAccountsMetadata)return e;var a=new p.proto.BotLinkedAccountsMetadata;if(e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");a.accounts=[];for(var A=0;A=0&&(a.acAuthTokens=e.acAuthTokens)),e.acErrorCode!=null&&(a.acErrorCode=e.acErrorCode|0),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.accounts=[]),e.accounts&&e.accounts.length){A.accounts=[];for(var r=0;r>>3){case 1:{s.fileSha256=e.string();break}case 2:{s.mediaKey=e.string();break}case 3:{s.fileEncSha256=e.string();break}case 4:{s.directPath=e.string();break}case 5:{s.mediaKeyTimestamp=e.int64();break}case 6:{s.mimetype=e.string();break}case 7:{s.orientationType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMediaMetadata)return e;var a=new p.proto.BotMediaMetadata;switch(e.fileSha256!=null&&(a.fileSha256=String(e.fileSha256)),e.mediaKey!=null&&(a.mediaKey=String(e.mediaKey)),e.fileEncSha256!=null&&(a.fileEncSha256=String(e.fileEncSha256)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.mediaKeyTimestamp!=null&&(l.Long?(a.mediaKeyTimestamp=l.Long.fromValue(e.mediaKeyTimestamp)).unsigned=!1:typeof e.mediaKeyTimestamp=="string"?a.mediaKeyTimestamp=parseInt(e.mediaKeyTimestamp,10):typeof e.mediaKeyTimestamp=="number"?a.mediaKeyTimestamp=e.mediaKeyTimestamp:typeof e.mediaKeyTimestamp=="object"&&(a.mediaKeyTimestamp=new l.LongBits(e.mediaKeyTimestamp.low>>>0,e.mediaKeyTimestamp.high>>>0).toNumber())),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.orientationType){default:if(typeof e.orientationType=="number"){a.orientationType=e.orientationType;break}break;case"CENTER":case 1:a.orientationType=1;break;case"LEFT":case 2:a.orientationType=2;break;case"RIGHT":case 3:a.orientationType=3;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.mediaKeyTimestamp!=null&&e.hasOwnProperty("mediaKeyTimestamp")&&(typeof e.mediaKeyTimestamp=="number"?A.mediaKeyTimestamp=a.longs===String?String(e.mediaKeyTimestamp):e.mediaKeyTimestamp:A.mediaKeyTimestamp=a.longs===String?ge(e.mediaKeyTimestamp):a.longs===Number?ce(e.mediaKeyTimestamp):e.mediaKeyTimestamp,a.oneofs&&(A._mediaKeyTimestamp="mediaKeyTimestamp")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.orientationType!=null&&e.hasOwnProperty("orientationType")&&(A.orientationType=a.enums===String?p.proto.BotMediaMetadata.OrientationType[e.orientationType]===void 0?e.orientationType:p.proto.BotMediaMetadata.OrientationType[e.orientationType]:e.orientationType,a.oneofs&&(A._orientationType="orientationType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMediaMetadata"},t.OrientationType=(function(){let i={},e=Object.create(i);return e[i[1]="CENTER"]=1,e[i[2]="LEFT"]=2,e[i[3]="RIGHT"]=3,e})(),t})(),n.BotMemoryFact=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.fact=e.string();break}case 2:{s.factId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMemoryFact)return e;var a=new p.proto.BotMemoryFact;return e.fact!=null&&(a.fact=String(e.fact)),e.factId!=null&&(a.factId=String(e.factId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.fact!=null&&e.hasOwnProperty("fact")&&(A.fact=e.fact,a.oneofs&&(A._fact="fact")),e.factId!=null&&e.hasOwnProperty("factId")&&(A.factId=e.factId,a.oneofs&&(A._factId="factId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMemoryFact"},t})(),n.BotMemoryMetadata=(function(){function t(i){if(this.addedFacts=[],this.removedFacts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.addedFacts&&s.addedFacts.length||(s.addedFacts=[]),s.addedFacts.push(p.proto.BotMemoryFact.decode(e,e.uint32()));break}case 2:{s.removedFacts&&s.removedFacts.length||(s.removedFacts=[]),s.removedFacts.push(p.proto.BotMemoryFact.decode(e,e.uint32()));break}case 3:{s.disclaimer=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMemoryMetadata)return e;var a=new p.proto.BotMemoryMetadata;if(e.addedFacts){if(!Array.isArray(e.addedFacts))throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected");a.addedFacts=[];for(var A=0;A>>3){case 1:{r.faceImages&&r.faceImages.length||(r.faceImages=[]),r.faceImages.push(p.proto.BotMediaMetadata.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotMemuMetadata)return i;var e=new p.proto.BotMemuMetadata;if(i.faceImages){if(!Array.isArray(i.faceImages))throw TypeError(".proto.BotMemuMetadata.faceImages: array expected");e.faceImages=[];for(var a=0;a>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMessageOrigin)return e;var a=new p.proto.BotMessageOrigin;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED":case 0:a.type=0;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.BotMessageOrigin.BotMessageOriginType[e.type]===void 0?e.type:p.proto.BotMessageOrigin.BotMessageOriginType[e.type]:e.type,a.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageOrigin"},t.BotMessageOriginType=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED"]=0,e})(),t})(),n.BotMessageOriginMetadata=(function(){function t(o){if(this.origins=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.origins&&r.origins.length||(r.origins=[]),r.origins.push(p.proto.BotMessageOrigin.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotMessageOriginMetadata)return i;var e=new p.proto.BotMessageOriginMetadata;if(i.origins){if(!Array.isArray(i.origins))throw TypeError(".proto.BotMessageOriginMetadata.origins: array expected");e.origins=[];for(var a=0;a>>3){case 1:{s.botEntryPointOrigin=e.int32();break}case 2:{s.forwardScore=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMessageSharingInfo)return e;var a=new p.proto.BotMessageSharingInfo;switch(e.botEntryPointOrigin){default:if(typeof e.botEntryPointOrigin=="number"){a.botEntryPointOrigin=e.botEntryPointOrigin;break}break;case"UNDEFINED_ENTRY_POINT":case 0:a.botEntryPointOrigin=0;break;case"FAVICON":case 1:a.botEntryPointOrigin=1;break;case"CHATLIST":case 2:a.botEntryPointOrigin=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:a.botEntryPointOrigin=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:a.botEntryPointOrigin=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:a.botEntryPointOrigin=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:a.botEntryPointOrigin=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:a.botEntryPointOrigin=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:a.botEntryPointOrigin=8;break;case"AIVOICE_SEARCH_BAR":case 9:a.botEntryPointOrigin=9;break;case"AIVOICE_FAVICON":case 10:a.botEntryPointOrigin=10;break;case"AISTUDIO":case 11:a.botEntryPointOrigin=11;break;case"DEEPLINK":case 12:a.botEntryPointOrigin=12;break;case"NOTIFICATION":case 13:a.botEntryPointOrigin=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:a.botEntryPointOrigin=14;break;case"FORWARD":case 15:a.botEntryPointOrigin=15;break;case"APP_SHORTCUT":case 16:a.botEntryPointOrigin=16;break;case"FF_FAMILY":case 17:a.botEntryPointOrigin=17;break;case"AI_TAB":case 18:a.botEntryPointOrigin=18;break;case"AI_HOME":case 19:a.botEntryPointOrigin=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:a.botEntryPointOrigin=20;break;case"AI_DEEPLINK":case 21:a.botEntryPointOrigin=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:a.botEntryPointOrigin=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:a.botEntryPointOrigin=23;break;case"NEW_CHAT_AI_STUDIO":case 24:a.botEntryPointOrigin=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:a.botEntryPointOrigin=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:a.botEntryPointOrigin=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:a.botEntryPointOrigin=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:a.botEntryPointOrigin=28;break;case"INVOKE_META_AI_1ON1":case 29:a.botEntryPointOrigin=29;break;case"INVOKE_META_AI_GROUP":case 30:a.botEntryPointOrigin=30;break;case"META_AI_FORWARD":case 31:a.botEntryPointOrigin=31;break;case"NEW_CHAT_AI_CONTACT":case 32:a.botEntryPointOrigin=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:a.botEntryPointOrigin=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:a.botEntryPointOrigin=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:a.botEntryPointOrigin=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:a.botEntryPointOrigin=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:a.botEntryPointOrigin=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:a.botEntryPointOrigin=38;break}return e.forwardScore!=null&&(a.forwardScore=e.forwardScore>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.botEntryPointOrigin!=null&&e.hasOwnProperty("botEntryPointOrigin")&&(A.botEntryPointOrigin=a.enums===String?p.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]===void 0?e.botEntryPointOrigin:p.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]:e.botEntryPointOrigin,a.oneofs&&(A._botEntryPointOrigin="botEntryPointOrigin")),e.forwardScore!=null&&e.hasOwnProperty("forwardScore")&&(A.forwardScore=e.forwardScore,a.oneofs&&(A._forwardScore="forwardScore")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageSharingInfo"},t})(),n.BotMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.avatarMetadata=p.proto.BotAvatarMetadata.decode(e,e.uint32());break}case 2:{s.personaId=e.string();break}case 3:{s.pluginMetadata=p.proto.BotPluginMetadata.decode(e,e.uint32());break}case 4:{s.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.decode(e,e.uint32());break}case 5:{s.invokerJid=e.string();break}case 6:{s.sessionMetadata=p.proto.BotSessionMetadata.decode(e,e.uint32());break}case 7:{s.memuMetadata=p.proto.BotMemuMetadata.decode(e,e.uint32());break}case 8:{s.timezone=e.string();break}case 9:{s.reminderMetadata=p.proto.BotReminderMetadata.decode(e,e.uint32());break}case 10:{s.modelMetadata=p.proto.BotModelMetadata.decode(e,e.uint32());break}case 11:{s.messageDisclaimerText=e.string();break}case 12:{s.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.decode(e,e.uint32());break}case 13:{s.capabilityMetadata=p.proto.BotCapabilityMetadata.decode(e,e.uint32());break}case 14:{s.imagineMetadata=p.proto.BotImagineMetadata.decode(e,e.uint32());break}case 15:{s.memoryMetadata=p.proto.BotMemoryMetadata.decode(e,e.uint32());break}case 16:{s.renderingMetadata=p.proto.BotRenderingMetadata.decode(e,e.uint32());break}case 17:{s.botMetricsMetadata=p.proto.BotMetricsMetadata.decode(e,e.uint32());break}case 18:{s.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.decode(e,e.uint32());break}case 19:{s.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.decode(e,e.uint32());break}case 20:{s.aiConversationContext=e.bytes();break}case 21:{s.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.decode(e,e.uint32());break}case 22:{s.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.decode(e,e.uint32());break}case 23:{s.botQuotaMetadata=p.proto.BotQuotaMetadata.decode(e,e.uint32());break}case 24:{s.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.decode(e,e.uint32());break}case 25:{s.conversationStarterPromptId=e.string();break}case 26:{s.botResponseId=e.string();break}case 27:{s.verificationMetadata=p.proto.BotSignatureVerificationMetadata.decode(e,e.uint32());break}case 28:{s.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.decode(e,e.uint32());break}case 29:{s.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.decode(e,e.uint32());break}case 30:{s.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.decode(e,e.uint32());break}case 31:{s.botThreadInfo=p.proto.AIThreadInfo.decode(e,e.uint32());break}case 32:{s.regenerateMetadata=p.proto.AIRegenerateMetadata.decode(e,e.uint32());break}case 33:{s.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.decode(e,e.uint32());break}case 999:{s.internalMetadata=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMetadata)return e;var a=new p.proto.BotMetadata;if(e.avatarMetadata!=null){if(typeof e.avatarMetadata!="object")throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");a.avatarMetadata=p.proto.BotAvatarMetadata.fromObject(e.avatarMetadata)}if(e.personaId!=null&&(a.personaId=String(e.personaId)),e.pluginMetadata!=null){if(typeof e.pluginMetadata!="object")throw TypeError(".proto.BotMetadata.pluginMetadata: object expected");a.pluginMetadata=p.proto.BotPluginMetadata.fromObject(e.pluginMetadata)}if(e.suggestedPromptMetadata!=null){if(typeof e.suggestedPromptMetadata!="object")throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected");a.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.fromObject(e.suggestedPromptMetadata)}if(e.invokerJid!=null&&(a.invokerJid=String(e.invokerJid)),e.sessionMetadata!=null){if(typeof e.sessionMetadata!="object")throw TypeError(".proto.BotMetadata.sessionMetadata: object expected");a.sessionMetadata=p.proto.BotSessionMetadata.fromObject(e.sessionMetadata)}if(e.memuMetadata!=null){if(typeof e.memuMetadata!="object")throw TypeError(".proto.BotMetadata.memuMetadata: object expected");a.memuMetadata=p.proto.BotMemuMetadata.fromObject(e.memuMetadata)}if(e.timezone!=null&&(a.timezone=String(e.timezone)),e.reminderMetadata!=null){if(typeof e.reminderMetadata!="object")throw TypeError(".proto.BotMetadata.reminderMetadata: object expected");a.reminderMetadata=p.proto.BotReminderMetadata.fromObject(e.reminderMetadata)}if(e.modelMetadata!=null){if(typeof e.modelMetadata!="object")throw TypeError(".proto.BotMetadata.modelMetadata: object expected");a.modelMetadata=p.proto.BotModelMetadata.fromObject(e.modelMetadata)}if(e.messageDisclaimerText!=null&&(a.messageDisclaimerText=String(e.messageDisclaimerText)),e.progressIndicatorMetadata!=null){if(typeof e.progressIndicatorMetadata!="object")throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected");a.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.fromObject(e.progressIndicatorMetadata)}if(e.capabilityMetadata!=null){if(typeof e.capabilityMetadata!="object")throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected");a.capabilityMetadata=p.proto.BotCapabilityMetadata.fromObject(e.capabilityMetadata)}if(e.imagineMetadata!=null){if(typeof e.imagineMetadata!="object")throw TypeError(".proto.BotMetadata.imagineMetadata: object expected");a.imagineMetadata=p.proto.BotImagineMetadata.fromObject(e.imagineMetadata)}if(e.memoryMetadata!=null){if(typeof e.memoryMetadata!="object")throw TypeError(".proto.BotMetadata.memoryMetadata: object expected");a.memoryMetadata=p.proto.BotMemoryMetadata.fromObject(e.memoryMetadata)}if(e.renderingMetadata!=null){if(typeof e.renderingMetadata!="object")throw TypeError(".proto.BotMetadata.renderingMetadata: object expected");a.renderingMetadata=p.proto.BotRenderingMetadata.fromObject(e.renderingMetadata)}if(e.botMetricsMetadata!=null){if(typeof e.botMetricsMetadata!="object")throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected");a.botMetricsMetadata=p.proto.BotMetricsMetadata.fromObject(e.botMetricsMetadata)}if(e.botLinkedAccountsMetadata!=null){if(typeof e.botLinkedAccountsMetadata!="object")throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected");a.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.fromObject(e.botLinkedAccountsMetadata)}if(e.richResponseSourcesMetadata!=null){if(typeof e.richResponseSourcesMetadata!="object")throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected");a.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.fromObject(e.richResponseSourcesMetadata)}if(e.aiConversationContext!=null&&(typeof e.aiConversationContext=="string"?l.base64.decode(e.aiConversationContext,a.aiConversationContext=l.newBuffer(l.base64.length(e.aiConversationContext)),0):e.aiConversationContext.length>=0&&(a.aiConversationContext=e.aiConversationContext)),e.botPromotionMessageMetadata!=null){if(typeof e.botPromotionMessageMetadata!="object")throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected");a.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.fromObject(e.botPromotionMessageMetadata)}if(e.botModeSelectionMetadata!=null){if(typeof e.botModeSelectionMetadata!="object")throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected");a.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.fromObject(e.botModeSelectionMetadata)}if(e.botQuotaMetadata!=null){if(typeof e.botQuotaMetadata!="object")throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected");a.botQuotaMetadata=p.proto.BotQuotaMetadata.fromObject(e.botQuotaMetadata)}if(e.botAgeCollectionMetadata!=null){if(typeof e.botAgeCollectionMetadata!="object")throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected");a.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.fromObject(e.botAgeCollectionMetadata)}if(e.conversationStarterPromptId!=null&&(a.conversationStarterPromptId=String(e.conversationStarterPromptId)),e.botResponseId!=null&&(a.botResponseId=String(e.botResponseId)),e.verificationMetadata!=null){if(typeof e.verificationMetadata!="object")throw TypeError(".proto.BotMetadata.verificationMetadata: object expected");a.verificationMetadata=p.proto.BotSignatureVerificationMetadata.fromObject(e.verificationMetadata)}if(e.unifiedResponseMutation!=null){if(typeof e.unifiedResponseMutation!="object")throw TypeError(".proto.BotMetadata.unifiedResponseMutation: object expected");a.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.fromObject(e.unifiedResponseMutation)}if(e.botMessageOriginMetadata!=null){if(typeof e.botMessageOriginMetadata!="object")throw TypeError(".proto.BotMetadata.botMessageOriginMetadata: object expected");a.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.fromObject(e.botMessageOriginMetadata)}if(e.inThreadSurveyMetadata!=null){if(typeof e.inThreadSurveyMetadata!="object")throw TypeError(".proto.BotMetadata.inThreadSurveyMetadata: object expected");a.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.fromObject(e.inThreadSurveyMetadata)}if(e.botThreadInfo!=null){if(typeof e.botThreadInfo!="object")throw TypeError(".proto.BotMetadata.botThreadInfo: object expected");a.botThreadInfo=p.proto.AIThreadInfo.fromObject(e.botThreadInfo)}if(e.regenerateMetadata!=null){if(typeof e.regenerateMetadata!="object")throw TypeError(".proto.BotMetadata.regenerateMetadata: object expected");a.regenerateMetadata=p.proto.AIRegenerateMetadata.fromObject(e.regenerateMetadata)}if(e.sessionTransparencyMetadata!=null){if(typeof e.sessionTransparencyMetadata!="object")throw TypeError(".proto.BotMetadata.sessionTransparencyMetadata: object expected");a.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.fromObject(e.sessionTransparencyMetadata)}return e.internalMetadata!=null&&(typeof e.internalMetadata=="string"?l.base64.decode(e.internalMetadata,a.internalMetadata=l.newBuffer(l.base64.length(e.internalMetadata)),0):e.internalMetadata.length>=0&&(a.internalMetadata=e.internalMetadata)),a},t.toObject=function(e,a){a||(a={});var A={};return e.avatarMetadata!=null&&e.hasOwnProperty("avatarMetadata")&&(A.avatarMetadata=p.proto.BotAvatarMetadata.toObject(e.avatarMetadata,a),a.oneofs&&(A._avatarMetadata="avatarMetadata")),e.personaId!=null&&e.hasOwnProperty("personaId")&&(A.personaId=e.personaId,a.oneofs&&(A._personaId="personaId")),e.pluginMetadata!=null&&e.hasOwnProperty("pluginMetadata")&&(A.pluginMetadata=p.proto.BotPluginMetadata.toObject(e.pluginMetadata,a),a.oneofs&&(A._pluginMetadata="pluginMetadata")),e.suggestedPromptMetadata!=null&&e.hasOwnProperty("suggestedPromptMetadata")&&(A.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.toObject(e.suggestedPromptMetadata,a),a.oneofs&&(A._suggestedPromptMetadata="suggestedPromptMetadata")),e.invokerJid!=null&&e.hasOwnProperty("invokerJid")&&(A.invokerJid=e.invokerJid,a.oneofs&&(A._invokerJid="invokerJid")),e.sessionMetadata!=null&&e.hasOwnProperty("sessionMetadata")&&(A.sessionMetadata=p.proto.BotSessionMetadata.toObject(e.sessionMetadata,a),a.oneofs&&(A._sessionMetadata="sessionMetadata")),e.memuMetadata!=null&&e.hasOwnProperty("memuMetadata")&&(A.memuMetadata=p.proto.BotMemuMetadata.toObject(e.memuMetadata,a),a.oneofs&&(A._memuMetadata="memuMetadata")),e.timezone!=null&&e.hasOwnProperty("timezone")&&(A.timezone=e.timezone,a.oneofs&&(A._timezone="timezone")),e.reminderMetadata!=null&&e.hasOwnProperty("reminderMetadata")&&(A.reminderMetadata=p.proto.BotReminderMetadata.toObject(e.reminderMetadata,a),a.oneofs&&(A._reminderMetadata="reminderMetadata")),e.modelMetadata!=null&&e.hasOwnProperty("modelMetadata")&&(A.modelMetadata=p.proto.BotModelMetadata.toObject(e.modelMetadata,a),a.oneofs&&(A._modelMetadata="modelMetadata")),e.messageDisclaimerText!=null&&e.hasOwnProperty("messageDisclaimerText")&&(A.messageDisclaimerText=e.messageDisclaimerText,a.oneofs&&(A._messageDisclaimerText="messageDisclaimerText")),e.progressIndicatorMetadata!=null&&e.hasOwnProperty("progressIndicatorMetadata")&&(A.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.toObject(e.progressIndicatorMetadata,a),a.oneofs&&(A._progressIndicatorMetadata="progressIndicatorMetadata")),e.capabilityMetadata!=null&&e.hasOwnProperty("capabilityMetadata")&&(A.capabilityMetadata=p.proto.BotCapabilityMetadata.toObject(e.capabilityMetadata,a),a.oneofs&&(A._capabilityMetadata="capabilityMetadata")),e.imagineMetadata!=null&&e.hasOwnProperty("imagineMetadata")&&(A.imagineMetadata=p.proto.BotImagineMetadata.toObject(e.imagineMetadata,a),a.oneofs&&(A._imagineMetadata="imagineMetadata")),e.memoryMetadata!=null&&e.hasOwnProperty("memoryMetadata")&&(A.memoryMetadata=p.proto.BotMemoryMetadata.toObject(e.memoryMetadata,a),a.oneofs&&(A._memoryMetadata="memoryMetadata")),e.renderingMetadata!=null&&e.hasOwnProperty("renderingMetadata")&&(A.renderingMetadata=p.proto.BotRenderingMetadata.toObject(e.renderingMetadata,a),a.oneofs&&(A._renderingMetadata="renderingMetadata")),e.botMetricsMetadata!=null&&e.hasOwnProperty("botMetricsMetadata")&&(A.botMetricsMetadata=p.proto.BotMetricsMetadata.toObject(e.botMetricsMetadata,a),a.oneofs&&(A._botMetricsMetadata="botMetricsMetadata")),e.botLinkedAccountsMetadata!=null&&e.hasOwnProperty("botLinkedAccountsMetadata")&&(A.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.toObject(e.botLinkedAccountsMetadata,a),a.oneofs&&(A._botLinkedAccountsMetadata="botLinkedAccountsMetadata")),e.richResponseSourcesMetadata!=null&&e.hasOwnProperty("richResponseSourcesMetadata")&&(A.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.toObject(e.richResponseSourcesMetadata,a),a.oneofs&&(A._richResponseSourcesMetadata="richResponseSourcesMetadata")),e.aiConversationContext!=null&&e.hasOwnProperty("aiConversationContext")&&(A.aiConversationContext=a.bytes===String?l.base64.encode(e.aiConversationContext,0,e.aiConversationContext.length):a.bytes===Array?Array.prototype.slice.call(e.aiConversationContext):e.aiConversationContext,a.oneofs&&(A._aiConversationContext="aiConversationContext")),e.botPromotionMessageMetadata!=null&&e.hasOwnProperty("botPromotionMessageMetadata")&&(A.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.toObject(e.botPromotionMessageMetadata,a),a.oneofs&&(A._botPromotionMessageMetadata="botPromotionMessageMetadata")),e.botModeSelectionMetadata!=null&&e.hasOwnProperty("botModeSelectionMetadata")&&(A.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.toObject(e.botModeSelectionMetadata,a),a.oneofs&&(A._botModeSelectionMetadata="botModeSelectionMetadata")),e.botQuotaMetadata!=null&&e.hasOwnProperty("botQuotaMetadata")&&(A.botQuotaMetadata=p.proto.BotQuotaMetadata.toObject(e.botQuotaMetadata,a),a.oneofs&&(A._botQuotaMetadata="botQuotaMetadata")),e.botAgeCollectionMetadata!=null&&e.hasOwnProperty("botAgeCollectionMetadata")&&(A.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.toObject(e.botAgeCollectionMetadata,a),a.oneofs&&(A._botAgeCollectionMetadata="botAgeCollectionMetadata")),e.conversationStarterPromptId!=null&&e.hasOwnProperty("conversationStarterPromptId")&&(A.conversationStarterPromptId=e.conversationStarterPromptId,a.oneofs&&(A._conversationStarterPromptId="conversationStarterPromptId")),e.botResponseId!=null&&e.hasOwnProperty("botResponseId")&&(A.botResponseId=e.botResponseId,a.oneofs&&(A._botResponseId="botResponseId")),e.verificationMetadata!=null&&e.hasOwnProperty("verificationMetadata")&&(A.verificationMetadata=p.proto.BotSignatureVerificationMetadata.toObject(e.verificationMetadata,a),a.oneofs&&(A._verificationMetadata="verificationMetadata")),e.unifiedResponseMutation!=null&&e.hasOwnProperty("unifiedResponseMutation")&&(A.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.toObject(e.unifiedResponseMutation,a),a.oneofs&&(A._unifiedResponseMutation="unifiedResponseMutation")),e.botMessageOriginMetadata!=null&&e.hasOwnProperty("botMessageOriginMetadata")&&(A.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.toObject(e.botMessageOriginMetadata,a),a.oneofs&&(A._botMessageOriginMetadata="botMessageOriginMetadata")),e.inThreadSurveyMetadata!=null&&e.hasOwnProperty("inThreadSurveyMetadata")&&(A.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.toObject(e.inThreadSurveyMetadata,a),a.oneofs&&(A._inThreadSurveyMetadata="inThreadSurveyMetadata")),e.botThreadInfo!=null&&e.hasOwnProperty("botThreadInfo")&&(A.botThreadInfo=p.proto.AIThreadInfo.toObject(e.botThreadInfo,a),a.oneofs&&(A._botThreadInfo="botThreadInfo")),e.regenerateMetadata!=null&&e.hasOwnProperty("regenerateMetadata")&&(A.regenerateMetadata=p.proto.AIRegenerateMetadata.toObject(e.regenerateMetadata,a),a.oneofs&&(A._regenerateMetadata="regenerateMetadata")),e.sessionTransparencyMetadata!=null&&e.hasOwnProperty("sessionTransparencyMetadata")&&(A.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.toObject(e.sessionTransparencyMetadata,a),a.oneofs&&(A._sessionTransparencyMetadata="sessionTransparencyMetadata")),e.internalMetadata!=null&&e.hasOwnProperty("internalMetadata")&&(A.internalMetadata=a.bytes===String?l.base64.encode(e.internalMetadata,0,e.internalMetadata.length):a.bytes===Array?Array.prototype.slice.call(e.internalMetadata):e.internalMetadata,a.oneofs&&(A._internalMetadata="internalMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetadata"},t})(),n.BotMetricsEntryPoint=(function(){let t={},o=Object.create(t);return o[t[0]="UNDEFINED_ENTRY_POINT"]=0,o[t[1]="FAVICON"]=1,o[t[2]="CHATLIST"]=2,o[t[3]="AISEARCH_NULL_STATE_PAPER_PLANE"]=3,o[t[4]="AISEARCH_NULL_STATE_SUGGESTION"]=4,o[t[5]="AISEARCH_TYPE_AHEAD_SUGGESTION"]=5,o[t[6]="AISEARCH_TYPE_AHEAD_PAPER_PLANE"]=6,o[t[7]="AISEARCH_TYPE_AHEAD_RESULT_CHATLIST"]=7,o[t[8]="AISEARCH_TYPE_AHEAD_RESULT_MESSAGES"]=8,o[t[9]="AIVOICE_SEARCH_BAR"]=9,o[t[10]="AIVOICE_FAVICON"]=10,o[t[11]="AISTUDIO"]=11,o[t[12]="DEEPLINK"]=12,o[t[13]="NOTIFICATION"]=13,o[t[14]="PROFILE_MESSAGE_BUTTON"]=14,o[t[15]="FORWARD"]=15,o[t[16]="APP_SHORTCUT"]=16,o[t[17]="FF_FAMILY"]=17,o[t[18]="AI_TAB"]=18,o[t[19]="AI_HOME"]=19,o[t[20]="AI_DEEPLINK_IMMERSIVE"]=20,o[t[21]="AI_DEEPLINK"]=21,o[t[22]="META_AI_CHAT_SHORTCUT_AI_STUDIO"]=22,o[t[23]="UGC_CHAT_SHORTCUT_AI_STUDIO"]=23,o[t[24]="NEW_CHAT_AI_STUDIO"]=24,o[t[25]="AIVOICE_FAVICON_CALL_HISTORY"]=25,o[t[26]="ASK_META_AI_CONTEXT_MENU"]=26,o[t[27]="ASK_META_AI_CONTEXT_MENU_1ON1"]=27,o[t[28]="ASK_META_AI_CONTEXT_MENU_GROUP"]=28,o[t[29]="INVOKE_META_AI_1ON1"]=29,o[t[30]="INVOKE_META_AI_GROUP"]=30,o[t[31]="META_AI_FORWARD"]=31,o[t[32]="NEW_CHAT_AI_CONTACT"]=32,o[t[33]="MESSAGE_QUICK_ACTION_1_ON_1_CHAT"]=33,o[t[34]="MESSAGE_QUICK_ACTION_GROUP_CHAT"]=34,o[t[35]="ATTACHMENT_TRAY_1_ON_1_CHAT"]=35,o[t[36]="ATTACHMENT_TRAY_GROUP_CHAT"]=36,o[t[37]="ASK_META_AI_MEDIA_VIEWER_1ON1"]=37,o[t[38]="ASK_META_AI_MEDIA_VIEWER_GROUP"]=38,o})(),n.BotMetricsMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.destinationId=e.string();break}case 2:{s.destinationEntryPoint=e.int32();break}case 3:{s.threadOrigin=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotMetricsMetadata)return e;var a=new p.proto.BotMetricsMetadata;switch(e.destinationId!=null&&(a.destinationId=String(e.destinationId)),e.destinationEntryPoint){default:if(typeof e.destinationEntryPoint=="number"){a.destinationEntryPoint=e.destinationEntryPoint;break}break;case"UNDEFINED_ENTRY_POINT":case 0:a.destinationEntryPoint=0;break;case"FAVICON":case 1:a.destinationEntryPoint=1;break;case"CHATLIST":case 2:a.destinationEntryPoint=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:a.destinationEntryPoint=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:a.destinationEntryPoint=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:a.destinationEntryPoint=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:a.destinationEntryPoint=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:a.destinationEntryPoint=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:a.destinationEntryPoint=8;break;case"AIVOICE_SEARCH_BAR":case 9:a.destinationEntryPoint=9;break;case"AIVOICE_FAVICON":case 10:a.destinationEntryPoint=10;break;case"AISTUDIO":case 11:a.destinationEntryPoint=11;break;case"DEEPLINK":case 12:a.destinationEntryPoint=12;break;case"NOTIFICATION":case 13:a.destinationEntryPoint=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:a.destinationEntryPoint=14;break;case"FORWARD":case 15:a.destinationEntryPoint=15;break;case"APP_SHORTCUT":case 16:a.destinationEntryPoint=16;break;case"FF_FAMILY":case 17:a.destinationEntryPoint=17;break;case"AI_TAB":case 18:a.destinationEntryPoint=18;break;case"AI_HOME":case 19:a.destinationEntryPoint=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:a.destinationEntryPoint=20;break;case"AI_DEEPLINK":case 21:a.destinationEntryPoint=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:a.destinationEntryPoint=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:a.destinationEntryPoint=23;break;case"NEW_CHAT_AI_STUDIO":case 24:a.destinationEntryPoint=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:a.destinationEntryPoint=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:a.destinationEntryPoint=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:a.destinationEntryPoint=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:a.destinationEntryPoint=28;break;case"INVOKE_META_AI_1ON1":case 29:a.destinationEntryPoint=29;break;case"INVOKE_META_AI_GROUP":case 30:a.destinationEntryPoint=30;break;case"META_AI_FORWARD":case 31:a.destinationEntryPoint=31;break;case"NEW_CHAT_AI_CONTACT":case 32:a.destinationEntryPoint=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:a.destinationEntryPoint=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:a.destinationEntryPoint=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:a.destinationEntryPoint=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:a.destinationEntryPoint=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:a.destinationEntryPoint=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:a.destinationEntryPoint=38;break}switch(e.threadOrigin){default:if(typeof e.threadOrigin=="number"){a.threadOrigin=e.threadOrigin;break}break;case"AI_TAB_THREAD":case 1:a.threadOrigin=1;break;case"AI_HOME_THREAD":case 2:a.threadOrigin=2;break;case"AI_DEEPLINK_IMMERSIVE_THREAD":case 3:a.threadOrigin=3;break;case"AI_DEEPLINK_THREAD":case 4:a.threadOrigin=4;break;case"ASK_META_AI_CONTEXT_MENU_THREAD":case 5:a.threadOrigin=5;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.destinationId!=null&&e.hasOwnProperty("destinationId")&&(A.destinationId=e.destinationId,a.oneofs&&(A._destinationId="destinationId")),e.destinationEntryPoint!=null&&e.hasOwnProperty("destinationEntryPoint")&&(A.destinationEntryPoint=a.enums===String?p.proto.BotMetricsEntryPoint[e.destinationEntryPoint]===void 0?e.destinationEntryPoint:p.proto.BotMetricsEntryPoint[e.destinationEntryPoint]:e.destinationEntryPoint,a.oneofs&&(A._destinationEntryPoint="destinationEntryPoint")),e.threadOrigin!=null&&e.hasOwnProperty("threadOrigin")&&(A.threadOrigin=a.enums===String?p.proto.BotMetricsThreadEntryPoint[e.threadOrigin]===void 0?e.threadOrigin:p.proto.BotMetricsThreadEntryPoint[e.threadOrigin]:e.threadOrigin,a.oneofs&&(A._threadOrigin="threadOrigin")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetricsMetadata"},t})(),n.BotMetricsThreadEntryPoint=(function(){let t={},o=Object.create(t);return o[t[1]="AI_TAB_THREAD"]=1,o[t[2]="AI_HOME_THREAD"]=2,o[t[3]="AI_DEEPLINK_IMMERSIVE_THREAD"]=3,o[t[4]="AI_DEEPLINK_THREAD"]=4,o[t[5]="ASK_META_AI_CONTEXT_MENU_THREAD"]=5,o})(),n.BotModeSelectionMetadata=(function(){function t(o){if(this.mode=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{if(r.mode&&r.mode.length||(r.mode=[]),(s&7)===2)for(var g=i.uint32()+i.pos;i.pos>>3){case 1:{s.modelType=e.int32();break}case 2:{s.premiumModelStatus=e.int32();break}case 3:{s.modelNameOverride=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotModelMetadata)return e;var a=new p.proto.BotModelMetadata;switch(e.modelType){default:if(typeof e.modelType=="number"){a.modelType=e.modelType;break}break;case"UNKNOWN_TYPE":case 0:a.modelType=0;break;case"LLAMA_PROD":case 1:a.modelType=1;break;case"LLAMA_PROD_PREMIUM":case 2:a.modelType=2;break}switch(e.premiumModelStatus){default:if(typeof e.premiumModelStatus=="number"){a.premiumModelStatus=e.premiumModelStatus;break}break;case"UNKNOWN_STATUS":case 0:a.premiumModelStatus=0;break;case"AVAILABLE":case 1:a.premiumModelStatus=1;break;case"QUOTA_EXCEED_LIMIT":case 2:a.premiumModelStatus=2;break}return e.modelNameOverride!=null&&(a.modelNameOverride=String(e.modelNameOverride)),a},t.toObject=function(e,a){a||(a={});var A={};return e.modelType!=null&&e.hasOwnProperty("modelType")&&(A.modelType=a.enums===String?p.proto.BotModelMetadata.ModelType[e.modelType]===void 0?e.modelType:p.proto.BotModelMetadata.ModelType[e.modelType]:e.modelType,a.oneofs&&(A._modelType="modelType")),e.premiumModelStatus!=null&&e.hasOwnProperty("premiumModelStatus")&&(A.premiumModelStatus=a.enums===String?p.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]===void 0?e.premiumModelStatus:p.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]:e.premiumModelStatus,a.oneofs&&(A._premiumModelStatus="premiumModelStatus")),e.modelNameOverride!=null&&e.hasOwnProperty("modelNameOverride")&&(A.modelNameOverride=e.modelNameOverride,a.oneofs&&(A._modelNameOverride="modelNameOverride")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotModelMetadata"},t.ModelType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="LLAMA_PROD"]=1,e[i[2]="LLAMA_PROD_PREMIUM"]=2,e})(),t.PremiumModelStatus=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_STATUS"]=0,e[i[1]="AVAILABLE"]=1,e[i[2]="QUOTA_EXCEED_LIMIT"]=2,e})(),t})(),n.BotPluginMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.provider=e.int32();break}case 2:{s.pluginType=e.int32();break}case 3:{s.thumbnailCdnUrl=e.string();break}case 4:{s.profilePhotoCdnUrl=e.string();break}case 5:{s.searchProviderUrl=e.string();break}case 6:{s.referenceIndex=e.uint32();break}case 7:{s.expectedLinksCount=e.uint32();break}case 9:{s.searchQuery=e.string();break}case 10:{s.parentPluginMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 11:{s.deprecatedField=e.int32();break}case 12:{s.parentPluginType=e.int32();break}case 13:{s.faviconCdnUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotPluginMetadata)return e;var a=new p.proto.BotPluginMetadata;switch(e.provider){default:if(typeof e.provider=="number"){a.provider=e.provider;break}break;case"UNKNOWN":case 0:a.provider=0;break;case"BING":case 1:a.provider=1;break;case"GOOGLE":case 2:a.provider=2;break;case"SUPPORT":case 3:a.provider=3;break}switch(e.pluginType){default:if(typeof e.pluginType=="number"){a.pluginType=e.pluginType;break}break;case"UNKNOWN_PLUGIN":case 0:a.pluginType=0;break;case"REELS":case 1:a.pluginType=1;break;case"SEARCH":case 2:a.pluginType=2;break}if(e.thumbnailCdnUrl!=null&&(a.thumbnailCdnUrl=String(e.thumbnailCdnUrl)),e.profilePhotoCdnUrl!=null&&(a.profilePhotoCdnUrl=String(e.profilePhotoCdnUrl)),e.searchProviderUrl!=null&&(a.searchProviderUrl=String(e.searchProviderUrl)),e.referenceIndex!=null&&(a.referenceIndex=e.referenceIndex>>>0),e.expectedLinksCount!=null&&(a.expectedLinksCount=e.expectedLinksCount>>>0),e.searchQuery!=null&&(a.searchQuery=String(e.searchQuery)),e.parentPluginMessageKey!=null){if(typeof e.parentPluginMessageKey!="object")throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected");a.parentPluginMessageKey=p.proto.MessageKey.fromObject(e.parentPluginMessageKey)}switch(e.deprecatedField){default:if(typeof e.deprecatedField=="number"){a.deprecatedField=e.deprecatedField;break}break;case"UNKNOWN_PLUGIN":case 0:a.deprecatedField=0;break;case"REELS":case 1:a.deprecatedField=1;break;case"SEARCH":case 2:a.deprecatedField=2;break}switch(e.parentPluginType){default:if(typeof e.parentPluginType=="number"){a.parentPluginType=e.parentPluginType;break}break;case"UNKNOWN_PLUGIN":case 0:a.parentPluginType=0;break;case"REELS":case 1:a.parentPluginType=1;break;case"SEARCH":case 2:a.parentPluginType=2;break}return e.faviconCdnUrl!=null&&(a.faviconCdnUrl=String(e.faviconCdnUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.provider!=null&&e.hasOwnProperty("provider")&&(A.provider=a.enums===String?p.proto.BotPluginMetadata.SearchProvider[e.provider]===void 0?e.provider:p.proto.BotPluginMetadata.SearchProvider[e.provider]:e.provider,a.oneofs&&(A._provider="provider")),e.pluginType!=null&&e.hasOwnProperty("pluginType")&&(A.pluginType=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.pluginType]===void 0?e.pluginType:p.proto.BotPluginMetadata.PluginType[e.pluginType]:e.pluginType,a.oneofs&&(A._pluginType="pluginType")),e.thumbnailCdnUrl!=null&&e.hasOwnProperty("thumbnailCdnUrl")&&(A.thumbnailCdnUrl=e.thumbnailCdnUrl,a.oneofs&&(A._thumbnailCdnUrl="thumbnailCdnUrl")),e.profilePhotoCdnUrl!=null&&e.hasOwnProperty("profilePhotoCdnUrl")&&(A.profilePhotoCdnUrl=e.profilePhotoCdnUrl,a.oneofs&&(A._profilePhotoCdnUrl="profilePhotoCdnUrl")),e.searchProviderUrl!=null&&e.hasOwnProperty("searchProviderUrl")&&(A.searchProviderUrl=e.searchProviderUrl,a.oneofs&&(A._searchProviderUrl="searchProviderUrl")),e.referenceIndex!=null&&e.hasOwnProperty("referenceIndex")&&(A.referenceIndex=e.referenceIndex,a.oneofs&&(A._referenceIndex="referenceIndex")),e.expectedLinksCount!=null&&e.hasOwnProperty("expectedLinksCount")&&(A.expectedLinksCount=e.expectedLinksCount,a.oneofs&&(A._expectedLinksCount="expectedLinksCount")),e.searchQuery!=null&&e.hasOwnProperty("searchQuery")&&(A.searchQuery=e.searchQuery,a.oneofs&&(A._searchQuery="searchQuery")),e.parentPluginMessageKey!=null&&e.hasOwnProperty("parentPluginMessageKey")&&(A.parentPluginMessageKey=p.proto.MessageKey.toObject(e.parentPluginMessageKey,a),a.oneofs&&(A._parentPluginMessageKey="parentPluginMessageKey")),e.deprecatedField!=null&&e.hasOwnProperty("deprecatedField")&&(A.deprecatedField=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.deprecatedField]===void 0?e.deprecatedField:p.proto.BotPluginMetadata.PluginType[e.deprecatedField]:e.deprecatedField,a.oneofs&&(A._deprecatedField="deprecatedField")),e.parentPluginType!=null&&e.hasOwnProperty("parentPluginType")&&(A.parentPluginType=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.parentPluginType]===void 0?e.parentPluginType:p.proto.BotPluginMetadata.PluginType[e.parentPluginType]:e.parentPluginType,a.oneofs&&(A._parentPluginType="parentPluginType")),e.faviconCdnUrl!=null&&e.hasOwnProperty("faviconCdnUrl")&&(A.faviconCdnUrl=e.faviconCdnUrl,a.oneofs&&(A._faviconCdnUrl="faviconCdnUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPluginMetadata"},t.PluginType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_PLUGIN"]=0,e[i[1]="REELS"]=1,e[i[2]="SEARCH"]=2,e})(),t.SearchProvider=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="BING"]=1,e[i[2]="GOOGLE"]=2,e[i[3]="SUPPORT"]=3,e})(),t})(),n.BotProgressIndicatorMetadata=(function(){function t(i){if(this.stepsMetadata=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.progressDescription=e.string();break}case 2:{s.stepsMetadata&&s.stepsMetadata.length||(s.stepsMetadata=[]),s.stepsMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotProgressIndicatorMetadata)return e;var a=new p.proto.BotProgressIndicatorMetadata;if(e.progressDescription!=null&&(a.progressDescription=String(e.progressDescription)),e.stepsMetadata){if(!Array.isArray(e.stepsMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected");a.stepsMetadata=[];for(var A=0;A>>3){case 1:{c.statusTitle=A.string();break}case 2:{c.statusBody=A.string();break}case 3:{c.sourcesMetadata&&c.sourcesMetadata.length||(c.sourcesMetadata=[]),c.sourcesMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.decode(A,A.uint32()));break}case 4:{c.status=A.int32();break}case 5:{c.isReasoning=A.bool();break}case 6:{c.isEnhancedSearch=A.bool();break}case 7:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata)return A;var r=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata;if(A.statusTitle!=null&&(r.statusTitle=String(A.statusTitle)),A.statusBody!=null&&(r.statusBody=String(A.statusBody)),A.sourcesMetadata){if(!Array.isArray(A.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected");r.sourcesMetadata=[];for(var s=0;s>>3){case 1:{d.title=s.string();break}case 2:{d.provider=s.int32();break}case 3:{d.sourceUrl=s.string();break}case 4:{d.favIconUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata;switch(s.title!=null&&(g.title=String(s.title)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN_PROVIDER":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.favIconUrl!=null&&(g.favIconUrl=String(s.favIconUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]===void 0?s.provider:p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.favIconUrl!=null&&s.hasOwnProperty("favIconUrl")&&(c.favIconUrl=s.favIconUrl,g.oneofs&&(c._favIconUrl="favIconUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata"},a})(),i.BotPlanningSearchSourcesMetadata=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.sourceTitle=s.string();break}case 2:{d.provider=s.int32();break}case 3:{d.sourceUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata;switch(s.sourceTitle!=null&&(g.sourceTitle=String(s.sourceTitle)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.sourceTitle!=null&&s.hasOwnProperty("sourceTitle")&&(c.sourceTitle=s.sourceTitle,g.oneofs&&(c._sourceTitle="sourceTitle")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]===void 0?s.provider:p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata"},a.BotPlanningSearchSourceProvider=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="OTHER"]=1,s[r[2]="GOOGLE"]=2,s[r[3]="BING"]=3,s})(),a})(),i.BotPlanningStepSectionMetadata=(function(){function a(r){if(this.sourcesMetadata=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.sectionTitle=s.string();break}case 2:{d.sectionBody=s.string();break}case 3:{d.sourcesMetadata&&d.sourcesMetadata.length||(d.sourcesMetadata=[]),d.sourcesMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata;if(s.sectionTitle!=null&&(g.sectionTitle=String(s.sectionTitle)),s.sectionBody!=null&&(g.sectionBody=String(s.sectionBody)),s.sourcesMetadata){if(!Array.isArray(s.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected");g.sourcesMetadata=[];for(var c=0;c>>3){case 1:{s.promotionType=e.int32();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotPromotionMessageMetadata)return e;var a=new p.proto.BotPromotionMessageMetadata;switch(e.promotionType){default:if(typeof e.promotionType=="number"){a.promotionType=e.promotionType;break}break;case"UNKNOWN_TYPE":case 0:a.promotionType=0;break;case"C50":case 1:a.promotionType=1;break;case"SURVEY_PLATFORM":case 2:a.promotionType=2;break}return e.buttonTitle!=null&&(a.buttonTitle=String(e.buttonTitle)),a},t.toObject=function(e,a){a||(a={});var A={};return e.promotionType!=null&&e.hasOwnProperty("promotionType")&&(A.promotionType=a.enums===String?p.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]===void 0?e.promotionType:p.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]:e.promotionType,a.oneofs&&(A._promotionType="promotionType")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,a.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromotionMessageMetadata"},t.BotPromotionType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="C50"]=1,e[i[2]="SURVEY_PLATFORM"]=2,e})(),t})(),n.BotPromptSuggestion=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.prompt=e.string();break}case 2:{s.promptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotPromptSuggestion)return e;var a=new p.proto.BotPromptSuggestion;return e.prompt!=null&&(a.prompt=String(e.prompt)),e.promptId!=null&&(a.promptId=String(e.promptId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.prompt!=null&&e.hasOwnProperty("prompt")&&(A.prompt=e.prompt,a.oneofs&&(A._prompt="prompt")),e.promptId!=null&&e.hasOwnProperty("promptId")&&(A.promptId=e.promptId,a.oneofs&&(A._promptId="promptId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromptSuggestion"},t})(),n.BotPromptSuggestions=(function(){function t(o){if(this.suggestions=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(p.proto.BotPromptSuggestion.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotPromptSuggestions)return i;var e=new p.proto.BotPromptSuggestions;if(i.suggestions){if(!Array.isArray(i.suggestions))throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected");e.suggestions=[];for(var a=0;a>>3){case 1:{r.botFeatureQuotaMetadata&&r.botFeatureQuotaMetadata.length||(r.botFeatureQuotaMetadata=[]),r.botFeatureQuotaMetadata.push(p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotQuotaMetadata)return i;var e=new p.proto.BotQuotaMetadata;if(i.botFeatureQuotaMetadata){if(!Array.isArray(i.botFeatureQuotaMetadata))throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected");e.botFeatureQuotaMetadata=[];for(var a=0;a>>3){case 1:{g.featureType=a.int32();break}case 2:{g.remainingQuota=a.uint32();break}case 3:{g.expirationTimestamp=a.uint64();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata)return a;var A=new p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata;switch(a.featureType){default:if(typeof a.featureType=="number"){A.featureType=a.featureType;break}break;case"UNKNOWN_FEATURE":case 0:A.featureType=0;break;case"REASONING_FEATURE":case 1:A.featureType=1;break}return a.remainingQuota!=null&&(A.remainingQuota=a.remainingQuota>>>0),a.expirationTimestamp!=null&&(l.Long?(A.expirationTimestamp=l.Long.fromValue(a.expirationTimestamp)).unsigned=!0:typeof a.expirationTimestamp=="string"?A.expirationTimestamp=parseInt(a.expirationTimestamp,10):typeof a.expirationTimestamp=="number"?A.expirationTimestamp=a.expirationTimestamp:typeof a.expirationTimestamp=="object"&&(A.expirationTimestamp=new l.LongBits(a.expirationTimestamp.low>>>0,a.expirationTimestamp.high>>>0).toNumber(!0))),A},o.toObject=function(a,A){A||(A={});var r={};return a.featureType!=null&&a.hasOwnProperty("featureType")&&(r.featureType=A.enums===String?p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[a.featureType]===void 0?a.featureType:p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[a.featureType]:a.featureType,A.oneofs&&(r._featureType="featureType")),a.remainingQuota!=null&&a.hasOwnProperty("remainingQuota")&&(r.remainingQuota=a.remainingQuota,A.oneofs&&(r._remainingQuota="remainingQuota")),a.expirationTimestamp!=null&&a.hasOwnProperty("expirationTimestamp")&&(typeof a.expirationTimestamp=="number"?r.expirationTimestamp=A.longs===String?String(a.expirationTimestamp):a.expirationTimestamp:r.expirationTimestamp=A.longs===String?ge(a.expirationTimestamp,!0):A.longs===Number?ce(a.expirationTimestamp,!0):a.expirationTimestamp,A.oneofs&&(r._expirationTimestamp="expirationTimestamp")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.BotQuotaMetadata.BotFeatureQuotaMetadata"},o.BotFeatureType=(function(){let e={},a=Object.create(e);return a[e[0]="UNKNOWN_FEATURE"]=0,a[e[1]="REASONING_FEATURE"]=1,a})(),o})(),t})(),n.BotReminderMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.requestMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.action=e.int32();break}case 3:{s.name=e.string();break}case 4:{s.nextTriggerTimestamp=e.uint64();break}case 5:{s.frequency=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotReminderMetadata)return e;var a=new p.proto.BotReminderMetadata;if(e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected");a.requestMessageKey=p.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.action){default:if(typeof e.action=="number"){a.action=e.action;break}break;case"NOTIFY":case 1:a.action=1;break;case"CREATE":case 2:a.action=2;break;case"DELETE":case 3:a.action=3;break;case"UPDATE":case 4:a.action=4;break}switch(e.name!=null&&(a.name=String(e.name)),e.nextTriggerTimestamp!=null&&(l.Long?(a.nextTriggerTimestamp=l.Long.fromValue(e.nextTriggerTimestamp)).unsigned=!0:typeof e.nextTriggerTimestamp=="string"?a.nextTriggerTimestamp=parseInt(e.nextTriggerTimestamp,10):typeof e.nextTriggerTimestamp=="number"?a.nextTriggerTimestamp=e.nextTriggerTimestamp:typeof e.nextTriggerTimestamp=="object"&&(a.nextTriggerTimestamp=new l.LongBits(e.nextTriggerTimestamp.low>>>0,e.nextTriggerTimestamp.high>>>0).toNumber(!0))),e.frequency){default:if(typeof e.frequency=="number"){a.frequency=e.frequency;break}break;case"ONCE":case 1:a.frequency=1;break;case"DAILY":case 2:a.frequency=2;break;case"WEEKLY":case 3:a.frequency=3;break;case"BIWEEKLY":case 4:a.frequency=4;break;case"MONTHLY":case 5:a.frequency=5;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=p.proto.MessageKey.toObject(e.requestMessageKey,a),a.oneofs&&(A._requestMessageKey="requestMessageKey")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=a.enums===String?p.proto.BotReminderMetadata.ReminderAction[e.action]===void 0?e.action:p.proto.BotReminderMetadata.ReminderAction[e.action]:e.action,a.oneofs&&(A._action="action")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,a.oneofs&&(A._name="name")),e.nextTriggerTimestamp!=null&&e.hasOwnProperty("nextTriggerTimestamp")&&(typeof e.nextTriggerTimestamp=="number"?A.nextTriggerTimestamp=a.longs===String?String(e.nextTriggerTimestamp):e.nextTriggerTimestamp:A.nextTriggerTimestamp=a.longs===String?ge(e.nextTriggerTimestamp,!0):a.longs===Number?ce(e.nextTriggerTimestamp,!0):e.nextTriggerTimestamp,a.oneofs&&(A._nextTriggerTimestamp="nextTriggerTimestamp")),e.frequency!=null&&e.hasOwnProperty("frequency")&&(A.frequency=a.enums===String?p.proto.BotReminderMetadata.ReminderFrequency[e.frequency]===void 0?e.frequency:p.proto.BotReminderMetadata.ReminderFrequency[e.frequency]:e.frequency,a.oneofs&&(A._frequency="frequency")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotReminderMetadata"},t.ReminderAction=(function(){let i={},e=Object.create(i);return e[i[1]="NOTIFY"]=1,e[i[2]="CREATE"]=2,e[i[3]="DELETE"]=3,e[i[4]="UPDATE"]=4,e})(),t.ReminderFrequency=(function(){let i={},e=Object.create(i);return e[i[1]="ONCE"]=1,e[i[2]="DAILY"]=2,e[i[3]="WEEKLY"]=3,e[i[4]="BIWEEKLY"]=4,e[i[5]="MONTHLY"]=5,e})(),t})(),n.BotRenderingMetadata=(function(){function t(o){if(this.keywords=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.keywords&&r.keywords.length||(r.keywords=[]),r.keywords.push(p.proto.BotRenderingMetadata.Keyword.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotRenderingMetadata)return i;var e=new p.proto.BotRenderingMetadata;if(i.keywords){if(!Array.isArray(i.keywords))throw TypeError(".proto.BotRenderingMetadata.keywords: array expected");e.keywords=[];for(var a=0;a>>3){case 1:{g.value=a.string();break}case 2:{g.associatedPrompts&&g.associatedPrompts.length||(g.associatedPrompts=[]),g.associatedPrompts.push(a.string());break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotRenderingMetadata.Keyword)return a;var A=new p.proto.BotRenderingMetadata.Keyword;if(a.value!=null&&(A.value=String(a.value)),a.associatedPrompts){if(!Array.isArray(a.associatedPrompts))throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected");A.associatedPrompts=[];for(var r=0;r>>3){case 1:{s.sessionId=e.string();break}case 2:{s.sessionSource=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotSessionMetadata)return e;var a=new p.proto.BotSessionMetadata;switch(e.sessionId!=null&&(a.sessionId=String(e.sessionId)),e.sessionSource){default:if(typeof e.sessionSource=="number"){a.sessionSource=e.sessionSource;break}break;case"NONE":case 0:a.sessionSource=0;break;case"NULL_STATE":case 1:a.sessionSource=1;break;case"TYPEAHEAD":case 2:a.sessionSource=2;break;case"USER_INPUT":case 3:a.sessionSource=3;break;case"EMU_FLASH":case 4:a.sessionSource=4;break;case"EMU_FLASH_FOLLOWUP":case 5:a.sessionSource=5;break;case"VOICE":case 6:a.sessionSource=6;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,a.oneofs&&(A._sessionId="sessionId")),e.sessionSource!=null&&e.hasOwnProperty("sessionSource")&&(A.sessionSource=a.enums===String?p.proto.BotSessionSource[e.sessionSource]===void 0?e.sessionSource:p.proto.BotSessionSource[e.sessionSource]:e.sessionSource,a.oneofs&&(A._sessionSource="sessionSource")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotSessionMetadata"},t})(),n.BotSessionSource=(function(){let t={},o=Object.create(t);return o[t[0]="NONE"]=0,o[t[1]="NULL_STATE"]=1,o[t[2]="TYPEAHEAD"]=2,o[t[3]="USER_INPUT"]=3,o[t[4]="EMU_FLASH"]=4,o[t[5]="EMU_FLASH_FOLLOWUP"]=5,o[t[6]="VOICE"]=6,o})(),n.BotSignatureVerificationMetadata=(function(){function t(o){if(this.proofs=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.proofs&&r.proofs.length||(r.proofs=[]),r.proofs.push(p.proto.BotSignatureVerificationUseCaseProof.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotSignatureVerificationMetadata)return i;var e=new p.proto.BotSignatureVerificationMetadata;if(i.proofs){if(!Array.isArray(i.proofs))throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: array expected");e.proofs=[];for(var a=0;a>>3){case 1:{s.version=e.int32();break}case 2:{s.useCase=e.int32();break}case 3:{s.signature=e.bytes();break}case 4:{s.certificateChain&&s.certificateChain.length||(s.certificateChain=[]),s.certificateChain.push(e.bytes());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotSignatureVerificationUseCaseProof)return e;var a=new p.proto.BotSignatureVerificationUseCaseProof;switch(e.version!=null&&(a.version=e.version|0),e.useCase){default:if(typeof e.useCase=="number"){a.useCase=e.useCase;break}break;case"UNSPECIFIED":case 0:a.useCase=0;break;case"WA_BOT_MSG":case 1:a.useCase=1;break}if(e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.certificateChain){if(!Array.isArray(e.certificateChain))throw TypeError(".proto.BotSignatureVerificationUseCaseProof.certificateChain: array expected");a.certificateChain=[];for(var A=0;A=0&&(a.certificateChain[A]=e.certificateChain[A])}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.certificateChain=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),e.useCase!=null&&e.hasOwnProperty("useCase")&&(A.useCase=a.enums===String?p.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]===void 0?e.useCase:p.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]:e.useCase,a.oneofs&&(A._useCase="useCase")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.certificateChain&&e.certificateChain.length){A.certificateChain=[];for(var r=0;r>>3){case 1:{r.sources&&r.sources.length||(r.sources=[]),r.sources.push(p.proto.BotSourcesMetadata.BotSourceItem.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.BotSourcesMetadata)return i;var e=new p.proto.BotSourcesMetadata;if(i.sources){if(!Array.isArray(i.sources))throw TypeError(".proto.BotSourcesMetadata.sources: array expected");e.sources=[];for(var a=0;a>>3){case 1:{g.provider=a.int32();break}case 2:{g.thumbnailCdnUrl=a.string();break}case 3:{g.sourceProviderUrl=a.string();break}case 4:{g.sourceQuery=a.string();break}case 5:{g.faviconCdnUrl=a.string();break}case 6:{g.citationNumber=a.uint32();break}case 7:{g.sourceTitle=a.string();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotSourcesMetadata.BotSourceItem)return a;var A=new p.proto.BotSourcesMetadata.BotSourceItem;switch(a.provider){default:if(typeof a.provider=="number"){A.provider=a.provider;break}break;case"UNKNOWN":case 0:A.provider=0;break;case"BING":case 1:A.provider=1;break;case"GOOGLE":case 2:A.provider=2;break;case"SUPPORT":case 3:A.provider=3;break;case"OTHER":case 4:A.provider=4;break}return a.thumbnailCdnUrl!=null&&(A.thumbnailCdnUrl=String(a.thumbnailCdnUrl)),a.sourceProviderUrl!=null&&(A.sourceProviderUrl=String(a.sourceProviderUrl)),a.sourceQuery!=null&&(A.sourceQuery=String(a.sourceQuery)),a.faviconCdnUrl!=null&&(A.faviconCdnUrl=String(a.faviconCdnUrl)),a.citationNumber!=null&&(A.citationNumber=a.citationNumber>>>0),a.sourceTitle!=null&&(A.sourceTitle=String(a.sourceTitle)),A},o.toObject=function(a,A){A||(A={});var r={};return a.provider!=null&&a.hasOwnProperty("provider")&&(r.provider=A.enums===String?p.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[a.provider]===void 0?a.provider:p.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[a.provider]:a.provider,A.oneofs&&(r._provider="provider")),a.thumbnailCdnUrl!=null&&a.hasOwnProperty("thumbnailCdnUrl")&&(r.thumbnailCdnUrl=a.thumbnailCdnUrl,A.oneofs&&(r._thumbnailCdnUrl="thumbnailCdnUrl")),a.sourceProviderUrl!=null&&a.hasOwnProperty("sourceProviderUrl")&&(r.sourceProviderUrl=a.sourceProviderUrl,A.oneofs&&(r._sourceProviderUrl="sourceProviderUrl")),a.sourceQuery!=null&&a.hasOwnProperty("sourceQuery")&&(r.sourceQuery=a.sourceQuery,A.oneofs&&(r._sourceQuery="sourceQuery")),a.faviconCdnUrl!=null&&a.hasOwnProperty("faviconCdnUrl")&&(r.faviconCdnUrl=a.faviconCdnUrl,A.oneofs&&(r._faviconCdnUrl="faviconCdnUrl")),a.citationNumber!=null&&a.hasOwnProperty("citationNumber")&&(r.citationNumber=a.citationNumber,A.oneofs&&(r._citationNumber="citationNumber")),a.sourceTitle!=null&&a.hasOwnProperty("sourceTitle")&&(r.sourceTitle=a.sourceTitle,A.oneofs&&(r._sourceTitle="sourceTitle")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.BotSourcesMetadata.BotSourceItem"},o.SourceProvider=(function(){let e={},a=Object.create(e);return a[e[0]="UNKNOWN"]=0,a[e[1]="BING"]=1,a[e[2]="GOOGLE"]=2,a[e[3]="SUPPORT"]=3,a[e[4]="OTHER"]=4,a})(),o})(),t})(),n.BotSuggestedPromptMetadata=(function(){function t(i){if(this.suggestedPrompts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.suggestedPrompts&&s.suggestedPrompts.length||(s.suggestedPrompts=[]),s.suggestedPrompts.push(e.string());break}case 2:{s.selectedPromptIndex=e.uint32();break}case 3:{s.promptSuggestions=p.proto.BotPromptSuggestions.decode(e,e.uint32());break}case 4:{s.selectedPromptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotSuggestedPromptMetadata)return e;var a=new p.proto.BotSuggestedPromptMetadata;if(e.suggestedPrompts){if(!Array.isArray(e.suggestedPrompts))throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected");a.suggestedPrompts=[];for(var A=0;A>>0),e.promptSuggestions!=null){if(typeof e.promptSuggestions!="object")throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected");a.promptSuggestions=p.proto.BotPromptSuggestions.fromObject(e.promptSuggestions)}return e.selectedPromptId!=null&&(a.selectedPromptId=String(e.selectedPromptId)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.suggestedPrompts=[]),e.suggestedPrompts&&e.suggestedPrompts.length){A.suggestedPrompts=[];for(var r=0;r>>3){case 1:{s.sbsMetadata=p.proto.BotUnifiedResponseMutation.SideBySideMetadata.decode(e,e.uint32());break}case 2:{s.mediaDetailsMetadataList&&s.mediaDetailsMetadataList.length||(s.mediaDetailsMetadataList=[]),s.mediaDetailsMetadataList.push(p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.BotUnifiedResponseMutation)return e;var a=new p.proto.BotUnifiedResponseMutation;if(e.sbsMetadata!=null){if(typeof e.sbsMetadata!="object")throw TypeError(".proto.BotUnifiedResponseMutation.sbsMetadata: object expected");a.sbsMetadata=p.proto.BotUnifiedResponseMutation.SideBySideMetadata.fromObject(e.sbsMetadata)}if(e.mediaDetailsMetadataList){if(!Array.isArray(e.mediaDetailsMetadataList))throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: array expected");a.mediaDetailsMetadataList=[];for(var A=0;A>>3){case 1:{c.id=A.string();break}case 2:{c.highResMedia=p.proto.BotMediaMetadata.decode(A,A.uint32());break}case 3:{c.previewMedia=p.proto.BotMediaMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata)return A;var r=new p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata;if(A.id!=null&&(r.id=String(A.id)),A.highResMedia!=null){if(typeof A.highResMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.highResMedia: object expected");r.highResMedia=p.proto.BotMediaMetadata.fromObject(A.highResMedia)}if(A.previewMedia!=null){if(typeof A.previewMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.previewMedia: object expected");r.previewMedia=p.proto.BotMediaMetadata.fromObject(A.previewMedia)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),A.highResMedia!=null&&A.hasOwnProperty("highResMedia")&&(s.highResMedia=p.proto.BotMediaMetadata.toObject(A.highResMedia,r),r.oneofs&&(s._highResMedia="highResMedia")),A.previewMedia!=null&&A.hasOwnProperty("previewMedia")&&(s.previewMedia=p.proto.BotMediaMetadata.toObject(A.previewMedia,r),r.oneofs&&(s._previewMedia="previewMedia")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.MediaDetailsMetadata"},i})(),t.SideBySideMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.primaryResponseId=A.string();break}case 2:{c.surveyCtaHasRendered=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotUnifiedResponseMutation.SideBySideMetadata)return A;var r=new p.proto.BotUnifiedResponseMutation.SideBySideMetadata;return A.primaryResponseId!=null&&(r.primaryResponseId=String(A.primaryResponseId)),A.surveyCtaHasRendered!=null&&(r.surveyCtaHasRendered=!!A.surveyCtaHasRendered),r},i.toObject=function(A,r){r||(r={});var s={};return A.primaryResponseId!=null&&A.hasOwnProperty("primaryResponseId")&&(s.primaryResponseId=A.primaryResponseId,r.oneofs&&(s._primaryResponseId="primaryResponseId")),A.surveyCtaHasRendered!=null&&A.hasOwnProperty("surveyCtaHasRendered")&&(s.surveyCtaHasRendered=A.surveyCtaHasRendered,r.oneofs&&(s._surveyCtaHasRendered="surveyCtaHasRendered")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.SideBySideMetadata"},i})(),t})(),n.CallLogRecord=(function(){function t(i){if(this.participants=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.callResult=e.int32();break}case 2:{s.isDndMode=e.bool();break}case 3:{s.silenceReason=e.int32();break}case 4:{s.duration=e.int64();break}case 5:{s.startTime=e.int64();break}case 6:{s.isIncoming=e.bool();break}case 7:{s.isVideo=e.bool();break}case 8:{s.isCallLink=e.bool();break}case 9:{s.callLinkToken=e.string();break}case 10:{s.scheduledCallId=e.string();break}case 11:{s.callId=e.string();break}case 12:{s.callCreatorJid=e.string();break}case 13:{s.groupJid=e.string();break}case 14:{s.participants&&s.participants.length||(s.participants=[]),s.participants.push(p.proto.CallLogRecord.ParticipantInfo.decode(e,e.uint32()));break}case 15:{s.callType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CallLogRecord)return e;var a=new p.proto.CallLogRecord;switch(e.callResult){default:if(typeof e.callResult=="number"){a.callResult=e.callResult;break}break;case"CONNECTED":case 0:a.callResult=0;break;case"REJECTED":case 1:a.callResult=1;break;case"CANCELLED":case 2:a.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:a.callResult=3;break;case"MISSED":case 4:a.callResult=4;break;case"INVALID":case 5:a.callResult=5;break;case"UNAVAILABLE":case 6:a.callResult=6;break;case"UPCOMING":case 7:a.callResult=7;break;case"FAILED":case 8:a.callResult=8;break;case"ABANDONED":case 9:a.callResult=9;break;case"ONGOING":case 10:a.callResult=10;break}switch(e.isDndMode!=null&&(a.isDndMode=!!e.isDndMode),e.silenceReason){default:if(typeof e.silenceReason=="number"){a.silenceReason=e.silenceReason;break}break;case"NONE":case 0:a.silenceReason=0;break;case"SCHEDULED":case 1:a.silenceReason=1;break;case"PRIVACY":case 2:a.silenceReason=2;break;case"LIGHTWEIGHT":case 3:a.silenceReason=3;break}if(e.duration!=null&&(l.Long?(a.duration=l.Long.fromValue(e.duration)).unsigned=!1:typeof e.duration=="string"?a.duration=parseInt(e.duration,10):typeof e.duration=="number"?a.duration=e.duration:typeof e.duration=="object"&&(a.duration=new l.LongBits(e.duration.low>>>0,e.duration.high>>>0).toNumber())),e.startTime!=null&&(l.Long?(a.startTime=l.Long.fromValue(e.startTime)).unsigned=!1:typeof e.startTime=="string"?a.startTime=parseInt(e.startTime,10):typeof e.startTime=="number"?a.startTime=e.startTime:typeof e.startTime=="object"&&(a.startTime=new l.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.isIncoming!=null&&(a.isIncoming=!!e.isIncoming),e.isVideo!=null&&(a.isVideo=!!e.isVideo),e.isCallLink!=null&&(a.isCallLink=!!e.isCallLink),e.callLinkToken!=null&&(a.callLinkToken=String(e.callLinkToken)),e.scheduledCallId!=null&&(a.scheduledCallId=String(e.scheduledCallId)),e.callId!=null&&(a.callId=String(e.callId)),e.callCreatorJid!=null&&(a.callCreatorJid=String(e.callCreatorJid)),e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.participants){if(!Array.isArray(e.participants))throw TypeError(".proto.CallLogRecord.participants: array expected");a.participants=[];for(var A=0;A>>3){case 1:{c.userJid=A.string();break}case 2:{c.callResult=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.CallLogRecord.ParticipantInfo)return A;var r=new p.proto.CallLogRecord.ParticipantInfo;switch(A.userJid!=null&&(r.userJid=String(A.userJid)),A.callResult){default:if(typeof A.callResult=="number"){r.callResult=A.callResult;break}break;case"CONNECTED":case 0:r.callResult=0;break;case"REJECTED":case 1:r.callResult=1;break;case"CANCELLED":case 2:r.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:r.callResult=3;break;case"MISSED":case 4:r.callResult=4;break;case"INVALID":case 5:r.callResult=5;break;case"UNAVAILABLE":case 6:r.callResult=6;break;case"UPCOMING":case 7:r.callResult=7;break;case"FAILED":case 8:r.callResult=8;break;case"ABANDONED":case 9:r.callResult=9;break;case"ONGOING":case 10:r.callResult=10;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.userJid!=null&&A.hasOwnProperty("userJid")&&(s.userJid=A.userJid,r.oneofs&&(s._userJid="userJid")),A.callResult!=null&&A.hasOwnProperty("callResult")&&(s.callResult=r.enums===String?p.proto.CallLogRecord.CallResult[A.callResult]===void 0?A.callResult:p.proto.CallLogRecord.CallResult[A.callResult]:A.callResult,r.oneofs&&(s._callResult="callResult")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CallLogRecord.ParticipantInfo"},i})(),t.SilenceReason=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="SCHEDULED"]=1,e[i[2]="PRIVACY"]=2,e[i[3]="LIGHTWEIGHT"]=3,e})(),t})(),n.CertChain=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.leaf=p.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}case 2:{s.intermediate=p.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CertChain)return e;var a=new p.proto.CertChain;if(e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".proto.CertChain.leaf: object expected");a.leaf=p.proto.CertChain.NoiseCertificate.fromObject(e.leaf)}if(e.intermediate!=null){if(typeof e.intermediate!="object")throw TypeError(".proto.CertChain.intermediate: object expected");a.intermediate=p.proto.CertChain.NoiseCertificate.fromObject(e.intermediate)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.leaf!=null&&e.hasOwnProperty("leaf")&&(A.leaf=p.proto.CertChain.NoiseCertificate.toObject(e.leaf,a),a.oneofs&&(A._leaf="leaf")),e.intermediate!=null&&e.hasOwnProperty("intermediate")&&(A.intermediate=p.proto.CertChain.NoiseCertificate.toObject(e.intermediate,a),a.oneofs&&(A._intermediate="intermediate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CertChain"},t.NoiseCertificate=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.details=A.bytes();break}case 2:{c.signature=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.CertChain.NoiseCertificate)return A;var r=new p.proto.CertChain.NoiseCertificate;return A.details!=null&&(typeof A.details=="string"?l.base64.decode(A.details,r.details=l.newBuffer(l.base64.length(A.details)),0):A.details.length>=0&&(r.details=A.details)),A.signature!=null&&(typeof A.signature=="string"?l.base64.decode(A.signature,r.signature=l.newBuffer(l.base64.length(A.signature)),0):A.signature.length>=0&&(r.signature=A.signature)),r},i.toObject=function(A,r){r||(r={});var s={};return A.details!=null&&A.hasOwnProperty("details")&&(s.details=r.bytes===String?l.base64.encode(A.details,0,A.details.length):r.bytes===Array?Array.prototype.slice.call(A.details):A.details,r.oneofs&&(s._details="details")),A.signature!=null&&A.hasOwnProperty("signature")&&(s.signature=r.bytes===String?l.base64.encode(A.signature,0,A.signature.length):r.bytes===Array?Array.prototype.slice.call(A.signature):A.signature,r.oneofs&&(s._signature="signature")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CertChain.NoiseCertificate"},i.Details=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.serial=s.uint32();break}case 2:{d.issuerSerial=s.uint32();break}case 3:{d.key=s.bytes();break}case 4:{d.notBefore=s.uint64();break}case 5:{d.notAfter=s.uint64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.CertChain.NoiseCertificate.Details)return s;var g=new p.proto.CertChain.NoiseCertificate.Details;return s.serial!=null&&(g.serial=s.serial>>>0),s.issuerSerial!=null&&(g.issuerSerial=s.issuerSerial>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),s.notBefore!=null&&(l.Long?(g.notBefore=l.Long.fromValue(s.notBefore)).unsigned=!0:typeof s.notBefore=="string"?g.notBefore=parseInt(s.notBefore,10):typeof s.notBefore=="number"?g.notBefore=s.notBefore:typeof s.notBefore=="object"&&(g.notBefore=new l.LongBits(s.notBefore.low>>>0,s.notBefore.high>>>0).toNumber(!0))),s.notAfter!=null&&(l.Long?(g.notAfter=l.Long.fromValue(s.notAfter)).unsigned=!0:typeof s.notAfter=="string"?g.notAfter=parseInt(s.notAfter,10):typeof s.notAfter=="number"?g.notAfter=s.notAfter:typeof s.notAfter=="object"&&(g.notAfter=new l.LongBits(s.notAfter.low>>>0,s.notAfter.high>>>0).toNumber(!0))),g},a.toObject=function(s,g){g||(g={});var c={};return s.serial!=null&&s.hasOwnProperty("serial")&&(c.serial=s.serial,g.oneofs&&(c._serial="serial")),s.issuerSerial!=null&&s.hasOwnProperty("issuerSerial")&&(c.issuerSerial=s.issuerSerial,g.oneofs&&(c._issuerSerial="issuerSerial")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),s.notBefore!=null&&s.hasOwnProperty("notBefore")&&(typeof s.notBefore=="number"?c.notBefore=g.longs===String?String(s.notBefore):s.notBefore:c.notBefore=g.longs===String?ge(s.notBefore,!0):g.longs===Number?ce(s.notBefore,!0):s.notBefore,g.oneofs&&(c._notBefore="notBefore")),s.notAfter!=null&&s.hasOwnProperty("notAfter")&&(typeof s.notAfter=="number"?c.notAfter=g.longs===String?String(s.notAfter):s.notAfter:c.notAfter=g.longs===String?ge(s.notAfter,!0):g.longs===Number?ce(s.notAfter,!0):s.notAfter,g.oneofs&&(c._notAfter="notAfter")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.CertChain.NoiseCertificate.Details"},a})(),i})(),t})(),n.ChatLockSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.hideLockedChats=e.bool();break}case 2:{s.secretCode=p.proto.UserPassword.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ChatLockSettings)return e;var a=new p.proto.ChatLockSettings;if(e.hideLockedChats!=null&&(a.hideLockedChats=!!e.hideLockedChats),e.secretCode!=null){if(typeof e.secretCode!="object")throw TypeError(".proto.ChatLockSettings.secretCode: object expected");a.secretCode=p.proto.UserPassword.fromObject(e.secretCode)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.hideLockedChats!=null&&e.hasOwnProperty("hideLockedChats")&&(A.hideLockedChats=e.hideLockedChats,a.oneofs&&(A._hideLockedChats="hideLockedChats")),e.secretCode!=null&&e.hasOwnProperty("secretCode")&&(A.secretCode=p.proto.UserPassword.toObject(e.secretCode,a),a.oneofs&&(A._secretCode="secretCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatLockSettings"},t})(),n.ChatRowOpaqueData=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ChatRowOpaqueData)return e;var a=new p.proto.ChatRowOpaqueData;if(e.draftMessage!=null){if(typeof e.draftMessage!="object")throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected");a.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.fromObject(e.draftMessage)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.draftMessage!=null&&e.hasOwnProperty("draftMessage")&&(A.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.toObject(e.draftMessage,a),a.oneofs&&(A._draftMessage="draftMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatRowOpaqueData"},t.DraftMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.omittedUrl=A.string();break}case 3:{c.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.decode(A,A.uint32());break}case 4:{c.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.decode(A,A.uint32());break}case 5:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ChatRowOpaqueData.DraftMessage)return A;var r=new p.proto.ChatRowOpaqueData.DraftMessage;if(A.text!=null&&(r.text=String(A.text)),A.omittedUrl!=null&&(r.omittedUrl=String(A.omittedUrl)),A.ctwaContextLinkData!=null){if(typeof A.ctwaContextLinkData!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected");r.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(A.ctwaContextLinkData)}if(A.ctwaContext!=null){if(typeof A.ctwaContext!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected");r.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(A.ctwaContext)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.omittedUrl!=null&&A.hasOwnProperty("omittedUrl")&&(s.omittedUrl=A.omittedUrl,r.oneofs&&(s._omittedUrl="omittedUrl")),A.ctwaContextLinkData!=null&&A.hasOwnProperty("ctwaContextLinkData")&&(s.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(A.ctwaContextLinkData,r),r.oneofs&&(s._ctwaContextLinkData="ctwaContextLinkData")),A.ctwaContext!=null&&A.hasOwnProperty("ctwaContext")&&(s.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(A.ctwaContext,r),r.oneofs&&(s._ctwaContext="ctwaContext")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ChatRowOpaqueData.DraftMessage"},i.CtwaContextData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.conversionSource=s.string();break}case 2:{d.conversionData=s.bytes();break}case 3:{d.sourceUrl=s.string();break}case 4:{d.sourceId=s.string();break}case 5:{d.sourceType=s.string();break}case 6:{d.title=s.string();break}case 7:{d.description=s.string();break}case 8:{d.thumbnail=s.string();break}case 9:{d.thumbnailUrl=s.string();break}case 10:{d.mediaType=s.int32();break}case 11:{d.mediaUrl=s.string();break}case 12:{d.isSuspiciousLink=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData)return s;var g=new p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData;switch(s.conversionSource!=null&&(g.conversionSource=String(s.conversionSource)),s.conversionData!=null&&(typeof s.conversionData=="string"?l.base64.decode(s.conversionData,g.conversionData=l.newBuffer(l.base64.length(s.conversionData)),0):s.conversionData.length>=0&&(g.conversionData=s.conversionData)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.sourceId!=null&&(g.sourceId=String(s.sourceId)),s.sourceType!=null&&(g.sourceType=String(s.sourceType)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.thumbnail!=null&&(g.thumbnail=String(s.thumbnail)),s.thumbnailUrl!=null&&(g.thumbnailUrl=String(s.thumbnailUrl)),s.mediaType){default:if(typeof s.mediaType=="number"){g.mediaType=s.mediaType;break}break;case"NONE":case 0:g.mediaType=0;break;case"IMAGE":case 1:g.mediaType=1;break;case"VIDEO":case 2:g.mediaType=2;break}return s.mediaUrl!=null&&(g.mediaUrl=String(s.mediaUrl)),s.isSuspiciousLink!=null&&(g.isSuspiciousLink=!!s.isSuspiciousLink),g},a.toObject=function(s,g){g||(g={});var c={};return s.conversionSource!=null&&s.hasOwnProperty("conversionSource")&&(c.conversionSource=s.conversionSource,g.oneofs&&(c._conversionSource="conversionSource")),s.conversionData!=null&&s.hasOwnProperty("conversionData")&&(c.conversionData=g.bytes===String?l.base64.encode(s.conversionData,0,s.conversionData.length):g.bytes===Array?Array.prototype.slice.call(s.conversionData):s.conversionData,g.oneofs&&(c._conversionData="conversionData")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.sourceId!=null&&s.hasOwnProperty("sourceId")&&(c.sourceId=s.sourceId,g.oneofs&&(c._sourceId="sourceId")),s.sourceType!=null&&s.hasOwnProperty("sourceType")&&(c.sourceType=s.sourceType,g.oneofs&&(c._sourceType="sourceType")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.thumbnail!=null&&s.hasOwnProperty("thumbnail")&&(c.thumbnail=s.thumbnail,g.oneofs&&(c._thumbnail="thumbnail")),s.thumbnailUrl!=null&&s.hasOwnProperty("thumbnailUrl")&&(c.thumbnailUrl=s.thumbnailUrl,g.oneofs&&(c._thumbnailUrl="thumbnailUrl")),s.mediaType!=null&&s.hasOwnProperty("mediaType")&&(c.mediaType=g.enums===String?p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]===void 0?s.mediaType:p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]:s.mediaType,g.oneofs&&(c._mediaType="mediaType")),s.mediaUrl!=null&&s.hasOwnProperty("mediaUrl")&&(c.mediaUrl=s.mediaUrl,g.oneofs&&(c._mediaUrl="mediaUrl")),s.isSuspiciousLink!=null&&s.hasOwnProperty("isSuspiciousLink")&&(c.isSuspiciousLink=s.isSuspiciousLink,g.oneofs&&(c._isSuspiciousLink="isSuspiciousLink")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextData"},a.ContextInfoExternalAdReplyInfoMediaType=(function(){let r={},s=Object.create(r);return s[r[0]="NONE"]=0,s[r[1]="IMAGE"]=1,s[r[2]="VIDEO"]=2,s})(),a})(),i.CtwaContextLinkData=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.context=s.string();break}case 2:{d.sourceUrl=s.string();break}case 3:{d.icebreaker=s.string();break}case 4:{d.phone=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData)return s;var g=new p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData;return s.context!=null&&(g.context=String(s.context)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.icebreaker!=null&&(g.icebreaker=String(s.icebreaker)),s.phone!=null&&(g.phone=String(s.phone)),g},a.toObject=function(s,g){g||(g={});var c={};return s.context!=null&&s.hasOwnProperty("context")&&(c.context=s.context,g.oneofs&&(c._context="context")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.icebreaker!=null&&s.hasOwnProperty("icebreaker")&&(c.icebreaker=s.icebreaker,g.oneofs&&(c._icebreaker="icebreaker")),s.phone!=null&&s.hasOwnProperty("phone")&&(c.phone=s.phone,g.oneofs&&(c._phone="phone")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData"},a})(),i})(),t})(),n.Citation=(function(){function t(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.title=i.string();break}case 2:{r.subtitle=i.string();break}case 3:{r.cmsId=i.string();break}case 4:{r.imageUrl=i.string();break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.Citation)return i;var e=new p.proto.Citation;return i.title!=null&&(e.title=String(i.title)),i.subtitle!=null&&(e.subtitle=String(i.subtitle)),i.cmsId!=null&&(e.cmsId=String(i.cmsId)),i.imageUrl!=null&&(e.imageUrl=String(i.imageUrl)),e},t.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.title="",a.subtitle="",a.cmsId="",a.imageUrl=""),i.title!=null&&i.hasOwnProperty("title")&&(a.title=i.title),i.subtitle!=null&&i.hasOwnProperty("subtitle")&&(a.subtitle=i.subtitle),i.cmsId!=null&&i.hasOwnProperty("cmsId")&&(a.cmsId=i.cmsId),i.imageUrl!=null&&i.hasOwnProperty("imageUrl")&&(a.imageUrl=i.imageUrl),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Citation"},t})(),n.ClientPairingProps=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.isChatDbLidMigrated=e.bool();break}case 2:{s.isSyncdPureLidSession=e.bool();break}case 3:{s.isSyncdSnapshotRecoveryEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ClientPairingProps)return e;var a=new p.proto.ClientPairingProps;return e.isChatDbLidMigrated!=null&&(a.isChatDbLidMigrated=!!e.isChatDbLidMigrated),e.isSyncdPureLidSession!=null&&(a.isSyncdPureLidSession=!!e.isSyncdPureLidSession),e.isSyncdSnapshotRecoveryEnabled!=null&&(a.isSyncdSnapshotRecoveryEnabled=!!e.isSyncdSnapshotRecoveryEnabled),a},t.toObject=function(e,a){a||(a={});var A={};return e.isChatDbLidMigrated!=null&&e.hasOwnProperty("isChatDbLidMigrated")&&(A.isChatDbLidMigrated=e.isChatDbLidMigrated,a.oneofs&&(A._isChatDbLidMigrated="isChatDbLidMigrated")),e.isSyncdPureLidSession!=null&&e.hasOwnProperty("isSyncdPureLidSession")&&(A.isSyncdPureLidSession=e.isSyncdPureLidSession,a.oneofs&&(A._isSyncdPureLidSession="isSyncdPureLidSession")),e.isSyncdSnapshotRecoveryEnabled!=null&&e.hasOwnProperty("isSyncdSnapshotRecoveryEnabled")&&(A.isSyncdSnapshotRecoveryEnabled=e.isSyncdSnapshotRecoveryEnabled,a.oneofs&&(A._isSyncdSnapshotRecoveryEnabled="isSyncdSnapshotRecoveryEnabled")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ClientPairingProps"},t})(),n.ClientPayload=(function(){function t(i){if(this.shards=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.username=e.uint64();break}case 3:{s.passive=e.bool();break}case 5:{s.userAgent=p.proto.ClientPayload.UserAgent.decode(e,e.uint32());break}case 6:{s.webInfo=p.proto.ClientPayload.WebInfo.decode(e,e.uint32());break}case 7:{s.pushName=e.string();break}case 9:{s.sessionId=e.sfixed32();break}case 10:{s.shortConnect=e.bool();break}case 12:{s.connectType=e.int32();break}case 13:{s.connectReason=e.int32();break}case 14:{if(s.shards&&s.shards.length||(s.shards=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0,e.username.high>>>0).toNumber(!0))),e.passive!=null&&(a.passive=!!e.passive),e.userAgent!=null){if(typeof e.userAgent!="object")throw TypeError(".proto.ClientPayload.userAgent: object expected");a.userAgent=p.proto.ClientPayload.UserAgent.fromObject(e.userAgent)}if(e.webInfo!=null){if(typeof e.webInfo!="object")throw TypeError(".proto.ClientPayload.webInfo: object expected");a.webInfo=p.proto.ClientPayload.WebInfo.fromObject(e.webInfo)}switch(e.pushName!=null&&(a.pushName=String(e.pushName)),e.sessionId!=null&&(a.sessionId=e.sessionId|0),e.shortConnect!=null&&(a.shortConnect=!!e.shortConnect),e.connectType){default:if(typeof e.connectType=="number"){a.connectType=e.connectType;break}break;case"CELLULAR_UNKNOWN":case 0:a.connectType=0;break;case"WIFI_UNKNOWN":case 1:a.connectType=1;break;case"CELLULAR_EDGE":case 100:a.connectType=100;break;case"CELLULAR_IDEN":case 101:a.connectType=101;break;case"CELLULAR_UMTS":case 102:a.connectType=102;break;case"CELLULAR_EVDO":case 103:a.connectType=103;break;case"CELLULAR_GPRS":case 104:a.connectType=104;break;case"CELLULAR_HSDPA":case 105:a.connectType=105;break;case"CELLULAR_HSUPA":case 106:a.connectType=106;break;case"CELLULAR_HSPA":case 107:a.connectType=107;break;case"CELLULAR_CDMA":case 108:a.connectType=108;break;case"CELLULAR_1XRTT":case 109:a.connectType=109;break;case"CELLULAR_EHRPD":case 110:a.connectType=110;break;case"CELLULAR_LTE":case 111:a.connectType=111;break;case"CELLULAR_HSPAP":case 112:a.connectType=112;break}switch(e.connectReason){default:if(typeof e.connectReason=="number"){a.connectReason=e.connectReason;break}break;case"PUSH":case 0:a.connectReason=0;break;case"USER_ACTIVATED":case 1:a.connectReason=1;break;case"SCHEDULED":case 2:a.connectReason=2;break;case"ERROR_RECONNECT":case 3:a.connectReason=3;break;case"NETWORK_SWITCH":case 4:a.connectReason=4;break;case"PING_RECONNECT":case 5:a.connectReason=5;break;case"UNKNOWN":case 6:a.connectReason=6;break}if(e.shards){if(!Array.isArray(e.shards))throw TypeError(".proto.ClientPayload.shards: array expected");a.shards=[];for(var A=0;A>>0),e.device!=null&&(a.device=e.device>>>0),e.devicePairingData!=null){if(typeof e.devicePairingData!="object")throw TypeError(".proto.ClientPayload.devicePairingData: object expected");a.devicePairingData=p.proto.ClientPayload.DevicePairingRegistrationData.fromObject(e.devicePairingData)}switch(e.product){default:if(typeof e.product=="number"){a.product=e.product;break}break;case"WHATSAPP":case 0:a.product=0;break;case"MESSENGER":case 1:a.product=1;break;case"INTEROP":case 2:a.product=2;break;case"INTEROP_MSGR":case 3:a.product=3;break;case"WHATSAPP_LID":case 4:a.product=4;break}switch(e.fbCat!=null&&(typeof e.fbCat=="string"?l.base64.decode(e.fbCat,a.fbCat=l.newBuffer(l.base64.length(e.fbCat)),0):e.fbCat.length>=0&&(a.fbCat=e.fbCat)),e.fbUserAgent!=null&&(typeof e.fbUserAgent=="string"?l.base64.decode(e.fbUserAgent,a.fbUserAgent=l.newBuffer(l.base64.length(e.fbUserAgent)),0):e.fbUserAgent.length>=0&&(a.fbUserAgent=e.fbUserAgent)),e.oc!=null&&(a.oc=!!e.oc),e.lc!=null&&(a.lc=e.lc|0),e.iosAppExtension){default:if(typeof e.iosAppExtension=="number"){a.iosAppExtension=e.iosAppExtension;break}break;case"SHARE_EXTENSION":case 0:a.iosAppExtension=0;break;case"SERVICE_EXTENSION":case 1:a.iosAppExtension=1;break;case"INTENTS_EXTENSION":case 2:a.iosAppExtension=2;break}if(e.fbAppId!=null&&(l.Long?(a.fbAppId=l.Long.fromValue(e.fbAppId)).unsigned=!0:typeof e.fbAppId=="string"?a.fbAppId=parseInt(e.fbAppId,10):typeof e.fbAppId=="number"?a.fbAppId=e.fbAppId:typeof e.fbAppId=="object"&&(a.fbAppId=new l.LongBits(e.fbAppId.low>>>0,e.fbAppId.high>>>0).toNumber(!0))),e.fbDeviceId!=null&&(typeof e.fbDeviceId=="string"?l.base64.decode(e.fbDeviceId,a.fbDeviceId=l.newBuffer(l.base64.length(e.fbDeviceId)),0):e.fbDeviceId.length>=0&&(a.fbDeviceId=e.fbDeviceId)),e.pull!=null&&(a.pull=!!e.pull),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,a.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(a.paddingBytes=e.paddingBytes)),e.yearClass!=null&&(a.yearClass=e.yearClass|0),e.memClass!=null&&(a.memClass=e.memClass|0),e.interopData!=null){if(typeof e.interopData!="object")throw TypeError(".proto.ClientPayload.interopData: object expected");a.interopData=p.proto.ClientPayload.InteropData.fromObject(e.interopData)}switch(e.trafficAnonymization){default:if(typeof e.trafficAnonymization=="number"){a.trafficAnonymization=e.trafficAnonymization;break}break;case"OFF":case 0:a.trafficAnonymization=0;break;case"STANDARD":case 1:a.trafficAnonymization=1;break}switch(e.lidDbMigrated!=null&&(a.lidDbMigrated=!!e.lidDbMigrated),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"DEFAULT":case 0:a.accountType=0;break;case"GUEST":case 1:a.accountType=1;break}return e.connectionSequenceInfo!=null&&(a.connectionSequenceInfo=e.connectionSequenceInfo|0),e.paaLink!=null&&(a.paaLink=!!e.paaLink),e.preacksCount!=null&&(a.preacksCount=e.preacksCount|0),e.processingQueueSize!=null&&(a.processingQueueSize=e.processingQueueSize|0),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.shards=[]),e.username!=null&&e.hasOwnProperty("username")&&(typeof e.username=="number"?A.username=a.longs===String?String(e.username):e.username:A.username=a.longs===String?ge(e.username,!0):a.longs===Number?ce(e.username,!0):e.username,a.oneofs&&(A._username="username")),e.passive!=null&&e.hasOwnProperty("passive")&&(A.passive=e.passive,a.oneofs&&(A._passive="passive")),e.userAgent!=null&&e.hasOwnProperty("userAgent")&&(A.userAgent=p.proto.ClientPayload.UserAgent.toObject(e.userAgent,a),a.oneofs&&(A._userAgent="userAgent")),e.webInfo!=null&&e.hasOwnProperty("webInfo")&&(A.webInfo=p.proto.ClientPayload.WebInfo.toObject(e.webInfo,a),a.oneofs&&(A._webInfo="webInfo")),e.pushName!=null&&e.hasOwnProperty("pushName")&&(A.pushName=e.pushName,a.oneofs&&(A._pushName="pushName")),e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,a.oneofs&&(A._sessionId="sessionId")),e.shortConnect!=null&&e.hasOwnProperty("shortConnect")&&(A.shortConnect=e.shortConnect,a.oneofs&&(A._shortConnect="shortConnect")),e.connectType!=null&&e.hasOwnProperty("connectType")&&(A.connectType=a.enums===String?p.proto.ClientPayload.ConnectType[e.connectType]===void 0?e.connectType:p.proto.ClientPayload.ConnectType[e.connectType]:e.connectType,a.oneofs&&(A._connectType="connectType")),e.connectReason!=null&&e.hasOwnProperty("connectReason")&&(A.connectReason=a.enums===String?p.proto.ClientPayload.ConnectReason[e.connectReason]===void 0?e.connectReason:p.proto.ClientPayload.ConnectReason[e.connectReason]:e.connectReason,a.oneofs&&(A._connectReason="connectReason")),e.shards&&e.shards.length){A.shards=[];for(var r=0;r>>3){case 15:{c.dnsMethod=A.int32();break}case 16:{c.appCached=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.DNSSource)return A;var r=new p.proto.ClientPayload.DNSSource;switch(A.dnsMethod){default:if(typeof A.dnsMethod=="number"){r.dnsMethod=A.dnsMethod;break}break;case"SYSTEM":case 0:r.dnsMethod=0;break;case"GOOGLE":case 1:r.dnsMethod=1;break;case"HARDCODED":case 2:r.dnsMethod=2;break;case"OVERRIDE":case 3:r.dnsMethod=3;break;case"FALLBACK":case 4:r.dnsMethod=4;break;case"MNS":case 5:r.dnsMethod=5;break}return A.appCached!=null&&(r.appCached=!!A.appCached),r},i.toObject=function(A,r){r||(r={});var s={};return A.dnsMethod!=null&&A.hasOwnProperty("dnsMethod")&&(s.dnsMethod=r.enums===String?p.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]===void 0?A.dnsMethod:p.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]:A.dnsMethod,r.oneofs&&(s._dnsMethod="dnsMethod")),A.appCached!=null&&A.hasOwnProperty("appCached")&&(s.appCached=A.appCached,r.oneofs&&(s._appCached="appCached")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DNSSource"},i.DNSResolutionMethod=(function(){let a={},A=Object.create(a);return A[a[0]="SYSTEM"]=0,A[a[1]="GOOGLE"]=1,A[a[2]="HARDCODED"]=2,A[a[3]="OVERRIDE"]=3,A[a[4]="FALLBACK"]=4,A[a[5]="MNS"]=5,A})(),i})(),t.DevicePairingRegistrationData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.eRegid=A.bytes();break}case 2:{c.eKeytype=A.bytes();break}case 3:{c.eIdent=A.bytes();break}case 4:{c.eSkeyId=A.bytes();break}case 5:{c.eSkeyVal=A.bytes();break}case 6:{c.eSkeySig=A.bytes();break}case 7:{c.buildHash=A.bytes();break}case 8:{c.deviceProps=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.DevicePairingRegistrationData)return A;var r=new p.proto.ClientPayload.DevicePairingRegistrationData;return A.eRegid!=null&&(typeof A.eRegid=="string"?l.base64.decode(A.eRegid,r.eRegid=l.newBuffer(l.base64.length(A.eRegid)),0):A.eRegid.length>=0&&(r.eRegid=A.eRegid)),A.eKeytype!=null&&(typeof A.eKeytype=="string"?l.base64.decode(A.eKeytype,r.eKeytype=l.newBuffer(l.base64.length(A.eKeytype)),0):A.eKeytype.length>=0&&(r.eKeytype=A.eKeytype)),A.eIdent!=null&&(typeof A.eIdent=="string"?l.base64.decode(A.eIdent,r.eIdent=l.newBuffer(l.base64.length(A.eIdent)),0):A.eIdent.length>=0&&(r.eIdent=A.eIdent)),A.eSkeyId!=null&&(typeof A.eSkeyId=="string"?l.base64.decode(A.eSkeyId,r.eSkeyId=l.newBuffer(l.base64.length(A.eSkeyId)),0):A.eSkeyId.length>=0&&(r.eSkeyId=A.eSkeyId)),A.eSkeyVal!=null&&(typeof A.eSkeyVal=="string"?l.base64.decode(A.eSkeyVal,r.eSkeyVal=l.newBuffer(l.base64.length(A.eSkeyVal)),0):A.eSkeyVal.length>=0&&(r.eSkeyVal=A.eSkeyVal)),A.eSkeySig!=null&&(typeof A.eSkeySig=="string"?l.base64.decode(A.eSkeySig,r.eSkeySig=l.newBuffer(l.base64.length(A.eSkeySig)),0):A.eSkeySig.length>=0&&(r.eSkeySig=A.eSkeySig)),A.buildHash!=null&&(typeof A.buildHash=="string"?l.base64.decode(A.buildHash,r.buildHash=l.newBuffer(l.base64.length(A.buildHash)),0):A.buildHash.length>=0&&(r.buildHash=A.buildHash)),A.deviceProps!=null&&(typeof A.deviceProps=="string"?l.base64.decode(A.deviceProps,r.deviceProps=l.newBuffer(l.base64.length(A.deviceProps)),0):A.deviceProps.length>=0&&(r.deviceProps=A.deviceProps)),r},i.toObject=function(A,r){r||(r={});var s={};return A.eRegid!=null&&A.hasOwnProperty("eRegid")&&(s.eRegid=r.bytes===String?l.base64.encode(A.eRegid,0,A.eRegid.length):r.bytes===Array?Array.prototype.slice.call(A.eRegid):A.eRegid,r.oneofs&&(s._eRegid="eRegid")),A.eKeytype!=null&&A.hasOwnProperty("eKeytype")&&(s.eKeytype=r.bytes===String?l.base64.encode(A.eKeytype,0,A.eKeytype.length):r.bytes===Array?Array.prototype.slice.call(A.eKeytype):A.eKeytype,r.oneofs&&(s._eKeytype="eKeytype")),A.eIdent!=null&&A.hasOwnProperty("eIdent")&&(s.eIdent=r.bytes===String?l.base64.encode(A.eIdent,0,A.eIdent.length):r.bytes===Array?Array.prototype.slice.call(A.eIdent):A.eIdent,r.oneofs&&(s._eIdent="eIdent")),A.eSkeyId!=null&&A.hasOwnProperty("eSkeyId")&&(s.eSkeyId=r.bytes===String?l.base64.encode(A.eSkeyId,0,A.eSkeyId.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyId):A.eSkeyId,r.oneofs&&(s._eSkeyId="eSkeyId")),A.eSkeyVal!=null&&A.hasOwnProperty("eSkeyVal")&&(s.eSkeyVal=r.bytes===String?l.base64.encode(A.eSkeyVal,0,A.eSkeyVal.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyVal):A.eSkeyVal,r.oneofs&&(s._eSkeyVal="eSkeyVal")),A.eSkeySig!=null&&A.hasOwnProperty("eSkeySig")&&(s.eSkeySig=r.bytes===String?l.base64.encode(A.eSkeySig,0,A.eSkeySig.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeySig):A.eSkeySig,r.oneofs&&(s._eSkeySig="eSkeySig")),A.buildHash!=null&&A.hasOwnProperty("buildHash")&&(s.buildHash=r.bytes===String?l.base64.encode(A.buildHash,0,A.buildHash.length):r.bytes===Array?Array.prototype.slice.call(A.buildHash):A.buildHash,r.oneofs&&(s._buildHash="buildHash")),A.deviceProps!=null&&A.hasOwnProperty("deviceProps")&&(s.deviceProps=r.bytes===String?l.base64.encode(A.deviceProps,0,A.deviceProps.length):r.bytes===Array?Array.prototype.slice.call(A.deviceProps):A.deviceProps,r.oneofs&&(s._deviceProps="deviceProps")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DevicePairingRegistrationData"},i})(),t.IOSAppExtension=(function(){let i={},e=Object.create(i);return e[i[0]="SHARE_EXTENSION"]=0,e[i[1]="SERVICE_EXTENSION"]=1,e[i[2]="INTENTS_EXTENSION"]=2,e})(),t.InteropData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.accountId=A.uint64();break}case 2:{c.token=A.bytes();break}case 3:{c.enableReadReceipts=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.InteropData)return A;var r=new p.proto.ClientPayload.InteropData;return A.accountId!=null&&(l.Long?(r.accountId=l.Long.fromValue(A.accountId)).unsigned=!0:typeof A.accountId=="string"?r.accountId=parseInt(A.accountId,10):typeof A.accountId=="number"?r.accountId=A.accountId:typeof A.accountId=="object"&&(r.accountId=new l.LongBits(A.accountId.low>>>0,A.accountId.high>>>0).toNumber(!0))),A.token!=null&&(typeof A.token=="string"?l.base64.decode(A.token,r.token=l.newBuffer(l.base64.length(A.token)),0):A.token.length>=0&&(r.token=A.token)),A.enableReadReceipts!=null&&(r.enableReadReceipts=!!A.enableReadReceipts),r},i.toObject=function(A,r){r||(r={});var s={};return A.accountId!=null&&A.hasOwnProperty("accountId")&&(typeof A.accountId=="number"?s.accountId=r.longs===String?String(A.accountId):A.accountId:s.accountId=r.longs===String?ge(A.accountId,!0):r.longs===Number?ce(A.accountId,!0):A.accountId,r.oneofs&&(s._accountId="accountId")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=r.bytes===String?l.base64.encode(A.token,0,A.token.length):r.bytes===Array?Array.prototype.slice.call(A.token):A.token,r.oneofs&&(s._token="token")),A.enableReadReceipts!=null&&A.hasOwnProperty("enableReadReceipts")&&(s.enableReadReceipts=A.enableReadReceipts,r.oneofs&&(s._enableReadReceipts="enableReadReceipts")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.InteropData"},i})(),t.Product=(function(){let i={},e=Object.create(i);return e[i[0]="WHATSAPP"]=0,e[i[1]="MESSENGER"]=1,e[i[2]="INTEROP"]=2,e[i[3]="INTEROP_MSGR"]=3,e[i[4]="WHATSAPP_LID"]=4,e})(),t.TrafficAnonymization=(function(){let i={},e=Object.create(i);return e[i[0]="OFF"]=0,e[i[1]="STANDARD"]=1,e})(),t.UserAgent=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.platform=A.int32();break}case 2:{c.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.decode(A,A.uint32());break}case 3:{c.mcc=A.string();break}case 4:{c.mnc=A.string();break}case 5:{c.osVersion=A.string();break}case 6:{c.manufacturer=A.string();break}case 7:{c.device=A.string();break}case 8:{c.osBuildNumber=A.string();break}case 9:{c.phoneId=A.string();break}case 10:{c.releaseChannel=A.int32();break}case 11:{c.localeLanguageIso6391=A.string();break}case 12:{c.localeCountryIso31661Alpha2=A.string();break}case 13:{c.deviceBoard=A.string();break}case 14:{c.deviceExpId=A.string();break}case 15:{c.deviceType=A.int32();break}case 16:{c.deviceModelType=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.UserAgent)return A;var r=new p.proto.ClientPayload.UserAgent;switch(A.platform){default:if(typeof A.platform=="number"){r.platform=A.platform;break}break;case"ANDROID":case 0:r.platform=0;break;case"IOS":case 1:r.platform=1;break;case"WINDOWS_PHONE":case 2:r.platform=2;break;case"BLACKBERRY":case 3:r.platform=3;break;case"BLACKBERRYX":case 4:r.platform=4;break;case"S40":case 5:r.platform=5;break;case"S60":case 6:r.platform=6;break;case"PYTHON_CLIENT":case 7:r.platform=7;break;case"TIZEN":case 8:r.platform=8;break;case"ENTERPRISE":case 9:r.platform=9;break;case"SMB_ANDROID":case 10:r.platform=10;break;case"KAIOS":case 11:r.platform=11;break;case"SMB_IOS":case 12:r.platform=12;break;case"WINDOWS":case 13:r.platform=13;break;case"WEB":case 14:r.platform=14;break;case"PORTAL":case 15:r.platform=15;break;case"GREEN_ANDROID":case 16:r.platform=16;break;case"GREEN_IPHONE":case 17:r.platform=17;break;case"BLUE_ANDROID":case 18:r.platform=18;break;case"BLUE_IPHONE":case 19:r.platform=19;break;case"FBLITE_ANDROID":case 20:r.platform=20;break;case"MLITE_ANDROID":case 21:r.platform=21;break;case"IGLITE_ANDROID":case 22:r.platform=22;break;case"PAGE":case 23:r.platform=23;break;case"MACOS":case 24:r.platform=24;break;case"OCULUS_MSG":case 25:r.platform=25;break;case"OCULUS_CALL":case 26:r.platform=26;break;case"MILAN":case 27:r.platform=27;break;case"CAPI":case 28:r.platform=28;break;case"WEAROS":case 29:r.platform=29;break;case"ARDEVICE":case 30:r.platform=30;break;case"VRDEVICE":case 31:r.platform=31;break;case"BLUE_WEB":case 32:r.platform=32;break;case"IPAD":case 33:r.platform=33;break;case"TEST":case 34:r.platform=34;break;case"SMART_GLASSES":case 35:r.platform=35;break;case"BLUE_VR":case 36:r.platform=36;break;case"AR_WRIST":case 37:r.platform=37;break}if(A.appVersion!=null){if(typeof A.appVersion!="object")throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected");r.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.fromObject(A.appVersion)}switch(A.mcc!=null&&(r.mcc=String(A.mcc)),A.mnc!=null&&(r.mnc=String(A.mnc)),A.osVersion!=null&&(r.osVersion=String(A.osVersion)),A.manufacturer!=null&&(r.manufacturer=String(A.manufacturer)),A.device!=null&&(r.device=String(A.device)),A.osBuildNumber!=null&&(r.osBuildNumber=String(A.osBuildNumber)),A.phoneId!=null&&(r.phoneId=String(A.phoneId)),A.releaseChannel){default:if(typeof A.releaseChannel=="number"){r.releaseChannel=A.releaseChannel;break}break;case"RELEASE":case 0:r.releaseChannel=0;break;case"BETA":case 1:r.releaseChannel=1;break;case"ALPHA":case 2:r.releaseChannel=2;break;case"DEBUG":case 3:r.releaseChannel=3;break}switch(A.localeLanguageIso6391!=null&&(r.localeLanguageIso6391=String(A.localeLanguageIso6391)),A.localeCountryIso31661Alpha2!=null&&(r.localeCountryIso31661Alpha2=String(A.localeCountryIso31661Alpha2)),A.deviceBoard!=null&&(r.deviceBoard=String(A.deviceBoard)),A.deviceExpId!=null&&(r.deviceExpId=String(A.deviceExpId)),A.deviceType){default:if(typeof A.deviceType=="number"){r.deviceType=A.deviceType;break}break;case"PHONE":case 0:r.deviceType=0;break;case"TABLET":case 1:r.deviceType=1;break;case"DESKTOP":case 2:r.deviceType=2;break;case"WEARABLE":case 3:r.deviceType=3;break;case"VR":case 4:r.deviceType=4;break}return A.deviceModelType!=null&&(r.deviceModelType=String(A.deviceModelType)),r},i.toObject=function(A,r){r||(r={});var s={};return A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=r.enums===String?p.proto.ClientPayload.UserAgent.Platform[A.platform]===void 0?A.platform:p.proto.ClientPayload.UserAgent.Platform[A.platform]:A.platform,r.oneofs&&(s._platform="platform")),A.appVersion!=null&&A.hasOwnProperty("appVersion")&&(s.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.toObject(A.appVersion,r),r.oneofs&&(s._appVersion="appVersion")),A.mcc!=null&&A.hasOwnProperty("mcc")&&(s.mcc=A.mcc,r.oneofs&&(s._mcc="mcc")),A.mnc!=null&&A.hasOwnProperty("mnc")&&(s.mnc=A.mnc,r.oneofs&&(s._mnc="mnc")),A.osVersion!=null&&A.hasOwnProperty("osVersion")&&(s.osVersion=A.osVersion,r.oneofs&&(s._osVersion="osVersion")),A.manufacturer!=null&&A.hasOwnProperty("manufacturer")&&(s.manufacturer=A.manufacturer,r.oneofs&&(s._manufacturer="manufacturer")),A.device!=null&&A.hasOwnProperty("device")&&(s.device=A.device,r.oneofs&&(s._device="device")),A.osBuildNumber!=null&&A.hasOwnProperty("osBuildNumber")&&(s.osBuildNumber=A.osBuildNumber,r.oneofs&&(s._osBuildNumber="osBuildNumber")),A.phoneId!=null&&A.hasOwnProperty("phoneId")&&(s.phoneId=A.phoneId,r.oneofs&&(s._phoneId="phoneId")),A.releaseChannel!=null&&A.hasOwnProperty("releaseChannel")&&(s.releaseChannel=r.enums===String?p.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]===void 0?A.releaseChannel:p.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]:A.releaseChannel,r.oneofs&&(s._releaseChannel="releaseChannel")),A.localeLanguageIso6391!=null&&A.hasOwnProperty("localeLanguageIso6391")&&(s.localeLanguageIso6391=A.localeLanguageIso6391,r.oneofs&&(s._localeLanguageIso6391="localeLanguageIso6391")),A.localeCountryIso31661Alpha2!=null&&A.hasOwnProperty("localeCountryIso31661Alpha2")&&(s.localeCountryIso31661Alpha2=A.localeCountryIso31661Alpha2,r.oneofs&&(s._localeCountryIso31661Alpha2="localeCountryIso31661Alpha2")),A.deviceBoard!=null&&A.hasOwnProperty("deviceBoard")&&(s.deviceBoard=A.deviceBoard,r.oneofs&&(s._deviceBoard="deviceBoard")),A.deviceExpId!=null&&A.hasOwnProperty("deviceExpId")&&(s.deviceExpId=A.deviceExpId,r.oneofs&&(s._deviceExpId="deviceExpId")),A.deviceType!=null&&A.hasOwnProperty("deviceType")&&(s.deviceType=r.enums===String?p.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]===void 0?A.deviceType:p.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]:A.deviceType,r.oneofs&&(s._deviceType="deviceType")),A.deviceModelType!=null&&A.hasOwnProperty("deviceModelType")&&(s.deviceModelType=A.deviceModelType,r.oneofs&&(s._deviceModelType="deviceModelType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.UserAgent"},i.AppVersion=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.primary=s.uint32();break}case 2:{d.secondary=s.uint32();break}case 3:{d.tertiary=s.uint32();break}case 4:{d.quaternary=s.uint32();break}case 5:{d.quinary=s.uint32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ClientPayload.UserAgent.AppVersion)return s;var g=new p.proto.ClientPayload.UserAgent.AppVersion;return s.primary!=null&&(g.primary=s.primary>>>0),s.secondary!=null&&(g.secondary=s.secondary>>>0),s.tertiary!=null&&(g.tertiary=s.tertiary>>>0),s.quaternary!=null&&(g.quaternary=s.quaternary>>>0),s.quinary!=null&&(g.quinary=s.quinary>>>0),g},a.toObject=function(s,g){g||(g={});var c={};return s.primary!=null&&s.hasOwnProperty("primary")&&(c.primary=s.primary,g.oneofs&&(c._primary="primary")),s.secondary!=null&&s.hasOwnProperty("secondary")&&(c.secondary=s.secondary,g.oneofs&&(c._secondary="secondary")),s.tertiary!=null&&s.hasOwnProperty("tertiary")&&(c.tertiary=s.tertiary,g.oneofs&&(c._tertiary="tertiary")),s.quaternary!=null&&s.hasOwnProperty("quaternary")&&(c.quaternary=s.quaternary,g.oneofs&&(c._quaternary="quaternary")),s.quinary!=null&&s.hasOwnProperty("quinary")&&(c.quinary=s.quinary,g.oneofs&&(c._quinary="quinary")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.UserAgent.AppVersion"},a})(),i.DeviceType=(function(){let a={},A=Object.create(a);return A[a[0]="PHONE"]=0,A[a[1]="TABLET"]=1,A[a[2]="DESKTOP"]=2,A[a[3]="WEARABLE"]=3,A[a[4]="VR"]=4,A})(),i.Platform=(function(){let a={},A=Object.create(a);return A[a[0]="ANDROID"]=0,A[a[1]="IOS"]=1,A[a[2]="WINDOWS_PHONE"]=2,A[a[3]="BLACKBERRY"]=3,A[a[4]="BLACKBERRYX"]=4,A[a[5]="S40"]=5,A[a[6]="S60"]=6,A[a[7]="PYTHON_CLIENT"]=7,A[a[8]="TIZEN"]=8,A[a[9]="ENTERPRISE"]=9,A[a[10]="SMB_ANDROID"]=10,A[a[11]="KAIOS"]=11,A[a[12]="SMB_IOS"]=12,A[a[13]="WINDOWS"]=13,A[a[14]="WEB"]=14,A[a[15]="PORTAL"]=15,A[a[16]="GREEN_ANDROID"]=16,A[a[17]="GREEN_IPHONE"]=17,A[a[18]="BLUE_ANDROID"]=18,A[a[19]="BLUE_IPHONE"]=19,A[a[20]="FBLITE_ANDROID"]=20,A[a[21]="MLITE_ANDROID"]=21,A[a[22]="IGLITE_ANDROID"]=22,A[a[23]="PAGE"]=23,A[a[24]="MACOS"]=24,A[a[25]="OCULUS_MSG"]=25,A[a[26]="OCULUS_CALL"]=26,A[a[27]="MILAN"]=27,A[a[28]="CAPI"]=28,A[a[29]="WEAROS"]=29,A[a[30]="ARDEVICE"]=30,A[a[31]="VRDEVICE"]=31,A[a[32]="BLUE_WEB"]=32,A[a[33]="IPAD"]=33,A[a[34]="TEST"]=34,A[a[35]="SMART_GLASSES"]=35,A[a[36]="BLUE_VR"]=36,A[a[37]="AR_WRIST"]=37,A})(),i.ReleaseChannel=(function(){let a={},A=Object.create(a);return A[a[0]="RELEASE"]=0,A[a[1]="BETA"]=1,A[a[2]="ALPHA"]=2,A[a[3]="DEBUG"]=3,A})(),i})(),t.WebInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.refToken=A.string();break}case 2:{c.version=A.string();break}case 3:{c.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.decode(A,A.uint32());break}case 4:{c.webSubPlatform=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.WebInfo)return A;var r=new p.proto.ClientPayload.WebInfo;if(A.refToken!=null&&(r.refToken=String(A.refToken)),A.version!=null&&(r.version=String(A.version)),A.webdPayload!=null){if(typeof A.webdPayload!="object")throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected");r.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.fromObject(A.webdPayload)}switch(A.webSubPlatform){default:if(typeof A.webSubPlatform=="number"){r.webSubPlatform=A.webSubPlatform;break}break;case"WEB_BROWSER":case 0:r.webSubPlatform=0;break;case"APP_STORE":case 1:r.webSubPlatform=1;break;case"WIN_STORE":case 2:r.webSubPlatform=2;break;case"DARWIN":case 3:r.webSubPlatform=3;break;case"WIN32":case 4:r.webSubPlatform=4;break;case"WIN_HYBRID":case 5:r.webSubPlatform=5;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.refToken!=null&&A.hasOwnProperty("refToken")&&(s.refToken=A.refToken,r.oneofs&&(s._refToken="refToken")),A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),A.webdPayload!=null&&A.hasOwnProperty("webdPayload")&&(s.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.toObject(A.webdPayload,r),r.oneofs&&(s._webdPayload="webdPayload")),A.webSubPlatform!=null&&A.hasOwnProperty("webSubPlatform")&&(s.webSubPlatform=r.enums===String?p.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]===void 0?A.webSubPlatform:p.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]:A.webSubPlatform,r.oneofs&&(s._webSubPlatform="webSubPlatform")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.WebInfo"},i.WebSubPlatform=(function(){let a={},A=Object.create(a);return A[a[0]="WEB_BROWSER"]=0,A[a[1]="APP_STORE"]=1,A[a[2]="WIN_STORE"]=2,A[a[3]="DARWIN"]=3,A[a[4]="WIN32"]=4,A[a[5]="WIN_HYBRID"]=5,A})(),i.WebdPayload=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.usesParticipantInKey=s.bool();break}case 2:{d.supportsStarredMessages=s.bool();break}case 3:{d.supportsDocumentMessages=s.bool();break}case 4:{d.supportsUrlMessages=s.bool();break}case 5:{d.supportsMediaRetry=s.bool();break}case 6:{d.supportsE2EImage=s.bool();break}case 7:{d.supportsE2EVideo=s.bool();break}case 8:{d.supportsE2EAudio=s.bool();break}case 9:{d.supportsE2EDocument=s.bool();break}case 10:{d.documentTypes=s.string();break}case 11:{d.features=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ClientPayload.WebInfo.WebdPayload)return s;var g=new p.proto.ClientPayload.WebInfo.WebdPayload;return s.usesParticipantInKey!=null&&(g.usesParticipantInKey=!!s.usesParticipantInKey),s.supportsStarredMessages!=null&&(g.supportsStarredMessages=!!s.supportsStarredMessages),s.supportsDocumentMessages!=null&&(g.supportsDocumentMessages=!!s.supportsDocumentMessages),s.supportsUrlMessages!=null&&(g.supportsUrlMessages=!!s.supportsUrlMessages),s.supportsMediaRetry!=null&&(g.supportsMediaRetry=!!s.supportsMediaRetry),s.supportsE2EImage!=null&&(g.supportsE2EImage=!!s.supportsE2EImage),s.supportsE2EVideo!=null&&(g.supportsE2EVideo=!!s.supportsE2EVideo),s.supportsE2EAudio!=null&&(g.supportsE2EAudio=!!s.supportsE2EAudio),s.supportsE2EDocument!=null&&(g.supportsE2EDocument=!!s.supportsE2EDocument),s.documentTypes!=null&&(g.documentTypes=String(s.documentTypes)),s.features!=null&&(typeof s.features=="string"?l.base64.decode(s.features,g.features=l.newBuffer(l.base64.length(s.features)),0):s.features.length>=0&&(g.features=s.features)),g},a.toObject=function(s,g){g||(g={});var c={};return s.usesParticipantInKey!=null&&s.hasOwnProperty("usesParticipantInKey")&&(c.usesParticipantInKey=s.usesParticipantInKey,g.oneofs&&(c._usesParticipantInKey="usesParticipantInKey")),s.supportsStarredMessages!=null&&s.hasOwnProperty("supportsStarredMessages")&&(c.supportsStarredMessages=s.supportsStarredMessages,g.oneofs&&(c._supportsStarredMessages="supportsStarredMessages")),s.supportsDocumentMessages!=null&&s.hasOwnProperty("supportsDocumentMessages")&&(c.supportsDocumentMessages=s.supportsDocumentMessages,g.oneofs&&(c._supportsDocumentMessages="supportsDocumentMessages")),s.supportsUrlMessages!=null&&s.hasOwnProperty("supportsUrlMessages")&&(c.supportsUrlMessages=s.supportsUrlMessages,g.oneofs&&(c._supportsUrlMessages="supportsUrlMessages")),s.supportsMediaRetry!=null&&s.hasOwnProperty("supportsMediaRetry")&&(c.supportsMediaRetry=s.supportsMediaRetry,g.oneofs&&(c._supportsMediaRetry="supportsMediaRetry")),s.supportsE2EImage!=null&&s.hasOwnProperty("supportsE2EImage")&&(c.supportsE2EImage=s.supportsE2EImage,g.oneofs&&(c._supportsE2EImage="supportsE2EImage")),s.supportsE2EVideo!=null&&s.hasOwnProperty("supportsE2EVideo")&&(c.supportsE2EVideo=s.supportsE2EVideo,g.oneofs&&(c._supportsE2EVideo="supportsE2EVideo")),s.supportsE2EAudio!=null&&s.hasOwnProperty("supportsE2EAudio")&&(c.supportsE2EAudio=s.supportsE2EAudio,g.oneofs&&(c._supportsE2EAudio="supportsE2EAudio")),s.supportsE2EDocument!=null&&s.hasOwnProperty("supportsE2EDocument")&&(c.supportsE2EDocument=s.supportsE2EDocument,g.oneofs&&(c._supportsE2EDocument="supportsE2EDocument")),s.documentTypes!=null&&s.hasOwnProperty("documentTypes")&&(c.documentTypes=s.documentTypes,g.oneofs&&(c._documentTypes="documentTypes")),s.features!=null&&s.hasOwnProperty("features")&&(c.features=g.bytes===String?l.base64.encode(s.features,0,s.features.length):g.bytes===Array?Array.prototype.slice.call(s.features):s.features,g.oneofs&&(c._features="features")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.WebInfo.WebdPayload"},a})(),i})(),t})(),n.CollectionName=(function(){let t={},o=Object.create(t);return o[t[0]="COLLECTION_NAME_UNKNOWN"]=0,o[t[1]="REGULAR"]=1,o[t[2]="REGULAR_LOW"]=2,o[t[3]="REGULAR_HIGH"]=3,o[t[4]="CRITICAL_BLOCK"]=4,o[t[5]="CRITICAL_UNBLOCK_LOW"]=5,o})(),n.CommentMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.commentParentKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.replyCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CommentMetadata)return e;var a=new p.proto.CommentMetadata;if(e.commentParentKey!=null){if(typeof e.commentParentKey!="object")throw TypeError(".proto.CommentMetadata.commentParentKey: object expected");a.commentParentKey=p.proto.MessageKey.fromObject(e.commentParentKey)}return e.replyCount!=null&&(a.replyCount=e.replyCount>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.commentParentKey!=null&&e.hasOwnProperty("commentParentKey")&&(A.commentParentKey=p.proto.MessageKey.toObject(e.commentParentKey,a),a.oneofs&&(A._commentParentKey="commentParentKey")),e.replyCount!=null&&e.hasOwnProperty("replyCount")&&(A.replyCount=e.replyCount,a.oneofs&&(A._replyCount="replyCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CommentMetadata"},t})(),n.CompanionCommitment=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.hash=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CompanionCommitment)return e;var a=new p.proto.CompanionCommitment;return e.hash!=null&&(typeof e.hash=="string"?l.base64.decode(e.hash,a.hash=l.newBuffer(l.base64.length(e.hash)),0):e.hash.length>=0&&(a.hash=e.hash)),a},t.toObject=function(e,a){a||(a={});var A={};return e.hash!=null&&e.hasOwnProperty("hash")&&(A.hash=a.bytes===String?l.base64.encode(e.hash,0,e.hash.length):a.bytes===Array?Array.prototype.slice.call(e.hash):e.hash,a.oneofs&&(A._hash="hash")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionCommitment"},t})(),n.CompanionEphemeralIdentity=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.deviceType=e.int32();break}case 3:{s.ref=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.CompanionEphemeralIdentity)return e;var a=new p.proto.CompanionEphemeralIdentity;switch(e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.deviceType){default:if(typeof e.deviceType=="number"){a.deviceType=e.deviceType;break}break;case"UNKNOWN":case 0:a.deviceType=0;break;case"CHROME":case 1:a.deviceType=1;break;case"FIREFOX":case 2:a.deviceType=2;break;case"IE":case 3:a.deviceType=3;break;case"OPERA":case 4:a.deviceType=4;break;case"SAFARI":case 5:a.deviceType=5;break;case"EDGE":case 6:a.deviceType=6;break;case"DESKTOP":case 7:a.deviceType=7;break;case"IPAD":case 8:a.deviceType=8;break;case"ANDROID_TABLET":case 9:a.deviceType=9;break;case"OHANA":case 10:a.deviceType=10;break;case"ALOHA":case 11:a.deviceType=11;break;case"CATALINA":case 12:a.deviceType=12;break;case"TCL_TV":case 13:a.deviceType=13;break;case"IOS_PHONE":case 14:a.deviceType=14;break;case"IOS_CATALYST":case 15:a.deviceType=15;break;case"ANDROID_PHONE":case 16:a.deviceType=16;break;case"ANDROID_AMBIGUOUS":case 17:a.deviceType=17;break;case"WEAR_OS":case 18:a.deviceType=18;break;case"AR_WRIST":case 19:a.deviceType=19;break;case"AR_DEVICE":case 20:a.deviceType=20;break;case"UWP":case 21:a.deviceType=21;break;case"VR":case 22:a.deviceType=22;break;case"CLOUD_API":case 23:a.deviceType=23;break;case"SMARTGLASSES":case 24:a.deviceType=24;break}return e.ref!=null&&(a.ref=String(e.ref)),a},t.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=a.enums===String?p.proto.DeviceProps.PlatformType[e.deviceType]===void 0?e.deviceType:p.proto.DeviceProps.PlatformType[e.deviceType]:e.deviceType,a.oneofs&&(A._deviceType="deviceType")),e.ref!=null&&e.hasOwnProperty("ref")&&(A.ref=e.ref,a.oneofs&&(A._ref="ref")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionEphemeralIdentity"},t})(),n.Config=(function(){function t(i){if(this.field={},i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.field===l.emptyObject&&(s.field={});var d=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=p.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.field[g]=c;break}case 2:{s.version=e.uint32();break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Config)return e;var a=new p.proto.Config;if(e.field){if(typeof e.field!="object")throw TypeError(".proto.Config.field: object expected");a.field={};for(var A=Object.keys(e.field),r=0;r>>0),a},t.toObject=function(e,a){a||(a={});var A={};(a.objects||a.defaults)&&(A.field={});var r;if(e.field&&(r=Object.keys(e.field)).length){A.field={};for(var s=0;s>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.participant=e.string();break}case 3:{s.quotedMessage=p.proto.Message.decode(e,e.uint32());break}case 4:{s.remoteJid=e.string();break}case 15:{s.mentionedJid&&s.mentionedJid.length||(s.mentionedJid=[]),s.mentionedJid.push(e.string());break}case 18:{s.conversionSource=e.string();break}case 19:{s.conversionData=e.bytes();break}case 20:{s.conversionDelaySeconds=e.uint32();break}case 21:{s.forwardingScore=e.uint32();break}case 22:{s.isForwarded=e.bool();break}case 23:{s.quotedAd=p.proto.ContextInfo.AdReplyInfo.decode(e,e.uint32());break}case 24:{s.placeholderKey=p.proto.MessageKey.decode(e,e.uint32());break}case 25:{s.expiration=e.uint32();break}case 26:{s.ephemeralSettingTimestamp=e.int64();break}case 27:{s.ephemeralSharedSecret=e.bytes();break}case 28:{s.externalAdReply=p.proto.ContextInfo.ExternalAdReplyInfo.decode(e,e.uint32());break}case 29:{s.entryPointConversionSource=e.string();break}case 30:{s.entryPointConversionApp=e.string();break}case 31:{s.entryPointConversionDelaySeconds=e.uint32();break}case 32:{s.disappearingMode=p.proto.DisappearingMode.decode(e,e.uint32());break}case 33:{s.actionLink=p.proto.ActionLink.decode(e,e.uint32());break}case 34:{s.groupSubject=e.string();break}case 35:{s.parentGroupJid=e.string();break}case 37:{s.trustBannerType=e.string();break}case 38:{s.trustBannerAction=e.uint32();break}case 39:{s.isSampled=e.bool();break}case 40:{s.groupMentions&&s.groupMentions.length||(s.groupMentions=[]),s.groupMentions.push(p.proto.GroupMention.decode(e,e.uint32()));break}case 41:{s.utm=p.proto.ContextInfo.UTMInfo.decode(e,e.uint32());break}case 43:{s.forwardedNewsletterMessageInfo=p.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 44:{s.businessMessageForwardInfo=p.proto.ContextInfo.BusinessMessageForwardInfo.decode(e,e.uint32());break}case 45:{s.smbClientCampaignId=e.string();break}case 46:{s.smbServerCampaignId=e.string();break}case 47:{s.dataSharingContext=p.proto.ContextInfo.DataSharingContext.decode(e,e.uint32());break}case 48:{s.alwaysShowAdAttribution=e.bool();break}case 49:{s.featureEligibilities=p.proto.ContextInfo.FeatureEligibilities.decode(e,e.uint32());break}case 50:{s.entryPointConversionExternalSource=e.string();break}case 51:{s.entryPointConversionExternalMedium=e.string();break}case 54:{s.ctwaSignals=e.string();break}case 55:{s.ctwaPayload=e.bytes();break}case 56:{s.forwardedAiBotMessageInfo=p.proto.ForwardedAIBotMessageInfo.decode(e,e.uint32());break}case 57:{s.statusAttributionType=e.int32();break}case 58:{s.urlTrackingMap=p.proto.UrlTrackingMap.decode(e,e.uint32());break}case 59:{s.pairedMediaType=e.int32();break}case 60:{s.rankingVersion=e.uint32();break}case 62:{s.memberLabel=p.proto.MemberLabel.decode(e,e.uint32());break}case 63:{s.isQuestion=e.bool();break}case 64:{s.statusSourceType=e.int32();break}case 65:{s.statusAttributions&&s.statusAttributions.length||(s.statusAttributions=[]),s.statusAttributions.push(p.proto.StatusAttribution.decode(e,e.uint32()));break}case 66:{s.isGroupStatus=e.bool();break}case 67:{s.forwardOrigin=e.int32();break}case 68:{s.questionReplyQuotedMessage=p.proto.ContextInfo.QuestionReplyQuotedMessage.decode(e,e.uint32());break}case 69:{s.statusAudienceMetadata=p.proto.ContextInfo.StatusAudienceMetadata.decode(e,e.uint32());break}case 70:{s.nonJidMentions=e.uint32();break}case 71:{s.quotedType=e.int32();break}case 72:{s.botMessageSharingInfo=p.proto.BotMessageSharingInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ContextInfo)return e;var a=new p.proto.ContextInfo;if(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.participant!=null&&(a.participant=String(e.participant)),e.quotedMessage!=null){if(typeof e.quotedMessage!="object")throw TypeError(".proto.ContextInfo.quotedMessage: object expected");a.quotedMessage=p.proto.Message.fromObject(e.quotedMessage)}if(e.remoteJid!=null&&(a.remoteJid=String(e.remoteJid)),e.mentionedJid){if(!Array.isArray(e.mentionedJid))throw TypeError(".proto.ContextInfo.mentionedJid: array expected");a.mentionedJid=[];for(var A=0;A=0&&(a.conversionData=e.conversionData)),e.conversionDelaySeconds!=null&&(a.conversionDelaySeconds=e.conversionDelaySeconds>>>0),e.forwardingScore!=null&&(a.forwardingScore=e.forwardingScore>>>0),e.isForwarded!=null&&(a.isForwarded=!!e.isForwarded),e.quotedAd!=null){if(typeof e.quotedAd!="object")throw TypeError(".proto.ContextInfo.quotedAd: object expected");a.quotedAd=p.proto.ContextInfo.AdReplyInfo.fromObject(e.quotedAd)}if(e.placeholderKey!=null){if(typeof e.placeholderKey!="object")throw TypeError(".proto.ContextInfo.placeholderKey: object expected");a.placeholderKey=p.proto.MessageKey.fromObject(e.placeholderKey)}if(e.expiration!=null&&(a.expiration=e.expiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(a.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?a.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(a.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.ephemeralSharedSecret!=null&&(typeof e.ephemeralSharedSecret=="string"?l.base64.decode(e.ephemeralSharedSecret,a.ephemeralSharedSecret=l.newBuffer(l.base64.length(e.ephemeralSharedSecret)),0):e.ephemeralSharedSecret.length>=0&&(a.ephemeralSharedSecret=e.ephemeralSharedSecret)),e.externalAdReply!=null){if(typeof e.externalAdReply!="object")throw TypeError(".proto.ContextInfo.externalAdReply: object expected");a.externalAdReply=p.proto.ContextInfo.ExternalAdReplyInfo.fromObject(e.externalAdReply)}if(e.entryPointConversionSource!=null&&(a.entryPointConversionSource=String(e.entryPointConversionSource)),e.entryPointConversionApp!=null&&(a.entryPointConversionApp=String(e.entryPointConversionApp)),e.entryPointConversionDelaySeconds!=null&&(a.entryPointConversionDelaySeconds=e.entryPointConversionDelaySeconds>>>0),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.ContextInfo.disappearingMode: object expected");a.disappearingMode=p.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.actionLink!=null){if(typeof e.actionLink!="object")throw TypeError(".proto.ContextInfo.actionLink: object expected");a.actionLink=p.proto.ActionLink.fromObject(e.actionLink)}if(e.groupSubject!=null&&(a.groupSubject=String(e.groupSubject)),e.parentGroupJid!=null&&(a.parentGroupJid=String(e.parentGroupJid)),e.trustBannerType!=null&&(a.trustBannerType=String(e.trustBannerType)),e.trustBannerAction!=null&&(a.trustBannerAction=e.trustBannerAction>>>0),e.isSampled!=null&&(a.isSampled=!!e.isSampled),e.groupMentions){if(!Array.isArray(e.groupMentions))throw TypeError(".proto.ContextInfo.groupMentions: array expected");a.groupMentions=[];for(var A=0;A=0&&(a.ctwaPayload=e.ctwaPayload)),e.forwardedAiBotMessageInfo!=null){if(typeof e.forwardedAiBotMessageInfo!="object")throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected");a.forwardedAiBotMessageInfo=p.proto.ForwardedAIBotMessageInfo.fromObject(e.forwardedAiBotMessageInfo)}switch(e.statusAttributionType){default:if(typeof e.statusAttributionType=="number"){a.statusAttributionType=e.statusAttributionType;break}break;case"NONE":case 0:a.statusAttributionType=0;break;case"RESHARED_FROM_MENTION":case 1:a.statusAttributionType=1;break;case"RESHARED_FROM_POST":case 2:a.statusAttributionType=2;break;case"RESHARED_FROM_POST_MANY_TIMES":case 3:a.statusAttributionType=3;break;case"FORWARDED_FROM_STATUS":case 4:a.statusAttributionType=4;break}if(e.urlTrackingMap!=null){if(typeof e.urlTrackingMap!="object")throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected");a.urlTrackingMap=p.proto.UrlTrackingMap.fromObject(e.urlTrackingMap)}switch(e.pairedMediaType){default:if(typeof e.pairedMediaType=="number"){a.pairedMediaType=e.pairedMediaType;break}break;case"NOT_PAIRED_MEDIA":case 0:a.pairedMediaType=0;break;case"SD_VIDEO_PARENT":case 1:a.pairedMediaType=1;break;case"HD_VIDEO_CHILD":case 2:a.pairedMediaType=2;break;case"SD_IMAGE_PARENT":case 3:a.pairedMediaType=3;break;case"HD_IMAGE_CHILD":case 4:a.pairedMediaType=4;break;case"MOTION_PHOTO_PARENT":case 5:a.pairedMediaType=5;break;case"MOTION_PHOTO_CHILD":case 6:a.pairedMediaType=6;break;case"HEVC_VIDEO_PARENT":case 7:a.pairedMediaType=7;break;case"HEVC_VIDEO_CHILD":case 8:a.pairedMediaType=8;break}if(e.rankingVersion!=null&&(a.rankingVersion=e.rankingVersion>>>0),e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.ContextInfo.memberLabel: object expected");a.memberLabel=p.proto.MemberLabel.fromObject(e.memberLabel)}switch(e.isQuestion!=null&&(a.isQuestion=!!e.isQuestion),e.statusSourceType){default:if(typeof e.statusSourceType=="number"){a.statusSourceType=e.statusSourceType;break}break;case"IMAGE":case 0:a.statusSourceType=0;break;case"VIDEO":case 1:a.statusSourceType=1;break;case"GIF":case 2:a.statusSourceType=2;break;case"AUDIO":case 3:a.statusSourceType=3;break;case"TEXT":case 4:a.statusSourceType=4;break;case"MUSIC_STANDALONE":case 5:a.statusSourceType=5;break}if(e.statusAttributions){if(!Array.isArray(e.statusAttributions))throw TypeError(".proto.ContextInfo.statusAttributions: array expected");a.statusAttributions=[];for(var A=0;A>>0),e.quotedType){default:if(typeof e.quotedType=="number"){a.quotedType=e.quotedType;break}break;case"EXPLICIT":case 0:a.quotedType=0;break;case"AUTO":case 1:a.quotedType=1;break}if(e.botMessageSharingInfo!=null){if(typeof e.botMessageSharingInfo!="object")throw TypeError(".proto.ContextInfo.botMessageSharingInfo: object expected");a.botMessageSharingInfo=p.proto.BotMessageSharingInfo.fromObject(e.botMessageSharingInfo)}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.mentionedJid=[],A.groupMentions=[],A.statusAttributions=[]),e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),e.quotedMessage!=null&&e.hasOwnProperty("quotedMessage")&&(A.quotedMessage=p.proto.Message.toObject(e.quotedMessage,a),a.oneofs&&(A._quotedMessage="quotedMessage")),e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,a.oneofs&&(A._remoteJid="remoteJid")),e.mentionedJid&&e.mentionedJid.length){A.mentionedJid=[];for(var r=0;r>>3){case 1:{c.advertiserName=A.string();break}case 2:{c.mediaType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.AdReplyInfo)return A;var r=new p.proto.ContextInfo.AdReplyInfo;switch(A.advertiserName!=null&&(r.advertiserName=String(A.advertiserName)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),r},i.toObject=function(A,r){r||(r={});var s={};return A.advertiserName!=null&&A.hasOwnProperty("advertiserName")&&(s.advertiserName=A.advertiserName,r.oneofs&&(s._advertiserName="advertiserName")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?p.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.AdReplyInfo"},i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="IMAGE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.BusinessMessageForwardInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.businessOwnerJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.BusinessMessageForwardInfo)return A;var r=new p.proto.ContextInfo.BusinessMessageForwardInfo;return A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),r},i.toObject=function(A,r){r||(r={});var s={};return A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.BusinessMessageForwardInfo"},i})(),t.DataSharingContext=(function(){function i(a){if(this.parameters=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.showMmDisclosure=A.bool();break}case 2:{c.encryptedSignalTokenConsented=A.string();break}case 3:{c.parameters&&c.parameters.length||(c.parameters=[]),c.parameters.push(p.proto.ContextInfo.DataSharingContext.Parameters.decode(A,A.uint32()));break}case 4:{c.dataSharingFlags=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.DataSharingContext)return A;var r=new p.proto.ContextInfo.DataSharingContext;if(A.showMmDisclosure!=null&&(r.showMmDisclosure=!!A.showMmDisclosure),A.encryptedSignalTokenConsented!=null&&(r.encryptedSignalTokenConsented=String(A.encryptedSignalTokenConsented)),A.parameters){if(!Array.isArray(A.parameters))throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected");r.parameters=[];for(var s=0;s>>3){case 1:{d.key=s.string();break}case 2:{d.stringData=s.string();break}case 3:{d.intData=s.int64();break}case 4:{d.floatData=s.float();break}case 5:{d.contents=p.proto.ContextInfo.DataSharingContext.Parameters.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ContextInfo.DataSharingContext.Parameters)return s;var g=new p.proto.ContextInfo.DataSharingContext.Parameters;if(s.key!=null&&(g.key=String(s.key)),s.stringData!=null&&(g.stringData=String(s.stringData)),s.intData!=null&&(l.Long?(g.intData=l.Long.fromValue(s.intData)).unsigned=!1:typeof s.intData=="string"?g.intData=parseInt(s.intData,10):typeof s.intData=="number"?g.intData=s.intData:typeof s.intData=="object"&&(g.intData=new l.LongBits(s.intData.low>>>0,s.intData.high>>>0).toNumber())),s.floatData!=null&&(g.floatData=Number(s.floatData)),s.contents!=null){if(typeof s.contents!="object")throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected");g.contents=p.proto.ContextInfo.DataSharingContext.Parameters.fromObject(s.contents)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.key!=null&&s.hasOwnProperty("key")&&(c.key=s.key,g.oneofs&&(c._key="key")),s.stringData!=null&&s.hasOwnProperty("stringData")&&(c.stringData=s.stringData,g.oneofs&&(c._stringData="stringData")),s.intData!=null&&s.hasOwnProperty("intData")&&(typeof s.intData=="number"?c.intData=g.longs===String?String(s.intData):s.intData:c.intData=g.longs===String?ge(s.intData):g.longs===Number?ce(s.intData):s.intData,g.oneofs&&(c._intData="intData")),s.floatData!=null&&s.hasOwnProperty("floatData")&&(c.floatData=g.json&&!isFinite(s.floatData)?String(s.floatData):s.floatData,g.oneofs&&(c._floatData="floatData")),s.contents!=null&&s.hasOwnProperty("contents")&&(c.contents=p.proto.ContextInfo.DataSharingContext.Parameters.toObject(s.contents,g),g.oneofs&&(c._contents="contents")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ContextInfo.DataSharingContext.Parameters"},a})(),i})(),t.ExternalAdReplyInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.body=A.string();break}case 3:{c.mediaType=A.int32();break}case 4:{c.thumbnailUrl=A.string();break}case 5:{c.mediaUrl=A.string();break}case 6:{c.thumbnail=A.bytes();break}case 7:{c.sourceType=A.string();break}case 8:{c.sourceId=A.string();break}case 9:{c.sourceUrl=A.string();break}case 10:{c.containsAutoReply=A.bool();break}case 11:{c.renderLargerThumbnail=A.bool();break}case 12:{c.showAdAttribution=A.bool();break}case 13:{c.ctwaClid=A.string();break}case 14:{c.ref=A.string();break}case 15:{c.clickToWhatsappCall=A.bool();break}case 16:{c.adContextPreviewDismissed=A.bool();break}case 17:{c.sourceApp=A.string();break}case 18:{c.automatedGreetingMessageShown=A.bool();break}case 19:{c.greetingMessageBody=A.string();break}case 20:{c.ctaPayload=A.string();break}case 21:{c.disableNudge=A.bool();break}case 22:{c.originalImageUrl=A.string();break}case 23:{c.automatedGreetingMessageCtaType=A.string();break}case 24:{c.wtwaAdFormat=A.bool();break}case 25:{c.adType=A.int32();break}case 26:{c.wtwaWebsiteUrl=A.string();break}case 27:{c.adPreviewUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.ExternalAdReplyInfo)return A;var r=new p.proto.ContextInfo.ExternalAdReplyInfo;switch(A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}switch(A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.mediaUrl!=null&&(r.mediaUrl=String(A.mediaUrl)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.sourceType!=null&&(r.sourceType=String(A.sourceType)),A.sourceId!=null&&(r.sourceId=String(A.sourceId)),A.sourceUrl!=null&&(r.sourceUrl=String(A.sourceUrl)),A.containsAutoReply!=null&&(r.containsAutoReply=!!A.containsAutoReply),A.renderLargerThumbnail!=null&&(r.renderLargerThumbnail=!!A.renderLargerThumbnail),A.showAdAttribution!=null&&(r.showAdAttribution=!!A.showAdAttribution),A.ctwaClid!=null&&(r.ctwaClid=String(A.ctwaClid)),A.ref!=null&&(r.ref=String(A.ref)),A.clickToWhatsappCall!=null&&(r.clickToWhatsappCall=!!A.clickToWhatsappCall),A.adContextPreviewDismissed!=null&&(r.adContextPreviewDismissed=!!A.adContextPreviewDismissed),A.sourceApp!=null&&(r.sourceApp=String(A.sourceApp)),A.automatedGreetingMessageShown!=null&&(r.automatedGreetingMessageShown=!!A.automatedGreetingMessageShown),A.greetingMessageBody!=null&&(r.greetingMessageBody=String(A.greetingMessageBody)),A.ctaPayload!=null&&(r.ctaPayload=String(A.ctaPayload)),A.disableNudge!=null&&(r.disableNudge=!!A.disableNudge),A.originalImageUrl!=null&&(r.originalImageUrl=String(A.originalImageUrl)),A.automatedGreetingMessageCtaType!=null&&(r.automatedGreetingMessageCtaType=String(A.automatedGreetingMessageCtaType)),A.wtwaAdFormat!=null&&(r.wtwaAdFormat=!!A.wtwaAdFormat),A.adType){default:if(typeof A.adType=="number"){r.adType=A.adType;break}break;case"CTWA":case 0:r.adType=0;break;case"CAWC":case 1:r.adType=1;break}return A.wtwaWebsiteUrl!=null&&(r.wtwaWebsiteUrl=String(A.wtwaWebsiteUrl)),A.adPreviewUrl!=null&&(r.adPreviewUrl=String(A.adPreviewUrl)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?p.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.mediaUrl!=null&&A.hasOwnProperty("mediaUrl")&&(s.mediaUrl=A.mediaUrl,r.oneofs&&(s._mediaUrl="mediaUrl")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.sourceType!=null&&A.hasOwnProperty("sourceType")&&(s.sourceType=A.sourceType,r.oneofs&&(s._sourceType="sourceType")),A.sourceId!=null&&A.hasOwnProperty("sourceId")&&(s.sourceId=A.sourceId,r.oneofs&&(s._sourceId="sourceId")),A.sourceUrl!=null&&A.hasOwnProperty("sourceUrl")&&(s.sourceUrl=A.sourceUrl,r.oneofs&&(s._sourceUrl="sourceUrl")),A.containsAutoReply!=null&&A.hasOwnProperty("containsAutoReply")&&(s.containsAutoReply=A.containsAutoReply,r.oneofs&&(s._containsAutoReply="containsAutoReply")),A.renderLargerThumbnail!=null&&A.hasOwnProperty("renderLargerThumbnail")&&(s.renderLargerThumbnail=A.renderLargerThumbnail,r.oneofs&&(s._renderLargerThumbnail="renderLargerThumbnail")),A.showAdAttribution!=null&&A.hasOwnProperty("showAdAttribution")&&(s.showAdAttribution=A.showAdAttribution,r.oneofs&&(s._showAdAttribution="showAdAttribution")),A.ctwaClid!=null&&A.hasOwnProperty("ctwaClid")&&(s.ctwaClid=A.ctwaClid,r.oneofs&&(s._ctwaClid="ctwaClid")),A.ref!=null&&A.hasOwnProperty("ref")&&(s.ref=A.ref,r.oneofs&&(s._ref="ref")),A.clickToWhatsappCall!=null&&A.hasOwnProperty("clickToWhatsappCall")&&(s.clickToWhatsappCall=A.clickToWhatsappCall,r.oneofs&&(s._clickToWhatsappCall="clickToWhatsappCall")),A.adContextPreviewDismissed!=null&&A.hasOwnProperty("adContextPreviewDismissed")&&(s.adContextPreviewDismissed=A.adContextPreviewDismissed,r.oneofs&&(s._adContextPreviewDismissed="adContextPreviewDismissed")),A.sourceApp!=null&&A.hasOwnProperty("sourceApp")&&(s.sourceApp=A.sourceApp,r.oneofs&&(s._sourceApp="sourceApp")),A.automatedGreetingMessageShown!=null&&A.hasOwnProperty("automatedGreetingMessageShown")&&(s.automatedGreetingMessageShown=A.automatedGreetingMessageShown,r.oneofs&&(s._automatedGreetingMessageShown="automatedGreetingMessageShown")),A.greetingMessageBody!=null&&A.hasOwnProperty("greetingMessageBody")&&(s.greetingMessageBody=A.greetingMessageBody,r.oneofs&&(s._greetingMessageBody="greetingMessageBody")),A.ctaPayload!=null&&A.hasOwnProperty("ctaPayload")&&(s.ctaPayload=A.ctaPayload,r.oneofs&&(s._ctaPayload="ctaPayload")),A.disableNudge!=null&&A.hasOwnProperty("disableNudge")&&(s.disableNudge=A.disableNudge,r.oneofs&&(s._disableNudge="disableNudge")),A.originalImageUrl!=null&&A.hasOwnProperty("originalImageUrl")&&(s.originalImageUrl=A.originalImageUrl,r.oneofs&&(s._originalImageUrl="originalImageUrl")),A.automatedGreetingMessageCtaType!=null&&A.hasOwnProperty("automatedGreetingMessageCtaType")&&(s.automatedGreetingMessageCtaType=A.automatedGreetingMessageCtaType,r.oneofs&&(s._automatedGreetingMessageCtaType="automatedGreetingMessageCtaType")),A.wtwaAdFormat!=null&&A.hasOwnProperty("wtwaAdFormat")&&(s.wtwaAdFormat=A.wtwaAdFormat,r.oneofs&&(s._wtwaAdFormat="wtwaAdFormat")),A.adType!=null&&A.hasOwnProperty("adType")&&(s.adType=r.enums===String?p.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]===void 0?A.adType:p.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]:A.adType,r.oneofs&&(s._adType="adType")),A.wtwaWebsiteUrl!=null&&A.hasOwnProperty("wtwaWebsiteUrl")&&(s.wtwaWebsiteUrl=A.wtwaWebsiteUrl,r.oneofs&&(s._wtwaWebsiteUrl="wtwaWebsiteUrl")),A.adPreviewUrl!=null&&A.hasOwnProperty("adPreviewUrl")&&(s.adPreviewUrl=A.adPreviewUrl,r.oneofs&&(s._adPreviewUrl="adPreviewUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ExternalAdReplyInfo"},i.AdType=(function(){let a={},A=Object.create(a);return A[a[0]="CTWA"]=0,A[a[1]="CAWC"]=1,A})(),i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="IMAGE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.FeatureEligibilities=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.cannotBeReactedTo=A.bool();break}case 2:{c.cannotBeRanked=A.bool();break}case 3:{c.canRequestFeedback=A.bool();break}case 4:{c.canBeReshared=A.bool();break}case 5:{c.canReceiveMultiReact=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.FeatureEligibilities)return A;var r=new p.proto.ContextInfo.FeatureEligibilities;return A.cannotBeReactedTo!=null&&(r.cannotBeReactedTo=!!A.cannotBeReactedTo),A.cannotBeRanked!=null&&(r.cannotBeRanked=!!A.cannotBeRanked),A.canRequestFeedback!=null&&(r.canRequestFeedback=!!A.canRequestFeedback),A.canBeReshared!=null&&(r.canBeReshared=!!A.canBeReshared),A.canReceiveMultiReact!=null&&(r.canReceiveMultiReact=!!A.canReceiveMultiReact),r},i.toObject=function(A,r){r||(r={});var s={};return A.cannotBeReactedTo!=null&&A.hasOwnProperty("cannotBeReactedTo")&&(s.cannotBeReactedTo=A.cannotBeReactedTo,r.oneofs&&(s._cannotBeReactedTo="cannotBeReactedTo")),A.cannotBeRanked!=null&&A.hasOwnProperty("cannotBeRanked")&&(s.cannotBeRanked=A.cannotBeRanked,r.oneofs&&(s._cannotBeRanked="cannotBeRanked")),A.canRequestFeedback!=null&&A.hasOwnProperty("canRequestFeedback")&&(s.canRequestFeedback=A.canRequestFeedback,r.oneofs&&(s._canRequestFeedback="canRequestFeedback")),A.canBeReshared!=null&&A.hasOwnProperty("canBeReshared")&&(s.canBeReshared=A.canBeReshared,r.oneofs&&(s._canBeReshared="canBeReshared")),A.canReceiveMultiReact!=null&&A.hasOwnProperty("canReceiveMultiReact")&&(s.canReceiveMultiReact=A.canReceiveMultiReact,r.oneofs&&(s._canReceiveMultiReact="canReceiveMultiReact")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.FeatureEligibilities"},i})(),t.ForwardOrigin=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT"]=1,e[i[2]="STATUS"]=2,e[i[3]="CHANNELS"]=3,e[i[4]="META_AI"]=4,e[i[5]="UGC"]=5,e})(),t.ForwardedNewsletterMessageInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.serverMessageId=A.int32();break}case 3:{c.newsletterName=A.string();break}case 4:{c.contentType=A.int32();break}case 5:{c.accessibilityText=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.ForwardedNewsletterMessageInfo)return A;var r=new p.proto.ContextInfo.ForwardedNewsletterMessageInfo;switch(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.serverMessageId!=null&&(r.serverMessageId=A.serverMessageId|0),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.contentType){default:if(typeof A.contentType=="number"){r.contentType=A.contentType;break}break;case"UPDATE":case 1:r.contentType=1;break;case"UPDATE_CARD":case 2:r.contentType=2;break;case"LINK_CARD":case 3:r.contentType=3;break}return A.accessibilityText!=null&&(r.accessibilityText=String(A.accessibilityText)),r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.serverMessageId!=null&&A.hasOwnProperty("serverMessageId")&&(s.serverMessageId=A.serverMessageId,r.oneofs&&(s._serverMessageId="serverMessageId")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.contentType!=null&&A.hasOwnProperty("contentType")&&(s.contentType=r.enums===String?p.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]===void 0?A.contentType:p.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]:A.contentType,r.oneofs&&(s._contentType="contentType")),A.accessibilityText!=null&&A.hasOwnProperty("accessibilityText")&&(s.accessibilityText=A.accessibilityText,r.oneofs&&(s._accessibilityText="accessibilityText")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ForwardedNewsletterMessageInfo"},i.ContentType=(function(){let a={},A=Object.create(a);return A[a[1]="UPDATE"]=1,A[a[2]="UPDATE_CARD"]=2,A[a[3]="LINK_CARD"]=3,A})(),i})(),t.PairedMediaType=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_PAIRED_MEDIA"]=0,e[i[1]="SD_VIDEO_PARENT"]=1,e[i[2]="HD_VIDEO_CHILD"]=2,e[i[3]="SD_IMAGE_PARENT"]=3,e[i[4]="HD_IMAGE_CHILD"]=4,e[i[5]="MOTION_PHOTO_PARENT"]=5,e[i[6]="MOTION_PHOTO_CHILD"]=6,e[i[7]="HEVC_VIDEO_PARENT"]=7,e[i[8]="HEVC_VIDEO_CHILD"]=8,e})(),t.QuestionReplyQuotedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serverQuestionId=A.int32();break}case 2:{c.quotedQuestion=p.proto.Message.decode(A,A.uint32());break}case 3:{c.quotedResponse=p.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.QuestionReplyQuotedMessage)return A;var r=new p.proto.ContextInfo.QuestionReplyQuotedMessage;if(A.serverQuestionId!=null&&(r.serverQuestionId=A.serverQuestionId|0),A.quotedQuestion!=null){if(typeof A.quotedQuestion!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedQuestion: object expected");r.quotedQuestion=p.proto.Message.fromObject(A.quotedQuestion)}if(A.quotedResponse!=null){if(typeof A.quotedResponse!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedResponse: object expected");r.quotedResponse=p.proto.Message.fromObject(A.quotedResponse)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.serverQuestionId!=null&&A.hasOwnProperty("serverQuestionId")&&(s.serverQuestionId=A.serverQuestionId,r.oneofs&&(s._serverQuestionId="serverQuestionId")),A.quotedQuestion!=null&&A.hasOwnProperty("quotedQuestion")&&(s.quotedQuestion=p.proto.Message.toObject(A.quotedQuestion,r),r.oneofs&&(s._quotedQuestion="quotedQuestion")),A.quotedResponse!=null&&A.hasOwnProperty("quotedResponse")&&(s.quotedResponse=p.proto.Message.toObject(A.quotedResponse,r),r.oneofs&&(s._quotedResponse="quotedResponse")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.QuestionReplyQuotedMessage"},i})(),t.QuotedType=(function(){let i={},e=Object.create(i);return e[i[0]="EXPLICIT"]=0,e[i[1]="AUTO"]=1,e})(),t.StatusAttributionType=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="RESHARED_FROM_MENTION"]=1,e[i[2]="RESHARED_FROM_POST"]=2,e[i[3]="RESHARED_FROM_POST_MANY_TIMES"]=3,e[i[4]="FORWARDED_FROM_STATUS"]=4,e})(),t.StatusAudienceMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.audienceType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.StatusAudienceMetadata)return A;var r=new p.proto.ContextInfo.StatusAudienceMetadata;switch(A.audienceType){default:if(typeof A.audienceType=="number"){r.audienceType=A.audienceType;break}break;case"UNKNOWN":case 0:r.audienceType=0;break;case"CLOSE_FRIENDS":case 1:r.audienceType=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.audienceType!=null&&A.hasOwnProperty("audienceType")&&(s.audienceType=r.enums===String?p.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]===void 0?A.audienceType:p.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]:A.audienceType,r.oneofs&&(s._audienceType="audienceType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.StatusAudienceMetadata"},i.AudienceType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CLOSE_FRIENDS"]=1,A})(),i})(),t.StatusSourceType=(function(){let i={},e=Object.create(i);return e[i[0]="IMAGE"]=0,e[i[1]="VIDEO"]=1,e[i[2]="GIF"]=2,e[i[3]="AUDIO"]=3,e[i[4]="TEXT"]=4,e[i[5]="MUSIC_STANDALONE"]=5,e})(),t.UTMInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.utmSource=A.string();break}case 2:{c.utmCampaign=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.UTMInfo)return A;var r=new p.proto.ContextInfo.UTMInfo;return A.utmSource!=null&&(r.utmSource=String(A.utmSource)),A.utmCampaign!=null&&(r.utmCampaign=String(A.utmCampaign)),r},i.toObject=function(A,r){r||(r={});var s={};return A.utmSource!=null&&A.hasOwnProperty("utmSource")&&(s.utmSource=A.utmSource,r.oneofs&&(s._utmSource="utmSource")),A.utmCampaign!=null&&A.hasOwnProperty("utmCampaign")&&(s.utmCampaign=A.utmCampaign,r.oneofs&&(s._utmCampaign="utmCampaign")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.UTMInfo"},i})(),t})(),n.Conversation=(function(){function t(i){if(this.messages=[],this.participant=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.messages&&s.messages.length||(s.messages=[]),s.messages.push(p.proto.HistorySyncMsg.decode(e,e.uint32()));break}case 3:{s.newJid=e.string();break}case 4:{s.oldJid=e.string();break}case 5:{s.lastMsgTimestamp=e.uint64();break}case 6:{s.unreadCount=e.uint32();break}case 7:{s.readOnly=e.bool();break}case 8:{s.endOfHistoryTransfer=e.bool();break}case 9:{s.ephemeralExpiration=e.uint32();break}case 10:{s.ephemeralSettingTimestamp=e.int64();break}case 11:{s.endOfHistoryTransferType=e.int32();break}case 12:{s.conversationTimestamp=e.uint64();break}case 13:{s.name=e.string();break}case 14:{s.pHash=e.string();break}case 15:{s.notSpam=e.bool();break}case 16:{s.archived=e.bool();break}case 17:{s.disappearingMode=p.proto.DisappearingMode.decode(e,e.uint32());break}case 18:{s.unreadMentionCount=e.uint32();break}case 19:{s.markedAsUnread=e.bool();break}case 20:{s.participant&&s.participant.length||(s.participant=[]),s.participant.push(p.proto.GroupParticipant.decode(e,e.uint32()));break}case 21:{s.tcToken=e.bytes();break}case 22:{s.tcTokenTimestamp=e.uint64();break}case 23:{s.contactPrimaryIdentityKey=e.bytes();break}case 24:{s.pinned=e.uint32();break}case 25:{s.muteEndTime=e.uint64();break}case 26:{s.wallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 27:{s.mediaVisibility=e.int32();break}case 28:{s.tcTokenSenderTimestamp=e.uint64();break}case 29:{s.suspended=e.bool();break}case 30:{s.terminated=e.bool();break}case 31:{s.createdAt=e.uint64();break}case 32:{s.createdBy=e.string();break}case 33:{s.description=e.string();break}case 34:{s.support=e.bool();break}case 35:{s.isParentGroup=e.bool();break}case 37:{s.parentGroupId=e.string();break}case 36:{s.isDefaultSubgroup=e.bool();break}case 38:{s.displayName=e.string();break}case 39:{s.pnJid=e.string();break}case 40:{s.shareOwnPn=e.bool();break}case 41:{s.pnhDuplicateLidThread=e.bool();break}case 42:{s.lidJid=e.string();break}case 43:{s.username=e.string();break}case 44:{s.lidOriginType=e.string();break}case 45:{s.commentsCount=e.uint32();break}case 46:{s.locked=e.bool();break}case 47:{s.systemMessageToInsert=e.int32();break}case 48:{s.capiCreatedGroup=e.bool();break}case 49:{s.accountLid=e.string();break}case 50:{s.limitSharing=e.bool();break}case 51:{s.limitSharingSettingTimestamp=e.int64();break}case 52:{s.limitSharingTrigger=e.int32();break}case 53:{s.limitSharingInitiatedByMe=e.bool();break}case 54:{s.maibaAiThreadEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Conversation)return e;var a=new p.proto.Conversation;if(e.id!=null&&(a.id=String(e.id)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".proto.Conversation.messages: array expected");a.messages=[];for(var A=0;A>>0,e.lastMsgTimestamp.high>>>0).toNumber(!0))),e.unreadCount!=null&&(a.unreadCount=e.unreadCount>>>0),e.readOnly!=null&&(a.readOnly=!!e.readOnly),e.endOfHistoryTransfer!=null&&(a.endOfHistoryTransfer=!!e.endOfHistoryTransfer),e.ephemeralExpiration!=null&&(a.ephemeralExpiration=e.ephemeralExpiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(a.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?a.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(a.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.endOfHistoryTransferType){default:if(typeof e.endOfHistoryTransferType=="number"){a.endOfHistoryTransferType=e.endOfHistoryTransferType;break}break;case"COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY":case 0:a.endOfHistoryTransferType=0;break;case"COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY":case 1:a.endOfHistoryTransferType=1;break;case"COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY":case 2:a.endOfHistoryTransferType=2;break}if(e.conversationTimestamp!=null&&(l.Long?(a.conversationTimestamp=l.Long.fromValue(e.conversationTimestamp)).unsigned=!0:typeof e.conversationTimestamp=="string"?a.conversationTimestamp=parseInt(e.conversationTimestamp,10):typeof e.conversationTimestamp=="number"?a.conversationTimestamp=e.conversationTimestamp:typeof e.conversationTimestamp=="object"&&(a.conversationTimestamp=new l.LongBits(e.conversationTimestamp.low>>>0,e.conversationTimestamp.high>>>0).toNumber(!0))),e.name!=null&&(a.name=String(e.name)),e.pHash!=null&&(a.pHash=String(e.pHash)),e.notSpam!=null&&(a.notSpam=!!e.notSpam),e.archived!=null&&(a.archived=!!e.archived),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.Conversation.disappearingMode: object expected");a.disappearingMode=p.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.unreadMentionCount!=null&&(a.unreadMentionCount=e.unreadMentionCount>>>0),e.markedAsUnread!=null&&(a.markedAsUnread=!!e.markedAsUnread),e.participant){if(!Array.isArray(e.participant))throw TypeError(".proto.Conversation.participant: array expected");a.participant=[];for(var A=0;A=0&&(a.tcToken=e.tcToken)),e.tcTokenTimestamp!=null&&(l.Long?(a.tcTokenTimestamp=l.Long.fromValue(e.tcTokenTimestamp)).unsigned=!0:typeof e.tcTokenTimestamp=="string"?a.tcTokenTimestamp=parseInt(e.tcTokenTimestamp,10):typeof e.tcTokenTimestamp=="number"?a.tcTokenTimestamp=e.tcTokenTimestamp:typeof e.tcTokenTimestamp=="object"&&(a.tcTokenTimestamp=new l.LongBits(e.tcTokenTimestamp.low>>>0,e.tcTokenTimestamp.high>>>0).toNumber(!0))),e.contactPrimaryIdentityKey!=null&&(typeof e.contactPrimaryIdentityKey=="string"?l.base64.decode(e.contactPrimaryIdentityKey,a.contactPrimaryIdentityKey=l.newBuffer(l.base64.length(e.contactPrimaryIdentityKey)),0):e.contactPrimaryIdentityKey.length>=0&&(a.contactPrimaryIdentityKey=e.contactPrimaryIdentityKey)),e.pinned!=null&&(a.pinned=e.pinned>>>0),e.muteEndTime!=null&&(l.Long?(a.muteEndTime=l.Long.fromValue(e.muteEndTime)).unsigned=!0:typeof e.muteEndTime=="string"?a.muteEndTime=parseInt(e.muteEndTime,10):typeof e.muteEndTime=="number"?a.muteEndTime=e.muteEndTime:typeof e.muteEndTime=="object"&&(a.muteEndTime=new l.LongBits(e.muteEndTime.low>>>0,e.muteEndTime.high>>>0).toNumber(!0))),e.wallpaper!=null){if(typeof e.wallpaper!="object")throw TypeError(".proto.Conversation.wallpaper: object expected");a.wallpaper=p.proto.WallpaperSettings.fromObject(e.wallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){a.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:a.mediaVisibility=0;break;case"OFF":case 1:a.mediaVisibility=1;break;case"ON":case 2:a.mediaVisibility=2;break}switch(e.tcTokenSenderTimestamp!=null&&(l.Long?(a.tcTokenSenderTimestamp=l.Long.fromValue(e.tcTokenSenderTimestamp)).unsigned=!0:typeof e.tcTokenSenderTimestamp=="string"?a.tcTokenSenderTimestamp=parseInt(e.tcTokenSenderTimestamp,10):typeof e.tcTokenSenderTimestamp=="number"?a.tcTokenSenderTimestamp=e.tcTokenSenderTimestamp:typeof e.tcTokenSenderTimestamp=="object"&&(a.tcTokenSenderTimestamp=new l.LongBits(e.tcTokenSenderTimestamp.low>>>0,e.tcTokenSenderTimestamp.high>>>0).toNumber(!0))),e.suspended!=null&&(a.suspended=!!e.suspended),e.terminated!=null&&(a.terminated=!!e.terminated),e.createdAt!=null&&(l.Long?(a.createdAt=l.Long.fromValue(e.createdAt)).unsigned=!0:typeof e.createdAt=="string"?a.createdAt=parseInt(e.createdAt,10):typeof e.createdAt=="number"?a.createdAt=e.createdAt:typeof e.createdAt=="object"&&(a.createdAt=new l.LongBits(e.createdAt.low>>>0,e.createdAt.high>>>0).toNumber(!0))),e.createdBy!=null&&(a.createdBy=String(e.createdBy)),e.description!=null&&(a.description=String(e.description)),e.support!=null&&(a.support=!!e.support),e.isParentGroup!=null&&(a.isParentGroup=!!e.isParentGroup),e.parentGroupId!=null&&(a.parentGroupId=String(e.parentGroupId)),e.isDefaultSubgroup!=null&&(a.isDefaultSubgroup=!!e.isDefaultSubgroup),e.displayName!=null&&(a.displayName=String(e.displayName)),e.pnJid!=null&&(a.pnJid=String(e.pnJid)),e.shareOwnPn!=null&&(a.shareOwnPn=!!e.shareOwnPn),e.pnhDuplicateLidThread!=null&&(a.pnhDuplicateLidThread=!!e.pnhDuplicateLidThread),e.lidJid!=null&&(a.lidJid=String(e.lidJid)),e.username!=null&&(a.username=String(e.username)),e.lidOriginType!=null&&(a.lidOriginType=String(e.lidOriginType)),e.commentsCount!=null&&(a.commentsCount=e.commentsCount>>>0),e.locked!=null&&(a.locked=!!e.locked),e.systemMessageToInsert){default:if(typeof e.systemMessageToInsert=="number"){a.systemMessageToInsert=e.systemMessageToInsert;break}break;case"E2EE_MSG":case 1:a.systemMessageToInsert=1;break;case"NE2EE_SELF":case 2:a.systemMessageToInsert=2;break;case"NE2EE_OTHER":case 3:a.systemMessageToInsert=3;break}switch(e.capiCreatedGroup!=null&&(a.capiCreatedGroup=!!e.capiCreatedGroup),e.accountLid!=null&&(a.accountLid=String(e.accountLid)),e.limitSharing!=null&&(a.limitSharing=!!e.limitSharing),e.limitSharingSettingTimestamp!=null&&(l.Long?(a.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?a.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?a.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(a.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.limitSharingTrigger){default:if(typeof e.limitSharingTrigger=="number"){a.limitSharingTrigger=e.limitSharingTrigger;break}break;case"UNKNOWN":case 0:a.limitSharingTrigger=0;break;case"CHAT_SETTING":case 1:a.limitSharingTrigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:a.limitSharingTrigger=2;break;case"UNKNOWN_GROUP":case 3:a.limitSharingTrigger=3;break}return e.limitSharingInitiatedByMe!=null&&(a.limitSharingInitiatedByMe=!!e.limitSharingInitiatedByMe),e.maibaAiThreadEnabled!=null&&(a.maibaAiThreadEnabled=!!e.maibaAiThreadEnabled),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.messages=[],A.participant=[]),a.defaults&&(A.id=""),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id),e.messages&&e.messages.length){A.messages=[];for(var r=0;r>>3){case 1:{s.chatLockSupportLevel=e.int32();break}case 2:{s.lidMigration=p.proto.DeviceCapabilities.LIDMigration.decode(e,e.uint32());break}case 3:{s.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.decode(e,e.uint32());break}case 4:{s.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.decode(e,e.uint32());break}case 5:{s.memberNameTagPrimarySupport=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DeviceCapabilities)return e;var a=new p.proto.DeviceCapabilities;switch(e.chatLockSupportLevel){default:if(typeof e.chatLockSupportLevel=="number"){a.chatLockSupportLevel=e.chatLockSupportLevel;break}break;case"NONE":case 0:a.chatLockSupportLevel=0;break;case"MINIMAL":case 1:a.chatLockSupportLevel=1;break;case"FULL":case 2:a.chatLockSupportLevel=2;break}if(e.lidMigration!=null){if(typeof e.lidMigration!="object")throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");a.lidMigration=p.proto.DeviceCapabilities.LIDMigration.fromObject(e.lidMigration)}if(e.businessBroadcast!=null){if(typeof e.businessBroadcast!="object")throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");a.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.fromObject(e.businessBroadcast)}if(e.userHasAvatar!=null){if(typeof e.userHasAvatar!="object")throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");a.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.fromObject(e.userHasAvatar)}switch(e.memberNameTagPrimarySupport){default:if(typeof e.memberNameTagPrimarySupport=="number"){a.memberNameTagPrimarySupport=e.memberNameTagPrimarySupport;break}break;case"DISABLED":case 0:a.memberNameTagPrimarySupport=0;break;case"RECEIVER_ENABLED":case 1:a.memberNameTagPrimarySupport=1;break;case"SENDER_ENABLED":case 2:a.memberNameTagPrimarySupport=2;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.chatLockSupportLevel!=null&&e.hasOwnProperty("chatLockSupportLevel")&&(A.chatLockSupportLevel=a.enums===String?p.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]===void 0?e.chatLockSupportLevel:p.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]:e.chatLockSupportLevel,a.oneofs&&(A._chatLockSupportLevel="chatLockSupportLevel")),e.lidMigration!=null&&e.hasOwnProperty("lidMigration")&&(A.lidMigration=p.proto.DeviceCapabilities.LIDMigration.toObject(e.lidMigration,a),a.oneofs&&(A._lidMigration="lidMigration")),e.businessBroadcast!=null&&e.hasOwnProperty("businessBroadcast")&&(A.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.toObject(e.businessBroadcast,a),a.oneofs&&(A._businessBroadcast="businessBroadcast")),e.userHasAvatar!=null&&e.hasOwnProperty("userHasAvatar")&&(A.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.toObject(e.userHasAvatar,a),a.oneofs&&(A._userHasAvatar="userHasAvatar")),e.memberNameTagPrimarySupport!=null&&e.hasOwnProperty("memberNameTagPrimarySupport")&&(A.memberNameTagPrimarySupport=a.enums===String?p.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]===void 0?e.memberNameTagPrimarySupport:p.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]:e.memberNameTagPrimarySupport,a.oneofs&&(A._memberNameTagPrimarySupport="memberNameTagPrimarySupport")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceCapabilities"},t.BusinessBroadcast=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.importListEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.BusinessBroadcast)return A;var r=new p.proto.DeviceCapabilities.BusinessBroadcast;return A.importListEnabled!=null&&(r.importListEnabled=!!A.importListEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.importListEnabled!=null&&A.hasOwnProperty("importListEnabled")&&(s.importListEnabled=A.importListEnabled,r.oneofs&&(s._importListEnabled="importListEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.BusinessBroadcast"},i})(),t.ChatLockSupportLevel=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="MINIMAL"]=1,e[i[2]="FULL"]=2,e})(),t.LIDMigration=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.chatDbMigrationTimestamp=A.uint64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.LIDMigration)return A;var r=new p.proto.DeviceCapabilities.LIDMigration;return A.chatDbMigrationTimestamp!=null&&(l.Long?(r.chatDbMigrationTimestamp=l.Long.fromValue(A.chatDbMigrationTimestamp)).unsigned=!0:typeof A.chatDbMigrationTimestamp=="string"?r.chatDbMigrationTimestamp=parseInt(A.chatDbMigrationTimestamp,10):typeof A.chatDbMigrationTimestamp=="number"?r.chatDbMigrationTimestamp=A.chatDbMigrationTimestamp:typeof A.chatDbMigrationTimestamp=="object"&&(r.chatDbMigrationTimestamp=new l.LongBits(A.chatDbMigrationTimestamp.low>>>0,A.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),r},i.toObject=function(A,r){r||(r={});var s={};return A.chatDbMigrationTimestamp!=null&&A.hasOwnProperty("chatDbMigrationTimestamp")&&(typeof A.chatDbMigrationTimestamp=="number"?s.chatDbMigrationTimestamp=r.longs===String?String(A.chatDbMigrationTimestamp):A.chatDbMigrationTimestamp:s.chatDbMigrationTimestamp=r.longs===String?ge(A.chatDbMigrationTimestamp,!0):r.longs===Number?ce(A.chatDbMigrationTimestamp,!0):A.chatDbMigrationTimestamp,r.oneofs&&(s._chatDbMigrationTimestamp="chatDbMigrationTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.LIDMigration"},i})(),t.MemberNameTagPrimarySupport=(function(){let i={},e=Object.create(i);return e[i[0]="DISABLED"]=0,e[i[1]="RECEIVER_ENABLED"]=1,e[i[2]="SENDER_ENABLED"]=2,e})(),t.UserHasAvatar=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.userHasAvatar=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.UserHasAvatar)return A;var r=new p.proto.DeviceCapabilities.UserHasAvatar;return A.userHasAvatar!=null&&(r.userHasAvatar=!!A.userHasAvatar),r},i.toObject=function(A,r){r||(r={});var s={};return A.userHasAvatar!=null&&A.hasOwnProperty("userHasAvatar")&&(s.userHasAvatar=A.userHasAvatar,r.oneofs&&(s._userHasAvatar="userHasAvatar")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.UserHasAvatar"},i})(),t})(),n.DeviceConsistencyCodeMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.generation=e.uint32();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DeviceConsistencyCodeMessage)return e;var a=new p.proto.DeviceConsistencyCodeMessage;return e.generation!=null&&(a.generation=e.generation>>>0),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.generation!=null&&e.hasOwnProperty("generation")&&(A.generation=e.generation,a.oneofs&&(A._generation="generation")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceConsistencyCodeMessage"},t})(),n.DeviceListMetadata=(function(){function t(i){if(this.senderKeyIndexes=[],this.recipientKeyIndexes=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.senderKeyHash=e.bytes();break}case 2:{s.senderTimestamp=e.uint64();break}case 3:{if(s.senderKeyIndexes&&s.senderKeyIndexes.length||(s.senderKeyIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos=0&&(a.senderKeyHash=e.senderKeyHash)),e.senderTimestamp!=null&&(l.Long?(a.senderTimestamp=l.Long.fromValue(e.senderTimestamp)).unsigned=!0:typeof e.senderTimestamp=="string"?a.senderTimestamp=parseInt(e.senderTimestamp,10):typeof e.senderTimestamp=="number"?a.senderTimestamp=e.senderTimestamp:typeof e.senderTimestamp=="object"&&(a.senderTimestamp=new l.LongBits(e.senderTimestamp.low>>>0,e.senderTimestamp.high>>>0).toNumber(!0))),e.senderKeyIndexes){if(!Array.isArray(e.senderKeyIndexes))throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected");a.senderKeyIndexes=[];for(var A=0;A>>0}switch(e.senderAccountType){default:if(typeof e.senderAccountType=="number"){a.senderAccountType=e.senderAccountType;break}break;case"E2EE":case 0:a.senderAccountType=0;break;case"HOSTED":case 1:a.senderAccountType=1;break}switch(e.receiverAccountType){default:if(typeof e.receiverAccountType=="number"){a.receiverAccountType=e.receiverAccountType;break}break;case"E2EE":case 0:a.receiverAccountType=0;break;case"HOSTED":case 1:a.receiverAccountType=1;break}if(e.recipientKeyHash!=null&&(typeof e.recipientKeyHash=="string"?l.base64.decode(e.recipientKeyHash,a.recipientKeyHash=l.newBuffer(l.base64.length(e.recipientKeyHash)),0):e.recipientKeyHash.length>=0&&(a.recipientKeyHash=e.recipientKeyHash)),e.recipientTimestamp!=null&&(l.Long?(a.recipientTimestamp=l.Long.fromValue(e.recipientTimestamp)).unsigned=!0:typeof e.recipientTimestamp=="string"?a.recipientTimestamp=parseInt(e.recipientTimestamp,10):typeof e.recipientTimestamp=="number"?a.recipientTimestamp=e.recipientTimestamp:typeof e.recipientTimestamp=="object"&&(a.recipientTimestamp=new l.LongBits(e.recipientTimestamp.low>>>0,e.recipientTimestamp.high>>>0).toNumber(!0))),e.recipientKeyIndexes){if(!Array.isArray(e.recipientKeyIndexes))throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected");a.recipientKeyIndexes=[];for(var A=0;A>>0}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.senderKeyIndexes=[],A.recipientKeyIndexes=[]),e.senderKeyHash!=null&&e.hasOwnProperty("senderKeyHash")&&(A.senderKeyHash=a.bytes===String?l.base64.encode(e.senderKeyHash,0,e.senderKeyHash.length):a.bytes===Array?Array.prototype.slice.call(e.senderKeyHash):e.senderKeyHash,a.oneofs&&(A._senderKeyHash="senderKeyHash")),e.senderTimestamp!=null&&e.hasOwnProperty("senderTimestamp")&&(typeof e.senderTimestamp=="number"?A.senderTimestamp=a.longs===String?String(e.senderTimestamp):e.senderTimestamp:A.senderTimestamp=a.longs===String?ge(e.senderTimestamp,!0):a.longs===Number?ce(e.senderTimestamp,!0):e.senderTimestamp,a.oneofs&&(A._senderTimestamp="senderTimestamp")),e.senderKeyIndexes&&e.senderKeyIndexes.length){A.senderKeyIndexes=[];for(var r=0;r>>3){case 1:{s.os=e.string();break}case 2:{s.version=p.proto.DeviceProps.AppVersion.decode(e,e.uint32());break}case 3:{s.platformType=e.int32();break}case 4:{s.requireFullSync=e.bool();break}case 5:{s.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DeviceProps)return e;var a=new p.proto.DeviceProps;if(e.os!=null&&(a.os=String(e.os)),e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.DeviceProps.version: object expected");a.version=p.proto.DeviceProps.AppVersion.fromObject(e.version)}switch(e.platformType){default:if(typeof e.platformType=="number"){a.platformType=e.platformType;break}break;case"UNKNOWN":case 0:a.platformType=0;break;case"CHROME":case 1:a.platformType=1;break;case"FIREFOX":case 2:a.platformType=2;break;case"IE":case 3:a.platformType=3;break;case"OPERA":case 4:a.platformType=4;break;case"SAFARI":case 5:a.platformType=5;break;case"EDGE":case 6:a.platformType=6;break;case"DESKTOP":case 7:a.platformType=7;break;case"IPAD":case 8:a.platformType=8;break;case"ANDROID_TABLET":case 9:a.platformType=9;break;case"OHANA":case 10:a.platformType=10;break;case"ALOHA":case 11:a.platformType=11;break;case"CATALINA":case 12:a.platformType=12;break;case"TCL_TV":case 13:a.platformType=13;break;case"IOS_PHONE":case 14:a.platformType=14;break;case"IOS_CATALYST":case 15:a.platformType=15;break;case"ANDROID_PHONE":case 16:a.platformType=16;break;case"ANDROID_AMBIGUOUS":case 17:a.platformType=17;break;case"WEAR_OS":case 18:a.platformType=18;break;case"AR_WRIST":case 19:a.platformType=19;break;case"AR_DEVICE":case 20:a.platformType=20;break;case"UWP":case 21:a.platformType=21;break;case"VR":case 22:a.platformType=22;break;case"CLOUD_API":case 23:a.platformType=23;break;case"SMARTGLASSES":case 24:a.platformType=24;break}if(e.requireFullSync!=null&&(a.requireFullSync=!!e.requireFullSync),e.historySyncConfig!=null){if(typeof e.historySyncConfig!="object")throw TypeError(".proto.DeviceProps.historySyncConfig: object expected");a.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.fromObject(e.historySyncConfig)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.os!=null&&e.hasOwnProperty("os")&&(A.os=e.os,a.oneofs&&(A._os="os")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.DeviceProps.AppVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.platformType!=null&&e.hasOwnProperty("platformType")&&(A.platformType=a.enums===String?p.proto.DeviceProps.PlatformType[e.platformType]===void 0?e.platformType:p.proto.DeviceProps.PlatformType[e.platformType]:e.platformType,a.oneofs&&(A._platformType="platformType")),e.requireFullSync!=null&&e.hasOwnProperty("requireFullSync")&&(A.requireFullSync=e.requireFullSync,a.oneofs&&(A._requireFullSync="requireFullSync")),e.historySyncConfig!=null&&e.hasOwnProperty("historySyncConfig")&&(A.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.toObject(e.historySyncConfig,a),a.oneofs&&(A._historySyncConfig="historySyncConfig")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceProps"},t.AppVersion=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.primary=A.uint32();break}case 2:{c.secondary=A.uint32();break}case 3:{c.tertiary=A.uint32();break}case 4:{c.quaternary=A.uint32();break}case 5:{c.quinary=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceProps.AppVersion)return A;var r=new p.proto.DeviceProps.AppVersion;return A.primary!=null&&(r.primary=A.primary>>>0),A.secondary!=null&&(r.secondary=A.secondary>>>0),A.tertiary!=null&&(r.tertiary=A.tertiary>>>0),A.quaternary!=null&&(r.quaternary=A.quaternary>>>0),A.quinary!=null&&(r.quinary=A.quinary>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.primary!=null&&A.hasOwnProperty("primary")&&(s.primary=A.primary,r.oneofs&&(s._primary="primary")),A.secondary!=null&&A.hasOwnProperty("secondary")&&(s.secondary=A.secondary,r.oneofs&&(s._secondary="secondary")),A.tertiary!=null&&A.hasOwnProperty("tertiary")&&(s.tertiary=A.tertiary,r.oneofs&&(s._tertiary="tertiary")),A.quaternary!=null&&A.hasOwnProperty("quaternary")&&(s.quaternary=A.quaternary,r.oneofs&&(s._quaternary="quaternary")),A.quinary!=null&&A.hasOwnProperty("quinary")&&(s.quinary=A.quinary,r.oneofs&&(s._quinary="quinary")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.AppVersion"},i})(),t.HistorySyncConfig=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.fullSyncDaysLimit=A.uint32();break}case 2:{c.fullSyncSizeMbLimit=A.uint32();break}case 3:{c.storageQuotaMb=A.uint32();break}case 4:{c.inlineInitialPayloadInE2EeMsg=A.bool();break}case 5:{c.recentSyncDaysLimit=A.uint32();break}case 6:{c.supportCallLogHistory=A.bool();break}case 7:{c.supportBotUserAgentChatHistory=A.bool();break}case 8:{c.supportCagReactionsAndPolls=A.bool();break}case 9:{c.supportBizHostedMsg=A.bool();break}case 10:{c.supportRecentSyncChunkMessageCountTuning=A.bool();break}case 11:{c.supportHostedGroupMsg=A.bool();break}case 12:{c.supportFbidBotChatHistory=A.bool();break}case 13:{c.supportAddOnHistorySyncMigration=A.bool();break}case 14:{c.supportMessageAssociation=A.bool();break}case 15:{c.supportGroupHistory=A.bool();break}case 16:{c.onDemandReady=A.bool();break}case 17:{c.supportGuestChat=A.bool();break}case 18:{c.completeOnDemandReady=A.bool();break}case 19:{c.thumbnailSyncDaysLimit=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceProps.HistorySyncConfig)return A;var r=new p.proto.DeviceProps.HistorySyncConfig;return A.fullSyncDaysLimit!=null&&(r.fullSyncDaysLimit=A.fullSyncDaysLimit>>>0),A.fullSyncSizeMbLimit!=null&&(r.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit>>>0),A.storageQuotaMb!=null&&(r.storageQuotaMb=A.storageQuotaMb>>>0),A.inlineInitialPayloadInE2EeMsg!=null&&(r.inlineInitialPayloadInE2EeMsg=!!A.inlineInitialPayloadInE2EeMsg),A.recentSyncDaysLimit!=null&&(r.recentSyncDaysLimit=A.recentSyncDaysLimit>>>0),A.supportCallLogHistory!=null&&(r.supportCallLogHistory=!!A.supportCallLogHistory),A.supportBotUserAgentChatHistory!=null&&(r.supportBotUserAgentChatHistory=!!A.supportBotUserAgentChatHistory),A.supportCagReactionsAndPolls!=null&&(r.supportCagReactionsAndPolls=!!A.supportCagReactionsAndPolls),A.supportBizHostedMsg!=null&&(r.supportBizHostedMsg=!!A.supportBizHostedMsg),A.supportRecentSyncChunkMessageCountTuning!=null&&(r.supportRecentSyncChunkMessageCountTuning=!!A.supportRecentSyncChunkMessageCountTuning),A.supportHostedGroupMsg!=null&&(r.supportHostedGroupMsg=!!A.supportHostedGroupMsg),A.supportFbidBotChatHistory!=null&&(r.supportFbidBotChatHistory=!!A.supportFbidBotChatHistory),A.supportAddOnHistorySyncMigration!=null&&(r.supportAddOnHistorySyncMigration=!!A.supportAddOnHistorySyncMigration),A.supportMessageAssociation!=null&&(r.supportMessageAssociation=!!A.supportMessageAssociation),A.supportGroupHistory!=null&&(r.supportGroupHistory=!!A.supportGroupHistory),A.onDemandReady!=null&&(r.onDemandReady=!!A.onDemandReady),A.supportGuestChat!=null&&(r.supportGuestChat=!!A.supportGuestChat),A.completeOnDemandReady!=null&&(r.completeOnDemandReady=!!A.completeOnDemandReady),A.thumbnailSyncDaysLimit!=null&&(r.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.fullSyncDaysLimit!=null&&A.hasOwnProperty("fullSyncDaysLimit")&&(s.fullSyncDaysLimit=A.fullSyncDaysLimit,r.oneofs&&(s._fullSyncDaysLimit="fullSyncDaysLimit")),A.fullSyncSizeMbLimit!=null&&A.hasOwnProperty("fullSyncSizeMbLimit")&&(s.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit,r.oneofs&&(s._fullSyncSizeMbLimit="fullSyncSizeMbLimit")),A.storageQuotaMb!=null&&A.hasOwnProperty("storageQuotaMb")&&(s.storageQuotaMb=A.storageQuotaMb,r.oneofs&&(s._storageQuotaMb="storageQuotaMb")),A.inlineInitialPayloadInE2EeMsg!=null&&A.hasOwnProperty("inlineInitialPayloadInE2EeMsg")&&(s.inlineInitialPayloadInE2EeMsg=A.inlineInitialPayloadInE2EeMsg,r.oneofs&&(s._inlineInitialPayloadInE2EeMsg="inlineInitialPayloadInE2EeMsg")),A.recentSyncDaysLimit!=null&&A.hasOwnProperty("recentSyncDaysLimit")&&(s.recentSyncDaysLimit=A.recentSyncDaysLimit,r.oneofs&&(s._recentSyncDaysLimit="recentSyncDaysLimit")),A.supportCallLogHistory!=null&&A.hasOwnProperty("supportCallLogHistory")&&(s.supportCallLogHistory=A.supportCallLogHistory,r.oneofs&&(s._supportCallLogHistory="supportCallLogHistory")),A.supportBotUserAgentChatHistory!=null&&A.hasOwnProperty("supportBotUserAgentChatHistory")&&(s.supportBotUserAgentChatHistory=A.supportBotUserAgentChatHistory,r.oneofs&&(s._supportBotUserAgentChatHistory="supportBotUserAgentChatHistory")),A.supportCagReactionsAndPolls!=null&&A.hasOwnProperty("supportCagReactionsAndPolls")&&(s.supportCagReactionsAndPolls=A.supportCagReactionsAndPolls,r.oneofs&&(s._supportCagReactionsAndPolls="supportCagReactionsAndPolls")),A.supportBizHostedMsg!=null&&A.hasOwnProperty("supportBizHostedMsg")&&(s.supportBizHostedMsg=A.supportBizHostedMsg,r.oneofs&&(s._supportBizHostedMsg="supportBizHostedMsg")),A.supportRecentSyncChunkMessageCountTuning!=null&&A.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")&&(s.supportRecentSyncChunkMessageCountTuning=A.supportRecentSyncChunkMessageCountTuning,r.oneofs&&(s._supportRecentSyncChunkMessageCountTuning="supportRecentSyncChunkMessageCountTuning")),A.supportHostedGroupMsg!=null&&A.hasOwnProperty("supportHostedGroupMsg")&&(s.supportHostedGroupMsg=A.supportHostedGroupMsg,r.oneofs&&(s._supportHostedGroupMsg="supportHostedGroupMsg")),A.supportFbidBotChatHistory!=null&&A.hasOwnProperty("supportFbidBotChatHistory")&&(s.supportFbidBotChatHistory=A.supportFbidBotChatHistory,r.oneofs&&(s._supportFbidBotChatHistory="supportFbidBotChatHistory")),A.supportAddOnHistorySyncMigration!=null&&A.hasOwnProperty("supportAddOnHistorySyncMigration")&&(s.supportAddOnHistorySyncMigration=A.supportAddOnHistorySyncMigration,r.oneofs&&(s._supportAddOnHistorySyncMigration="supportAddOnHistorySyncMigration")),A.supportMessageAssociation!=null&&A.hasOwnProperty("supportMessageAssociation")&&(s.supportMessageAssociation=A.supportMessageAssociation,r.oneofs&&(s._supportMessageAssociation="supportMessageAssociation")),A.supportGroupHistory!=null&&A.hasOwnProperty("supportGroupHistory")&&(s.supportGroupHistory=A.supportGroupHistory,r.oneofs&&(s._supportGroupHistory="supportGroupHistory")),A.onDemandReady!=null&&A.hasOwnProperty("onDemandReady")&&(s.onDemandReady=A.onDemandReady,r.oneofs&&(s._onDemandReady="onDemandReady")),A.supportGuestChat!=null&&A.hasOwnProperty("supportGuestChat")&&(s.supportGuestChat=A.supportGuestChat,r.oneofs&&(s._supportGuestChat="supportGuestChat")),A.completeOnDemandReady!=null&&A.hasOwnProperty("completeOnDemandReady")&&(s.completeOnDemandReady=A.completeOnDemandReady,r.oneofs&&(s._completeOnDemandReady="completeOnDemandReady")),A.thumbnailSyncDaysLimit!=null&&A.hasOwnProperty("thumbnailSyncDaysLimit")&&(s.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit,r.oneofs&&(s._thumbnailSyncDaysLimit="thumbnailSyncDaysLimit")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.HistorySyncConfig"},i})(),t.PlatformType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHROME"]=1,e[i[2]="FIREFOX"]=2,e[i[3]="IE"]=3,e[i[4]="OPERA"]=4,e[i[5]="SAFARI"]=5,e[i[6]="EDGE"]=6,e[i[7]="DESKTOP"]=7,e[i[8]="IPAD"]=8,e[i[9]="ANDROID_TABLET"]=9,e[i[10]="OHANA"]=10,e[i[11]="ALOHA"]=11,e[i[12]="CATALINA"]=12,e[i[13]="TCL_TV"]=13,e[i[14]="IOS_PHONE"]=14,e[i[15]="IOS_CATALYST"]=15,e[i[16]="ANDROID_PHONE"]=16,e[i[17]="ANDROID_AMBIGUOUS"]=17,e[i[18]="WEAR_OS"]=18,e[i[19]="AR_WRIST"]=19,e[i[20]="AR_DEVICE"]=20,e[i[21]="UWP"]=21,e[i[22]="VR"]=22,e[i[23]="CLOUD_API"]=23,e[i[24]="SMARTGLASSES"]=24,e})(),t})(),n.DisappearingMode=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.initiator=e.int32();break}case 2:{s.trigger=e.int32();break}case 3:{s.initiatorDeviceJid=e.string();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.DisappearingMode)return e;var a=new p.proto.DisappearingMode;switch(e.initiator){default:if(typeof e.initiator=="number"){a.initiator=e.initiator;break}break;case"CHANGED_IN_CHAT":case 0:a.initiator=0;break;case"INITIATED_BY_ME":case 1:a.initiator=1;break;case"INITIATED_BY_OTHER":case 2:a.initiator=2;break;case"BIZ_UPGRADE_FB_HOSTING":case 3:a.initiator=3;break}switch(e.trigger){default:if(typeof e.trigger=="number"){a.trigger=e.trigger;break}break;case"UNKNOWN":case 0:a.trigger=0;break;case"CHAT_SETTING":case 1:a.trigger=1;break;case"ACCOUNT_SETTING":case 2:a.trigger=2;break;case"BULK_CHANGE":case 3:a.trigger=3;break;case"BIZ_SUPPORTS_FB_HOSTING":case 4:a.trigger=4;break;case"UNKNOWN_GROUPS":case 5:a.trigger=5;break}return e.initiatorDeviceJid!=null&&(a.initiatorDeviceJid=String(e.initiatorDeviceJid)),e.initiatedByMe!=null&&(a.initiatedByMe=!!e.initiatedByMe),a},t.toObject=function(e,a){a||(a={});var A={};return e.initiator!=null&&e.hasOwnProperty("initiator")&&(A.initiator=a.enums===String?p.proto.DisappearingMode.Initiator[e.initiator]===void 0?e.initiator:p.proto.DisappearingMode.Initiator[e.initiator]:e.initiator,a.oneofs&&(A._initiator="initiator")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=a.enums===String?p.proto.DisappearingMode.Trigger[e.trigger]===void 0?e.trigger:p.proto.DisappearingMode.Trigger[e.trigger]:e.trigger,a.oneofs&&(A._trigger="trigger")),e.initiatorDeviceJid!=null&&e.hasOwnProperty("initiatorDeviceJid")&&(A.initiatorDeviceJid=e.initiatorDeviceJid,a.oneofs&&(A._initiatorDeviceJid="initiatorDeviceJid")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,a.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DisappearingMode"},t.Initiator=(function(){let i={},e=Object.create(i);return e[i[0]="CHANGED_IN_CHAT"]=0,e[i[1]="INITIATED_BY_ME"]=1,e[i[2]="INITIATED_BY_OTHER"]=2,e[i[3]="BIZ_UPGRADE_FB_HOSTING"]=3,e})(),t.Trigger=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT_SETTING"]=1,e[i[2]="ACCOUNT_SETTING"]=2,e[i[3]="BULK_CHANGE"]=3,e[i[4]="BIZ_SUPPORTS_FB_HOSTING"]=4,e[i[5]="UNKNOWN_GROUPS"]=5,e})(),t})(),n.EmbeddedContent=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.embeddedMessage=p.proto.EmbeddedMessage.decode(e,e.uint32());break}case 2:{s.embeddedMusic=p.proto.EmbeddedMusic.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EmbeddedContent)return e;var a=new p.proto.EmbeddedContent;if(e.embeddedMessage!=null){if(typeof e.embeddedMessage!="object")throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected");a.embeddedMessage=p.proto.EmbeddedMessage.fromObject(e.embeddedMessage)}if(e.embeddedMusic!=null){if(typeof e.embeddedMusic!="object")throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected");a.embeddedMusic=p.proto.EmbeddedMusic.fromObject(e.embeddedMusic)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.embeddedMessage!=null&&e.hasOwnProperty("embeddedMessage")&&(A.embeddedMessage=p.proto.EmbeddedMessage.toObject(e.embeddedMessage,a),a.oneofs&&(A.content="embeddedMessage")),e.embeddedMusic!=null&&e.hasOwnProperty("embeddedMusic")&&(A.embeddedMusic=p.proto.EmbeddedMusic.toObject(e.embeddedMusic,a),a.oneofs&&(A.content="embeddedMusic")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedContent"},t})(),n.EmbeddedMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EmbeddedMessage)return e;var a=new p.proto.EmbeddedMessage;if(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.EmbeddedMessage.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMessage"},t})(),n.EmbeddedMusic=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.musicContentMediaId=e.string();break}case 2:{s.songId=e.string();break}case 3:{s.author=e.string();break}case 4:{s.title=e.string();break}case 5:{s.artworkDirectPath=e.string();break}case 6:{s.artworkSha256=e.bytes();break}case 7:{s.artworkEncSha256=e.bytes();break}case 8:{s.artistAttribution=e.string();break}case 9:{s.countryBlocklist=e.bytes();break}case 10:{s.isExplicit=e.bool();break}case 11:{s.artworkMediaKey=e.bytes();break}case 12:{s.musicSongStartTimeInMs=e.int64();break}case 13:{s.derivedContentStartTimeInMs=e.int64();break}case 14:{s.overlapDurationInMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EmbeddedMusic)return e;var a=new p.proto.EmbeddedMusic;return e.musicContentMediaId!=null&&(a.musicContentMediaId=String(e.musicContentMediaId)),e.songId!=null&&(a.songId=String(e.songId)),e.author!=null&&(a.author=String(e.author)),e.title!=null&&(a.title=String(e.title)),e.artworkDirectPath!=null&&(a.artworkDirectPath=String(e.artworkDirectPath)),e.artworkSha256!=null&&(typeof e.artworkSha256=="string"?l.base64.decode(e.artworkSha256,a.artworkSha256=l.newBuffer(l.base64.length(e.artworkSha256)),0):e.artworkSha256.length>=0&&(a.artworkSha256=e.artworkSha256)),e.artworkEncSha256!=null&&(typeof e.artworkEncSha256=="string"?l.base64.decode(e.artworkEncSha256,a.artworkEncSha256=l.newBuffer(l.base64.length(e.artworkEncSha256)),0):e.artworkEncSha256.length>=0&&(a.artworkEncSha256=e.artworkEncSha256)),e.artistAttribution!=null&&(a.artistAttribution=String(e.artistAttribution)),e.countryBlocklist!=null&&(typeof e.countryBlocklist=="string"?l.base64.decode(e.countryBlocklist,a.countryBlocklist=l.newBuffer(l.base64.length(e.countryBlocklist)),0):e.countryBlocklist.length>=0&&(a.countryBlocklist=e.countryBlocklist)),e.isExplicit!=null&&(a.isExplicit=!!e.isExplicit),e.artworkMediaKey!=null&&(typeof e.artworkMediaKey=="string"?l.base64.decode(e.artworkMediaKey,a.artworkMediaKey=l.newBuffer(l.base64.length(e.artworkMediaKey)),0):e.artworkMediaKey.length>=0&&(a.artworkMediaKey=e.artworkMediaKey)),e.musicSongStartTimeInMs!=null&&(l.Long?(a.musicSongStartTimeInMs=l.Long.fromValue(e.musicSongStartTimeInMs)).unsigned=!1:typeof e.musicSongStartTimeInMs=="string"?a.musicSongStartTimeInMs=parseInt(e.musicSongStartTimeInMs,10):typeof e.musicSongStartTimeInMs=="number"?a.musicSongStartTimeInMs=e.musicSongStartTimeInMs:typeof e.musicSongStartTimeInMs=="object"&&(a.musicSongStartTimeInMs=new l.LongBits(e.musicSongStartTimeInMs.low>>>0,e.musicSongStartTimeInMs.high>>>0).toNumber())),e.derivedContentStartTimeInMs!=null&&(l.Long?(a.derivedContentStartTimeInMs=l.Long.fromValue(e.derivedContentStartTimeInMs)).unsigned=!1:typeof e.derivedContentStartTimeInMs=="string"?a.derivedContentStartTimeInMs=parseInt(e.derivedContentStartTimeInMs,10):typeof e.derivedContentStartTimeInMs=="number"?a.derivedContentStartTimeInMs=e.derivedContentStartTimeInMs:typeof e.derivedContentStartTimeInMs=="object"&&(a.derivedContentStartTimeInMs=new l.LongBits(e.derivedContentStartTimeInMs.low>>>0,e.derivedContentStartTimeInMs.high>>>0).toNumber())),e.overlapDurationInMs!=null&&(l.Long?(a.overlapDurationInMs=l.Long.fromValue(e.overlapDurationInMs)).unsigned=!1:typeof e.overlapDurationInMs=="string"?a.overlapDurationInMs=parseInt(e.overlapDurationInMs,10):typeof e.overlapDurationInMs=="number"?a.overlapDurationInMs=e.overlapDurationInMs:typeof e.overlapDurationInMs=="object"&&(a.overlapDurationInMs=new l.LongBits(e.overlapDurationInMs.low>>>0,e.overlapDurationInMs.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.musicContentMediaId!=null&&e.hasOwnProperty("musicContentMediaId")&&(A.musicContentMediaId=e.musicContentMediaId,a.oneofs&&(A._musicContentMediaId="musicContentMediaId")),e.songId!=null&&e.hasOwnProperty("songId")&&(A.songId=e.songId,a.oneofs&&(A._songId="songId")),e.author!=null&&e.hasOwnProperty("author")&&(A.author=e.author,a.oneofs&&(A._author="author")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.artworkDirectPath!=null&&e.hasOwnProperty("artworkDirectPath")&&(A.artworkDirectPath=e.artworkDirectPath,a.oneofs&&(A._artworkDirectPath="artworkDirectPath")),e.artworkSha256!=null&&e.hasOwnProperty("artworkSha256")&&(A.artworkSha256=a.bytes===String?l.base64.encode(e.artworkSha256,0,e.artworkSha256.length):a.bytes===Array?Array.prototype.slice.call(e.artworkSha256):e.artworkSha256,a.oneofs&&(A._artworkSha256="artworkSha256")),e.artworkEncSha256!=null&&e.hasOwnProperty("artworkEncSha256")&&(A.artworkEncSha256=a.bytes===String?l.base64.encode(e.artworkEncSha256,0,e.artworkEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.artworkEncSha256):e.artworkEncSha256,a.oneofs&&(A._artworkEncSha256="artworkEncSha256")),e.artistAttribution!=null&&e.hasOwnProperty("artistAttribution")&&(A.artistAttribution=e.artistAttribution,a.oneofs&&(A._artistAttribution="artistAttribution")),e.countryBlocklist!=null&&e.hasOwnProperty("countryBlocklist")&&(A.countryBlocklist=a.bytes===String?l.base64.encode(e.countryBlocklist,0,e.countryBlocklist.length):a.bytes===Array?Array.prototype.slice.call(e.countryBlocklist):e.countryBlocklist,a.oneofs&&(A._countryBlocklist="countryBlocklist")),e.isExplicit!=null&&e.hasOwnProperty("isExplicit")&&(A.isExplicit=e.isExplicit,a.oneofs&&(A._isExplicit="isExplicit")),e.artworkMediaKey!=null&&e.hasOwnProperty("artworkMediaKey")&&(A.artworkMediaKey=a.bytes===String?l.base64.encode(e.artworkMediaKey,0,e.artworkMediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.artworkMediaKey):e.artworkMediaKey,a.oneofs&&(A._artworkMediaKey="artworkMediaKey")),e.musicSongStartTimeInMs!=null&&e.hasOwnProperty("musicSongStartTimeInMs")&&(typeof e.musicSongStartTimeInMs=="number"?A.musicSongStartTimeInMs=a.longs===String?String(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs:A.musicSongStartTimeInMs=a.longs===String?ge(e.musicSongStartTimeInMs):a.longs===Number?ce(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs,a.oneofs&&(A._musicSongStartTimeInMs="musicSongStartTimeInMs")),e.derivedContentStartTimeInMs!=null&&e.hasOwnProperty("derivedContentStartTimeInMs")&&(typeof e.derivedContentStartTimeInMs=="number"?A.derivedContentStartTimeInMs=a.longs===String?String(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs:A.derivedContentStartTimeInMs=a.longs===String?ge(e.derivedContentStartTimeInMs):a.longs===Number?ce(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs,a.oneofs&&(A._derivedContentStartTimeInMs="derivedContentStartTimeInMs")),e.overlapDurationInMs!=null&&e.hasOwnProperty("overlapDurationInMs")&&(typeof e.overlapDurationInMs=="number"?A.overlapDurationInMs=a.longs===String?String(e.overlapDurationInMs):e.overlapDurationInMs:A.overlapDurationInMs=a.longs===String?ge(e.overlapDurationInMs):a.longs===Number?ce(e.overlapDurationInMs):e.overlapDurationInMs,a.oneofs&&(A._overlapDurationInMs="overlapDurationInMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMusic"},t})(),n.EncryptedPairingRequest=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encryptedPayload=e.bytes();break}case 2:{s.iv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EncryptedPairingRequest)return e;var a=new p.proto.EncryptedPairingRequest;return e.encryptedPayload!=null&&(typeof e.encryptedPayload=="string"?l.base64.decode(e.encryptedPayload,a.encryptedPayload=l.newBuffer(l.base64.length(e.encryptedPayload)),0):e.encryptedPayload.length>=0&&(a.encryptedPayload=e.encryptedPayload)),e.iv!=null&&(typeof e.iv=="string"?l.base64.decode(e.iv,a.iv=l.newBuffer(l.base64.length(e.iv)),0):e.iv.length>=0&&(a.iv=e.iv)),a},t.toObject=function(e,a){a||(a={});var A={};return e.encryptedPayload!=null&&e.hasOwnProperty("encryptedPayload")&&(A.encryptedPayload=a.bytes===String?l.base64.encode(e.encryptedPayload,0,e.encryptedPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encryptedPayload):e.encryptedPayload,a.oneofs&&(A._encryptedPayload="encryptedPayload")),e.iv!=null&&e.hasOwnProperty("iv")&&(A.iv=a.bytes===String?l.base64.encode(e.iv,0,e.iv.length):a.bytes===Array?Array.prototype.slice.call(e.iv):e.iv,a.oneofs&&(A._iv="iv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EncryptedPairingRequest"},t})(),n.EphemeralSetting=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.duration=e.sfixed32();break}case 2:{s.timestamp=e.sfixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EphemeralSetting)return e;var a=new p.proto.EphemeralSetting;return e.duration!=null&&(a.duration=e.duration|0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.duration!=null&&e.hasOwnProperty("duration")&&(A.duration=e.duration,a.oneofs&&(A._duration="duration")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EphemeralSetting"},t})(),n.EventAdditionalMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.isStale=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EventAdditionalMetadata)return e;var a=new p.proto.EventAdditionalMetadata;return e.isStale!=null&&(a.isStale=!!e.isStale),a},t.toObject=function(e,a){a||(a={});var A={};return e.isStale!=null&&e.hasOwnProperty("isStale")&&(A.isStale=e.isStale,a.oneofs&&(A._isStale="isStale")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventAdditionalMetadata"},t})(),n.EventResponse=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.eventResponseMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.timestampMs=e.int64();break}case 3:{s.eventResponseMessage=p.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 4:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.EventResponse)return e;var a=new p.proto.EventResponse;if(e.eventResponseMessageKey!=null){if(typeof e.eventResponseMessageKey!="object")throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");a.eventResponseMessageKey=p.proto.MessageKey.fromObject(e.eventResponseMessageKey)}if(e.timestampMs!=null&&(l.Long?(a.timestampMs=l.Long.fromValue(e.timestampMs)).unsigned=!1:typeof e.timestampMs=="string"?a.timestampMs=parseInt(e.timestampMs,10):typeof e.timestampMs=="number"?a.timestampMs=e.timestampMs:typeof e.timestampMs=="object"&&(a.timestampMs=new l.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber())),e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");a.eventResponseMessage=p.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}return e.unread!=null&&(a.unread=!!e.unread),a},t.toObject=function(e,a){a||(a={});var A={};return e.eventResponseMessageKey!=null&&e.hasOwnProperty("eventResponseMessageKey")&&(A.eventResponseMessageKey=p.proto.MessageKey.toObject(e.eventResponseMessageKey,a),a.oneofs&&(A._eventResponseMessageKey="eventResponseMessageKey")),e.timestampMs!=null&&e.hasOwnProperty("timestampMs")&&(typeof e.timestampMs=="number"?A.timestampMs=a.longs===String?String(e.timestampMs):e.timestampMs:A.timestampMs=a.longs===String?ge(e.timestampMs):a.longs===Number?ce(e.timestampMs):e.timestampMs,a.oneofs&&(A._timestampMs="timestampMs")),e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=p.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,a),a.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventResponse"},t})(),n.ExitCode=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.code=e.uint64();break}case 2:{s.text=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ExitCode)return e;var a=new p.proto.ExitCode;return e.code!=null&&(l.Long?(a.code=l.Long.fromValue(e.code)).unsigned=!0:typeof e.code=="string"?a.code=parseInt(e.code,10):typeof e.code=="number"?a.code=e.code:typeof e.code=="object"&&(a.code=new l.LongBits(e.code.low>>>0,e.code.high>>>0).toNumber(!0))),e.text!=null&&(a.text=String(e.text)),a},t.toObject=function(e,a){a||(a={});var A={};return e.code!=null&&e.hasOwnProperty("code")&&(typeof e.code=="number"?A.code=a.longs===String?String(e.code):e.code:A.code=a.longs===String?ge(e.code,!0):a.longs===Number?ce(e.code,!0):e.code,a.oneofs&&(A._code="code")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExitCode"},t})(),n.ExternalBlobReference=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.mediaKey=e.bytes();break}case 2:{s.directPath=e.string();break}case 3:{s.handle=e.string();break}case 4:{s.fileSizeBytes=e.uint64();break}case 5:{s.fileSha256=e.bytes();break}case 6:{s.fileEncSha256=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ExternalBlobReference)return e;var a=new p.proto.ExternalBlobReference;return e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,a.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(a.mediaKey=e.mediaKey)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.handle!=null&&(a.handle=String(e.handle)),e.fileSizeBytes!=null&&(l.Long?(a.fileSizeBytes=l.Long.fromValue(e.fileSizeBytes)).unsigned=!0:typeof e.fileSizeBytes=="string"?a.fileSizeBytes=parseInt(e.fileSizeBytes,10):typeof e.fileSizeBytes=="number"?a.fileSizeBytes=e.fileSizeBytes:typeof e.fileSizeBytes=="object"&&(a.fileSizeBytes=new l.LongBits(e.fileSizeBytes.low>>>0,e.fileSizeBytes.high>>>0).toNumber(!0))),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),a},t.toObject=function(e,a){a||(a={});var A={};return e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=a.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.handle!=null&&e.hasOwnProperty("handle")&&(A.handle=e.handle,a.oneofs&&(A._handle="handle")),e.fileSizeBytes!=null&&e.hasOwnProperty("fileSizeBytes")&&(typeof e.fileSizeBytes=="number"?A.fileSizeBytes=a.longs===String?String(e.fileSizeBytes):e.fileSizeBytes:A.fileSizeBytes=a.longs===String?ge(e.fileSizeBytes,!0):a.longs===Number?ce(e.fileSizeBytes,!0):e.fileSizeBytes,a.oneofs&&(A._fileSizeBytes="fileSizeBytes")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=a.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExternalBlobReference"},t})(),n.Field=(function(){function t(i){if(this.subfield={},i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.isMessage=e.bool();break}case 5:{s.subfield===l.emptyObject&&(s.subfield={});var d=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=p.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.subfield[g]=c;break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Field)return e;var a=new p.proto.Field;if(e.minVersion!=null&&(a.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(a.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(a.notReportableMinVersion=e.notReportableMinVersion>>>0),e.isMessage!=null&&(a.isMessage=!!e.isMessage),e.subfield){if(typeof e.subfield!="object")throw TypeError(".proto.Field.subfield: object expected");a.subfield={};for(var A=Object.keys(e.subfield),r=0;r>>3){case 1:{s.botName=e.string();break}case 2:{s.botJid=e.string();break}case 3:{s.creatorName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ForwardedAIBotMessageInfo)return e;var a=new p.proto.ForwardedAIBotMessageInfo;return e.botName!=null&&(a.botName=String(e.botName)),e.botJid!=null&&(a.botJid=String(e.botJid)),e.creatorName!=null&&(a.creatorName=String(e.creatorName)),a},t.toObject=function(e,a){a||(a={});var A={};return e.botName!=null&&e.hasOwnProperty("botName")&&(A.botName=e.botName,a.oneofs&&(A._botName="botName")),e.botJid!=null&&e.hasOwnProperty("botJid")&&(A.botJid=e.botJid,a.oneofs&&(A._botJid="botJid")),e.creatorName!=null&&e.hasOwnProperty("creatorName")&&(A.creatorName=e.creatorName,a.oneofs&&(A._creatorName="creatorName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ForwardedAIBotMessageInfo"},t})(),n.GlobalSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lightThemeWallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 2:{s.mediaVisibility=e.int32();break}case 3:{s.darkThemeWallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 4:{s.autoDownloadWiFi=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 5:{s.autoDownloadCellular=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 6:{s.autoDownloadRoaming=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 7:{s.showIndividualNotificationsPreview=e.bool();break}case 8:{s.showGroupNotificationsPreview=e.bool();break}case 9:{s.disappearingModeDuration=e.int32();break}case 10:{s.disappearingModeTimestamp=e.int64();break}case 11:{s.avatarUserSettings=p.proto.AvatarUserSettings.decode(e,e.uint32());break}case 12:{s.fontSize=e.int32();break}case 13:{s.securityNotifications=e.bool();break}case 14:{s.autoUnarchiveChats=e.bool();break}case 15:{s.videoQualityMode=e.int32();break}case 16:{s.photoQualityMode=e.int32();break}case 17:{s.individualNotificationSettings=p.proto.NotificationSettings.decode(e,e.uint32());break}case 18:{s.groupNotificationSettings=p.proto.NotificationSettings.decode(e,e.uint32());break}case 19:{s.chatLockSettings=p.proto.ChatLockSettings.decode(e,e.uint32());break}case 20:{s.chatDbLidMigrationTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GlobalSettings)return e;var a=new p.proto.GlobalSettings;if(e.lightThemeWallpaper!=null){if(typeof e.lightThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected");a.lightThemeWallpaper=p.proto.WallpaperSettings.fromObject(e.lightThemeWallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){a.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:a.mediaVisibility=0;break;case"OFF":case 1:a.mediaVisibility=1;break;case"ON":case 2:a.mediaVisibility=2;break}if(e.darkThemeWallpaper!=null){if(typeof e.darkThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected");a.darkThemeWallpaper=p.proto.WallpaperSettings.fromObject(e.darkThemeWallpaper)}if(e.autoDownloadWiFi!=null){if(typeof e.autoDownloadWiFi!="object")throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected");a.autoDownloadWiFi=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadWiFi)}if(e.autoDownloadCellular!=null){if(typeof e.autoDownloadCellular!="object")throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected");a.autoDownloadCellular=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadCellular)}if(e.autoDownloadRoaming!=null){if(typeof e.autoDownloadRoaming!="object")throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected");a.autoDownloadRoaming=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadRoaming)}if(e.showIndividualNotificationsPreview!=null&&(a.showIndividualNotificationsPreview=!!e.showIndividualNotificationsPreview),e.showGroupNotificationsPreview!=null&&(a.showGroupNotificationsPreview=!!e.showGroupNotificationsPreview),e.disappearingModeDuration!=null&&(a.disappearingModeDuration=e.disappearingModeDuration|0),e.disappearingModeTimestamp!=null&&(l.Long?(a.disappearingModeTimestamp=l.Long.fromValue(e.disappearingModeTimestamp)).unsigned=!1:typeof e.disappearingModeTimestamp=="string"?a.disappearingModeTimestamp=parseInt(e.disappearingModeTimestamp,10):typeof e.disappearingModeTimestamp=="number"?a.disappearingModeTimestamp=e.disappearingModeTimestamp:typeof e.disappearingModeTimestamp=="object"&&(a.disappearingModeTimestamp=new l.LongBits(e.disappearingModeTimestamp.low>>>0,e.disappearingModeTimestamp.high>>>0).toNumber())),e.avatarUserSettings!=null){if(typeof e.avatarUserSettings!="object")throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected");a.avatarUserSettings=p.proto.AvatarUserSettings.fromObject(e.avatarUserSettings)}if(e.fontSize!=null&&(a.fontSize=e.fontSize|0),e.securityNotifications!=null&&(a.securityNotifications=!!e.securityNotifications),e.autoUnarchiveChats!=null&&(a.autoUnarchiveChats=!!e.autoUnarchiveChats),e.videoQualityMode!=null&&(a.videoQualityMode=e.videoQualityMode|0),e.photoQualityMode!=null&&(a.photoQualityMode=e.photoQualityMode|0),e.individualNotificationSettings!=null){if(typeof e.individualNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected");a.individualNotificationSettings=p.proto.NotificationSettings.fromObject(e.individualNotificationSettings)}if(e.groupNotificationSettings!=null){if(typeof e.groupNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected");a.groupNotificationSettings=p.proto.NotificationSettings.fromObject(e.groupNotificationSettings)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected");a.chatLockSettings=p.proto.ChatLockSettings.fromObject(e.chatLockSettings)}return e.chatDbLidMigrationTimestamp!=null&&(l.Long?(a.chatDbLidMigrationTimestamp=l.Long.fromValue(e.chatDbLidMigrationTimestamp)).unsigned=!1:typeof e.chatDbLidMigrationTimestamp=="string"?a.chatDbLidMigrationTimestamp=parseInt(e.chatDbLidMigrationTimestamp,10):typeof e.chatDbLidMigrationTimestamp=="number"?a.chatDbLidMigrationTimestamp=e.chatDbLidMigrationTimestamp:typeof e.chatDbLidMigrationTimestamp=="object"&&(a.chatDbLidMigrationTimestamp=new l.LongBits(e.chatDbLidMigrationTimestamp.low>>>0,e.chatDbLidMigrationTimestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.lightThemeWallpaper!=null&&e.hasOwnProperty("lightThemeWallpaper")&&(A.lightThemeWallpaper=p.proto.WallpaperSettings.toObject(e.lightThemeWallpaper,a),a.oneofs&&(A._lightThemeWallpaper="lightThemeWallpaper")),e.mediaVisibility!=null&&e.hasOwnProperty("mediaVisibility")&&(A.mediaVisibility=a.enums===String?p.proto.MediaVisibility[e.mediaVisibility]===void 0?e.mediaVisibility:p.proto.MediaVisibility[e.mediaVisibility]:e.mediaVisibility,a.oneofs&&(A._mediaVisibility="mediaVisibility")),e.darkThemeWallpaper!=null&&e.hasOwnProperty("darkThemeWallpaper")&&(A.darkThemeWallpaper=p.proto.WallpaperSettings.toObject(e.darkThemeWallpaper,a),a.oneofs&&(A._darkThemeWallpaper="darkThemeWallpaper")),e.autoDownloadWiFi!=null&&e.hasOwnProperty("autoDownloadWiFi")&&(A.autoDownloadWiFi=p.proto.AutoDownloadSettings.toObject(e.autoDownloadWiFi,a),a.oneofs&&(A._autoDownloadWiFi="autoDownloadWiFi")),e.autoDownloadCellular!=null&&e.hasOwnProperty("autoDownloadCellular")&&(A.autoDownloadCellular=p.proto.AutoDownloadSettings.toObject(e.autoDownloadCellular,a),a.oneofs&&(A._autoDownloadCellular="autoDownloadCellular")),e.autoDownloadRoaming!=null&&e.hasOwnProperty("autoDownloadRoaming")&&(A.autoDownloadRoaming=p.proto.AutoDownloadSettings.toObject(e.autoDownloadRoaming,a),a.oneofs&&(A._autoDownloadRoaming="autoDownloadRoaming")),e.showIndividualNotificationsPreview!=null&&e.hasOwnProperty("showIndividualNotificationsPreview")&&(A.showIndividualNotificationsPreview=e.showIndividualNotificationsPreview,a.oneofs&&(A._showIndividualNotificationsPreview="showIndividualNotificationsPreview")),e.showGroupNotificationsPreview!=null&&e.hasOwnProperty("showGroupNotificationsPreview")&&(A.showGroupNotificationsPreview=e.showGroupNotificationsPreview,a.oneofs&&(A._showGroupNotificationsPreview="showGroupNotificationsPreview")),e.disappearingModeDuration!=null&&e.hasOwnProperty("disappearingModeDuration")&&(A.disappearingModeDuration=e.disappearingModeDuration,a.oneofs&&(A._disappearingModeDuration="disappearingModeDuration")),e.disappearingModeTimestamp!=null&&e.hasOwnProperty("disappearingModeTimestamp")&&(typeof e.disappearingModeTimestamp=="number"?A.disappearingModeTimestamp=a.longs===String?String(e.disappearingModeTimestamp):e.disappearingModeTimestamp:A.disappearingModeTimestamp=a.longs===String?ge(e.disappearingModeTimestamp):a.longs===Number?ce(e.disappearingModeTimestamp):e.disappearingModeTimestamp,a.oneofs&&(A._disappearingModeTimestamp="disappearingModeTimestamp")),e.avatarUserSettings!=null&&e.hasOwnProperty("avatarUserSettings")&&(A.avatarUserSettings=p.proto.AvatarUserSettings.toObject(e.avatarUserSettings,a),a.oneofs&&(A._avatarUserSettings="avatarUserSettings")),e.fontSize!=null&&e.hasOwnProperty("fontSize")&&(A.fontSize=e.fontSize,a.oneofs&&(A._fontSize="fontSize")),e.securityNotifications!=null&&e.hasOwnProperty("securityNotifications")&&(A.securityNotifications=e.securityNotifications,a.oneofs&&(A._securityNotifications="securityNotifications")),e.autoUnarchiveChats!=null&&e.hasOwnProperty("autoUnarchiveChats")&&(A.autoUnarchiveChats=e.autoUnarchiveChats,a.oneofs&&(A._autoUnarchiveChats="autoUnarchiveChats")),e.videoQualityMode!=null&&e.hasOwnProperty("videoQualityMode")&&(A.videoQualityMode=e.videoQualityMode,a.oneofs&&(A._videoQualityMode="videoQualityMode")),e.photoQualityMode!=null&&e.hasOwnProperty("photoQualityMode")&&(A.photoQualityMode=e.photoQualityMode,a.oneofs&&(A._photoQualityMode="photoQualityMode")),e.individualNotificationSettings!=null&&e.hasOwnProperty("individualNotificationSettings")&&(A.individualNotificationSettings=p.proto.NotificationSettings.toObject(e.individualNotificationSettings,a),a.oneofs&&(A._individualNotificationSettings="individualNotificationSettings")),e.groupNotificationSettings!=null&&e.hasOwnProperty("groupNotificationSettings")&&(A.groupNotificationSettings=p.proto.NotificationSettings.toObject(e.groupNotificationSettings,a),a.oneofs&&(A._groupNotificationSettings="groupNotificationSettings")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=p.proto.ChatLockSettings.toObject(e.chatLockSettings,a),a.oneofs&&(A._chatLockSettings="chatLockSettings")),e.chatDbLidMigrationTimestamp!=null&&e.hasOwnProperty("chatDbLidMigrationTimestamp")&&(typeof e.chatDbLidMigrationTimestamp=="number"?A.chatDbLidMigrationTimestamp=a.longs===String?String(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp:A.chatDbLidMigrationTimestamp=a.longs===String?ge(e.chatDbLidMigrationTimestamp):a.longs===Number?ce(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp,a.oneofs&&(A._chatDbLidMigrationTimestamp="chatDbLidMigrationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GlobalSettings"},t})(),n.GroupHistoryBundleInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 2:{s.processState=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupHistoryBundleInfo)return e;var a=new p.proto.GroupHistoryBundleInfo;if(e.deprecatedMessageHistoryBundle!=null){if(typeof e.deprecatedMessageHistoryBundle!="object")throw TypeError(".proto.GroupHistoryBundleInfo.deprecatedMessageHistoryBundle: object expected");a.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.fromObject(e.deprecatedMessageHistoryBundle)}switch(e.processState){default:if(typeof e.processState=="number"){a.processState=e.processState;break}break;case"NOT_INJECTED":case 0:a.processState=0;break;case"INJECTED":case 1:a.processState=1;break;case"INJECTED_PARTIAL":case 2:a.processState=2;break;case"INJECTION_FAILED":case 3:a.processState=3;break;case"INJECTION_FAILED_NO_RETRY":case 4:a.processState=4;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.deprecatedMessageHistoryBundle!=null&&e.hasOwnProperty("deprecatedMessageHistoryBundle")&&(A.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.toObject(e.deprecatedMessageHistoryBundle,a),a.oneofs&&(A._deprecatedMessageHistoryBundle="deprecatedMessageHistoryBundle")),e.processState!=null&&e.hasOwnProperty("processState")&&(A.processState=a.enums===String?p.proto.GroupHistoryBundleInfo.ProcessState[e.processState]===void 0?e.processState:p.proto.GroupHistoryBundleInfo.ProcessState[e.processState]:e.processState,a.oneofs&&(A._processState="processState")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryBundleInfo"},t.ProcessState=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_INJECTED"]=0,e[i[1]="INJECTED"]=1,e[i[2]="INJECTED_PARTIAL"]=2,e[i[3]="INJECTION_FAILED"]=3,e[i[4]="INJECTION_FAILED_NO_RETRY"]=4,e})(),t})(),n.GroupHistoryIndividualMessageInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.bundleMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.editedAfterReceivedAsHistory=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupHistoryIndividualMessageInfo)return e;var a=new p.proto.GroupHistoryIndividualMessageInfo;if(e.bundleMessageKey!=null){if(typeof e.bundleMessageKey!="object")throw TypeError(".proto.GroupHistoryIndividualMessageInfo.bundleMessageKey: object expected");a.bundleMessageKey=p.proto.MessageKey.fromObject(e.bundleMessageKey)}return e.editedAfterReceivedAsHistory!=null&&(a.editedAfterReceivedAsHistory=!!e.editedAfterReceivedAsHistory),a},t.toObject=function(e,a){a||(a={});var A={};return e.bundleMessageKey!=null&&e.hasOwnProperty("bundleMessageKey")&&(A.bundleMessageKey=p.proto.MessageKey.toObject(e.bundleMessageKey,a),a.oneofs&&(A._bundleMessageKey="bundleMessageKey")),e.editedAfterReceivedAsHistory!=null&&e.hasOwnProperty("editedAfterReceivedAsHistory")&&(A.editedAfterReceivedAsHistory=e.editedAfterReceivedAsHistory,a.oneofs&&(A._editedAfterReceivedAsHistory="editedAfterReceivedAsHistory")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryIndividualMessageInfo"},t})(),n.GroupMention=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.groupJid=e.string();break}case 2:{s.groupSubject=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupMention)return e;var a=new p.proto.GroupMention;return e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.groupSubject!=null&&(a.groupSubject=String(e.groupSubject)),a},t.toObject=function(e,a){a||(a={});var A={};return e.groupJid!=null&&e.hasOwnProperty("groupJid")&&(A.groupJid=e.groupJid,a.oneofs&&(A._groupJid="groupJid")),e.groupSubject!=null&&e.hasOwnProperty("groupSubject")&&(A.groupSubject=e.groupSubject,a.oneofs&&(A._groupSubject="groupSubject")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupMention"},t})(),n.GroupParticipant=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.rank=e.int32();break}case 3:{s.memberLabel=p.proto.MemberLabel.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.GroupParticipant)return e;var a=new p.proto.GroupParticipant;switch(e.userJid!=null&&(a.userJid=String(e.userJid)),e.rank){default:if(typeof e.rank=="number"){a.rank=e.rank;break}break;case"REGULAR":case 0:a.rank=0;break;case"ADMIN":case 1:a.rank=1;break;case"SUPERADMIN":case 2:a.rank=2;break}if(e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.GroupParticipant.memberLabel: object expected");a.memberLabel=p.proto.MemberLabel.fromObject(e.memberLabel)}return a},t.toObject=function(e,a){a||(a={});var A={};return a.defaults&&(A.userJid=""),e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid),e.rank!=null&&e.hasOwnProperty("rank")&&(A.rank=a.enums===String?p.proto.GroupParticipant.Rank[e.rank]===void 0?e.rank:p.proto.GroupParticipant.Rank[e.rank]:e.rank,a.oneofs&&(A._rank="rank")),e.memberLabel!=null&&e.hasOwnProperty("memberLabel")&&(A.memberLabel=p.proto.MemberLabel.toObject(e.memberLabel,a),a.oneofs&&(A._memberLabel="memberLabel")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupParticipant"},t.Rank=(function(){let i={},e=Object.create(i);return e[i[0]="REGULAR"]=0,e[i[1]="ADMIN"]=1,e[i[2]="SUPERADMIN"]=2,e})(),t})(),n.HandshakeMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 2:{s.clientHello=p.proto.HandshakeMessage.ClientHello.decode(e,e.uint32());break}case 3:{s.serverHello=p.proto.HandshakeMessage.ServerHello.decode(e,e.uint32());break}case 4:{s.clientFinish=p.proto.HandshakeMessage.ClientFinish.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HandshakeMessage)return e;var a=new p.proto.HandshakeMessage;if(e.clientHello!=null){if(typeof e.clientHello!="object")throw TypeError(".proto.HandshakeMessage.clientHello: object expected");a.clientHello=p.proto.HandshakeMessage.ClientHello.fromObject(e.clientHello)}if(e.serverHello!=null){if(typeof e.serverHello!="object")throw TypeError(".proto.HandshakeMessage.serverHello: object expected");a.serverHello=p.proto.HandshakeMessage.ServerHello.fromObject(e.serverHello)}if(e.clientFinish!=null){if(typeof e.clientFinish!="object")throw TypeError(".proto.HandshakeMessage.clientFinish: object expected");a.clientFinish=p.proto.HandshakeMessage.ClientFinish.fromObject(e.clientFinish)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.clientHello!=null&&e.hasOwnProperty("clientHello")&&(A.clientHello=p.proto.HandshakeMessage.ClientHello.toObject(e.clientHello,a),a.oneofs&&(A._clientHello="clientHello")),e.serverHello!=null&&e.hasOwnProperty("serverHello")&&(A.serverHello=p.proto.HandshakeMessage.ServerHello.toObject(e.serverHello,a),a.oneofs&&(A._serverHello="serverHello")),e.clientFinish!=null&&e.hasOwnProperty("clientFinish")&&(A.clientFinish=p.proto.HandshakeMessage.ClientFinish.toObject(e.clientFinish,a),a.oneofs&&(A._clientFinish="clientFinish")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HandshakeMessage"},t.ClientFinish=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.static=A.bytes();break}case 2:{c.payload=A.bytes();break}case 3:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ClientFinish)return A;var r=new p.proto.HandshakeMessage.ClientFinish;return A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},i.toObject=function(A,r){r||(r={});var s={};return A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientFinish"},i})(),t.ClientHello=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.useExtended=A.bool();break}case 5:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ClientHello)return A;var r=new p.proto.HandshakeMessage.ClientHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.useExtended!=null&&(r.useExtended=!!A.useExtended),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},i.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.useExtended!=null&&A.hasOwnProperty("useExtended")&&(s.useExtended=A.useExtended,r.oneofs&&(s._useExtended="useExtended")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientHello"},i})(),t.ServerHello=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.extendedStatic=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ServerHello)return A;var r=new p.proto.HandshakeMessage.ServerHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedStatic!=null&&(typeof A.extendedStatic=="string"?l.base64.decode(A.extendedStatic,r.extendedStatic=l.newBuffer(l.base64.length(A.extendedStatic)),0):A.extendedStatic.length>=0&&(r.extendedStatic=A.extendedStatic)),r},i.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedStatic!=null&&A.hasOwnProperty("extendedStatic")&&(s.extendedStatic=r.bytes===String?l.base64.encode(A.extendedStatic,0,A.extendedStatic.length):r.bytes===Array?Array.prototype.slice.call(A.extendedStatic):A.extendedStatic,r.oneofs&&(s._extendedStatic="extendedStatic")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ServerHello"},i})(),t})(),n.HistorySync=(function(){function t(i){if(this.conversations=[],this.statusV3Messages=[],this.pushnames=[],this.recentStickers=[],this.pastParticipants=[],this.callLogRecords=[],this.phoneNumberToLidMappings=[],this.accounts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.syncType=e.int32();break}case 2:{s.conversations&&s.conversations.length||(s.conversations=[]),s.conversations.push(p.proto.Conversation.decode(e,e.uint32()));break}case 3:{s.statusV3Messages&&s.statusV3Messages.length||(s.statusV3Messages=[]),s.statusV3Messages.push(p.proto.WebMessageInfo.decode(e,e.uint32()));break}case 5:{s.chunkOrder=e.uint32();break}case 6:{s.progress=e.uint32();break}case 7:{s.pushnames&&s.pushnames.length||(s.pushnames=[]),s.pushnames.push(p.proto.Pushname.decode(e,e.uint32()));break}case 8:{s.globalSettings=p.proto.GlobalSettings.decode(e,e.uint32());break}case 9:{s.threadIdUserSecret=e.bytes();break}case 10:{s.threadDsTimeframeOffset=e.uint32();break}case 11:{s.recentStickers&&s.recentStickers.length||(s.recentStickers=[]),s.recentStickers.push(p.proto.StickerMetadata.decode(e,e.uint32()));break}case 12:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(p.proto.PastParticipants.decode(e,e.uint32()));break}case 13:{s.callLogRecords&&s.callLogRecords.length||(s.callLogRecords=[]),s.callLogRecords.push(p.proto.CallLogRecord.decode(e,e.uint32()));break}case 14:{s.aiWaitListState=e.int32();break}case 15:{s.phoneNumberToLidMappings&&s.phoneNumberToLidMappings.length||(s.phoneNumberToLidMappings=[]),s.phoneNumberToLidMappings.push(p.proto.PhoneNumberToLIDMapping.decode(e,e.uint32()));break}case 16:{s.companionMetaNonce=e.string();break}case 17:{s.shareableChatIdentifierEncryptionKey=e.bytes();break}case 18:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(p.proto.Account.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HistorySync)return e;var a=new p.proto.HistorySync;switch(e.syncType){default:if(typeof e.syncType=="number"){a.syncType=e.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:a.syncType=0;break;case"INITIAL_STATUS_V3":case 1:a.syncType=1;break;case"FULL":case 2:a.syncType=2;break;case"RECENT":case 3:a.syncType=3;break;case"PUSH_NAME":case 4:a.syncType=4;break;case"NON_BLOCKING_DATA":case 5:a.syncType=5;break;case"ON_DEMAND":case 6:a.syncType=6;break}if(e.conversations){if(!Array.isArray(e.conversations))throw TypeError(".proto.HistorySync.conversations: array expected");a.conversations=[];for(var A=0;A>>0),e.progress!=null&&(a.progress=e.progress>>>0),e.pushnames){if(!Array.isArray(e.pushnames))throw TypeError(".proto.HistorySync.pushnames: array expected");a.pushnames=[];for(var A=0;A=0&&(a.threadIdUserSecret=e.threadIdUserSecret)),e.threadDsTimeframeOffset!=null&&(a.threadDsTimeframeOffset=e.threadDsTimeframeOffset>>>0),e.recentStickers){if(!Array.isArray(e.recentStickers))throw TypeError(".proto.HistorySync.recentStickers: array expected");a.recentStickers=[];for(var A=0;A=0&&(a.shareableChatIdentifierEncryptionKey=e.shareableChatIdentifierEncryptionKey)),e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.HistorySync.accounts: array expected");a.accounts=[];for(var A=0;A>>3){case 1:{s.message=p.proto.WebMessageInfo.decode(e,e.uint32());break}case 2:{s.msgOrderId=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HistorySyncMsg)return e;var a=new p.proto.HistorySyncMsg;if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.HistorySyncMsg.message: object expected");a.message=p.proto.WebMessageInfo.fromObject(e.message)}return e.msgOrderId!=null&&(l.Long?(a.msgOrderId=l.Long.fromValue(e.msgOrderId)).unsigned=!0:typeof e.msgOrderId=="string"?a.msgOrderId=parseInt(e.msgOrderId,10):typeof e.msgOrderId=="number"?a.msgOrderId=e.msgOrderId:typeof e.msgOrderId=="object"&&(a.msgOrderId=new l.LongBits(e.msgOrderId.low>>>0,e.msgOrderId.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.WebMessageInfo.toObject(e.message,a),a.oneofs&&(A._message="message")),e.msgOrderId!=null&&e.hasOwnProperty("msgOrderId")&&(typeof e.msgOrderId=="number"?A.msgOrderId=a.longs===String?String(e.msgOrderId):e.msgOrderId:A.msgOrderId=a.longs===String?ge(e.msgOrderId,!0):a.longs===Number?ce(e.msgOrderId,!0):e.msgOrderId,a.oneofs&&(A._msgOrderId="msgOrderId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HistorySyncMsg"},t})(),n.HydratedTemplateButton=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.decode(e,e.uint32());break}case 3:{s.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.HydratedTemplateButton)return e;var a=new p.proto.HydratedTemplateButton;if(e.index!=null&&(a.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected");a.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected");a.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.HydratedTemplateButton.callButton: object expected");a.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.fromObject(e.callButton)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(e.quickReplyButton,a),a.oneofs&&(A.hydratedButton="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.toObject(e.urlButton,a),a.oneofs&&(A.hydratedButton="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.toObject(e.callButton,a),a.oneofs&&(A.hydratedButton="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,a.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HydratedTemplateButton"},t.HydratedCallButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.phoneNumber=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedCallButton)return A;var r=new p.proto.HydratedTemplateButton.HydratedCallButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.phoneNumber!=null&&(r.phoneNumber=String(A.phoneNumber)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=A.phoneNumber,r.oneofs&&(s._phoneNumber="phoneNumber")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedCallButton"},i})(),t.HydratedQuickReplyButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedQuickReplyButton)return A;var r=new p.proto.HydratedTemplateButton.HydratedQuickReplyButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.id!=null&&(r.id=String(A.id)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedQuickReplyButton"},i})(),t.HydratedURLButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.url=A.string();break}case 3:{c.consentedUsersUrl=A.string();break}case 4:{c.webviewPresentation=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedURLButton)return A;var r=new p.proto.HydratedTemplateButton.HydratedURLButton;switch(A.displayText!=null&&(r.displayText=String(A.displayText)),A.url!=null&&(r.url=String(A.url)),A.consentedUsersUrl!=null&&(r.consentedUsersUrl=String(A.consentedUsersUrl)),A.webviewPresentation){default:if(typeof A.webviewPresentation=="number"){r.webviewPresentation=A.webviewPresentation;break}break;case"FULL":case 1:r.webviewPresentation=1;break;case"TALL":case 2:r.webviewPresentation=2;break;case"COMPACT":case 3:r.webviewPresentation=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.consentedUsersUrl!=null&&A.hasOwnProperty("consentedUsersUrl")&&(s.consentedUsersUrl=A.consentedUsersUrl,r.oneofs&&(s._consentedUsersUrl="consentedUsersUrl")),A.webviewPresentation!=null&&A.hasOwnProperty("webviewPresentation")&&(s.webviewPresentation=r.enums===String?p.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]===void 0?A.webviewPresentation:p.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]:A.webviewPresentation,r.oneofs&&(s._webviewPresentation="webviewPresentation")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedURLButton"},i.WebviewPresentationType=(function(){let a={},A=Object.create(a);return A[a[1]="FULL"]=1,A[a[2]="TALL"]=2,A[a[3]="COMPACT"]=3,A})(),i})(),t})(),n.IdentityKeyPairStructure=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.IdentityKeyPairStructure)return e;var a=new p.proto.IdentityKeyPairStructure;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.IdentityKeyPairStructure"},t})(),n.InThreadSurveyMetadata=(function(){function t(i){if(this.questions=[],this.privacyStatementParts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.tessaSessionId=e.string();break}case 2:{s.simonSessionId=e.string();break}case 3:{s.simonSurveyId=e.string();break}case 4:{s.tessaRootId=e.string();break}case 5:{s.requestId=e.string();break}case 6:{s.tessaEvent=e.string();break}case 7:{s.invitationHeaderText=e.string();break}case 8:{s.invitationBodyText=e.string();break}case 9:{s.invitationCtaText=e.string();break}case 10:{s.invitationCtaUrl=e.string();break}case 11:{s.surveyTitle=e.string();break}case 12:{s.questions&&s.questions.length||(s.questions=[]),s.questions.push(p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.decode(e,e.uint32()));break}case 13:{s.surveyContinueButtonText=e.string();break}case 14:{s.surveySubmitButtonText=e.string();break}case 15:{s.privacyStatementFull=e.string();break}case 16:{s.privacyStatementParts&&s.privacyStatementParts.length||(s.privacyStatementParts=[]),s.privacyStatementParts.push(p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.decode(e,e.uint32()));break}case 17:{s.feedbackToastText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.InThreadSurveyMetadata)return e;var a=new p.proto.InThreadSurveyMetadata;if(e.tessaSessionId!=null&&(a.tessaSessionId=String(e.tessaSessionId)),e.simonSessionId!=null&&(a.simonSessionId=String(e.simonSessionId)),e.simonSurveyId!=null&&(a.simonSurveyId=String(e.simonSurveyId)),e.tessaRootId!=null&&(a.tessaRootId=String(e.tessaRootId)),e.requestId!=null&&(a.requestId=String(e.requestId)),e.tessaEvent!=null&&(a.tessaEvent=String(e.tessaEvent)),e.invitationHeaderText!=null&&(a.invitationHeaderText=String(e.invitationHeaderText)),e.invitationBodyText!=null&&(a.invitationBodyText=String(e.invitationBodyText)),e.invitationCtaText!=null&&(a.invitationCtaText=String(e.invitationCtaText)),e.invitationCtaUrl!=null&&(a.invitationCtaUrl=String(e.invitationCtaUrl)),e.surveyTitle!=null&&(a.surveyTitle=String(e.surveyTitle)),e.questions){if(!Array.isArray(e.questions))throw TypeError(".proto.InThreadSurveyMetadata.questions: array expected");a.questions=[];for(var A=0;A>>3){case 1:{c.stringValue=A.string();break}case 2:{c.numericValue=A.uint32();break}case 3:{c.textTranslated=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyOption)return A;var r=new p.proto.InThreadSurveyMetadata.InThreadSurveyOption;return A.stringValue!=null&&(r.stringValue=String(A.stringValue)),A.numericValue!=null&&(r.numericValue=A.numericValue>>>0),A.textTranslated!=null&&(r.textTranslated=String(A.textTranslated)),r},i.toObject=function(A,r){r||(r={});var s={};return A.stringValue!=null&&A.hasOwnProperty("stringValue")&&(s.stringValue=A.stringValue,r.oneofs&&(s._stringValue="stringValue")),A.numericValue!=null&&A.hasOwnProperty("numericValue")&&(s.numericValue=A.numericValue,r.oneofs&&(s._numericValue="numericValue")),A.textTranslated!=null&&A.hasOwnProperty("textTranslated")&&(s.textTranslated=A.textTranslated,r.oneofs&&(s._textTranslated="textTranslated")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyOption"},i})(),t.InThreadSurveyPrivacyStatementPart=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.url=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart)return A;var r=new p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart;return A.text!=null&&(r.text=String(A.text)),A.url!=null&&(r.url=String(A.url)),r},i.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart"},i})(),t.InThreadSurveyQuestion=(function(){function i(a){if(this.questionOptions=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.questionText=A.string();break}case 2:{c.questionId=A.string();break}case 3:{c.questionOptions&&c.questionOptions.length||(c.questionOptions=[]),c.questionOptions.push(p.proto.InThreadSurveyMetadata.InThreadSurveyOption.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion)return A;var r=new p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion;if(A.questionText!=null&&(r.questionText=String(A.questionText)),A.questionId!=null&&(r.questionId=String(A.questionId)),A.questionOptions){if(!Array.isArray(A.questionOptions))throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: array expected");r.questionOptions=[];for(var s=0;s>>3){case 1:{s.polygonVertices&&s.polygonVertices.length||(s.polygonVertices=[]),s.polygonVertices.push(p.proto.Point.decode(e,e.uint32()));break}case 4:{s.shouldSkipConfirmation=e.bool();break}case 5:{s.embeddedContent=p.proto.EmbeddedContent.decode(e,e.uint32());break}case 8:{s.statusLinkType=e.int32();break}case 2:{s.location=p.proto.Location.decode(e,e.uint32());break}case 3:{s.newsletter=p.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 6:{s.embeddedAction=e.bool();break}case 7:{s.tapAction=p.proto.TapLinkAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.InteractiveAnnotation)return e;var a=new p.proto.InteractiveAnnotation;if(e.polygonVertices){if(!Array.isArray(e.polygonVertices))throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected");a.polygonVertices=[];for(var A=0;A>>3){case 1:{s.isGalaxyFlowCompleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.InteractiveMessageAdditionalMetadata)return e;var a=new p.proto.InteractiveMessageAdditionalMetadata;return e.isGalaxyFlowCompleted!=null&&(a.isGalaxyFlowCompleted=!!e.isGalaxyFlowCompleted),a},t.toObject=function(e,a){a||(a={});var A={};return e.isGalaxyFlowCompleted!=null&&e.hasOwnProperty("isGalaxyFlowCompleted")&&(A.isGalaxyFlowCompleted=e.isGalaxyFlowCompleted,a.oneofs&&(A._isGalaxyFlowCompleted="isGalaxyFlowCompleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.InteractiveMessageAdditionalMetadata"},t})(),n.KeepInChat=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.keepType=e.int32();break}case 2:{s.serverTimestamp=e.int64();break}case 3:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 4:{s.deviceJid=e.string();break}case 5:{s.clientTimestampMs=e.int64();break}case 6:{s.serverTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.KeepInChat)return e;var a=new p.proto.KeepInChat;switch(e.keepType){default:if(typeof e.keepType=="number"){a.keepType=e.keepType;break}break;case"UNKNOWN":case 0:a.keepType=0;break;case"KEEP_FOR_ALL":case 1:a.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:a.keepType=2;break}if(e.serverTimestamp!=null&&(l.Long?(a.serverTimestamp=l.Long.fromValue(e.serverTimestamp)).unsigned=!1:typeof e.serverTimestamp=="string"?a.serverTimestamp=parseInt(e.serverTimestamp,10):typeof e.serverTimestamp=="number"?a.serverTimestamp=e.serverTimestamp:typeof e.serverTimestamp=="object"&&(a.serverTimestamp=new l.LongBits(e.serverTimestamp.low>>>0,e.serverTimestamp.high>>>0).toNumber())),e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.KeepInChat.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}return e.deviceJid!=null&&(a.deviceJid=String(e.deviceJid)),e.clientTimestampMs!=null&&(l.Long?(a.clientTimestampMs=l.Long.fromValue(e.clientTimestampMs)).unsigned=!1:typeof e.clientTimestampMs=="string"?a.clientTimestampMs=parseInt(e.clientTimestampMs,10):typeof e.clientTimestampMs=="number"?a.clientTimestampMs=e.clientTimestampMs:typeof e.clientTimestampMs=="object"&&(a.clientTimestampMs=new l.LongBits(e.clientTimestampMs.low>>>0,e.clientTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.keepType!=null&&e.hasOwnProperty("keepType")&&(A.keepType=a.enums===String?p.proto.KeepType[e.keepType]===void 0?e.keepType:p.proto.KeepType[e.keepType]:e.keepType,a.oneofs&&(A._keepType="keepType")),e.serverTimestamp!=null&&e.hasOwnProperty("serverTimestamp")&&(typeof e.serverTimestamp=="number"?A.serverTimestamp=a.longs===String?String(e.serverTimestamp):e.serverTimestamp:A.serverTimestamp=a.longs===String?ge(e.serverTimestamp):a.longs===Number?ce(e.serverTimestamp):e.serverTimestamp,a.oneofs&&(A._serverTimestamp="serverTimestamp")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.deviceJid!=null&&e.hasOwnProperty("deviceJid")&&(A.deviceJid=e.deviceJid,a.oneofs&&(A._deviceJid="deviceJid")),e.clientTimestampMs!=null&&e.hasOwnProperty("clientTimestampMs")&&(typeof e.clientTimestampMs=="number"?A.clientTimestampMs=a.longs===String?String(e.clientTimestampMs):e.clientTimestampMs:A.clientTimestampMs=a.longs===String?ge(e.clientTimestampMs):a.longs===Number?ce(e.clientTimestampMs):e.clientTimestampMs,a.oneofs&&(A._clientTimestampMs="clientTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeepInChat"},t})(),n.KeepType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN"]=0,o[t[1]="KEEP_FOR_ALL"]=1,o[t[2]="UNDO_KEEP_FOR_ALL"]=2,o})(),n.KeyExchangeMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.ratchetKey=e.bytes();break}case 4:{s.identityKey=e.bytes();break}case 5:{s.baseKeySignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.KeyExchangeMessage)return e;var a=new p.proto.KeyExchangeMessage;return e.id!=null&&(a.id=e.id>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,a.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(a.baseKey=e.baseKey)),e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,a.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(a.ratchetKey=e.ratchetKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,a.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(a.identityKey=e.identityKey)),e.baseKeySignature!=null&&(typeof e.baseKeySignature=="string"?l.base64.decode(e.baseKeySignature,a.baseKeySignature=l.newBuffer(l.base64.length(e.baseKeySignature)),0):e.baseKeySignature.length>=0&&(a.baseKeySignature=e.baseKeySignature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=a.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):a.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,a.oneofs&&(A._baseKey="baseKey")),e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=a.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):a.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,a.oneofs&&(A._ratchetKey="ratchetKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=a.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):a.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,a.oneofs&&(A._identityKey="identityKey")),e.baseKeySignature!=null&&e.hasOwnProperty("baseKeySignature")&&(A.baseKeySignature=a.bytes===String?l.base64.encode(e.baseKeySignature,0,e.baseKeySignature.length):a.bytes===Array?Array.prototype.slice.call(e.baseKeySignature):e.baseKeySignature,a.oneofs&&(A._baseKeySignature="baseKeySignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyExchangeMessage"},t})(),n.KeyId=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.KeyId)return e;var a=new p.proto.KeyId;return e.id!=null&&(typeof e.id=="string"?l.base64.decode(e.id,a.id=l.newBuffer(l.base64.length(e.id)),0):e.id.length>=0&&(a.id=e.id)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=a.bytes===String?l.base64.encode(e.id,0,e.id.length):a.bytes===Array?Array.prototype.slice.call(e.id):e.id,a.oneofs&&(A._id="id")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyId"},t})(),n.LIDMigrationMapping=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pn=e.uint64();break}case 2:{s.assignedLid=e.uint64();break}case 3:{s.latestLid=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMapping)return e;var a=new p.proto.LIDMigrationMapping;return e.pn!=null&&(l.Long?(a.pn=l.Long.fromValue(e.pn)).unsigned=!0:typeof e.pn=="string"?a.pn=parseInt(e.pn,10):typeof e.pn=="number"?a.pn=e.pn:typeof e.pn=="object"&&(a.pn=new l.LongBits(e.pn.low>>>0,e.pn.high>>>0).toNumber(!0))),e.assignedLid!=null&&(l.Long?(a.assignedLid=l.Long.fromValue(e.assignedLid)).unsigned=!0:typeof e.assignedLid=="string"?a.assignedLid=parseInt(e.assignedLid,10):typeof e.assignedLid=="number"?a.assignedLid=e.assignedLid:typeof e.assignedLid=="object"&&(a.assignedLid=new l.LongBits(e.assignedLid.low>>>0,e.assignedLid.high>>>0).toNumber(!0))),e.latestLid!=null&&(l.Long?(a.latestLid=l.Long.fromValue(e.latestLid)).unsigned=!0:typeof e.latestLid=="string"?a.latestLid=parseInt(e.latestLid,10):typeof e.latestLid=="number"?a.latestLid=e.latestLid:typeof e.latestLid=="object"&&(a.latestLid=new l.LongBits(e.latestLid.low>>>0,e.latestLid.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};if(a.defaults){if(l.Long){var r=new l.Long(0,0,!0);A.pn=a.longs===String?r.toString():a.longs===Number?r.toNumber():r}else A.pn=a.longs===String?"0":0;if(l.Long){var r=new l.Long(0,0,!0);A.assignedLid=a.longs===String?r.toString():a.longs===Number?r.toNumber():r}else A.assignedLid=a.longs===String?"0":0}return e.pn!=null&&e.hasOwnProperty("pn")&&(typeof e.pn=="number"?A.pn=a.longs===String?String(e.pn):e.pn:A.pn=a.longs===String?ge(e.pn,!0):a.longs===Number?ce(e.pn,!0):e.pn),e.assignedLid!=null&&e.hasOwnProperty("assignedLid")&&(typeof e.assignedLid=="number"?A.assignedLid=a.longs===String?String(e.assignedLid):e.assignedLid:A.assignedLid=a.longs===String?ge(e.assignedLid,!0):a.longs===Number?ce(e.assignedLid,!0):e.assignedLid),e.latestLid!=null&&e.hasOwnProperty("latestLid")&&(typeof e.latestLid=="number"?A.latestLid=a.longs===String?String(e.latestLid):e.latestLid:A.latestLid=a.longs===String?ge(e.latestLid,!0):a.longs===Number?ce(e.latestLid,!0):e.latestLid,a.oneofs&&(A._latestLid="latestLid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMapping"},t})(),n.LIDMigrationMappingSyncMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encodedMappingPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMappingSyncMessage)return e;var a=new p.proto.LIDMigrationMappingSyncMessage;return e.encodedMappingPayload!=null&&(typeof e.encodedMappingPayload=="string"?l.base64.decode(e.encodedMappingPayload,a.encodedMappingPayload=l.newBuffer(l.base64.length(e.encodedMappingPayload)),0):e.encodedMappingPayload.length>=0&&(a.encodedMappingPayload=e.encodedMappingPayload)),a},t.toObject=function(e,a){a||(a={});var A={};return e.encodedMappingPayload!=null&&e.hasOwnProperty("encodedMappingPayload")&&(A.encodedMappingPayload=a.bytes===String?l.base64.encode(e.encodedMappingPayload,0,e.encodedMappingPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encodedMappingPayload):e.encodedMappingPayload,a.oneofs&&(A._encodedMappingPayload="encodedMappingPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMappingSyncMessage"},t})(),n.LIDMigrationMappingSyncPayload=(function(){function t(i){if(this.pnToLidMappings=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pnToLidMappings&&s.pnToLidMappings.length||(s.pnToLidMappings=[]),s.pnToLidMappings.push(p.proto.LIDMigrationMapping.decode(e,e.uint32()));break}case 2:{s.chatDbMigrationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMappingSyncPayload)return e;var a=new p.proto.LIDMigrationMappingSyncPayload;if(e.pnToLidMappings){if(!Array.isArray(e.pnToLidMappings))throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected");a.pnToLidMappings=[];for(var A=0;A>>0,e.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.pnToLidMappings=[]),e.pnToLidMappings&&e.pnToLidMappings.length){A.pnToLidMappings=[];for(var r=0;r>>3){case 1:{s.eventResponseMessage=p.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 2:{s.pollVote=p.proto.Message.PollVoteMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LegacyMessage)return e;var a=new p.proto.LegacyMessage;if(e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected");a.eventResponseMessage=p.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}if(e.pollVote!=null){if(typeof e.pollVote!="object")throw TypeError(".proto.LegacyMessage.pollVote: object expected");a.pollVote=p.proto.Message.PollVoteMessage.fromObject(e.pollVote)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=p.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,a),a.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.pollVote!=null&&e.hasOwnProperty("pollVote")&&(A.pollVote=p.proto.Message.PollVoteMessage.toObject(e.pollVote,a),a.oneofs&&(A._pollVote="pollVote")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LegacyMessage"},t})(),n.LimitSharing=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sharingLimited=e.bool();break}case 2:{s.trigger=e.int32();break}case 3:{s.limitSharingSettingTimestamp=e.int64();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LimitSharing)return e;var a=new p.proto.LimitSharing;switch(e.sharingLimited!=null&&(a.sharingLimited=!!e.sharingLimited),e.trigger){default:if(typeof e.trigger=="number"){a.trigger=e.trigger;break}break;case"UNKNOWN":case 0:a.trigger=0;break;case"CHAT_SETTING":case 1:a.trigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:a.trigger=2;break;case"UNKNOWN_GROUP":case 3:a.trigger=3;break}return e.limitSharingSettingTimestamp!=null&&(l.Long?(a.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?a.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?a.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(a.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.initiatedByMe!=null&&(a.initiatedByMe=!!e.initiatedByMe),a},t.toObject=function(e,a){a||(a={});var A={};return e.sharingLimited!=null&&e.hasOwnProperty("sharingLimited")&&(A.sharingLimited=e.sharingLimited,a.oneofs&&(A._sharingLimited="sharingLimited")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=a.enums===String?p.proto.LimitSharing.TriggerType[e.trigger]===void 0?e.trigger:p.proto.LimitSharing.TriggerType[e.trigger]:e.trigger,a.oneofs&&(A._trigger="trigger")),e.limitSharingSettingTimestamp!=null&&e.hasOwnProperty("limitSharingSettingTimestamp")&&(typeof e.limitSharingSettingTimestamp=="number"?A.limitSharingSettingTimestamp=a.longs===String?String(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp:A.limitSharingSettingTimestamp=a.longs===String?ge(e.limitSharingSettingTimestamp):a.longs===Number?ce(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp,a.oneofs&&(A._limitSharingSettingTimestamp="limitSharingSettingTimestamp")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,a.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LimitSharing"},t.TriggerType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT_SETTING"]=1,e[i[2]="BIZ_SUPPORTS_FB_HOSTING"]=2,e[i[3]="UNKNOWN_GROUP"]=3,e})(),t})(),n.LocalizedName=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lg=e.string();break}case 2:{s.lc=e.string();break}case 3:{s.verifiedName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.LocalizedName)return e;var a=new p.proto.LocalizedName;return e.lg!=null&&(a.lg=String(e.lg)),e.lc!=null&&(a.lc=String(e.lc)),e.verifiedName!=null&&(a.verifiedName=String(e.verifiedName)),a},t.toObject=function(e,a){a||(a={});var A={};return e.lg!=null&&e.hasOwnProperty("lg")&&(A.lg=e.lg,a.oneofs&&(A._lg="lg")),e.lc!=null&&e.hasOwnProperty("lc")&&(A.lc=e.lc,a.oneofs&&(A._lc="lc")),e.verifiedName!=null&&e.hasOwnProperty("verifiedName")&&(A.verifiedName=e.verifiedName,a.oneofs&&(A._verifiedName="verifiedName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LocalizedName"},t})(),n.Location=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.degreesLatitude=e.double();break}case 2:{s.degreesLongitude=e.double();break}case 3:{s.name=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Location)return e;var a=new p.proto.Location;return e.degreesLatitude!=null&&(a.degreesLatitude=Number(e.degreesLatitude)),e.degreesLongitude!=null&&(a.degreesLongitude=Number(e.degreesLongitude)),e.name!=null&&(a.name=String(e.name)),a},t.toObject=function(e,a){a||(a={});var A={};return e.degreesLatitude!=null&&e.hasOwnProperty("degreesLatitude")&&(A.degreesLatitude=a.json&&!isFinite(e.degreesLatitude)?String(e.degreesLatitude):e.degreesLatitude,a.oneofs&&(A._degreesLatitude="degreesLatitude")),e.degreesLongitude!=null&&e.hasOwnProperty("degreesLongitude")&&(A.degreesLongitude=a.json&&!isFinite(e.degreesLongitude)?String(e.degreesLongitude):e.degreesLongitude,a.oneofs&&(A._degreesLongitude="degreesLongitude")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,a.oneofs&&(A._name="name")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Location"},t})(),n.MediaData=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.localPath=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MediaData)return e;var a=new p.proto.MediaData;return e.localPath!=null&&(a.localPath=String(e.localPath)),a},t.toObject=function(e,a){a||(a={});var A={};return e.localPath!=null&&e.hasOwnProperty("localPath")&&(A.localPath=e.localPath,a.oneofs&&(A._localPath="localPath")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaData"},t})(),n.MediaNotifyMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.expressPathUrl=e.string();break}case 2:{s.fileEncSha256=e.bytes();break}case 3:{s.fileLength=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MediaNotifyMessage)return e;var a=new p.proto.MediaNotifyMessage;return e.expressPathUrl!=null&&(a.expressPathUrl=String(e.expressPathUrl)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.expressPathUrl!=null&&e.hasOwnProperty("expressPathUrl")&&(A.expressPathUrl=e.expressPathUrl,a.oneofs&&(A._expressPathUrl="expressPathUrl")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?ge(e.fileLength,!0):a.longs===Number?ce(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaNotifyMessage"},t})(),n.MediaRetryNotification=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.directPath=e.string();break}case 3:{s.result=e.int32();break}case 4:{s.messageSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MediaRetryNotification)return e;var a=new p.proto.MediaRetryNotification;switch(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.result){default:if(typeof e.result=="number"){a.result=e.result;break}break;case"GENERAL_ERROR":case 0:a.result=0;break;case"SUCCESS":case 1:a.result=1;break;case"NOT_FOUND":case 2:a.result=2;break;case"DECRYPTION_ERROR":case 3:a.result=3;break}return e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),a},t.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.result!=null&&e.hasOwnProperty("result")&&(A.result=a.enums===String?p.proto.MediaRetryNotification.ResultType[e.result]===void 0?e.result:p.proto.MediaRetryNotification.ResultType[e.result]:e.result,a.oneofs&&(A._result="result")),e.messageSecret!=null&&e.hasOwnProperty("messageSecret")&&(A.messageSecret=a.bytes===String?l.base64.encode(e.messageSecret,0,e.messageSecret.length):a.bytes===Array?Array.prototype.slice.call(e.messageSecret):e.messageSecret,a.oneofs&&(A._messageSecret="messageSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaRetryNotification"},t.ResultType=(function(){let i={},e=Object.create(i);return e[i[0]="GENERAL_ERROR"]=0,e[i[1]="SUCCESS"]=1,e[i[2]="NOT_FOUND"]=2,e[i[3]="DECRYPTION_ERROR"]=3,e})(),t})(),n.MediaVisibility=(function(){let t={},o=Object.create(t);return o[t[0]="DEFAULT"]=0,o[t[1]="OFF"]=1,o[t[2]="ON"]=2,o})(),n.MemberLabel=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.label=e.string();break}case 2:{s.labelTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MemberLabel)return e;var a=new p.proto.MemberLabel;return e.label!=null&&(a.label=String(e.label)),e.labelTimestamp!=null&&(l.Long?(a.labelTimestamp=l.Long.fromValue(e.labelTimestamp)).unsigned=!1:typeof e.labelTimestamp=="string"?a.labelTimestamp=parseInt(e.labelTimestamp,10):typeof e.labelTimestamp=="number"?a.labelTimestamp=e.labelTimestamp:typeof e.labelTimestamp=="object"&&(a.labelTimestamp=new l.LongBits(e.labelTimestamp.low>>>0,e.labelTimestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.label!=null&&e.hasOwnProperty("label")&&(A.label=e.label,a.oneofs&&(A._label="label")),e.labelTimestamp!=null&&e.hasOwnProperty("labelTimestamp")&&(typeof e.labelTimestamp=="number"?A.labelTimestamp=a.longs===String?String(e.labelTimestamp):e.labelTimestamp:A.labelTimestamp=a.longs===String?ge(e.labelTimestamp):a.longs===Number?ce(e.labelTimestamp):e.labelTimestamp,a.oneofs&&(A._labelTimestamp="labelTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MemberLabel"},t})(),n.Message=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.conversation=e.string();break}case 2:{s.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 3:{s.imageMessage=p.proto.Message.ImageMessage.decode(e,e.uint32());break}case 4:{s.contactMessage=p.proto.Message.ContactMessage.decode(e,e.uint32());break}case 5:{s.locationMessage=p.proto.Message.LocationMessage.decode(e,e.uint32());break}case 6:{s.extendedTextMessage=p.proto.Message.ExtendedTextMessage.decode(e,e.uint32());break}case 7:{s.documentMessage=p.proto.Message.DocumentMessage.decode(e,e.uint32());break}case 8:{s.audioMessage=p.proto.Message.AudioMessage.decode(e,e.uint32());break}case 9:{s.videoMessage=p.proto.Message.VideoMessage.decode(e,e.uint32());break}case 10:{s.call=p.proto.Message.Call.decode(e,e.uint32());break}case 11:{s.chat=p.proto.Message.Chat.decode(e,e.uint32());break}case 12:{s.protocolMessage=p.proto.Message.ProtocolMessage.decode(e,e.uint32());break}case 13:{s.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.decode(e,e.uint32());break}case 14:{s.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.decode(e,e.uint32());break}case 15:{s.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 16:{s.sendPaymentMessage=p.proto.Message.SendPaymentMessage.decode(e,e.uint32());break}case 18:{s.liveLocationMessage=p.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 22:{s.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.decode(e,e.uint32());break}case 23:{s.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.decode(e,e.uint32());break}case 24:{s.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.decode(e,e.uint32());break}case 25:{s.templateMessage=p.proto.Message.TemplateMessage.decode(e,e.uint32());break}case 26:{s.stickerMessage=p.proto.Message.StickerMessage.decode(e,e.uint32());break}case 28:{s.groupInviteMessage=p.proto.Message.GroupInviteMessage.decode(e,e.uint32());break}case 29:{s.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.decode(e,e.uint32());break}case 30:{s.productMessage=p.proto.Message.ProductMessage.decode(e,e.uint32());break}case 31:{s.deviceSentMessage=p.proto.Message.DeviceSentMessage.decode(e,e.uint32());break}case 35:{s.messageContextInfo=p.proto.MessageContextInfo.decode(e,e.uint32());break}case 36:{s.listMessage=p.proto.Message.ListMessage.decode(e,e.uint32());break}case 37:{s.viewOnceMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 38:{s.orderMessage=p.proto.Message.OrderMessage.decode(e,e.uint32());break}case 39:{s.listResponseMessage=p.proto.Message.ListResponseMessage.decode(e,e.uint32());break}case 40:{s.ephemeralMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 41:{s.invoiceMessage=p.proto.Message.InvoiceMessage.decode(e,e.uint32());break}case 42:{s.buttonsMessage=p.proto.Message.ButtonsMessage.decode(e,e.uint32());break}case 43:{s.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.decode(e,e.uint32());break}case 44:{s.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.decode(e,e.uint32());break}case 45:{s.interactiveMessage=p.proto.Message.InteractiveMessage.decode(e,e.uint32());break}case 46:{s.reactionMessage=p.proto.Message.ReactionMessage.decode(e,e.uint32());break}case 47:{s.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.decode(e,e.uint32());break}case 48:{s.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.decode(e,e.uint32());break}case 49:{s.pollCreationMessage=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 50:{s.pollUpdateMessage=p.proto.Message.PollUpdateMessage.decode(e,e.uint32());break}case 51:{s.keepInChatMessage=p.proto.Message.KeepInChatMessage.decode(e,e.uint32());break}case 53:{s.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 54:{s.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.decode(e,e.uint32());break}case 55:{s.viewOnceMessageV2=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 56:{s.encReactionMessage=p.proto.Message.EncReactionMessage.decode(e,e.uint32());break}case 58:{s.editedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 59:{s.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 60:{s.pollCreationMessageV2=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 61:{s.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.decode(e,e.uint32());break}case 62:{s.groupMentionedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 63:{s.pinInChatMessage=p.proto.Message.PinInChatMessage.decode(e,e.uint32());break}case 64:{s.pollCreationMessageV3=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 65:{s.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.decode(e,e.uint32());break}case 66:{s.ptvMessage=p.proto.Message.VideoMessage.decode(e,e.uint32());break}case 67:{s.botInvokeMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 69:{s.callLogMesssage=p.proto.Message.CallLogMessage.decode(e,e.uint32());break}case 70:{s.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 71:{s.encCommentMessage=p.proto.Message.EncCommentMessage.decode(e,e.uint32());break}case 72:{s.bcallMessage=p.proto.Message.BCallMessage.decode(e,e.uint32());break}case 74:{s.lottieStickerMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 75:{s.eventMessage=p.proto.Message.EventMessage.decode(e,e.uint32());break}case 76:{s.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.decode(e,e.uint32());break}case 77:{s.commentMessage=p.proto.Message.CommentMessage.decode(e,e.uint32());break}case 78:{s.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.decode(e,e.uint32());break}case 80:{s.placeholderMessage=p.proto.Message.PlaceholderMessage.decode(e,e.uint32());break}case 82:{s.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.decode(e,e.uint32());break}case 83:{s.albumMessage=p.proto.Message.AlbumMessage.decode(e,e.uint32());break}case 85:{s.eventCoverImage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 86:{s.stickerPackMessage=p.proto.Message.StickerPackMessage.decode(e,e.uint32());break}case 87:{s.statusMentionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 88:{s.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}case 90:{s.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 91:{s.associatedChildMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 92:{s.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 93:{s.pollCreationMessageV4=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 95:{s.statusAddYours=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 96:{s.groupStatusMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 97:{s.richResponseMessage=p.proto.AIRichResponseMessage.decode(e,e.uint32());break}case 98:{s.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.decode(e,e.uint32());break}case 99:{s.limitSharingMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 100:{s.botTaskMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 101:{s.questionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 102:{s.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.decode(e,e.uint32());break}case 103:{s.groupStatusMessageV2=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 104:{s.botForwardedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 105:{s.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.decode(e,e.uint32());break}case 106:{s.questionReplyMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 107:{s.questionResponseMessage=p.proto.Message.QuestionResponseMessage.decode(e,e.uint32());break}case 109:{s.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.decode(e,e.uint32());break}case 110:{s.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.decode(e,e.uint32());break}case 111:{s.pollCreationMessageV5=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 113:{s.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.decode(e,e.uint32());break}case 114:{s.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Message)return e;var a=new p.proto.Message;if(e.conversation!=null&&(a.conversation=String(e.conversation)),e.senderKeyDistributionMessage!=null){if(typeof e.senderKeyDistributionMessage!="object")throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected");a.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.fromObject(e.senderKeyDistributionMessage)}if(e.imageMessage!=null){if(typeof e.imageMessage!="object")throw TypeError(".proto.Message.imageMessage: object expected");a.imageMessage=p.proto.Message.ImageMessage.fromObject(e.imageMessage)}if(e.contactMessage!=null){if(typeof e.contactMessage!="object")throw TypeError(".proto.Message.contactMessage: object expected");a.contactMessage=p.proto.Message.ContactMessage.fromObject(e.contactMessage)}if(e.locationMessage!=null){if(typeof e.locationMessage!="object")throw TypeError(".proto.Message.locationMessage: object expected");a.locationMessage=p.proto.Message.LocationMessage.fromObject(e.locationMessage)}if(e.extendedTextMessage!=null){if(typeof e.extendedTextMessage!="object")throw TypeError(".proto.Message.extendedTextMessage: object expected");a.extendedTextMessage=p.proto.Message.ExtendedTextMessage.fromObject(e.extendedTextMessage)}if(e.documentMessage!=null){if(typeof e.documentMessage!="object")throw TypeError(".proto.Message.documentMessage: object expected");a.documentMessage=p.proto.Message.DocumentMessage.fromObject(e.documentMessage)}if(e.audioMessage!=null){if(typeof e.audioMessage!="object")throw TypeError(".proto.Message.audioMessage: object expected");a.audioMessage=p.proto.Message.AudioMessage.fromObject(e.audioMessage)}if(e.videoMessage!=null){if(typeof e.videoMessage!="object")throw TypeError(".proto.Message.videoMessage: object expected");a.videoMessage=p.proto.Message.VideoMessage.fromObject(e.videoMessage)}if(e.call!=null){if(typeof e.call!="object")throw TypeError(".proto.Message.call: object expected");a.call=p.proto.Message.Call.fromObject(e.call)}if(e.chat!=null){if(typeof e.chat!="object")throw TypeError(".proto.Message.chat: object expected");a.chat=p.proto.Message.Chat.fromObject(e.chat)}if(e.protocolMessage!=null){if(typeof e.protocolMessage!="object")throw TypeError(".proto.Message.protocolMessage: object expected");a.protocolMessage=p.proto.Message.ProtocolMessage.fromObject(e.protocolMessage)}if(e.contactsArrayMessage!=null){if(typeof e.contactsArrayMessage!="object")throw TypeError(".proto.Message.contactsArrayMessage: object expected");a.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.fromObject(e.contactsArrayMessage)}if(e.highlyStructuredMessage!=null){if(typeof e.highlyStructuredMessage!="object")throw TypeError(".proto.Message.highlyStructuredMessage: object expected");a.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.fromObject(e.highlyStructuredMessage)}if(e.fastRatchetKeySenderKeyDistributionMessage!=null){if(typeof e.fastRatchetKeySenderKeyDistributionMessage!="object")throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected");a.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.fromObject(e.fastRatchetKeySenderKeyDistributionMessage)}if(e.sendPaymentMessage!=null){if(typeof e.sendPaymentMessage!="object")throw TypeError(".proto.Message.sendPaymentMessage: object expected");a.sendPaymentMessage=p.proto.Message.SendPaymentMessage.fromObject(e.sendPaymentMessage)}if(e.liveLocationMessage!=null){if(typeof e.liveLocationMessage!="object")throw TypeError(".proto.Message.liveLocationMessage: object expected");a.liveLocationMessage=p.proto.Message.LiveLocationMessage.fromObject(e.liveLocationMessage)}if(e.requestPaymentMessage!=null){if(typeof e.requestPaymentMessage!="object")throw TypeError(".proto.Message.requestPaymentMessage: object expected");a.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.fromObject(e.requestPaymentMessage)}if(e.declinePaymentRequestMessage!=null){if(typeof e.declinePaymentRequestMessage!="object")throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected");a.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.fromObject(e.declinePaymentRequestMessage)}if(e.cancelPaymentRequestMessage!=null){if(typeof e.cancelPaymentRequestMessage!="object")throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected");a.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.fromObject(e.cancelPaymentRequestMessage)}if(e.templateMessage!=null){if(typeof e.templateMessage!="object")throw TypeError(".proto.Message.templateMessage: object expected");a.templateMessage=p.proto.Message.TemplateMessage.fromObject(e.templateMessage)}if(e.stickerMessage!=null){if(typeof e.stickerMessage!="object")throw TypeError(".proto.Message.stickerMessage: object expected");a.stickerMessage=p.proto.Message.StickerMessage.fromObject(e.stickerMessage)}if(e.groupInviteMessage!=null){if(typeof e.groupInviteMessage!="object")throw TypeError(".proto.Message.groupInviteMessage: object expected");a.groupInviteMessage=p.proto.Message.GroupInviteMessage.fromObject(e.groupInviteMessage)}if(e.templateButtonReplyMessage!=null){if(typeof e.templateButtonReplyMessage!="object")throw TypeError(".proto.Message.templateButtonReplyMessage: object expected");a.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.fromObject(e.templateButtonReplyMessage)}if(e.productMessage!=null){if(typeof e.productMessage!="object")throw TypeError(".proto.Message.productMessage: object expected");a.productMessage=p.proto.Message.ProductMessage.fromObject(e.productMessage)}if(e.deviceSentMessage!=null){if(typeof e.deviceSentMessage!="object")throw TypeError(".proto.Message.deviceSentMessage: object expected");a.deviceSentMessage=p.proto.Message.DeviceSentMessage.fromObject(e.deviceSentMessage)}if(e.messageContextInfo!=null){if(typeof e.messageContextInfo!="object")throw TypeError(".proto.Message.messageContextInfo: object expected");a.messageContextInfo=p.proto.MessageContextInfo.fromObject(e.messageContextInfo)}if(e.listMessage!=null){if(typeof e.listMessage!="object")throw TypeError(".proto.Message.listMessage: object expected");a.listMessage=p.proto.Message.ListMessage.fromObject(e.listMessage)}if(e.viewOnceMessage!=null){if(typeof e.viewOnceMessage!="object")throw TypeError(".proto.Message.viewOnceMessage: object expected");a.viewOnceMessage=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessage)}if(e.orderMessage!=null){if(typeof e.orderMessage!="object")throw TypeError(".proto.Message.orderMessage: object expected");a.orderMessage=p.proto.Message.OrderMessage.fromObject(e.orderMessage)}if(e.listResponseMessage!=null){if(typeof e.listResponseMessage!="object")throw TypeError(".proto.Message.listResponseMessage: object expected");a.listResponseMessage=p.proto.Message.ListResponseMessage.fromObject(e.listResponseMessage)}if(e.ephemeralMessage!=null){if(typeof e.ephemeralMessage!="object")throw TypeError(".proto.Message.ephemeralMessage: object expected");a.ephemeralMessage=p.proto.Message.FutureProofMessage.fromObject(e.ephemeralMessage)}if(e.invoiceMessage!=null){if(typeof e.invoiceMessage!="object")throw TypeError(".proto.Message.invoiceMessage: object expected");a.invoiceMessage=p.proto.Message.InvoiceMessage.fromObject(e.invoiceMessage)}if(e.buttonsMessage!=null){if(typeof e.buttonsMessage!="object")throw TypeError(".proto.Message.buttonsMessage: object expected");a.buttonsMessage=p.proto.Message.ButtonsMessage.fromObject(e.buttonsMessage)}if(e.buttonsResponseMessage!=null){if(typeof e.buttonsResponseMessage!="object")throw TypeError(".proto.Message.buttonsResponseMessage: object expected");a.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.fromObject(e.buttonsResponseMessage)}if(e.paymentInviteMessage!=null){if(typeof e.paymentInviteMessage!="object")throw TypeError(".proto.Message.paymentInviteMessage: object expected");a.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.fromObject(e.paymentInviteMessage)}if(e.interactiveMessage!=null){if(typeof e.interactiveMessage!="object")throw TypeError(".proto.Message.interactiveMessage: object expected");a.interactiveMessage=p.proto.Message.InteractiveMessage.fromObject(e.interactiveMessage)}if(e.reactionMessage!=null){if(typeof e.reactionMessage!="object")throw TypeError(".proto.Message.reactionMessage: object expected");a.reactionMessage=p.proto.Message.ReactionMessage.fromObject(e.reactionMessage)}if(e.stickerSyncRmrMessage!=null){if(typeof e.stickerSyncRmrMessage!="object")throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected");a.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.fromObject(e.stickerSyncRmrMessage)}if(e.interactiveResponseMessage!=null){if(typeof e.interactiveResponseMessage!="object")throw TypeError(".proto.Message.interactiveResponseMessage: object expected");a.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.fromObject(e.interactiveResponseMessage)}if(e.pollCreationMessage!=null){if(typeof e.pollCreationMessage!="object")throw TypeError(".proto.Message.pollCreationMessage: object expected");a.pollCreationMessage=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessage)}if(e.pollUpdateMessage!=null){if(typeof e.pollUpdateMessage!="object")throw TypeError(".proto.Message.pollUpdateMessage: object expected");a.pollUpdateMessage=p.proto.Message.PollUpdateMessage.fromObject(e.pollUpdateMessage)}if(e.keepInChatMessage!=null){if(typeof e.keepInChatMessage!="object")throw TypeError(".proto.Message.keepInChatMessage: object expected");a.keepInChatMessage=p.proto.Message.KeepInChatMessage.fromObject(e.keepInChatMessage)}if(e.documentWithCaptionMessage!=null){if(typeof e.documentWithCaptionMessage!="object")throw TypeError(".proto.Message.documentWithCaptionMessage: object expected");a.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.fromObject(e.documentWithCaptionMessage)}if(e.requestPhoneNumberMessage!=null){if(typeof e.requestPhoneNumberMessage!="object")throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected");a.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.fromObject(e.requestPhoneNumberMessage)}if(e.viewOnceMessageV2!=null){if(typeof e.viewOnceMessageV2!="object")throw TypeError(".proto.Message.viewOnceMessageV2: object expected");a.viewOnceMessageV2=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2)}if(e.encReactionMessage!=null){if(typeof e.encReactionMessage!="object")throw TypeError(".proto.Message.encReactionMessage: object expected");a.encReactionMessage=p.proto.Message.EncReactionMessage.fromObject(e.encReactionMessage)}if(e.editedMessage!=null){if(typeof e.editedMessage!="object")throw TypeError(".proto.Message.editedMessage: object expected");a.editedMessage=p.proto.Message.FutureProofMessage.fromObject(e.editedMessage)}if(e.viewOnceMessageV2Extension!=null){if(typeof e.viewOnceMessageV2Extension!="object")throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected");a.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2Extension)}if(e.pollCreationMessageV2!=null){if(typeof e.pollCreationMessageV2!="object")throw TypeError(".proto.Message.pollCreationMessageV2: object expected");a.pollCreationMessageV2=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV2)}if(e.scheduledCallCreationMessage!=null){if(typeof e.scheduledCallCreationMessage!="object")throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected");a.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.fromObject(e.scheduledCallCreationMessage)}if(e.groupMentionedMessage!=null){if(typeof e.groupMentionedMessage!="object")throw TypeError(".proto.Message.groupMentionedMessage: object expected");a.groupMentionedMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupMentionedMessage)}if(e.pinInChatMessage!=null){if(typeof e.pinInChatMessage!="object")throw TypeError(".proto.Message.pinInChatMessage: object expected");a.pinInChatMessage=p.proto.Message.PinInChatMessage.fromObject(e.pinInChatMessage)}if(e.pollCreationMessageV3!=null){if(typeof e.pollCreationMessageV3!="object")throw TypeError(".proto.Message.pollCreationMessageV3: object expected");a.pollCreationMessageV3=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV3)}if(e.scheduledCallEditMessage!=null){if(typeof e.scheduledCallEditMessage!="object")throw TypeError(".proto.Message.scheduledCallEditMessage: object expected");a.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.fromObject(e.scheduledCallEditMessage)}if(e.ptvMessage!=null){if(typeof e.ptvMessage!="object")throw TypeError(".proto.Message.ptvMessage: object expected");a.ptvMessage=p.proto.Message.VideoMessage.fromObject(e.ptvMessage)}if(e.botInvokeMessage!=null){if(typeof e.botInvokeMessage!="object")throw TypeError(".proto.Message.botInvokeMessage: object expected");a.botInvokeMessage=p.proto.Message.FutureProofMessage.fromObject(e.botInvokeMessage)}if(e.callLogMesssage!=null){if(typeof e.callLogMesssage!="object")throw TypeError(".proto.Message.callLogMesssage: object expected");a.callLogMesssage=p.proto.Message.CallLogMessage.fromObject(e.callLogMesssage)}if(e.messageHistoryBundle!=null){if(typeof e.messageHistoryBundle!="object")throw TypeError(".proto.Message.messageHistoryBundle: object expected");a.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.fromObject(e.messageHistoryBundle)}if(e.encCommentMessage!=null){if(typeof e.encCommentMessage!="object")throw TypeError(".proto.Message.encCommentMessage: object expected");a.encCommentMessage=p.proto.Message.EncCommentMessage.fromObject(e.encCommentMessage)}if(e.bcallMessage!=null){if(typeof e.bcallMessage!="object")throw TypeError(".proto.Message.bcallMessage: object expected");a.bcallMessage=p.proto.Message.BCallMessage.fromObject(e.bcallMessage)}if(e.lottieStickerMessage!=null){if(typeof e.lottieStickerMessage!="object")throw TypeError(".proto.Message.lottieStickerMessage: object expected");a.lottieStickerMessage=p.proto.Message.FutureProofMessage.fromObject(e.lottieStickerMessage)}if(e.eventMessage!=null){if(typeof e.eventMessage!="object")throw TypeError(".proto.Message.eventMessage: object expected");a.eventMessage=p.proto.Message.EventMessage.fromObject(e.eventMessage)}if(e.encEventResponseMessage!=null){if(typeof e.encEventResponseMessage!="object")throw TypeError(".proto.Message.encEventResponseMessage: object expected");a.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.fromObject(e.encEventResponseMessage)}if(e.commentMessage!=null){if(typeof e.commentMessage!="object")throw TypeError(".proto.Message.commentMessage: object expected");a.commentMessage=p.proto.Message.CommentMessage.fromObject(e.commentMessage)}if(e.newsletterAdminInviteMessage!=null){if(typeof e.newsletterAdminInviteMessage!="object")throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected");a.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.fromObject(e.newsletterAdminInviteMessage)}if(e.placeholderMessage!=null){if(typeof e.placeholderMessage!="object")throw TypeError(".proto.Message.placeholderMessage: object expected");a.placeholderMessage=p.proto.Message.PlaceholderMessage.fromObject(e.placeholderMessage)}if(e.secretEncryptedMessage!=null){if(typeof e.secretEncryptedMessage!="object")throw TypeError(".proto.Message.secretEncryptedMessage: object expected");a.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.fromObject(e.secretEncryptedMessage)}if(e.albumMessage!=null){if(typeof e.albumMessage!="object")throw TypeError(".proto.Message.albumMessage: object expected");a.albumMessage=p.proto.Message.AlbumMessage.fromObject(e.albumMessage)}if(e.eventCoverImage!=null){if(typeof e.eventCoverImage!="object")throw TypeError(".proto.Message.eventCoverImage: object expected");a.eventCoverImage=p.proto.Message.FutureProofMessage.fromObject(e.eventCoverImage)}if(e.stickerPackMessage!=null){if(typeof e.stickerPackMessage!="object")throw TypeError(".proto.Message.stickerPackMessage: object expected");a.stickerPackMessage=p.proto.Message.StickerPackMessage.fromObject(e.stickerPackMessage)}if(e.statusMentionMessage!=null){if(typeof e.statusMentionMessage!="object")throw TypeError(".proto.Message.statusMentionMessage: object expected");a.statusMentionMessage=p.proto.Message.FutureProofMessage.fromObject(e.statusMentionMessage)}if(e.pollResultSnapshotMessage!=null){if(typeof e.pollResultSnapshotMessage!="object")throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected");a.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessage)}if(e.pollCreationOptionImageMessage!=null){if(typeof e.pollCreationOptionImageMessage!="object")throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected");a.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.fromObject(e.pollCreationOptionImageMessage)}if(e.associatedChildMessage!=null){if(typeof e.associatedChildMessage!="object")throw TypeError(".proto.Message.associatedChildMessage: object expected");a.associatedChildMessage=p.proto.Message.FutureProofMessage.fromObject(e.associatedChildMessage)}if(e.groupStatusMentionMessage!=null){if(typeof e.groupStatusMentionMessage!="object")throw TypeError(".proto.Message.groupStatusMentionMessage: object expected");a.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMentionMessage)}if(e.pollCreationMessageV4!=null){if(typeof e.pollCreationMessageV4!="object")throw TypeError(".proto.Message.pollCreationMessageV4: object expected");a.pollCreationMessageV4=p.proto.Message.FutureProofMessage.fromObject(e.pollCreationMessageV4)}if(e.statusAddYours!=null){if(typeof e.statusAddYours!="object")throw TypeError(".proto.Message.statusAddYours: object expected");a.statusAddYours=p.proto.Message.FutureProofMessage.fromObject(e.statusAddYours)}if(e.groupStatusMessage!=null){if(typeof e.groupStatusMessage!="object")throw TypeError(".proto.Message.groupStatusMessage: object expected");a.groupStatusMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessage)}if(e.richResponseMessage!=null){if(typeof e.richResponseMessage!="object")throw TypeError(".proto.Message.richResponseMessage: object expected");a.richResponseMessage=p.proto.AIRichResponseMessage.fromObject(e.richResponseMessage)}if(e.statusNotificationMessage!=null){if(typeof e.statusNotificationMessage!="object")throw TypeError(".proto.Message.statusNotificationMessage: object expected");a.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.fromObject(e.statusNotificationMessage)}if(e.limitSharingMessage!=null){if(typeof e.limitSharingMessage!="object")throw TypeError(".proto.Message.limitSharingMessage: object expected");a.limitSharingMessage=p.proto.Message.FutureProofMessage.fromObject(e.limitSharingMessage)}if(e.botTaskMessage!=null){if(typeof e.botTaskMessage!="object")throw TypeError(".proto.Message.botTaskMessage: object expected");a.botTaskMessage=p.proto.Message.FutureProofMessage.fromObject(e.botTaskMessage)}if(e.questionMessage!=null){if(typeof e.questionMessage!="object")throw TypeError(".proto.Message.questionMessage: object expected");a.questionMessage=p.proto.Message.FutureProofMessage.fromObject(e.questionMessage)}if(e.messageHistoryNotice!=null){if(typeof e.messageHistoryNotice!="object")throw TypeError(".proto.Message.messageHistoryNotice: object expected");a.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.fromObject(e.messageHistoryNotice)}if(e.groupStatusMessageV2!=null){if(typeof e.groupStatusMessageV2!="object")throw TypeError(".proto.Message.groupStatusMessageV2: object expected");a.groupStatusMessageV2=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessageV2)}if(e.botForwardedMessage!=null){if(typeof e.botForwardedMessage!="object")throw TypeError(".proto.Message.botForwardedMessage: object expected");a.botForwardedMessage=p.proto.Message.FutureProofMessage.fromObject(e.botForwardedMessage)}if(e.statusQuestionAnswerMessage!=null){if(typeof e.statusQuestionAnswerMessage!="object")throw TypeError(".proto.Message.statusQuestionAnswerMessage: object expected");a.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.fromObject(e.statusQuestionAnswerMessage)}if(e.questionReplyMessage!=null){if(typeof e.questionReplyMessage!="object")throw TypeError(".proto.Message.questionReplyMessage: object expected");a.questionReplyMessage=p.proto.Message.FutureProofMessage.fromObject(e.questionReplyMessage)}if(e.questionResponseMessage!=null){if(typeof e.questionResponseMessage!="object")throw TypeError(".proto.Message.questionResponseMessage: object expected");a.questionResponseMessage=p.proto.Message.QuestionResponseMessage.fromObject(e.questionResponseMessage)}if(e.statusQuotedMessage!=null){if(typeof e.statusQuotedMessage!="object")throw TypeError(".proto.Message.statusQuotedMessage: object expected");a.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.fromObject(e.statusQuotedMessage)}if(e.statusStickerInteractionMessage!=null){if(typeof e.statusStickerInteractionMessage!="object")throw TypeError(".proto.Message.statusStickerInteractionMessage: object expected");a.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.fromObject(e.statusStickerInteractionMessage)}if(e.pollCreationMessageV5!=null){if(typeof e.pollCreationMessageV5!="object")throw TypeError(".proto.Message.pollCreationMessageV5: object expected");a.pollCreationMessageV5=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV5)}if(e.newsletterFollowerInviteMessageV2!=null){if(typeof e.newsletterFollowerInviteMessageV2!="object")throw TypeError(".proto.Message.newsletterFollowerInviteMessageV2: object expected");a.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.fromObject(e.newsletterFollowerInviteMessageV2)}if(e.pollResultSnapshotMessageV3!=null){if(typeof e.pollResultSnapshotMessageV3!="object")throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");a.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessageV3)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.conversation!=null&&e.hasOwnProperty("conversation")&&(A.conversation=e.conversation,a.oneofs&&(A._conversation="conversation")),e.senderKeyDistributionMessage!=null&&e.hasOwnProperty("senderKeyDistributionMessage")&&(A.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.toObject(e.senderKeyDistributionMessage,a),a.oneofs&&(A._senderKeyDistributionMessage="senderKeyDistributionMessage")),e.imageMessage!=null&&e.hasOwnProperty("imageMessage")&&(A.imageMessage=p.proto.Message.ImageMessage.toObject(e.imageMessage,a),a.oneofs&&(A._imageMessage="imageMessage")),e.contactMessage!=null&&e.hasOwnProperty("contactMessage")&&(A.contactMessage=p.proto.Message.ContactMessage.toObject(e.contactMessage,a),a.oneofs&&(A._contactMessage="contactMessage")),e.locationMessage!=null&&e.hasOwnProperty("locationMessage")&&(A.locationMessage=p.proto.Message.LocationMessage.toObject(e.locationMessage,a),a.oneofs&&(A._locationMessage="locationMessage")),e.extendedTextMessage!=null&&e.hasOwnProperty("extendedTextMessage")&&(A.extendedTextMessage=p.proto.Message.ExtendedTextMessage.toObject(e.extendedTextMessage,a),a.oneofs&&(A._extendedTextMessage="extendedTextMessage")),e.documentMessage!=null&&e.hasOwnProperty("documentMessage")&&(A.documentMessage=p.proto.Message.DocumentMessage.toObject(e.documentMessage,a),a.oneofs&&(A._documentMessage="documentMessage")),e.audioMessage!=null&&e.hasOwnProperty("audioMessage")&&(A.audioMessage=p.proto.Message.AudioMessage.toObject(e.audioMessage,a),a.oneofs&&(A._audioMessage="audioMessage")),e.videoMessage!=null&&e.hasOwnProperty("videoMessage")&&(A.videoMessage=p.proto.Message.VideoMessage.toObject(e.videoMessage,a),a.oneofs&&(A._videoMessage="videoMessage")),e.call!=null&&e.hasOwnProperty("call")&&(A.call=p.proto.Message.Call.toObject(e.call,a),a.oneofs&&(A._call="call")),e.chat!=null&&e.hasOwnProperty("chat")&&(A.chat=p.proto.Message.Chat.toObject(e.chat,a),a.oneofs&&(A._chat="chat")),e.protocolMessage!=null&&e.hasOwnProperty("protocolMessage")&&(A.protocolMessage=p.proto.Message.ProtocolMessage.toObject(e.protocolMessage,a),a.oneofs&&(A._protocolMessage="protocolMessage")),e.contactsArrayMessage!=null&&e.hasOwnProperty("contactsArrayMessage")&&(A.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.toObject(e.contactsArrayMessage,a),a.oneofs&&(A._contactsArrayMessage="contactsArrayMessage")),e.highlyStructuredMessage!=null&&e.hasOwnProperty("highlyStructuredMessage")&&(A.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.toObject(e.highlyStructuredMessage,a),a.oneofs&&(A._highlyStructuredMessage="highlyStructuredMessage")),e.fastRatchetKeySenderKeyDistributionMessage!=null&&e.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")&&(A.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.toObject(e.fastRatchetKeySenderKeyDistributionMessage,a),a.oneofs&&(A._fastRatchetKeySenderKeyDistributionMessage="fastRatchetKeySenderKeyDistributionMessage")),e.sendPaymentMessage!=null&&e.hasOwnProperty("sendPaymentMessage")&&(A.sendPaymentMessage=p.proto.Message.SendPaymentMessage.toObject(e.sendPaymentMessage,a),a.oneofs&&(A._sendPaymentMessage="sendPaymentMessage")),e.liveLocationMessage!=null&&e.hasOwnProperty("liveLocationMessage")&&(A.liveLocationMessage=p.proto.Message.LiveLocationMessage.toObject(e.liveLocationMessage,a),a.oneofs&&(A._liveLocationMessage="liveLocationMessage")),e.requestPaymentMessage!=null&&e.hasOwnProperty("requestPaymentMessage")&&(A.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.toObject(e.requestPaymentMessage,a),a.oneofs&&(A._requestPaymentMessage="requestPaymentMessage")),e.declinePaymentRequestMessage!=null&&e.hasOwnProperty("declinePaymentRequestMessage")&&(A.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.toObject(e.declinePaymentRequestMessage,a),a.oneofs&&(A._declinePaymentRequestMessage="declinePaymentRequestMessage")),e.cancelPaymentRequestMessage!=null&&e.hasOwnProperty("cancelPaymentRequestMessage")&&(A.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.toObject(e.cancelPaymentRequestMessage,a),a.oneofs&&(A._cancelPaymentRequestMessage="cancelPaymentRequestMessage")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=p.proto.Message.TemplateMessage.toObject(e.templateMessage,a),a.oneofs&&(A._templateMessage="templateMessage")),e.stickerMessage!=null&&e.hasOwnProperty("stickerMessage")&&(A.stickerMessage=p.proto.Message.StickerMessage.toObject(e.stickerMessage,a),a.oneofs&&(A._stickerMessage="stickerMessage")),e.groupInviteMessage!=null&&e.hasOwnProperty("groupInviteMessage")&&(A.groupInviteMessage=p.proto.Message.GroupInviteMessage.toObject(e.groupInviteMessage,a),a.oneofs&&(A._groupInviteMessage="groupInviteMessage")),e.templateButtonReplyMessage!=null&&e.hasOwnProperty("templateButtonReplyMessage")&&(A.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.toObject(e.templateButtonReplyMessage,a),a.oneofs&&(A._templateButtonReplyMessage="templateButtonReplyMessage")),e.productMessage!=null&&e.hasOwnProperty("productMessage")&&(A.productMessage=p.proto.Message.ProductMessage.toObject(e.productMessage,a),a.oneofs&&(A._productMessage="productMessage")),e.deviceSentMessage!=null&&e.hasOwnProperty("deviceSentMessage")&&(A.deviceSentMessage=p.proto.Message.DeviceSentMessage.toObject(e.deviceSentMessage,a),a.oneofs&&(A._deviceSentMessage="deviceSentMessage")),e.messageContextInfo!=null&&e.hasOwnProperty("messageContextInfo")&&(A.messageContextInfo=p.proto.MessageContextInfo.toObject(e.messageContextInfo,a),a.oneofs&&(A._messageContextInfo="messageContextInfo")),e.listMessage!=null&&e.hasOwnProperty("listMessage")&&(A.listMessage=p.proto.Message.ListMessage.toObject(e.listMessage,a),a.oneofs&&(A._listMessage="listMessage")),e.viewOnceMessage!=null&&e.hasOwnProperty("viewOnceMessage")&&(A.viewOnceMessage=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessage,a),a.oneofs&&(A._viewOnceMessage="viewOnceMessage")),e.orderMessage!=null&&e.hasOwnProperty("orderMessage")&&(A.orderMessage=p.proto.Message.OrderMessage.toObject(e.orderMessage,a),a.oneofs&&(A._orderMessage="orderMessage")),e.listResponseMessage!=null&&e.hasOwnProperty("listResponseMessage")&&(A.listResponseMessage=p.proto.Message.ListResponseMessage.toObject(e.listResponseMessage,a),a.oneofs&&(A._listResponseMessage="listResponseMessage")),e.ephemeralMessage!=null&&e.hasOwnProperty("ephemeralMessage")&&(A.ephemeralMessage=p.proto.Message.FutureProofMessage.toObject(e.ephemeralMessage,a),a.oneofs&&(A._ephemeralMessage="ephemeralMessage")),e.invoiceMessage!=null&&e.hasOwnProperty("invoiceMessage")&&(A.invoiceMessage=p.proto.Message.InvoiceMessage.toObject(e.invoiceMessage,a),a.oneofs&&(A._invoiceMessage="invoiceMessage")),e.buttonsMessage!=null&&e.hasOwnProperty("buttonsMessage")&&(A.buttonsMessage=p.proto.Message.ButtonsMessage.toObject(e.buttonsMessage,a),a.oneofs&&(A._buttonsMessage="buttonsMessage")),e.buttonsResponseMessage!=null&&e.hasOwnProperty("buttonsResponseMessage")&&(A.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.toObject(e.buttonsResponseMessage,a),a.oneofs&&(A._buttonsResponseMessage="buttonsResponseMessage")),e.paymentInviteMessage!=null&&e.hasOwnProperty("paymentInviteMessage")&&(A.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.toObject(e.paymentInviteMessage,a),a.oneofs&&(A._paymentInviteMessage="paymentInviteMessage")),e.interactiveMessage!=null&&e.hasOwnProperty("interactiveMessage")&&(A.interactiveMessage=p.proto.Message.InteractiveMessage.toObject(e.interactiveMessage,a),a.oneofs&&(A._interactiveMessage="interactiveMessage")),e.reactionMessage!=null&&e.hasOwnProperty("reactionMessage")&&(A.reactionMessage=p.proto.Message.ReactionMessage.toObject(e.reactionMessage,a),a.oneofs&&(A._reactionMessage="reactionMessage")),e.stickerSyncRmrMessage!=null&&e.hasOwnProperty("stickerSyncRmrMessage")&&(A.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.toObject(e.stickerSyncRmrMessage,a),a.oneofs&&(A._stickerSyncRmrMessage="stickerSyncRmrMessage")),e.interactiveResponseMessage!=null&&e.hasOwnProperty("interactiveResponseMessage")&&(A.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.toObject(e.interactiveResponseMessage,a),a.oneofs&&(A._interactiveResponseMessage="interactiveResponseMessage")),e.pollCreationMessage!=null&&e.hasOwnProperty("pollCreationMessage")&&(A.pollCreationMessage=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessage,a),a.oneofs&&(A._pollCreationMessage="pollCreationMessage")),e.pollUpdateMessage!=null&&e.hasOwnProperty("pollUpdateMessage")&&(A.pollUpdateMessage=p.proto.Message.PollUpdateMessage.toObject(e.pollUpdateMessage,a),a.oneofs&&(A._pollUpdateMessage="pollUpdateMessage")),e.keepInChatMessage!=null&&e.hasOwnProperty("keepInChatMessage")&&(A.keepInChatMessage=p.proto.Message.KeepInChatMessage.toObject(e.keepInChatMessage,a),a.oneofs&&(A._keepInChatMessage="keepInChatMessage")),e.documentWithCaptionMessage!=null&&e.hasOwnProperty("documentWithCaptionMessage")&&(A.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.toObject(e.documentWithCaptionMessage,a),a.oneofs&&(A._documentWithCaptionMessage="documentWithCaptionMessage")),e.requestPhoneNumberMessage!=null&&e.hasOwnProperty("requestPhoneNumberMessage")&&(A.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.toObject(e.requestPhoneNumberMessage,a),a.oneofs&&(A._requestPhoneNumberMessage="requestPhoneNumberMessage")),e.viewOnceMessageV2!=null&&e.hasOwnProperty("viewOnceMessageV2")&&(A.viewOnceMessageV2=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2,a),a.oneofs&&(A._viewOnceMessageV2="viewOnceMessageV2")),e.encReactionMessage!=null&&e.hasOwnProperty("encReactionMessage")&&(A.encReactionMessage=p.proto.Message.EncReactionMessage.toObject(e.encReactionMessage,a),a.oneofs&&(A._encReactionMessage="encReactionMessage")),e.editedMessage!=null&&e.hasOwnProperty("editedMessage")&&(A.editedMessage=p.proto.Message.FutureProofMessage.toObject(e.editedMessage,a),a.oneofs&&(A._editedMessage="editedMessage")),e.viewOnceMessageV2Extension!=null&&e.hasOwnProperty("viewOnceMessageV2Extension")&&(A.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2Extension,a),a.oneofs&&(A._viewOnceMessageV2Extension="viewOnceMessageV2Extension")),e.pollCreationMessageV2!=null&&e.hasOwnProperty("pollCreationMessageV2")&&(A.pollCreationMessageV2=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV2,a),a.oneofs&&(A._pollCreationMessageV2="pollCreationMessageV2")),e.scheduledCallCreationMessage!=null&&e.hasOwnProperty("scheduledCallCreationMessage")&&(A.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.toObject(e.scheduledCallCreationMessage,a),a.oneofs&&(A._scheduledCallCreationMessage="scheduledCallCreationMessage")),e.groupMentionedMessage!=null&&e.hasOwnProperty("groupMentionedMessage")&&(A.groupMentionedMessage=p.proto.Message.FutureProofMessage.toObject(e.groupMentionedMessage,a),a.oneofs&&(A._groupMentionedMessage="groupMentionedMessage")),e.pinInChatMessage!=null&&e.hasOwnProperty("pinInChatMessage")&&(A.pinInChatMessage=p.proto.Message.PinInChatMessage.toObject(e.pinInChatMessage,a),a.oneofs&&(A._pinInChatMessage="pinInChatMessage")),e.pollCreationMessageV3!=null&&e.hasOwnProperty("pollCreationMessageV3")&&(A.pollCreationMessageV3=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV3,a),a.oneofs&&(A._pollCreationMessageV3="pollCreationMessageV3")),e.scheduledCallEditMessage!=null&&e.hasOwnProperty("scheduledCallEditMessage")&&(A.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.toObject(e.scheduledCallEditMessage,a),a.oneofs&&(A._scheduledCallEditMessage="scheduledCallEditMessage")),e.ptvMessage!=null&&e.hasOwnProperty("ptvMessage")&&(A.ptvMessage=p.proto.Message.VideoMessage.toObject(e.ptvMessage,a),a.oneofs&&(A._ptvMessage="ptvMessage")),e.botInvokeMessage!=null&&e.hasOwnProperty("botInvokeMessage")&&(A.botInvokeMessage=p.proto.Message.FutureProofMessage.toObject(e.botInvokeMessage,a),a.oneofs&&(A._botInvokeMessage="botInvokeMessage")),e.callLogMesssage!=null&&e.hasOwnProperty("callLogMesssage")&&(A.callLogMesssage=p.proto.Message.CallLogMessage.toObject(e.callLogMesssage,a),a.oneofs&&(A._callLogMesssage="callLogMesssage")),e.messageHistoryBundle!=null&&e.hasOwnProperty("messageHistoryBundle")&&(A.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.toObject(e.messageHistoryBundle,a),a.oneofs&&(A._messageHistoryBundle="messageHistoryBundle")),e.encCommentMessage!=null&&e.hasOwnProperty("encCommentMessage")&&(A.encCommentMessage=p.proto.Message.EncCommentMessage.toObject(e.encCommentMessage,a),a.oneofs&&(A._encCommentMessage="encCommentMessage")),e.bcallMessage!=null&&e.hasOwnProperty("bcallMessage")&&(A.bcallMessage=p.proto.Message.BCallMessage.toObject(e.bcallMessage,a),a.oneofs&&(A._bcallMessage="bcallMessage")),e.lottieStickerMessage!=null&&e.hasOwnProperty("lottieStickerMessage")&&(A.lottieStickerMessage=p.proto.Message.FutureProofMessage.toObject(e.lottieStickerMessage,a),a.oneofs&&(A._lottieStickerMessage="lottieStickerMessage")),e.eventMessage!=null&&e.hasOwnProperty("eventMessage")&&(A.eventMessage=p.proto.Message.EventMessage.toObject(e.eventMessage,a),a.oneofs&&(A._eventMessage="eventMessage")),e.encEventResponseMessage!=null&&e.hasOwnProperty("encEventResponseMessage")&&(A.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.toObject(e.encEventResponseMessage,a),a.oneofs&&(A._encEventResponseMessage="encEventResponseMessage")),e.commentMessage!=null&&e.hasOwnProperty("commentMessage")&&(A.commentMessage=p.proto.Message.CommentMessage.toObject(e.commentMessage,a),a.oneofs&&(A._commentMessage="commentMessage")),e.newsletterAdminInviteMessage!=null&&e.hasOwnProperty("newsletterAdminInviteMessage")&&(A.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.toObject(e.newsletterAdminInviteMessage,a),a.oneofs&&(A._newsletterAdminInviteMessage="newsletterAdminInviteMessage")),e.placeholderMessage!=null&&e.hasOwnProperty("placeholderMessage")&&(A.placeholderMessage=p.proto.Message.PlaceholderMessage.toObject(e.placeholderMessage,a),a.oneofs&&(A._placeholderMessage="placeholderMessage")),e.secretEncryptedMessage!=null&&e.hasOwnProperty("secretEncryptedMessage")&&(A.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.toObject(e.secretEncryptedMessage,a),a.oneofs&&(A._secretEncryptedMessage="secretEncryptedMessage")),e.albumMessage!=null&&e.hasOwnProperty("albumMessage")&&(A.albumMessage=p.proto.Message.AlbumMessage.toObject(e.albumMessage,a),a.oneofs&&(A._albumMessage="albumMessage")),e.eventCoverImage!=null&&e.hasOwnProperty("eventCoverImage")&&(A.eventCoverImage=p.proto.Message.FutureProofMessage.toObject(e.eventCoverImage,a),a.oneofs&&(A._eventCoverImage="eventCoverImage")),e.stickerPackMessage!=null&&e.hasOwnProperty("stickerPackMessage")&&(A.stickerPackMessage=p.proto.Message.StickerPackMessage.toObject(e.stickerPackMessage,a),a.oneofs&&(A._stickerPackMessage="stickerPackMessage")),e.statusMentionMessage!=null&&e.hasOwnProperty("statusMentionMessage")&&(A.statusMentionMessage=p.proto.Message.FutureProofMessage.toObject(e.statusMentionMessage,a),a.oneofs&&(A._statusMentionMessage="statusMentionMessage")),e.pollResultSnapshotMessage!=null&&e.hasOwnProperty("pollResultSnapshotMessage")&&(A.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessage,a),a.oneofs&&(A._pollResultSnapshotMessage="pollResultSnapshotMessage")),e.pollCreationOptionImageMessage!=null&&e.hasOwnProperty("pollCreationOptionImageMessage")&&(A.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.toObject(e.pollCreationOptionImageMessage,a),a.oneofs&&(A._pollCreationOptionImageMessage="pollCreationOptionImageMessage")),e.associatedChildMessage!=null&&e.hasOwnProperty("associatedChildMessage")&&(A.associatedChildMessage=p.proto.Message.FutureProofMessage.toObject(e.associatedChildMessage,a),a.oneofs&&(A._associatedChildMessage="associatedChildMessage")),e.groupStatusMentionMessage!=null&&e.hasOwnProperty("groupStatusMentionMessage")&&(A.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMentionMessage,a),a.oneofs&&(A._groupStatusMentionMessage="groupStatusMentionMessage")),e.pollCreationMessageV4!=null&&e.hasOwnProperty("pollCreationMessageV4")&&(A.pollCreationMessageV4=p.proto.Message.FutureProofMessage.toObject(e.pollCreationMessageV4,a),a.oneofs&&(A._pollCreationMessageV4="pollCreationMessageV4")),e.statusAddYours!=null&&e.hasOwnProperty("statusAddYours")&&(A.statusAddYours=p.proto.Message.FutureProofMessage.toObject(e.statusAddYours,a),a.oneofs&&(A._statusAddYours="statusAddYours")),e.groupStatusMessage!=null&&e.hasOwnProperty("groupStatusMessage")&&(A.groupStatusMessage=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMessage,a),a.oneofs&&(A._groupStatusMessage="groupStatusMessage")),e.richResponseMessage!=null&&e.hasOwnProperty("richResponseMessage")&&(A.richResponseMessage=p.proto.AIRichResponseMessage.toObject(e.richResponseMessage,a),a.oneofs&&(A._richResponseMessage="richResponseMessage")),e.statusNotificationMessage!=null&&e.hasOwnProperty("statusNotificationMessage")&&(A.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.toObject(e.statusNotificationMessage,a),a.oneofs&&(A._statusNotificationMessage="statusNotificationMessage")),e.limitSharingMessage!=null&&e.hasOwnProperty("limitSharingMessage")&&(A.limitSharingMessage=p.proto.Message.FutureProofMessage.toObject(e.limitSharingMessage,a),a.oneofs&&(A._limitSharingMessage="limitSharingMessage")),e.botTaskMessage!=null&&e.hasOwnProperty("botTaskMessage")&&(A.botTaskMessage=p.proto.Message.FutureProofMessage.toObject(e.botTaskMessage,a),a.oneofs&&(A._botTaskMessage="botTaskMessage")),e.questionMessage!=null&&e.hasOwnProperty("questionMessage")&&(A.questionMessage=p.proto.Message.FutureProofMessage.toObject(e.questionMessage,a),a.oneofs&&(A._questionMessage="questionMessage")),e.messageHistoryNotice!=null&&e.hasOwnProperty("messageHistoryNotice")&&(A.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.toObject(e.messageHistoryNotice,a),a.oneofs&&(A._messageHistoryNotice="messageHistoryNotice")),e.groupStatusMessageV2!=null&&e.hasOwnProperty("groupStatusMessageV2")&&(A.groupStatusMessageV2=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMessageV2,a),a.oneofs&&(A._groupStatusMessageV2="groupStatusMessageV2")),e.botForwardedMessage!=null&&e.hasOwnProperty("botForwardedMessage")&&(A.botForwardedMessage=p.proto.Message.FutureProofMessage.toObject(e.botForwardedMessage,a),a.oneofs&&(A._botForwardedMessage="botForwardedMessage")),e.statusQuestionAnswerMessage!=null&&e.hasOwnProperty("statusQuestionAnswerMessage")&&(A.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.toObject(e.statusQuestionAnswerMessage,a),a.oneofs&&(A._statusQuestionAnswerMessage="statusQuestionAnswerMessage")),e.questionReplyMessage!=null&&e.hasOwnProperty("questionReplyMessage")&&(A.questionReplyMessage=p.proto.Message.FutureProofMessage.toObject(e.questionReplyMessage,a),a.oneofs&&(A._questionReplyMessage="questionReplyMessage")),e.questionResponseMessage!=null&&e.hasOwnProperty("questionResponseMessage")&&(A.questionResponseMessage=p.proto.Message.QuestionResponseMessage.toObject(e.questionResponseMessage,a),a.oneofs&&(A._questionResponseMessage="questionResponseMessage")),e.statusQuotedMessage!=null&&e.hasOwnProperty("statusQuotedMessage")&&(A.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.toObject(e.statusQuotedMessage,a),a.oneofs&&(A._statusQuotedMessage="statusQuotedMessage")),e.statusStickerInteractionMessage!=null&&e.hasOwnProperty("statusStickerInteractionMessage")&&(A.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.toObject(e.statusStickerInteractionMessage,a),a.oneofs&&(A._statusStickerInteractionMessage="statusStickerInteractionMessage")),e.pollCreationMessageV5!=null&&e.hasOwnProperty("pollCreationMessageV5")&&(A.pollCreationMessageV5=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV5,a),a.oneofs&&(A._pollCreationMessageV5="pollCreationMessageV5")),e.newsletterFollowerInviteMessageV2!=null&&e.hasOwnProperty("newsletterFollowerInviteMessageV2")&&(A.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.toObject(e.newsletterFollowerInviteMessageV2,a),a.oneofs&&(A._newsletterFollowerInviteMessageV2="newsletterFollowerInviteMessageV2")),e.pollResultSnapshotMessageV3!=null&&e.hasOwnProperty("pollResultSnapshotMessageV3")&&(A.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessageV3,a),a.oneofs&&(A._pollResultSnapshotMessageV3="pollResultSnapshotMessageV3")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Message"},t.AlbumMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 2:{c.expectedImageCount=A.uint32();break}case 3:{c.expectedVideoCount=A.uint32();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AlbumMessage)return A;var r=new p.proto.Message.AlbumMessage;if(A.expectedImageCount!=null&&(r.expectedImageCount=A.expectedImageCount>>>0),A.expectedVideoCount!=null&&(r.expectedVideoCount=A.expectedVideoCount>>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.expectedImageCount!=null&&A.hasOwnProperty("expectedImageCount")&&(s.expectedImageCount=A.expectedImageCount,r.oneofs&&(s._expectedImageCount="expectedImageCount")),A.expectedVideoCount!=null&&A.hasOwnProperty("expectedVideoCount")&&(s.expectedVideoCount=A.expectedVideoCount,r.oneofs&&(s._expectedVideoCount="expectedVideoCount")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AlbumMessage"},i})(),t.AppStateFatalExceptionNotification=(function(){function i(a){if(this.collectionNames=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.collectionNames&&c.collectionNames.length||(c.collectionNames=[]),c.collectionNames.push(A.string());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateFatalExceptionNotification)return A;var r=new p.proto.Message.AppStateFatalExceptionNotification;if(A.collectionNames){if(!Array.isArray(A.collectionNames))throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected");r.collectionNames=[];for(var s=0;s>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.collectionNames=[]),A.collectionNames&&A.collectionNames.length){s.collectionNames=[];for(var g=0;g>>3){case 1:{c.keyId=p.proto.Message.AppStateSyncKeyId.decode(A,A.uint32());break}case 2:{c.keyData=p.proto.Message.AppStateSyncKeyData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKey)return A;var r=new p.proto.Message.AppStateSyncKey;if(A.keyId!=null){if(typeof A.keyId!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected");r.keyId=p.proto.Message.AppStateSyncKeyId.fromObject(A.keyId)}if(A.keyData!=null){if(typeof A.keyData!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected");r.keyData=p.proto.Message.AppStateSyncKeyData.fromObject(A.keyData)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=p.proto.Message.AppStateSyncKeyId.toObject(A.keyId,r),r.oneofs&&(s._keyId="keyId")),A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=p.proto.Message.AppStateSyncKeyData.toObject(A.keyData,r),r.oneofs&&(s._keyData="keyData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKey"},i})(),t.AppStateSyncKeyData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.keyData=A.bytes();break}case 2:{c.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.decode(A,A.uint32());break}case 3:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKeyData)return A;var r=new p.proto.Message.AppStateSyncKeyData;if(A.keyData!=null&&(typeof A.keyData=="string"?l.base64.decode(A.keyData,r.keyData=l.newBuffer(l.base64.length(A.keyData)),0):A.keyData.length>=0&&(r.keyData=A.keyData)),A.fingerprint!=null){if(typeof A.fingerprint!="object")throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected");r.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.fromObject(A.fingerprint)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=r.bytes===String?l.base64.encode(A.keyData,0,A.keyData.length):r.bytes===Array?Array.prototype.slice.call(A.keyData):A.keyData,r.oneofs&&(s._keyData="keyData")),A.fingerprint!=null&&A.hasOwnProperty("fingerprint")&&(s.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.toObject(A.fingerprint,r),r.oneofs&&(s._fingerprint="fingerprint")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyData"},i})(),t.AppStateSyncKeyFingerprint=(function(){function i(a){if(this.deviceIndexes=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.rawId=A.uint32();break}case 2:{c.currentIndex=A.uint32();break}case 3:{if(c.deviceIndexes&&c.deviceIndexes.length||(c.deviceIndexes=[]),(I&7)===2)for(var d=A.uint32()+A.pos;A.pos>>0),A.currentIndex!=null&&(r.currentIndex=A.currentIndex>>>0),A.deviceIndexes){if(!Array.isArray(A.deviceIndexes))throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected");r.deviceIndexes=[];for(var s=0;s>>0}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.deviceIndexes=[]),A.rawId!=null&&A.hasOwnProperty("rawId")&&(s.rawId=A.rawId,r.oneofs&&(s._rawId="rawId")),A.currentIndex!=null&&A.hasOwnProperty("currentIndex")&&(s.currentIndex=A.currentIndex,r.oneofs&&(s._currentIndex="currentIndex")),A.deviceIndexes&&A.deviceIndexes.length){s.deviceIndexes=[];for(var g=0;g>>3){case 1:{c.keyId=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKeyId)return A;var r=new p.proto.Message.AppStateSyncKeyId;return A.keyId!=null&&(typeof A.keyId=="string"?l.base64.decode(A.keyId,r.keyId=l.newBuffer(l.base64.length(A.keyId)),0):A.keyId.length>=0&&(r.keyId=A.keyId)),r},i.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=r.bytes===String?l.base64.encode(A.keyId,0,A.keyId.length):r.bytes===Array?Array.prototype.slice.call(A.keyId):A.keyId,r.oneofs&&(s._keyId="keyId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyId"},i})(),t.AppStateSyncKeyRequest=(function(){function i(e){if(this.keyIds=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.keyIds&&g.keyIds.length||(g.keyIds=[]),g.keyIds.push(p.proto.Message.AppStateSyncKeyId.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.AppStateSyncKeyRequest)return a;var A=new p.proto.Message.AppStateSyncKeyRequest;if(a.keyIds){if(!Array.isArray(a.keyIds))throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected");A.keyIds=[];for(var r=0;r>>3){case 1:{g.keys&&g.keys.length||(g.keys=[]),g.keys.push(p.proto.Message.AppStateSyncKey.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.AppStateSyncKeyShare)return a;var A=new p.proto.Message.AppStateSyncKeyShare;if(a.keys){if(!Array.isArray(a.keys))throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected");A.keys=[];for(var r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.ptt=A.bool();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileEncSha256=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.waveform=A.bytes();break}case 20:{c.backgroundArgb=A.fixed32();break}case 21:{c.viewOnce=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AudioMessage)return A;var r=new p.proto.Message.AudioMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.ptt!=null&&(r.ptt=!!A.ptt),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.waveform!=null&&(typeof A.waveform=="string"?l.base64.decode(A.waveform,r.waveform=l.newBuffer(l.base64.length(A.waveform)),0):A.waveform.length>=0&&(r.waveform=A.waveform)),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.ptt!=null&&A.hasOwnProperty("ptt")&&(s.ptt=A.ptt,r.oneofs&&(s._ptt="ptt")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.streamingSidecar!=null&&A.hasOwnProperty("streamingSidecar")&&(s.streamingSidecar=r.bytes===String?l.base64.encode(A.streamingSidecar,0,A.streamingSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.streamingSidecar):A.streamingSidecar,r.oneofs&&(s._streamingSidecar="streamingSidecar")),A.waveform!=null&&A.hasOwnProperty("waveform")&&(s.waveform=r.bytes===String?l.base64.encode(A.waveform,0,A.waveform.length):r.bytes===Array?Array.prototype.slice.call(A.waveform):A.waveform,r.oneofs&&(s._waveform="waveform")),A.backgroundArgb!=null&&A.hasOwnProperty("backgroundArgb")&&(s.backgroundArgb=A.backgroundArgb,r.oneofs&&(s._backgroundArgb="backgroundArgb")),A.viewOnce!=null&&A.hasOwnProperty("viewOnce")&&(s.viewOnce=A.viewOnce,r.oneofs&&(s._viewOnce="viewOnce")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AudioMessage"},i})(),t.BCallMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.sessionId=A.string();break}case 2:{c.mediaType=A.int32();break}case 3:{c.masterKey=A.bytes();break}case 4:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.BCallMessage)return A;var r=new p.proto.Message.BCallMessage;switch(A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"UNKNOWN":case 0:r.mediaType=0;break;case"AUDIO":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.masterKey!=null&&(typeof A.masterKey=="string"?l.base64.decode(A.masterKey,r.masterKey=l.newBuffer(l.base64.length(A.masterKey)),0):A.masterKey.length>=0&&(r.masterKey=A.masterKey)),A.caption!=null&&(r.caption=String(A.caption)),r},i.toObject=function(A,r){r||(r={});var s={};return A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?p.proto.Message.BCallMessage.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.Message.BCallMessage.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.masterKey!=null&&A.hasOwnProperty("masterKey")&&(s.masterKey=r.bytes===String?l.base64.encode(A.masterKey,0,A.masterKey.length):r.bytes===Array?Array.prototype.slice.call(A.masterKey):A.masterKey,r.oneofs&&(s._masterKey="masterKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.BCallMessage"},i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="AUDIO"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.ButtonsMessage=(function(){function i(a){if(this.buttons=[],a)for(var A=Object.keys(a),r=0;r>>3){case 6:{c.contentText=A.string();break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 9:{c.buttons&&c.buttons.length||(c.buttons=[]),c.buttons.push(p.proto.Message.ButtonsMessage.Button.decode(A,A.uint32()));break}case 10:{c.headerType=A.int32();break}case 1:{c.text=A.string();break}case 2:{c.documentMessage=p.proto.Message.DocumentMessage.decode(A,A.uint32());break}case 3:{c.imageMessage=p.proto.Message.ImageMessage.decode(A,A.uint32());break}case 4:{c.videoMessage=p.proto.Message.VideoMessage.decode(A,A.uint32());break}case 5:{c.locationMessage=p.proto.Message.LocationMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ButtonsMessage)return A;var r=new p.proto.Message.ButtonsMessage;if(A.contentText!=null&&(r.contentText=String(A.contentText)),A.footerText!=null&&(r.footerText=String(A.footerText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.buttons){if(!Array.isArray(A.buttons))throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected");r.buttons=[];for(var s=0;s>>3){case 1:{d.buttonId=s.string();break}case 2:{d.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.decode(s,s.uint32());break}case 3:{d.type=s.int32();break}case 4:{d.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ButtonsMessage.Button)return s;var g=new p.proto.Message.ButtonsMessage.Button;if(s.buttonId!=null&&(g.buttonId=String(s.buttonId)),s.buttonText!=null){if(typeof s.buttonText!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected");g.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(s.buttonText)}switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"UNKNOWN":case 0:g.type=0;break;case"RESPONSE":case 1:g.type=1;break;case"NATIVE_FLOW":case 2:g.type=2;break}if(s.nativeFlowInfo!=null){if(typeof s.nativeFlowInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected");g.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(s.nativeFlowInfo)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.buttonId!=null&&s.hasOwnProperty("buttonId")&&(c.buttonId=s.buttonId,g.oneofs&&(c._buttonId="buttonId")),s.buttonText!=null&&s.hasOwnProperty("buttonText")&&(c.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.toObject(s.buttonText,g),g.oneofs&&(c._buttonText="buttonText")),s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?p.proto.Message.ButtonsMessage.Button.Type[s.type]===void 0?s.type:p.proto.Message.ButtonsMessage.Button.Type[s.type]:s.type,g.oneofs&&(c._type="type")),s.nativeFlowInfo!=null&&s.hasOwnProperty("nativeFlowInfo")&&(c.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(s.nativeFlowInfo,g),g.oneofs&&(c._nativeFlowInfo="nativeFlowInfo")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ButtonsMessage.Button"},a.ButtonText=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.displayText=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.ButtonsMessage.Button.ButtonText)return c;var I=new p.proto.Message.ButtonsMessage.Button.ButtonText;return c.displayText!=null&&(I.displayText=String(c.displayText)),I},r.toObject=function(c,I){I||(I={});var d={};return c.displayText!=null&&c.hasOwnProperty("displayText")&&(d.displayText=c.displayText,I.oneofs&&(d._displayText="displayText")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.ButtonText"},r})(),a.NativeFlowInfo=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.name=c.string();break}case 2:{f.paramsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.ButtonsMessage.Button.NativeFlowInfo)return c;var I=new p.proto.Message.ButtonsMessage.Button.NativeFlowInfo;return c.name!=null&&(I.name=String(c.name)),c.paramsJson!=null&&(I.paramsJson=String(c.paramsJson)),I},r.toObject=function(c,I){I||(I={});var d={};return c.name!=null&&c.hasOwnProperty("name")&&(d.name=c.name,I.oneofs&&(d._name="name")),c.paramsJson!=null&&c.hasOwnProperty("paramsJson")&&(d.paramsJson=c.paramsJson,I.oneofs&&(d._paramsJson="paramsJson")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.NativeFlowInfo"},r})(),a.Type=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="RESPONSE"]=1,s[r[2]="NATIVE_FLOW"]=2,s})(),a})(),i.HeaderType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="EMPTY"]=1,A[a[2]="TEXT"]=2,A[a[3]="DOCUMENT"]=3,A[a[4]="IMAGE"]=4,A[a[5]="VIDEO"]=5,A[a[6]="LOCATION"]=6,A})(),i})(),t.ButtonsResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.selectedButtonId=A.string();break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.type=A.int32();break}case 2:{c.selectedDisplayText=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ButtonsResponseMessage)return A;var r=new p.proto.Message.ButtonsResponseMessage;if(A.selectedButtonId!=null&&(r.selectedButtonId=String(A.selectedButtonId)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DISPLAY_TEXT":case 1:r.type=1;break}return A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),r},i.toObject=function(A,r){r||(r={});var s={};return A.selectedButtonId!=null&&A.hasOwnProperty("selectedButtonId")&&(s.selectedButtonId=A.selectedButtonId,r.oneofs&&(s._selectedButtonId="selectedButtonId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s.response="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.ButtonsResponseMessage.Type[A.type]===void 0?A.type:p.proto.Message.ButtonsResponseMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ButtonsResponseMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="DISPLAY_TEXT"]=1,A})(),i})(),t.Call=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.callKey=A.bytes();break}case 2:{c.conversionSource=A.string();break}case 3:{c.conversionData=A.bytes();break}case 4:{c.conversionDelaySeconds=A.uint32();break}case 5:{c.ctwaSignals=A.string();break}case 6:{c.ctwaPayload=A.bytes();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.nativeFlowCallButtonPayload=A.string();break}case 9:{c.deeplinkPayload=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.Call)return A;var r=new p.proto.Message.Call;if(A.callKey!=null&&(typeof A.callKey=="string"?l.base64.decode(A.callKey,r.callKey=l.newBuffer(l.base64.length(A.callKey)),0):A.callKey.length>=0&&(r.callKey=A.callKey)),A.conversionSource!=null&&(r.conversionSource=String(A.conversionSource)),A.conversionData!=null&&(typeof A.conversionData=="string"?l.base64.decode(A.conversionData,r.conversionData=l.newBuffer(l.base64.length(A.conversionData)),0):A.conversionData.length>=0&&(r.conversionData=A.conversionData)),A.conversionDelaySeconds!=null&&(r.conversionDelaySeconds=A.conversionDelaySeconds>>>0),A.ctwaSignals!=null&&(r.ctwaSignals=String(A.ctwaSignals)),A.ctwaPayload!=null&&(typeof A.ctwaPayload=="string"?l.base64.decode(A.ctwaPayload,r.ctwaPayload=l.newBuffer(l.base64.length(A.ctwaPayload)),0):A.ctwaPayload.length>=0&&(r.ctwaPayload=A.ctwaPayload)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.Call.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.nativeFlowCallButtonPayload!=null&&(r.nativeFlowCallButtonPayload=String(A.nativeFlowCallButtonPayload)),A.deeplinkPayload!=null&&(r.deeplinkPayload=String(A.deeplinkPayload)),r},i.toObject=function(A,r){r||(r={});var s={};return A.callKey!=null&&A.hasOwnProperty("callKey")&&(s.callKey=r.bytes===String?l.base64.encode(A.callKey,0,A.callKey.length):r.bytes===Array?Array.prototype.slice.call(A.callKey):A.callKey,r.oneofs&&(s._callKey="callKey")),A.conversionSource!=null&&A.hasOwnProperty("conversionSource")&&(s.conversionSource=A.conversionSource,r.oneofs&&(s._conversionSource="conversionSource")),A.conversionData!=null&&A.hasOwnProperty("conversionData")&&(s.conversionData=r.bytes===String?l.base64.encode(A.conversionData,0,A.conversionData.length):r.bytes===Array?Array.prototype.slice.call(A.conversionData):A.conversionData,r.oneofs&&(s._conversionData="conversionData")),A.conversionDelaySeconds!=null&&A.hasOwnProperty("conversionDelaySeconds")&&(s.conversionDelaySeconds=A.conversionDelaySeconds,r.oneofs&&(s._conversionDelaySeconds="conversionDelaySeconds")),A.ctwaSignals!=null&&A.hasOwnProperty("ctwaSignals")&&(s.ctwaSignals=A.ctwaSignals,r.oneofs&&(s._ctwaSignals="ctwaSignals")),A.ctwaPayload!=null&&A.hasOwnProperty("ctwaPayload")&&(s.ctwaPayload=r.bytes===String?l.base64.encode(A.ctwaPayload,0,A.ctwaPayload.length):r.bytes===Array?Array.prototype.slice.call(A.ctwaPayload):A.ctwaPayload,r.oneofs&&(s._ctwaPayload="ctwaPayload")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.nativeFlowCallButtonPayload!=null&&A.hasOwnProperty("nativeFlowCallButtonPayload")&&(s.nativeFlowCallButtonPayload=A.nativeFlowCallButtonPayload,r.oneofs&&(s._nativeFlowCallButtonPayload="nativeFlowCallButtonPayload")),A.deeplinkPayload!=null&&A.hasOwnProperty("deeplinkPayload")&&(s.deeplinkPayload=A.deeplinkPayload,r.oneofs&&(s._deeplinkPayload="deeplinkPayload")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Call"},i})(),t.CallLogMessage=(function(){function i(a){if(this.participants=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isVideo=A.bool();break}case 2:{c.callOutcome=A.int32();break}case 3:{c.durationSecs=A.int64();break}case 4:{c.callType=A.int32();break}case 5:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(p.proto.Message.CallLogMessage.CallParticipant.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CallLogMessage)return A;var r=new p.proto.Message.CallLogMessage;switch(A.isVideo!=null&&(r.isVideo=!!A.isVideo),A.callOutcome){default:if(typeof A.callOutcome=="number"){r.callOutcome=A.callOutcome;break}break;case"CONNECTED":case 0:r.callOutcome=0;break;case"MISSED":case 1:r.callOutcome=1;break;case"FAILED":case 2:r.callOutcome=2;break;case"REJECTED":case 3:r.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:r.callOutcome=4;break;case"ONGOING":case 5:r.callOutcome=5;break;case"SILENCED_BY_DND":case 6:r.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:r.callOutcome=7;break}switch(A.durationSecs!=null&&(l.Long?(r.durationSecs=l.Long.fromValue(A.durationSecs)).unsigned=!1:typeof A.durationSecs=="string"?r.durationSecs=parseInt(A.durationSecs,10):typeof A.durationSecs=="number"?r.durationSecs=A.durationSecs:typeof A.durationSecs=="object"&&(r.durationSecs=new l.LongBits(A.durationSecs.low>>>0,A.durationSecs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"REGULAR":case 0:r.callType=0;break;case"SCHEDULED_CALL":case 1:r.callType=1;break;case"VOICE_CHAT":case 2:r.callType=2;break}if(A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.Message.CallLogMessage.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{d.jid=s.string();break}case 2:{d.callOutcome=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.CallLogMessage.CallParticipant)return s;var g=new p.proto.Message.CallLogMessage.CallParticipant;switch(s.jid!=null&&(g.jid=String(s.jid)),s.callOutcome){default:if(typeof s.callOutcome=="number"){g.callOutcome=s.callOutcome;break}break;case"CONNECTED":case 0:g.callOutcome=0;break;case"MISSED":case 1:g.callOutcome=1;break;case"FAILED":case 2:g.callOutcome=2;break;case"REJECTED":case 3:g.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:g.callOutcome=4;break;case"ONGOING":case 5:g.callOutcome=5;break;case"SILENCED_BY_DND":case 6:g.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:g.callOutcome=7;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.jid!=null&&s.hasOwnProperty("jid")&&(c.jid=s.jid,g.oneofs&&(c._jid="jid")),s.callOutcome!=null&&s.hasOwnProperty("callOutcome")&&(c.callOutcome=g.enums===String?p.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]===void 0?s.callOutcome:p.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]:s.callOutcome,g.oneofs&&(c._callOutcome="callOutcome")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CallLogMessage.CallParticipant"},a})(),i.CallType=(function(){let a={},A=Object.create(a);return A[a[0]="REGULAR"]=0,A[a[1]="SCHEDULED_CALL"]=1,A[a[2]="VOICE_CHAT"]=2,A})(),i})(),t.CancelPaymentRequestMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CancelPaymentRequestMessage)return A;var r=new p.proto.Message.CancelPaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CancelPaymentRequestMessage"},i})(),t.Chat=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.Chat)return A;var r=new p.proto.Message.Chat;return A.displayName!=null&&(r.displayName=String(A.displayName)),A.id!=null&&(r.id=String(A.id)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Chat"},i})(),t.CloudAPIThreadControlNotification=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.senderNotificationTimestampMs=A.int64();break}case 3:{c.consumerLid=A.string();break}case 4:{c.consumerPhoneNumber=A.string();break}case 5:{c.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.decode(A,A.uint32());break}case 6:{c.shouldSuppressNotification=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CloudAPIThreadControlNotification)return A;var r=new p.proto.Message.CloudAPIThreadControlNotification;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"UNKNOWN":case 0:r.status=0;break;case"CONTROL_PASSED":case 1:r.status=1;break;case"CONTROL_TAKEN":case 2:r.status=2;break}if(A.senderNotificationTimestampMs!=null&&(l.Long?(r.senderNotificationTimestampMs=l.Long.fromValue(A.senderNotificationTimestampMs)).unsigned=!1:typeof A.senderNotificationTimestampMs=="string"?r.senderNotificationTimestampMs=parseInt(A.senderNotificationTimestampMs,10):typeof A.senderNotificationTimestampMs=="number"?r.senderNotificationTimestampMs=A.senderNotificationTimestampMs:typeof A.senderNotificationTimestampMs=="object"&&(r.senderNotificationTimestampMs=new l.LongBits(A.senderNotificationTimestampMs.low>>>0,A.senderNotificationTimestampMs.high>>>0).toNumber())),A.consumerLid!=null&&(r.consumerLid=String(A.consumerLid)),A.consumerPhoneNumber!=null&&(r.consumerPhoneNumber=String(A.consumerPhoneNumber)),A.notificationContent!=null){if(typeof A.notificationContent!="object")throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected");r.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(A.notificationContent)}return A.shouldSuppressNotification!=null&&(r.shouldSuppressNotification=!!A.shouldSuppressNotification),r},i.toObject=function(A,r){r||(r={});var s={};return A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]===void 0?A.status:p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]:A.status,r.oneofs&&(s._status="status")),A.senderNotificationTimestampMs!=null&&A.hasOwnProperty("senderNotificationTimestampMs")&&(typeof A.senderNotificationTimestampMs=="number"?s.senderNotificationTimestampMs=r.longs===String?String(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs:s.senderNotificationTimestampMs=r.longs===String?ge(A.senderNotificationTimestampMs):r.longs===Number?ce(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs,r.oneofs&&(s._senderNotificationTimestampMs="senderNotificationTimestampMs")),A.consumerLid!=null&&A.hasOwnProperty("consumerLid")&&(s.consumerLid=A.consumerLid,r.oneofs&&(s._consumerLid="consumerLid")),A.consumerPhoneNumber!=null&&A.hasOwnProperty("consumerPhoneNumber")&&(s.consumerPhoneNumber=A.consumerPhoneNumber,r.oneofs&&(s._consumerPhoneNumber="consumerPhoneNumber")),A.notificationContent!=null&&A.hasOwnProperty("notificationContent")&&(s.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(A.notificationContent,r),r.oneofs&&(s._notificationContent="notificationContent")),A.shouldSuppressNotification!=null&&A.hasOwnProperty("shouldSuppressNotification")&&(s.shouldSuppressNotification=A.shouldSuppressNotification,r.oneofs&&(s._shouldSuppressNotification="shouldSuppressNotification")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CloudAPIThreadControlNotification"},i.CloudAPIThreadControl=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CONTROL_PASSED"]=1,A[a[2]="CONTROL_TAKEN"]=2,A})(),i.CloudAPIThreadControlNotificationContent=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.handoffNotificationText=s.string();break}case 2:{d.extraJson=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent)return s;var g=new p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent;return s.handoffNotificationText!=null&&(g.handoffNotificationText=String(s.handoffNotificationText)),s.extraJson!=null&&(g.extraJson=String(s.extraJson)),g},a.toObject=function(s,g){g||(g={});var c={};return s.handoffNotificationText!=null&&s.hasOwnProperty("handoffNotificationText")&&(c.handoffNotificationText=s.handoffNotificationText,g.oneofs&&(c._handoffNotificationText="handoffNotificationText")),s.extraJson!=null&&s.hasOwnProperty("extraJson")&&(c.extraJson=s.extraJson,g.oneofs&&(c._extraJson="extraJson")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent"},a})(),i})(),t.CommentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.message=p.proto.Message.decode(A,A.uint32());break}case 2:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CommentMessage)return A;var r=new p.proto.Message.CommentMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.CommentMessage.message: object expected");r.message=p.proto.Message.fromObject(A.message)}if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CommentMessage"},i})(),t.ContactMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayName=A.string();break}case 16:{c.vcard=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ContactMessage)return A;var r=new p.proto.Message.ContactMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.vcard!=null&&(r.vcard=String(A.vcard)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.vcard!=null&&A.hasOwnProperty("vcard")&&(s.vcard=A.vcard,r.oneofs&&(s._vcard="vcard")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ContactMessage"},i})(),t.ContactsArrayMessage=(function(){function i(a){if(this.contacts=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.contacts&&c.contacts.length||(c.contacts=[]),c.contacts.push(p.proto.Message.ContactMessage.decode(A,A.uint32()));break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ContactsArrayMessage)return A;var r=new p.proto.Message.ContactsArrayMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.contacts){if(!Array.isArray(A.contacts))throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected");r.contacts=[];for(var s=0;s>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DeclinePaymentRequestMessage)return A;var r=new p.proto.Message.DeclinePaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeclinePaymentRequestMessage"},i})(),t.DeviceSentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.destinationJid=A.string();break}case 2:{c.message=p.proto.Message.decode(A,A.uint32());break}case 3:{c.phash=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DeviceSentMessage)return A;var r=new p.proto.Message.DeviceSentMessage;if(A.destinationJid!=null&&(r.destinationJid=String(A.destinationJid)),A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.DeviceSentMessage.message: object expected");r.message=p.proto.Message.fromObject(A.message)}return A.phash!=null&&(r.phash=String(A.phash)),r},i.toObject=function(A,r){r||(r={});var s={};return A.destinationJid!=null&&A.hasOwnProperty("destinationJid")&&(s.destinationJid=A.destinationJid,r.oneofs&&(s._destinationJid="destinationJid")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.phash!=null&&A.hasOwnProperty("phash")&&(s.phash=A.phash,r.oneofs&&(s._phash="phash")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeviceSentMessage"},i})(),t.DocumentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.title=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.pageCount=A.uint32();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileName=A.string();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.directPath=A.string();break}case 11:{c.mediaKeyTimestamp=A.int64();break}case 12:{c.contactVcard=A.bool();break}case 13:{c.thumbnailDirectPath=A.string();break}case 14:{c.thumbnailSha256=A.bytes();break}case 15:{c.thumbnailEncSha256=A.bytes();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.caption=A.string();break}case 21:{c.accessibilityLabel=A.string();break}case 22:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DocumentMessage)return A;var r=new p.proto.Message.DocumentMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.title!=null&&(r.title=String(A.title)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.pageCount!=null&&(r.pageCount=A.pageCount>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileName!=null&&(r.fileName=String(A.fileName)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contactVcard!=null&&(r.contactVcard=!!A.contactVcard),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.pageCount!=null&&A.hasOwnProperty("pageCount")&&(s.pageCount=A.pageCount,r.oneofs&&(s._pageCount="pageCount")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileName!=null&&A.hasOwnProperty("fileName")&&(s.fileName=A.fileName,r.oneofs&&(s._fileName="fileName")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contactVcard!=null&&A.hasOwnProperty("contactVcard")&&(s.contactVcard=A.contactVcard,r.oneofs&&(s._contactVcard="contactVcard")),A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DocumentMessage"},i})(),t.EncCommentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncCommentMessage)return A;var r=new p.proto.Message.EncCommentMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncCommentMessage"},i})(),t.EncEventResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.eventCreationMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncEventResponseMessage)return A;var r=new p.proto.Message.EncEventResponseMessage;if(A.eventCreationMessageKey!=null){if(typeof A.eventCreationMessageKey!="object")throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected");r.eventCreationMessageKey=p.proto.MessageKey.fromObject(A.eventCreationMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.eventCreationMessageKey!=null&&A.hasOwnProperty("eventCreationMessageKey")&&(s.eventCreationMessageKey=p.proto.MessageKey.toObject(A.eventCreationMessageKey,r),r.oneofs&&(s._eventCreationMessageKey="eventCreationMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncEventResponseMessage"},i})(),t.EncReactionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncReactionMessage)return A;var r=new p.proto.Message.EncReactionMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncReactionMessage"},i})(),t.EventMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.isCanceled=A.bool();break}case 3:{c.name=A.string();break}case 4:{c.description=A.string();break}case 5:{c.location=p.proto.Message.LocationMessage.decode(A,A.uint32());break}case 6:{c.joinLink=A.string();break}case 7:{c.startTime=A.int64();break}case 8:{c.endTime=A.int64();break}case 9:{c.extraGuestsAllowed=A.bool();break}case 10:{c.isScheduleCall=A.bool();break}case 11:{c.hasReminder=A.bool();break}case 12:{c.reminderOffsetSec=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EventMessage)return A;var r=new p.proto.Message.EventMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.EventMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.isCanceled!=null&&(r.isCanceled=!!A.isCanceled),A.name!=null&&(r.name=String(A.name)),A.description!=null&&(r.description=String(A.description)),A.location!=null){if(typeof A.location!="object")throw TypeError(".proto.Message.EventMessage.location: object expected");r.location=p.proto.Message.LocationMessage.fromObject(A.location)}return A.joinLink!=null&&(r.joinLink=String(A.joinLink)),A.startTime!=null&&(l.Long?(r.startTime=l.Long.fromValue(A.startTime)).unsigned=!1:typeof A.startTime=="string"?r.startTime=parseInt(A.startTime,10):typeof A.startTime=="number"?r.startTime=A.startTime:typeof A.startTime=="object"&&(r.startTime=new l.LongBits(A.startTime.low>>>0,A.startTime.high>>>0).toNumber())),A.endTime!=null&&(l.Long?(r.endTime=l.Long.fromValue(A.endTime)).unsigned=!1:typeof A.endTime=="string"?r.endTime=parseInt(A.endTime,10):typeof A.endTime=="number"?r.endTime=A.endTime:typeof A.endTime=="object"&&(r.endTime=new l.LongBits(A.endTime.low>>>0,A.endTime.high>>>0).toNumber())),A.extraGuestsAllowed!=null&&(r.extraGuestsAllowed=!!A.extraGuestsAllowed),A.isScheduleCall!=null&&(r.isScheduleCall=!!A.isScheduleCall),A.hasReminder!=null&&(r.hasReminder=!!A.hasReminder),A.reminderOffsetSec!=null&&(l.Long?(r.reminderOffsetSec=l.Long.fromValue(A.reminderOffsetSec)).unsigned=!1:typeof A.reminderOffsetSec=="string"?r.reminderOffsetSec=parseInt(A.reminderOffsetSec,10):typeof A.reminderOffsetSec=="number"?r.reminderOffsetSec=A.reminderOffsetSec:typeof A.reminderOffsetSec=="object"&&(r.reminderOffsetSec=new l.LongBits(A.reminderOffsetSec.low>>>0,A.reminderOffsetSec.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.isCanceled!=null&&A.hasOwnProperty("isCanceled")&&(s.isCanceled=A.isCanceled,r.oneofs&&(s._isCanceled="isCanceled")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),A.location!=null&&A.hasOwnProperty("location")&&(s.location=p.proto.Message.LocationMessage.toObject(A.location,r),r.oneofs&&(s._location="location")),A.joinLink!=null&&A.hasOwnProperty("joinLink")&&(s.joinLink=A.joinLink,r.oneofs&&(s._joinLink="joinLink")),A.startTime!=null&&A.hasOwnProperty("startTime")&&(typeof A.startTime=="number"?s.startTime=r.longs===String?String(A.startTime):A.startTime:s.startTime=r.longs===String?ge(A.startTime):r.longs===Number?ce(A.startTime):A.startTime,r.oneofs&&(s._startTime="startTime")),A.endTime!=null&&A.hasOwnProperty("endTime")&&(typeof A.endTime=="number"?s.endTime=r.longs===String?String(A.endTime):A.endTime:s.endTime=r.longs===String?ge(A.endTime):r.longs===Number?ce(A.endTime):A.endTime,r.oneofs&&(s._endTime="endTime")),A.extraGuestsAllowed!=null&&A.hasOwnProperty("extraGuestsAllowed")&&(s.extraGuestsAllowed=A.extraGuestsAllowed,r.oneofs&&(s._extraGuestsAllowed="extraGuestsAllowed")),A.isScheduleCall!=null&&A.hasOwnProperty("isScheduleCall")&&(s.isScheduleCall=A.isScheduleCall,r.oneofs&&(s._isScheduleCall="isScheduleCall")),A.hasReminder!=null&&A.hasOwnProperty("hasReminder")&&(s.hasReminder=A.hasReminder,r.oneofs&&(s._hasReminder="hasReminder")),A.reminderOffsetSec!=null&&A.hasOwnProperty("reminderOffsetSec")&&(typeof A.reminderOffsetSec=="number"?s.reminderOffsetSec=r.longs===String?String(A.reminderOffsetSec):A.reminderOffsetSec:s.reminderOffsetSec=r.longs===String?ge(A.reminderOffsetSec):r.longs===Number?ce(A.reminderOffsetSec):A.reminderOffsetSec,r.oneofs&&(s._reminderOffsetSec="reminderOffsetSec")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventMessage"},i})(),t.EventResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.response=A.int32();break}case 2:{c.timestampMs=A.int64();break}case 3:{c.extraGuestCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EventResponseMessage)return A;var r=new p.proto.Message.EventResponseMessage;switch(A.response){default:if(typeof A.response=="number"){r.response=A.response;break}break;case"UNKNOWN":case 0:r.response=0;break;case"GOING":case 1:r.response=1;break;case"NOT_GOING":case 2:r.response=2;break;case"MAYBE":case 3:r.response=3;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.extraGuestCount!=null&&(r.extraGuestCount=A.extraGuestCount|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.response!=null&&A.hasOwnProperty("response")&&(s.response=r.enums===String?p.proto.Message.EventResponseMessage.EventResponseType[A.response]===void 0?A.response:p.proto.Message.EventResponseMessage.EventResponseType[A.response]:A.response,r.oneofs&&(s._response="response")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.extraGuestCount!=null&&A.hasOwnProperty("extraGuestCount")&&(s.extraGuestCount=A.extraGuestCount,r.oneofs&&(s._extraGuestCount="extraGuestCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventResponseMessage"},i.EventResponseType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="GOING"]=1,A[a[2]="NOT_GOING"]=2,A[a[3]="MAYBE"]=3,A})(),i})(),t.ExtendedTextMessage=(function(){function i(a){if(this.endCardTiles=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.matchedText=A.string();break}case 5:{c.description=A.string();break}case 6:{c.title=A.string();break}case 7:{c.textArgb=A.fixed32();break}case 8:{c.backgroundArgb=A.fixed32();break}case 9:{c.font=A.int32();break}case 10:{c.previewType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.doNotPlayInline=A.bool();break}case 19:{c.thumbnailDirectPath=A.string();break}case 20:{c.thumbnailSha256=A.bytes();break}case 21:{c.thumbnailEncSha256=A.bytes();break}case 22:{c.mediaKey=A.bytes();break}case 23:{c.mediaKeyTimestamp=A.int64();break}case 24:{c.thumbnailHeight=A.uint32();break}case 25:{c.thumbnailWidth=A.uint32();break}case 26:{c.inviteLinkGroupType=A.int32();break}case 27:{c.inviteLinkParentGroupSubjectV2=A.string();break}case 28:{c.inviteLinkParentGroupThumbnailV2=A.bytes();break}case 29:{c.inviteLinkGroupTypeV2=A.int32();break}case 30:{c.viewOnce=A.bool();break}case 31:{c.videoHeight=A.uint32();break}case 32:{c.videoWidth=A.uint32();break}case 33:{c.faviconMMSMetadata=p.proto.Message.MMSThumbnailMetadata.decode(A,A.uint32());break}case 34:{c.linkPreviewMetadata=p.proto.Message.LinkPreviewMetadata.decode(A,A.uint32());break}case 35:{c.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 36:{c.endCardTiles&&c.endCardTiles.length||(c.endCardTiles=[]),c.endCardTiles.push(p.proto.Message.VideoEndCard.decode(A,A.uint32()));break}case 37:{c.videoContentUrl=A.string();break}case 38:{c.musicMetadata=p.proto.EmbeddedMusic.decode(A,A.uint32());break}case 39:{c.paymentExtendedMetadata=p.proto.Message.PaymentExtendedMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ExtendedTextMessage)return A;var r=new p.proto.Message.ExtendedTextMessage;switch(A.text!=null&&(r.text=String(A.text)),A.matchedText!=null&&(r.matchedText=String(A.matchedText)),A.description!=null&&(r.description=String(A.description)),A.title!=null&&(r.title=String(A.title)),A.textArgb!=null&&(r.textArgb=A.textArgb>>>0),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.font){default:if(typeof A.font=="number"){r.font=A.font;break}break;case"SYSTEM":case 0:r.font=0;break;case"SYSTEM_TEXT":case 1:r.font=1;break;case"FB_SCRIPT":case 2:r.font=2;break;case"SYSTEM_BOLD":case 6:r.font=6;break;case"MORNINGBREEZE_REGULAR":case 7:r.font=7;break;case"CALISTOGA_REGULAR":case 8:r.font=8;break;case"EXO2_EXTRABOLD":case 9:r.font=9;break;case"COURIERPRIME_BOLD":case 10:r.font=10;break}switch(A.previewType){default:if(typeof A.previewType=="number"){r.previewType=A.previewType;break}break;case"NONE":case 0:r.previewType=0;break;case"VIDEO":case 1:r.previewType=1;break;case"PLACEHOLDER":case 4:r.previewType=4;break;case"IMAGE":case 5:r.previewType=5;break;case"PAYMENT_LINKS":case 6:r.previewType=6;break;case"PROFILE":case 7:r.previewType=7;break}if(A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.doNotPlayInline!=null&&(r.doNotPlayInline=!!A.doNotPlayInline),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.inviteLinkGroupType){default:if(typeof A.inviteLinkGroupType=="number"){r.inviteLinkGroupType=A.inviteLinkGroupType;break}break;case"DEFAULT":case 0:r.inviteLinkGroupType=0;break;case"PARENT":case 1:r.inviteLinkGroupType=1;break;case"SUB":case 2:r.inviteLinkGroupType=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupType=3;break}switch(A.inviteLinkParentGroupSubjectV2!=null&&(r.inviteLinkParentGroupSubjectV2=String(A.inviteLinkParentGroupSubjectV2)),A.inviteLinkParentGroupThumbnailV2!=null&&(typeof A.inviteLinkParentGroupThumbnailV2=="string"?l.base64.decode(A.inviteLinkParentGroupThumbnailV2,r.inviteLinkParentGroupThumbnailV2=l.newBuffer(l.base64.length(A.inviteLinkParentGroupThumbnailV2)),0):A.inviteLinkParentGroupThumbnailV2.length>=0&&(r.inviteLinkParentGroupThumbnailV2=A.inviteLinkParentGroupThumbnailV2)),A.inviteLinkGroupTypeV2){default:if(typeof A.inviteLinkGroupTypeV2=="number"){r.inviteLinkGroupTypeV2=A.inviteLinkGroupTypeV2;break}break;case"DEFAULT":case 0:r.inviteLinkGroupTypeV2=0;break;case"PARENT":case 1:r.inviteLinkGroupTypeV2=1;break;case"SUB":case 2:r.inviteLinkGroupTypeV2=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupTypeV2=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.videoHeight!=null&&(r.videoHeight=A.videoHeight>>>0),A.videoWidth!=null&&(r.videoWidth=A.videoWidth>>>0),A.faviconMMSMetadata!=null){if(typeof A.faviconMMSMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected");r.faviconMMSMetadata=p.proto.Message.MMSThumbnailMetadata.fromObject(A.faviconMMSMetadata)}if(A.linkPreviewMetadata!=null){if(typeof A.linkPreviewMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected");r.linkPreviewMetadata=p.proto.Message.LinkPreviewMetadata.fromObject(A.linkPreviewMetadata)}if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected");r.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.endCardTiles){if(!Array.isArray(A.endCardTiles))throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: array expected");r.endCardTiles=[];for(var s=0;s>>3){case 1:{c.requestId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.FullHistorySyncOnDemandRequestMetadata)return A;var r=new p.proto.Message.FullHistorySyncOnDemandRequestMetadata;return A.requestId!=null&&(r.requestId=String(A.requestId)),r},i.toObject=function(A,r){r||(r={});var s={};return A.requestId!=null&&A.hasOwnProperty("requestId")&&(s.requestId=A.requestId,r.oneofs&&(s._requestId="requestId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FullHistorySyncOnDemandRequestMetadata"},i})(),t.FutureProofMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.message=p.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.FutureProofMessage)return A;var r=new p.proto.Message.FutureProofMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.FutureProofMessage.message: object expected");r.message=p.proto.Message.fromObject(A.message)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FutureProofMessage"},i})(),t.GroupInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.groupJid=A.string();break}case 2:{c.inviteCode=A.string();break}case 3:{c.inviteExpiration=A.int64();break}case 4:{c.groupName=A.string();break}case 5:{c.jpegThumbnail=A.bytes();break}case 6:{c.caption=A.string();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.groupType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.GroupInviteMessage)return A;var r=new p.proto.Message.GroupInviteMessage;if(A.groupJid!=null&&(r.groupJid=String(A.groupJid)),A.inviteCode!=null&&(r.inviteCode=String(A.inviteCode)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.groupName!=null&&(r.groupName=String(A.groupName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.groupType){default:if(typeof A.groupType=="number"){r.groupType=A.groupType;break}break;case"DEFAULT":case 0:r.groupType=0;break;case"PARENT":case 1:r.groupType=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.groupJid!=null&&A.hasOwnProperty("groupJid")&&(s.groupJid=A.groupJid,r.oneofs&&(s._groupJid="groupJid")),A.inviteCode!=null&&A.hasOwnProperty("inviteCode")&&(s.inviteCode=A.inviteCode,r.oneofs&&(s._inviteCode="inviteCode")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.groupName!=null&&A.hasOwnProperty("groupName")&&(s.groupName=A.groupName,r.oneofs&&(s._groupName="groupName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.groupType!=null&&A.hasOwnProperty("groupType")&&(s.groupType=r.enums===String?p.proto.Message.GroupInviteMessage.GroupType[A.groupType]===void 0?A.groupType:p.proto.Message.GroupInviteMessage.GroupType[A.groupType]:A.groupType,r.oneofs&&(s._groupType="groupType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.GroupInviteMessage"},i.GroupType=(function(){let a={},A=Object.create(a);return A[a[0]="DEFAULT"]=0,A[a[1]="PARENT"]=1,A})(),i})(),t.HighlyStructuredMessage=(function(){function i(a){if(this.params=[],this.localizableParams=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.namespace=A.string();break}case 2:{c.elementName=A.string();break}case 3:{c.params&&c.params.length||(c.params=[]),c.params.push(A.string());break}case 4:{c.fallbackLg=A.string();break}case 5:{c.fallbackLc=A.string();break}case 6:{c.localizableParams&&c.localizableParams.length||(c.localizableParams=[]),c.localizableParams.push(p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.decode(A,A.uint32()));break}case 7:{c.deterministicLg=A.string();break}case 8:{c.deterministicLc=A.string();break}case 9:{c.hydratedHsm=p.proto.Message.TemplateMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HighlyStructuredMessage)return A;var r=new p.proto.Message.HighlyStructuredMessage;if(A.namespace!=null&&(r.namespace=String(A.namespace)),A.elementName!=null&&(r.elementName=String(A.elementName)),A.params){if(!Array.isArray(A.params))throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected");r.params=[];for(var s=0;s>>3){case 1:{d.default=s.string();break}case 2:{d.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.decode(s,s.uint32());break}case 3:{d.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter)return s;var g=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter;if(s.default!=null&&(g.default=String(s.default)),s.currency!=null){if(typeof s.currency!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected");g.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(s.currency)}if(s.dateTime!=null){if(typeof s.dateTime!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected");g.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(s.dateTime)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.default!=null&&s.hasOwnProperty("default")&&(c.default=s.default,g.oneofs&&(c._default="default")),s.currency!=null&&s.hasOwnProperty("currency")&&(c.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(s.currency,g),g.oneofs&&(c.paramOneof="currency")),s.dateTime!=null&&s.hasOwnProperty("dateTime")&&(c.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(s.dateTime,g),g.oneofs&&(c.paramOneof="dateTime")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter"},a.HSMCurrency=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.currencyCode=c.string();break}case 2:{f.amount1000=c.int64();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency)return c;var I=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency;return c.currencyCode!=null&&(I.currencyCode=String(c.currencyCode)),c.amount1000!=null&&(l.Long?(I.amount1000=l.Long.fromValue(c.amount1000)).unsigned=!1:typeof c.amount1000=="string"?I.amount1000=parseInt(c.amount1000,10):typeof c.amount1000=="number"?I.amount1000=c.amount1000:typeof c.amount1000=="object"&&(I.amount1000=new l.LongBits(c.amount1000.low>>>0,c.amount1000.high>>>0).toNumber())),I},r.toObject=function(c,I){I||(I={});var d={};return c.currencyCode!=null&&c.hasOwnProperty("currencyCode")&&(d.currencyCode=c.currencyCode,I.oneofs&&(d._currencyCode="currencyCode")),c.amount1000!=null&&c.hasOwnProperty("amount1000")&&(typeof c.amount1000=="number"?d.amount1000=I.longs===String?String(c.amount1000):c.amount1000:d.amount1000=I.longs===String?ge(c.amount1000):I.longs===Number?ce(c.amount1000):c.amount1000,I.oneofs&&(d._amount1000="amount1000")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency"},r})(),a.HSMDateTime=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.decode(c,c.uint32());break}case 2:{f.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime)return c;var I=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime;if(c.component!=null){if(typeof c.component!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected");I.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(c.component)}if(c.unixEpoch!=null){if(typeof c.unixEpoch!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected");I.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(c.unixEpoch)}return I},r.toObject=function(c,I){I||(I={});var d={};return c.component!=null&&c.hasOwnProperty("component")&&(d.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(c.component,I),I.oneofs&&(d.datetimeOneof="component")),c.unixEpoch!=null&&c.hasOwnProperty("unixEpoch")&&(d.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(c.unixEpoch,I),I.oneofs&&(d.datetimeOneof="unixEpoch")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime"},r.HSMDateTimeComponent=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.dayOfWeek=d.int32();break}case 2:{y.year=d.uint32();break}case 3:{y.month=d.uint32();break}case 4:{y.dayOfMonth=d.uint32();break}case 5:{y.hour=d.uint32();break}case 6:{y.minute=d.uint32();break}case 7:{y.calendar=d.int32();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent)return d;var B=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent;switch(d.dayOfWeek){default:if(typeof d.dayOfWeek=="number"){B.dayOfWeek=d.dayOfWeek;break}break;case"MONDAY":case 1:B.dayOfWeek=1;break;case"TUESDAY":case 2:B.dayOfWeek=2;break;case"WEDNESDAY":case 3:B.dayOfWeek=3;break;case"THURSDAY":case 4:B.dayOfWeek=4;break;case"FRIDAY":case 5:B.dayOfWeek=5;break;case"SATURDAY":case 6:B.dayOfWeek=6;break;case"SUNDAY":case 7:B.dayOfWeek=7;break}switch(d.year!=null&&(B.year=d.year>>>0),d.month!=null&&(B.month=d.month>>>0),d.dayOfMonth!=null&&(B.dayOfMonth=d.dayOfMonth>>>0),d.hour!=null&&(B.hour=d.hour>>>0),d.minute!=null&&(B.minute=d.minute>>>0),d.calendar){default:if(typeof d.calendar=="number"){B.calendar=d.calendar;break}break;case"GREGORIAN":case 1:B.calendar=1;break;case"SOLAR_HIJRI":case 2:B.calendar=2;break}return B},g.toObject=function(d,B){B||(B={});var f={};return d.dayOfWeek!=null&&d.hasOwnProperty("dayOfWeek")&&(f.dayOfWeek=B.enums===String?p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[d.dayOfWeek]===void 0?d.dayOfWeek:p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[d.dayOfWeek]:d.dayOfWeek,B.oneofs&&(f._dayOfWeek="dayOfWeek")),d.year!=null&&d.hasOwnProperty("year")&&(f.year=d.year,B.oneofs&&(f._year="year")),d.month!=null&&d.hasOwnProperty("month")&&(f.month=d.month,B.oneofs&&(f._month="month")),d.dayOfMonth!=null&&d.hasOwnProperty("dayOfMonth")&&(f.dayOfMonth=d.dayOfMonth,B.oneofs&&(f._dayOfMonth="dayOfMonth")),d.hour!=null&&d.hasOwnProperty("hour")&&(f.hour=d.hour,B.oneofs&&(f._hour="hour")),d.minute!=null&&d.hasOwnProperty("minute")&&(f.minute=d.minute,B.oneofs&&(f._minute="minute")),d.calendar!=null&&d.hasOwnProperty("calendar")&&(f.calendar=B.enums===String?p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[d.calendar]===void 0?d.calendar:p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[d.calendar]:d.calendar,B.oneofs&&(f._calendar="calendar")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent"},g.CalendarType=(function(){let I={},d=Object.create(I);return d[I[1]="GREGORIAN"]=1,d[I[2]="SOLAR_HIJRI"]=2,d})(),g.DayOfWeekType=(function(){let I={},d=Object.create(I);return d[I[1]="MONDAY"]=1,d[I[2]="TUESDAY"]=2,d[I[3]="WEDNESDAY"]=3,d[I[4]="THURSDAY"]=4,d[I[5]="FRIDAY"]=5,d[I[6]="SATURDAY"]=6,d[I[7]="SUNDAY"]=7,d})(),g})(),r.HSMDateTimeUnixEpoch=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.timestamp=d.int64();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch)return d;var B=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch;return d.timestamp!=null&&(l.Long?(B.timestamp=l.Long.fromValue(d.timestamp)).unsigned=!1:typeof d.timestamp=="string"?B.timestamp=parseInt(d.timestamp,10):typeof d.timestamp=="number"?B.timestamp=d.timestamp:typeof d.timestamp=="object"&&(B.timestamp=new l.LongBits(d.timestamp.low>>>0,d.timestamp.high>>>0).toNumber())),B},g.toObject=function(d,B){B||(B={});var f={};return d.timestamp!=null&&d.hasOwnProperty("timestamp")&&(typeof d.timestamp=="number"?f.timestamp=B.longs===String?String(d.timestamp):d.timestamp:f.timestamp=B.longs===String?ge(d.timestamp):B.longs===Number?ce(d.timestamp):d.timestamp,B.oneofs&&(f._timestamp="timestamp")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch"},g})(),r})(),a})(),i})(),t.HistorySyncMessageAccessStatus=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.completeAccessGranted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HistorySyncMessageAccessStatus)return A;var r=new p.proto.Message.HistorySyncMessageAccessStatus;return A.completeAccessGranted!=null&&(r.completeAccessGranted=!!A.completeAccessGranted),r},i.toObject=function(A,r){r||(r={});var s={};return A.completeAccessGranted!=null&&A.hasOwnProperty("completeAccessGranted")&&(s.completeAccessGranted=A.completeAccessGranted,r.oneofs&&(s._completeAccessGranted="completeAccessGranted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncMessageAccessStatus"},i})(),t.HistorySyncNotification=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.fileSha256=A.bytes();break}case 2:{c.fileLength=A.uint64();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.syncType=A.int32();break}case 7:{c.chunkOrder=A.uint32();break}case 8:{c.originalMessageId=A.string();break}case 9:{c.progress=A.uint32();break}case 10:{c.oldestMsgInChunkTimestampSec=A.int64();break}case 11:{c.initialHistBootstrapInlinePayload=A.bytes();break}case 12:{c.peerDataRequestSessionId=A.string();break}case 13:{c.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(A,A.uint32());break}case 14:{c.encHandle=A.string();break}case 15:{c.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HistorySyncNotification)return A;var r=new p.proto.Message.HistorySyncNotification;switch(A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.syncType){default:if(typeof A.syncType=="number"){r.syncType=A.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:r.syncType=0;break;case"INITIAL_STATUS_V3":case 1:r.syncType=1;break;case"FULL":case 2:r.syncType=2;break;case"RECENT":case 3:r.syncType=3;break;case"PUSH_NAME":case 4:r.syncType=4;break;case"NON_BLOCKING_DATA":case 5:r.syncType=5;break;case"ON_DEMAND":case 6:r.syncType=6;break;case"NO_HISTORY":case 7:r.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:r.syncType=8;break}if(A.chunkOrder!=null&&(r.chunkOrder=A.chunkOrder>>>0),A.originalMessageId!=null&&(r.originalMessageId=String(A.originalMessageId)),A.progress!=null&&(r.progress=A.progress>>>0),A.oldestMsgInChunkTimestampSec!=null&&(l.Long?(r.oldestMsgInChunkTimestampSec=l.Long.fromValue(A.oldestMsgInChunkTimestampSec)).unsigned=!1:typeof A.oldestMsgInChunkTimestampSec=="string"?r.oldestMsgInChunkTimestampSec=parseInt(A.oldestMsgInChunkTimestampSec,10):typeof A.oldestMsgInChunkTimestampSec=="number"?r.oldestMsgInChunkTimestampSec=A.oldestMsgInChunkTimestampSec:typeof A.oldestMsgInChunkTimestampSec=="object"&&(r.oldestMsgInChunkTimestampSec=new l.LongBits(A.oldestMsgInChunkTimestampSec.low>>>0,A.oldestMsgInChunkTimestampSec.high>>>0).toNumber())),A.initialHistBootstrapInlinePayload!=null&&(typeof A.initialHistBootstrapInlinePayload=="string"?l.base64.decode(A.initialHistBootstrapInlinePayload,r.initialHistBootstrapInlinePayload=l.newBuffer(l.base64.length(A.initialHistBootstrapInlinePayload)),0):A.initialHistBootstrapInlinePayload.length>=0&&(r.initialHistBootstrapInlinePayload=A.initialHistBootstrapInlinePayload)),A.peerDataRequestSessionId!=null&&(r.peerDataRequestSessionId=String(A.peerDataRequestSessionId)),A.fullHistorySyncOnDemandRequestMetadata!=null){if(typeof A.fullHistorySyncOnDemandRequestMetadata!="object")throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected");r.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(A.fullHistorySyncOnDemandRequestMetadata)}if(A.encHandle!=null&&(r.encHandle=String(A.encHandle)),A.messageAccessStatus!=null){if(typeof A.messageAccessStatus!="object")throw TypeError(".proto.Message.HistorySyncNotification.messageAccessStatus: object expected");r.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.fromObject(A.messageAccessStatus)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.syncType!=null&&A.hasOwnProperty("syncType")&&(s.syncType=r.enums===String?p.proto.Message.HistorySyncType[A.syncType]===void 0?A.syncType:p.proto.Message.HistorySyncType[A.syncType]:A.syncType,r.oneofs&&(s._syncType="syncType")),A.chunkOrder!=null&&A.hasOwnProperty("chunkOrder")&&(s.chunkOrder=A.chunkOrder,r.oneofs&&(s._chunkOrder="chunkOrder")),A.originalMessageId!=null&&A.hasOwnProperty("originalMessageId")&&(s.originalMessageId=A.originalMessageId,r.oneofs&&(s._originalMessageId="originalMessageId")),A.progress!=null&&A.hasOwnProperty("progress")&&(s.progress=A.progress,r.oneofs&&(s._progress="progress")),A.oldestMsgInChunkTimestampSec!=null&&A.hasOwnProperty("oldestMsgInChunkTimestampSec")&&(typeof A.oldestMsgInChunkTimestampSec=="number"?s.oldestMsgInChunkTimestampSec=r.longs===String?String(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec:s.oldestMsgInChunkTimestampSec=r.longs===String?ge(A.oldestMsgInChunkTimestampSec):r.longs===Number?ce(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec,r.oneofs&&(s._oldestMsgInChunkTimestampSec="oldestMsgInChunkTimestampSec")),A.initialHistBootstrapInlinePayload!=null&&A.hasOwnProperty("initialHistBootstrapInlinePayload")&&(s.initialHistBootstrapInlinePayload=r.bytes===String?l.base64.encode(A.initialHistBootstrapInlinePayload,0,A.initialHistBootstrapInlinePayload.length):r.bytes===Array?Array.prototype.slice.call(A.initialHistBootstrapInlinePayload):A.initialHistBootstrapInlinePayload,r.oneofs&&(s._initialHistBootstrapInlinePayload="initialHistBootstrapInlinePayload")),A.peerDataRequestSessionId!=null&&A.hasOwnProperty("peerDataRequestSessionId")&&(s.peerDataRequestSessionId=A.peerDataRequestSessionId,r.oneofs&&(s._peerDataRequestSessionId="peerDataRequestSessionId")),A.fullHistorySyncOnDemandRequestMetadata!=null&&A.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")&&(s.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(A.fullHistorySyncOnDemandRequestMetadata,r),r.oneofs&&(s._fullHistorySyncOnDemandRequestMetadata="fullHistorySyncOnDemandRequestMetadata")),A.encHandle!=null&&A.hasOwnProperty("encHandle")&&(s.encHandle=A.encHandle,r.oneofs&&(s._encHandle="encHandle")),A.messageAccessStatus!=null&&A.hasOwnProperty("messageAccessStatus")&&(s.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.toObject(A.messageAccessStatus,r),r.oneofs&&(s._messageAccessStatus="messageAccessStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncNotification"},i})(),t.HistorySyncType=(function(){let i={},e=Object.create(i);return e[i[0]="INITIAL_BOOTSTRAP"]=0,e[i[1]="INITIAL_STATUS_V3"]=1,e[i[2]="FULL"]=2,e[i[3]="RECENT"]=3,e[i[4]="PUSH_NAME"]=4,e[i[5]="NON_BLOCKING_DATA"]=5,e[i[6]="ON_DEMAND"]=6,e[i[7]="NO_HISTORY"]=7,e[i[8]="MESSAGE_ACCESS_STATUS"]=8,e})(),t.ImageMessage=(function(){function i(a){if(this.interactiveAnnotations=[],this.scanLengths=[],this.annotations=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.caption=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 11:{c.directPath=A.string();break}case 12:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.firstScanSidecar=A.bytes();break}case 19:{c.firstScanLength=A.uint32();break}case 20:{c.experimentGroupId=A.uint32();break}case 21:{c.scansSidecar=A.bytes();break}case 22:{if(c.scanLengths&&c.scanLengths.length||(c.scanLengths=[]),(I&7)===2)for(var d=A.uint32()+A.pos;A.pos=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.firstScanSidecar!=null&&(typeof A.firstScanSidecar=="string"?l.base64.decode(A.firstScanSidecar,r.firstScanSidecar=l.newBuffer(l.base64.length(A.firstScanSidecar)),0):A.firstScanSidecar.length>=0&&(r.firstScanSidecar=A.firstScanSidecar)),A.firstScanLength!=null&&(r.firstScanLength=A.firstScanLength>>>0),A.experimentGroupId!=null&&(r.experimentGroupId=A.experimentGroupId>>>0),A.scansSidecar!=null&&(typeof A.scansSidecar=="string"?l.base64.decode(A.scansSidecar,r.scansSidecar=l.newBuffer(l.base64.length(A.scansSidecar)),0):A.scansSidecar.length>=0&&(r.scansSidecar=A.scansSidecar)),A.scanLengths){if(!Array.isArray(A.scanLengths))throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected");r.scanLengths=[];for(var s=0;s>>0}if(A.midQualityFileSha256!=null&&(typeof A.midQualityFileSha256=="string"?l.base64.decode(A.midQualityFileSha256,r.midQualityFileSha256=l.newBuffer(l.base64.length(A.midQualityFileSha256)),0):A.midQualityFileSha256.length>=0&&(r.midQualityFileSha256=A.midQualityFileSha256)),A.midQualityFileEncSha256!=null&&(typeof A.midQualityFileEncSha256=="string"?l.base64.decode(A.midQualityFileEncSha256,r.midQualityFileEncSha256=l.newBuffer(l.base64.length(A.midQualityFileEncSha256)),0):A.midQualityFileEncSha256.length>=0&&(r.midQualityFileEncSha256=A.midQualityFileEncSha256)),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.ImageMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>3){case 1:{c.securityNotificationEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InitialSecurityNotificationSettingSync)return A;var r=new p.proto.Message.InitialSecurityNotificationSettingSync;return A.securityNotificationEnabled!=null&&(r.securityNotificationEnabled=!!A.securityNotificationEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.securityNotificationEnabled!=null&&A.hasOwnProperty("securityNotificationEnabled")&&(s.securityNotificationEnabled=A.securityNotificationEnabled,r.oneofs&&(s._securityNotificationEnabled="securityNotificationEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InitialSecurityNotificationSettingSync"},i})(),t.InteractiveMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.header=p.proto.Message.InteractiveMessage.Header.decode(A,A.uint32());break}case 2:{c.body=p.proto.Message.InteractiveMessage.Body.decode(A,A.uint32());break}case 3:{c.footer=p.proto.Message.InteractiveMessage.Footer.decode(A,A.uint32());break}case 15:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 16:{c.urlTrackingMap=p.proto.UrlTrackingMap.decode(A,A.uint32());break}case 4:{c.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.decode(A,A.uint32());break}case 5:{c.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.decode(A,A.uint32());break}case 6:{c.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.decode(A,A.uint32());break}case 7:{c.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InteractiveMessage)return A;var r=new p.proto.Message.InteractiveMessage;if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.InteractiveMessage.header: object expected");r.header=p.proto.Message.InteractiveMessage.Header.fromObject(A.header)}if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveMessage.body: object expected");r.body=p.proto.Message.InteractiveMessage.Body.fromObject(A.body)}if(A.footer!=null){if(typeof A.footer!="object")throw TypeError(".proto.Message.InteractiveMessage.footer: object expected");r.footer=p.proto.Message.InteractiveMessage.Footer.fromObject(A.footer)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.urlTrackingMap!=null){if(typeof A.urlTrackingMap!="object")throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected");r.urlTrackingMap=p.proto.UrlTrackingMap.fromObject(A.urlTrackingMap)}if(A.shopStorefrontMessage!=null){if(typeof A.shopStorefrontMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected");r.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.fromObject(A.shopStorefrontMessage)}if(A.collectionMessage!=null){if(typeof A.collectionMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected");r.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.fromObject(A.collectionMessage)}if(A.nativeFlowMessage!=null){if(typeof A.nativeFlowMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected");r.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(A.nativeFlowMessage)}if(A.carouselMessage!=null){if(typeof A.carouselMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected");r.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.fromObject(A.carouselMessage)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.header!=null&&A.hasOwnProperty("header")&&(s.header=p.proto.Message.InteractiveMessage.Header.toObject(A.header,r),r.oneofs&&(s._header="header")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=p.proto.Message.InteractiveMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=p.proto.Message.InteractiveMessage.Footer.toObject(A.footer,r),r.oneofs&&(s._footer="footer")),A.shopStorefrontMessage!=null&&A.hasOwnProperty("shopStorefrontMessage")&&(s.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.toObject(A.shopStorefrontMessage,r),r.oneofs&&(s.interactiveMessage="shopStorefrontMessage")),A.collectionMessage!=null&&A.hasOwnProperty("collectionMessage")&&(s.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.toObject(A.collectionMessage,r),r.oneofs&&(s.interactiveMessage="collectionMessage")),A.nativeFlowMessage!=null&&A.hasOwnProperty("nativeFlowMessage")&&(s.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(A.nativeFlowMessage,r),r.oneofs&&(s.interactiveMessage="nativeFlowMessage")),A.carouselMessage!=null&&A.hasOwnProperty("carouselMessage")&&(s.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.toObject(A.carouselMessage,r),r.oneofs&&(s.interactiveMessage="carouselMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.urlTrackingMap!=null&&A.hasOwnProperty("urlTrackingMap")&&(s.urlTrackingMap=p.proto.UrlTrackingMap.toObject(A.urlTrackingMap,r),r.oneofs&&(s._urlTrackingMap="urlTrackingMap")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveMessage"},i.Body=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.text=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Body)return s;var g=new p.proto.Message.InteractiveMessage.Body;return s.text!=null&&(g.text=String(s.text)),g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Body"},a})(),i.CarouselMessage=(function(){function a(r){if(this.cards=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.cards&&d.cards.length||(d.cards=[]),d.cards.push(p.proto.Message.InteractiveMessage.decode(s,s.uint32()));break}case 2:{d.messageVersion=s.int32();break}case 3:{d.carouselCardType=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.CarouselMessage)return s;var g=new p.proto.Message.InteractiveMessage.CarouselMessage;if(s.cards){if(!Array.isArray(s.cards))throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected");g.cards=[];for(var c=0;c>>3){case 1:{d.bizJid=s.string();break}case 2:{d.id=s.string();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.CollectionMessage)return s;var g=new p.proto.Message.InteractiveMessage.CollectionMessage;return s.bizJid!=null&&(g.bizJid=String(s.bizJid)),s.id!=null&&(g.id=String(s.id)),s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.bizJid!=null&&s.hasOwnProperty("bizJid")&&(c.bizJid=s.bizJid,g.oneofs&&(c._bizJid="bizJid")),s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.CollectionMessage"},a})(),i.Footer=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.text=s.string();break}case 3:{d.hasMediaAttachment=s.bool();break}case 2:{d.audioMessage=p.proto.Message.AudioMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Footer)return s;var g=new p.proto.Message.InteractiveMessage.Footer;if(s.text!=null&&(g.text=String(s.text)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.audioMessage!=null){if(typeof s.audioMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Footer.audioMessage: object expected");g.audioMessage=p.proto.Message.AudioMessage.fromObject(s.audioMessage)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.audioMessage!=null&&s.hasOwnProperty("audioMessage")&&(c.audioMessage=p.proto.Message.AudioMessage.toObject(s.audioMessage,g),g.oneofs&&(c.media="audioMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Footer"},a})(),i.Header=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.title=s.string();break}case 2:{d.subtitle=s.string();break}case 5:{d.hasMediaAttachment=s.bool();break}case 3:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 4:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 6:{d.jpegThumbnail=s.bytes();break}case 7:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 8:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}case 9:{d.productMessage=p.proto.Message.ProductMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Header)return s;var g=new p.proto.Message.InteractiveMessage.Header;if(s.title!=null&&(g.title=String(s.title)),s.subtitle!=null&&(g.subtitle=String(s.subtitle)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.documentMessage!=null){if(typeof s.documentMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected");g.documentMessage=p.proto.Message.DocumentMessage.fromObject(s.documentMessage)}if(s.imageMessage!=null){if(typeof s.imageMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected");g.imageMessage=p.proto.Message.ImageMessage.fromObject(s.imageMessage)}if(s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),s.videoMessage!=null){if(typeof s.videoMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected");g.videoMessage=p.proto.Message.VideoMessage.fromObject(s.videoMessage)}if(s.locationMessage!=null){if(typeof s.locationMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected");g.locationMessage=p.proto.Message.LocationMessage.fromObject(s.locationMessage)}if(s.productMessage!=null){if(typeof s.productMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected");g.productMessage=p.proto.Message.ProductMessage.fromObject(s.productMessage)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.subtitle!=null&&s.hasOwnProperty("subtitle")&&(c.subtitle=s.subtitle,g.oneofs&&(c._subtitle="subtitle")),s.documentMessage!=null&&s.hasOwnProperty("documentMessage")&&(c.documentMessage=p.proto.Message.DocumentMessage.toObject(s.documentMessage,g),g.oneofs&&(c.media="documentMessage")),s.imageMessage!=null&&s.hasOwnProperty("imageMessage")&&(c.imageMessage=p.proto.Message.ImageMessage.toObject(s.imageMessage,g),g.oneofs&&(c.media="imageMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c.media="jpegThumbnail")),s.videoMessage!=null&&s.hasOwnProperty("videoMessage")&&(c.videoMessage=p.proto.Message.VideoMessage.toObject(s.videoMessage,g),g.oneofs&&(c.media="videoMessage")),s.locationMessage!=null&&s.hasOwnProperty("locationMessage")&&(c.locationMessage=p.proto.Message.LocationMessage.toObject(s.locationMessage,g),g.oneofs&&(c.media="locationMessage")),s.productMessage!=null&&s.hasOwnProperty("productMessage")&&(c.productMessage=p.proto.Message.ProductMessage.toObject(s.productMessage,g),g.oneofs&&(c.media="productMessage")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Header"},a})(),i.NativeFlowMessage=(function(){function a(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.buttons&&d.buttons.length||(d.buttons=[]),d.buttons.push(p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.decode(s,s.uint32()));break}case 2:{d.messageParamsJson=s.string();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.NativeFlowMessage)return s;var g=new p.proto.Message.InteractiveMessage.NativeFlowMessage;if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 1:{f.name=c.string();break}case 2:{f.buttonParamsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton)return c;var I=new p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton;return c.name!=null&&(I.name=String(c.name)),c.buttonParamsJson!=null&&(I.buttonParamsJson=String(c.buttonParamsJson)),I},r.toObject=function(c,I){I||(I={});var d={};return c.name!=null&&c.hasOwnProperty("name")&&(d.name=c.name,I.oneofs&&(d._name="name")),c.buttonParamsJson!=null&&c.hasOwnProperty("buttonParamsJson")&&(d.buttonParamsJson=c.buttonParamsJson,I.oneofs&&(d._buttonParamsJson="buttonParamsJson")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton"},r})(),a})(),i.ShopMessage=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.id=s.string();break}case 2:{d.surface=s.int32();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.ShopMessage)return s;var g=new p.proto.Message.InteractiveMessage.ShopMessage;switch(s.id!=null&&(g.id=String(s.id)),s.surface){default:if(typeof s.surface=="number"){g.surface=s.surface;break}break;case"UNKNOWN_SURFACE":case 0:g.surface=0;break;case"FB":case 1:g.surface=1;break;case"IG":case 2:g.surface=2;break;case"WA":case 3:g.surface=3;break}return s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.surface!=null&&s.hasOwnProperty("surface")&&(c.surface=g.enums===String?p.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]===void 0?s.surface:p.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]:s.surface,g.oneofs&&(c._surface="surface")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.ShopMessage"},a.Surface=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN_SURFACE"]=0,s[r[1]="FB"]=1,s[r[2]="IG"]=2,s[r[3]="WA"]=3,s})(),a})(),i})(),t.InteractiveResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.body=p.proto.Message.InteractiveResponseMessage.Body.decode(A,A.uint32());break}case 15:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InteractiveResponseMessage)return A;var r=new p.proto.Message.InteractiveResponseMessage;if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected");r.body=p.proto.Message.InteractiveResponseMessage.Body.fromObject(A.body)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.nativeFlowResponseMessage!=null){if(typeof A.nativeFlowResponseMessage!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected");r.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(A.nativeFlowResponseMessage)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.body!=null&&A.hasOwnProperty("body")&&(s.body=p.proto.Message.InteractiveResponseMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.nativeFlowResponseMessage!=null&&A.hasOwnProperty("nativeFlowResponseMessage")&&(s.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(A.nativeFlowResponseMessage,r),r.oneofs&&(s.interactiveResponseMessage="nativeFlowResponseMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveResponseMessage"},i.Body=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.text=s.string();break}case 2:{d.format=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveResponseMessage.Body)return s;var g=new p.proto.Message.InteractiveResponseMessage.Body;switch(s.text!=null&&(g.text=String(s.text)),s.format){default:if(typeof s.format=="number"){g.format=s.format;break}break;case"DEFAULT":case 0:g.format=0;break;case"EXTENSIONS_1":case 1:g.format=1;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.format!=null&&s.hasOwnProperty("format")&&(c.format=g.enums===String?p.proto.Message.InteractiveResponseMessage.Body.Format[s.format]===void 0?s.format:p.proto.Message.InteractiveResponseMessage.Body.Format[s.format]:s.format,g.oneofs&&(c._format="format")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.Body"},a.Format=(function(){let r={},s=Object.create(r);return s[r[0]="DEFAULT"]=0,s[r[1]="EXTENSIONS_1"]=1,s})(),a})(),i.NativeFlowResponseMessage=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.name=s.string();break}case 2:{d.paramsJson=s.string();break}case 3:{d.version=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage)return s;var g=new p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage;return s.name!=null&&(g.name=String(s.name)),s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),s.version!=null&&(g.version=s.version|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name,g.oneofs&&(c._name="name")),s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),s.version!=null&&s.hasOwnProperty("version")&&(c.version=s.version,g.oneofs&&(c._version="version")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage"},a})(),i})(),t.InvoiceMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.note=A.string();break}case 2:{c.token=A.string();break}case 3:{c.attachmentType=A.int32();break}case 4:{c.attachmentMimetype=A.string();break}case 5:{c.attachmentMediaKey=A.bytes();break}case 6:{c.attachmentMediaKeyTimestamp=A.int64();break}case 7:{c.attachmentFileSha256=A.bytes();break}case 8:{c.attachmentFileEncSha256=A.bytes();break}case 9:{c.attachmentDirectPath=A.string();break}case 10:{c.attachmentJpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InvoiceMessage)return A;var r=new p.proto.Message.InvoiceMessage;switch(A.note!=null&&(r.note=String(A.note)),A.token!=null&&(r.token=String(A.token)),A.attachmentType){default:if(typeof A.attachmentType=="number"){r.attachmentType=A.attachmentType;break}break;case"IMAGE":case 0:r.attachmentType=0;break;case"PDF":case 1:r.attachmentType=1;break}return A.attachmentMimetype!=null&&(r.attachmentMimetype=String(A.attachmentMimetype)),A.attachmentMediaKey!=null&&(typeof A.attachmentMediaKey=="string"?l.base64.decode(A.attachmentMediaKey,r.attachmentMediaKey=l.newBuffer(l.base64.length(A.attachmentMediaKey)),0):A.attachmentMediaKey.length>=0&&(r.attachmentMediaKey=A.attachmentMediaKey)),A.attachmentMediaKeyTimestamp!=null&&(l.Long?(r.attachmentMediaKeyTimestamp=l.Long.fromValue(A.attachmentMediaKeyTimestamp)).unsigned=!1:typeof A.attachmentMediaKeyTimestamp=="string"?r.attachmentMediaKeyTimestamp=parseInt(A.attachmentMediaKeyTimestamp,10):typeof A.attachmentMediaKeyTimestamp=="number"?r.attachmentMediaKeyTimestamp=A.attachmentMediaKeyTimestamp:typeof A.attachmentMediaKeyTimestamp=="object"&&(r.attachmentMediaKeyTimestamp=new l.LongBits(A.attachmentMediaKeyTimestamp.low>>>0,A.attachmentMediaKeyTimestamp.high>>>0).toNumber())),A.attachmentFileSha256!=null&&(typeof A.attachmentFileSha256=="string"?l.base64.decode(A.attachmentFileSha256,r.attachmentFileSha256=l.newBuffer(l.base64.length(A.attachmentFileSha256)),0):A.attachmentFileSha256.length>=0&&(r.attachmentFileSha256=A.attachmentFileSha256)),A.attachmentFileEncSha256!=null&&(typeof A.attachmentFileEncSha256=="string"?l.base64.decode(A.attachmentFileEncSha256,r.attachmentFileEncSha256=l.newBuffer(l.base64.length(A.attachmentFileEncSha256)),0):A.attachmentFileEncSha256.length>=0&&(r.attachmentFileEncSha256=A.attachmentFileEncSha256)),A.attachmentDirectPath!=null&&(r.attachmentDirectPath=String(A.attachmentDirectPath)),A.attachmentJpegThumbnail!=null&&(typeof A.attachmentJpegThumbnail=="string"?l.base64.decode(A.attachmentJpegThumbnail,r.attachmentJpegThumbnail=l.newBuffer(l.base64.length(A.attachmentJpegThumbnail)),0):A.attachmentJpegThumbnail.length>=0&&(r.attachmentJpegThumbnail=A.attachmentJpegThumbnail)),r},i.toObject=function(A,r){r||(r={});var s={};return A.note!=null&&A.hasOwnProperty("note")&&(s.note=A.note,r.oneofs&&(s._note="note")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.attachmentType!=null&&A.hasOwnProperty("attachmentType")&&(s.attachmentType=r.enums===String?p.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]===void 0?A.attachmentType:p.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]:A.attachmentType,r.oneofs&&(s._attachmentType="attachmentType")),A.attachmentMimetype!=null&&A.hasOwnProperty("attachmentMimetype")&&(s.attachmentMimetype=A.attachmentMimetype,r.oneofs&&(s._attachmentMimetype="attachmentMimetype")),A.attachmentMediaKey!=null&&A.hasOwnProperty("attachmentMediaKey")&&(s.attachmentMediaKey=r.bytes===String?l.base64.encode(A.attachmentMediaKey,0,A.attachmentMediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentMediaKey):A.attachmentMediaKey,r.oneofs&&(s._attachmentMediaKey="attachmentMediaKey")),A.attachmentMediaKeyTimestamp!=null&&A.hasOwnProperty("attachmentMediaKeyTimestamp")&&(typeof A.attachmentMediaKeyTimestamp=="number"?s.attachmentMediaKeyTimestamp=r.longs===String?String(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp:s.attachmentMediaKeyTimestamp=r.longs===String?ge(A.attachmentMediaKeyTimestamp):r.longs===Number?ce(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp,r.oneofs&&(s._attachmentMediaKeyTimestamp="attachmentMediaKeyTimestamp")),A.attachmentFileSha256!=null&&A.hasOwnProperty("attachmentFileSha256")&&(s.attachmentFileSha256=r.bytes===String?l.base64.encode(A.attachmentFileSha256,0,A.attachmentFileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileSha256):A.attachmentFileSha256,r.oneofs&&(s._attachmentFileSha256="attachmentFileSha256")),A.attachmentFileEncSha256!=null&&A.hasOwnProperty("attachmentFileEncSha256")&&(s.attachmentFileEncSha256=r.bytes===String?l.base64.encode(A.attachmentFileEncSha256,0,A.attachmentFileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileEncSha256):A.attachmentFileEncSha256,r.oneofs&&(s._attachmentFileEncSha256="attachmentFileEncSha256")),A.attachmentDirectPath!=null&&A.hasOwnProperty("attachmentDirectPath")&&(s.attachmentDirectPath=A.attachmentDirectPath,r.oneofs&&(s._attachmentDirectPath="attachmentDirectPath")),A.attachmentJpegThumbnail!=null&&A.hasOwnProperty("attachmentJpegThumbnail")&&(s.attachmentJpegThumbnail=r.bytes===String?l.base64.encode(A.attachmentJpegThumbnail,0,A.attachmentJpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentJpegThumbnail):A.attachmentJpegThumbnail,r.oneofs&&(s._attachmentJpegThumbnail="attachmentJpegThumbnail")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InvoiceMessage"},i.AttachmentType=(function(){let a={},A=Object.create(a);return A[a[0]="IMAGE"]=0,A[a[1]="PDF"]=1,A})(),i})(),t.KeepInChatMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.keepType=A.int32();break}case 3:{c.timestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.KeepInChatMessage)return A;var r=new p.proto.Message.KeepInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.KeepInChatMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.keepType){default:if(typeof A.keepType=="number"){r.keepType=A.keepType;break}break;case"UNKNOWN":case 0:r.keepType=0;break;case"KEEP_FOR_ALL":case 1:r.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:r.keepType=2;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.keepType!=null&&A.hasOwnProperty("keepType")&&(s.keepType=r.enums===String?p.proto.KeepType[A.keepType]===void 0?A.keepType:p.proto.KeepType[A.keepType]:A.keepType,r.oneofs&&(s._keepType="keepType")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.KeepInChatMessage"},i})(),t.LinkPreviewMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 2:{c.urlMetadata=p.proto.Message.URLMetadata.decode(A,A.uint32());break}case 3:{c.fbExperimentId=A.uint32();break}case 4:{c.linkMediaDuration=A.uint32();break}case 5:{c.socialMediaPostType=A.int32();break}case 6:{c.linkInlineVideoMuted=A.bool();break}case 7:{c.videoContentUrl=A.string();break}case 8:{c.musicMetadata=p.proto.EmbeddedMusic.decode(A,A.uint32());break}case 9:{c.videoContentCaption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LinkPreviewMetadata)return A;var r=new p.proto.Message.LinkPreviewMetadata;if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected");r.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.urlMetadata!=null){if(typeof A.urlMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected");r.urlMetadata=p.proto.Message.URLMetadata.fromObject(A.urlMetadata)}switch(A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),A.linkMediaDuration!=null&&(r.linkMediaDuration=A.linkMediaDuration>>>0),A.socialMediaPostType){default:if(typeof A.socialMediaPostType=="number"){r.socialMediaPostType=A.socialMediaPostType;break}break;case"NONE":case 0:r.socialMediaPostType=0;break;case"REEL":case 1:r.socialMediaPostType=1;break;case"LIVE_VIDEO":case 2:r.socialMediaPostType=2;break;case"LONG_VIDEO":case 3:r.socialMediaPostType=3;break;case"SINGLE_IMAGE":case 4:r.socialMediaPostType=4;break;case"CAROUSEL":case 5:r.socialMediaPostType=5;break}if(A.linkInlineVideoMuted!=null&&(r.linkInlineVideoMuted=!!A.linkInlineVideoMuted),A.videoContentUrl!=null&&(r.videoContentUrl=String(A.videoContentUrl)),A.musicMetadata!=null){if(typeof A.musicMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.musicMetadata: object expected");r.musicMetadata=p.proto.EmbeddedMusic.fromObject(A.musicMetadata)}return A.videoContentCaption!=null&&(r.videoContentCaption=String(A.videoContentCaption)),r},i.toObject=function(A,r){r||(r={});var s={};return A.paymentLinkMetadata!=null&&A.hasOwnProperty("paymentLinkMetadata")&&(s.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.toObject(A.paymentLinkMetadata,r),r.oneofs&&(s._paymentLinkMetadata="paymentLinkMetadata")),A.urlMetadata!=null&&A.hasOwnProperty("urlMetadata")&&(s.urlMetadata=p.proto.Message.URLMetadata.toObject(A.urlMetadata,r),r.oneofs&&(s._urlMetadata="urlMetadata")),A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),A.linkMediaDuration!=null&&A.hasOwnProperty("linkMediaDuration")&&(s.linkMediaDuration=A.linkMediaDuration,r.oneofs&&(s._linkMediaDuration="linkMediaDuration")),A.socialMediaPostType!=null&&A.hasOwnProperty("socialMediaPostType")&&(s.socialMediaPostType=r.enums===String?p.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]===void 0?A.socialMediaPostType:p.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]:A.socialMediaPostType,r.oneofs&&(s._socialMediaPostType="socialMediaPostType")),A.linkInlineVideoMuted!=null&&A.hasOwnProperty("linkInlineVideoMuted")&&(s.linkInlineVideoMuted=A.linkInlineVideoMuted,r.oneofs&&(s._linkInlineVideoMuted="linkInlineVideoMuted")),A.videoContentUrl!=null&&A.hasOwnProperty("videoContentUrl")&&(s.videoContentUrl=A.videoContentUrl,r.oneofs&&(s._videoContentUrl="videoContentUrl")),A.musicMetadata!=null&&A.hasOwnProperty("musicMetadata")&&(s.musicMetadata=p.proto.EmbeddedMusic.toObject(A.musicMetadata,r),r.oneofs&&(s._musicMetadata="musicMetadata")),A.videoContentCaption!=null&&A.hasOwnProperty("videoContentCaption")&&(s.videoContentCaption=A.videoContentCaption,r.oneofs&&(s._videoContentCaption="videoContentCaption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LinkPreviewMetadata"},i.SocialMediaPostType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="REEL"]=1,A[a[2]="LIVE_VIDEO"]=2,A[a[3]="LONG_VIDEO"]=3,A[a[4]="SINGLE_IMAGE"]=4,A[a[5]="CAROUSEL"]=5,A})(),i})(),t.ListMessage=(function(){function i(a){if(this.sections=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.description=A.string();break}case 3:{c.buttonText=A.string();break}case 4:{c.listType=A.int32();break}case 5:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(p.proto.Message.ListMessage.Section.decode(A,A.uint32()));break}case 6:{c.productListInfo=p.proto.Message.ListMessage.ProductListInfo.decode(A,A.uint32());break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ListMessage)return A;var r=new p.proto.Message.ListMessage;switch(A.title!=null&&(r.title=String(A.title)),A.description!=null&&(r.description=String(A.description)),A.buttonText!=null&&(r.buttonText=String(A.buttonText)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break;case"PRODUCT_LIST":case 2:r.listType=2;break}if(A.sections){if(!Array.isArray(A.sections))throw TypeError(".proto.Message.ListMessage.sections: array expected");r.sections=[];for(var s=0;s>>3){case 1:{d.productId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Product)return s;var g=new p.proto.Message.ListMessage.Product;return s.productId!=null&&(g.productId=String(s.productId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Product"},a})(),i.ProductListHeaderImage=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.productId=s.string();break}case 2:{d.jpegThumbnail=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductListHeaderImage)return s;var g=new p.proto.Message.ListMessage.ProductListHeaderImage;return s.productId!=null&&(g.productId=String(s.productId)),s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c._jpegThumbnail="jpegThumbnail")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.ProductListHeaderImage"},a})(),i.ProductListInfo=(function(){function a(r){if(this.productSections=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.productSections&&d.productSections.length||(d.productSections=[]),d.productSections.push(p.proto.Message.ListMessage.ProductSection.decode(s,s.uint32()));break}case 2:{d.headerImage=p.proto.Message.ListMessage.ProductListHeaderImage.decode(s,s.uint32());break}case 3:{d.businessOwnerJid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductListInfo)return s;var g=new p.proto.Message.ListMessage.ProductListInfo;if(s.productSections){if(!Array.isArray(s.productSections))throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected");g.productSections=[];for(var c=0;c>>3){case 1:{d.title=s.string();break}case 2:{d.products&&d.products.length||(d.products=[]),d.products.push(p.proto.Message.ListMessage.Product.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductSection)return s;var g=new p.proto.Message.ListMessage.ProductSection;if(s.title!=null&&(g.title=String(s.title)),s.products){if(!Array.isArray(s.products))throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected");g.products=[];for(var c=0;c>>3){case 1:{d.title=s.string();break}case 2:{d.description=s.string();break}case 3:{d.rowId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Row)return s;var g=new p.proto.Message.ListMessage.Row;return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.rowId!=null&&(g.rowId=String(s.rowId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.rowId!=null&&s.hasOwnProperty("rowId")&&(c.rowId=s.rowId,g.oneofs&&(c._rowId="rowId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Row"},a})(),i.Section=(function(){function a(r){if(this.rows=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.title=s.string();break}case 2:{d.rows&&d.rows.length||(d.rows=[]),d.rows.push(p.proto.Message.ListMessage.Row.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Section)return s;var g=new p.proto.Message.ListMessage.Section;if(s.title!=null&&(g.title=String(s.title)),s.rows){if(!Array.isArray(s.rows))throw TypeError(".proto.Message.ListMessage.Section.rows: array expected");g.rows=[];for(var c=0;c>>3){case 1:{c.title=A.string();break}case 2:{c.listType=A.int32();break}case 3:{c.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.decode(A,A.uint32());break}case 4:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 5:{c.description=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ListResponseMessage)return A;var r=new p.proto.Message.ListResponseMessage;switch(A.title!=null&&(r.title=String(A.title)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break}if(A.singleSelectReply!=null){if(typeof A.singleSelectReply!="object")throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected");r.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(A.singleSelectReply)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.description!=null&&(r.description=String(A.description)),r},i.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.listType!=null&&A.hasOwnProperty("listType")&&(s.listType=r.enums===String?p.proto.Message.ListResponseMessage.ListType[A.listType]===void 0?A.listType:p.proto.Message.ListResponseMessage.ListType[A.listType]:A.listType,r.oneofs&&(s._listType="listType")),A.singleSelectReply!=null&&A.hasOwnProperty("singleSelectReply")&&(s.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.toObject(A.singleSelectReply,r),r.oneofs&&(s._singleSelectReply="singleSelectReply")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ListResponseMessage"},i.ListType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="SINGLE_SELECT"]=1,A})(),i.SingleSelectReply=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.selectedRowId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListResponseMessage.SingleSelectReply)return s;var g=new p.proto.Message.ListResponseMessage.SingleSelectReply;return s.selectedRowId!=null&&(g.selectedRowId=String(s.selectedRowId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.selectedRowId!=null&&s.hasOwnProperty("selectedRowId")&&(c.selectedRowId=s.selectedRowId,g.oneofs&&(c._selectedRowId="selectedRowId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListResponseMessage.SingleSelectReply"},a})(),i})(),t.LiveLocationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.accuracyInMeters=A.uint32();break}case 4:{c.speedInMps=A.float();break}case 5:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 6:{c.caption=A.string();break}case 7:{c.sequenceNumber=A.int64();break}case 8:{c.timeOffset=A.uint32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LiveLocationMessage)return A;var r=new p.proto.Message.LiveLocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.sequenceNumber!=null&&(l.Long?(r.sequenceNumber=l.Long.fromValue(A.sequenceNumber)).unsigned=!1:typeof A.sequenceNumber=="string"?r.sequenceNumber=parseInt(A.sequenceNumber,10):typeof A.sequenceNumber=="number"?r.sequenceNumber=A.sequenceNumber:typeof A.sequenceNumber=="object"&&(r.sequenceNumber=new l.LongBits(A.sequenceNumber.low>>>0,A.sequenceNumber.high>>>0).toNumber())),A.timeOffset!=null&&(r.timeOffset=A.timeOffset>>>0),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.sequenceNumber!=null&&A.hasOwnProperty("sequenceNumber")&&(typeof A.sequenceNumber=="number"?s.sequenceNumber=r.longs===String?String(A.sequenceNumber):A.sequenceNumber:s.sequenceNumber=r.longs===String?ge(A.sequenceNumber):r.longs===Number?ce(A.sequenceNumber):A.sequenceNumber,r.oneofs&&(s._sequenceNumber="sequenceNumber")),A.timeOffset!=null&&A.hasOwnProperty("timeOffset")&&(s.timeOffset=A.timeOffset,r.oneofs&&(s._timeOffset="timeOffset")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LiveLocationMessage"},i})(),t.LocationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.isLive=A.bool();break}case 7:{c.accuracyInMeters=A.uint32();break}case 8:{c.speedInMps=A.float();break}case 9:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 11:{c.comment=A.string();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LocationMessage)return A;var r=new p.proto.Message.LocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.isLive!=null&&(r.isLive=!!A.isLive),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.comment!=null&&(r.comment=String(A.comment)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.isLive!=null&&A.hasOwnProperty("isLive")&&(s.isLive=A.isLive,r.oneofs&&(s._isLive="isLive")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.comment!=null&&A.hasOwnProperty("comment")&&(s.comment=A.comment,r.oneofs&&(s._comment="comment")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LocationMessage"},i})(),t.MMSThumbnailMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.thumbnailDirectPath=A.string();break}case 2:{c.thumbnailSha256=A.bytes();break}case 3:{c.thumbnailEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mediaKeyTimestamp=A.int64();break}case 6:{c.thumbnailHeight=A.uint32();break}case 7:{c.thumbnailWidth=A.uint32();break}case 8:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MMSThumbnailMetadata)return A;var r=new p.proto.Message.MMSThumbnailMetadata;switch(A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MMSThumbnailMetadata"},i})(),t.MediaKeyDomain=(function(){let i={},e=Object.create(i);return e[i[0]="UNSET"]=0,e[i[1]="E2EE_CHAT"]=1,e[i[2]="STATUS"]=2,e[i[3]="CAPI"]=3,e[i[4]="BOT"]=4,e})(),t.MessageHistoryBundle=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.mimetype=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.mediaKeyTimestamp=A.int64();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryBundle)return A;var r=new p.proto.Message.MessageHistoryBundle;if(A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected");r.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryBundle"},i})(),t.MessageHistoryMetadata=(function(){function i(a){if(this.historyReceivers=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.historyReceivers&&c.historyReceivers.length||(c.historyReceivers=[]),c.historyReceivers.push(A.string());break}case 2:{c.oldestMessageTimestamp=A.int64();break}case 3:{c.messageCount=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryMetadata)return A;var r=new p.proto.Message.MessageHistoryMetadata;if(A.historyReceivers){if(!Array.isArray(A.historyReceivers))throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected");r.historyReceivers=[];for(var s=0;s>>0,A.oldestMessageTimestamp.high>>>0).toNumber())),A.messageCount!=null&&(l.Long?(r.messageCount=l.Long.fromValue(A.messageCount)).unsigned=!1:typeof A.messageCount=="string"?r.messageCount=parseInt(A.messageCount,10):typeof A.messageCount=="number"?r.messageCount=A.messageCount:typeof A.messageCount=="object"&&(r.messageCount=new l.LongBits(A.messageCount.low>>>0,A.messageCount.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.historyReceivers=[]),A.historyReceivers&&A.historyReceivers.length){s.historyReceivers=[];for(var g=0;g>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryNotice)return A;var r=new p.proto.Message.MessageHistoryNotice;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected");r.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryNotice"},i})(),t.NewsletterAdminInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.inviteExpiration=A.int64();break}case 6:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.NewsletterAdminInviteMessage)return A;var r=new p.proto.Message.NewsletterAdminInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterAdminInviteMessage"},i})(),t.NewsletterFollowerInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.NewsletterFollowerInviteMessage)return A;var r=new p.proto.Message.NewsletterFollowerInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterFollowerInviteMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterFollowerInviteMessage"},i})(),t.OrderMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.orderId=A.string();break}case 2:{c.thumbnail=A.bytes();break}case 3:{c.itemCount=A.int32();break}case 4:{c.status=A.int32();break}case 5:{c.surface=A.int32();break}case 6:{c.message=A.string();break}case 7:{c.orderTitle=A.string();break}case 8:{c.sellerJid=A.string();break}case 9:{c.token=A.string();break}case 10:{c.totalAmount1000=A.int64();break}case 11:{c.totalCurrencyCode=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.messageVersion=A.int32();break}case 13:{c.orderRequestMessageId=p.proto.MessageKey.decode(A,A.uint32());break}case 15:{c.catalogType=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.OrderMessage)return A;var r=new p.proto.Message.OrderMessage;switch(A.orderId!=null&&(r.orderId=String(A.orderId)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.itemCount!=null&&(r.itemCount=A.itemCount|0),A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"INQUIRY":case 1:r.status=1;break;case"ACCEPTED":case 2:r.status=2;break;case"DECLINED":case 3:r.status=3;break}switch(A.surface){default:if(typeof A.surface=="number"){r.surface=A.surface;break}break;case"CATALOG":case 1:r.surface=1;break}if(A.message!=null&&(r.message=String(A.message)),A.orderTitle!=null&&(r.orderTitle=String(A.orderTitle)),A.sellerJid!=null&&(r.sellerJid=String(A.sellerJid)),A.token!=null&&(r.token=String(A.token)),A.totalAmount1000!=null&&(l.Long?(r.totalAmount1000=l.Long.fromValue(A.totalAmount1000)).unsigned=!1:typeof A.totalAmount1000=="string"?r.totalAmount1000=parseInt(A.totalAmount1000,10):typeof A.totalAmount1000=="number"?r.totalAmount1000=A.totalAmount1000:typeof A.totalAmount1000=="object"&&(r.totalAmount1000=new l.LongBits(A.totalAmount1000.low>>>0,A.totalAmount1000.high>>>0).toNumber())),A.totalCurrencyCode!=null&&(r.totalCurrencyCode=String(A.totalCurrencyCode)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageVersion!=null&&(r.messageVersion=A.messageVersion|0),A.orderRequestMessageId!=null){if(typeof A.orderRequestMessageId!="object")throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected");r.orderRequestMessageId=p.proto.MessageKey.fromObject(A.orderRequestMessageId)}return A.catalogType!=null&&(r.catalogType=String(A.catalogType)),r},i.toObject=function(A,r){r||(r={});var s={};return A.orderId!=null&&A.hasOwnProperty("orderId")&&(s.orderId=A.orderId,r.oneofs&&(s._orderId="orderId")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.itemCount!=null&&A.hasOwnProperty("itemCount")&&(s.itemCount=A.itemCount,r.oneofs&&(s._itemCount="itemCount")),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?p.proto.Message.OrderMessage.OrderStatus[A.status]===void 0?A.status:p.proto.Message.OrderMessage.OrderStatus[A.status]:A.status,r.oneofs&&(s._status="status")),A.surface!=null&&A.hasOwnProperty("surface")&&(s.surface=r.enums===String?p.proto.Message.OrderMessage.OrderSurface[A.surface]===void 0?A.surface:p.proto.Message.OrderMessage.OrderSurface[A.surface]:A.surface,r.oneofs&&(s._surface="surface")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.orderTitle!=null&&A.hasOwnProperty("orderTitle")&&(s.orderTitle=A.orderTitle,r.oneofs&&(s._orderTitle="orderTitle")),A.sellerJid!=null&&A.hasOwnProperty("sellerJid")&&(s.sellerJid=A.sellerJid,r.oneofs&&(s._sellerJid="sellerJid")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.totalAmount1000!=null&&A.hasOwnProperty("totalAmount1000")&&(typeof A.totalAmount1000=="number"?s.totalAmount1000=r.longs===String?String(A.totalAmount1000):A.totalAmount1000:s.totalAmount1000=r.longs===String?ge(A.totalAmount1000):r.longs===Number?ce(A.totalAmount1000):A.totalAmount1000,r.oneofs&&(s._totalAmount1000="totalAmount1000")),A.totalCurrencyCode!=null&&A.hasOwnProperty("totalCurrencyCode")&&(s.totalCurrencyCode=A.totalCurrencyCode,r.oneofs&&(s._totalCurrencyCode="totalCurrencyCode")),A.messageVersion!=null&&A.hasOwnProperty("messageVersion")&&(s.messageVersion=A.messageVersion,r.oneofs&&(s._messageVersion="messageVersion")),A.orderRequestMessageId!=null&&A.hasOwnProperty("orderRequestMessageId")&&(s.orderRequestMessageId=p.proto.MessageKey.toObject(A.orderRequestMessageId,r),r.oneofs&&(s._orderRequestMessageId="orderRequestMessageId")),A.catalogType!=null&&A.hasOwnProperty("catalogType")&&(s.catalogType=A.catalogType,r.oneofs&&(s._catalogType="catalogType")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.OrderMessage"},i.OrderStatus=(function(){let a={},A=Object.create(a);return A[a[1]="INQUIRY"]=1,A[a[2]="ACCEPTED"]=2,A[a[3]="DECLINED"]=3,A})(),i.OrderSurface=(function(){let a={},A=Object.create(a);return A[a[1]="CATALOG"]=1,A})(),i})(),t.PaymentExtendedMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.uint32();break}case 2:{c.platform=A.string();break}case 3:{c.messageParamsJson=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentExtendedMetadata)return A;var r=new p.proto.Message.PaymentExtendedMetadata;return A.type!=null&&(r.type=A.type>>>0),A.platform!=null&&(r.platform=String(A.platform)),A.messageParamsJson!=null&&(r.messageParamsJson=String(A.messageParamsJson)),r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=A.type,r.oneofs&&(s._type="type")),A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=A.platform,r.oneofs&&(s._platform="platform")),A.messageParamsJson!=null&&A.hasOwnProperty("messageParamsJson")&&(s.messageParamsJson=A.messageParamsJson,r.oneofs&&(s._messageParamsJson="messageParamsJson")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentExtendedMetadata"},i})(),t.PaymentInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serviceType=A.int32();break}case 2:{c.expiryTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentInviteMessage)return A;var r=new p.proto.Message.PaymentInviteMessage;switch(A.serviceType){default:if(typeof A.serviceType=="number"){r.serviceType=A.serviceType;break}break;case"UNKNOWN":case 0:r.serviceType=0;break;case"FBPAY":case 1:r.serviceType=1;break;case"NOVI":case 2:r.serviceType=2;break;case"UPI":case 3:r.serviceType=3;break}return A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.serviceType!=null&&A.hasOwnProperty("serviceType")&&(s.serviceType=r.enums===String?p.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]===void 0?A.serviceType:p.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]:A.serviceType,r.oneofs&&(s._serviceType="serviceType")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentInviteMessage"},i.ServiceType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="FBPAY"]=1,A[a[2]="NOVI"]=2,A[a[3]="UPI"]=3,A})(),i})(),t.PaymentLinkMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.decode(A,A.uint32());break}case 2:{c.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.decode(A,A.uint32());break}case 3:{c.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentLinkMetadata)return A;var r=new p.proto.Message.PaymentLinkMetadata;if(A.button!=null){if(typeof A.button!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected");r.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(A.button)}if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected");r.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(A.header)}if(A.provider!=null){if(typeof A.provider!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.provider: object expected");r.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.fromObject(A.provider)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.button!=null&&A.hasOwnProperty("button")&&(s.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(A.button,r),r.oneofs&&(s._button="button")),A.header!=null&&A.hasOwnProperty("header")&&(s.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(A.header,r),r.oneofs&&(s._header="header")),A.provider!=null&&A.hasOwnProperty("provider")&&(s.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.toObject(A.provider,r),r.oneofs&&(s._provider="provider")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentLinkMetadata"},i.PaymentLinkButton=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.displayText=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkButton)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkButton;return s.displayText!=null&&(g.displayText=String(s.displayText)),g},a.toObject=function(s,g){g||(g={});var c={};return s.displayText!=null&&s.hasOwnProperty("displayText")&&(c.displayText=s.displayText,g.oneofs&&(c._displayText="displayText")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkButton"},a})(),i.PaymentLinkHeader=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.headerType=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader;switch(s.headerType){default:if(typeof s.headerType=="number"){g.headerType=s.headerType;break}break;case"LINK_PREVIEW":case 0:g.headerType=0;break;case"ORDER":case 1:g.headerType=1;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.headerType!=null&&s.hasOwnProperty("headerType")&&(c.headerType=g.enums===String?p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]===void 0?s.headerType:p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]:s.headerType,g.oneofs&&(c._headerType="headerType")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkHeader"},a.PaymentLinkHeaderType=(function(){let r={},s=Object.create(r);return s[r[0]="LINK_PREVIEW"]=0,s[r[1]="ORDER"]=1,s})(),a})(),i.PaymentLinkProvider=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.paramsJson=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider;return s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),g},a.toObject=function(s,g){g||(g={});var c={};return s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkProvider"},a})(),i})(),t.PeerDataOperationRequestMessage=(function(){function i(a){if(this.requestStickerReupload=[],this.requestUrlPreview=[],this.placeholderMessageResendRequest=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.requestStickerReupload&&c.requestStickerReupload.length||(c.requestStickerReupload=[]),c.requestStickerReupload.push(p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.decode(A,A.uint32()));break}case 3:{c.requestUrlPreview&&c.requestUrlPreview.length||(c.requestUrlPreview=[]),c.requestUrlPreview.push(p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(A,A.uint32()));break}case 4:{c.historySyncOnDemandRequest=p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(A,A.uint32());break}case 5:{c.placeholderMessageResendRequest&&c.placeholderMessageResendRequest.length||(c.placeholderMessageResendRequest=[]),c.placeholderMessageResendRequest.push(p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.decode(A,A.uint32()));break}case 6:{c.fullHistorySyncOnDemandRequest=p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.decode(A,A.uint32());break}case 7:{c.syncdCollectionFatalRecoveryRequest=p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.decode(A,A.uint32());break}case 8:{c.historySyncChunkRetryRequest=p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.decode(A,A.uint32());break}case 9:{c.galaxyFlowAction=p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PeerDataOperationRequestMessage)return A;var r=new p.proto.Message.PeerDataOperationRequestMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.requestStickerReupload){if(!Array.isArray(A.requestStickerReupload))throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected");r.requestStickerReupload=[];for(var s=0;s>>3){case 1:{d.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(s,s.uint32());break}case 2:{d.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest;if(s.requestMetadata!=null){if(typeof s.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected");g.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(s.requestMetadata)}if(s.historySyncConfig!=null){if(typeof s.historySyncConfig!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected");g.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.fromObject(s.historySyncConfig)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.requestMetadata!=null&&s.hasOwnProperty("requestMetadata")&&(c.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(s.requestMetadata,g),g.oneofs&&(c._requestMetadata="requestMetadata")),s.historySyncConfig!=null&&s.hasOwnProperty("historySyncConfig")&&(c.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.toObject(s.historySyncConfig,g),g.oneofs&&(c._historySyncConfig="historySyncConfig")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest"},a})(),i.GalaxyFlowAction=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.type=s.int32();break}case 2:{d.flowId=s.string();break}case 3:{d.stanzaId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction;switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"NOTIFY_LAUNCH":case 1:g.type=1;break}return s.flowId!=null&&(g.flowId=String(s.flowId)),s.stanzaId!=null&&(g.stanzaId=String(s.stanzaId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]===void 0?s.type:p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]:s.type,g.oneofs&&(c._type="type")),s.flowId!=null&&s.hasOwnProperty("flowId")&&(c.flowId=s.flowId,g.oneofs&&(c._flowId="flowId")),s.stanzaId!=null&&s.hasOwnProperty("stanzaId")&&(c.stanzaId=s.stanzaId,g.oneofs&&(c._stanzaId="stanzaId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction"},a.GalaxyFlowActionType=(function(){let r={},s=Object.create(r);return s[r[1]="NOTIFY_LAUNCH"]=1,s})(),a})(),i.HistorySyncChunkRetryRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.syncType=s.int32();break}case 2:{d.chunkOrder=s.uint32();break}case 3:{d.chunkNotificationId=s.string();break}case 4:{d.regenerateChunk=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest;switch(s.syncType){default:if(typeof s.syncType=="number"){g.syncType=s.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:g.syncType=0;break;case"INITIAL_STATUS_V3":case 1:g.syncType=1;break;case"FULL":case 2:g.syncType=2;break;case"RECENT":case 3:g.syncType=3;break;case"PUSH_NAME":case 4:g.syncType=4;break;case"NON_BLOCKING_DATA":case 5:g.syncType=5;break;case"ON_DEMAND":case 6:g.syncType=6;break;case"NO_HISTORY":case 7:g.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:g.syncType=8;break}return s.chunkOrder!=null&&(g.chunkOrder=s.chunkOrder>>>0),s.chunkNotificationId!=null&&(g.chunkNotificationId=String(s.chunkNotificationId)),s.regenerateChunk!=null&&(g.regenerateChunk=!!s.regenerateChunk),g},a.toObject=function(s,g){g||(g={});var c={};return s.syncType!=null&&s.hasOwnProperty("syncType")&&(c.syncType=g.enums===String?p.proto.Message.HistorySyncType[s.syncType]===void 0?s.syncType:p.proto.Message.HistorySyncType[s.syncType]:s.syncType,g.oneofs&&(c._syncType="syncType")),s.chunkOrder!=null&&s.hasOwnProperty("chunkOrder")&&(c.chunkOrder=s.chunkOrder,g.oneofs&&(c._chunkOrder="chunkOrder")),s.chunkNotificationId!=null&&s.hasOwnProperty("chunkNotificationId")&&(c.chunkNotificationId=s.chunkNotificationId,g.oneofs&&(c._chunkNotificationId="chunkNotificationId")),s.regenerateChunk!=null&&s.hasOwnProperty("regenerateChunk")&&(c.regenerateChunk=s.regenerateChunk,g.oneofs&&(c._regenerateChunk="regenerateChunk")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest"},a})(),i.HistorySyncOnDemandRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.chatJid=s.string();break}case 2:{d.oldestMsgId=s.string();break}case 3:{d.oldestMsgFromMe=s.bool();break}case 4:{d.onDemandMsgCount=s.int32();break}case 5:{d.oldestMsgTimestampMs=s.int64();break}case 6:{d.accountLid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest;return s.chatJid!=null&&(g.chatJid=String(s.chatJid)),s.oldestMsgId!=null&&(g.oldestMsgId=String(s.oldestMsgId)),s.oldestMsgFromMe!=null&&(g.oldestMsgFromMe=!!s.oldestMsgFromMe),s.onDemandMsgCount!=null&&(g.onDemandMsgCount=s.onDemandMsgCount|0),s.oldestMsgTimestampMs!=null&&(l.Long?(g.oldestMsgTimestampMs=l.Long.fromValue(s.oldestMsgTimestampMs)).unsigned=!1:typeof s.oldestMsgTimestampMs=="string"?g.oldestMsgTimestampMs=parseInt(s.oldestMsgTimestampMs,10):typeof s.oldestMsgTimestampMs=="number"?g.oldestMsgTimestampMs=s.oldestMsgTimestampMs:typeof s.oldestMsgTimestampMs=="object"&&(g.oldestMsgTimestampMs=new l.LongBits(s.oldestMsgTimestampMs.low>>>0,s.oldestMsgTimestampMs.high>>>0).toNumber())),s.accountLid!=null&&(g.accountLid=String(s.accountLid)),g},a.toObject=function(s,g){g||(g={});var c={};return s.chatJid!=null&&s.hasOwnProperty("chatJid")&&(c.chatJid=s.chatJid,g.oneofs&&(c._chatJid="chatJid")),s.oldestMsgId!=null&&s.hasOwnProperty("oldestMsgId")&&(c.oldestMsgId=s.oldestMsgId,g.oneofs&&(c._oldestMsgId="oldestMsgId")),s.oldestMsgFromMe!=null&&s.hasOwnProperty("oldestMsgFromMe")&&(c.oldestMsgFromMe=s.oldestMsgFromMe,g.oneofs&&(c._oldestMsgFromMe="oldestMsgFromMe")),s.onDemandMsgCount!=null&&s.hasOwnProperty("onDemandMsgCount")&&(c.onDemandMsgCount=s.onDemandMsgCount,g.oneofs&&(c._onDemandMsgCount="onDemandMsgCount")),s.oldestMsgTimestampMs!=null&&s.hasOwnProperty("oldestMsgTimestampMs")&&(typeof s.oldestMsgTimestampMs=="number"?c.oldestMsgTimestampMs=g.longs===String?String(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs:c.oldestMsgTimestampMs=g.longs===String?ge(s.oldestMsgTimestampMs):g.longs===Number?ce(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs,g.oneofs&&(c._oldestMsgTimestampMs="oldestMsgTimestampMs")),s.accountLid!=null&&s.hasOwnProperty("accountLid")&&(c.accountLid=s.accountLid,g.oneofs&&(c._accountLid="accountLid")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest"},a})(),i.PlaceholderMessageResendRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.messageKey=p.proto.MessageKey.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest;if(s.messageKey!=null){if(typeof s.messageKey!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected");g.messageKey=p.proto.MessageKey.fromObject(s.messageKey)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.messageKey!=null&&s.hasOwnProperty("messageKey")&&(c.messageKey=p.proto.MessageKey.toObject(s.messageKey,g),g.oneofs&&(c._messageKey="messageKey")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest"},a})(),i.RequestStickerReupload=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.fileSha256=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload;return s.fileSha256!=null&&(g.fileSha256=String(s.fileSha256)),g},a.toObject=function(s,g){g||(g={});var c={};return s.fileSha256!=null&&s.hasOwnProperty("fileSha256")&&(c.fileSha256=s.fileSha256,g.oneofs&&(c._fileSha256="fileSha256")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload"},a})(),i.RequestUrlPreview=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.url=s.string();break}case 2:{d.includeHqThumbnail=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview;return s.url!=null&&(g.url=String(s.url)),s.includeHqThumbnail!=null&&(g.includeHqThumbnail=!!s.includeHqThumbnail),g},a.toObject=function(s,g){g||(g={});var c={};return s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.includeHqThumbnail!=null&&s.hasOwnProperty("includeHqThumbnail")&&(c.includeHqThumbnail=s.includeHqThumbnail,g.oneofs&&(c._includeHqThumbnail="includeHqThumbnail")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview"},a})(),i.SyncDCollectionFatalRecoveryRequest=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.collectionName=s.string();break}case 2:{d.timestamp=s.int64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest;return s.collectionName!=null&&(g.collectionName=String(s.collectionName)),s.timestamp!=null&&(l.Long?(g.timestamp=l.Long.fromValue(s.timestamp)).unsigned=!1:typeof s.timestamp=="string"?g.timestamp=parseInt(s.timestamp,10):typeof s.timestamp=="number"?g.timestamp=s.timestamp:typeof s.timestamp=="object"&&(g.timestamp=new l.LongBits(s.timestamp.low>>>0,s.timestamp.high>>>0).toNumber())),g},a.toObject=function(s,g){g||(g={});var c={};return s.collectionName!=null&&s.hasOwnProperty("collectionName")&&(c.collectionName=s.collectionName,g.oneofs&&(c._collectionName="collectionName")),s.timestamp!=null&&s.hasOwnProperty("timestamp")&&(typeof s.timestamp=="number"?c.timestamp=g.longs===String?String(s.timestamp):s.timestamp:c.timestamp=g.longs===String?ge(s.timestamp):g.longs===Number?ce(s.timestamp):s.timestamp,g.oneofs&&(c._timestamp="timestamp")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest"},a})(),i})(),t.PeerDataOperationRequestResponseMessage=(function(){function i(a){if(this.peerDataOperationResult=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.stanzaId=A.string();break}case 3:{c.peerDataOperationResult&&c.peerDataOperationResult.length||(c.peerDataOperationResult=[]),c.peerDataOperationResult.push(p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PeerDataOperationRequestResponseMessage)return A;var r=new p.proto.Message.PeerDataOperationRequestResponseMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.stanzaId!=null&&(r.stanzaId=String(A.stanzaId)),A.peerDataOperationResult){if(!Array.isArray(A.peerDataOperationResult))throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected");r.peerDataOperationResult=[];for(var s=0;s>>3){case 1:{d.mediaUploadResult=s.int32();break}case 2:{d.stickerMessage=p.proto.Message.StickerMessage.decode(s,s.uint32());break}case 3:{d.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.decode(s,s.uint32());break}case 4:{d.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.decode(s,s.uint32());break}case 5:{d.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.decode(s,s.uint32());break}case 6:{d.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.decode(s,s.uint32());break}case 7:{d.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.decode(s,s.uint32());break}case 8:{d.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.decode(s,s.uint32());break}case 9:{d.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.decode(s,s.uint32());break}case 10:{d.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult)return s;var g=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult;switch(s.mediaUploadResult){default:if(typeof s.mediaUploadResult=="number"){g.mediaUploadResult=s.mediaUploadResult;break}break;case"GENERAL_ERROR":case 0:g.mediaUploadResult=0;break;case"SUCCESS":case 1:g.mediaUploadResult=1;break;case"NOT_FOUND":case 2:g.mediaUploadResult=2;break;case"DECRYPTION_ERROR":case 3:g.mediaUploadResult=3;break}if(s.stickerMessage!=null){if(typeof s.stickerMessage!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected");g.stickerMessage=p.proto.Message.StickerMessage.fromObject(s.stickerMessage)}if(s.linkPreviewResponse!=null){if(typeof s.linkPreviewResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected");g.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(s.linkPreviewResponse)}if(s.placeholderMessageResendResponse!=null){if(typeof s.placeholderMessageResendResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected");g.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(s.placeholderMessageResendResponse)}if(s.waffleNonceFetchRequestResponse!=null){if(typeof s.waffleNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected");g.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(s.waffleNonceFetchRequestResponse)}if(s.fullHistorySyncOnDemandRequestResponse!=null){if(typeof s.fullHistorySyncOnDemandRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected");g.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(s.fullHistorySyncOnDemandRequestResponse)}if(s.companionMetaNonceFetchRequestResponse!=null){if(typeof s.companionMetaNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected");g.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(s.companionMetaNonceFetchRequestResponse)}if(s.syncdSnapshotFatalRecoveryResponse!=null){if(typeof s.syncdSnapshotFatalRecoveryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected");g.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(s.syncdSnapshotFatalRecoveryResponse)}if(s.companionCanonicalUserNonceFetchRequestResponse!=null){if(typeof s.companionCanonicalUserNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionCanonicalUserNonceFetchRequestResponse: object expected");g.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.fromObject(s.companionCanonicalUserNonceFetchRequestResponse)}if(s.historySyncChunkRetryResponse!=null){if(typeof s.historySyncChunkRetryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.historySyncChunkRetryResponse: object expected");g.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.fromObject(s.historySyncChunkRetryResponse)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.mediaUploadResult!=null&&s.hasOwnProperty("mediaUploadResult")&&(c.mediaUploadResult=g.enums===String?p.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]===void 0?s.mediaUploadResult:p.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]:s.mediaUploadResult,g.oneofs&&(c._mediaUploadResult="mediaUploadResult")),s.stickerMessage!=null&&s.hasOwnProperty("stickerMessage")&&(c.stickerMessage=p.proto.Message.StickerMessage.toObject(s.stickerMessage,g),g.oneofs&&(c._stickerMessage="stickerMessage")),s.linkPreviewResponse!=null&&s.hasOwnProperty("linkPreviewResponse")&&(c.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(s.linkPreviewResponse,g),g.oneofs&&(c._linkPreviewResponse="linkPreviewResponse")),s.placeholderMessageResendResponse!=null&&s.hasOwnProperty("placeholderMessageResendResponse")&&(c.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(s.placeholderMessageResendResponse,g),g.oneofs&&(c._placeholderMessageResendResponse="placeholderMessageResendResponse")),s.waffleNonceFetchRequestResponse!=null&&s.hasOwnProperty("waffleNonceFetchRequestResponse")&&(c.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(s.waffleNonceFetchRequestResponse,g),g.oneofs&&(c._waffleNonceFetchRequestResponse="waffleNonceFetchRequestResponse")),s.fullHistorySyncOnDemandRequestResponse!=null&&s.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")&&(c.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(s.fullHistorySyncOnDemandRequestResponse,g),g.oneofs&&(c._fullHistorySyncOnDemandRequestResponse="fullHistorySyncOnDemandRequestResponse")),s.companionMetaNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionMetaNonceFetchRequestResponse")&&(c.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(s.companionMetaNonceFetchRequestResponse,g),g.oneofs&&(c._companionMetaNonceFetchRequestResponse="companionMetaNonceFetchRequestResponse")),s.syncdSnapshotFatalRecoveryResponse!=null&&s.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")&&(c.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(s.syncdSnapshotFatalRecoveryResponse,g),g.oneofs&&(c._syncdSnapshotFatalRecoveryResponse="syncdSnapshotFatalRecoveryResponse")),s.companionCanonicalUserNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionCanonicalUserNonceFetchRequestResponse")&&(c.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.toObject(s.companionCanonicalUserNonceFetchRequestResponse,g),g.oneofs&&(c._companionCanonicalUserNonceFetchRequestResponse="companionCanonicalUserNonceFetchRequestResponse")),s.historySyncChunkRetryResponse!=null&&s.hasOwnProperty("historySyncChunkRetryResponse")&&(c.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.toObject(s.historySyncChunkRetryResponse,g),g.oneofs&&(c._historySyncChunkRetryResponse="historySyncChunkRetryResponse")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult"},a.CompanionCanonicalUserNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waFbid=c.string();break}case 3:{f.forceRefresh=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waFbid!=null&&(I.waFbid=String(c.waFbid)),c.forceRefresh!=null&&(I.forceRefresh=!!c.forceRefresh),I},r.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),c.waFbid!=null&&c.hasOwnProperty("waFbid")&&(d.waFbid=c.waFbid,I.oneofs&&(d._waFbid="waFbid")),c.forceRefresh!=null&&c.hasOwnProperty("forceRefresh")&&(d.forceRefresh=c.forceRefresh,I.oneofs&&(d._forceRefresh="forceRefresh")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse"},r})(),a.CompanionMetaNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),I},r.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse"},r})(),a.FullHistorySyncOnDemandRequestResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(c,c.uint32());break}case 2:{f.responseCode=c.int32();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse;if(c.requestMetadata!=null){if(typeof c.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected");I.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(c.requestMetadata)}switch(c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"REQUEST_SUCCESS":case 0:I.responseCode=0;break;case"REQUEST_TIME_EXPIRED":case 1:I.responseCode=1;break;case"DECLINED_SHARING_HISTORY":case 2:I.responseCode=2;break;case"GENERIC_ERROR":case 3:I.responseCode=3;break;case"ERROR_REQUEST_ON_NON_SMB_PRIMARY":case 4:I.responseCode=4;break;case"ERROR_HOSTED_DEVICE_NOT_CONNECTED":case 5:I.responseCode=5;break;case"ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET":case 6:I.responseCode=6;break}return I},r.toObject=function(c,I){I||(I={});var d={};return c.requestMetadata!=null&&c.hasOwnProperty("requestMetadata")&&(d.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(c.requestMetadata,I),I.oneofs&&(d._requestMetadata="requestMetadata")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(d.responseCode=I.enums===String?p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]===void 0?c.responseCode:p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(d._responseCode="responseCode")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse"},r})(),a.FullHistorySyncOnDemandResponseCode=(function(){let r={},s=Object.create(r);return s[r[0]="REQUEST_SUCCESS"]=0,s[r[1]="REQUEST_TIME_EXPIRED"]=1,s[r[2]="DECLINED_SHARING_HISTORY"]=2,s[r[3]="GENERIC_ERROR"]=3,s[r[4]="ERROR_REQUEST_ON_NON_SMB_PRIMARY"]=4,s[r[5]="ERROR_HOSTED_DEVICE_NOT_CONNECTED"]=5,s[r[6]="ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET"]=6,s})(),a.HistorySyncChunkRetryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.syncType=c.int32();break}case 2:{f.chunkOrder=c.uint32();break}case 3:{f.requestId=c.string();break}case 4:{f.responseCode=c.int32();break}case 5:{f.canRecover=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse;switch(c.syncType){default:if(typeof c.syncType=="number"){I.syncType=c.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:I.syncType=0;break;case"INITIAL_STATUS_V3":case 1:I.syncType=1;break;case"FULL":case 2:I.syncType=2;break;case"RECENT":case 3:I.syncType=3;break;case"PUSH_NAME":case 4:I.syncType=4;break;case"NON_BLOCKING_DATA":case 5:I.syncType=5;break;case"ON_DEMAND":case 6:I.syncType=6;break;case"NO_HISTORY":case 7:I.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:I.syncType=8;break}switch(c.chunkOrder!=null&&(I.chunkOrder=c.chunkOrder>>>0),c.requestId!=null&&(I.requestId=String(c.requestId)),c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"GENERATION_ERROR":case 1:I.responseCode=1;break;case"CHUNK_CONSUMED":case 2:I.responseCode=2;break;case"TIMEOUT":case 3:I.responseCode=3;break;case"SESSION_EXHAUSTED":case 4:I.responseCode=4;break;case"CHUNK_EXHAUSTED":case 5:I.responseCode=5;break;case"DUPLICATED_REQUEST":case 6:I.responseCode=6;break}return c.canRecover!=null&&(I.canRecover=!!c.canRecover),I},r.toObject=function(c,I){I||(I={});var d={};return c.syncType!=null&&c.hasOwnProperty("syncType")&&(d.syncType=I.enums===String?p.proto.Message.HistorySyncType[c.syncType]===void 0?c.syncType:p.proto.Message.HistorySyncType[c.syncType]:c.syncType,I.oneofs&&(d._syncType="syncType")),c.chunkOrder!=null&&c.hasOwnProperty("chunkOrder")&&(d.chunkOrder=c.chunkOrder,I.oneofs&&(d._chunkOrder="chunkOrder")),c.requestId!=null&&c.hasOwnProperty("requestId")&&(d.requestId=c.requestId,I.oneofs&&(d._requestId="requestId")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(d.responseCode=I.enums===String?p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]===void 0?c.responseCode:p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(d._responseCode="responseCode")),c.canRecover!=null&&c.hasOwnProperty("canRecover")&&(d.canRecover=c.canRecover,I.oneofs&&(d._canRecover="canRecover")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse"},r})(),a.HistorySyncChunkRetryResponseCode=(function(){let r={},s=Object.create(r);return s[r[1]="GENERATION_ERROR"]=1,s[r[2]="CHUNK_CONSUMED"]=2,s[r[3]="TIMEOUT"]=3,s[r[4]="SESSION_EXHAUSTED"]=4,s[r[5]="CHUNK_EXHAUSTED"]=5,s[r[6]="DUPLICATED_REQUEST"]=6,s})(),a.LinkPreviewResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.url=c.string();break}case 2:{f.title=c.string();break}case 3:{f.description=c.string();break}case 4:{f.thumbData=c.bytes();break}case 6:{f.matchText=c.string();break}case 7:{f.previewType=c.string();break}case 8:{f.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.decode(c,c.uint32());break}case 9:{f.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse;if(c.url!=null&&(I.url=String(c.url)),c.title!=null&&(I.title=String(c.title)),c.description!=null&&(I.description=String(c.description)),c.thumbData!=null&&(typeof c.thumbData=="string"?l.base64.decode(c.thumbData,I.thumbData=l.newBuffer(l.base64.length(c.thumbData)),0):c.thumbData.length>=0&&(I.thumbData=c.thumbData)),c.matchText!=null&&(I.matchText=String(c.matchText)),c.previewType!=null&&(I.previewType=String(c.previewType)),c.hqThumbnail!=null){if(typeof c.hqThumbnail!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected");I.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(c.hqThumbnail)}if(c.previewMetadata!=null){if(typeof c.previewMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.previewMetadata: object expected");I.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.fromObject(c.previewMetadata)}return I},r.toObject=function(c,I){I||(I={});var d={};return c.url!=null&&c.hasOwnProperty("url")&&(d.url=c.url,I.oneofs&&(d._url="url")),c.title!=null&&c.hasOwnProperty("title")&&(d.title=c.title,I.oneofs&&(d._title="title")),c.description!=null&&c.hasOwnProperty("description")&&(d.description=c.description,I.oneofs&&(d._description="description")),c.thumbData!=null&&c.hasOwnProperty("thumbData")&&(d.thumbData=I.bytes===String?l.base64.encode(c.thumbData,0,c.thumbData.length):I.bytes===Array?Array.prototype.slice.call(c.thumbData):c.thumbData,I.oneofs&&(d._thumbData="thumbData")),c.matchText!=null&&c.hasOwnProperty("matchText")&&(d.matchText=c.matchText,I.oneofs&&(d._matchText="matchText")),c.previewType!=null&&c.hasOwnProperty("previewType")&&(d.previewType=c.previewType,I.oneofs&&(d._previewType="previewType")),c.hqThumbnail!=null&&c.hasOwnProperty("hqThumbnail")&&(d.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(c.hqThumbnail,I),I.oneofs&&(d._hqThumbnail="hqThumbnail")),c.previewMetadata!=null&&c.hasOwnProperty("previewMetadata")&&(d.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.toObject(c.previewMetadata,I),I.oneofs&&(d._previewMetadata="previewMetadata")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse"},r.LinkPreviewHighQualityThumbnail=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.directPath=d.string();break}case 2:{y.thumbHash=d.string();break}case 3:{y.encThumbHash=d.string();break}case 4:{y.mediaKey=d.bytes();break}case 5:{y.mediaKeyTimestampMs=d.int64();break}case 6:{y.thumbWidth=d.int32();break}case 7:{y.thumbHeight=d.int32();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail)return d;var B=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail;return d.directPath!=null&&(B.directPath=String(d.directPath)),d.thumbHash!=null&&(B.thumbHash=String(d.thumbHash)),d.encThumbHash!=null&&(B.encThumbHash=String(d.encThumbHash)),d.mediaKey!=null&&(typeof d.mediaKey=="string"?l.base64.decode(d.mediaKey,B.mediaKey=l.newBuffer(l.base64.length(d.mediaKey)),0):d.mediaKey.length>=0&&(B.mediaKey=d.mediaKey)),d.mediaKeyTimestampMs!=null&&(l.Long?(B.mediaKeyTimestampMs=l.Long.fromValue(d.mediaKeyTimestampMs)).unsigned=!1:typeof d.mediaKeyTimestampMs=="string"?B.mediaKeyTimestampMs=parseInt(d.mediaKeyTimestampMs,10):typeof d.mediaKeyTimestampMs=="number"?B.mediaKeyTimestampMs=d.mediaKeyTimestampMs:typeof d.mediaKeyTimestampMs=="object"&&(B.mediaKeyTimestampMs=new l.LongBits(d.mediaKeyTimestampMs.low>>>0,d.mediaKeyTimestampMs.high>>>0).toNumber())),d.thumbWidth!=null&&(B.thumbWidth=d.thumbWidth|0),d.thumbHeight!=null&&(B.thumbHeight=d.thumbHeight|0),B},g.toObject=function(d,B){B||(B={});var f={};return d.directPath!=null&&d.hasOwnProperty("directPath")&&(f.directPath=d.directPath,B.oneofs&&(f._directPath="directPath")),d.thumbHash!=null&&d.hasOwnProperty("thumbHash")&&(f.thumbHash=d.thumbHash,B.oneofs&&(f._thumbHash="thumbHash")),d.encThumbHash!=null&&d.hasOwnProperty("encThumbHash")&&(f.encThumbHash=d.encThumbHash,B.oneofs&&(f._encThumbHash="encThumbHash")),d.mediaKey!=null&&d.hasOwnProperty("mediaKey")&&(f.mediaKey=B.bytes===String?l.base64.encode(d.mediaKey,0,d.mediaKey.length):B.bytes===Array?Array.prototype.slice.call(d.mediaKey):d.mediaKey,B.oneofs&&(f._mediaKey="mediaKey")),d.mediaKeyTimestampMs!=null&&d.hasOwnProperty("mediaKeyTimestampMs")&&(typeof d.mediaKeyTimestampMs=="number"?f.mediaKeyTimestampMs=B.longs===String?String(d.mediaKeyTimestampMs):d.mediaKeyTimestampMs:f.mediaKeyTimestampMs=B.longs===String?ge(d.mediaKeyTimestampMs):B.longs===Number?ce(d.mediaKeyTimestampMs):d.mediaKeyTimestampMs,B.oneofs&&(f._mediaKeyTimestampMs="mediaKeyTimestampMs")),d.thumbWidth!=null&&d.hasOwnProperty("thumbWidth")&&(f.thumbWidth=d.thumbWidth,B.oneofs&&(f._thumbWidth="thumbWidth")),d.thumbHeight!=null&&d.hasOwnProperty("thumbHeight")&&(f.thumbHeight=d.thumbHeight,B.oneofs&&(f._thumbHeight="thumbHeight")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail"},g})(),r.PaymentLinkPreviewMetadata=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.isBusinessVerified=d.bool();break}case 2:{y.providerName=d.string();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata)return d;var B=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata;return d.isBusinessVerified!=null&&(B.isBusinessVerified=!!d.isBusinessVerified),d.providerName!=null&&(B.providerName=String(d.providerName)),B},g.toObject=function(d,B){B||(B={});var f={};return d.isBusinessVerified!=null&&d.hasOwnProperty("isBusinessVerified")&&(f.isBusinessVerified=d.isBusinessVerified,B.oneofs&&(f._isBusinessVerified="isBusinessVerified")),d.providerName!=null&&d.hasOwnProperty("providerName")&&(f.providerName=d.providerName,B.oneofs&&(f._providerName="providerName")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata"},g})(),r})(),a.PlaceholderMessageResendResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.webMessageInfoBytes=c.bytes();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse;return c.webMessageInfoBytes!=null&&(typeof c.webMessageInfoBytes=="string"?l.base64.decode(c.webMessageInfoBytes,I.webMessageInfoBytes=l.newBuffer(l.base64.length(c.webMessageInfoBytes)),0):c.webMessageInfoBytes.length>=0&&(I.webMessageInfoBytes=c.webMessageInfoBytes)),I},r.toObject=function(c,I){I||(I={});var d={};return c.webMessageInfoBytes!=null&&c.hasOwnProperty("webMessageInfoBytes")&&(d.webMessageInfoBytes=I.bytes===String?l.base64.encode(c.webMessageInfoBytes,0,c.webMessageInfoBytes.length):I.bytes===Array?Array.prototype.slice.call(c.webMessageInfoBytes):c.webMessageInfoBytes,I.oneofs&&(d._webMessageInfoBytes="webMessageInfoBytes")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse"},r})(),a.SyncDSnapshotFatalRecoveryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.collectionSnapshot=c.bytes();break}case 2:{f.isCompressed=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse;return c.collectionSnapshot!=null&&(typeof c.collectionSnapshot=="string"?l.base64.decode(c.collectionSnapshot,I.collectionSnapshot=l.newBuffer(l.base64.length(c.collectionSnapshot)),0):c.collectionSnapshot.length>=0&&(I.collectionSnapshot=c.collectionSnapshot)),c.isCompressed!=null&&(I.isCompressed=!!c.isCompressed),I},r.toObject=function(c,I){I||(I={});var d={};return c.collectionSnapshot!=null&&c.hasOwnProperty("collectionSnapshot")&&(d.collectionSnapshot=I.bytes===String?l.base64.encode(c.collectionSnapshot,0,c.collectionSnapshot.length):I.bytes===Array?Array.prototype.slice.call(c.collectionSnapshot):c.collectionSnapshot,I.oneofs&&(d._collectionSnapshot="collectionSnapshot")),c.isCompressed!=null&&c.hasOwnProperty("isCompressed")&&(d.isCompressed=c.isCompressed,I.oneofs&&(d._isCompressed="isCompressed")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse"},r})(),a.WaffleNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waEntFbid=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waEntFbid!=null&&(I.waEntFbid=String(c.waEntFbid)),I},r.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),c.waEntFbid!=null&&c.hasOwnProperty("waEntFbid")&&(d.waEntFbid=c.waEntFbid,I.oneofs&&(d._waEntFbid="waEntFbid")),d},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse"},r})(),a})(),i})(),t.PeerDataOperationRequestType=(function(){let i={},e=Object.create(i);return e[i[0]="UPLOAD_STICKER"]=0,e[i[1]="SEND_RECENT_STICKER_BOOTSTRAP"]=1,e[i[2]="GENERATE_LINK_PREVIEW"]=2,e[i[3]="HISTORY_SYNC_ON_DEMAND"]=3,e[i[4]="PLACEHOLDER_MESSAGE_RESEND"]=4,e[i[5]="WAFFLE_LINKING_NONCE_FETCH"]=5,e[i[6]="FULL_HISTORY_SYNC_ON_DEMAND"]=6,e[i[7]="COMPANION_META_NONCE_FETCH"]=7,e[i[8]="COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY"]=8,e[i[9]="COMPANION_CANONICAL_USER_NONCE_FETCH"]=9,e[i[10]="HISTORY_SYNC_CHUNK_RETRY"]=10,e[i[11]="GALAXY_FLOW_ACTION"]=11,e})(),t.PinInChatMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 3:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PinInChatMessage)return A;var r=new p.proto.Message.PinInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.PinInChatMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN_TYPE":case 0:r.type=0;break;case"PIN_FOR_ALL":case 1:r.type=1;break;case"UNPIN_FOR_ALL":case 2:r.type=2;break}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.PinInChatMessage.Type[A.type]===void 0?A.type:p.proto.Message.PinInChatMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PinInChatMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN_TYPE"]=0,A[a[1]="PIN_FOR_ALL"]=1,A[a[2]="UNPIN_FOR_ALL"]=2,A})(),i})(),t.PlaceholderMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PlaceholderMessage)return A;var r=new p.proto.Message.PlaceholderMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"MASK_LINKED_DEVICES":case 0:r.type=0;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.PlaceholderMessage.PlaceholderType[A.type]===void 0?A.type:p.proto.Message.PlaceholderMessage.PlaceholderType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PlaceholderMessage"},i.PlaceholderType=(function(){let a={},A=Object.create(a);return A[a[0]="MASK_LINKED_DEVICES"]=0,A})(),i})(),t.PollContentType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="TEXT"]=1,e[i[2]="IMAGE"]=2,e})(),t.PollCreationMessage=(function(){function i(a){if(this.options=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.encKey=A.bytes();break}case 2:{c.name=A.string();break}case 3:{c.options&&c.options.length||(c.options=[]),c.options.push(p.proto.Message.PollCreationMessage.Option.decode(A,A.uint32()));break}case 4:{c.selectableOptionsCount=A.uint32();break}case 5:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 6:{c.pollContentType=A.int32();break}case 7:{c.pollType=A.int32();break}case 8:{c.correctAnswer=p.proto.Message.PollCreationMessage.Option.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollCreationMessage)return A;var r=new p.proto.Message.PollCreationMessage;if(A.encKey!=null&&(typeof A.encKey=="string"?l.base64.decode(A.encKey,r.encKey=l.newBuffer(l.base64.length(A.encKey)),0):A.encKey.length>=0&&(r.encKey=A.encKey)),A.name!=null&&(r.name=String(A.name)),A.options){if(!Array.isArray(A.options))throw TypeError(".proto.Message.PollCreationMessage.options: array expected");r.options=[];for(var s=0;s>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.pollContentType){default:if(typeof A.pollContentType=="number"){r.pollContentType=A.pollContentType;break}break;case"UNKNOWN":case 0:r.pollContentType=0;break;case"TEXT":case 1:r.pollContentType=1;break;case"IMAGE":case 2:r.pollContentType=2;break}switch(A.pollType){default:if(typeof A.pollType=="number"){r.pollType=A.pollType;break}break;case"POLL":case 0:r.pollType=0;break;case"QUIZ":case 1:r.pollType=1;break}if(A.correctAnswer!=null){if(typeof A.correctAnswer!="object")throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");r.correctAnswer=p.proto.Message.PollCreationMessage.Option.fromObject(A.correctAnswer)}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.options=[]),A.encKey!=null&&A.hasOwnProperty("encKey")&&(s.encKey=r.bytes===String?l.base64.encode(A.encKey,0,A.encKey.length):r.bytes===Array?Array.prototype.slice.call(A.encKey):A.encKey,r.oneofs&&(s._encKey="encKey")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.options&&A.options.length){s.options=[];for(var g=0;g>>3){case 1:{d.optionName=s.string();break}case 2:{d.optionHash=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PollCreationMessage.Option)return s;var g=new p.proto.Message.PollCreationMessage.Option;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionHash!=null&&(g.optionHash=String(s.optionHash)),g},a.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionHash!=null&&s.hasOwnProperty("optionHash")&&(c.optionHash=s.optionHash,g.oneofs&&(c._optionHash="optionHash")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollCreationMessage.Option"},a})(),i})(),t.PollEncValue=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.encPayload=A.bytes();break}case 2:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollEncValue)return A;var r=new p.proto.Message.PollEncValue;return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},i.toObject=function(A,r){r||(r={});var s={};return A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollEncValue"},i})(),t.PollResultSnapshotMessage=(function(){function i(a){if(this.pollVotes=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.pollVotes&&c.pollVotes.length||(c.pollVotes=[]),c.pollVotes.push(p.proto.Message.PollResultSnapshotMessage.PollVote.decode(A,A.uint32()));break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.pollType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollResultSnapshotMessage)return A;var r=new p.proto.Message.PollResultSnapshotMessage;if(A.name!=null&&(r.name=String(A.name)),A.pollVotes){if(!Array.isArray(A.pollVotes))throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected");r.pollVotes=[];for(var s=0;s>>3){case 1:{d.optionName=s.string();break}case 2:{d.optionVoteCount=s.int64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PollResultSnapshotMessage.PollVote)return s;var g=new p.proto.Message.PollResultSnapshotMessage.PollVote;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionVoteCount!=null&&(l.Long?(g.optionVoteCount=l.Long.fromValue(s.optionVoteCount)).unsigned=!1:typeof s.optionVoteCount=="string"?g.optionVoteCount=parseInt(s.optionVoteCount,10):typeof s.optionVoteCount=="number"?g.optionVoteCount=s.optionVoteCount:typeof s.optionVoteCount=="object"&&(g.optionVoteCount=new l.LongBits(s.optionVoteCount.low>>>0,s.optionVoteCount.high>>>0).toNumber())),g},a.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionVoteCount!=null&&s.hasOwnProperty("optionVoteCount")&&(typeof s.optionVoteCount=="number"?c.optionVoteCount=g.longs===String?String(s.optionVoteCount):s.optionVoteCount:c.optionVoteCount=g.longs===String?ge(s.optionVoteCount):g.longs===Number?ce(s.optionVoteCount):s.optionVoteCount,g.oneofs&&(c._optionVoteCount="optionVoteCount")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollResultSnapshotMessage.PollVote"},a})(),i})(),t.PollType=(function(){let i={},e=Object.create(i);return e[i[0]="POLL"]=0,e[i[1]="QUIZ"]=1,e})(),t.PollUpdateMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.pollCreationMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.vote=p.proto.Message.PollEncValue.decode(A,A.uint32());break}case 3:{c.metadata=p.proto.Message.PollUpdateMessageMetadata.decode(A,A.uint32());break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollUpdateMessage)return A;var r=new p.proto.Message.PollUpdateMessage;if(A.pollCreationMessageKey!=null){if(typeof A.pollCreationMessageKey!="object")throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected");r.pollCreationMessageKey=p.proto.MessageKey.fromObject(A.pollCreationMessageKey)}if(A.vote!=null){if(typeof A.vote!="object")throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected");r.vote=p.proto.Message.PollEncValue.fromObject(A.vote)}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected");r.metadata=p.proto.Message.PollUpdateMessageMetadata.fromObject(A.metadata)}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.pollCreationMessageKey!=null&&A.hasOwnProperty("pollCreationMessageKey")&&(s.pollCreationMessageKey=p.proto.MessageKey.toObject(A.pollCreationMessageKey,r),r.oneofs&&(s._pollCreationMessageKey="pollCreationMessageKey")),A.vote!=null&&A.hasOwnProperty("vote")&&(s.vote=p.proto.Message.PollEncValue.toObject(A.vote,r),r.oneofs&&(s._vote="vote")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=p.proto.Message.PollUpdateMessageMetadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollUpdateMessage"},i})(),t.PollUpdateMessageMetadata=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){default:a.skipType(c&7);break}}return g},i.fromObject=function(a){return a instanceof p.proto.Message.PollUpdateMessageMetadata?a:new p.proto.Message.PollUpdateMessageMetadata},i.toObject=function(){return{}},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Message.PollUpdateMessageMetadata"},i})(),t.PollVoteMessage=(function(){function i(e){if(this.selectedOptions=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.selectedOptions&&g.selectedOptions.length||(g.selectedOptions=[]),g.selectedOptions.push(a.bytes());break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.PollVoteMessage)return a;var A=new p.proto.Message.PollVoteMessage;if(a.selectedOptions){if(!Array.isArray(a.selectedOptions))throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected");A.selectedOptions=[];for(var r=0;r=0&&(A.selectedOptions[r]=a.selectedOptions[r])}return A},i.toObject=function(a,A){A||(A={});var r={};if((A.arrays||A.defaults)&&(r.selectedOptions=[]),a.selectedOptions&&a.selectedOptions.length){r.selectedOptions=[];for(var s=0;s>>3){case 1:{c.product=p.proto.Message.ProductMessage.ProductSnapshot.decode(A,A.uint32());break}case 2:{c.businessOwnerJid=A.string();break}case 4:{c.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.decode(A,A.uint32());break}case 5:{c.body=A.string();break}case 6:{c.footer=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ProductMessage)return A;var r=new p.proto.Message.ProductMessage;if(A.product!=null){if(typeof A.product!="object")throw TypeError(".proto.Message.ProductMessage.product: object expected");r.product=p.proto.Message.ProductMessage.ProductSnapshot.fromObject(A.product)}if(A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),A.catalog!=null){if(typeof A.catalog!="object")throw TypeError(".proto.Message.ProductMessage.catalog: object expected");r.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.fromObject(A.catalog)}if(A.body!=null&&(r.body=String(A.body)),A.footer!=null&&(r.footer=String(A.footer)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.product!=null&&A.hasOwnProperty("product")&&(s.product=p.proto.Message.ProductMessage.ProductSnapshot.toObject(A.product,r),r.oneofs&&(s._product="product")),A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),A.catalog!=null&&A.hasOwnProperty("catalog")&&(s.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.toObject(A.catalog,r),r.oneofs&&(s._catalog="catalog")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=A.footer,r.oneofs&&(s._footer="footer")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProductMessage"},i.CatalogSnapshot=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.catalogImage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{d.title=s.string();break}case 3:{d.description=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ProductMessage.CatalogSnapshot)return s;var g=new p.proto.Message.ProductMessage.CatalogSnapshot;if(s.catalogImage!=null){if(typeof s.catalogImage!="object")throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected");g.catalogImage=p.proto.Message.ImageMessage.fromObject(s.catalogImage)}return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),g},a.toObject=function(s,g){g||(g={});var c={};return s.catalogImage!=null&&s.hasOwnProperty("catalogImage")&&(c.catalogImage=p.proto.Message.ImageMessage.toObject(s.catalogImage,g),g.oneofs&&(c._catalogImage="catalogImage")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.CatalogSnapshot"},a})(),i.ProductSnapshot=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.productImage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{d.productId=s.string();break}case 3:{d.title=s.string();break}case 4:{d.description=s.string();break}case 5:{d.currencyCode=s.string();break}case 6:{d.priceAmount1000=s.int64();break}case 7:{d.retailerId=s.string();break}case 8:{d.url=s.string();break}case 9:{d.productImageCount=s.uint32();break}case 11:{d.firstImageId=s.string();break}case 12:{d.salePriceAmount1000=s.int64();break}case 13:{d.signedUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ProductMessage.ProductSnapshot)return s;var g=new p.proto.Message.ProductMessage.ProductSnapshot;if(s.productImage!=null){if(typeof s.productImage!="object")throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected");g.productImage=p.proto.Message.ImageMessage.fromObject(s.productImage)}return s.productId!=null&&(g.productId=String(s.productId)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.currencyCode!=null&&(g.currencyCode=String(s.currencyCode)),s.priceAmount1000!=null&&(l.Long?(g.priceAmount1000=l.Long.fromValue(s.priceAmount1000)).unsigned=!1:typeof s.priceAmount1000=="string"?g.priceAmount1000=parseInt(s.priceAmount1000,10):typeof s.priceAmount1000=="number"?g.priceAmount1000=s.priceAmount1000:typeof s.priceAmount1000=="object"&&(g.priceAmount1000=new l.LongBits(s.priceAmount1000.low>>>0,s.priceAmount1000.high>>>0).toNumber())),s.retailerId!=null&&(g.retailerId=String(s.retailerId)),s.url!=null&&(g.url=String(s.url)),s.productImageCount!=null&&(g.productImageCount=s.productImageCount>>>0),s.firstImageId!=null&&(g.firstImageId=String(s.firstImageId)),s.salePriceAmount1000!=null&&(l.Long?(g.salePriceAmount1000=l.Long.fromValue(s.salePriceAmount1000)).unsigned=!1:typeof s.salePriceAmount1000=="string"?g.salePriceAmount1000=parseInt(s.salePriceAmount1000,10):typeof s.salePriceAmount1000=="number"?g.salePriceAmount1000=s.salePriceAmount1000:typeof s.salePriceAmount1000=="object"&&(g.salePriceAmount1000=new l.LongBits(s.salePriceAmount1000.low>>>0,s.salePriceAmount1000.high>>>0).toNumber())),s.signedUrl!=null&&(g.signedUrl=String(s.signedUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productImage!=null&&s.hasOwnProperty("productImage")&&(c.productImage=p.proto.Message.ImageMessage.toObject(s.productImage,g),g.oneofs&&(c._productImage="productImage")),s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.currencyCode!=null&&s.hasOwnProperty("currencyCode")&&(c.currencyCode=s.currencyCode,g.oneofs&&(c._currencyCode="currencyCode")),s.priceAmount1000!=null&&s.hasOwnProperty("priceAmount1000")&&(typeof s.priceAmount1000=="number"?c.priceAmount1000=g.longs===String?String(s.priceAmount1000):s.priceAmount1000:c.priceAmount1000=g.longs===String?ge(s.priceAmount1000):g.longs===Number?ce(s.priceAmount1000):s.priceAmount1000,g.oneofs&&(c._priceAmount1000="priceAmount1000")),s.retailerId!=null&&s.hasOwnProperty("retailerId")&&(c.retailerId=s.retailerId,g.oneofs&&(c._retailerId="retailerId")),s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.productImageCount!=null&&s.hasOwnProperty("productImageCount")&&(c.productImageCount=s.productImageCount,g.oneofs&&(c._productImageCount="productImageCount")),s.firstImageId!=null&&s.hasOwnProperty("firstImageId")&&(c.firstImageId=s.firstImageId,g.oneofs&&(c._firstImageId="firstImageId")),s.salePriceAmount1000!=null&&s.hasOwnProperty("salePriceAmount1000")&&(typeof s.salePriceAmount1000=="number"?c.salePriceAmount1000=g.longs===String?String(s.salePriceAmount1000):s.salePriceAmount1000:c.salePriceAmount1000=g.longs===String?ge(s.salePriceAmount1000):g.longs===Number?ce(s.salePriceAmount1000):s.salePriceAmount1000,g.oneofs&&(c._salePriceAmount1000="salePriceAmount1000")),s.signedUrl!=null&&s.hasOwnProperty("signedUrl")&&(c.signedUrl=s.signedUrl,g.oneofs&&(c._signedUrl="signedUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.ProductSnapshot"},a})(),i})(),t.ProtocolMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 4:{c.ephemeralExpiration=A.uint32();break}case 5:{c.ephemeralSettingTimestamp=A.int64();break}case 6:{c.historySyncNotification=p.proto.Message.HistorySyncNotification.decode(A,A.uint32());break}case 7:{c.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.decode(A,A.uint32());break}case 8:{c.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.decode(A,A.uint32());break}case 9:{c.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.decode(A,A.uint32());break}case 10:{c.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.decode(A,A.uint32());break}case 11:{c.disappearingMode=p.proto.DisappearingMode.decode(A,A.uint32());break}case 14:{c.editedMessage=p.proto.Message.decode(A,A.uint32());break}case 15:{c.timestampMs=A.int64();break}case 16:{c.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.decode(A,A.uint32());break}case 17:{c.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.decode(A,A.uint32());break}case 18:{c.botFeedbackMessage=p.proto.BotFeedbackMessage.decode(A,A.uint32());break}case 19:{c.invokerJid=A.string();break}case 20:{c.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.decode(A,A.uint32());break}case 21:{c.mediaNotifyMessage=p.proto.MediaNotifyMessage.decode(A,A.uint32());break}case 22:{c.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.decode(A,A.uint32());break}case 23:{c.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.decode(A,A.uint32());break}case 24:{c.limitSharing=p.proto.LimitSharing.decode(A,A.uint32());break}case 25:{c.aiPsiMetadata=A.bytes();break}case 26:{c.aiQueryFanout=p.proto.AIQueryFanout.decode(A,A.uint32());break}case 27:{c.memberLabel=p.proto.MemberLabel.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ProtocolMessage)return A;var r=new p.proto.Message.ProtocolMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ProtocolMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"REVOKE":case 0:r.type=0;break;case"EPHEMERAL_SETTING":case 3:r.type=3;break;case"EPHEMERAL_SYNC_RESPONSE":case 4:r.type=4;break;case"HISTORY_SYNC_NOTIFICATION":case 5:r.type=5;break;case"APP_STATE_SYNC_KEY_SHARE":case 6:r.type=6;break;case"APP_STATE_SYNC_KEY_REQUEST":case 7:r.type=7;break;case"MSG_FANOUT_BACKFILL_REQUEST":case 8:r.type=8;break;case"INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC":case 9:r.type=9;break;case"APP_STATE_FATAL_EXCEPTION_NOTIFICATION":case 10:r.type=10;break;case"SHARE_PHONE_NUMBER":case 11:r.type=11;break;case"MESSAGE_EDIT":case 14:r.type=14;break;case"PEER_DATA_OPERATION_REQUEST_MESSAGE":case 16:r.type=16;break;case"PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE":case 17:r.type=17;break;case"REQUEST_WELCOME_MESSAGE":case 18:r.type=18;break;case"BOT_FEEDBACK_MESSAGE":case 19:r.type=19;break;case"MEDIA_NOTIFY_MESSAGE":case 20:r.type=20;break;case"CLOUD_API_THREAD_CONTROL_NOTIFICATION":case 21:r.type=21;break;case"LID_MIGRATION_MAPPING_SYNC":case 22:r.type=22;break;case"REMINDER_MESSAGE":case 23:r.type=23;break;case"BOT_MEMU_ONBOARDING_MESSAGE":case 24:r.type=24;break;case"STATUS_MENTION_MESSAGE":case 25:r.type=25;break;case"STOP_GENERATION_MESSAGE":case 26:r.type=26;break;case"LIMIT_SHARING":case 27:r.type=27;break;case"AI_PSI_METADATA":case 28:r.type=28;break;case"AI_QUERY_FANOUT":case 29:r.type=29;break;case"GROUP_MEMBER_LABEL_CHANGE":case 30:r.type=30;break}if(A.ephemeralExpiration!=null&&(r.ephemeralExpiration=A.ephemeralExpiration>>>0),A.ephemeralSettingTimestamp!=null&&(l.Long?(r.ephemeralSettingTimestamp=l.Long.fromValue(A.ephemeralSettingTimestamp)).unsigned=!1:typeof A.ephemeralSettingTimestamp=="string"?r.ephemeralSettingTimestamp=parseInt(A.ephemeralSettingTimestamp,10):typeof A.ephemeralSettingTimestamp=="number"?r.ephemeralSettingTimestamp=A.ephemeralSettingTimestamp:typeof A.ephemeralSettingTimestamp=="object"&&(r.ephemeralSettingTimestamp=new l.LongBits(A.ephemeralSettingTimestamp.low>>>0,A.ephemeralSettingTimestamp.high>>>0).toNumber())),A.historySyncNotification!=null){if(typeof A.historySyncNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected");r.historySyncNotification=p.proto.Message.HistorySyncNotification.fromObject(A.historySyncNotification)}if(A.appStateSyncKeyShare!=null){if(typeof A.appStateSyncKeyShare!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected");r.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.fromObject(A.appStateSyncKeyShare)}if(A.appStateSyncKeyRequest!=null){if(typeof A.appStateSyncKeyRequest!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected");r.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.fromObject(A.appStateSyncKeyRequest)}if(A.initialSecurityNotificationSettingSync!=null){if(typeof A.initialSecurityNotificationSettingSync!="object")throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected");r.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.fromObject(A.initialSecurityNotificationSettingSync)}if(A.appStateFatalExceptionNotification!=null){if(typeof A.appStateFatalExceptionNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected");r.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.fromObject(A.appStateFatalExceptionNotification)}if(A.disappearingMode!=null){if(typeof A.disappearingMode!="object")throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected");r.disappearingMode=p.proto.DisappearingMode.fromObject(A.disappearingMode)}if(A.editedMessage!=null){if(typeof A.editedMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected");r.editedMessage=p.proto.Message.fromObject(A.editedMessage)}if(A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.peerDataOperationRequestMessage!=null){if(typeof A.peerDataOperationRequestMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected");r.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.fromObject(A.peerDataOperationRequestMessage)}if(A.peerDataOperationRequestResponseMessage!=null){if(typeof A.peerDataOperationRequestResponseMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected");r.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(A.peerDataOperationRequestResponseMessage)}if(A.botFeedbackMessage!=null){if(typeof A.botFeedbackMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected");r.botFeedbackMessage=p.proto.BotFeedbackMessage.fromObject(A.botFeedbackMessage)}if(A.invokerJid!=null&&(r.invokerJid=String(A.invokerJid)),A.requestWelcomeMessageMetadata!=null){if(typeof A.requestWelcomeMessageMetadata!="object")throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected");r.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.fromObject(A.requestWelcomeMessageMetadata)}if(A.mediaNotifyMessage!=null){if(typeof A.mediaNotifyMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected");r.mediaNotifyMessage=p.proto.MediaNotifyMessage.fromObject(A.mediaNotifyMessage)}if(A.cloudApiThreadControlNotification!=null){if(typeof A.cloudApiThreadControlNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected");r.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.fromObject(A.cloudApiThreadControlNotification)}if(A.lidMigrationMappingSyncMessage!=null){if(typeof A.lidMigrationMappingSyncMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected");r.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.fromObject(A.lidMigrationMappingSyncMessage)}if(A.limitSharing!=null){if(typeof A.limitSharing!="object")throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected");r.limitSharing=p.proto.LimitSharing.fromObject(A.limitSharing)}if(A.aiPsiMetadata!=null&&(typeof A.aiPsiMetadata=="string"?l.base64.decode(A.aiPsiMetadata,r.aiPsiMetadata=l.newBuffer(l.base64.length(A.aiPsiMetadata)),0):A.aiPsiMetadata.length>=0&&(r.aiPsiMetadata=A.aiPsiMetadata)),A.aiQueryFanout!=null){if(typeof A.aiQueryFanout!="object")throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected");r.aiQueryFanout=p.proto.AIQueryFanout.fromObject(A.aiQueryFanout)}if(A.memberLabel!=null){if(typeof A.memberLabel!="object")throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected");r.memberLabel=p.proto.MemberLabel.fromObject(A.memberLabel)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.ProtocolMessage.Type[A.type]===void 0?A.type:p.proto.Message.ProtocolMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.ephemeralExpiration!=null&&A.hasOwnProperty("ephemeralExpiration")&&(s.ephemeralExpiration=A.ephemeralExpiration,r.oneofs&&(s._ephemeralExpiration="ephemeralExpiration")),A.ephemeralSettingTimestamp!=null&&A.hasOwnProperty("ephemeralSettingTimestamp")&&(typeof A.ephemeralSettingTimestamp=="number"?s.ephemeralSettingTimestamp=r.longs===String?String(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp:s.ephemeralSettingTimestamp=r.longs===String?ge(A.ephemeralSettingTimestamp):r.longs===Number?ce(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp,r.oneofs&&(s._ephemeralSettingTimestamp="ephemeralSettingTimestamp")),A.historySyncNotification!=null&&A.hasOwnProperty("historySyncNotification")&&(s.historySyncNotification=p.proto.Message.HistorySyncNotification.toObject(A.historySyncNotification,r),r.oneofs&&(s._historySyncNotification="historySyncNotification")),A.appStateSyncKeyShare!=null&&A.hasOwnProperty("appStateSyncKeyShare")&&(s.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.toObject(A.appStateSyncKeyShare,r),r.oneofs&&(s._appStateSyncKeyShare="appStateSyncKeyShare")),A.appStateSyncKeyRequest!=null&&A.hasOwnProperty("appStateSyncKeyRequest")&&(s.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.toObject(A.appStateSyncKeyRequest,r),r.oneofs&&(s._appStateSyncKeyRequest="appStateSyncKeyRequest")),A.initialSecurityNotificationSettingSync!=null&&A.hasOwnProperty("initialSecurityNotificationSettingSync")&&(s.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.toObject(A.initialSecurityNotificationSettingSync,r),r.oneofs&&(s._initialSecurityNotificationSettingSync="initialSecurityNotificationSettingSync")),A.appStateFatalExceptionNotification!=null&&A.hasOwnProperty("appStateFatalExceptionNotification")&&(s.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.toObject(A.appStateFatalExceptionNotification,r),r.oneofs&&(s._appStateFatalExceptionNotification="appStateFatalExceptionNotification")),A.disappearingMode!=null&&A.hasOwnProperty("disappearingMode")&&(s.disappearingMode=p.proto.DisappearingMode.toObject(A.disappearingMode,r),r.oneofs&&(s._disappearingMode="disappearingMode")),A.editedMessage!=null&&A.hasOwnProperty("editedMessage")&&(s.editedMessage=p.proto.Message.toObject(A.editedMessage,r),r.oneofs&&(s._editedMessage="editedMessage")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.peerDataOperationRequestMessage!=null&&A.hasOwnProperty("peerDataOperationRequestMessage")&&(s.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.toObject(A.peerDataOperationRequestMessage,r),r.oneofs&&(s._peerDataOperationRequestMessage="peerDataOperationRequestMessage")),A.peerDataOperationRequestResponseMessage!=null&&A.hasOwnProperty("peerDataOperationRequestResponseMessage")&&(s.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.toObject(A.peerDataOperationRequestResponseMessage,r),r.oneofs&&(s._peerDataOperationRequestResponseMessage="peerDataOperationRequestResponseMessage")),A.botFeedbackMessage!=null&&A.hasOwnProperty("botFeedbackMessage")&&(s.botFeedbackMessage=p.proto.BotFeedbackMessage.toObject(A.botFeedbackMessage,r),r.oneofs&&(s._botFeedbackMessage="botFeedbackMessage")),A.invokerJid!=null&&A.hasOwnProperty("invokerJid")&&(s.invokerJid=A.invokerJid,r.oneofs&&(s._invokerJid="invokerJid")),A.requestWelcomeMessageMetadata!=null&&A.hasOwnProperty("requestWelcomeMessageMetadata")&&(s.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.toObject(A.requestWelcomeMessageMetadata,r),r.oneofs&&(s._requestWelcomeMessageMetadata="requestWelcomeMessageMetadata")),A.mediaNotifyMessage!=null&&A.hasOwnProperty("mediaNotifyMessage")&&(s.mediaNotifyMessage=p.proto.MediaNotifyMessage.toObject(A.mediaNotifyMessage,r),r.oneofs&&(s._mediaNotifyMessage="mediaNotifyMessage")),A.cloudApiThreadControlNotification!=null&&A.hasOwnProperty("cloudApiThreadControlNotification")&&(s.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.toObject(A.cloudApiThreadControlNotification,r),r.oneofs&&(s._cloudApiThreadControlNotification="cloudApiThreadControlNotification")),A.lidMigrationMappingSyncMessage!=null&&A.hasOwnProperty("lidMigrationMappingSyncMessage")&&(s.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.toObject(A.lidMigrationMappingSyncMessage,r),r.oneofs&&(s._lidMigrationMappingSyncMessage="lidMigrationMappingSyncMessage")),A.limitSharing!=null&&A.hasOwnProperty("limitSharing")&&(s.limitSharing=p.proto.LimitSharing.toObject(A.limitSharing,r),r.oneofs&&(s._limitSharing="limitSharing")),A.aiPsiMetadata!=null&&A.hasOwnProperty("aiPsiMetadata")&&(s.aiPsiMetadata=r.bytes===String?l.base64.encode(A.aiPsiMetadata,0,A.aiPsiMetadata.length):r.bytes===Array?Array.prototype.slice.call(A.aiPsiMetadata):A.aiPsiMetadata,r.oneofs&&(s._aiPsiMetadata="aiPsiMetadata")),A.aiQueryFanout!=null&&A.hasOwnProperty("aiQueryFanout")&&(s.aiQueryFanout=p.proto.AIQueryFanout.toObject(A.aiQueryFanout,r),r.oneofs&&(s._aiQueryFanout="aiQueryFanout")),A.memberLabel!=null&&A.hasOwnProperty("memberLabel")&&(s.memberLabel=p.proto.MemberLabel.toObject(A.memberLabel,r),r.oneofs&&(s._memberLabel="memberLabel")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProtocolMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="REVOKE"]=0,A[a[3]="EPHEMERAL_SETTING"]=3,A[a[4]="EPHEMERAL_SYNC_RESPONSE"]=4,A[a[5]="HISTORY_SYNC_NOTIFICATION"]=5,A[a[6]="APP_STATE_SYNC_KEY_SHARE"]=6,A[a[7]="APP_STATE_SYNC_KEY_REQUEST"]=7,A[a[8]="MSG_FANOUT_BACKFILL_REQUEST"]=8,A[a[9]="INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC"]=9,A[a[10]="APP_STATE_FATAL_EXCEPTION_NOTIFICATION"]=10,A[a[11]="SHARE_PHONE_NUMBER"]=11,A[a[14]="MESSAGE_EDIT"]=14,A[a[16]="PEER_DATA_OPERATION_REQUEST_MESSAGE"]=16,A[a[17]="PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"]=17,A[a[18]="REQUEST_WELCOME_MESSAGE"]=18,A[a[19]="BOT_FEEDBACK_MESSAGE"]=19,A[a[20]="MEDIA_NOTIFY_MESSAGE"]=20,A[a[21]="CLOUD_API_THREAD_CONTROL_NOTIFICATION"]=21,A[a[22]="LID_MIGRATION_MAPPING_SYNC"]=22,A[a[23]="REMINDER_MESSAGE"]=23,A[a[24]="BOT_MEMU_ONBOARDING_MESSAGE"]=24,A[a[25]="STATUS_MENTION_MESSAGE"]=25,A[a[26]="STOP_GENERATION_MESSAGE"]=26,A[a[27]="LIMIT_SHARING"]=27,A[a[28]="AI_PSI_METADATA"]=28,A[a[29]="AI_QUERY_FANOUT"]=29,A[a[30]="GROUP_MEMBER_LABEL_CHANGE"]=30,A})(),i})(),t.QuestionResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.QuestionResponseMessage)return A;var r=new p.proto.Message.QuestionResponseMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.QuestionResponseMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.QuestionResponseMessage"},i})(),t.ReactionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}case 3:{c.groupingKey=A.string();break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ReactionMessage)return A;var r=new p.proto.Message.ReactionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ReactionMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),A.groupingKey!=null&&(r.groupingKey=String(A.groupingKey)),A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.groupingKey!=null&&A.hasOwnProperty("groupingKey")&&(s.groupingKey=A.groupingKey,r.oneofs&&(s._groupingKey="groupingKey")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ReactionMessage"},i})(),t.RequestPaymentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 4:{c.noteMessage=p.proto.Message.decode(A,A.uint32());break}case 1:{c.currencyCodeIso4217=A.string();break}case 2:{c.amount1000=A.uint64();break}case 3:{c.requestFrom=A.string();break}case 5:{c.expiryTimestamp=A.int64();break}case 6:{c.amount=p.proto.Money.decode(A,A.uint32());break}case 7:{c.background=p.proto.PaymentBackground.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestPaymentMessage)return A;var r=new p.proto.Message.RequestPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected");r.noteMessage=p.proto.Message.fromObject(A.noteMessage)}if(A.currencyCodeIso4217!=null&&(r.currencyCodeIso4217=String(A.currencyCodeIso4217)),A.amount1000!=null&&(l.Long?(r.amount1000=l.Long.fromValue(A.amount1000)).unsigned=!0:typeof A.amount1000=="string"?r.amount1000=parseInt(A.amount1000,10):typeof A.amount1000=="number"?r.amount1000=A.amount1000:typeof A.amount1000=="object"&&(r.amount1000=new l.LongBits(A.amount1000.low>>>0,A.amount1000.high>>>0).toNumber(!0))),A.requestFrom!=null&&(r.requestFrom=String(A.requestFrom)),A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),A.amount!=null){if(typeof A.amount!="object")throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected");r.amount=p.proto.Money.fromObject(A.amount)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected");r.background=p.proto.PaymentBackground.fromObject(A.background)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.currencyCodeIso4217!=null&&A.hasOwnProperty("currencyCodeIso4217")&&(s.currencyCodeIso4217=A.currencyCodeIso4217,r.oneofs&&(s._currencyCodeIso4217="currencyCodeIso4217")),A.amount1000!=null&&A.hasOwnProperty("amount1000")&&(typeof A.amount1000=="number"?s.amount1000=r.longs===String?String(A.amount1000):A.amount1000:s.amount1000=r.longs===String?ge(A.amount1000,!0):r.longs===Number?ce(A.amount1000,!0):A.amount1000,r.oneofs&&(s._amount1000="amount1000")),A.requestFrom!=null&&A.hasOwnProperty("requestFrom")&&(s.requestFrom=A.requestFrom,r.oneofs&&(s._requestFrom="requestFrom")),A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=p.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),A.amount!=null&&A.hasOwnProperty("amount")&&(s.amount=p.proto.Money.toObject(A.amount,r),r.oneofs&&(s._amount="amount")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=p.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPaymentMessage"},i})(),t.RequestPhoneNumberMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestPhoneNumberMessage)return A;var r=new p.proto.Message.RequestPhoneNumberMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPhoneNumberMessage"},i})(),t.RequestWelcomeMessageMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.localChatState=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestWelcomeMessageMetadata)return A;var r=new p.proto.Message.RequestWelcomeMessageMetadata;switch(A.localChatState){default:if(typeof A.localChatState=="number"){r.localChatState=A.localChatState;break}break;case"EMPTY":case 0:r.localChatState=0;break;case"NON_EMPTY":case 1:r.localChatState=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.localChatState!=null&&A.hasOwnProperty("localChatState")&&(s.localChatState=r.enums===String?p.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]===void 0?A.localChatState:p.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]:A.localChatState,r.oneofs&&(s._localChatState="localChatState")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestWelcomeMessageMetadata"},i.LocalChatState=(function(){let a={},A=Object.create(a);return A[a[0]="EMPTY"]=0,A[a[1]="NON_EMPTY"]=1,A})(),i})(),t.ScheduledCallCreationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.scheduledTimestampMs=A.int64();break}case 2:{c.callType=A.int32();break}case 3:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ScheduledCallCreationMessage)return A;var r=new p.proto.Message.ScheduledCallCreationMessage;switch(A.scheduledTimestampMs!=null&&(l.Long?(r.scheduledTimestampMs=l.Long.fromValue(A.scheduledTimestampMs)).unsigned=!1:typeof A.scheduledTimestampMs=="string"?r.scheduledTimestampMs=parseInt(A.scheduledTimestampMs,10):typeof A.scheduledTimestampMs=="number"?r.scheduledTimestampMs=A.scheduledTimestampMs:typeof A.scheduledTimestampMs=="object"&&(r.scheduledTimestampMs=new l.LongBits(A.scheduledTimestampMs.low>>>0,A.scheduledTimestampMs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"UNKNOWN":case 0:r.callType=0;break;case"VOICE":case 1:r.callType=1;break;case"VIDEO":case 2:r.callType=2;break}return A.title!=null&&(r.title=String(A.title)),r},i.toObject=function(A,r){r||(r={});var s={};return A.scheduledTimestampMs!=null&&A.hasOwnProperty("scheduledTimestampMs")&&(typeof A.scheduledTimestampMs=="number"?s.scheduledTimestampMs=r.longs===String?String(A.scheduledTimestampMs):A.scheduledTimestampMs:s.scheduledTimestampMs=r.longs===String?ge(A.scheduledTimestampMs):r.longs===Number?ce(A.scheduledTimestampMs):A.scheduledTimestampMs,r.oneofs&&(s._scheduledTimestampMs="scheduledTimestampMs")),A.callType!=null&&A.hasOwnProperty("callType")&&(s.callType=r.enums===String?p.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]===void 0?A.callType:p.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]:A.callType,r.oneofs&&(s._callType="callType")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallCreationMessage"},i.CallType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="VOICE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),t.ScheduledCallEditMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.editType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ScheduledCallEditMessage)return A;var r=new p.proto.Message.ScheduledCallEditMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.editType){default:if(typeof A.editType=="number"){r.editType=A.editType;break}break;case"UNKNOWN":case 0:r.editType=0;break;case"CANCEL":case 1:r.editType=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.editType!=null&&A.hasOwnProperty("editType")&&(s.editType=r.enums===String?p.proto.Message.ScheduledCallEditMessage.EditType[A.editType]===void 0?A.editType:p.proto.Message.ScheduledCallEditMessage.EditType[A.editType]:A.editType,r.oneofs&&(s._editType="editType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallEditMessage"},i.EditType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CANCEL"]=1,A})(),i})(),t.SecretEncryptedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}case 4:{c.secretEncType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SecretEncryptedMessage)return A;var r=new p.proto.Message.SecretEncryptedMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected");r.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}switch(A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),A.secretEncType){default:if(typeof A.secretEncType=="number"){r.secretEncType=A.secretEncType;break}break;case"UNKNOWN":case 0:r.secretEncType=0;break;case"EVENT_EDIT":case 1:r.secretEncType=1;break;case"MESSAGE_EDIT":case 2:r.secretEncType=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),A.secretEncType!=null&&A.hasOwnProperty("secretEncType")&&(s.secretEncType=r.enums===String?p.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]===void 0?A.secretEncType:p.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]:A.secretEncType,r.oneofs&&(s._secretEncType="secretEncType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SecretEncryptedMessage"},i.SecretEncType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="EVENT_EDIT"]=1,A[a[2]="MESSAGE_EDIT"]=2,A})(),i})(),t.SendPaymentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 2:{c.noteMessage=p.proto.Message.decode(A,A.uint32());break}case 3:{c.requestMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 4:{c.background=p.proto.PaymentBackground.decode(A,A.uint32());break}case 5:{c.transactionData=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SendPaymentMessage)return A;var r=new p.proto.Message.SendPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected");r.noteMessage=p.proto.Message.fromObject(A.noteMessage)}if(A.requestMessageKey!=null){if(typeof A.requestMessageKey!="object")throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected");r.requestMessageKey=p.proto.MessageKey.fromObject(A.requestMessageKey)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.SendPaymentMessage.background: object expected");r.background=p.proto.PaymentBackground.fromObject(A.background)}return A.transactionData!=null&&(r.transactionData=String(A.transactionData)),r},i.toObject=function(A,r){r||(r={});var s={};return A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=p.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.requestMessageKey!=null&&A.hasOwnProperty("requestMessageKey")&&(s.requestMessageKey=p.proto.MessageKey.toObject(A.requestMessageKey,r),r.oneofs&&(s._requestMessageKey="requestMessageKey")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=p.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),A.transactionData!=null&&A.hasOwnProperty("transactionData")&&(s.transactionData=A.transactionData,r.oneofs&&(s._transactionData="transactionData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SendPaymentMessage"},i})(),t.SenderKeyDistributionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.groupId=A.string();break}case 2:{c.axolotlSenderKeyDistributionMessage=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SenderKeyDistributionMessage)return A;var r=new p.proto.Message.SenderKeyDistributionMessage;return A.groupId!=null&&(r.groupId=String(A.groupId)),A.axolotlSenderKeyDistributionMessage!=null&&(typeof A.axolotlSenderKeyDistributionMessage=="string"?l.base64.decode(A.axolotlSenderKeyDistributionMessage,r.axolotlSenderKeyDistributionMessage=l.newBuffer(l.base64.length(A.axolotlSenderKeyDistributionMessage)),0):A.axolotlSenderKeyDistributionMessage.length>=0&&(r.axolotlSenderKeyDistributionMessage=A.axolotlSenderKeyDistributionMessage)),r},i.toObject=function(A,r){r||(r={});var s={};return A.groupId!=null&&A.hasOwnProperty("groupId")&&(s.groupId=A.groupId,r.oneofs&&(s._groupId="groupId")),A.axolotlSenderKeyDistributionMessage!=null&&A.hasOwnProperty("axolotlSenderKeyDistributionMessage")&&(s.axolotlSenderKeyDistributionMessage=r.bytes===String?l.base64.encode(A.axolotlSenderKeyDistributionMessage,0,A.axolotlSenderKeyDistributionMessage.length):r.bytes===Array?Array.prototype.slice.call(A.axolotlSenderKeyDistributionMessage):A.axolotlSenderKeyDistributionMessage,r.oneofs&&(s._axolotlSenderKeyDistributionMessage="axolotlSenderKeyDistributionMessage")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SenderKeyDistributionMessage"},i})(),t.StatusNotificationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.responseMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.originalMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusNotificationMessage)return A;var r=new p.proto.Message.StatusNotificationMessage;if(A.responseMessageKey!=null){if(typeof A.responseMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected");r.responseMessageKey=p.proto.MessageKey.fromObject(A.responseMessageKey)}if(A.originalMessageKey!=null){if(typeof A.originalMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected");r.originalMessageKey=p.proto.MessageKey.fromObject(A.originalMessageKey)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"STATUS_ADD_YOURS":case 1:r.type=1;break;case"STATUS_RESHARE":case 2:r.type=2;break;case"STATUS_QUESTION_ANSWER_RESHARE":case 3:r.type=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.responseMessageKey!=null&&A.hasOwnProperty("responseMessageKey")&&(s.responseMessageKey=p.proto.MessageKey.toObject(A.responseMessageKey,r),r.oneofs&&(s._responseMessageKey="responseMessageKey")),A.originalMessageKey!=null&&A.hasOwnProperty("originalMessageKey")&&(s.originalMessageKey=p.proto.MessageKey.toObject(A.originalMessageKey,r),r.oneofs&&(s._originalMessageKey="originalMessageKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]===void 0?A.type:p.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusNotificationMessage"},i.StatusNotificationType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="STATUS_ADD_YOURS"]=1,A[a[2]="STATUS_RESHARE"]=2,A[a[3]="STATUS_QUESTION_ANSWER_RESHARE"]=3,A})(),i})(),t.StatusQuestionAnswerMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusQuestionAnswerMessage)return A;var r=new p.proto.Message.StatusQuestionAnswerMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusQuestionAnswerMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuestionAnswerMessage"},i})(),t.StatusQuotedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.text=A.string();break}case 3:{c.thumbnail=A.bytes();break}case 4:{c.originalStatusId=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusQuotedMessage)return A;var r=new p.proto.Message.StatusQuotedMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"QUESTION_ANSWER":case 1:r.type=1;break}if(A.text!=null&&(r.text=String(A.text)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.originalStatusId!=null){if(typeof A.originalStatusId!="object")throw TypeError(".proto.Message.StatusQuotedMessage.originalStatusId: object expected");r.originalStatusId=p.proto.MessageKey.fromObject(A.originalStatusId)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]===void 0?A.type:p.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]:A.type,r.oneofs&&(s._type="type")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.originalStatusId!=null&&A.hasOwnProperty("originalStatusId")&&(s.originalStatusId=p.proto.MessageKey.toObject(A.originalStatusId,r),r.oneofs&&(s._originalStatusId="originalStatusId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuotedMessage"},i.StatusQuotedMessageType=(function(){let a={},A=Object.create(a);return A[a[1]="QUESTION_ANSWER"]=1,A})(),i})(),t.StatusStickerInteractionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.stickerKey=A.string();break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusStickerInteractionMessage)return A;var r=new p.proto.Message.StatusStickerInteractionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusStickerInteractionMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}switch(A.stickerKey!=null&&(r.stickerKey=String(A.stickerKey)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"REACTION":case 1:r.type=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.stickerKey!=null&&A.hasOwnProperty("stickerKey")&&(s.stickerKey=A.stickerKey,r.oneofs&&(s._stickerKey="stickerKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]===void 0?A.type:p.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]:A.type,r.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusStickerInteractionMessage"},i.StatusStickerType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="REACTION"]=1,A})(),i})(),t.StickerMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.fileEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mimetype=A.string();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.directPath=A.string();break}case 9:{c.fileLength=A.uint64();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 11:{c.firstFrameLength=A.uint32();break}case 12:{c.firstFrameSidecar=A.bytes();break}case 13:{c.isAnimated=A.bool();break}case 16:{c.pngThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.stickerSentTs=A.int64();break}case 19:{c.isAvatar=A.bool();break}case 20:{c.isAiSticker=A.bool();break}case 21:{c.isLottie=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerMessage)return A;var r=new p.proto.Message.StickerMessage;if(A.url!=null&&(r.url=String(A.url)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.firstFrameLength!=null&&(r.firstFrameLength=A.firstFrameLength>>>0),A.firstFrameSidecar!=null&&(typeof A.firstFrameSidecar=="string"?l.base64.decode(A.firstFrameSidecar,r.firstFrameSidecar=l.newBuffer(l.base64.length(A.firstFrameSidecar)),0):A.firstFrameSidecar.length>=0&&(r.firstFrameSidecar=A.firstFrameSidecar)),A.isAnimated!=null&&(r.isAnimated=!!A.isAnimated),A.pngThumbnail!=null&&(typeof A.pngThumbnail=="string"?l.base64.decode(A.pngThumbnail,r.pngThumbnail=l.newBuffer(l.base64.length(A.pngThumbnail)),0):A.pngThumbnail.length>=0&&(r.pngThumbnail=A.pngThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.stickerSentTs!=null&&(l.Long?(r.stickerSentTs=l.Long.fromValue(A.stickerSentTs)).unsigned=!1:typeof A.stickerSentTs=="string"?r.stickerSentTs=parseInt(A.stickerSentTs,10):typeof A.stickerSentTs=="number"?r.stickerSentTs=A.stickerSentTs:typeof A.stickerSentTs=="object"&&(r.stickerSentTs=new l.LongBits(A.stickerSentTs.low>>>0,A.stickerSentTs.high>>>0).toNumber())),A.isAvatar!=null&&(r.isAvatar=!!A.isAvatar),A.isAiSticker!=null&&(r.isAiSticker=!!A.isAiSticker),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.firstFrameLength!=null&&A.hasOwnProperty("firstFrameLength")&&(s.firstFrameLength=A.firstFrameLength,r.oneofs&&(s._firstFrameLength="firstFrameLength")),A.firstFrameSidecar!=null&&A.hasOwnProperty("firstFrameSidecar")&&(s.firstFrameSidecar=r.bytes===String?l.base64.encode(A.firstFrameSidecar,0,A.firstFrameSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.firstFrameSidecar):A.firstFrameSidecar,r.oneofs&&(s._firstFrameSidecar="firstFrameSidecar")),A.isAnimated!=null&&A.hasOwnProperty("isAnimated")&&(s.isAnimated=A.isAnimated,r.oneofs&&(s._isAnimated="isAnimated")),A.pngThumbnail!=null&&A.hasOwnProperty("pngThumbnail")&&(s.pngThumbnail=r.bytes===String?l.base64.encode(A.pngThumbnail,0,A.pngThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.pngThumbnail):A.pngThumbnail,r.oneofs&&(s._pngThumbnail="pngThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.stickerSentTs!=null&&A.hasOwnProperty("stickerSentTs")&&(typeof A.stickerSentTs=="number"?s.stickerSentTs=r.longs===String?String(A.stickerSentTs):A.stickerSentTs:s.stickerSentTs=r.longs===String?ge(A.stickerSentTs):r.longs===Number?ce(A.stickerSentTs):A.stickerSentTs,r.oneofs&&(s._stickerSentTs="stickerSentTs")),A.isAvatar!=null&&A.hasOwnProperty("isAvatar")&&(s.isAvatar=A.isAvatar,r.oneofs&&(s._isAvatar="isAvatar")),A.isAiSticker!=null&&A.hasOwnProperty("isAiSticker")&&(s.isAiSticker=A.isAiSticker,r.oneofs&&(s._isAiSticker="isAiSticker")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StickerMessage"},i})(),t.StickerPackMessage=(function(){function i(a){if(this.stickers=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.stickerPackId=A.string();break}case 2:{c.name=A.string();break}case 3:{c.publisher=A.string();break}case 4:{c.stickers&&c.stickers.length||(c.stickers=[]),c.stickers.push(p.proto.Message.StickerPackMessage.Sticker.decode(A,A.uint32()));break}case 5:{c.fileLength=A.uint64();break}case 6:{c.fileSha256=A.bytes();break}case 7:{c.fileEncSha256=A.bytes();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.caption=A.string();break}case 11:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.packDescription=A.string();break}case 13:{c.mediaKeyTimestamp=A.int64();break}case 14:{c.trayIconFileName=A.string();break}case 15:{c.thumbnailDirectPath=A.string();break}case 16:{c.thumbnailSha256=A.bytes();break}case 17:{c.thumbnailEncSha256=A.bytes();break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.imageDataHash=A.string();break}case 21:{c.stickerPackSize=A.uint64();break}case 22:{c.stickerPackOrigin=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerPackMessage)return A;var r=new p.proto.Message.StickerPackMessage;if(A.stickerPackId!=null&&(r.stickerPackId=String(A.stickerPackId)),A.name!=null&&(r.name=String(A.name)),A.publisher!=null&&(r.publisher=String(A.publisher)),A.stickers){if(!Array.isArray(A.stickers))throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected");r.stickers=[];for(var s=0;s>>0,A.fileLength.high>>>0).toNumber(!0))),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.packDescription!=null&&(r.packDescription=String(A.packDescription)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.trayIconFileName!=null&&(r.trayIconFileName=String(A.trayIconFileName)),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.imageDataHash!=null&&(r.imageDataHash=String(A.imageDataHash)),A.stickerPackSize!=null&&(l.Long?(r.stickerPackSize=l.Long.fromValue(A.stickerPackSize)).unsigned=!0:typeof A.stickerPackSize=="string"?r.stickerPackSize=parseInt(A.stickerPackSize,10):typeof A.stickerPackSize=="number"?r.stickerPackSize=A.stickerPackSize:typeof A.stickerPackSize=="object"&&(r.stickerPackSize=new l.LongBits(A.stickerPackSize.low>>>0,A.stickerPackSize.high>>>0).toNumber(!0))),A.stickerPackOrigin){default:if(typeof A.stickerPackOrigin=="number"){r.stickerPackOrigin=A.stickerPackOrigin;break}break;case"FIRST_PARTY":case 0:r.stickerPackOrigin=0;break;case"THIRD_PARTY":case 1:r.stickerPackOrigin=1;break;case"USER_CREATED":case 2:r.stickerPackOrigin=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.stickers=[]),A.stickerPackId!=null&&A.hasOwnProperty("stickerPackId")&&(s.stickerPackId=A.stickerPackId,r.oneofs&&(s._stickerPackId="stickerPackId")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.publisher!=null&&A.hasOwnProperty("publisher")&&(s.publisher=A.publisher,r.oneofs&&(s._publisher="publisher")),A.stickers&&A.stickers.length){s.stickers=[];for(var g=0;g>>3){case 1:{d.fileName=s.string();break}case 2:{d.isAnimated=s.bool();break}case 3:{d.emojis&&d.emojis.length||(d.emojis=[]),d.emojis.push(s.string());break}case 4:{d.accessibilityLabel=s.string();break}case 5:{d.isLottie=s.bool();break}case 6:{d.mimetype=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.StickerPackMessage.Sticker)return s;var g=new p.proto.Message.StickerPackMessage.Sticker;if(s.fileName!=null&&(g.fileName=String(s.fileName)),s.isAnimated!=null&&(g.isAnimated=!!s.isAnimated),s.emojis){if(!Array.isArray(s.emojis))throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected");g.emojis=[];for(var c=0;c>>3){case 1:{c.filehash&&c.filehash.length||(c.filehash=[]),c.filehash.push(A.string());break}case 2:{c.rmrSource=A.string();break}case 3:{c.requestTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerSyncRMRMessage)return A;var r=new p.proto.Message.StickerSyncRMRMessage;if(A.filehash){if(!Array.isArray(A.filehash))throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected");r.filehash=[];for(var s=0;s>>0,A.requestTimestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.filehash=[]),A.filehash&&A.filehash.length){s.filehash=[];for(var g=0;g>>3){case 1:{c.selectedId=A.string();break}case 2:{c.selectedDisplayText=A.string();break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.selectedIndex=A.uint32();break}case 5:{c.selectedCarouselCardIndex=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.TemplateButtonReplyMessage)return A;var r=new p.proto.Message.TemplateButtonReplyMessage;if(A.selectedId!=null&&(r.selectedId=String(A.selectedId)),A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.selectedIndex!=null&&(r.selectedIndex=A.selectedIndex>>>0),A.selectedCarouselCardIndex!=null&&(r.selectedCarouselCardIndex=A.selectedCarouselCardIndex>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.selectedId!=null&&A.hasOwnProperty("selectedId")&&(s.selectedId=A.selectedId,r.oneofs&&(s._selectedId="selectedId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s._selectedDisplayText="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.selectedIndex!=null&&A.hasOwnProperty("selectedIndex")&&(s.selectedIndex=A.selectedIndex,r.oneofs&&(s._selectedIndex="selectedIndex")),A.selectedCarouselCardIndex!=null&&A.hasOwnProperty("selectedCarouselCardIndex")&&(s.selectedCarouselCardIndex=A.selectedCarouselCardIndex,r.oneofs&&(s._selectedCarouselCardIndex="selectedCarouselCardIndex")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateButtonReplyMessage"},i})(),t.TemplateMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 9:{c.templateId=A.string();break}case 1:{c.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.decode(A,A.uint32());break}case 2:{c.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 5:{c.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.TemplateMessage)return A;var r=new p.proto.Message.TemplateMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.hydratedTemplate!=null){if(typeof A.hydratedTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected");r.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedTemplate)}if(A.templateId!=null&&(r.templateId=String(A.templateId)),A.fourRowTemplate!=null){if(typeof A.fourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected");r.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.fromObject(A.fourRowTemplate)}if(A.hydratedFourRowTemplate!=null){if(typeof A.hydratedFourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected");r.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedFourRowTemplate)}if(A.interactiveMessageTemplate!=null){if(typeof A.interactiveMessageTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected");r.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.fromObject(A.interactiveMessageTemplate)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.fourRowTemplate!=null&&A.hasOwnProperty("fourRowTemplate")&&(s.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.toObject(A.fourRowTemplate,r),r.oneofs&&(s.format="fourRowTemplate")),A.hydratedFourRowTemplate!=null&&A.hasOwnProperty("hydratedFourRowTemplate")&&(s.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedFourRowTemplate,r),r.oneofs&&(s.format="hydratedFourRowTemplate")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.hydratedTemplate!=null&&A.hasOwnProperty("hydratedTemplate")&&(s.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedTemplate,r),r.oneofs&&(s._hydratedTemplate="hydratedTemplate")),A.interactiveMessageTemplate!=null&&A.hasOwnProperty("interactiveMessageTemplate")&&(s.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.toObject(A.interactiveMessageTemplate,r),r.oneofs&&(s.format="interactiveMessageTemplate")),A.templateId!=null&&A.hasOwnProperty("templateId")&&(s.templateId=A.templateId,r.oneofs&&(s._templateId="templateId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateMessage"},i.FourRowTemplate=(function(){function a(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 6:{d.content=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 7:{d.footer=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 8:{d.buttons&&d.buttons.length||(d.buttons=[]),d.buttons.push(p.proto.TemplateButton.decode(s,s.uint32()));break}case 1:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{d.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 3:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.TemplateMessage.FourRowTemplate)return s;var g=new p.proto.Message.TemplateMessage.FourRowTemplate;if(s.content!=null){if(typeof s.content!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected");g.content=p.proto.Message.HighlyStructuredMessage.fromObject(s.content)}if(s.footer!=null){if(typeof s.footer!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected");g.footer=p.proto.Message.HighlyStructuredMessage.fromObject(s.footer)}if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 6:{d.hydratedContentText=s.string();break}case 7:{d.hydratedFooterText=s.string();break}case 8:{d.hydratedButtons&&d.hydratedButtons.length||(d.hydratedButtons=[]),d.hydratedButtons.push(p.proto.HydratedTemplateButton.decode(s,s.uint32()));break}case 9:{d.templateId=s.string();break}case 10:{d.maskLinkedDevices=s.bool();break}case 1:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{d.hydratedTitleText=s.string();break}case 3:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.TemplateMessage.HydratedFourRowTemplate)return s;var g=new p.proto.Message.TemplateMessage.HydratedFourRowTemplate;if(s.hydratedContentText!=null&&(g.hydratedContentText=String(s.hydratedContentText)),s.hydratedFooterText!=null&&(g.hydratedFooterText=String(s.hydratedFooterText)),s.hydratedButtons){if(!Array.isArray(s.hydratedButtons))throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected");g.hydratedButtons=[];for(var c=0;c>>3){case 1:{c.fbExperimentId=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.URLMetadata)return A;var r=new p.proto.Message.URLMetadata;return A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),r},i.toObject=function(A,r){r||(r={});var s={};return A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.URLMetadata"},i})(),t.VideoEndCard=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.username=a.string();break}case 2:{g.caption=a.string();break}case 3:{g.thumbnailImageUrl=a.string();break}case 4:{g.profilePictureUrl=a.string();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.VideoEndCard)return a;var A=new p.proto.Message.VideoEndCard;return a.username!=null&&(A.username=String(a.username)),a.caption!=null&&(A.caption=String(a.caption)),a.thumbnailImageUrl!=null&&(A.thumbnailImageUrl=String(a.thumbnailImageUrl)),a.profilePictureUrl!=null&&(A.profilePictureUrl=String(a.profilePictureUrl)),A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.username="",r.caption="",r.thumbnailImageUrl="",r.profilePictureUrl=""),a.username!=null&&a.hasOwnProperty("username")&&(r.username=a.username),a.caption!=null&&a.hasOwnProperty("caption")&&(r.caption=a.caption),a.thumbnailImageUrl!=null&&a.hasOwnProperty("thumbnailImageUrl")&&(r.thumbnailImageUrl=a.thumbnailImageUrl),a.profilePictureUrl!=null&&a.hasOwnProperty("profilePictureUrl")&&(r.profilePictureUrl=a.profilePictureUrl),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Message.VideoEndCard"},i})(),t.VideoMessage=(function(){function i(a){if(this.interactiveAnnotations=[],this.annotations=[],this.processedVideos=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.mediaKey=A.bytes();break}case 7:{c.caption=A.string();break}case 8:{c.gifPlayback=A.bool();break}case 9:{c.height=A.uint32();break}case 10:{c.width=A.uint32();break}case 11:{c.fileEncSha256=A.bytes();break}case 12:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 13:{c.directPath=A.string();break}case 14:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.gifAttribution=A.int32();break}case 20:{c.viewOnce=A.bool();break}case 21:{c.thumbnailDirectPath=A.string();break}case 22:{c.thumbnailSha256=A.bytes();break}case 23:{c.thumbnailEncSha256=A.bytes();break}case 24:{c.staticUrl=A.string();break}case 25:{c.annotations&&c.annotations.length||(c.annotations=[]),c.annotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 26:{c.accessibilityLabel=A.string();break}case 27:{c.processedVideos&&c.processedVideos.length||(c.processedVideos=[]),c.processedVideos.push(p.proto.ProcessedVideo.decode(A,A.uint32()));break}case 28:{c.externalShareFullVideoDurationInSeconds=A.uint32();break}case 29:{c.motionPhotoPresentationOffsetMs=A.uint64();break}case 30:{c.metadataUrl=A.string();break}case 31:{c.videoSourceType=A.int32();break}case 32:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.VideoMessage)return A;var r=new p.proto.Message.VideoMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.caption!=null&&(r.caption=String(A.caption)),A.gifPlayback!=null&&(r.gifPlayback=!!A.gifPlayback),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected");r.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.gifAttribution){default:if(typeof A.gifAttribution=="number"){r.gifAttribution=A.gifAttribution;break}break;case"NONE":case 0:r.gifAttribution=0;break;case"GIPHY":case 1:r.gifAttribution=1;break;case"TENOR":case 2:r.gifAttribution=2;break;case"KLIPY":case 3:r.gifAttribution=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.VideoMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>0),A.motionPhotoPresentationOffsetMs!=null&&(l.Long?(r.motionPhotoPresentationOffsetMs=l.Long.fromValue(A.motionPhotoPresentationOffsetMs)).unsigned=!0:typeof A.motionPhotoPresentationOffsetMs=="string"?r.motionPhotoPresentationOffsetMs=parseInt(A.motionPhotoPresentationOffsetMs,10):typeof A.motionPhotoPresentationOffsetMs=="number"?r.motionPhotoPresentationOffsetMs=A.motionPhotoPresentationOffsetMs:typeof A.motionPhotoPresentationOffsetMs=="object"&&(r.motionPhotoPresentationOffsetMs=new l.LongBits(A.motionPhotoPresentationOffsetMs.low>>>0,A.motionPhotoPresentationOffsetMs.high>>>0).toNumber(!0))),A.metadataUrl!=null&&(r.metadataUrl=String(A.metadataUrl)),A.videoSourceType){default:if(typeof A.videoSourceType=="number"){r.videoSourceType=A.videoSourceType;break}break;case"USER_VIDEO":case 0:r.videoSourceType=0;break;case"AI_GENERATED":case 1:r.videoSourceType=1;break}switch(A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.interactiveAnnotations=[],s.annotations=[],s.processedVideos=[]),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.gifPlayback!=null&&A.hasOwnProperty("gifPlayback")&&(s.gifPlayback=A.gifPlayback,r.oneofs&&(s._gifPlayback="gifPlayback")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.interactiveAnnotations&&A.interactiveAnnotations.length){s.interactiveAnnotations=[];for(var g=0;g>>3){case 1:{s.messageAddOnType=e.int32();break}case 2:{s.messageAddOn=p.proto.Message.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.status=e.int32();break}case 6:{s.addOnContextInfo=p.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}case 7:{s.messageAddOnKey=p.proto.MessageKey.decode(e,e.uint32());break}case 8:{s.legacyMessage=p.proto.LegacyMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageAddOn)return e;var a=new p.proto.MessageAddOn;switch(e.messageAddOnType){default:if(typeof e.messageAddOnType=="number"){a.messageAddOnType=e.messageAddOnType;break}break;case"UNDEFINED":case 0:a.messageAddOnType=0;break;case"REACTION":case 1:a.messageAddOnType=1;break;case"EVENT_RESPONSE":case 2:a.messageAddOnType=2;break;case"POLL_UPDATE":case 3:a.messageAddOnType=3;break;case"PIN_IN_CHAT":case 4:a.messageAddOnType=4;break}if(e.messageAddOn!=null){if(typeof e.messageAddOn!="object")throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");a.messageAddOn=p.proto.Message.fromObject(e.messageAddOn)}switch(e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"ERROR":case 0:a.status=0;break;case"PENDING":case 1:a.status=1;break;case"SERVER_ACK":case 2:a.status=2;break;case"DELIVERY_ACK":case 3:a.status=3;break;case"READ":case 4:a.status=4;break;case"PLAYED":case 5:a.status=5;break}if(e.addOnContextInfo!=null){if(typeof e.addOnContextInfo!="object")throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");a.addOnContextInfo=p.proto.MessageAddOnContextInfo.fromObject(e.addOnContextInfo)}if(e.messageAddOnKey!=null){if(typeof e.messageAddOnKey!="object")throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");a.messageAddOnKey=p.proto.MessageKey.fromObject(e.messageAddOnKey)}if(e.legacyMessage!=null){if(typeof e.legacyMessage!="object")throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");a.legacyMessage=p.proto.LegacyMessage.fromObject(e.legacyMessage)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageAddOnType!=null&&e.hasOwnProperty("messageAddOnType")&&(A.messageAddOnType=a.enums===String?p.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]===void 0?e.messageAddOnType:p.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]:e.messageAddOnType,a.oneofs&&(A._messageAddOnType="messageAddOnType")),e.messageAddOn!=null&&e.hasOwnProperty("messageAddOn")&&(A.messageAddOn=p.proto.Message.toObject(e.messageAddOn,a),a.oneofs&&(A._messageAddOn="messageAddOn")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=a.enums===String?p.proto.WebMessageInfo.Status[e.status]===void 0?e.status:p.proto.WebMessageInfo.Status[e.status]:e.status,a.oneofs&&(A._status="status")),e.addOnContextInfo!=null&&e.hasOwnProperty("addOnContextInfo")&&(A.addOnContextInfo=p.proto.MessageAddOnContextInfo.toObject(e.addOnContextInfo,a),a.oneofs&&(A._addOnContextInfo="addOnContextInfo")),e.messageAddOnKey!=null&&e.hasOwnProperty("messageAddOnKey")&&(A.messageAddOnKey=p.proto.MessageKey.toObject(e.messageAddOnKey,a),a.oneofs&&(A._messageAddOnKey="messageAddOnKey")),e.legacyMessage!=null&&e.hasOwnProperty("legacyMessage")&&(A.legacyMessage=p.proto.LegacyMessage.toObject(e.legacyMessage,a),a.oneofs&&(A._legacyMessage="legacyMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOn"},t.MessageAddOnType=(function(){let i={},e=Object.create(i);return e[i[0]="UNDEFINED"]=0,e[i[1]="REACTION"]=1,e[i[2]="EVENT_RESPONSE"]=2,e[i[3]="POLL_UPDATE"]=3,e[i[4]="PIN_IN_CHAT"]=4,e})(),t})(),n.MessageAddOnContextInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageAddOnDurationInSecs=e.uint32();break}case 2:{s.messageAddOnExpiryType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageAddOnContextInfo)return e;var a=new p.proto.MessageAddOnContextInfo;switch(e.messageAddOnDurationInSecs!=null&&(a.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){a.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:a.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:a.messageAddOnExpiryType=2;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.messageAddOnDurationInSecs!=null&&e.hasOwnProperty("messageAddOnDurationInSecs")&&(A.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs,a.oneofs&&(A._messageAddOnDurationInSecs="messageAddOnDurationInSecs")),e.messageAddOnExpiryType!=null&&e.hasOwnProperty("messageAddOnExpiryType")&&(A.messageAddOnExpiryType=a.enums===String?p.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]===void 0?e.messageAddOnExpiryType:p.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]:e.messageAddOnExpiryType,a.oneofs&&(A._messageAddOnExpiryType="messageAddOnExpiryType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOnContextInfo"},t})(),n.MessageAssociation=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.associationType=e.int32();break}case 2:{s.parentMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.messageIndex=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageAssociation)return e;var a=new p.proto.MessageAssociation;switch(e.associationType){default:if(typeof e.associationType=="number"){a.associationType=e.associationType;break}break;case"UNKNOWN":case 0:a.associationType=0;break;case"MEDIA_ALBUM":case 1:a.associationType=1;break;case"BOT_PLUGIN":case 2:a.associationType=2;break;case"EVENT_COVER_IMAGE":case 3:a.associationType=3;break;case"STATUS_POLL":case 4:a.associationType=4;break;case"HD_VIDEO_DUAL_UPLOAD":case 5:a.associationType=5;break;case"STATUS_EXTERNAL_RESHARE":case 6:a.associationType=6;break;case"MEDIA_POLL":case 7:a.associationType=7;break;case"STATUS_ADD_YOURS":case 8:a.associationType=8;break;case"STATUS_NOTIFICATION":case 9:a.associationType=9;break;case"HD_IMAGE_DUAL_UPLOAD":case 10:a.associationType=10;break;case"STICKER_ANNOTATION":case 11:a.associationType=11;break;case"MOTION_PHOTO":case 12:a.associationType=12;break;case"STATUS_LINK_ACTION":case 13:a.associationType=13;break;case"VIEW_ALL_REPLIES":case 14:a.associationType=14;break;case"STATUS_ADD_YOURS_AI_IMAGINE":case 15:a.associationType=15;break;case"STATUS_QUESTION":case 16:a.associationType=16;break;case"STATUS_ADD_YOURS_DIWALI":case 17:a.associationType=17;break;case"STATUS_REACTION":case 18:a.associationType=18;break;case"HEVC_VIDEO_DUAL_UPLOAD":case 19:a.associationType=19;break}if(e.parentMessageKey!=null){if(typeof e.parentMessageKey!="object")throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");a.parentMessageKey=p.proto.MessageKey.fromObject(e.parentMessageKey)}return e.messageIndex!=null&&(a.messageIndex=e.messageIndex|0),a},t.toObject=function(e,a){a||(a={});var A={};return e.associationType!=null&&e.hasOwnProperty("associationType")&&(A.associationType=a.enums===String?p.proto.MessageAssociation.AssociationType[e.associationType]===void 0?e.associationType:p.proto.MessageAssociation.AssociationType[e.associationType]:e.associationType,a.oneofs&&(A._associationType="associationType")),e.parentMessageKey!=null&&e.hasOwnProperty("parentMessageKey")&&(A.parentMessageKey=p.proto.MessageKey.toObject(e.parentMessageKey,a),a.oneofs&&(A._parentMessageKey="parentMessageKey")),e.messageIndex!=null&&e.hasOwnProperty("messageIndex")&&(A.messageIndex=e.messageIndex,a.oneofs&&(A._messageIndex="messageIndex")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAssociation"},t.AssociationType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="MEDIA_ALBUM"]=1,e[i[2]="BOT_PLUGIN"]=2,e[i[3]="EVENT_COVER_IMAGE"]=3,e[i[4]="STATUS_POLL"]=4,e[i[5]="HD_VIDEO_DUAL_UPLOAD"]=5,e[i[6]="STATUS_EXTERNAL_RESHARE"]=6,e[i[7]="MEDIA_POLL"]=7,e[i[8]="STATUS_ADD_YOURS"]=8,e[i[9]="STATUS_NOTIFICATION"]=9,e[i[10]="HD_IMAGE_DUAL_UPLOAD"]=10,e[i[11]="STICKER_ANNOTATION"]=11,e[i[12]="MOTION_PHOTO"]=12,e[i[13]="STATUS_LINK_ACTION"]=13,e[i[14]="VIEW_ALL_REPLIES"]=14,e[i[15]="STATUS_ADD_YOURS_AI_IMAGINE"]=15,e[i[16]="STATUS_QUESTION"]=16,e[i[17]="STATUS_ADD_YOURS_DIWALI"]=17,e[i[18]="STATUS_REACTION"]=18,e[i[19]="HEVC_VIDEO_DUAL_UPLOAD"]=19,e})(),t})(),n.MessageContextInfo=(function(){function t(i){if(this.threadId=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.deviceListMetadata=p.proto.DeviceListMetadata.decode(e,e.uint32());break}case 2:{s.deviceListMetadataVersion=e.int32();break}case 3:{s.messageSecret=e.bytes();break}case 4:{s.paddingBytes=e.bytes();break}case 5:{s.messageAddOnDurationInSecs=e.uint32();break}case 6:{s.botMessageSecret=e.bytes();break}case 7:{s.botMetadata=p.proto.BotMetadata.decode(e,e.uint32());break}case 8:{s.reportingTokenVersion=e.int32();break}case 9:{s.messageAddOnExpiryType=e.int32();break}case 10:{s.messageAssociation=p.proto.MessageAssociation.decode(e,e.uint32());break}case 11:{s.capiCreatedGroup=e.bool();break}case 12:{s.supportPayload=e.string();break}case 13:{s.limitSharing=p.proto.LimitSharing.decode(e,e.uint32());break}case 14:{s.limitSharingV2=p.proto.LimitSharing.decode(e,e.uint32());break}case 15:{s.threadId&&s.threadId.length||(s.threadId=[]),s.threadId.push(p.proto.ThreadID.decode(e,e.uint32()));break}case 16:{s.weblinkRenderConfig=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageContextInfo)return e;var a=new p.proto.MessageContextInfo;if(e.deviceListMetadata!=null){if(typeof e.deviceListMetadata!="object")throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected");a.deviceListMetadata=p.proto.DeviceListMetadata.fromObject(e.deviceListMetadata)}if(e.deviceListMetadataVersion!=null&&(a.deviceListMetadataVersion=e.deviceListMetadataVersion|0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,a.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(a.paddingBytes=e.paddingBytes)),e.messageAddOnDurationInSecs!=null&&(a.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,a.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(a.botMessageSecret=e.botMessageSecret)),e.botMetadata!=null){if(typeof e.botMetadata!="object")throw TypeError(".proto.MessageContextInfo.botMetadata: object expected");a.botMetadata=p.proto.BotMetadata.fromObject(e.botMetadata)}switch(e.reportingTokenVersion!=null&&(a.reportingTokenVersion=e.reportingTokenVersion|0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){a.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:a.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:a.messageAddOnExpiryType=2;break}if(e.messageAssociation!=null){if(typeof e.messageAssociation!="object")throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected");a.messageAssociation=p.proto.MessageAssociation.fromObject(e.messageAssociation)}if(e.capiCreatedGroup!=null&&(a.capiCreatedGroup=!!e.capiCreatedGroup),e.supportPayload!=null&&(a.supportPayload=String(e.supportPayload)),e.limitSharing!=null){if(typeof e.limitSharing!="object")throw TypeError(".proto.MessageContextInfo.limitSharing: object expected");a.limitSharing=p.proto.LimitSharing.fromObject(e.limitSharing)}if(e.limitSharingV2!=null){if(typeof e.limitSharingV2!="object")throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected");a.limitSharingV2=p.proto.LimitSharing.fromObject(e.limitSharingV2)}if(e.threadId){if(!Array.isArray(e.threadId))throw TypeError(".proto.MessageContextInfo.threadId: array expected");a.threadId=[];for(var A=0;A>>3){case 1:{s.remoteJid=e.string();break}case 2:{s.fromMe=e.bool();break}case 3:{s.id=e.string();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageKey)return e;var a=new p.proto.MessageKey;return e.remoteJid!=null&&(a.remoteJid=String(e.remoteJid)),e.fromMe!=null&&(a.fromMe=!!e.fromMe),e.id!=null&&(a.id=String(e.id)),e.participant!=null&&(a.participant=String(e.participant)),a},t.toObject=function(e,a){a||(a={});var A={};return e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,a.oneofs&&(A._remoteJid="remoteJid")),e.fromMe!=null&&e.hasOwnProperty("fromMe")&&(A.fromMe=e.fromMe,a.oneofs&&(A._fromMe="fromMe")),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageKey"},t})(),n.MessageSecretMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=e.sfixed32();break}case 2:{s.encIv=e.bytes();break}case 3:{s.encPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MessageSecretMessage)return e;var a=new p.proto.MessageSecretMessage;return e.version!=null&&(a.version=e.version|0),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),a},t.toObject=function(e,a){a||(a={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=a.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):a.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,a.oneofs&&(A._encIv="encIv")),e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=a.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,a.oneofs&&(A._encPayload="encPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageSecretMessage"},t})(),n.Money=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.value=e.int64();break}case 2:{s.offset=e.uint32();break}case 3:{s.currencyCode=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Money)return e;var a=new p.proto.Money;return e.value!=null&&(l.Long?(a.value=l.Long.fromValue(e.value)).unsigned=!1:typeof e.value=="string"?a.value=parseInt(e.value,10):typeof e.value=="number"?a.value=e.value:typeof e.value=="object"&&(a.value=new l.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),e.offset!=null&&(a.offset=e.offset>>>0),e.currencyCode!=null&&(a.currencyCode=String(e.currencyCode)),a},t.toObject=function(e,a){a||(a={});var A={};return e.value!=null&&e.hasOwnProperty("value")&&(typeof e.value=="number"?A.value=a.longs===String?String(e.value):e.value:A.value=a.longs===String?ge(e.value):a.longs===Number?ce(e.value):e.value,a.oneofs&&(A._value="value")),e.offset!=null&&e.hasOwnProperty("offset")&&(A.offset=e.offset,a.oneofs&&(A._offset="offset")),e.currencyCode!=null&&e.hasOwnProperty("currencyCode")&&(A.currencyCode=e.currencyCode,a.oneofs&&(A._currencyCode="currencyCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Money"},t})(),n.MsgOpaqueData=(function(){function t(i){if(this.pollOptions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.body=e.string();break}case 3:{s.caption=e.string();break}case 5:{s.lng=e.double();break}case 6:{s.isLive=e.bool();break}case 7:{s.lat=e.double();break}case 8:{s.paymentAmount1000=e.int32();break}case 9:{s.paymentNoteMsgBody=e.string();break}case 11:{s.matchedText=e.string();break}case 12:{s.title=e.string();break}case 13:{s.description=e.string();break}case 14:{s.futureproofBuffer=e.bytes();break}case 15:{s.clientUrl=e.string();break}case 16:{s.loc=e.string();break}case 17:{s.pollName=e.string();break}case 18:{s.pollOptions&&s.pollOptions.length||(s.pollOptions=[]),s.pollOptions.push(p.proto.MsgOpaqueData.PollOption.decode(e,e.uint32()));break}case 20:{s.pollSelectableOptionsCount=e.uint32();break}case 21:{s.messageSecret=e.bytes();break}case 51:{s.originalSelfAuthor=e.string();break}case 22:{s.senderTimestampMs=e.int64();break}case 23:{s.pollUpdateParentKey=e.string();break}case 24:{s.encPollVote=p.proto.PollEncValue.decode(e,e.uint32());break}case 28:{s.isSentCagPollCreation=e.bool();break}case 42:{s.pollContentType=e.int32();break}case 46:{s.pollType=e.int32();break}case 47:{s.correctOptionIndex=e.int32();break}case 41:{s.pollVotesSnapshot=p.proto.MsgOpaqueData.PollVotesSnapshot.decode(e,e.uint32());break}case 25:{s.encReactionTargetMessageKey=e.string();break}case 26:{s.encReactionEncPayload=e.bytes();break}case 27:{s.encReactionEncIv=e.bytes();break}case 29:{s.botMessageSecret=e.bytes();break}case 30:{s.targetMessageKey=e.string();break}case 31:{s.encPayload=e.bytes();break}case 32:{s.encIv=e.bytes();break}case 33:{s.eventName=e.string();break}case 34:{s.isEventCanceled=e.bool();break}case 35:{s.eventDescription=e.string();break}case 36:{s.eventJoinLink=e.string();break}case 37:{s.eventStartTime=e.int64();break}case 38:{s.eventLocation=p.proto.MsgOpaqueData.EventLocation.decode(e,e.uint32());break}case 40:{s.eventEndTime=e.int64();break}case 44:{s.eventIsScheduledCall=e.bool();break}case 45:{s.eventExtraGuestsAllowed=e.bool();break}case 43:{s.plainProtobufBytes=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MsgOpaqueData)return e;var a=new p.proto.MsgOpaqueData;if(e.body!=null&&(a.body=String(e.body)),e.caption!=null&&(a.caption=String(e.caption)),e.lng!=null&&(a.lng=Number(e.lng)),e.isLive!=null&&(a.isLive=!!e.isLive),e.lat!=null&&(a.lat=Number(e.lat)),e.paymentAmount1000!=null&&(a.paymentAmount1000=e.paymentAmount1000|0),e.paymentNoteMsgBody!=null&&(a.paymentNoteMsgBody=String(e.paymentNoteMsgBody)),e.matchedText!=null&&(a.matchedText=String(e.matchedText)),e.title!=null&&(a.title=String(e.title)),e.description!=null&&(a.description=String(e.description)),e.futureproofBuffer!=null&&(typeof e.futureproofBuffer=="string"?l.base64.decode(e.futureproofBuffer,a.futureproofBuffer=l.newBuffer(l.base64.length(e.futureproofBuffer)),0):e.futureproofBuffer.length>=0&&(a.futureproofBuffer=e.futureproofBuffer)),e.clientUrl!=null&&(a.clientUrl=String(e.clientUrl)),e.loc!=null&&(a.loc=String(e.loc)),e.pollName!=null&&(a.pollName=String(e.pollName)),e.pollOptions){if(!Array.isArray(e.pollOptions))throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected");a.pollOptions=[];for(var A=0;A>>0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),e.originalSelfAuthor!=null&&(a.originalSelfAuthor=String(e.originalSelfAuthor)),e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.pollUpdateParentKey!=null&&(a.pollUpdateParentKey=String(e.pollUpdateParentKey)),e.encPollVote!=null){if(typeof e.encPollVote!="object")throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected");a.encPollVote=p.proto.PollEncValue.fromObject(e.encPollVote)}switch(e.isSentCagPollCreation!=null&&(a.isSentCagPollCreation=!!e.isSentCagPollCreation),e.pollContentType){default:if(typeof e.pollContentType=="number"){a.pollContentType=e.pollContentType;break}break;case"UNKNOWN":case 0:a.pollContentType=0;break;case"TEXT":case 1:a.pollContentType=1;break;case"IMAGE":case 2:a.pollContentType=2;break}switch(e.pollType){default:if(typeof e.pollType=="number"){a.pollType=e.pollType;break}break;case"POLL":case 0:a.pollType=0;break;case"QUIZ":case 1:a.pollType=1;break}if(e.correctOptionIndex!=null&&(a.correctOptionIndex=e.correctOptionIndex|0),e.pollVotesSnapshot!=null){if(typeof e.pollVotesSnapshot!="object")throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected");a.pollVotesSnapshot=p.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(e.pollVotesSnapshot)}if(e.encReactionTargetMessageKey!=null&&(a.encReactionTargetMessageKey=String(e.encReactionTargetMessageKey)),e.encReactionEncPayload!=null&&(typeof e.encReactionEncPayload=="string"?l.base64.decode(e.encReactionEncPayload,a.encReactionEncPayload=l.newBuffer(l.base64.length(e.encReactionEncPayload)),0):e.encReactionEncPayload.length>=0&&(a.encReactionEncPayload=e.encReactionEncPayload)),e.encReactionEncIv!=null&&(typeof e.encReactionEncIv=="string"?l.base64.decode(e.encReactionEncIv,a.encReactionEncIv=l.newBuffer(l.base64.length(e.encReactionEncIv)),0):e.encReactionEncIv.length>=0&&(a.encReactionEncIv=e.encReactionEncIv)),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,a.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(a.botMessageSecret=e.botMessageSecret)),e.targetMessageKey!=null&&(a.targetMessageKey=String(e.targetMessageKey)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),e.eventName!=null&&(a.eventName=String(e.eventName)),e.isEventCanceled!=null&&(a.isEventCanceled=!!e.isEventCanceled),e.eventDescription!=null&&(a.eventDescription=String(e.eventDescription)),e.eventJoinLink!=null&&(a.eventJoinLink=String(e.eventJoinLink)),e.eventStartTime!=null&&(l.Long?(a.eventStartTime=l.Long.fromValue(e.eventStartTime)).unsigned=!1:typeof e.eventStartTime=="string"?a.eventStartTime=parseInt(e.eventStartTime,10):typeof e.eventStartTime=="number"?a.eventStartTime=e.eventStartTime:typeof e.eventStartTime=="object"&&(a.eventStartTime=new l.LongBits(e.eventStartTime.low>>>0,e.eventStartTime.high>>>0).toNumber())),e.eventLocation!=null){if(typeof e.eventLocation!="object")throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected");a.eventLocation=p.proto.MsgOpaqueData.EventLocation.fromObject(e.eventLocation)}return e.eventEndTime!=null&&(l.Long?(a.eventEndTime=l.Long.fromValue(e.eventEndTime)).unsigned=!1:typeof e.eventEndTime=="string"?a.eventEndTime=parseInt(e.eventEndTime,10):typeof e.eventEndTime=="number"?a.eventEndTime=e.eventEndTime:typeof e.eventEndTime=="object"&&(a.eventEndTime=new l.LongBits(e.eventEndTime.low>>>0,e.eventEndTime.high>>>0).toNumber())),e.eventIsScheduledCall!=null&&(a.eventIsScheduledCall=!!e.eventIsScheduledCall),e.eventExtraGuestsAllowed!=null&&(a.eventExtraGuestsAllowed=!!e.eventExtraGuestsAllowed),e.plainProtobufBytes!=null&&(typeof e.plainProtobufBytes=="string"?l.base64.decode(e.plainProtobufBytes,a.plainProtobufBytes=l.newBuffer(l.base64.length(e.plainProtobufBytes)),0):e.plainProtobufBytes.length>=0&&(a.plainProtobufBytes=e.plainProtobufBytes)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.pollOptions=[]),e.body!=null&&e.hasOwnProperty("body")&&(A.body=e.body,a.oneofs&&(A._body="body")),e.caption!=null&&e.hasOwnProperty("caption")&&(A.caption=e.caption,a.oneofs&&(A._caption="caption")),e.lng!=null&&e.hasOwnProperty("lng")&&(A.lng=a.json&&!isFinite(e.lng)?String(e.lng):e.lng,a.oneofs&&(A._lng="lng")),e.isLive!=null&&e.hasOwnProperty("isLive")&&(A.isLive=e.isLive,a.oneofs&&(A._isLive="isLive")),e.lat!=null&&e.hasOwnProperty("lat")&&(A.lat=a.json&&!isFinite(e.lat)?String(e.lat):e.lat,a.oneofs&&(A._lat="lat")),e.paymentAmount1000!=null&&e.hasOwnProperty("paymentAmount1000")&&(A.paymentAmount1000=e.paymentAmount1000,a.oneofs&&(A._paymentAmount1000="paymentAmount1000")),e.paymentNoteMsgBody!=null&&e.hasOwnProperty("paymentNoteMsgBody")&&(A.paymentNoteMsgBody=e.paymentNoteMsgBody,a.oneofs&&(A._paymentNoteMsgBody="paymentNoteMsgBody")),e.matchedText!=null&&e.hasOwnProperty("matchedText")&&(A.matchedText=e.matchedText,a.oneofs&&(A._matchedText="matchedText")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.description!=null&&e.hasOwnProperty("description")&&(A.description=e.description,a.oneofs&&(A._description="description")),e.futureproofBuffer!=null&&e.hasOwnProperty("futureproofBuffer")&&(A.futureproofBuffer=a.bytes===String?l.base64.encode(e.futureproofBuffer,0,e.futureproofBuffer.length):a.bytes===Array?Array.prototype.slice.call(e.futureproofBuffer):e.futureproofBuffer,a.oneofs&&(A._futureproofBuffer="futureproofBuffer")),e.clientUrl!=null&&e.hasOwnProperty("clientUrl")&&(A.clientUrl=e.clientUrl,a.oneofs&&(A._clientUrl="clientUrl")),e.loc!=null&&e.hasOwnProperty("loc")&&(A.loc=e.loc,a.oneofs&&(A._loc="loc")),e.pollName!=null&&e.hasOwnProperty("pollName")&&(A.pollName=e.pollName,a.oneofs&&(A._pollName="pollName")),e.pollOptions&&e.pollOptions.length){A.pollOptions=[];for(var r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.jpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.EventLocation)return A;var r=new p.proto.MsgOpaqueData.EventLocation;return A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),r},i.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.EventLocation"},i})(),t.PollContentType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="TEXT"]=1,e[i[2]="IMAGE"]=2,e})(),t.PollOption=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.hash=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.PollOption)return A;var r=new p.proto.MsgOpaqueData.PollOption;return A.name!=null&&(r.name=String(A.name)),A.hash!=null&&(r.hash=String(A.hash)),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.hash!=null&&A.hasOwnProperty("hash")&&(s.hash=A.hash,r.oneofs&&(s._hash="hash")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollOption"},i})(),t.PollType=(function(){let i={},e=Object.create(i);return e[i[0]="POLL"]=0,e[i[1]="QUIZ"]=1,e})(),t.PollVoteSnapshot=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.option=p.proto.MsgOpaqueData.PollOption.decode(A,A.uint32());break}case 2:{c.optionVoteCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.PollVoteSnapshot)return A;var r=new p.proto.MsgOpaqueData.PollVoteSnapshot;if(A.option!=null){if(typeof A.option!="object")throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected");r.option=p.proto.MsgOpaqueData.PollOption.fromObject(A.option)}return A.optionVoteCount!=null&&(r.optionVoteCount=A.optionVoteCount|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.option!=null&&A.hasOwnProperty("option")&&(s.option=p.proto.MsgOpaqueData.PollOption.toObject(A.option,r),r.oneofs&&(s._option="option")),A.optionVoteCount!=null&&A.hasOwnProperty("optionVoteCount")&&(s.optionVoteCount=A.optionVoteCount,r.oneofs&&(s._optionVoteCount="optionVoteCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollVoteSnapshot"},i})(),t.PollVotesSnapshot=(function(){function i(e){if(this.pollVotes=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.pollVotes&&g.pollVotes.length||(g.pollVotes=[]),g.pollVotes.push(p.proto.MsgOpaqueData.PollVoteSnapshot.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.MsgOpaqueData.PollVotesSnapshot)return a;var A=new p.proto.MsgOpaqueData.PollVotesSnapshot;if(a.pollVotes){if(!Array.isArray(a.pollVotes))throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected");A.pollVotes=[];for(var r=0;r>>3){case 1:{s.currentMsg=p.proto.MsgOpaqueData.decode(e,e.uint32());break}case 2:{s.quotedMsg=p.proto.MsgOpaqueData.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.MsgRowOpaqueData)return e;var a=new p.proto.MsgRowOpaqueData;if(e.currentMsg!=null){if(typeof e.currentMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected");a.currentMsg=p.proto.MsgOpaqueData.fromObject(e.currentMsg)}if(e.quotedMsg!=null){if(typeof e.quotedMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected");a.quotedMsg=p.proto.MsgOpaqueData.fromObject(e.quotedMsg)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.currentMsg!=null&&e.hasOwnProperty("currentMsg")&&(A.currentMsg=p.proto.MsgOpaqueData.toObject(e.currentMsg,a),a.oneofs&&(A._currentMsg="currentMsg")),e.quotedMsg!=null&&e.hasOwnProperty("quotedMsg")&&(A.quotedMsg=p.proto.MsgOpaqueData.toObject(e.quotedMsg,a),a.oneofs&&(A._quotedMsg="quotedMsg")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MsgRowOpaqueData"},t})(),n.MutationProps=(function(){let t={},o=Object.create(t);return o[t[2]="STAR_ACTION"]=2,o[t[3]="CONTACT_ACTION"]=3,o[t[4]="MUTE_ACTION"]=4,o[t[5]="PIN_ACTION"]=5,o[t[6]="SECURITY_NOTIFICATION_SETTING"]=6,o[t[7]="PUSH_NAME_SETTING"]=7,o[t[8]="QUICK_REPLY_ACTION"]=8,o[t[11]="RECENT_EMOJI_WEIGHTS_ACTION"]=11,o[t[13]="LABEL_MESSAGE_ACTION"]=13,o[t[14]="LABEL_EDIT_ACTION"]=14,o[t[15]="LABEL_ASSOCIATION_ACTION"]=15,o[t[16]="LOCALE_SETTING"]=16,o[t[17]="ARCHIVE_CHAT_ACTION"]=17,o[t[18]="DELETE_MESSAGE_FOR_ME_ACTION"]=18,o[t[19]="KEY_EXPIRATION"]=19,o[t[20]="MARK_CHAT_AS_READ_ACTION"]=20,o[t[21]="CLEAR_CHAT_ACTION"]=21,o[t[22]="DELETE_CHAT_ACTION"]=22,o[t[23]="UNARCHIVE_CHATS_SETTING"]=23,o[t[24]="PRIMARY_FEATURE"]=24,o[t[26]="ANDROID_UNSUPPORTED_ACTIONS"]=26,o[t[27]="AGENT_ACTION"]=27,o[t[28]="SUBSCRIPTION_ACTION"]=28,o[t[29]="USER_STATUS_MUTE_ACTION"]=29,o[t[30]="TIME_FORMAT_ACTION"]=30,o[t[31]="NUX_ACTION"]=31,o[t[32]="PRIMARY_VERSION_ACTION"]=32,o[t[33]="STICKER_ACTION"]=33,o[t[34]="REMOVE_RECENT_STICKER_ACTION"]=34,o[t[35]="CHAT_ASSIGNMENT"]=35,o[t[36]="CHAT_ASSIGNMENT_OPENED_STATUS"]=36,o[t[37]="PN_FOR_LID_CHAT_ACTION"]=37,o[t[38]="MARKETING_MESSAGE_ACTION"]=38,o[t[39]="MARKETING_MESSAGE_BROADCAST_ACTION"]=39,o[t[40]="EXTERNAL_WEB_BETA_ACTION"]=40,o[t[41]="PRIVACY_SETTING_RELAY_ALL_CALLS"]=41,o[t[42]="CALL_LOG_ACTION"]=42,o[t[43]="UGC_BOT"]=43,o[t[44]="STATUS_PRIVACY"]=44,o[t[45]="BOT_WELCOME_REQUEST_ACTION"]=45,o[t[46]="DELETE_INDIVIDUAL_CALL_LOG"]=46,o[t[47]="LABEL_REORDERING_ACTION"]=47,o[t[48]="PAYMENT_INFO_ACTION"]=48,o[t[49]="CUSTOM_PAYMENT_METHODS_ACTION"]=49,o[t[50]="LOCK_CHAT_ACTION"]=50,o[t[51]="CHAT_LOCK_SETTINGS"]=51,o[t[52]="WAMO_USER_IDENTIFIER_ACTION"]=52,o[t[53]="PRIVACY_SETTING_DISABLE_LINK_PREVIEWS_ACTION"]=53,o[t[54]="DEVICE_CAPABILITIES"]=54,o[t[55]="NOTE_EDIT_ACTION"]=55,o[t[56]="FAVORITES_ACTION"]=56,o[t[57]="MERCHANT_PAYMENT_PARTNER_ACTION"]=57,o[t[58]="WAFFLE_ACCOUNT_LINK_STATE_ACTION"]=58,o[t[59]="USERNAME_CHAT_START_MODE"]=59,o[t[60]="NOTIFICATION_ACTIVITY_SETTING_ACTION"]=60,o[t[61]="LID_CONTACT_ACTION"]=61,o[t[62]="CTWA_PER_CUSTOMER_DATA_SHARING_ACTION"]=62,o[t[63]="PAYMENT_TOS_ACTION"]=63,o[t[64]="PRIVACY_SETTING_CHANNELS_PERSONALISED_RECOMMENDATION_ACTION"]=64,o[t[65]="BUSINESS_BROADCAST_ASSOCIATION_ACTION"]=65,o[t[66]="DETECTED_OUTCOMES_STATUS_ACTION"]=66,o[t[68]="MAIBA_AI_FEATURES_CONTROL_ACTION"]=68,o[t[69]="BUSINESS_BROADCAST_LIST_ACTION"]=69,o[t[70]="MUSIC_USER_ID_ACTION"]=70,o[t[71]="STATUS_POST_OPT_IN_NOTIFICATION_PREFERENCES_ACTION"]=71,o[t[72]="AVATAR_UPDATED_ACTION"]=72,o[t[73]="GALAXY_FLOW_ACTION"]=73,o[t[74]="PRIVATE_PROCESSING_SETTING_ACTION"]=74,o[t[75]="NEWSLETTER_SAVED_INTERESTS_ACTION"]=75,o[t[76]="AI_THREAD_RENAME_ACTION"]=76,o[t[77]="INTERACTIVE_MESSAGE_ACTION"]=77,o[t[10001]="SHARE_OWN_PN"]=10001,o[t[10002]="BUSINESS_BROADCAST_ACTION"]=10002,o})(),n.NoiseCertificate=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.NoiseCertificate)return e;var a=new p.proto.NoiseCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NoiseCertificate"},t.Details=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serial=A.uint32();break}case 2:{c.issuer=A.string();break}case 3:{c.expires=A.uint64();break}case 4:{c.subject=A.string();break}case 5:{c.key=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.NoiseCertificate.Details)return A;var r=new p.proto.NoiseCertificate.Details;return A.serial!=null&&(r.serial=A.serial>>>0),A.issuer!=null&&(r.issuer=String(A.issuer)),A.expires!=null&&(l.Long?(r.expires=l.Long.fromValue(A.expires)).unsigned=!0:typeof A.expires=="string"?r.expires=parseInt(A.expires,10):typeof A.expires=="number"?r.expires=A.expires:typeof A.expires=="object"&&(r.expires=new l.LongBits(A.expires.low>>>0,A.expires.high>>>0).toNumber(!0))),A.subject!=null&&(r.subject=String(A.subject)),A.key!=null&&(typeof A.key=="string"?l.base64.decode(A.key,r.key=l.newBuffer(l.base64.length(A.key)),0):A.key.length>=0&&(r.key=A.key)),r},i.toObject=function(A,r){r||(r={});var s={};return A.serial!=null&&A.hasOwnProperty("serial")&&(s.serial=A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.expires!=null&&A.hasOwnProperty("expires")&&(typeof A.expires=="number"?s.expires=r.longs===String?String(A.expires):A.expires:s.expires=r.longs===String?ge(A.expires,!0):r.longs===Number?ce(A.expires,!0):A.expires,r.oneofs&&(s._expires="expires")),A.subject!=null&&A.hasOwnProperty("subject")&&(s.subject=A.subject,r.oneofs&&(s._subject="subject")),A.key!=null&&A.hasOwnProperty("key")&&(s.key=r.bytes===String?l.base64.encode(A.key,0,A.key.length):r.bytes===Array?Array.prototype.slice.call(A.key):A.key,r.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.NoiseCertificate.Details"},i})(),t})(),n.NotificationMessageInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.NotificationMessageInfo)return e;var a=new p.proto.NotificationMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.NotificationMessageInfo.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.NotificationMessageInfo.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return e.messageTimestamp!=null&&(l.Long?(a.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?a.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?a.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(a.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.participant!=null&&(a.participant=String(e.participant)),a},t.toObject=function(e,a){a||(a={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),e.messageTimestamp!=null&&e.hasOwnProperty("messageTimestamp")&&(typeof e.messageTimestamp=="number"?A.messageTimestamp=a.longs===String?String(e.messageTimestamp):e.messageTimestamp:A.messageTimestamp=a.longs===String?ge(e.messageTimestamp,!0):a.longs===Number?ce(e.messageTimestamp,!0):e.messageTimestamp,a.oneofs&&(A._messageTimestamp="messageTimestamp")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationMessageInfo"},t})(),n.NotificationSettings=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageVibrate=e.string();break}case 2:{s.messagePopup=e.string();break}case 3:{s.messageLight=e.string();break}case 4:{s.lowPriorityNotifications=e.bool();break}case 5:{s.reactionsMuted=e.bool();break}case 6:{s.callVibrate=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.NotificationSettings)return e;var a=new p.proto.NotificationSettings;return e.messageVibrate!=null&&(a.messageVibrate=String(e.messageVibrate)),e.messagePopup!=null&&(a.messagePopup=String(e.messagePopup)),e.messageLight!=null&&(a.messageLight=String(e.messageLight)),e.lowPriorityNotifications!=null&&(a.lowPriorityNotifications=!!e.lowPriorityNotifications),e.reactionsMuted!=null&&(a.reactionsMuted=!!e.reactionsMuted),e.callVibrate!=null&&(a.callVibrate=String(e.callVibrate)),a},t.toObject=function(e,a){a||(a={});var A={};return e.messageVibrate!=null&&e.hasOwnProperty("messageVibrate")&&(A.messageVibrate=e.messageVibrate,a.oneofs&&(A._messageVibrate="messageVibrate")),e.messagePopup!=null&&e.hasOwnProperty("messagePopup")&&(A.messagePopup=e.messagePopup,a.oneofs&&(A._messagePopup="messagePopup")),e.messageLight!=null&&e.hasOwnProperty("messageLight")&&(A.messageLight=e.messageLight,a.oneofs&&(A._messageLight="messageLight")),e.lowPriorityNotifications!=null&&e.hasOwnProperty("lowPriorityNotifications")&&(A.lowPriorityNotifications=e.lowPriorityNotifications,a.oneofs&&(A._lowPriorityNotifications="lowPriorityNotifications")),e.reactionsMuted!=null&&e.hasOwnProperty("reactionsMuted")&&(A.reactionsMuted=e.reactionsMuted,a.oneofs&&(A._reactionsMuted="reactionsMuted")),e.callVibrate!=null&&e.hasOwnProperty("callVibrate")&&(A.callVibrate=e.callVibrate,a.oneofs&&(A._callVibrate="callVibrate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationSettings"},t})(),n.PairingRequest=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.companionPublicKey=e.bytes();break}case 2:{s.companionIdentityKey=e.bytes();break}case 3:{s.advSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PairingRequest)return e;var a=new p.proto.PairingRequest;return e.companionPublicKey!=null&&(typeof e.companionPublicKey=="string"?l.base64.decode(e.companionPublicKey,a.companionPublicKey=l.newBuffer(l.base64.length(e.companionPublicKey)),0):e.companionPublicKey.length>=0&&(a.companionPublicKey=e.companionPublicKey)),e.companionIdentityKey!=null&&(typeof e.companionIdentityKey=="string"?l.base64.decode(e.companionIdentityKey,a.companionIdentityKey=l.newBuffer(l.base64.length(e.companionIdentityKey)),0):e.companionIdentityKey.length>=0&&(a.companionIdentityKey=e.companionIdentityKey)),e.advSecret!=null&&(typeof e.advSecret=="string"?l.base64.decode(e.advSecret,a.advSecret=l.newBuffer(l.base64.length(e.advSecret)),0):e.advSecret.length>=0&&(a.advSecret=e.advSecret)),a},t.toObject=function(e,a){a||(a={});var A={};return e.companionPublicKey!=null&&e.hasOwnProperty("companionPublicKey")&&(A.companionPublicKey=a.bytes===String?l.base64.encode(e.companionPublicKey,0,e.companionPublicKey.length):a.bytes===Array?Array.prototype.slice.call(e.companionPublicKey):e.companionPublicKey,a.oneofs&&(A._companionPublicKey="companionPublicKey")),e.companionIdentityKey!=null&&e.hasOwnProperty("companionIdentityKey")&&(A.companionIdentityKey=a.bytes===String?l.base64.encode(e.companionIdentityKey,0,e.companionIdentityKey.length):a.bytes===Array?Array.prototype.slice.call(e.companionIdentityKey):e.companionIdentityKey,a.oneofs&&(A._companionIdentityKey="companionIdentityKey")),e.advSecret!=null&&e.hasOwnProperty("advSecret")&&(A.advSecret=a.bytes===String?l.base64.encode(e.advSecret,0,e.advSecret.length):a.bytes===Array?Array.prototype.slice.call(e.advSecret):e.advSecret,a.oneofs&&(A._advSecret="advSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PairingRequest"},t})(),n.PastParticipant=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.leaveReason=e.int32();break}case 3:{s.leaveTs=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PastParticipant)return e;var a=new p.proto.PastParticipant;switch(e.userJid!=null&&(a.userJid=String(e.userJid)),e.leaveReason){default:if(typeof e.leaveReason=="number"){a.leaveReason=e.leaveReason;break}break;case"LEFT":case 0:a.leaveReason=0;break;case"REMOVED":case 1:a.leaveReason=1;break}return e.leaveTs!=null&&(l.Long?(a.leaveTs=l.Long.fromValue(e.leaveTs)).unsigned=!0:typeof e.leaveTs=="string"?a.leaveTs=parseInt(e.leaveTs,10):typeof e.leaveTs=="number"?a.leaveTs=e.leaveTs:typeof e.leaveTs=="object"&&(a.leaveTs=new l.LongBits(e.leaveTs.low>>>0,e.leaveTs.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid,a.oneofs&&(A._userJid="userJid")),e.leaveReason!=null&&e.hasOwnProperty("leaveReason")&&(A.leaveReason=a.enums===String?p.proto.PastParticipant.LeaveReason[e.leaveReason]===void 0?e.leaveReason:p.proto.PastParticipant.LeaveReason[e.leaveReason]:e.leaveReason,a.oneofs&&(A._leaveReason="leaveReason")),e.leaveTs!=null&&e.hasOwnProperty("leaveTs")&&(typeof e.leaveTs=="number"?A.leaveTs=a.longs===String?String(e.leaveTs):e.leaveTs:A.leaveTs=a.longs===String?ge(e.leaveTs,!0):a.longs===Number?ce(e.leaveTs,!0):e.leaveTs,a.oneofs&&(A._leaveTs="leaveTs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PastParticipant"},t.LeaveReason=(function(){let i={},e=Object.create(i);return e[i[0]="LEFT"]=0,e[i[1]="REMOVED"]=1,e})(),t})(),n.PastParticipants=(function(){function t(i){if(this.pastParticipants=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.groupJid=e.string();break}case 2:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(p.proto.PastParticipant.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PastParticipants)return e;var a=new p.proto.PastParticipants;if(e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.pastParticipants){if(!Array.isArray(e.pastParticipants))throw TypeError(".proto.PastParticipants.pastParticipants: array expected");a.pastParticipants=[];for(var A=0;A>>3){case 1:{s.currentLthash=e.bytes();break}case 2:{s.newLthash=e.bytes();break}case 3:{s.patchVersion=e.bytes();break}case 4:{s.collectionName=e.bytes();break}case 5:{s.firstFourBytesFromAHashOfSnapshotMacKey=e.bytes();break}case 6:{s.newLthashSubtract=e.bytes();break}case 7:{s.numberAdd=e.int32();break}case 8:{s.numberRemove=e.int32();break}case 9:{s.numberOverride=e.int32();break}case 10:{s.senderPlatform=e.int32();break}case 11:{s.isSenderPrimary=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PatchDebugData)return e;var a=new p.proto.PatchDebugData;switch(e.currentLthash!=null&&(typeof e.currentLthash=="string"?l.base64.decode(e.currentLthash,a.currentLthash=l.newBuffer(l.base64.length(e.currentLthash)),0):e.currentLthash.length>=0&&(a.currentLthash=e.currentLthash)),e.newLthash!=null&&(typeof e.newLthash=="string"?l.base64.decode(e.newLthash,a.newLthash=l.newBuffer(l.base64.length(e.newLthash)),0):e.newLthash.length>=0&&(a.newLthash=e.newLthash)),e.patchVersion!=null&&(typeof e.patchVersion=="string"?l.base64.decode(e.patchVersion,a.patchVersion=l.newBuffer(l.base64.length(e.patchVersion)),0):e.patchVersion.length>=0&&(a.patchVersion=e.patchVersion)),e.collectionName!=null&&(typeof e.collectionName=="string"?l.base64.decode(e.collectionName,a.collectionName=l.newBuffer(l.base64.length(e.collectionName)),0):e.collectionName.length>=0&&(a.collectionName=e.collectionName)),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&(typeof e.firstFourBytesFromAHashOfSnapshotMacKey=="string"?l.base64.decode(e.firstFourBytesFromAHashOfSnapshotMacKey,a.firstFourBytesFromAHashOfSnapshotMacKey=l.newBuffer(l.base64.length(e.firstFourBytesFromAHashOfSnapshotMacKey)),0):e.firstFourBytesFromAHashOfSnapshotMacKey.length>=0&&(a.firstFourBytesFromAHashOfSnapshotMacKey=e.firstFourBytesFromAHashOfSnapshotMacKey)),e.newLthashSubtract!=null&&(typeof e.newLthashSubtract=="string"?l.base64.decode(e.newLthashSubtract,a.newLthashSubtract=l.newBuffer(l.base64.length(e.newLthashSubtract)),0):e.newLthashSubtract.length>=0&&(a.newLthashSubtract=e.newLthashSubtract)),e.numberAdd!=null&&(a.numberAdd=e.numberAdd|0),e.numberRemove!=null&&(a.numberRemove=e.numberRemove|0),e.numberOverride!=null&&(a.numberOverride=e.numberOverride|0),e.senderPlatform){default:if(typeof e.senderPlatform=="number"){a.senderPlatform=e.senderPlatform;break}break;case"ANDROID":case 0:a.senderPlatform=0;break;case"SMBA":case 1:a.senderPlatform=1;break;case"IPHONE":case 2:a.senderPlatform=2;break;case"SMBI":case 3:a.senderPlatform=3;break;case"WEB":case 4:a.senderPlatform=4;break;case"UWP":case 5:a.senderPlatform=5;break;case"DARWIN":case 6:a.senderPlatform=6;break;case"IPAD":case 7:a.senderPlatform=7;break;case"WEAROS":case 8:a.senderPlatform=8;break;case"WASG":case 9:a.senderPlatform=9;break;case"WEARM":case 10:a.senderPlatform=10;break;case"CAPI":case 11:a.senderPlatform=11;break}return e.isSenderPrimary!=null&&(a.isSenderPrimary=!!e.isSenderPrimary),a},t.toObject=function(e,a){a||(a={});var A={};return e.currentLthash!=null&&e.hasOwnProperty("currentLthash")&&(A.currentLthash=a.bytes===String?l.base64.encode(e.currentLthash,0,e.currentLthash.length):a.bytes===Array?Array.prototype.slice.call(e.currentLthash):e.currentLthash,a.oneofs&&(A._currentLthash="currentLthash")),e.newLthash!=null&&e.hasOwnProperty("newLthash")&&(A.newLthash=a.bytes===String?l.base64.encode(e.newLthash,0,e.newLthash.length):a.bytes===Array?Array.prototype.slice.call(e.newLthash):e.newLthash,a.oneofs&&(A._newLthash="newLthash")),e.patchVersion!=null&&e.hasOwnProperty("patchVersion")&&(A.patchVersion=a.bytes===String?l.base64.encode(e.patchVersion,0,e.patchVersion.length):a.bytes===Array?Array.prototype.slice.call(e.patchVersion):e.patchVersion,a.oneofs&&(A._patchVersion="patchVersion")),e.collectionName!=null&&e.hasOwnProperty("collectionName")&&(A.collectionName=a.bytes===String?l.base64.encode(e.collectionName,0,e.collectionName.length):a.bytes===Array?Array.prototype.slice.call(e.collectionName):e.collectionName,a.oneofs&&(A._collectionName="collectionName")),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&e.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")&&(A.firstFourBytesFromAHashOfSnapshotMacKey=a.bytes===String?l.base64.encode(e.firstFourBytesFromAHashOfSnapshotMacKey,0,e.firstFourBytesFromAHashOfSnapshotMacKey.length):a.bytes===Array?Array.prototype.slice.call(e.firstFourBytesFromAHashOfSnapshotMacKey):e.firstFourBytesFromAHashOfSnapshotMacKey,a.oneofs&&(A._firstFourBytesFromAHashOfSnapshotMacKey="firstFourBytesFromAHashOfSnapshotMacKey")),e.newLthashSubtract!=null&&e.hasOwnProperty("newLthashSubtract")&&(A.newLthashSubtract=a.bytes===String?l.base64.encode(e.newLthashSubtract,0,e.newLthashSubtract.length):a.bytes===Array?Array.prototype.slice.call(e.newLthashSubtract):e.newLthashSubtract,a.oneofs&&(A._newLthashSubtract="newLthashSubtract")),e.numberAdd!=null&&e.hasOwnProperty("numberAdd")&&(A.numberAdd=e.numberAdd,a.oneofs&&(A._numberAdd="numberAdd")),e.numberRemove!=null&&e.hasOwnProperty("numberRemove")&&(A.numberRemove=e.numberRemove,a.oneofs&&(A._numberRemove="numberRemove")),e.numberOverride!=null&&e.hasOwnProperty("numberOverride")&&(A.numberOverride=e.numberOverride,a.oneofs&&(A._numberOverride="numberOverride")),e.senderPlatform!=null&&e.hasOwnProperty("senderPlatform")&&(A.senderPlatform=a.enums===String?p.proto.PatchDebugData.Platform[e.senderPlatform]===void 0?e.senderPlatform:p.proto.PatchDebugData.Platform[e.senderPlatform]:e.senderPlatform,a.oneofs&&(A._senderPlatform="senderPlatform")),e.isSenderPrimary!=null&&e.hasOwnProperty("isSenderPrimary")&&(A.isSenderPrimary=e.isSenderPrimary,a.oneofs&&(A._isSenderPrimary="isSenderPrimary")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PatchDebugData"},t.Platform=(function(){let i={},e=Object.create(i);return e[i[0]="ANDROID"]=0,e[i[1]="SMBA"]=1,e[i[2]="IPHONE"]=2,e[i[3]="SMBI"]=3,e[i[4]="WEB"]=4,e[i[5]="UWP"]=5,e[i[6]="DARWIN"]=6,e[i[7]="IPAD"]=7,e[i[8]="WEAROS"]=8,e[i[9]="WASG"]=9,e[i[10]="WEARM"]=10,e[i[11]="CAPI"]=11,e})(),t})(),n.PaymentBackground=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.fileLength=e.uint64();break}case 3:{s.width=e.uint32();break}case 4:{s.height=e.uint32();break}case 5:{s.mimetype=e.string();break}case 6:{s.placeholderArgb=e.fixed32();break}case 7:{s.textArgb=e.fixed32();break}case 8:{s.subtextArgb=e.fixed32();break}case 9:{s.mediaData=p.proto.PaymentBackground.MediaData.decode(e,e.uint32());break}case 10:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PaymentBackground)return e;var a=new p.proto.PaymentBackground;if(e.id!=null&&(a.id=String(e.id)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.width!=null&&(a.width=e.width>>>0),e.height!=null&&(a.height=e.height>>>0),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.placeholderArgb!=null&&(a.placeholderArgb=e.placeholderArgb>>>0),e.textArgb!=null&&(a.textArgb=e.textArgb>>>0),e.subtextArgb!=null&&(a.subtextArgb=e.subtextArgb>>>0),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.PaymentBackground.mediaData: object expected");a.mediaData=p.proto.PaymentBackground.MediaData.fromObject(e.mediaData)}switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN":case 0:a.type=0;break;case"DEFAULT":case 1:a.type=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?ge(e.fileLength,!0):a.longs===Number?ce(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,a.oneofs&&(A._width="width")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,a.oneofs&&(A._height="height")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.placeholderArgb!=null&&e.hasOwnProperty("placeholderArgb")&&(A.placeholderArgb=e.placeholderArgb,a.oneofs&&(A._placeholderArgb="placeholderArgb")),e.textArgb!=null&&e.hasOwnProperty("textArgb")&&(A.textArgb=e.textArgb,a.oneofs&&(A._textArgb="textArgb")),e.subtextArgb!=null&&e.hasOwnProperty("subtextArgb")&&(A.subtextArgb=e.subtextArgb,a.oneofs&&(A._subtextArgb="subtextArgb")),e.mediaData!=null&&e.hasOwnProperty("mediaData")&&(A.mediaData=p.proto.PaymentBackground.MediaData.toObject(e.mediaData,a),a.oneofs&&(A._mediaData="mediaData")),e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.PaymentBackground.Type[e.type]===void 0?e.type:p.proto.PaymentBackground.Type[e.type]:e.type,a.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentBackground"},t.MediaData=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.mediaKey=A.bytes();break}case 2:{c.mediaKeyTimestamp=A.int64();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.PaymentBackground.MediaData)return A;var r=new p.proto.PaymentBackground.MediaData;return A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),r},i.toObject=function(A,r){r||(r={});var s={};return A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.PaymentBackground.MediaData"},i})(),t.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="DEFAULT"]=1,e})(),t})(),n.PaymentInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.currencyDeprecated=e.int32();break}case 2:{s.amount1000=e.uint64();break}case 3:{s.receiverJid=e.string();break}case 4:{s.status=e.int32();break}case 5:{s.transactionTimestamp=e.uint64();break}case 6:{s.requestMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 7:{s.expiryTimestamp=e.uint64();break}case 8:{s.futureproofed=e.bool();break}case 9:{s.currency=e.string();break}case 10:{s.txnStatus=e.int32();break}case 11:{s.useNoviFiatFormat=e.bool();break}case 12:{s.primaryAmount=p.proto.Money.decode(e,e.uint32());break}case 13:{s.exchangeAmount=p.proto.Money.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PaymentInfo)return e;var a=new p.proto.PaymentInfo;switch(e.currencyDeprecated){default:if(typeof e.currencyDeprecated=="number"){a.currencyDeprecated=e.currencyDeprecated;break}break;case"UNKNOWN_CURRENCY":case 0:a.currencyDeprecated=0;break;case"INR":case 1:a.currencyDeprecated=1;break}switch(e.amount1000!=null&&(l.Long?(a.amount1000=l.Long.fromValue(e.amount1000)).unsigned=!0:typeof e.amount1000=="string"?a.amount1000=parseInt(e.amount1000,10):typeof e.amount1000=="number"?a.amount1000=e.amount1000:typeof e.amount1000=="object"&&(a.amount1000=new l.LongBits(e.amount1000.low>>>0,e.amount1000.high>>>0).toNumber(!0))),e.receiverJid!=null&&(a.receiverJid=String(e.receiverJid)),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"UNKNOWN_STATUS":case 0:a.status=0;break;case"PROCESSING":case 1:a.status=1;break;case"SENT":case 2:a.status=2;break;case"NEED_TO_ACCEPT":case 3:a.status=3;break;case"COMPLETE":case 4:a.status=4;break;case"COULD_NOT_COMPLETE":case 5:a.status=5;break;case"REFUNDED":case 6:a.status=6;break;case"EXPIRED":case 7:a.status=7;break;case"REJECTED":case 8:a.status=8;break;case"CANCELLED":case 9:a.status=9;break;case"WAITING_FOR_PAYER":case 10:a.status=10;break;case"WAITING":case 11:a.status=11;break}if(e.transactionTimestamp!=null&&(l.Long?(a.transactionTimestamp=l.Long.fromValue(e.transactionTimestamp)).unsigned=!0:typeof e.transactionTimestamp=="string"?a.transactionTimestamp=parseInt(e.transactionTimestamp,10):typeof e.transactionTimestamp=="number"?a.transactionTimestamp=e.transactionTimestamp:typeof e.transactionTimestamp=="object"&&(a.transactionTimestamp=new l.LongBits(e.transactionTimestamp.low>>>0,e.transactionTimestamp.high>>>0).toNumber(!0))),e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected");a.requestMessageKey=p.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.expiryTimestamp!=null&&(l.Long?(a.expiryTimestamp=l.Long.fromValue(e.expiryTimestamp)).unsigned=!0:typeof e.expiryTimestamp=="string"?a.expiryTimestamp=parseInt(e.expiryTimestamp,10):typeof e.expiryTimestamp=="number"?a.expiryTimestamp=e.expiryTimestamp:typeof e.expiryTimestamp=="object"&&(a.expiryTimestamp=new l.LongBits(e.expiryTimestamp.low>>>0,e.expiryTimestamp.high>>>0).toNumber(!0))),e.futureproofed!=null&&(a.futureproofed=!!e.futureproofed),e.currency!=null&&(a.currency=String(e.currency)),e.txnStatus){default:if(typeof e.txnStatus=="number"){a.txnStatus=e.txnStatus;break}break;case"UNKNOWN":case 0:a.txnStatus=0;break;case"PENDING_SETUP":case 1:a.txnStatus=1;break;case"PENDING_RECEIVER_SETUP":case 2:a.txnStatus=2;break;case"INIT":case 3:a.txnStatus=3;break;case"SUCCESS":case 4:a.txnStatus=4;break;case"COMPLETED":case 5:a.txnStatus=5;break;case"FAILED":case 6:a.txnStatus=6;break;case"FAILED_RISK":case 7:a.txnStatus=7;break;case"FAILED_PROCESSING":case 8:a.txnStatus=8;break;case"FAILED_RECEIVER_PROCESSING":case 9:a.txnStatus=9;break;case"FAILED_DA":case 10:a.txnStatus=10;break;case"FAILED_DA_FINAL":case 11:a.txnStatus=11;break;case"REFUNDED_TXN":case 12:a.txnStatus=12;break;case"REFUND_FAILED":case 13:a.txnStatus=13;break;case"REFUND_FAILED_PROCESSING":case 14:a.txnStatus=14;break;case"REFUND_FAILED_DA":case 15:a.txnStatus=15;break;case"EXPIRED_TXN":case 16:a.txnStatus=16;break;case"AUTH_CANCELED":case 17:a.txnStatus=17;break;case"AUTH_CANCEL_FAILED_PROCESSING":case 18:a.txnStatus=18;break;case"AUTH_CANCEL_FAILED":case 19:a.txnStatus=19;break;case"COLLECT_INIT":case 20:a.txnStatus=20;break;case"COLLECT_SUCCESS":case 21:a.txnStatus=21;break;case"COLLECT_FAILED":case 22:a.txnStatus=22;break;case"COLLECT_FAILED_RISK":case 23:a.txnStatus=23;break;case"COLLECT_REJECTED":case 24:a.txnStatus=24;break;case"COLLECT_EXPIRED":case 25:a.txnStatus=25;break;case"COLLECT_CANCELED":case 26:a.txnStatus=26;break;case"COLLECT_CANCELLING":case 27:a.txnStatus=27;break;case"IN_REVIEW":case 28:a.txnStatus=28;break;case"REVERSAL_SUCCESS":case 29:a.txnStatus=29;break;case"REVERSAL_PENDING":case 30:a.txnStatus=30;break;case"REFUND_PENDING":case 31:a.txnStatus=31;break}if(e.useNoviFiatFormat!=null&&(a.useNoviFiatFormat=!!e.useNoviFiatFormat),e.primaryAmount!=null){if(typeof e.primaryAmount!="object")throw TypeError(".proto.PaymentInfo.primaryAmount: object expected");a.primaryAmount=p.proto.Money.fromObject(e.primaryAmount)}if(e.exchangeAmount!=null){if(typeof e.exchangeAmount!="object")throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected");a.exchangeAmount=p.proto.Money.fromObject(e.exchangeAmount)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.currencyDeprecated!=null&&e.hasOwnProperty("currencyDeprecated")&&(A.currencyDeprecated=a.enums===String?p.proto.PaymentInfo.Currency[e.currencyDeprecated]===void 0?e.currencyDeprecated:p.proto.PaymentInfo.Currency[e.currencyDeprecated]:e.currencyDeprecated,a.oneofs&&(A._currencyDeprecated="currencyDeprecated")),e.amount1000!=null&&e.hasOwnProperty("amount1000")&&(typeof e.amount1000=="number"?A.amount1000=a.longs===String?String(e.amount1000):e.amount1000:A.amount1000=a.longs===String?ge(e.amount1000,!0):a.longs===Number?ce(e.amount1000,!0):e.amount1000,a.oneofs&&(A._amount1000="amount1000")),e.receiverJid!=null&&e.hasOwnProperty("receiverJid")&&(A.receiverJid=e.receiverJid,a.oneofs&&(A._receiverJid="receiverJid")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=a.enums===String?p.proto.PaymentInfo.Status[e.status]===void 0?e.status:p.proto.PaymentInfo.Status[e.status]:e.status,a.oneofs&&(A._status="status")),e.transactionTimestamp!=null&&e.hasOwnProperty("transactionTimestamp")&&(typeof e.transactionTimestamp=="number"?A.transactionTimestamp=a.longs===String?String(e.transactionTimestamp):e.transactionTimestamp:A.transactionTimestamp=a.longs===String?ge(e.transactionTimestamp,!0):a.longs===Number?ce(e.transactionTimestamp,!0):e.transactionTimestamp,a.oneofs&&(A._transactionTimestamp="transactionTimestamp")),e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=p.proto.MessageKey.toObject(e.requestMessageKey,a),a.oneofs&&(A._requestMessageKey="requestMessageKey")),e.expiryTimestamp!=null&&e.hasOwnProperty("expiryTimestamp")&&(typeof e.expiryTimestamp=="number"?A.expiryTimestamp=a.longs===String?String(e.expiryTimestamp):e.expiryTimestamp:A.expiryTimestamp=a.longs===String?ge(e.expiryTimestamp,!0):a.longs===Number?ce(e.expiryTimestamp,!0):e.expiryTimestamp,a.oneofs&&(A._expiryTimestamp="expiryTimestamp")),e.futureproofed!=null&&e.hasOwnProperty("futureproofed")&&(A.futureproofed=e.futureproofed,a.oneofs&&(A._futureproofed="futureproofed")),e.currency!=null&&e.hasOwnProperty("currency")&&(A.currency=e.currency,a.oneofs&&(A._currency="currency")),e.txnStatus!=null&&e.hasOwnProperty("txnStatus")&&(A.txnStatus=a.enums===String?p.proto.PaymentInfo.TxnStatus[e.txnStatus]===void 0?e.txnStatus:p.proto.PaymentInfo.TxnStatus[e.txnStatus]:e.txnStatus,a.oneofs&&(A._txnStatus="txnStatus")),e.useNoviFiatFormat!=null&&e.hasOwnProperty("useNoviFiatFormat")&&(A.useNoviFiatFormat=e.useNoviFiatFormat,a.oneofs&&(A._useNoviFiatFormat="useNoviFiatFormat")),e.primaryAmount!=null&&e.hasOwnProperty("primaryAmount")&&(A.primaryAmount=p.proto.Money.toObject(e.primaryAmount,a),a.oneofs&&(A._primaryAmount="primaryAmount")),e.exchangeAmount!=null&&e.hasOwnProperty("exchangeAmount")&&(A.exchangeAmount=p.proto.Money.toObject(e.exchangeAmount,a),a.oneofs&&(A._exchangeAmount="exchangeAmount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentInfo"},t.Currency=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_CURRENCY"]=0,e[i[1]="INR"]=1,e})(),t.Status=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_STATUS"]=0,e[i[1]="PROCESSING"]=1,e[i[2]="SENT"]=2,e[i[3]="NEED_TO_ACCEPT"]=3,e[i[4]="COMPLETE"]=4,e[i[5]="COULD_NOT_COMPLETE"]=5,e[i[6]="REFUNDED"]=6,e[i[7]="EXPIRED"]=7,e[i[8]="REJECTED"]=8,e[i[9]="CANCELLED"]=9,e[i[10]="WAITING_FOR_PAYER"]=10,e[i[11]="WAITING"]=11,e})(),t.TxnStatus=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="PENDING_SETUP"]=1,e[i[2]="PENDING_RECEIVER_SETUP"]=2,e[i[3]="INIT"]=3,e[i[4]="SUCCESS"]=4,e[i[5]="COMPLETED"]=5,e[i[6]="FAILED"]=6,e[i[7]="FAILED_RISK"]=7,e[i[8]="FAILED_PROCESSING"]=8,e[i[9]="FAILED_RECEIVER_PROCESSING"]=9,e[i[10]="FAILED_DA"]=10,e[i[11]="FAILED_DA_FINAL"]=11,e[i[12]="REFUNDED_TXN"]=12,e[i[13]="REFUND_FAILED"]=13,e[i[14]="REFUND_FAILED_PROCESSING"]=14,e[i[15]="REFUND_FAILED_DA"]=15,e[i[16]="EXPIRED_TXN"]=16,e[i[17]="AUTH_CANCELED"]=17,e[i[18]="AUTH_CANCEL_FAILED_PROCESSING"]=18,e[i[19]="AUTH_CANCEL_FAILED"]=19,e[i[20]="COLLECT_INIT"]=20,e[i[21]="COLLECT_SUCCESS"]=21,e[i[22]="COLLECT_FAILED"]=22,e[i[23]="COLLECT_FAILED_RISK"]=23,e[i[24]="COLLECT_REJECTED"]=24,e[i[25]="COLLECT_EXPIRED"]=25,e[i[26]="COLLECT_CANCELED"]=26,e[i[27]="COLLECT_CANCELLING"]=27,e[i[28]="IN_REVIEW"]=28,e[i[29]="REVERSAL_SUCCESS"]=29,e[i[30]="REVERSAL_PENDING"]=30,e[i[31]="REFUND_PENDING"]=31,e})(),t})(),n.PhoneNumberToLIDMapping=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pnJid=e.string();break}case 2:{s.lidJid=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PhoneNumberToLIDMapping)return e;var a=new p.proto.PhoneNumberToLIDMapping;return e.pnJid!=null&&(a.pnJid=String(e.pnJid)),e.lidJid!=null&&(a.lidJid=String(e.lidJid)),a},t.toObject=function(e,a){a||(a={});var A={};return e.pnJid!=null&&e.hasOwnProperty("pnJid")&&(A.pnJid=e.pnJid,a.oneofs&&(A._pnJid="pnJid")),e.lidJid!=null&&e.hasOwnProperty("lidJid")&&(A.lidJid=e.lidJid,a.oneofs&&(A._lidJid="lidJid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhoneNumberToLIDMapping"},t})(),n.PhotoChange=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.oldPhoto=e.bytes();break}case 2:{s.newPhoto=e.bytes();break}case 3:{s.newPhotoId=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PhotoChange)return e;var a=new p.proto.PhotoChange;return e.oldPhoto!=null&&(typeof e.oldPhoto=="string"?l.base64.decode(e.oldPhoto,a.oldPhoto=l.newBuffer(l.base64.length(e.oldPhoto)),0):e.oldPhoto.length>=0&&(a.oldPhoto=e.oldPhoto)),e.newPhoto!=null&&(typeof e.newPhoto=="string"?l.base64.decode(e.newPhoto,a.newPhoto=l.newBuffer(l.base64.length(e.newPhoto)),0):e.newPhoto.length>=0&&(a.newPhoto=e.newPhoto)),e.newPhotoId!=null&&(a.newPhotoId=e.newPhotoId>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.oldPhoto!=null&&e.hasOwnProperty("oldPhoto")&&(A.oldPhoto=a.bytes===String?l.base64.encode(e.oldPhoto,0,e.oldPhoto.length):a.bytes===Array?Array.prototype.slice.call(e.oldPhoto):e.oldPhoto,a.oneofs&&(A._oldPhoto="oldPhoto")),e.newPhoto!=null&&e.hasOwnProperty("newPhoto")&&(A.newPhoto=a.bytes===String?l.base64.encode(e.newPhoto,0,e.newPhoto.length):a.bytes===Array?Array.prototype.slice.call(e.newPhoto):e.newPhoto,a.oneofs&&(A._newPhoto="newPhoto")),e.newPhotoId!=null&&e.hasOwnProperty("newPhotoId")&&(A.newPhotoId=e.newPhotoId,a.oneofs&&(A._newPhotoId="newPhotoId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhotoChange"},t})(),n.PinInChat=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PinInChat)return e;var a=new p.proto.PinInChat;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN_TYPE":case 0:a.type=0;break;case"PIN_FOR_ALL":case 1:a.type=1;break;case"UNPIN_FOR_ALL":case 2:a.type=2;break}if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.PinInChat.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.messageAddOnContextInfo!=null){if(typeof e.messageAddOnContextInfo!="object")throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected");a.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.fromObject(e.messageAddOnContextInfo)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.PinInChat.Type[e.type]===void 0?e.type:p.proto.PinInChat.Type[e.type]:e.type,a.oneofs&&(A._type="type")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.messageAddOnContextInfo!=null&&e.hasOwnProperty("messageAddOnContextInfo")&&(A.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.toObject(e.messageAddOnContextInfo,a),a.oneofs&&(A._messageAddOnContextInfo="messageAddOnContextInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PinInChat"},t.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="PIN_FOR_ALL"]=1,e[i[2]="UNPIN_FOR_ALL"]=2,e})(),t})(),n.Point=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.xDeprecated=e.int32();break}case 2:{s.yDeprecated=e.int32();break}case 3:{s.x=e.double();break}case 4:{s.y=e.double();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Point)return e;var a=new p.proto.Point;return e.xDeprecated!=null&&(a.xDeprecated=e.xDeprecated|0),e.yDeprecated!=null&&(a.yDeprecated=e.yDeprecated|0),e.x!=null&&(a.x=Number(e.x)),e.y!=null&&(a.y=Number(e.y)),a},t.toObject=function(e,a){a||(a={});var A={};return e.xDeprecated!=null&&e.hasOwnProperty("xDeprecated")&&(A.xDeprecated=e.xDeprecated,a.oneofs&&(A._xDeprecated="xDeprecated")),e.yDeprecated!=null&&e.hasOwnProperty("yDeprecated")&&(A.yDeprecated=e.yDeprecated,a.oneofs&&(A._yDeprecated="yDeprecated")),e.x!=null&&e.hasOwnProperty("x")&&(A.x=a.json&&!isFinite(e.x)?String(e.x):e.x,a.oneofs&&(A._x="x")),e.y!=null&&e.hasOwnProperty("y")&&(A.y=a.json&&!isFinite(e.y)?String(e.y):e.y,a.oneofs&&(A._y="y")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Point"},t})(),n.PollAdditionalMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pollInvalidated=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PollAdditionalMetadata)return e;var a=new p.proto.PollAdditionalMetadata;return e.pollInvalidated!=null&&(a.pollInvalidated=!!e.pollInvalidated),a},t.toObject=function(e,a){a||(a={});var A={};return e.pollInvalidated!=null&&e.hasOwnProperty("pollInvalidated")&&(A.pollInvalidated=e.pollInvalidated,a.oneofs&&(A._pollInvalidated="pollInvalidated")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollAdditionalMetadata"},t})(),n.PollEncValue=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encPayload=e.bytes();break}case 2:{s.encIv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PollEncValue)return e;var a=new p.proto.PollEncValue;return e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),a},t.toObject=function(e,a){a||(a={});var A={};return e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=a.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,a.oneofs&&(A._encPayload="encPayload")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=a.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):a.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,a.oneofs&&(A._encIv="encIv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollEncValue"},t})(),n.PollUpdate=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pollUpdateMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.vote=p.proto.Message.PollVoteMessage.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PollUpdate)return e;var a=new p.proto.PollUpdate;if(e.pollUpdateMessageKey!=null){if(typeof e.pollUpdateMessageKey!="object")throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected");a.pollUpdateMessageKey=p.proto.MessageKey.fromObject(e.pollUpdateMessageKey)}if(e.vote!=null){if(typeof e.vote!="object")throw TypeError(".proto.PollUpdate.vote: object expected");a.vote=p.proto.Message.PollVoteMessage.fromObject(e.vote)}return e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.unread!=null&&(a.unread=!!e.unread),a},t.toObject=function(e,a){a||(a={});var A={};return e.pollUpdateMessageKey!=null&&e.hasOwnProperty("pollUpdateMessageKey")&&(A.pollUpdateMessageKey=p.proto.MessageKey.toObject(e.pollUpdateMessageKey,a),a.oneofs&&(A._pollUpdateMessageKey="pollUpdateMessageKey")),e.vote!=null&&e.hasOwnProperty("vote")&&(A.vote=p.proto.Message.PollVoteMessage.toObject(e.vote,a),a.oneofs&&(A._vote="vote")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?ge(e.serverTimestampMs):a.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollUpdate"},t})(),n.PreKeyRecordStructure=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PreKeyRecordStructure)return e;var a=new p.proto.PreKeyRecordStructure;return e.id!=null&&(a.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeyRecordStructure"},t})(),n.PreKeySignalMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 5:{s.registrationId=e.uint32();break}case 1:{s.preKeyId=e.uint32();break}case 6:{s.signedPreKeyId=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.identityKey=e.bytes();break}case 4:{s.message=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PreKeySignalMessage)return e;var a=new p.proto.PreKeySignalMessage;return e.registrationId!=null&&(a.registrationId=e.registrationId>>>0),e.preKeyId!=null&&(a.preKeyId=e.preKeyId>>>0),e.signedPreKeyId!=null&&(a.signedPreKeyId=e.signedPreKeyId>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,a.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(a.baseKey=e.baseKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,a.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(a.identityKey=e.identityKey)),e.message!=null&&(typeof e.message=="string"?l.base64.decode(e.message,a.message=l.newBuffer(l.base64.length(e.message)),0):e.message.length>=0&&(a.message=e.message)),a},t.toObject=function(e,a){a||(a={});var A={};return e.preKeyId!=null&&e.hasOwnProperty("preKeyId")&&(A.preKeyId=e.preKeyId,a.oneofs&&(A._preKeyId="preKeyId")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=a.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):a.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,a.oneofs&&(A._baseKey="baseKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=a.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):a.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,a.oneofs&&(A._identityKey="identityKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=a.bytes===String?l.base64.encode(e.message,0,e.message.length):a.bytes===Array?Array.prototype.slice.call(e.message):e.message,a.oneofs&&(A._message="message")),e.registrationId!=null&&e.hasOwnProperty("registrationId")&&(A.registrationId=e.registrationId,a.oneofs&&(A._registrationId="registrationId")),e.signedPreKeyId!=null&&e.hasOwnProperty("signedPreKeyId")&&(A.signedPreKeyId=e.signedPreKeyId,a.oneofs&&(A._signedPreKeyId="signedPreKeyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeySignalMessage"},t})(),n.PremiumMessageInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.serverCampaignId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PremiumMessageInfo)return e;var a=new p.proto.PremiumMessageInfo;return e.serverCampaignId!=null&&(a.serverCampaignId=String(e.serverCampaignId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.serverCampaignId!=null&&e.hasOwnProperty("serverCampaignId")&&(A.serverCampaignId=e.serverCampaignId,a.oneofs&&(A._serverCampaignId="serverCampaignId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PremiumMessageInfo"},t})(),n.PrimaryEphemeralIdentity=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.nonce=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.PrimaryEphemeralIdentity)return e;var a=new p.proto.PrimaryEphemeralIdentity;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.nonce!=null&&(typeof e.nonce=="string"?l.base64.decode(e.nonce,a.nonce=l.newBuffer(l.base64.length(e.nonce)),0):e.nonce.length>=0&&(a.nonce=e.nonce)),a},t.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.nonce!=null&&e.hasOwnProperty("nonce")&&(A.nonce=a.bytes===String?l.base64.encode(e.nonce,0,e.nonce.length):a.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce,a.oneofs&&(A._nonce="nonce")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PrimaryEphemeralIdentity"},t})(),n.PrivacySystemMessage=(function(){let t={},o=Object.create(t);return o[t[1]="E2EE_MSG"]=1,o[t[2]="NE2EE_SELF"]=2,o[t[3]="NE2EE_OTHER"]=3,o})(),n.ProcessedVideo=(function(){function t(i){if(this.capabilities=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.directPath=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.height=e.uint32();break}case 4:{s.width=e.uint32();break}case 5:{s.fileLength=e.uint64();break}case 6:{s.bitrate=e.uint32();break}case 7:{s.quality=e.int32();break}case 8:{s.capabilities&&s.capabilities.length||(s.capabilities=[]),s.capabilities.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ProcessedVideo)return e;var a=new p.proto.ProcessedVideo;switch(e.directPath!=null&&(a.directPath=String(e.directPath)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.height!=null&&(a.height=e.height>>>0),e.width!=null&&(a.width=e.width>>>0),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.bitrate!=null&&(a.bitrate=e.bitrate>>>0),e.quality){default:if(typeof e.quality=="number"){a.quality=e.quality;break}break;case"UNDEFINED":case 0:a.quality=0;break;case"LOW":case 1:a.quality=1;break;case"MID":case 2:a.quality=2;break;case"HIGH":case 3:a.quality=3;break}if(e.capabilities){if(!Array.isArray(e.capabilities))throw TypeError(".proto.ProcessedVideo.capabilities: array expected");a.capabilities=[];for(var A=0;A>>3){case 1:{s.companionEphemeralIdentity=e.bytes();break}case 2:{s.commitment=p.proto.CompanionCommitment.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ProloguePayload)return e;var a=new p.proto.ProloguePayload;if(e.companionEphemeralIdentity!=null&&(typeof e.companionEphemeralIdentity=="string"?l.base64.decode(e.companionEphemeralIdentity,a.companionEphemeralIdentity=l.newBuffer(l.base64.length(e.companionEphemeralIdentity)),0):e.companionEphemeralIdentity.length>=0&&(a.companionEphemeralIdentity=e.companionEphemeralIdentity)),e.commitment!=null){if(typeof e.commitment!="object")throw TypeError(".proto.ProloguePayload.commitment: object expected");a.commitment=p.proto.CompanionCommitment.fromObject(e.commitment)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.companionEphemeralIdentity!=null&&e.hasOwnProperty("companionEphemeralIdentity")&&(A.companionEphemeralIdentity=a.bytes===String?l.base64.encode(e.companionEphemeralIdentity,0,e.companionEphemeralIdentity.length):a.bytes===Array?Array.prototype.slice.call(e.companionEphemeralIdentity):e.companionEphemeralIdentity,a.oneofs&&(A._companionEphemeralIdentity="companionEphemeralIdentity")),e.commitment!=null&&e.hasOwnProperty("commitment")&&(A.commitment=p.proto.CompanionCommitment.toObject(e.commitment,a),a.oneofs&&(A._commitment="commitment")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ProloguePayload"},t})(),n.Pushname=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.pushname=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Pushname)return e;var a=new p.proto.Pushname;return e.id!=null&&(a.id=String(e.id)),e.pushname!=null&&(a.pushname=String(e.pushname)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.pushname!=null&&e.hasOwnProperty("pushname")&&(A.pushname=e.pushname,a.oneofs&&(A._pushname="pushname")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Pushname"},t})(),n.QuarantinedMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.originalData=e.bytes();break}case 2:{s.extractedText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.QuarantinedMessage)return e;var a=new p.proto.QuarantinedMessage;return e.originalData!=null&&(typeof e.originalData=="string"?l.base64.decode(e.originalData,a.originalData=l.newBuffer(l.base64.length(e.originalData)),0):e.originalData.length>=0&&(a.originalData=e.originalData)),e.extractedText!=null&&(a.extractedText=String(e.extractedText)),a},t.toObject=function(e,a){a||(a={});var A={};return e.originalData!=null&&e.hasOwnProperty("originalData")&&(A.originalData=a.bytes===String?l.base64.encode(e.originalData,0,e.originalData.length):a.bytes===Array?Array.prototype.slice.call(e.originalData):e.originalData,a.oneofs&&(A._originalData="originalData")),e.extractedText!=null&&e.hasOwnProperty("extractedText")&&(A.extractedText=e.extractedText,a.oneofs&&(A._extractedText="extractedText")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.QuarantinedMessage"},t})(),n.Reaction=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.text=e.string();break}case 3:{s.groupingKey=e.string();break}case 4:{s.senderTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Reaction)return e;var a=new p.proto.Reaction;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.Reaction.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}return e.text!=null&&(a.text=String(e.text)),e.groupingKey!=null&&(a.groupingKey=String(e.groupingKey)),e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.unread!=null&&(a.unread=!!e.unread),a},t.toObject=function(e,a){a||(a={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),e.groupingKey!=null&&e.hasOwnProperty("groupingKey")&&(A.groupingKey=e.groupingKey,a.oneofs&&(A._groupingKey="groupingKey")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?ge(e.senderTimestampMs):a.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reaction"},t})(),n.RecentEmojiWeight=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.emoji=e.string();break}case 2:{s.weight=e.float();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.RecentEmojiWeight)return e;var a=new p.proto.RecentEmojiWeight;return e.emoji!=null&&(a.emoji=String(e.emoji)),e.weight!=null&&(a.weight=Number(e.weight)),a},t.toObject=function(e,a){a||(a={});var A={};return e.emoji!=null&&e.hasOwnProperty("emoji")&&(A.emoji=e.emoji,a.oneofs&&(A._emoji="emoji")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=a.json&&!isFinite(e.weight)?String(e.weight):e.weight,a.oneofs&&(A._weight="weight")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.RecentEmojiWeight"},t})(),n.RecordStructure=(function(){function t(i){if(this.previousSessions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.currentSession=p.proto.SessionStructure.decode(e,e.uint32());break}case 2:{s.previousSessions&&s.previousSessions.length||(s.previousSessions=[]),s.previousSessions.push(p.proto.SessionStructure.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.RecordStructure)return e;var a=new p.proto.RecordStructure;if(e.currentSession!=null){if(typeof e.currentSession!="object")throw TypeError(".proto.RecordStructure.currentSession: object expected");a.currentSession=p.proto.SessionStructure.fromObject(e.currentSession)}if(e.previousSessions){if(!Array.isArray(e.previousSessions))throw TypeError(".proto.RecordStructure.previousSessions: array expected");a.previousSessions=[];for(var A=0;A>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.never=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.Reportable)return e;var a=new p.proto.Reportable;return e.minVersion!=null&&(a.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(a.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(a.notReportableMinVersion=e.notReportableMinVersion>>>0),e.never!=null&&(a.never=!!e.never),a},t.toObject=function(e,a){a||(a={});var A={};return e.minVersion!=null&&e.hasOwnProperty("minVersion")&&(A.minVersion=e.minVersion,a.oneofs&&(A._minVersion="minVersion")),e.maxVersion!=null&&e.hasOwnProperty("maxVersion")&&(A.maxVersion=e.maxVersion,a.oneofs&&(A._maxVersion="maxVersion")),e.notReportableMinVersion!=null&&e.hasOwnProperty("notReportableMinVersion")&&(A.notReportableMinVersion=e.notReportableMinVersion,a.oneofs&&(A._notReportableMinVersion="notReportableMinVersion")),e.never!=null&&e.hasOwnProperty("never")&&(A.never=e.never,a.oneofs&&(A._never="never")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reportable"},t})(),n.ReportingTokenInfo=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.reportingTag=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ReportingTokenInfo)return e;var a=new p.proto.ReportingTokenInfo;return e.reportingTag!=null&&(typeof e.reportingTag=="string"?l.base64.decode(e.reportingTag,a.reportingTag=l.newBuffer(l.base64.length(e.reportingTag)),0):e.reportingTag.length>=0&&(a.reportingTag=e.reportingTag)),a},t.toObject=function(e,a){a||(a={});var A={};return e.reportingTag!=null&&e.hasOwnProperty("reportingTag")&&(A.reportingTag=a.bytes===String?l.base64.encode(e.reportingTag,0,e.reportingTag.length):a.bytes===Array?Array.prototype.slice.call(e.reportingTag):e.reportingTag,a.oneofs&&(A._reportingTag="reportingTag")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ReportingTokenInfo"},t})(),n.SenderKeyDistributionMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.chainKey=e.bytes();break}case 4:{s.signingKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SenderKeyDistributionMessage)return e;var a=new p.proto.SenderKeyDistributionMessage;return e.id!=null&&(a.id=e.id>>>0),e.iteration!=null&&(a.iteration=e.iteration>>>0),e.chainKey!=null&&(typeof e.chainKey=="string"?l.base64.decode(e.chainKey,a.chainKey=l.newBuffer(l.base64.length(e.chainKey)),0):e.chainKey.length>=0&&(a.chainKey=e.chainKey)),e.signingKey!=null&&(typeof e.signingKey=="string"?l.base64.decode(e.signingKey,a.signingKey=l.newBuffer(l.base64.length(e.signingKey)),0):e.signingKey.length>=0&&(a.signingKey=e.signingKey)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,a.oneofs&&(A._iteration="iteration")),e.chainKey!=null&&e.hasOwnProperty("chainKey")&&(A.chainKey=a.bytes===String?l.base64.encode(e.chainKey,0,e.chainKey.length):a.bytes===Array?Array.prototype.slice.call(e.chainKey):e.chainKey,a.oneofs&&(A._chainKey="chainKey")),e.signingKey!=null&&e.hasOwnProperty("signingKey")&&(A.signingKey=a.bytes===String?l.base64.encode(e.signingKey,0,e.signingKey.length):a.bytes===Array?Array.prototype.slice.call(e.signingKey):e.signingKey,a.oneofs&&(A._signingKey="signingKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyDistributionMessage"},t})(),n.SenderKeyMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SenderKeyMessage)return e;var a=new p.proto.SenderKeyMessage;return e.id!=null&&(a.id=e.id>>>0),e.iteration!=null&&(a.iteration=e.iteration>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,a.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(a.ciphertext=e.ciphertext)),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,a.oneofs&&(A._iteration="iteration")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=a.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):a.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,a.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyMessage"},t})(),n.SenderKeyRecordStructure=(function(){function t(o){if(this.senderKeyStates=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.senderKeyStates&&r.senderKeyStates.length||(r.senderKeyStates=[]),r.senderKeyStates.push(p.proto.SenderKeyStateStructure.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.SenderKeyRecordStructure)return i;var e=new p.proto.SenderKeyRecordStructure;if(i.senderKeyStates){if(!Array.isArray(i.senderKeyStates))throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected");e.senderKeyStates=[];for(var a=0;a>>3){case 1:{s.senderKeyId=e.uint32();break}case 2:{s.senderChainKey=p.proto.SenderKeyStateStructure.SenderChainKey.decode(e,e.uint32());break}case 3:{s.senderSigningKey=p.proto.SenderKeyStateStructure.SenderSigningKey.decode(e,e.uint32());break}case 4:{s.senderMessageKeys&&s.senderMessageKeys.length||(s.senderMessageKeys=[]),s.senderMessageKeys.push(p.proto.SenderKeyStateStructure.SenderMessageKey.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SenderKeyStateStructure)return e;var a=new p.proto.SenderKeyStateStructure;if(e.senderKeyId!=null&&(a.senderKeyId=e.senderKeyId>>>0),e.senderChainKey!=null){if(typeof e.senderChainKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected");a.senderChainKey=p.proto.SenderKeyStateStructure.SenderChainKey.fromObject(e.senderChainKey)}if(e.senderSigningKey!=null){if(typeof e.senderSigningKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected");a.senderSigningKey=p.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(e.senderSigningKey)}if(e.senderMessageKeys){if(!Array.isArray(e.senderMessageKeys))throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected");a.senderMessageKeys=[];for(var A=0;A>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderChainKey)return A;var r=new p.proto.SenderKeyStateStructure.SenderChainKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},i.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderChainKey"},i})(),t.SenderMessageKey=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderMessageKey)return A;var r=new p.proto.SenderKeyStateStructure.SenderMessageKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},i.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderMessageKey"},i})(),t.SenderSigningKey=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.public=A.bytes();break}case 2:{c.private=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderSigningKey)return A;var r=new p.proto.SenderKeyStateStructure.SenderSigningKey;return A.public!=null&&(typeof A.public=="string"?l.base64.decode(A.public,r.public=l.newBuffer(l.base64.length(A.public)),0):A.public.length>=0&&(r.public=A.public)),A.private!=null&&(typeof A.private=="string"?l.base64.decode(A.private,r.private=l.newBuffer(l.base64.length(A.private)),0):A.private.length>=0&&(r.private=A.private)),r},i.toObject=function(A,r){r||(r={});var s={};return A.public!=null&&A.hasOwnProperty("public")&&(s.public=r.bytes===String?l.base64.encode(A.public,0,A.public.length):r.bytes===Array?Array.prototype.slice.call(A.public):A.public,r.oneofs&&(s._public="public")),A.private!=null&&A.hasOwnProperty("private")&&(s.private=r.bytes===String?l.base64.encode(A.private,0,A.private.length):r.bytes===Array?Array.prototype.slice.call(A.private):A.private,r.oneofs&&(s._private="private")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderSigningKey"},i})(),t})(),n.ServerErrorReceipt=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ServerErrorReceipt)return e;var a=new p.proto.ServerErrorReceipt;return e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),a},t.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ServerErrorReceipt"},t})(),n.SessionStructure=(function(){function t(i){if(this.receiverChains=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sessionVersion=e.uint32();break}case 2:{s.localIdentityPublic=e.bytes();break}case 3:{s.remoteIdentityPublic=e.bytes();break}case 4:{s.rootKey=e.bytes();break}case 5:{s.previousCounter=e.uint32();break}case 6:{s.senderChain=p.proto.SessionStructure.Chain.decode(e,e.uint32());break}case 7:{s.receiverChains&&s.receiverChains.length||(s.receiverChains=[]),s.receiverChains.push(p.proto.SessionStructure.Chain.decode(e,e.uint32()));break}case 8:{s.pendingKeyExchange=p.proto.SessionStructure.PendingKeyExchange.decode(e,e.uint32());break}case 9:{s.pendingPreKey=p.proto.SessionStructure.PendingPreKey.decode(e,e.uint32());break}case 10:{s.remoteRegistrationId=e.uint32();break}case 11:{s.localRegistrationId=e.uint32();break}case 12:{s.needsRefresh=e.bool();break}case 13:{s.aliceBaseKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SessionStructure)return e;var a=new p.proto.SessionStructure;if(e.sessionVersion!=null&&(a.sessionVersion=e.sessionVersion>>>0),e.localIdentityPublic!=null&&(typeof e.localIdentityPublic=="string"?l.base64.decode(e.localIdentityPublic,a.localIdentityPublic=l.newBuffer(l.base64.length(e.localIdentityPublic)),0):e.localIdentityPublic.length>=0&&(a.localIdentityPublic=e.localIdentityPublic)),e.remoteIdentityPublic!=null&&(typeof e.remoteIdentityPublic=="string"?l.base64.decode(e.remoteIdentityPublic,a.remoteIdentityPublic=l.newBuffer(l.base64.length(e.remoteIdentityPublic)),0):e.remoteIdentityPublic.length>=0&&(a.remoteIdentityPublic=e.remoteIdentityPublic)),e.rootKey!=null&&(typeof e.rootKey=="string"?l.base64.decode(e.rootKey,a.rootKey=l.newBuffer(l.base64.length(e.rootKey)),0):e.rootKey.length>=0&&(a.rootKey=e.rootKey)),e.previousCounter!=null&&(a.previousCounter=e.previousCounter>>>0),e.senderChain!=null){if(typeof e.senderChain!="object")throw TypeError(".proto.SessionStructure.senderChain: object expected");a.senderChain=p.proto.SessionStructure.Chain.fromObject(e.senderChain)}if(e.receiverChains){if(!Array.isArray(e.receiverChains))throw TypeError(".proto.SessionStructure.receiverChains: array expected");a.receiverChains=[];for(var A=0;A>>0),e.localRegistrationId!=null&&(a.localRegistrationId=e.localRegistrationId>>>0),e.needsRefresh!=null&&(a.needsRefresh=!!e.needsRefresh),e.aliceBaseKey!=null&&(typeof e.aliceBaseKey=="string"?l.base64.decode(e.aliceBaseKey,a.aliceBaseKey=l.newBuffer(l.base64.length(e.aliceBaseKey)),0):e.aliceBaseKey.length>=0&&(a.aliceBaseKey=e.aliceBaseKey)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.receiverChains=[]),e.sessionVersion!=null&&e.hasOwnProperty("sessionVersion")&&(A.sessionVersion=e.sessionVersion,a.oneofs&&(A._sessionVersion="sessionVersion")),e.localIdentityPublic!=null&&e.hasOwnProperty("localIdentityPublic")&&(A.localIdentityPublic=a.bytes===String?l.base64.encode(e.localIdentityPublic,0,e.localIdentityPublic.length):a.bytes===Array?Array.prototype.slice.call(e.localIdentityPublic):e.localIdentityPublic,a.oneofs&&(A._localIdentityPublic="localIdentityPublic")),e.remoteIdentityPublic!=null&&e.hasOwnProperty("remoteIdentityPublic")&&(A.remoteIdentityPublic=a.bytes===String?l.base64.encode(e.remoteIdentityPublic,0,e.remoteIdentityPublic.length):a.bytes===Array?Array.prototype.slice.call(e.remoteIdentityPublic):e.remoteIdentityPublic,a.oneofs&&(A._remoteIdentityPublic="remoteIdentityPublic")),e.rootKey!=null&&e.hasOwnProperty("rootKey")&&(A.rootKey=a.bytes===String?l.base64.encode(e.rootKey,0,e.rootKey.length):a.bytes===Array?Array.prototype.slice.call(e.rootKey):e.rootKey,a.oneofs&&(A._rootKey="rootKey")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,a.oneofs&&(A._previousCounter="previousCounter")),e.senderChain!=null&&e.hasOwnProperty("senderChain")&&(A.senderChain=p.proto.SessionStructure.Chain.toObject(e.senderChain,a),a.oneofs&&(A._senderChain="senderChain")),e.receiverChains&&e.receiverChains.length){A.receiverChains=[];for(var r=0;r>>3){case 1:{c.senderRatchetKey=A.bytes();break}case 2:{c.senderRatchetKeyPrivate=A.bytes();break}case 3:{c.chainKey=p.proto.SessionStructure.Chain.ChainKey.decode(A,A.uint32());break}case 4:{c.messageKeys&&c.messageKeys.length||(c.messageKeys=[]),c.messageKeys.push(p.proto.SessionStructure.Chain.MessageKey.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.Chain)return A;var r=new p.proto.SessionStructure.Chain;if(A.senderRatchetKey!=null&&(typeof A.senderRatchetKey=="string"?l.base64.decode(A.senderRatchetKey,r.senderRatchetKey=l.newBuffer(l.base64.length(A.senderRatchetKey)),0):A.senderRatchetKey.length>=0&&(r.senderRatchetKey=A.senderRatchetKey)),A.senderRatchetKeyPrivate!=null&&(typeof A.senderRatchetKeyPrivate=="string"?l.base64.decode(A.senderRatchetKeyPrivate,r.senderRatchetKeyPrivate=l.newBuffer(l.base64.length(A.senderRatchetKeyPrivate)),0):A.senderRatchetKeyPrivate.length>=0&&(r.senderRatchetKeyPrivate=A.senderRatchetKeyPrivate)),A.chainKey!=null){if(typeof A.chainKey!="object")throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");r.chainKey=p.proto.SessionStructure.Chain.ChainKey.fromObject(A.chainKey)}if(A.messageKeys){if(!Array.isArray(A.messageKeys))throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");r.messageKeys=[];for(var s=0;s>>3){case 1:{d.index=s.uint32();break}case 2:{d.key=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.SessionStructure.Chain.ChainKey)return s;var g=new p.proto.SessionStructure.Chain.ChainKey;return s.index!=null&&(g.index=s.index>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),g},a.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.ChainKey"},a})(),i.MessageKey=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.index=s.uint32();break}case 2:{d.cipherKey=s.bytes();break}case 3:{d.macKey=s.bytes();break}case 4:{d.iv=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.SessionStructure.Chain.MessageKey)return s;var g=new p.proto.SessionStructure.Chain.MessageKey;return s.index!=null&&(g.index=s.index>>>0),s.cipherKey!=null&&(typeof s.cipherKey=="string"?l.base64.decode(s.cipherKey,g.cipherKey=l.newBuffer(l.base64.length(s.cipherKey)),0):s.cipherKey.length>=0&&(g.cipherKey=s.cipherKey)),s.macKey!=null&&(typeof s.macKey=="string"?l.base64.decode(s.macKey,g.macKey=l.newBuffer(l.base64.length(s.macKey)),0):s.macKey.length>=0&&(g.macKey=s.macKey)),s.iv!=null&&(typeof s.iv=="string"?l.base64.decode(s.iv,g.iv=l.newBuffer(l.base64.length(s.iv)),0):s.iv.length>=0&&(g.iv=s.iv)),g},a.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.cipherKey!=null&&s.hasOwnProperty("cipherKey")&&(c.cipherKey=g.bytes===String?l.base64.encode(s.cipherKey,0,s.cipherKey.length):g.bytes===Array?Array.prototype.slice.call(s.cipherKey):s.cipherKey,g.oneofs&&(c._cipherKey="cipherKey")),s.macKey!=null&&s.hasOwnProperty("macKey")&&(c.macKey=g.bytes===String?l.base64.encode(s.macKey,0,s.macKey.length):g.bytes===Array?Array.prototype.slice.call(s.macKey):s.macKey,g.oneofs&&(c._macKey="macKey")),s.iv!=null&&s.hasOwnProperty("iv")&&(c.iv=g.bytes===String?l.base64.encode(s.iv,0,s.iv.length):g.bytes===Array?Array.prototype.slice.call(s.iv):s.iv,g.oneofs&&(c._iv="iv")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.MessageKey"},a})(),i})(),t.PendingKeyExchange=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.sequence=A.uint32();break}case 2:{c.localBaseKey=A.bytes();break}case 3:{c.localBaseKeyPrivate=A.bytes();break}case 4:{c.localRatchetKey=A.bytes();break}case 5:{c.localRatchetKeyPrivate=A.bytes();break}case 7:{c.localIdentityKey=A.bytes();break}case 8:{c.localIdentityKeyPrivate=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.PendingKeyExchange)return A;var r=new p.proto.SessionStructure.PendingKeyExchange;return A.sequence!=null&&(r.sequence=A.sequence>>>0),A.localBaseKey!=null&&(typeof A.localBaseKey=="string"?l.base64.decode(A.localBaseKey,r.localBaseKey=l.newBuffer(l.base64.length(A.localBaseKey)),0):A.localBaseKey.length>=0&&(r.localBaseKey=A.localBaseKey)),A.localBaseKeyPrivate!=null&&(typeof A.localBaseKeyPrivate=="string"?l.base64.decode(A.localBaseKeyPrivate,r.localBaseKeyPrivate=l.newBuffer(l.base64.length(A.localBaseKeyPrivate)),0):A.localBaseKeyPrivate.length>=0&&(r.localBaseKeyPrivate=A.localBaseKeyPrivate)),A.localRatchetKey!=null&&(typeof A.localRatchetKey=="string"?l.base64.decode(A.localRatchetKey,r.localRatchetKey=l.newBuffer(l.base64.length(A.localRatchetKey)),0):A.localRatchetKey.length>=0&&(r.localRatchetKey=A.localRatchetKey)),A.localRatchetKeyPrivate!=null&&(typeof A.localRatchetKeyPrivate=="string"?l.base64.decode(A.localRatchetKeyPrivate,r.localRatchetKeyPrivate=l.newBuffer(l.base64.length(A.localRatchetKeyPrivate)),0):A.localRatchetKeyPrivate.length>=0&&(r.localRatchetKeyPrivate=A.localRatchetKeyPrivate)),A.localIdentityKey!=null&&(typeof A.localIdentityKey=="string"?l.base64.decode(A.localIdentityKey,r.localIdentityKey=l.newBuffer(l.base64.length(A.localIdentityKey)),0):A.localIdentityKey.length>=0&&(r.localIdentityKey=A.localIdentityKey)),A.localIdentityKeyPrivate!=null&&(typeof A.localIdentityKeyPrivate=="string"?l.base64.decode(A.localIdentityKeyPrivate,r.localIdentityKeyPrivate=l.newBuffer(l.base64.length(A.localIdentityKeyPrivate)),0):A.localIdentityKeyPrivate.length>=0&&(r.localIdentityKeyPrivate=A.localIdentityKeyPrivate)),r},i.toObject=function(A,r){r||(r={});var s={};return A.sequence!=null&&A.hasOwnProperty("sequence")&&(s.sequence=A.sequence,r.oneofs&&(s._sequence="sequence")),A.localBaseKey!=null&&A.hasOwnProperty("localBaseKey")&&(s.localBaseKey=r.bytes===String?l.base64.encode(A.localBaseKey,0,A.localBaseKey.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKey):A.localBaseKey,r.oneofs&&(s._localBaseKey="localBaseKey")),A.localBaseKeyPrivate!=null&&A.hasOwnProperty("localBaseKeyPrivate")&&(s.localBaseKeyPrivate=r.bytes===String?l.base64.encode(A.localBaseKeyPrivate,0,A.localBaseKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKeyPrivate):A.localBaseKeyPrivate,r.oneofs&&(s._localBaseKeyPrivate="localBaseKeyPrivate")),A.localRatchetKey!=null&&A.hasOwnProperty("localRatchetKey")&&(s.localRatchetKey=r.bytes===String?l.base64.encode(A.localRatchetKey,0,A.localRatchetKey.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKey):A.localRatchetKey,r.oneofs&&(s._localRatchetKey="localRatchetKey")),A.localRatchetKeyPrivate!=null&&A.hasOwnProperty("localRatchetKeyPrivate")&&(s.localRatchetKeyPrivate=r.bytes===String?l.base64.encode(A.localRatchetKeyPrivate,0,A.localRatchetKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKeyPrivate):A.localRatchetKeyPrivate,r.oneofs&&(s._localRatchetKeyPrivate="localRatchetKeyPrivate")),A.localIdentityKey!=null&&A.hasOwnProperty("localIdentityKey")&&(s.localIdentityKey=r.bytes===String?l.base64.encode(A.localIdentityKey,0,A.localIdentityKey.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKey):A.localIdentityKey,r.oneofs&&(s._localIdentityKey="localIdentityKey")),A.localIdentityKeyPrivate!=null&&A.hasOwnProperty("localIdentityKeyPrivate")&&(s.localIdentityKeyPrivate=r.bytes===String?l.base64.encode(A.localIdentityKeyPrivate,0,A.localIdentityKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKeyPrivate):A.localIdentityKeyPrivate,r.oneofs&&(s._localIdentityKeyPrivate="localIdentityKeyPrivate")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingKeyExchange"},i})(),t.PendingPreKey=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.preKeyId=A.uint32();break}case 3:{c.signedPreKeyId=A.int32();break}case 2:{c.baseKey=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.PendingPreKey)return A;var r=new p.proto.SessionStructure.PendingPreKey;return A.preKeyId!=null&&(r.preKeyId=A.preKeyId>>>0),A.signedPreKeyId!=null&&(r.signedPreKeyId=A.signedPreKeyId|0),A.baseKey!=null&&(typeof A.baseKey=="string"?l.base64.decode(A.baseKey,r.baseKey=l.newBuffer(l.base64.length(A.baseKey)),0):A.baseKey.length>=0&&(r.baseKey=A.baseKey)),r},i.toObject=function(A,r){r||(r={});var s={};return A.preKeyId!=null&&A.hasOwnProperty("preKeyId")&&(s.preKeyId=A.preKeyId,r.oneofs&&(s._preKeyId="preKeyId")),A.baseKey!=null&&A.hasOwnProperty("baseKey")&&(s.baseKey=r.bytes===String?l.base64.encode(A.baseKey,0,A.baseKey.length):r.bytes===Array?Array.prototype.slice.call(A.baseKey):A.baseKey,r.oneofs&&(s._baseKey="baseKey")),A.signedPreKeyId!=null&&A.hasOwnProperty("signedPreKeyId")&&(s.signedPreKeyId=A.signedPreKeyId,r.oneofs&&(s._signedPreKeyId="signedPreKeyId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingPreKey"},i})(),t})(),n.SessionTransparencyMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.disclaimerText=e.string();break}case 2:{s.hcaId=e.string();break}case 3:{s.sessionTransparencyType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SessionTransparencyMetadata)return e;var a=new p.proto.SessionTransparencyMetadata;switch(e.disclaimerText!=null&&(a.disclaimerText=String(e.disclaimerText)),e.hcaId!=null&&(a.hcaId=String(e.hcaId)),e.sessionTransparencyType){default:if(typeof e.sessionTransparencyType=="number"){a.sessionTransparencyType=e.sessionTransparencyType;break}break;case"UNKNOWN_TYPE":case 0:a.sessionTransparencyType=0;break;case"NY_AI_SAFETY_DISCLAIMER":case 1:a.sessionTransparencyType=1;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.disclaimerText!=null&&e.hasOwnProperty("disclaimerText")&&(A.disclaimerText=e.disclaimerText,a.oneofs&&(A._disclaimerText="disclaimerText")),e.hcaId!=null&&e.hasOwnProperty("hcaId")&&(A.hcaId=e.hcaId,a.oneofs&&(A._hcaId="hcaId")),e.sessionTransparencyType!=null&&e.hasOwnProperty("sessionTransparencyType")&&(A.sessionTransparencyType=a.enums===String?p.proto.SessionTransparencyType[e.sessionTransparencyType]===void 0?e.sessionTransparencyType:p.proto.SessionTransparencyType[e.sessionTransparencyType]:e.sessionTransparencyType,a.oneofs&&(A._sessionTransparencyType="sessionTransparencyType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SessionTransparencyMetadata"},t})(),n.SessionTransparencyType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN_TYPE"]=0,o[t[1]="NY_AI_SAFETY_DISCLAIMER"]=1,o})(),n.SignalMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.ratchetKey=e.bytes();break}case 2:{s.counter=e.uint32();break}case 3:{s.previousCounter=e.uint32();break}case 4:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SignalMessage)return e;var a=new p.proto.SignalMessage;return e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,a.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(a.ratchetKey=e.ratchetKey)),e.counter!=null&&(a.counter=e.counter>>>0),e.previousCounter!=null&&(a.previousCounter=e.previousCounter>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,a.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(a.ciphertext=e.ciphertext)),a},t.toObject=function(e,a){a||(a={});var A={};return e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=a.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):a.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,a.oneofs&&(A._ratchetKey="ratchetKey")),e.counter!=null&&e.hasOwnProperty("counter")&&(A.counter=e.counter,a.oneofs&&(A._counter="counter")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,a.oneofs&&(A._previousCounter="previousCounter")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=a.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):a.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,a.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignalMessage"},t})(),n.SignedPreKeyRecordStructure=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}case 4:{s.signature=e.bytes();break}case 5:{s.timestamp=e.fixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SignedPreKeyRecordStructure)return e;var a=new p.proto.SignedPreKeyRecordStructure;return e.id!=null&&(a.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},t.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignedPreKeyRecordStructure"},t})(),n.StatusAttribution=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.actionUrl=e.string();break}case 3:{s.statusReshare=p.proto.StatusAttribution.StatusReshare.decode(e,e.uint32());break}case 4:{s.externalShare=p.proto.StatusAttribution.ExternalShare.decode(e,e.uint32());break}case 5:{s.music=p.proto.StatusAttribution.Music.decode(e,e.uint32());break}case 6:{s.groupStatus=p.proto.StatusAttribution.GroupStatus.decode(e,e.uint32());break}case 7:{s.rlAttribution=p.proto.StatusAttribution.RLAttribution.decode(e,e.uint32());break}case 8:{s.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StatusAttribution)return e;var a=new p.proto.StatusAttribution;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN":case 0:a.type=0;break;case"RESHARE":case 1:a.type=1;break;case"EXTERNAL_SHARE":case 2:a.type=2;break;case"MUSIC":case 3:a.type=3;break;case"STATUS_MENTION":case 4:a.type=4;break;case"GROUP_STATUS":case 5:a.type=5;break;case"RL_ATTRIBUTION":case 6:a.type=6;break;case"AI_CREATED":case 7:a.type=7;break;case"LAYOUTS":case 8:a.type=8;break}if(e.actionUrl!=null&&(a.actionUrl=String(e.actionUrl)),e.statusReshare!=null){if(typeof e.statusReshare!="object")throw TypeError(".proto.StatusAttribution.statusReshare: object expected");a.statusReshare=p.proto.StatusAttribution.StatusReshare.fromObject(e.statusReshare)}if(e.externalShare!=null){if(typeof e.externalShare!="object")throw TypeError(".proto.StatusAttribution.externalShare: object expected");a.externalShare=p.proto.StatusAttribution.ExternalShare.fromObject(e.externalShare)}if(e.music!=null){if(typeof e.music!="object")throw TypeError(".proto.StatusAttribution.music: object expected");a.music=p.proto.StatusAttribution.Music.fromObject(e.music)}if(e.groupStatus!=null){if(typeof e.groupStatus!="object")throw TypeError(".proto.StatusAttribution.groupStatus: object expected");a.groupStatus=p.proto.StatusAttribution.GroupStatus.fromObject(e.groupStatus)}if(e.rlAttribution!=null){if(typeof e.rlAttribution!="object")throw TypeError(".proto.StatusAttribution.rlAttribution: object expected");a.rlAttribution=p.proto.StatusAttribution.RLAttribution.fromObject(e.rlAttribution)}if(e.aiCreatedAttribution!=null){if(typeof e.aiCreatedAttribution!="object")throw TypeError(".proto.StatusAttribution.aiCreatedAttribution: object expected");a.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.fromObject(e.aiCreatedAttribution)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.StatusAttribution.Type[e.type]===void 0?e.type:p.proto.StatusAttribution.Type[e.type]:e.type,a.oneofs&&(A._type="type")),e.actionUrl!=null&&e.hasOwnProperty("actionUrl")&&(A.actionUrl=e.actionUrl,a.oneofs&&(A._actionUrl="actionUrl")),e.statusReshare!=null&&e.hasOwnProperty("statusReshare")&&(A.statusReshare=p.proto.StatusAttribution.StatusReshare.toObject(e.statusReshare,a),a.oneofs&&(A.attributionData="statusReshare")),e.externalShare!=null&&e.hasOwnProperty("externalShare")&&(A.externalShare=p.proto.StatusAttribution.ExternalShare.toObject(e.externalShare,a),a.oneofs&&(A.attributionData="externalShare")),e.music!=null&&e.hasOwnProperty("music")&&(A.music=p.proto.StatusAttribution.Music.toObject(e.music,a),a.oneofs&&(A.attributionData="music")),e.groupStatus!=null&&e.hasOwnProperty("groupStatus")&&(A.groupStatus=p.proto.StatusAttribution.GroupStatus.toObject(e.groupStatus,a),a.oneofs&&(A.attributionData="groupStatus")),e.rlAttribution!=null&&e.hasOwnProperty("rlAttribution")&&(A.rlAttribution=p.proto.StatusAttribution.RLAttribution.toObject(e.rlAttribution,a),a.oneofs&&(A.attributionData="rlAttribution")),e.aiCreatedAttribution!=null&&e.hasOwnProperty("aiCreatedAttribution")&&(A.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.toObject(e.aiCreatedAttribution,a),a.oneofs&&(A.attributionData="aiCreatedAttribution")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusAttribution"},t.AiCreatedAttribution=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.AiCreatedAttribution)return A;var r=new p.proto.StatusAttribution.AiCreatedAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"STATUS_MIMICRY":case 1:r.source=1;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.AiCreatedAttribution"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="STATUS_MIMICRY"]=1,A})(),i})(),t.ExternalShare=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.actionUrl=A.string();break}case 2:{c.source=A.int32();break}case 3:{c.duration=A.int32();break}case 4:{c.actionFallbackUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.ExternalShare)return A;var r=new p.proto.StatusAttribution.ExternalShare;switch(A.actionUrl!=null&&(r.actionUrl=String(A.actionUrl)),A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INSTAGRAM":case 1:r.source=1;break;case"FACEBOOK":case 2:r.source=2;break;case"MESSENGER":case 3:r.source=3;break;case"SPOTIFY":case 4:r.source=4;break;case"YOUTUBE":case 5:r.source=5;break;case"PINTEREST":case 6:r.source=6;break;case"THREADS":case 7:r.source=7;break;case"APPLE_MUSIC":case 8:r.source=8;break;case"SHARECHAT":case 9:r.source=9;break;case"GOOGLE_PHOTOS":case 10:r.source=10;break}return A.duration!=null&&(r.duration=A.duration|0),A.actionFallbackUrl!=null&&(r.actionFallbackUrl=String(A.actionFallbackUrl)),r},i.toObject=function(A,r){r||(r={});var s={};return A.actionUrl!=null&&A.hasOwnProperty("actionUrl")&&(s.actionUrl=A.actionUrl,r.oneofs&&(s._actionUrl="actionUrl")),A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.ExternalShare.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.ExternalShare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.duration!=null&&A.hasOwnProperty("duration")&&(s.duration=A.duration,r.oneofs&&(s._duration="duration")),A.actionFallbackUrl!=null&&A.hasOwnProperty("actionFallbackUrl")&&(s.actionFallbackUrl=A.actionFallbackUrl,r.oneofs&&(s._actionFallbackUrl="actionFallbackUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.ExternalShare"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="INSTAGRAM"]=1,A[a[2]="FACEBOOK"]=2,A[a[3]="MESSENGER"]=3,A[a[4]="SPOTIFY"]=4,A[a[5]="YOUTUBE"]=5,A[a[6]="PINTEREST"]=6,A[a[7]="THREADS"]=7,A[a[8]="APPLE_MUSIC"]=8,A[a[9]="SHARECHAT"]=9,A[a[10]="GOOGLE_PHOTOS"]=10,A})(),i})(),t.GroupStatus=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.authorJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.GroupStatus)return A;var r=new p.proto.StatusAttribution.GroupStatus;return A.authorJid!=null&&(r.authorJid=String(A.authorJid)),r},i.toObject=function(A,r){r||(r={});var s={};return A.authorJid!=null&&A.hasOwnProperty("authorJid")&&(s.authorJid=A.authorJid,r.oneofs&&(s._authorJid="authorJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.GroupStatus"},i})(),t.Music=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.authorName=A.string();break}case 2:{c.songId=A.string();break}case 3:{c.title=A.string();break}case 4:{c.author=A.string();break}case 5:{c.artistAttribution=A.string();break}case 6:{c.isExplicit=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.Music)return A;var r=new p.proto.StatusAttribution.Music;return A.authorName!=null&&(r.authorName=String(A.authorName)),A.songId!=null&&(r.songId=String(A.songId)),A.title!=null&&(r.title=String(A.title)),A.author!=null&&(r.author=String(A.author)),A.artistAttribution!=null&&(r.artistAttribution=String(A.artistAttribution)),A.isExplicit!=null&&(r.isExplicit=!!A.isExplicit),r},i.toObject=function(A,r){r||(r={});var s={};return A.authorName!=null&&A.hasOwnProperty("authorName")&&(s.authorName=A.authorName,r.oneofs&&(s._authorName="authorName")),A.songId!=null&&A.hasOwnProperty("songId")&&(s.songId=A.songId,r.oneofs&&(s._songId="songId")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.author!=null&&A.hasOwnProperty("author")&&(s.author=A.author,r.oneofs&&(s._author="author")),A.artistAttribution!=null&&A.hasOwnProperty("artistAttribution")&&(s.artistAttribution=A.artistAttribution,r.oneofs&&(s._artistAttribution="artistAttribution")),A.isExplicit!=null&&A.hasOwnProperty("isExplicit")&&(s.isExplicit=A.isExplicit,r.oneofs&&(s._isExplicit="isExplicit")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.Music"},i})(),t.RLAttribution=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.RLAttribution)return A;var r=new p.proto.StatusAttribution.RLAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"RAY_BAN_META_GLASSES":case 1:r.source=1;break;case"OAKLEY_META_GLASSES":case 2:r.source=2;break;case"HYPERNOVA_GLASSES":case 3:r.source=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.RLAttribution.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.RLAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.RLAttribution"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="RAY_BAN_META_GLASSES"]=1,A[a[2]="OAKLEY_META_GLASSES"]=2,A[a[3]="HYPERNOVA_GLASSES"]=3,A})(),i})(),t.StatusReshare=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.source=A.int32();break}case 2:{c.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.StatusReshare)return A;var r=new p.proto.StatusAttribution.StatusReshare;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INTERNAL_RESHARE":case 1:r.source=1;break;case"MENTION_RESHARE":case 2:r.source=2;break;case"CHANNEL_RESHARE":case 3:r.source=3;break;case"FORWARD":case 4:r.source=4;break}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.StatusAttribution.StatusReshare.metadata: object expected");r.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.fromObject(A.metadata)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?p.proto.StatusAttribution.StatusReshare.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.StatusReshare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.StatusReshare"},i.Metadata=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.duration=s.int32();break}case 2:{d.channelJid=s.string();break}case 3:{d.channelMessageId=s.int32();break}case 4:{d.hasMultipleReshares=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.StatusAttribution.StatusReshare.Metadata)return s;var g=new p.proto.StatusAttribution.StatusReshare.Metadata;return s.duration!=null&&(g.duration=s.duration|0),s.channelJid!=null&&(g.channelJid=String(s.channelJid)),s.channelMessageId!=null&&(g.channelMessageId=s.channelMessageId|0),s.hasMultipleReshares!=null&&(g.hasMultipleReshares=!!s.hasMultipleReshares),g},a.toObject=function(s,g){g||(g={});var c={};return s.duration!=null&&s.hasOwnProperty("duration")&&(c.duration=s.duration,g.oneofs&&(c._duration="duration")),s.channelJid!=null&&s.hasOwnProperty("channelJid")&&(c.channelJid=s.channelJid,g.oneofs&&(c._channelJid="channelJid")),s.channelMessageId!=null&&s.hasOwnProperty("channelMessageId")&&(c.channelMessageId=s.channelMessageId,g.oneofs&&(c._channelMessageId="channelMessageId")),s.hasMultipleReshares!=null&&s.hasOwnProperty("hasMultipleReshares")&&(c.hasMultipleReshares=s.hasMultipleReshares,g.oneofs&&(c._hasMultipleReshares="hasMultipleReshares")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.StatusAttribution.StatusReshare.Metadata"},a})(),i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="INTERNAL_RESHARE"]=1,A[a[2]="MENTION_RESHARE"]=2,A[a[3]="CHANNEL_RESHARE"]=3,A[a[4]="FORWARD"]=4,A})(),i})(),t.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="RESHARE"]=1,e[i[2]="EXTERNAL_SHARE"]=2,e[i[3]="MUSIC"]=3,e[i[4]="STATUS_MENTION"]=4,e[i[5]="GROUP_STATUS"]=5,e[i[6]="RL_ATTRIBUTION"]=6,e[i[7]="AI_CREATED"]=7,e[i[8]="LAYOUTS"]=8,e})(),t})(),n.StatusMentionMessage=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.quotedStatus=p.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StatusMentionMessage)return e;var a=new p.proto.StatusMentionMessage;if(e.quotedStatus!=null){if(typeof e.quotedStatus!="object")throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected");a.quotedStatus=p.proto.Message.fromObject(e.quotedStatus)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.quotedStatus!=null&&e.hasOwnProperty("quotedStatus")&&(A.quotedStatus=p.proto.Message.toObject(e.quotedStatus,a),a.oneofs&&(A._quotedStatus="quotedStatus")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusMentionMessage"},t})(),n.StatusPSA=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 44:{s.campaignId=e.uint64();break}case 45:{s.campaignExpirationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StatusPSA)return e;var a=new p.proto.StatusPSA;return e.campaignId!=null&&(l.Long?(a.campaignId=l.Long.fromValue(e.campaignId)).unsigned=!0:typeof e.campaignId=="string"?a.campaignId=parseInt(e.campaignId,10):typeof e.campaignId=="number"?a.campaignId=e.campaignId:typeof e.campaignId=="object"&&(a.campaignId=new l.LongBits(e.campaignId.low>>>0,e.campaignId.high>>>0).toNumber(!0))),e.campaignExpirationTimestamp!=null&&(l.Long?(a.campaignExpirationTimestamp=l.Long.fromValue(e.campaignExpirationTimestamp)).unsigned=!0:typeof e.campaignExpirationTimestamp=="string"?a.campaignExpirationTimestamp=parseInt(e.campaignExpirationTimestamp,10):typeof e.campaignExpirationTimestamp=="number"?a.campaignExpirationTimestamp=e.campaignExpirationTimestamp:typeof e.campaignExpirationTimestamp=="object"&&(a.campaignExpirationTimestamp=new l.LongBits(e.campaignExpirationTimestamp.low>>>0,e.campaignExpirationTimestamp.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};if(a.defaults)if(l.Long){var r=new l.Long(0,0,!0);A.campaignId=a.longs===String?r.toString():a.longs===Number?r.toNumber():r}else A.campaignId=a.longs===String?"0":0;return e.campaignId!=null&&e.hasOwnProperty("campaignId")&&(typeof e.campaignId=="number"?A.campaignId=a.longs===String?String(e.campaignId):e.campaignId:A.campaignId=a.longs===String?ge(e.campaignId,!0):a.longs===Number?ce(e.campaignId,!0):e.campaignId),e.campaignExpirationTimestamp!=null&&e.hasOwnProperty("campaignExpirationTimestamp")&&(typeof e.campaignExpirationTimestamp=="number"?A.campaignExpirationTimestamp=a.longs===String?String(e.campaignExpirationTimestamp):e.campaignExpirationTimestamp:A.campaignExpirationTimestamp=a.longs===String?ge(e.campaignExpirationTimestamp,!0):a.longs===Number?ce(e.campaignExpirationTimestamp,!0):e.campaignExpirationTimestamp,a.oneofs&&(A._campaignExpirationTimestamp="campaignExpirationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusPSA"},t})(),n.StickerMetadata=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.url=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.fileEncSha256=e.bytes();break}case 4:{s.mediaKey=e.bytes();break}case 5:{s.mimetype=e.string();break}case 6:{s.height=e.uint32();break}case 7:{s.width=e.uint32();break}case 8:{s.directPath=e.string();break}case 9:{s.fileLength=e.uint64();break}case 10:{s.weight=e.float();break}case 11:{s.lastStickerSentTs=e.int64();break}case 12:{s.isLottie=e.bool();break}case 13:{s.imageHash=e.string();break}case 14:{s.isAvatarSticker=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.StickerMetadata)return e;var a=new p.proto.StickerMetadata;return e.url!=null&&(a.url=String(e.url)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,a.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(a.mediaKey=e.mediaKey)),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.height!=null&&(a.height=e.height>>>0),e.width!=null&&(a.width=e.width>>>0),e.directPath!=null&&(a.directPath=String(e.directPath)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.weight!=null&&(a.weight=Number(e.weight)),e.lastStickerSentTs!=null&&(l.Long?(a.lastStickerSentTs=l.Long.fromValue(e.lastStickerSentTs)).unsigned=!1:typeof e.lastStickerSentTs=="string"?a.lastStickerSentTs=parseInt(e.lastStickerSentTs,10):typeof e.lastStickerSentTs=="number"?a.lastStickerSentTs=e.lastStickerSentTs:typeof e.lastStickerSentTs=="object"&&(a.lastStickerSentTs=new l.LongBits(e.lastStickerSentTs.low>>>0,e.lastStickerSentTs.high>>>0).toNumber())),e.isLottie!=null&&(a.isLottie=!!e.isLottie),e.imageHash!=null&&(a.imageHash=String(e.imageHash)),e.isAvatarSticker!=null&&(a.isAvatarSticker=!!e.isAvatarSticker),a},t.toObject=function(e,a){a||(a={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=a.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=a.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,a.oneofs&&(A._height="height")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,a.oneofs&&(A._width="width")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?ge(e.fileLength,!0):a.longs===Number?ce(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=a.json&&!isFinite(e.weight)?String(e.weight):e.weight,a.oneofs&&(A._weight="weight")),e.lastStickerSentTs!=null&&e.hasOwnProperty("lastStickerSentTs")&&(typeof e.lastStickerSentTs=="number"?A.lastStickerSentTs=a.longs===String?String(e.lastStickerSentTs):e.lastStickerSentTs:A.lastStickerSentTs=a.longs===String?ge(e.lastStickerSentTs):a.longs===Number?ce(e.lastStickerSentTs):e.lastStickerSentTs,a.oneofs&&(A._lastStickerSentTs="lastStickerSentTs")),e.isLottie!=null&&e.hasOwnProperty("isLottie")&&(A.isLottie=e.isLottie,a.oneofs&&(A._isLottie="isLottie")),e.imageHash!=null&&e.hasOwnProperty("imageHash")&&(A.imageHash=e.imageHash,a.oneofs&&(A._imageHash="imageHash")),e.isAvatarSticker!=null&&e.hasOwnProperty("isAvatarSticker")&&(A.isAvatarSticker=e.isAvatarSticker,a.oneofs&&(A._isAvatarSticker="isAvatarSticker")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StickerMetadata"},t})(),n.SyncActionData=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.index=e.bytes();break}case 2:{s.value=p.proto.SyncActionValue.decode(e,e.uint32());break}case 3:{s.padding=e.bytes();break}case 4:{s.version=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncActionData)return e;var a=new p.proto.SyncActionData;if(e.index!=null&&(typeof e.index=="string"?l.base64.decode(e.index,a.index=l.newBuffer(l.base64.length(e.index)),0):e.index.length>=0&&(a.index=e.index)),e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncActionData.value: object expected");a.value=p.proto.SyncActionValue.fromObject(e.value)}return e.padding!=null&&(typeof e.padding=="string"?l.base64.decode(e.padding,a.padding=l.newBuffer(l.base64.length(e.padding)),0):e.padding.length>=0&&(a.padding=e.padding)),e.version!=null&&(a.version=e.version|0),a},t.toObject=function(e,a){a||(a={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=a.bytes===String?l.base64.encode(e.index,0,e.index.length):a.bytes===Array?Array.prototype.slice.call(e.index):e.index,a.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=p.proto.SyncActionValue.toObject(e.value,a),a.oneofs&&(A._value="value")),e.padding!=null&&e.hasOwnProperty("padding")&&(A.padding=a.bytes===String?l.base64.encode(e.padding,0,e.padding.length):a.bytes===Array?Array.prototype.slice.call(e.padding):e.padding,a.oneofs&&(A._padding="padding")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionData"},t})(),n.SyncActionValue=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.timestamp=e.int64();break}case 2:{s.starAction=p.proto.SyncActionValue.StarAction.decode(e,e.uint32());break}case 3:{s.contactAction=p.proto.SyncActionValue.ContactAction.decode(e,e.uint32());break}case 4:{s.muteAction=p.proto.SyncActionValue.MuteAction.decode(e,e.uint32());break}case 5:{s.pinAction=p.proto.SyncActionValue.PinAction.decode(e,e.uint32());break}case 7:{s.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.decode(e,e.uint32());break}case 8:{s.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.decode(e,e.uint32());break}case 11:{s.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.decode(e,e.uint32());break}case 14:{s.labelEditAction=p.proto.SyncActionValue.LabelEditAction.decode(e,e.uint32());break}case 15:{s.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.decode(e,e.uint32());break}case 16:{s.localeSetting=p.proto.SyncActionValue.LocaleSetting.decode(e,e.uint32());break}case 17:{s.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.decode(e,e.uint32());break}case 18:{s.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.decode(e,e.uint32());break}case 19:{s.keyExpiration=p.proto.SyncActionValue.KeyExpiration.decode(e,e.uint32());break}case 20:{s.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.decode(e,e.uint32());break}case 21:{s.clearChatAction=p.proto.SyncActionValue.ClearChatAction.decode(e,e.uint32());break}case 22:{s.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.decode(e,e.uint32());break}case 23:{s.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.decode(e,e.uint32());break}case 24:{s.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.decode(e,e.uint32());break}case 26:{s.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.decode(e,e.uint32());break}case 27:{s.agentAction=p.proto.SyncActionValue.AgentAction.decode(e,e.uint32());break}case 28:{s.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.decode(e,e.uint32());break}case 29:{s.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.decode(e,e.uint32());break}case 30:{s.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.decode(e,e.uint32());break}case 31:{s.nuxAction=p.proto.SyncActionValue.NuxAction.decode(e,e.uint32());break}case 32:{s.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.decode(e,e.uint32());break}case 33:{s.stickerAction=p.proto.SyncActionValue.StickerAction.decode(e,e.uint32());break}case 34:{s.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.decode(e,e.uint32());break}case 35:{s.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.decode(e,e.uint32());break}case 36:{s.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(e,e.uint32());break}case 37:{s.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.decode(e,e.uint32());break}case 38:{s.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.decode(e,e.uint32());break}case 39:{s.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.decode(e,e.uint32());break}case 40:{s.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.decode(e,e.uint32());break}case 41:{s.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.decode(e,e.uint32());break}case 42:{s.callLogAction=p.proto.SyncActionValue.CallLogAction.decode(e,e.uint32());break}case 43:{s.ugcBot=p.proto.SyncActionValue.UGCBot.decode(e,e.uint32());break}case 44:{s.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.decode(e,e.uint32());break}case 45:{s.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.decode(e,e.uint32());break}case 46:{s.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.decode(e,e.uint32());break}case 47:{s.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.decode(e,e.uint32());break}case 48:{s.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.decode(e,e.uint32());break}case 49:{s.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.decode(e,e.uint32());break}case 50:{s.lockChatAction=p.proto.SyncActionValue.LockChatAction.decode(e,e.uint32());break}case 51:{s.chatLockSettings=p.proto.ChatLockSettings.decode(e,e.uint32());break}case 52:{s.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.decode(e,e.uint32());break}case 53:{s.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.decode(e,e.uint32());break}case 54:{s.deviceCapabilities=p.proto.DeviceCapabilities.decode(e,e.uint32());break}case 55:{s.noteEditAction=p.proto.SyncActionValue.NoteEditAction.decode(e,e.uint32());break}case 56:{s.favoritesAction=p.proto.SyncActionValue.FavoritesAction.decode(e,e.uint32());break}case 57:{s.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.decode(e,e.uint32());break}case 58:{s.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.decode(e,e.uint32());break}case 59:{s.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.decode(e,e.uint32());break}case 60:{s.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.decode(e,e.uint32());break}case 61:{s.lidContactAction=p.proto.SyncActionValue.LidContactAction.decode(e,e.uint32());break}case 62:{s.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.decode(e,e.uint32());break}case 63:{s.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.decode(e,e.uint32());break}case 64:{s.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.decode(e,e.uint32());break}case 65:{s.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.decode(e,e.uint32());break}case 66:{s.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.decode(e,e.uint32());break}case 68:{s.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.decode(e,e.uint32());break}case 69:{s.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.decode(e,e.uint32());break}case 70:{s.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.decode(e,e.uint32());break}case 71:{s.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.decode(e,e.uint32());break}case 72:{s.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.decode(e,e.uint32());break}case 74:{s.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.decode(e,e.uint32());break}case 75:{s.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.decode(e,e.uint32());break}case 76:{s.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.decode(e,e.uint32());break}case 77:{s.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncActionValue)return e;var a=new p.proto.SyncActionValue;if(e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.starAction!=null){if(typeof e.starAction!="object")throw TypeError(".proto.SyncActionValue.starAction: object expected");a.starAction=p.proto.SyncActionValue.StarAction.fromObject(e.starAction)}if(e.contactAction!=null){if(typeof e.contactAction!="object")throw TypeError(".proto.SyncActionValue.contactAction: object expected");a.contactAction=p.proto.SyncActionValue.ContactAction.fromObject(e.contactAction)}if(e.muteAction!=null){if(typeof e.muteAction!="object")throw TypeError(".proto.SyncActionValue.muteAction: object expected");a.muteAction=p.proto.SyncActionValue.MuteAction.fromObject(e.muteAction)}if(e.pinAction!=null){if(typeof e.pinAction!="object")throw TypeError(".proto.SyncActionValue.pinAction: object expected");a.pinAction=p.proto.SyncActionValue.PinAction.fromObject(e.pinAction)}if(e.pushNameSetting!=null){if(typeof e.pushNameSetting!="object")throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected");a.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.fromObject(e.pushNameSetting)}if(e.quickReplyAction!=null){if(typeof e.quickReplyAction!="object")throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected");a.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.fromObject(e.quickReplyAction)}if(e.recentEmojiWeightsAction!=null){if(typeof e.recentEmojiWeightsAction!="object")throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected");a.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(e.recentEmojiWeightsAction)}if(e.labelEditAction!=null){if(typeof e.labelEditAction!="object")throw TypeError(".proto.SyncActionValue.labelEditAction: object expected");a.labelEditAction=p.proto.SyncActionValue.LabelEditAction.fromObject(e.labelEditAction)}if(e.labelAssociationAction!=null){if(typeof e.labelAssociationAction!="object")throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected");a.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.fromObject(e.labelAssociationAction)}if(e.localeSetting!=null){if(typeof e.localeSetting!="object")throw TypeError(".proto.SyncActionValue.localeSetting: object expected");a.localeSetting=p.proto.SyncActionValue.LocaleSetting.fromObject(e.localeSetting)}if(e.archiveChatAction!=null){if(typeof e.archiveChatAction!="object")throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected");a.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.fromObject(e.archiveChatAction)}if(e.deleteMessageForMeAction!=null){if(typeof e.deleteMessageForMeAction!="object")throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected");a.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(e.deleteMessageForMeAction)}if(e.keyExpiration!=null){if(typeof e.keyExpiration!="object")throw TypeError(".proto.SyncActionValue.keyExpiration: object expected");a.keyExpiration=p.proto.SyncActionValue.KeyExpiration.fromObject(e.keyExpiration)}if(e.markChatAsReadAction!=null){if(typeof e.markChatAsReadAction!="object")throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected");a.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.fromObject(e.markChatAsReadAction)}if(e.clearChatAction!=null){if(typeof e.clearChatAction!="object")throw TypeError(".proto.SyncActionValue.clearChatAction: object expected");a.clearChatAction=p.proto.SyncActionValue.ClearChatAction.fromObject(e.clearChatAction)}if(e.deleteChatAction!=null){if(typeof e.deleteChatAction!="object")throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected");a.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.fromObject(e.deleteChatAction)}if(e.unarchiveChatsSetting!=null){if(typeof e.unarchiveChatsSetting!="object")throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected");a.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(e.unarchiveChatsSetting)}if(e.primaryFeature!=null){if(typeof e.primaryFeature!="object")throw TypeError(".proto.SyncActionValue.primaryFeature: object expected");a.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.fromObject(e.primaryFeature)}if(e.androidUnsupportedActions!=null){if(typeof e.androidUnsupportedActions!="object")throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected");a.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(e.androidUnsupportedActions)}if(e.agentAction!=null){if(typeof e.agentAction!="object")throw TypeError(".proto.SyncActionValue.agentAction: object expected");a.agentAction=p.proto.SyncActionValue.AgentAction.fromObject(e.agentAction)}if(e.subscriptionAction!=null){if(typeof e.subscriptionAction!="object")throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected");a.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.fromObject(e.subscriptionAction)}if(e.userStatusMuteAction!=null){if(typeof e.userStatusMuteAction!="object")throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected");a.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.fromObject(e.userStatusMuteAction)}if(e.timeFormatAction!=null){if(typeof e.timeFormatAction!="object")throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected");a.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.fromObject(e.timeFormatAction)}if(e.nuxAction!=null){if(typeof e.nuxAction!="object")throw TypeError(".proto.SyncActionValue.nuxAction: object expected");a.nuxAction=p.proto.SyncActionValue.NuxAction.fromObject(e.nuxAction)}if(e.primaryVersionAction!=null){if(typeof e.primaryVersionAction!="object")throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected");a.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.fromObject(e.primaryVersionAction)}if(e.stickerAction!=null){if(typeof e.stickerAction!="object")throw TypeError(".proto.SyncActionValue.stickerAction: object expected");a.stickerAction=p.proto.SyncActionValue.StickerAction.fromObject(e.stickerAction)}if(e.removeRecentStickerAction!=null){if(typeof e.removeRecentStickerAction!="object")throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected");a.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(e.removeRecentStickerAction)}if(e.chatAssignment!=null){if(typeof e.chatAssignment!="object")throw TypeError(".proto.SyncActionValue.chatAssignment: object expected");a.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.fromObject(e.chatAssignment)}if(e.chatAssignmentOpenedStatus!=null){if(typeof e.chatAssignmentOpenedStatus!="object")throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected");a.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(e.chatAssignmentOpenedStatus)}if(e.pnForLidChatAction!=null){if(typeof e.pnForLidChatAction!="object")throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected");a.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.fromObject(e.pnForLidChatAction)}if(e.marketingMessageAction!=null){if(typeof e.marketingMessageAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected");a.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.fromObject(e.marketingMessageAction)}if(e.marketingMessageBroadcastAction!=null){if(typeof e.marketingMessageBroadcastAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected");a.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(e.marketingMessageBroadcastAction)}if(e.externalWebBetaAction!=null){if(typeof e.externalWebBetaAction!="object")throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected");a.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.fromObject(e.externalWebBetaAction)}if(e.privacySettingRelayAllCalls!=null){if(typeof e.privacySettingRelayAllCalls!="object")throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected");a.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(e.privacySettingRelayAllCalls)}if(e.callLogAction!=null){if(typeof e.callLogAction!="object")throw TypeError(".proto.SyncActionValue.callLogAction: object expected");a.callLogAction=p.proto.SyncActionValue.CallLogAction.fromObject(e.callLogAction)}if(e.ugcBot!=null){if(typeof e.ugcBot!="object")throw TypeError(".proto.SyncActionValue.ugcBot: object expected");a.ugcBot=p.proto.SyncActionValue.UGCBot.fromObject(e.ugcBot)}if(e.statusPrivacy!=null){if(typeof e.statusPrivacy!="object")throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected");a.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.fromObject(e.statusPrivacy)}if(e.botWelcomeRequestAction!=null){if(typeof e.botWelcomeRequestAction!="object")throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected");a.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(e.botWelcomeRequestAction)}if(e.deleteIndividualCallLog!=null){if(typeof e.deleteIndividualCallLog!="object")throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected");a.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(e.deleteIndividualCallLog)}if(e.labelReorderingAction!=null){if(typeof e.labelReorderingAction!="object")throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected");a.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.fromObject(e.labelReorderingAction)}if(e.paymentInfoAction!=null){if(typeof e.paymentInfoAction!="object")throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected");a.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.fromObject(e.paymentInfoAction)}if(e.customPaymentMethodsAction!=null){if(typeof e.customPaymentMethodsAction!="object")throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected");a.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(e.customPaymentMethodsAction)}if(e.lockChatAction!=null){if(typeof e.lockChatAction!="object")throw TypeError(".proto.SyncActionValue.lockChatAction: object expected");a.lockChatAction=p.proto.SyncActionValue.LockChatAction.fromObject(e.lockChatAction)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected");a.chatLockSettings=p.proto.ChatLockSettings.fromObject(e.chatLockSettings)}if(e.wamoUserIdentifierAction!=null){if(typeof e.wamoUserIdentifierAction!="object")throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected");a.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(e.wamoUserIdentifierAction)}if(e.privacySettingDisableLinkPreviewsAction!=null){if(typeof e.privacySettingDisableLinkPreviewsAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected");a.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(e.privacySettingDisableLinkPreviewsAction)}if(e.deviceCapabilities!=null){if(typeof e.deviceCapabilities!="object")throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected");a.deviceCapabilities=p.proto.DeviceCapabilities.fromObject(e.deviceCapabilities)}if(e.noteEditAction!=null){if(typeof e.noteEditAction!="object")throw TypeError(".proto.SyncActionValue.noteEditAction: object expected");a.noteEditAction=p.proto.SyncActionValue.NoteEditAction.fromObject(e.noteEditAction)}if(e.favoritesAction!=null){if(typeof e.favoritesAction!="object")throw TypeError(".proto.SyncActionValue.favoritesAction: object expected");a.favoritesAction=p.proto.SyncActionValue.FavoritesAction.fromObject(e.favoritesAction)}if(e.merchantPaymentPartnerAction!=null){if(typeof e.merchantPaymentPartnerAction!="object")throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected");a.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(e.merchantPaymentPartnerAction)}if(e.waffleAccountLinkStateAction!=null){if(typeof e.waffleAccountLinkStateAction!="object")throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected");a.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(e.waffleAccountLinkStateAction)}if(e.usernameChatStartMode!=null){if(typeof e.usernameChatStartMode!="object")throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected");a.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(e.usernameChatStartMode)}if(e.notificationActivitySettingAction!=null){if(typeof e.notificationActivitySettingAction!="object")throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected");a.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(e.notificationActivitySettingAction)}if(e.lidContactAction!=null){if(typeof e.lidContactAction!="object")throw TypeError(".proto.SyncActionValue.lidContactAction: object expected");a.lidContactAction=p.proto.SyncActionValue.LidContactAction.fromObject(e.lidContactAction)}if(e.ctwaPerCustomerDataSharingAction!=null){if(typeof e.ctwaPerCustomerDataSharingAction!="object")throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected");a.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(e.ctwaPerCustomerDataSharingAction)}if(e.paymentTosAction!=null){if(typeof e.paymentTosAction!="object")throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected");a.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.fromObject(e.paymentTosAction)}if(e.privacySettingChannelsPersonalisedRecommendationAction!=null){if(typeof e.privacySettingChannelsPersonalisedRecommendationAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingChannelsPersonalisedRecommendationAction: object expected");a.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.fromObject(e.privacySettingChannelsPersonalisedRecommendationAction)}if(e.businessBroadcastAssociationAction!=null){if(typeof e.businessBroadcastAssociationAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastAssociationAction: object expected");a.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.fromObject(e.businessBroadcastAssociationAction)}if(e.detectedOutcomesStatusAction!=null){if(typeof e.detectedOutcomesStatusAction!="object")throw TypeError(".proto.SyncActionValue.detectedOutcomesStatusAction: object expected");a.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.fromObject(e.detectedOutcomesStatusAction)}if(e.maibaAiFeaturesControlAction!=null){if(typeof e.maibaAiFeaturesControlAction!="object")throw TypeError(".proto.SyncActionValue.maibaAiFeaturesControlAction: object expected");a.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.fromObject(e.maibaAiFeaturesControlAction)}if(e.businessBroadcastListAction!=null){if(typeof e.businessBroadcastListAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastListAction: object expected");a.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.fromObject(e.businessBroadcastListAction)}if(e.musicUserIdAction!=null){if(typeof e.musicUserIdAction!="object")throw TypeError(".proto.SyncActionValue.musicUserIdAction: object expected");a.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.fromObject(e.musicUserIdAction)}if(e.statusPostOptInNotificationPreferencesAction!=null){if(typeof e.statusPostOptInNotificationPreferencesAction!="object")throw TypeError(".proto.SyncActionValue.statusPostOptInNotificationPreferencesAction: object expected");a.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.fromObject(e.statusPostOptInNotificationPreferencesAction)}if(e.avatarUpdatedAction!=null){if(typeof e.avatarUpdatedAction!="object")throw TypeError(".proto.SyncActionValue.avatarUpdatedAction: object expected");a.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.fromObject(e.avatarUpdatedAction)}if(e.privateProcessingSettingAction!=null){if(typeof e.privateProcessingSettingAction!="object")throw TypeError(".proto.SyncActionValue.privateProcessingSettingAction: object expected");a.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.fromObject(e.privateProcessingSettingAction)}if(e.newsletterSavedInterestsAction!=null){if(typeof e.newsletterSavedInterestsAction!="object")throw TypeError(".proto.SyncActionValue.newsletterSavedInterestsAction: object expected");a.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.fromObject(e.newsletterSavedInterestsAction)}if(e.aiThreadRenameAction!=null){if(typeof e.aiThreadRenameAction!="object")throw TypeError(".proto.SyncActionValue.aiThreadRenameAction: object expected");a.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.fromObject(e.aiThreadRenameAction)}if(e.interactiveMessageAction!=null){if(typeof e.interactiveMessageAction!="object")throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");a.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.fromObject(e.interactiveMessageAction)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?ge(e.timestamp):a.longs===Number?ce(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.starAction!=null&&e.hasOwnProperty("starAction")&&(A.starAction=p.proto.SyncActionValue.StarAction.toObject(e.starAction,a),a.oneofs&&(A._starAction="starAction")),e.contactAction!=null&&e.hasOwnProperty("contactAction")&&(A.contactAction=p.proto.SyncActionValue.ContactAction.toObject(e.contactAction,a),a.oneofs&&(A._contactAction="contactAction")),e.muteAction!=null&&e.hasOwnProperty("muteAction")&&(A.muteAction=p.proto.SyncActionValue.MuteAction.toObject(e.muteAction,a),a.oneofs&&(A._muteAction="muteAction")),e.pinAction!=null&&e.hasOwnProperty("pinAction")&&(A.pinAction=p.proto.SyncActionValue.PinAction.toObject(e.pinAction,a),a.oneofs&&(A._pinAction="pinAction")),e.pushNameSetting!=null&&e.hasOwnProperty("pushNameSetting")&&(A.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.toObject(e.pushNameSetting,a),a.oneofs&&(A._pushNameSetting="pushNameSetting")),e.quickReplyAction!=null&&e.hasOwnProperty("quickReplyAction")&&(A.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.toObject(e.quickReplyAction,a),a.oneofs&&(A._quickReplyAction="quickReplyAction")),e.recentEmojiWeightsAction!=null&&e.hasOwnProperty("recentEmojiWeightsAction")&&(A.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(e.recentEmojiWeightsAction,a),a.oneofs&&(A._recentEmojiWeightsAction="recentEmojiWeightsAction")),e.labelEditAction!=null&&e.hasOwnProperty("labelEditAction")&&(A.labelEditAction=p.proto.SyncActionValue.LabelEditAction.toObject(e.labelEditAction,a),a.oneofs&&(A._labelEditAction="labelEditAction")),e.labelAssociationAction!=null&&e.hasOwnProperty("labelAssociationAction")&&(A.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.toObject(e.labelAssociationAction,a),a.oneofs&&(A._labelAssociationAction="labelAssociationAction")),e.localeSetting!=null&&e.hasOwnProperty("localeSetting")&&(A.localeSetting=p.proto.SyncActionValue.LocaleSetting.toObject(e.localeSetting,a),a.oneofs&&(A._localeSetting="localeSetting")),e.archiveChatAction!=null&&e.hasOwnProperty("archiveChatAction")&&(A.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.toObject(e.archiveChatAction,a),a.oneofs&&(A._archiveChatAction="archiveChatAction")),e.deleteMessageForMeAction!=null&&e.hasOwnProperty("deleteMessageForMeAction")&&(A.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.toObject(e.deleteMessageForMeAction,a),a.oneofs&&(A._deleteMessageForMeAction="deleteMessageForMeAction")),e.keyExpiration!=null&&e.hasOwnProperty("keyExpiration")&&(A.keyExpiration=p.proto.SyncActionValue.KeyExpiration.toObject(e.keyExpiration,a),a.oneofs&&(A._keyExpiration="keyExpiration")),e.markChatAsReadAction!=null&&e.hasOwnProperty("markChatAsReadAction")&&(A.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.toObject(e.markChatAsReadAction,a),a.oneofs&&(A._markChatAsReadAction="markChatAsReadAction")),e.clearChatAction!=null&&e.hasOwnProperty("clearChatAction")&&(A.clearChatAction=p.proto.SyncActionValue.ClearChatAction.toObject(e.clearChatAction,a),a.oneofs&&(A._clearChatAction="clearChatAction")),e.deleteChatAction!=null&&e.hasOwnProperty("deleteChatAction")&&(A.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.toObject(e.deleteChatAction,a),a.oneofs&&(A._deleteChatAction="deleteChatAction")),e.unarchiveChatsSetting!=null&&e.hasOwnProperty("unarchiveChatsSetting")&&(A.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.toObject(e.unarchiveChatsSetting,a),a.oneofs&&(A._unarchiveChatsSetting="unarchiveChatsSetting")),e.primaryFeature!=null&&e.hasOwnProperty("primaryFeature")&&(A.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.toObject(e.primaryFeature,a),a.oneofs&&(A._primaryFeature="primaryFeature")),e.androidUnsupportedActions!=null&&e.hasOwnProperty("androidUnsupportedActions")&&(A.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.toObject(e.androidUnsupportedActions,a),a.oneofs&&(A._androidUnsupportedActions="androidUnsupportedActions")),e.agentAction!=null&&e.hasOwnProperty("agentAction")&&(A.agentAction=p.proto.SyncActionValue.AgentAction.toObject(e.agentAction,a),a.oneofs&&(A._agentAction="agentAction")),e.subscriptionAction!=null&&e.hasOwnProperty("subscriptionAction")&&(A.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.toObject(e.subscriptionAction,a),a.oneofs&&(A._subscriptionAction="subscriptionAction")),e.userStatusMuteAction!=null&&e.hasOwnProperty("userStatusMuteAction")&&(A.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.toObject(e.userStatusMuteAction,a),a.oneofs&&(A._userStatusMuteAction="userStatusMuteAction")),e.timeFormatAction!=null&&e.hasOwnProperty("timeFormatAction")&&(A.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.toObject(e.timeFormatAction,a),a.oneofs&&(A._timeFormatAction="timeFormatAction")),e.nuxAction!=null&&e.hasOwnProperty("nuxAction")&&(A.nuxAction=p.proto.SyncActionValue.NuxAction.toObject(e.nuxAction,a),a.oneofs&&(A._nuxAction="nuxAction")),e.primaryVersionAction!=null&&e.hasOwnProperty("primaryVersionAction")&&(A.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.toObject(e.primaryVersionAction,a),a.oneofs&&(A._primaryVersionAction="primaryVersionAction")),e.stickerAction!=null&&e.hasOwnProperty("stickerAction")&&(A.stickerAction=p.proto.SyncActionValue.StickerAction.toObject(e.stickerAction,a),a.oneofs&&(A._stickerAction="stickerAction")),e.removeRecentStickerAction!=null&&e.hasOwnProperty("removeRecentStickerAction")&&(A.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.toObject(e.removeRecentStickerAction,a),a.oneofs&&(A._removeRecentStickerAction="removeRecentStickerAction")),e.chatAssignment!=null&&e.hasOwnProperty("chatAssignment")&&(A.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.toObject(e.chatAssignment,a),a.oneofs&&(A._chatAssignment="chatAssignment")),e.chatAssignmentOpenedStatus!=null&&e.hasOwnProperty("chatAssignmentOpenedStatus")&&(A.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(e.chatAssignmentOpenedStatus,a),a.oneofs&&(A._chatAssignmentOpenedStatus="chatAssignmentOpenedStatus")),e.pnForLidChatAction!=null&&e.hasOwnProperty("pnForLidChatAction")&&(A.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.toObject(e.pnForLidChatAction,a),a.oneofs&&(A._pnForLidChatAction="pnForLidChatAction")),e.marketingMessageAction!=null&&e.hasOwnProperty("marketingMessageAction")&&(A.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.toObject(e.marketingMessageAction,a),a.oneofs&&(A._marketingMessageAction="marketingMessageAction")),e.marketingMessageBroadcastAction!=null&&e.hasOwnProperty("marketingMessageBroadcastAction")&&(A.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(e.marketingMessageBroadcastAction,a),a.oneofs&&(A._marketingMessageBroadcastAction="marketingMessageBroadcastAction")),e.externalWebBetaAction!=null&&e.hasOwnProperty("externalWebBetaAction")&&(A.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.toObject(e.externalWebBetaAction,a),a.oneofs&&(A._externalWebBetaAction="externalWebBetaAction")),e.privacySettingRelayAllCalls!=null&&e.hasOwnProperty("privacySettingRelayAllCalls")&&(A.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(e.privacySettingRelayAllCalls,a),a.oneofs&&(A._privacySettingRelayAllCalls="privacySettingRelayAllCalls")),e.callLogAction!=null&&e.hasOwnProperty("callLogAction")&&(A.callLogAction=p.proto.SyncActionValue.CallLogAction.toObject(e.callLogAction,a),a.oneofs&&(A._callLogAction="callLogAction")),e.ugcBot!=null&&e.hasOwnProperty("ugcBot")&&(A.ugcBot=p.proto.SyncActionValue.UGCBot.toObject(e.ugcBot,a),a.oneofs&&(A._ugcBot="ugcBot")),e.statusPrivacy!=null&&e.hasOwnProperty("statusPrivacy")&&(A.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.toObject(e.statusPrivacy,a),a.oneofs&&(A._statusPrivacy="statusPrivacy")),e.botWelcomeRequestAction!=null&&e.hasOwnProperty("botWelcomeRequestAction")&&(A.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.toObject(e.botWelcomeRequestAction,a),a.oneofs&&(A._botWelcomeRequestAction="botWelcomeRequestAction")),e.deleteIndividualCallLog!=null&&e.hasOwnProperty("deleteIndividualCallLog")&&(A.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(e.deleteIndividualCallLog,a),a.oneofs&&(A._deleteIndividualCallLog="deleteIndividualCallLog")),e.labelReorderingAction!=null&&e.hasOwnProperty("labelReorderingAction")&&(A.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.toObject(e.labelReorderingAction,a),a.oneofs&&(A._labelReorderingAction="labelReorderingAction")),e.paymentInfoAction!=null&&e.hasOwnProperty("paymentInfoAction")&&(A.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.toObject(e.paymentInfoAction,a),a.oneofs&&(A._paymentInfoAction="paymentInfoAction")),e.customPaymentMethodsAction!=null&&e.hasOwnProperty("customPaymentMethodsAction")&&(A.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(e.customPaymentMethodsAction,a),a.oneofs&&(A._customPaymentMethodsAction="customPaymentMethodsAction")),e.lockChatAction!=null&&e.hasOwnProperty("lockChatAction")&&(A.lockChatAction=p.proto.SyncActionValue.LockChatAction.toObject(e.lockChatAction,a),a.oneofs&&(A._lockChatAction="lockChatAction")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=p.proto.ChatLockSettings.toObject(e.chatLockSettings,a),a.oneofs&&(A._chatLockSettings="chatLockSettings")),e.wamoUserIdentifierAction!=null&&e.hasOwnProperty("wamoUserIdentifierAction")&&(A.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.toObject(e.wamoUserIdentifierAction,a),a.oneofs&&(A._wamoUserIdentifierAction="wamoUserIdentifierAction")),e.privacySettingDisableLinkPreviewsAction!=null&&e.hasOwnProperty("privacySettingDisableLinkPreviewsAction")&&(A.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(e.privacySettingDisableLinkPreviewsAction,a),a.oneofs&&(A._privacySettingDisableLinkPreviewsAction="privacySettingDisableLinkPreviewsAction")),e.deviceCapabilities!=null&&e.hasOwnProperty("deviceCapabilities")&&(A.deviceCapabilities=p.proto.DeviceCapabilities.toObject(e.deviceCapabilities,a),a.oneofs&&(A._deviceCapabilities="deviceCapabilities")),e.noteEditAction!=null&&e.hasOwnProperty("noteEditAction")&&(A.noteEditAction=p.proto.SyncActionValue.NoteEditAction.toObject(e.noteEditAction,a),a.oneofs&&(A._noteEditAction="noteEditAction")),e.favoritesAction!=null&&e.hasOwnProperty("favoritesAction")&&(A.favoritesAction=p.proto.SyncActionValue.FavoritesAction.toObject(e.favoritesAction,a),a.oneofs&&(A._favoritesAction="favoritesAction")),e.merchantPaymentPartnerAction!=null&&e.hasOwnProperty("merchantPaymentPartnerAction")&&(A.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(e.merchantPaymentPartnerAction,a),a.oneofs&&(A._merchantPaymentPartnerAction="merchantPaymentPartnerAction")),e.waffleAccountLinkStateAction!=null&&e.hasOwnProperty("waffleAccountLinkStateAction")&&(A.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(e.waffleAccountLinkStateAction,a),a.oneofs&&(A._waffleAccountLinkStateAction="waffleAccountLinkStateAction")),e.usernameChatStartMode!=null&&e.hasOwnProperty("usernameChatStartMode")&&(A.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.toObject(e.usernameChatStartMode,a),a.oneofs&&(A._usernameChatStartMode="usernameChatStartMode")),e.notificationActivitySettingAction!=null&&e.hasOwnProperty("notificationActivitySettingAction")&&(A.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.toObject(e.notificationActivitySettingAction,a),a.oneofs&&(A._notificationActivitySettingAction="notificationActivitySettingAction")),e.lidContactAction!=null&&e.hasOwnProperty("lidContactAction")&&(A.lidContactAction=p.proto.SyncActionValue.LidContactAction.toObject(e.lidContactAction,a),a.oneofs&&(A._lidContactAction="lidContactAction")),e.ctwaPerCustomerDataSharingAction!=null&&e.hasOwnProperty("ctwaPerCustomerDataSharingAction")&&(A.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(e.ctwaPerCustomerDataSharingAction,a),a.oneofs&&(A._ctwaPerCustomerDataSharingAction="ctwaPerCustomerDataSharingAction")),e.paymentTosAction!=null&&e.hasOwnProperty("paymentTosAction")&&(A.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.toObject(e.paymentTosAction,a),a.oneofs&&(A._paymentTosAction="paymentTosAction")),e.privacySettingChannelsPersonalisedRecommendationAction!=null&&e.hasOwnProperty("privacySettingChannelsPersonalisedRecommendationAction")&&(A.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.toObject(e.privacySettingChannelsPersonalisedRecommendationAction,a),a.oneofs&&(A._privacySettingChannelsPersonalisedRecommendationAction="privacySettingChannelsPersonalisedRecommendationAction")),e.businessBroadcastAssociationAction!=null&&e.hasOwnProperty("businessBroadcastAssociationAction")&&(A.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.toObject(e.businessBroadcastAssociationAction,a),a.oneofs&&(A._businessBroadcastAssociationAction="businessBroadcastAssociationAction")),e.detectedOutcomesStatusAction!=null&&e.hasOwnProperty("detectedOutcomesStatusAction")&&(A.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.toObject(e.detectedOutcomesStatusAction,a),a.oneofs&&(A._detectedOutcomesStatusAction="detectedOutcomesStatusAction")),e.maibaAiFeaturesControlAction!=null&&e.hasOwnProperty("maibaAiFeaturesControlAction")&&(A.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.toObject(e.maibaAiFeaturesControlAction,a),a.oneofs&&(A._maibaAiFeaturesControlAction="maibaAiFeaturesControlAction")),e.businessBroadcastListAction!=null&&e.hasOwnProperty("businessBroadcastListAction")&&(A.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.toObject(e.businessBroadcastListAction,a),a.oneofs&&(A._businessBroadcastListAction="businessBroadcastListAction")),e.musicUserIdAction!=null&&e.hasOwnProperty("musicUserIdAction")&&(A.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.toObject(e.musicUserIdAction,a),a.oneofs&&(A._musicUserIdAction="musicUserIdAction")),e.statusPostOptInNotificationPreferencesAction!=null&&e.hasOwnProperty("statusPostOptInNotificationPreferencesAction")&&(A.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.toObject(e.statusPostOptInNotificationPreferencesAction,a),a.oneofs&&(A._statusPostOptInNotificationPreferencesAction="statusPostOptInNotificationPreferencesAction")),e.avatarUpdatedAction!=null&&e.hasOwnProperty("avatarUpdatedAction")&&(A.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.toObject(e.avatarUpdatedAction,a),a.oneofs&&(A._avatarUpdatedAction="avatarUpdatedAction")),e.privateProcessingSettingAction!=null&&e.hasOwnProperty("privateProcessingSettingAction")&&(A.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.toObject(e.privateProcessingSettingAction,a),a.oneofs&&(A._privateProcessingSettingAction="privateProcessingSettingAction")),e.newsletterSavedInterestsAction!=null&&e.hasOwnProperty("newsletterSavedInterestsAction")&&(A.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.toObject(e.newsletterSavedInterestsAction,a),a.oneofs&&(A._newsletterSavedInterestsAction="newsletterSavedInterestsAction")),e.aiThreadRenameAction!=null&&e.hasOwnProperty("aiThreadRenameAction")&&(A.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.toObject(e.aiThreadRenameAction,a),a.oneofs&&(A._aiThreadRenameAction="aiThreadRenameAction")),e.interactiveMessageAction!=null&&e.hasOwnProperty("interactiveMessageAction")&&(A.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.toObject(e.interactiveMessageAction,a),a.oneofs&&(A._interactiveMessageAction="interactiveMessageAction")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionValue"},t.AgentAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.deviceID=A.int32();break}case 3:{c.isDeleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AgentAction)return A;var r=new p.proto.SyncActionValue.AgentAction;return A.name!=null&&(r.name=String(A.name)),A.deviceID!=null&&(r.deviceID=A.deviceID|0),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.deviceID!=null&&A.hasOwnProperty("deviceID")&&(s.deviceID=A.deviceID,r.oneofs&&(s._deviceID="deviceID")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AgentAction"},i})(),t.AiThreadRenameAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newTitle=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AiThreadRenameAction)return A;var r=new p.proto.SyncActionValue.AiThreadRenameAction;return A.newTitle!=null&&(r.newTitle=String(A.newTitle)),r},i.toObject=function(A,r){r||(r={});var s={};return A.newTitle!=null&&A.hasOwnProperty("newTitle")&&(s.newTitle=A.newTitle,r.oneofs&&(s._newTitle="newTitle")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AiThreadRenameAction"},i})(),t.AndroidUnsupportedActions=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.allowed=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AndroidUnsupportedActions)return A;var r=new p.proto.SyncActionValue.AndroidUnsupportedActions;return A.allowed!=null&&(r.allowed=!!A.allowed),r},i.toObject=function(A,r){r||(r={});var s={};return A.allowed!=null&&A.hasOwnProperty("allowed")&&(s.allowed=A.allowed,r.oneofs&&(s._allowed="allowed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AndroidUnsupportedActions"},i})(),t.ArchiveChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.archived=A.bool();break}case 2:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ArchiveChatAction)return A;var r=new p.proto.SyncActionValue.ArchiveChatAction;if(A.archived!=null&&(r.archived=!!A.archived),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.archived!=null&&A.hasOwnProperty("archived")&&(s.archived=A.archived,r.oneofs&&(s._archived="archived")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ArchiveChatAction"},i})(),t.AvatarUpdatedAction=(function(){function i(a){if(this.recentAvatarStickers=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.eventType=A.int32();break}case 2:{c.recentAvatarStickers&&c.recentAvatarStickers.length||(c.recentAvatarStickers=[]),c.recentAvatarStickers.push(p.proto.SyncActionValue.StickerAction.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AvatarUpdatedAction)return A;var r=new p.proto.SyncActionValue.AvatarUpdatedAction;switch(A.eventType){default:if(typeof A.eventType=="number"){r.eventType=A.eventType;break}break;case"UPDATED":case 0:r.eventType=0;break;case"CREATED":case 1:r.eventType=1;break;case"DELETED":case 2:r.eventType=2;break}if(A.recentAvatarStickers){if(!Array.isArray(A.recentAvatarStickers))throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: array expected");r.recentAvatarStickers=[];for(var s=0;s>>3){case 1:{c.isSent=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BotWelcomeRequestAction)return A;var r=new p.proto.SyncActionValue.BotWelcomeRequestAction;return A.isSent!=null&&(r.isSent=!!A.isSent),r},i.toObject=function(A,r){r||(r={});var s={};return A.isSent!=null&&A.hasOwnProperty("isSent")&&(s.isSent=A.isSent,r.oneofs&&(s._isSent="isSent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BotWelcomeRequestAction"},i})(),t.BroadcastListParticipant=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.lidJid=A.string();break}case 2:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BroadcastListParticipant)return A;var r=new p.proto.SyncActionValue.BroadcastListParticipant;return A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},i.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.lidJid=""),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BroadcastListParticipant"},i})(),t.BusinessBroadcastAssociationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BusinessBroadcastAssociationAction)return A;var r=new p.proto.SyncActionValue.BusinessBroadcastAssociationAction;return A.deleted!=null&&(r.deleted=!!A.deleted),r},i.toObject=function(A,r){r||(r={});var s={};return A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BusinessBroadcastAssociationAction"},i})(),t.BusinessBroadcastListAction=(function(){function i(a){if(this.participants=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deleted=A.bool();break}case 2:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(p.proto.SyncActionValue.BroadcastListParticipant.decode(A,A.uint32()));break}case 3:{c.listName=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BusinessBroadcastListAction)return A;var r=new p.proto.SyncActionValue.BusinessBroadcastListAction;if(A.deleted!=null&&(r.deleted=!!A.deleted),A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{c.callLogRecord=p.proto.CallLogRecord.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.CallLogAction)return A;var r=new p.proto.SyncActionValue.CallLogAction;if(A.callLogRecord!=null){if(typeof A.callLogRecord!="object")throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected");r.callLogRecord=p.proto.CallLogRecord.fromObject(A.callLogRecord)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.callLogRecord!=null&&A.hasOwnProperty("callLogRecord")&&(s.callLogRecord=p.proto.CallLogRecord.toObject(A.callLogRecord,r),r.oneofs&&(s._callLogRecord="callLogRecord")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CallLogAction"},i})(),t.ChatAssignmentAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deviceAgentID=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ChatAssignmentAction)return A;var r=new p.proto.SyncActionValue.ChatAssignmentAction;return A.deviceAgentID!=null&&(r.deviceAgentID=String(A.deviceAgentID)),r},i.toObject=function(A,r){r||(r={});var s={};return A.deviceAgentID!=null&&A.hasOwnProperty("deviceAgentID")&&(s.deviceAgentID=A.deviceAgentID,r.oneofs&&(s._deviceAgentID="deviceAgentID")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentAction"},i})(),t.ChatAssignmentOpenedStatusAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.chatOpened=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction)return A;var r=new p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction;return A.chatOpened!=null&&(r.chatOpened=!!A.chatOpened),r},i.toObject=function(A,r){r||(r={});var s={};return A.chatOpened!=null&&A.hasOwnProperty("chatOpened")&&(s.chatOpened=A.chatOpened,r.oneofs&&(s._chatOpened="chatOpened")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentOpenedStatusAction"},i})(),t.ClearChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ClearChatAction)return A;var r=new p.proto.SyncActionValue.ClearChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ClearChatAction"},i})(),t.ContactAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.lidJid=A.string();break}case 4:{c.saveOnPrimaryAddressbook=A.bool();break}case 5:{c.pnJid=A.string();break}case 6:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ContactAction)return A;var r=new p.proto.SyncActionValue.ContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.saveOnPrimaryAddressbook!=null&&(r.saveOnPrimaryAddressbook=!!A.saveOnPrimaryAddressbook),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),A.username!=null&&(r.username=String(A.username)),r},i.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid,r.oneofs&&(s._lidJid="lidJid")),A.saveOnPrimaryAddressbook!=null&&A.hasOwnProperty("saveOnPrimaryAddressbook")&&(s.saveOnPrimaryAddressbook=A.saveOnPrimaryAddressbook,r.oneofs&&(s._saveOnPrimaryAddressbook="saveOnPrimaryAddressbook")),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ContactAction"},i})(),t.CtwaPerCustomerDataSharingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isCtwaPerCustomerDataSharingEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction)return A;var r=new p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction;return A.isCtwaPerCustomerDataSharingEnabled!=null&&(r.isCtwaPerCustomerDataSharingEnabled=!!A.isCtwaPerCustomerDataSharingEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isCtwaPerCustomerDataSharingEnabled!=null&&A.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")&&(s.isCtwaPerCustomerDataSharingEnabled=A.isCtwaPerCustomerDataSharingEnabled,r.oneofs&&(s._isCtwaPerCustomerDataSharingEnabled="isCtwaPerCustomerDataSharingEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CtwaPerCustomerDataSharingAction"},i})(),t.CustomPaymentMethod=(function(){function i(e){if(this.metadata=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.credentialId=a.string();break}case 2:{g.country=a.string();break}case 3:{g.type=a.string();break}case 4:{g.metadata&&g.metadata.length||(g.metadata=[]),g.metadata.push(p.proto.SyncActionValue.CustomPaymentMethodMetadata.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethod)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethod;if(a.credentialId!=null&&(A.credentialId=String(a.credentialId)),a.country!=null&&(A.country=String(a.country)),a.type!=null&&(A.type=String(a.type)),a.metadata){if(!Array.isArray(a.metadata))throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected");A.metadata=[];for(var r=0;r>>3){case 1:{g.key=a.string();break}case 2:{g.value=a.string();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethodMetadata)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethodMetadata;return a.key!=null&&(A.key=String(a.key)),a.value!=null&&(A.value=String(a.value)),A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.key="",r.value=""),a.key!=null&&a.hasOwnProperty("key")&&(r.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(r.value=a.value),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.CustomPaymentMethodMetadata"},i})(),t.CustomPaymentMethodsAction=(function(){function i(e){if(this.customPaymentMethods=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.customPaymentMethods&&g.customPaymentMethods.length||(g.customPaymentMethods=[]),g.customPaymentMethods.push(p.proto.SyncActionValue.CustomPaymentMethod.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethodsAction)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethodsAction;if(a.customPaymentMethods){if(!Array.isArray(a.customPaymentMethods))throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected");A.customPaymentMethods=[];for(var r=0;r>>3){case 1:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteChatAction)return A;var r=new p.proto.SyncActionValue.DeleteChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteChatAction"},i})(),t.DeleteIndividualCallLogAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.peerJid=A.string();break}case 2:{c.isIncoming=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteIndividualCallLogAction)return A;var r=new p.proto.SyncActionValue.DeleteIndividualCallLogAction;return A.peerJid!=null&&(r.peerJid=String(A.peerJid)),A.isIncoming!=null&&(r.isIncoming=!!A.isIncoming),r},i.toObject=function(A,r){r||(r={});var s={};return A.peerJid!=null&&A.hasOwnProperty("peerJid")&&(s.peerJid=A.peerJid,r.oneofs&&(s._peerJid="peerJid")),A.isIncoming!=null&&A.hasOwnProperty("isIncoming")&&(s.isIncoming=A.isIncoming,r.oneofs&&(s._isIncoming="isIncoming")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteIndividualCallLogAction"},i})(),t.DeleteMessageForMeAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.deleteMedia=A.bool();break}case 2:{c.messageTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteMessageForMeAction)return A;var r=new p.proto.SyncActionValue.DeleteMessageForMeAction;return A.deleteMedia!=null&&(r.deleteMedia=!!A.deleteMedia),A.messageTimestamp!=null&&(l.Long?(r.messageTimestamp=l.Long.fromValue(A.messageTimestamp)).unsigned=!1:typeof A.messageTimestamp=="string"?r.messageTimestamp=parseInt(A.messageTimestamp,10):typeof A.messageTimestamp=="number"?r.messageTimestamp=A.messageTimestamp:typeof A.messageTimestamp=="object"&&(r.messageTimestamp=new l.LongBits(A.messageTimestamp.low>>>0,A.messageTimestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.deleteMedia!=null&&A.hasOwnProperty("deleteMedia")&&(s.deleteMedia=A.deleteMedia,r.oneofs&&(s._deleteMedia="deleteMedia")),A.messageTimestamp!=null&&A.hasOwnProperty("messageTimestamp")&&(typeof A.messageTimestamp=="number"?s.messageTimestamp=r.longs===String?String(A.messageTimestamp):A.messageTimestamp:s.messageTimestamp=r.longs===String?ge(A.messageTimestamp):r.longs===Number?ce(A.messageTimestamp):A.messageTimestamp,r.oneofs&&(s._messageTimestamp="messageTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteMessageForMeAction"},i})(),t.DetectedOutcomesStatusAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DetectedOutcomesStatusAction)return A;var r=new p.proto.SyncActionValue.DetectedOutcomesStatusAction;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DetectedOutcomesStatusAction"},i})(),t.ExternalWebBetaAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isOptIn=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ExternalWebBetaAction)return A;var r=new p.proto.SyncActionValue.ExternalWebBetaAction;return A.isOptIn!=null&&(r.isOptIn=!!A.isOptIn),r},i.toObject=function(A,r){r||(r={});var s={};return A.isOptIn!=null&&A.hasOwnProperty("isOptIn")&&(s.isOptIn=A.isOptIn,r.oneofs&&(s._isOptIn="isOptIn")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ExternalWebBetaAction"},i})(),t.FavoritesAction=(function(){function i(e){if(this.favorites=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.favorites&&g.favorites.length||(g.favorites=[]),g.favorites.push(p.proto.SyncActionValue.FavoritesAction.Favorite.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.FavoritesAction)return a;var A=new p.proto.SyncActionValue.FavoritesAction;if(a.favorites){if(!Array.isArray(a.favorites))throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected");A.favorites=[];for(var r=0;r>>3){case 1:{I.id=r.string();break}default:r.skipType(d&7);break}}return I},e.fromObject=function(r){if(r instanceof p.proto.SyncActionValue.FavoritesAction.Favorite)return r;var s=new p.proto.SyncActionValue.FavoritesAction.Favorite;return r.id!=null&&(s.id=String(r.id)),s},e.toObject=function(r,s){s||(s={});var g={};return r.id!=null&&r.hasOwnProperty("id")&&(g.id=r.id,s.oneofs&&(g._id="id")),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},e.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/proto.SyncActionValue.FavoritesAction.Favorite"},e})(),i})(),t.InteractiveMessageAction=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.type=a.int32();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.InteractiveMessageAction)return a;var A=new p.proto.SyncActionValue.InteractiveMessageAction;switch(a.type){default:if(typeof a.type=="number"){A.type=a.type;break}break;case"DISABLE_CTA":case 1:A.type=1;break}return A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.type=A.enums===String?"DISABLE_CTA":1),a.type!=null&&a.hasOwnProperty("type")&&(r.type=A.enums===String?p.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[a.type]===void 0?a.type:p.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[a.type]:a.type),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.InteractiveMessageAction"},i.InteractiveMessageActionMode=(function(){let e={},a=Object.create(e);return a[e[1]="DISABLE_CTA"]=1,a})(),i})(),t.KeyExpiration=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.expiredKeyEpoch=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.KeyExpiration)return A;var r=new p.proto.SyncActionValue.KeyExpiration;return A.expiredKeyEpoch!=null&&(r.expiredKeyEpoch=A.expiredKeyEpoch|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.expiredKeyEpoch!=null&&A.hasOwnProperty("expiredKeyEpoch")&&(s.expiredKeyEpoch=A.expiredKeyEpoch,r.oneofs&&(s._expiredKeyEpoch="expiredKeyEpoch")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.KeyExpiration"},i})(),t.LabelAssociationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.labeled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LabelAssociationAction)return A;var r=new p.proto.SyncActionValue.LabelAssociationAction;return A.labeled!=null&&(r.labeled=!!A.labeled),r},i.toObject=function(A,r){r||(r={});var s={};return A.labeled!=null&&A.hasOwnProperty("labeled")&&(s.labeled=A.labeled,r.oneofs&&(s._labeled="labeled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelAssociationAction"},i})(),t.LabelEditAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.color=A.int32();break}case 3:{c.predefinedId=A.int32();break}case 4:{c.deleted=A.bool();break}case 5:{c.orderIndex=A.int32();break}case 6:{c.isActive=A.bool();break}case 7:{c.type=A.int32();break}case 8:{c.isImmutable=A.bool();break}case 9:{c.muteEndTimeMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LabelEditAction)return A;var r=new p.proto.SyncActionValue.LabelEditAction;switch(A.name!=null&&(r.name=String(A.name)),A.color!=null&&(r.color=A.color|0),A.predefinedId!=null&&(r.predefinedId=A.predefinedId|0),A.deleted!=null&&(r.deleted=!!A.deleted),A.orderIndex!=null&&(r.orderIndex=A.orderIndex|0),A.isActive!=null&&(r.isActive=!!A.isActive),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"NONE":case 0:r.type=0;break;case"UNREAD":case 1:r.type=1;break;case"GROUPS":case 2:r.type=2;break;case"FAVORITES":case 3:r.type=3;break;case"PREDEFINED":case 4:r.type=4;break;case"CUSTOM":case 5:r.type=5;break;case"COMMUNITY":case 6:r.type=6;break;case"SERVER_ASSIGNED":case 7:r.type=7;break;case"DRAFTED":case 8:r.type=8;break;case"AI_HANDOFF":case 9:r.type=9;break}return A.isImmutable!=null&&(r.isImmutable=!!A.isImmutable),A.muteEndTimeMs!=null&&(l.Long?(r.muteEndTimeMs=l.Long.fromValue(A.muteEndTimeMs)).unsigned=!1:typeof A.muteEndTimeMs=="string"?r.muteEndTimeMs=parseInt(A.muteEndTimeMs,10):typeof A.muteEndTimeMs=="number"?r.muteEndTimeMs=A.muteEndTimeMs:typeof A.muteEndTimeMs=="object"&&(r.muteEndTimeMs=new l.LongBits(A.muteEndTimeMs.low>>>0,A.muteEndTimeMs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.color!=null&&A.hasOwnProperty("color")&&(s.color=A.color,r.oneofs&&(s._color="color")),A.predefinedId!=null&&A.hasOwnProperty("predefinedId")&&(s.predefinedId=A.predefinedId,r.oneofs&&(s._predefinedId="predefinedId")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.orderIndex!=null&&A.hasOwnProperty("orderIndex")&&(s.orderIndex=A.orderIndex,r.oneofs&&(s._orderIndex="orderIndex")),A.isActive!=null&&A.hasOwnProperty("isActive")&&(s.isActive=A.isActive,r.oneofs&&(s._isActive="isActive")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.SyncActionValue.LabelEditAction.ListType[A.type]===void 0?A.type:p.proto.SyncActionValue.LabelEditAction.ListType[A.type]:A.type,r.oneofs&&(s._type="type")),A.isImmutable!=null&&A.hasOwnProperty("isImmutable")&&(s.isImmutable=A.isImmutable,r.oneofs&&(s._isImmutable="isImmutable")),A.muteEndTimeMs!=null&&A.hasOwnProperty("muteEndTimeMs")&&(typeof A.muteEndTimeMs=="number"?s.muteEndTimeMs=r.longs===String?String(A.muteEndTimeMs):A.muteEndTimeMs:s.muteEndTimeMs=r.longs===String?ge(A.muteEndTimeMs):r.longs===Number?ce(A.muteEndTimeMs):A.muteEndTimeMs,r.oneofs&&(s._muteEndTimeMs="muteEndTimeMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelEditAction"},i.ListType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="UNREAD"]=1,A[a[2]="GROUPS"]=2,A[a[3]="FAVORITES"]=3,A[a[4]="PREDEFINED"]=4,A[a[5]="CUSTOM"]=5,A[a[6]="COMMUNITY"]=6,A[a[7]="SERVER_ASSIGNED"]=7,A[a[8]="DRAFTED"]=8,A[a[9]="AI_HANDOFF"]=9,A})(),i})(),t.LabelReorderingAction=(function(){function i(e){if(this.sortedLabelIds=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{if(g.sortedLabelIds&&g.sortedLabelIds.length||(g.sortedLabelIds=[]),(c&7)===2)for(var I=a.uint32()+a.pos;a.pos>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LidContactAction)return A;var r=new p.proto.SyncActionValue.LidContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.username!=null&&(r.username=String(A.username)),r},i.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LidContactAction"},i})(),t.LocaleSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.locale=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LocaleSetting)return A;var r=new p.proto.SyncActionValue.LocaleSetting;return A.locale!=null&&(r.locale=String(A.locale)),r},i.toObject=function(A,r){r||(r={});var s={};return A.locale!=null&&A.hasOwnProperty("locale")&&(s.locale=A.locale,r.oneofs&&(s._locale="locale")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LocaleSetting"},i})(),t.LockChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.locked=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LockChatAction)return A;var r=new p.proto.SyncActionValue.LockChatAction;return A.locked!=null&&(r.locked=!!A.locked),r},i.toObject=function(A,r){r||(r={});var s={};return A.locked!=null&&A.hasOwnProperty("locked")&&(s.locked=A.locked,r.oneofs&&(s._locked="locked")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LockChatAction"},i})(),t.MaibaAIFeaturesControlAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.aiFeatureStatus=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MaibaAIFeaturesControlAction)return A;var r=new p.proto.SyncActionValue.MaibaAIFeaturesControlAction;switch(A.aiFeatureStatus){default:if(typeof A.aiFeatureStatus=="number"){r.aiFeatureStatus=A.aiFeatureStatus;break}break;case"ENABLED":case 0:r.aiFeatureStatus=0;break;case"ENABLED_HAS_LEARNING":case 1:r.aiFeatureStatus=1;break;case"DISABLED":case 2:r.aiFeatureStatus=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.aiFeatureStatus!=null&&A.hasOwnProperty("aiFeatureStatus")&&(s.aiFeatureStatus=r.enums===String?p.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]===void 0?A.aiFeatureStatus:p.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]:A.aiFeatureStatus,r.oneofs&&(s._aiFeatureStatus="aiFeatureStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MaibaAIFeaturesControlAction"},i.MaibaAIFeatureStatus=(function(){let a={},A=Object.create(a);return A[a[0]="ENABLED"]=0,A[a[1]="ENABLED_HAS_LEARNING"]=1,A[a[2]="DISABLED"]=2,A})(),i})(),t.MarkChatAsReadAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.read=A.bool();break}case 2:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarkChatAsReadAction)return A;var r=new p.proto.SyncActionValue.MarkChatAsReadAction;if(A.read!=null&&(r.read=!!A.read),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected");r.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.read!=null&&A.hasOwnProperty("read")&&(s.read=A.read,r.oneofs&&(s._read="read")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarkChatAsReadAction"},i})(),t.MarketingMessageAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.message=A.string();break}case 3:{c.type=A.int32();break}case 4:{c.createdAt=A.int64();break}case 5:{c.lastSentAt=A.int64();break}case 6:{c.isDeleted=A.bool();break}case 7:{c.mediaId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarketingMessageAction)return A;var r=new p.proto.SyncActionValue.MarketingMessageAction;switch(A.name!=null&&(r.name=String(A.name)),A.message!=null&&(r.message=String(A.message)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PERSONALIZED":case 0:r.type=0;break}return A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.lastSentAt!=null&&(l.Long?(r.lastSentAt=l.Long.fromValue(A.lastSentAt)).unsigned=!1:typeof A.lastSentAt=="string"?r.lastSentAt=parseInt(A.lastSentAt,10):typeof A.lastSentAt=="number"?r.lastSentAt=A.lastSentAt:typeof A.lastSentAt=="object"&&(r.lastSentAt=new l.LongBits(A.lastSentAt.low>>>0,A.lastSentAt.high>>>0).toNumber())),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),A.mediaId!=null&&(r.mediaId=String(A.mediaId)),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]===void 0?A.type:p.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]:A.type,r.oneofs&&(s._type="type")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.lastSentAt!=null&&A.hasOwnProperty("lastSentAt")&&(typeof A.lastSentAt=="number"?s.lastSentAt=r.longs===String?String(A.lastSentAt):A.lastSentAt:s.lastSentAt=r.longs===String?ge(A.lastSentAt):r.longs===Number?ce(A.lastSentAt):A.lastSentAt,r.oneofs&&(s._lastSentAt="lastSentAt")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),A.mediaId!=null&&A.hasOwnProperty("mediaId")&&(s.mediaId=A.mediaId,r.oneofs&&(s._mediaId="mediaId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageAction"},i.MarketingMessagePrototypeType=(function(){let a={},A=Object.create(a);return A[a[0]="PERSONALIZED"]=0,A})(),i})(),t.MarketingMessageBroadcastAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.repliedCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarketingMessageBroadcastAction)return A;var r=new p.proto.SyncActionValue.MarketingMessageBroadcastAction;return A.repliedCount!=null&&(r.repliedCount=A.repliedCount|0),r},i.toObject=function(A,r){r||(r={});var s={};return A.repliedCount!=null&&A.hasOwnProperty("repliedCount")&&(s.repliedCount=A.repliedCount,r.oneofs&&(s._repliedCount="repliedCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageBroadcastAction"},i})(),t.MerchantPaymentPartnerAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.country=A.string();break}case 3:{c.gatewayName=A.string();break}case 4:{c.credentialId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MerchantPaymentPartnerAction)return A;var r=new p.proto.SyncActionValue.MerchantPaymentPartnerAction;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"ACTIVE":case 0:r.status=0;break;case"INACTIVE":case 1:r.status=1;break}return A.country!=null&&(r.country=String(A.country)),A.gatewayName!=null&&(r.gatewayName=String(A.gatewayName)),A.credentialId!=null&&(r.credentialId=String(A.credentialId)),r},i.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.status=r.enums===String?"ACTIVE":0,s.country=""),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?p.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]===void 0?A.status:p.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]:A.status),A.country!=null&&A.hasOwnProperty("country")&&(s.country=A.country),A.gatewayName!=null&&A.hasOwnProperty("gatewayName")&&(s.gatewayName=A.gatewayName,r.oneofs&&(s._gatewayName="gatewayName")),A.credentialId!=null&&A.hasOwnProperty("credentialId")&&(s.credentialId=A.credentialId,r.oneofs&&(s._credentialId="credentialId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MerchantPaymentPartnerAction"},i.Status=(function(){let a={},A=Object.create(a);return A[a[0]="ACTIVE"]=0,A[a[1]="INACTIVE"]=1,A})(),i})(),t.MusicUserIdAction=(function(){function i(a){if(this.musicUserIdMap={},a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.musicUserId=A.string();break}case 2:{c.musicUserIdMap===l.emptyObject&&(c.musicUserIdMap={});var f=A.uint32()+A.pos;for(I="",d="";A.pos>>3){case 1:I=A.string();break;case 2:d=A.string();break;default:A.skipType(Q&7);break}}c.musicUserIdMap[I]=d;break}default:A.skipType(B&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MusicUserIdAction)return A;var r=new p.proto.SyncActionValue.MusicUserIdAction;if(A.musicUserId!=null&&(r.musicUserId=String(A.musicUserId)),A.musicUserIdMap){if(typeof A.musicUserIdMap!="object")throw TypeError(".proto.SyncActionValue.MusicUserIdAction.musicUserIdMap: object expected");r.musicUserIdMap={};for(var s=Object.keys(A.musicUserIdMap),g=0;g>>3){case 1:{c.muted=A.bool();break}case 2:{c.muteEndTimestamp=A.int64();break}case 3:{c.autoMuted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MuteAction)return A;var r=new p.proto.SyncActionValue.MuteAction;return A.muted!=null&&(r.muted=!!A.muted),A.muteEndTimestamp!=null&&(l.Long?(r.muteEndTimestamp=l.Long.fromValue(A.muteEndTimestamp)).unsigned=!1:typeof A.muteEndTimestamp=="string"?r.muteEndTimestamp=parseInt(A.muteEndTimestamp,10):typeof A.muteEndTimestamp=="number"?r.muteEndTimestamp=A.muteEndTimestamp:typeof A.muteEndTimestamp=="object"&&(r.muteEndTimestamp=new l.LongBits(A.muteEndTimestamp.low>>>0,A.muteEndTimestamp.high>>>0).toNumber())),A.autoMuted!=null&&(r.autoMuted=!!A.autoMuted),r},i.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),A.muteEndTimestamp!=null&&A.hasOwnProperty("muteEndTimestamp")&&(typeof A.muteEndTimestamp=="number"?s.muteEndTimestamp=r.longs===String?String(A.muteEndTimestamp):A.muteEndTimestamp:s.muteEndTimestamp=r.longs===String?ge(A.muteEndTimestamp):r.longs===Number?ce(A.muteEndTimestamp):A.muteEndTimestamp,r.oneofs&&(s._muteEndTimestamp="muteEndTimestamp")),A.autoMuted!=null&&A.hasOwnProperty("autoMuted")&&(s.autoMuted=A.autoMuted,r.oneofs&&(s._autoMuted="autoMuted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MuteAction"},i})(),t.NewsletterSavedInterestsAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.newsletterSavedInterests=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NewsletterSavedInterestsAction)return A;var r=new p.proto.SyncActionValue.NewsletterSavedInterestsAction;return A.newsletterSavedInterests!=null&&(r.newsletterSavedInterests=String(A.newsletterSavedInterests)),r},i.toObject=function(A,r){r||(r={});var s={};return A.newsletterSavedInterests!=null&&A.hasOwnProperty("newsletterSavedInterests")&&(s.newsletterSavedInterests=A.newsletterSavedInterests,r.oneofs&&(s._newsletterSavedInterests="newsletterSavedInterests")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NewsletterSavedInterestsAction"},i})(),t.NoteEditAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.chatJid=A.string();break}case 3:{c.createdAt=A.int64();break}case 4:{c.deleted=A.bool();break}case 5:{c.unstructuredContent=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NoteEditAction)return A;var r=new p.proto.SyncActionValue.NoteEditAction;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNSTRUCTURED":case 1:r.type=1;break;case"STRUCTURED":case 2:r.type=2;break}return A.chatJid!=null&&(r.chatJid=String(A.chatJid)),A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.deleted!=null&&(r.deleted=!!A.deleted),A.unstructuredContent!=null&&(r.unstructuredContent=String(A.unstructuredContent)),r},i.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?p.proto.SyncActionValue.NoteEditAction.NoteType[A.type]===void 0?A.type:p.proto.SyncActionValue.NoteEditAction.NoteType[A.type]:A.type,r.oneofs&&(s._type="type")),A.chatJid!=null&&A.hasOwnProperty("chatJid")&&(s.chatJid=A.chatJid,r.oneofs&&(s._chatJid="chatJid")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.unstructuredContent!=null&&A.hasOwnProperty("unstructuredContent")&&(s.unstructuredContent=A.unstructuredContent,r.oneofs&&(s._unstructuredContent="unstructuredContent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NoteEditAction"},i.NoteType=(function(){let a={},A=Object.create(a);return A[a[1]="UNSTRUCTURED"]=1,A[a[2]="STRUCTURED"]=2,A})(),i})(),t.NotificationActivitySettingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.notificationActivitySetting=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NotificationActivitySettingAction)return A;var r=new p.proto.SyncActionValue.NotificationActivitySettingAction;switch(A.notificationActivitySetting){default:if(typeof A.notificationActivitySetting=="number"){r.notificationActivitySetting=A.notificationActivitySetting;break}break;case"DEFAULT_ALL_MESSAGES":case 0:r.notificationActivitySetting=0;break;case"ALL_MESSAGES":case 1:r.notificationActivitySetting=1;break;case"HIGHLIGHTS":case 2:r.notificationActivitySetting=2;break;case"DEFAULT_HIGHLIGHTS":case 3:r.notificationActivitySetting=3;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.notificationActivitySetting!=null&&A.hasOwnProperty("notificationActivitySetting")&&(s.notificationActivitySetting=r.enums===String?p.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]===void 0?A.notificationActivitySetting:p.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]:A.notificationActivitySetting,r.oneofs&&(s._notificationActivitySetting="notificationActivitySetting")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NotificationActivitySettingAction"},i.NotificationActivitySetting=(function(){let a={},A=Object.create(a);return A[a[0]="DEFAULT_ALL_MESSAGES"]=0,A[a[1]="ALL_MESSAGES"]=1,A[a[2]="HIGHLIGHTS"]=2,A[a[3]="DEFAULT_HIGHLIGHTS"]=3,A})(),i})(),t.NuxAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.acknowledged=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NuxAction)return A;var r=new p.proto.SyncActionValue.NuxAction;return A.acknowledged!=null&&(r.acknowledged=!!A.acknowledged),r},i.toObject=function(A,r){r||(r={});var s={};return A.acknowledged!=null&&A.hasOwnProperty("acknowledged")&&(s.acknowledged=A.acknowledged,r.oneofs&&(s._acknowledged="acknowledged")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NuxAction"},i})(),t.PaymentInfoAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.cpi=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PaymentInfoAction)return A;var r=new p.proto.SyncActionValue.PaymentInfoAction;return A.cpi!=null&&(r.cpi=String(A.cpi)),r},i.toObject=function(A,r){r||(r={});var s={};return A.cpi!=null&&A.hasOwnProperty("cpi")&&(s.cpi=A.cpi,r.oneofs&&(s._cpi="cpi")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PaymentInfoAction"},i})(),t.PaymentTosAction=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.paymentNotice=a.int32();break}case 2:{g.accepted=a.bool();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.PaymentTosAction)return a;var A=new p.proto.SyncActionValue.PaymentTosAction;switch(a.paymentNotice){default:if(typeof a.paymentNotice=="number"){A.paymentNotice=a.paymentNotice;break}break;case"BR_PAY_PRIVACY_POLICY":case 0:A.paymentNotice=0;break}return a.accepted!=null&&(A.accepted=!!a.accepted),A},i.toObject=function(a,A){A||(A={});var r={};return A.defaults&&(r.paymentNotice=A.enums===String?"BR_PAY_PRIVACY_POLICY":0,r.accepted=!1),a.paymentNotice!=null&&a.hasOwnProperty("paymentNotice")&&(r.paymentNotice=A.enums===String?p.proto.SyncActionValue.PaymentTosAction.PaymentNotice[a.paymentNotice]===void 0?a.paymentNotice:p.proto.SyncActionValue.PaymentTosAction.PaymentNotice[a.paymentNotice]:a.paymentNotice),a.accepted!=null&&a.hasOwnProperty("accepted")&&(r.accepted=a.accepted),r},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.PaymentTosAction"},i.PaymentNotice=(function(){let e={},a=Object.create(e);return a[e[0]="BR_PAY_PRIVACY_POLICY"]=0,a})(),i})(),t.PinAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.pinned=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PinAction)return A;var r=new p.proto.SyncActionValue.PinAction;return A.pinned!=null&&(r.pinned=!!A.pinned),r},i.toObject=function(A,r){r||(r={});var s={};return A.pinned!=null&&A.hasOwnProperty("pinned")&&(s.pinned=A.pinned,r.oneofs&&(s._pinned="pinned")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PinAction"},i})(),t.PnForLidChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PnForLidChatAction)return A;var r=new p.proto.SyncActionValue.PnForLidChatAction;return A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},i.toObject=function(A,r){r||(r={});var s={};return A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PnForLidChatAction"},i})(),t.PrimaryFeature=(function(){function i(e){if(this.flags=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.flags&&g.flags.length||(g.flags=[]),g.flags.push(a.string());break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.PrimaryFeature)return a;var A=new p.proto.SyncActionValue.PrimaryFeature;if(a.flags){if(!Array.isArray(a.flags))throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected");A.flags=[];for(var r=0;r>>3){case 1:{c.version=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrimaryVersionAction)return A;var r=new p.proto.SyncActionValue.PrimaryVersionAction;return A.version!=null&&(r.version=String(A.version)),r},i.toObject=function(A,r){r||(r={});var s={};return A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrimaryVersionAction"},i})(),t.PrivacySettingChannelsPersonalisedRecommendationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isUserOptedOut=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction)return A;var r=new p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction;return A.isUserOptedOut!=null&&(r.isUserOptedOut=!!A.isUserOptedOut),r},i.toObject=function(A,r){r||(r={});var s={};return A.isUserOptedOut!=null&&A.hasOwnProperty("isUserOptedOut")&&(s.isUserOptedOut=A.isUserOptedOut,r.oneofs&&(s._isUserOptedOut="isUserOptedOut")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction"},i})(),t.PrivacySettingDisableLinkPreviewsAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isPreviewsDisabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction)return A;var r=new p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction;return A.isPreviewsDisabled!=null&&(r.isPreviewsDisabled=!!A.isPreviewsDisabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isPreviewsDisabled!=null&&A.hasOwnProperty("isPreviewsDisabled")&&(s.isPreviewsDisabled=A.isPreviewsDisabled,r.oneofs&&(s._isPreviewsDisabled="isPreviewsDisabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction"},i})(),t.PrivacySettingRelayAllCalls=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingRelayAllCalls)return A;var r=new p.proto.SyncActionValue.PrivacySettingRelayAllCalls;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingRelayAllCalls"},i})(),t.PrivateProcessingSettingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.privateProcessingStatus=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivateProcessingSettingAction)return A;var r=new p.proto.SyncActionValue.PrivateProcessingSettingAction;switch(A.privateProcessingStatus){default:if(typeof A.privateProcessingStatus=="number"){r.privateProcessingStatus=A.privateProcessingStatus;break}break;case"UNDEFINED":case 0:r.privateProcessingStatus=0;break;case"ENABLED":case 1:r.privateProcessingStatus=1;break;case"DISABLED":case 2:r.privateProcessingStatus=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.privateProcessingStatus!=null&&A.hasOwnProperty("privateProcessingStatus")&&(s.privateProcessingStatus=r.enums===String?p.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]===void 0?A.privateProcessingStatus:p.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]:A.privateProcessingStatus,r.oneofs&&(s._privateProcessingStatus="privateProcessingStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivateProcessingSettingAction"},i.PrivateProcessingStatus=(function(){let a={},A=Object.create(a);return A[a[0]="UNDEFINED"]=0,A[a[1]="ENABLED"]=1,A[a[2]="DISABLED"]=2,A})(),i})(),t.PushNameSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.name=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PushNameSetting)return A;var r=new p.proto.SyncActionValue.PushNameSetting;return A.name!=null&&(r.name=String(A.name)),r},i.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PushNameSetting"},i})(),t.QuickReplyAction=(function(){function i(a){if(this.keywords=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.shortcut=A.string();break}case 2:{c.message=A.string();break}case 3:{c.keywords&&c.keywords.length||(c.keywords=[]),c.keywords.push(A.string());break}case 4:{c.count=A.int32();break}case 5:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.QuickReplyAction)return A;var r=new p.proto.SyncActionValue.QuickReplyAction;if(A.shortcut!=null&&(r.shortcut=String(A.shortcut)),A.message!=null&&(r.message=String(A.message)),A.keywords){if(!Array.isArray(A.keywords))throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected");r.keywords=[];for(var s=0;s>>3){case 1:{g.weights&&g.weights.length||(g.weights=[]),g.weights.push(p.proto.RecentEmojiWeight.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.RecentEmojiWeightsAction)return a;var A=new p.proto.SyncActionValue.RecentEmojiWeightsAction;if(a.weights){if(!Array.isArray(a.weights))throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected");A.weights=[];for(var r=0;r>>3){case 1:{c.lastStickerSentTs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.RemoveRecentStickerAction)return A;var r=new p.proto.SyncActionValue.RemoveRecentStickerAction;return A.lastStickerSentTs!=null&&(l.Long?(r.lastStickerSentTs=l.Long.fromValue(A.lastStickerSentTs)).unsigned=!1:typeof A.lastStickerSentTs=="string"?r.lastStickerSentTs=parseInt(A.lastStickerSentTs,10):typeof A.lastStickerSentTs=="number"?r.lastStickerSentTs=A.lastStickerSentTs:typeof A.lastStickerSentTs=="object"&&(r.lastStickerSentTs=new l.LongBits(A.lastStickerSentTs.low>>>0,A.lastStickerSentTs.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.lastStickerSentTs!=null&&A.hasOwnProperty("lastStickerSentTs")&&(typeof A.lastStickerSentTs=="number"?s.lastStickerSentTs=r.longs===String?String(A.lastStickerSentTs):A.lastStickerSentTs:s.lastStickerSentTs=r.longs===String?ge(A.lastStickerSentTs):r.longs===Number?ce(A.lastStickerSentTs):A.lastStickerSentTs,r.oneofs&&(s._lastStickerSentTs="lastStickerSentTs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.RemoveRecentStickerAction"},i})(),t.StarAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.starred=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StarAction)return A;var r=new p.proto.SyncActionValue.StarAction;return A.starred!=null&&(r.starred=!!A.starred),r},i.toObject=function(A,r){r||(r={});var s={};return A.starred!=null&&A.hasOwnProperty("starred")&&(s.starred=A.starred,r.oneofs&&(s._starred="starred")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StarAction"},i})(),t.StatusPostOptInNotificationPreferencesAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.enabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction)return A;var r=new p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction;return A.enabled!=null&&(r.enabled=!!A.enabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.enabled!=null&&A.hasOwnProperty("enabled")&&(s.enabled=A.enabled,r.oneofs&&(s._enabled="enabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction"},i})(),t.StatusPrivacyAction=(function(){function i(a){if(this.userJid=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.mode=A.int32();break}case 2:{c.userJid&&c.userJid.length||(c.userJid=[]),c.userJid.push(A.string());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StatusPrivacyAction)return A;var r=new p.proto.SyncActionValue.StatusPrivacyAction;switch(A.mode){default:if(typeof A.mode=="number"){r.mode=A.mode;break}break;case"ALLOW_LIST":case 0:r.mode=0;break;case"DENY_LIST":case 1:r.mode=1;break;case"CONTACTS":case 2:r.mode=2;break;case"CLOSE_FRIENDS":case 3:r.mode=3;break}if(A.userJid){if(!Array.isArray(A.userJid))throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected");r.userJid=[];for(var s=0;s>>3){case 1:{c.url=A.string();break}case 2:{c.fileEncSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.mimetype=A.string();break}case 5:{c.height=A.uint32();break}case 6:{c.width=A.uint32();break}case 7:{c.directPath=A.string();break}case 8:{c.fileLength=A.uint64();break}case 9:{c.isFavorite=A.bool();break}case 10:{c.deviceIdHint=A.uint32();break}case 11:{c.isLottie=A.bool();break}case 12:{c.imageHash=A.string();break}case 13:{c.isAvatarSticker=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StickerAction)return A;var r=new p.proto.SyncActionValue.StickerAction;return A.url!=null&&(r.url=String(A.url)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.isFavorite!=null&&(r.isFavorite=!!A.isFavorite),A.deviceIdHint!=null&&(r.deviceIdHint=A.deviceIdHint>>>0),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.imageHash!=null&&(r.imageHash=String(A.imageHash)),A.isAvatarSticker!=null&&(r.isAvatarSticker=!!A.isAvatarSticker),r},i.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.isFavorite!=null&&A.hasOwnProperty("isFavorite")&&(s.isFavorite=A.isFavorite,r.oneofs&&(s._isFavorite="isFavorite")),A.deviceIdHint!=null&&A.hasOwnProperty("deviceIdHint")&&(s.deviceIdHint=A.deviceIdHint,r.oneofs&&(s._deviceIdHint="deviceIdHint")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.imageHash!=null&&A.hasOwnProperty("imageHash")&&(s.imageHash=A.imageHash,r.oneofs&&(s._imageHash="imageHash")),A.isAvatarSticker!=null&&A.hasOwnProperty("isAvatarSticker")&&(s.isAvatarSticker=A.isAvatarSticker,r.oneofs&&(s._isAvatarSticker="isAvatarSticker")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StickerAction"},i})(),t.SubscriptionAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.isDeactivated=A.bool();break}case 2:{c.isAutoRenewing=A.bool();break}case 3:{c.expirationDate=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SubscriptionAction)return A;var r=new p.proto.SyncActionValue.SubscriptionAction;return A.isDeactivated!=null&&(r.isDeactivated=!!A.isDeactivated),A.isAutoRenewing!=null&&(r.isAutoRenewing=!!A.isAutoRenewing),A.expirationDate!=null&&(l.Long?(r.expirationDate=l.Long.fromValue(A.expirationDate)).unsigned=!1:typeof A.expirationDate=="string"?r.expirationDate=parseInt(A.expirationDate,10):typeof A.expirationDate=="number"?r.expirationDate=A.expirationDate:typeof A.expirationDate=="object"&&(r.expirationDate=new l.LongBits(A.expirationDate.low>>>0,A.expirationDate.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.isDeactivated!=null&&A.hasOwnProperty("isDeactivated")&&(s.isDeactivated=A.isDeactivated,r.oneofs&&(s._isDeactivated="isDeactivated")),A.isAutoRenewing!=null&&A.hasOwnProperty("isAutoRenewing")&&(s.isAutoRenewing=A.isAutoRenewing,r.oneofs&&(s._isAutoRenewing="isAutoRenewing")),A.expirationDate!=null&&A.hasOwnProperty("expirationDate")&&(typeof A.expirationDate=="number"?s.expirationDate=r.longs===String?String(A.expirationDate):A.expirationDate:s.expirationDate=r.longs===String?ge(A.expirationDate):r.longs===Number?ce(A.expirationDate):A.expirationDate,r.oneofs&&(s._expirationDate="expirationDate")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SubscriptionAction"},i})(),t.SyncActionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SyncActionMessage)return A;var r=new p.proto.SyncActionValue.SyncActionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected");r.key=p.proto.MessageKey.fromObject(A.key)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SyncActionMessage"},i})(),t.SyncActionMessageRange=(function(){function i(a){if(this.messages=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.lastMessageTimestamp=A.int64();break}case 2:{c.lastSystemMessageTimestamp=A.int64();break}case 3:{c.messages&&c.messages.length||(c.messages=[]),c.messages.push(p.proto.SyncActionValue.SyncActionMessage.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SyncActionMessageRange)return A;var r=new p.proto.SyncActionValue.SyncActionMessageRange;if(A.lastMessageTimestamp!=null&&(l.Long?(r.lastMessageTimestamp=l.Long.fromValue(A.lastMessageTimestamp)).unsigned=!1:typeof A.lastMessageTimestamp=="string"?r.lastMessageTimestamp=parseInt(A.lastMessageTimestamp,10):typeof A.lastMessageTimestamp=="number"?r.lastMessageTimestamp=A.lastMessageTimestamp:typeof A.lastMessageTimestamp=="object"&&(r.lastMessageTimestamp=new l.LongBits(A.lastMessageTimestamp.low>>>0,A.lastMessageTimestamp.high>>>0).toNumber())),A.lastSystemMessageTimestamp!=null&&(l.Long?(r.lastSystemMessageTimestamp=l.Long.fromValue(A.lastSystemMessageTimestamp)).unsigned=!1:typeof A.lastSystemMessageTimestamp=="string"?r.lastSystemMessageTimestamp=parseInt(A.lastSystemMessageTimestamp,10):typeof A.lastSystemMessageTimestamp=="number"?r.lastSystemMessageTimestamp=A.lastSystemMessageTimestamp:typeof A.lastSystemMessageTimestamp=="object"&&(r.lastSystemMessageTimestamp=new l.LongBits(A.lastSystemMessageTimestamp.low>>>0,A.lastSystemMessageTimestamp.high>>>0).toNumber())),A.messages){if(!Array.isArray(A.messages))throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected");r.messages=[];for(var s=0;s>>3){case 1:{c.isTwentyFourHourFormatEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.TimeFormatAction)return A;var r=new p.proto.SyncActionValue.TimeFormatAction;return A.isTwentyFourHourFormatEnabled!=null&&(r.isTwentyFourHourFormatEnabled=!!A.isTwentyFourHourFormatEnabled),r},i.toObject=function(A,r){r||(r={});var s={};return A.isTwentyFourHourFormatEnabled!=null&&A.hasOwnProperty("isTwentyFourHourFormatEnabled")&&(s.isTwentyFourHourFormatEnabled=A.isTwentyFourHourFormatEnabled,r.oneofs&&(s._isTwentyFourHourFormatEnabled="isTwentyFourHourFormatEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.TimeFormatAction"},i})(),t.UGCBot=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.definition=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UGCBot)return A;var r=new p.proto.SyncActionValue.UGCBot;return A.definition!=null&&(typeof A.definition=="string"?l.base64.decode(A.definition,r.definition=l.newBuffer(l.base64.length(A.definition)),0):A.definition.length>=0&&(r.definition=A.definition)),r},i.toObject=function(A,r){r||(r={});var s={};return A.definition!=null&&A.hasOwnProperty("definition")&&(s.definition=r.bytes===String?l.base64.encode(A.definition,0,A.definition.length):r.bytes===Array?Array.prototype.slice.call(A.definition):A.definition,r.oneofs&&(s._definition="definition")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UGCBot"},i})(),t.UnarchiveChatsSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.unarchiveChats=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UnarchiveChatsSetting)return A;var r=new p.proto.SyncActionValue.UnarchiveChatsSetting;return A.unarchiveChats!=null&&(r.unarchiveChats=!!A.unarchiveChats),r},i.toObject=function(A,r){r||(r={});var s={};return A.unarchiveChats!=null&&A.hasOwnProperty("unarchiveChats")&&(s.unarchiveChats=A.unarchiveChats,r.oneofs&&(s._unarchiveChats="unarchiveChats")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UnarchiveChatsSetting"},i})(),t.UserStatusMuteAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.muted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UserStatusMuteAction)return A;var r=new p.proto.SyncActionValue.UserStatusMuteAction;return A.muted!=null&&(r.muted=!!A.muted),r},i.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UserStatusMuteAction"},i})(),t.UsernameChatStartModeAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.chatStartMode=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UsernameChatStartModeAction)return A;var r=new p.proto.SyncActionValue.UsernameChatStartModeAction;switch(A.chatStartMode){default:if(typeof A.chatStartMode=="number"){r.chatStartMode=A.chatStartMode;break}break;case"LID":case 1:r.chatStartMode=1;break;case"PN":case 2:r.chatStartMode=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.chatStartMode!=null&&A.hasOwnProperty("chatStartMode")&&(s.chatStartMode=r.enums===String?p.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]===void 0?A.chatStartMode:p.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]:A.chatStartMode,r.oneofs&&(s._chatStartMode="chatStartMode")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UsernameChatStartModeAction"},i.ChatStartMode=(function(){let a={},A=Object.create(a);return A[a[1]="LID"]=1,A[a[2]="PN"]=2,A})(),i})(),t.WaffleAccountLinkStateAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 2:{c.linkState=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.WaffleAccountLinkStateAction)return A;var r=new p.proto.SyncActionValue.WaffleAccountLinkStateAction;switch(A.linkState){default:if(typeof A.linkState=="number"){r.linkState=A.linkState;break}break;case"ACTIVE":case 0:r.linkState=0;break;case"PAUSED":case 1:r.linkState=1;break;case"UNLINKED":case 2:r.linkState=2;break}return r},i.toObject=function(A,r){r||(r={});var s={};return A.linkState!=null&&A.hasOwnProperty("linkState")&&(s.linkState=r.enums===String?p.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]===void 0?A.linkState:p.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]:A.linkState,r.oneofs&&(s._linkState="linkState")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WaffleAccountLinkStateAction"},i.AccountLinkState=(function(){let a={},A=Object.create(a);return A[a[0]="ACTIVE"]=0,A[a[1]="PAUSED"]=1,A[a[2]="UNLINKED"]=2,A})(),i})(),t.WamoUserIdentifierAction=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.identifier=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.WamoUserIdentifierAction)return A;var r=new p.proto.SyncActionValue.WamoUserIdentifierAction;return A.identifier!=null&&(r.identifier=String(A.identifier)),r},i.toObject=function(A,r){r||(r={});var s={};return A.identifier!=null&&A.hasOwnProperty("identifier")&&(s.identifier=A.identifier,r.oneofs&&(s._identifier="identifier")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WamoUserIdentifierAction"},i})(),t})(),n.SyncdIndex=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdIndex)return e;var a=new p.proto.SyncdIndex;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,a.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(a.blob=e.blob)),a},t.toObject=function(e,a){a||(a={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=a.bytes===String?l.base64.encode(e.blob,0,e.blob.length):a.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,a.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdIndex"},t})(),n.SyncdMutation=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.operation=e.int32();break}case 2:{s.record=p.proto.SyncdRecord.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdMutation)return e;var a=new p.proto.SyncdMutation;switch(e.operation){default:if(typeof e.operation=="number"){a.operation=e.operation;break}break;case"SET":case 0:a.operation=0;break;case"REMOVE":case 1:a.operation=1;break}if(e.record!=null){if(typeof e.record!="object")throw TypeError(".proto.SyncdMutation.record: object expected");a.record=p.proto.SyncdRecord.fromObject(e.record)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.operation!=null&&e.hasOwnProperty("operation")&&(A.operation=a.enums===String?p.proto.SyncdMutation.SyncdOperation[e.operation]===void 0?e.operation:p.proto.SyncdMutation.SyncdOperation[e.operation]:e.operation,a.oneofs&&(A._operation="operation")),e.record!=null&&e.hasOwnProperty("record")&&(A.record=p.proto.SyncdRecord.toObject(e.record,a),a.oneofs&&(A._record="record")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdMutation"},t.SyncdOperation=(function(){let i={},e=Object.create(i);return e[i[0]="SET"]=0,e[i[1]="REMOVE"]=1,e})(),t})(),n.SyncdMutations=(function(){function t(o){if(this.mutations=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.mutations&&r.mutations.length||(r.mutations=[]),r.mutations.push(p.proto.SyncdMutation.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.SyncdMutations)return i;var e=new p.proto.SyncdMutations;if(i.mutations){if(!Array.isArray(i.mutations))throw TypeError(".proto.SyncdMutations.mutations: array expected");e.mutations=[];for(var a=0;a>>3){case 1:{s.version=p.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.mutations&&s.mutations.length||(s.mutations=[]),s.mutations.push(p.proto.SyncdMutation.decode(e,e.uint32()));break}case 3:{s.externalMutations=p.proto.ExternalBlobReference.decode(e,e.uint32());break}case 4:{s.snapshotMac=e.bytes();break}case 5:{s.patchMac=e.bytes();break}case 6:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}case 7:{s.exitCode=p.proto.ExitCode.decode(e,e.uint32());break}case 8:{s.deviceIndex=e.uint32();break}case 9:{s.clientDebugData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdPatch)return e;var a=new p.proto.SyncdPatch;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdPatch.version: object expected");a.version=p.proto.SyncdVersion.fromObject(e.version)}if(e.mutations){if(!Array.isArray(e.mutations))throw TypeError(".proto.SyncdPatch.mutations: array expected");a.mutations=[];for(var A=0;A=0&&(a.snapshotMac=e.snapshotMac)),e.patchMac!=null&&(typeof e.patchMac=="string"?l.base64.decode(e.patchMac,a.patchMac=l.newBuffer(l.base64.length(e.patchMac)),0):e.patchMac.length>=0&&(a.patchMac=e.patchMac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdPatch.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}if(e.exitCode!=null){if(typeof e.exitCode!="object")throw TypeError(".proto.SyncdPatch.exitCode: object expected");a.exitCode=p.proto.ExitCode.fromObject(e.exitCode)}return e.deviceIndex!=null&&(a.deviceIndex=e.deviceIndex>>>0),e.clientDebugData!=null&&(typeof e.clientDebugData=="string"?l.base64.decode(e.clientDebugData,a.clientDebugData=l.newBuffer(l.base64.length(e.clientDebugData)),0):e.clientDebugData.length>=0&&(a.clientDebugData=e.clientDebugData)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.mutations=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.SyncdVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.mutations&&e.mutations.length){A.mutations=[];for(var r=0;r>>3){case 1:{s.index=p.proto.SyncdIndex.decode(e,e.uint32());break}case 2:{s.value=p.proto.SyncdValue.decode(e,e.uint32());break}case 3:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdRecord)return e;var a=new p.proto.SyncdRecord;if(e.index!=null){if(typeof e.index!="object")throw TypeError(".proto.SyncdRecord.index: object expected");a.index=p.proto.SyncdIndex.fromObject(e.index)}if(e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncdRecord.value: object expected");a.value=p.proto.SyncdValue.fromObject(e.value)}if(e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdRecord.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=p.proto.SyncdIndex.toObject(e.index,a),a.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=p.proto.SyncdValue.toObject(e.value,a),a.oneofs&&(A._value="value")),e.keyId!=null&&e.hasOwnProperty("keyId")&&(A.keyId=p.proto.KeyId.toObject(e.keyId,a),a.oneofs&&(A._keyId="keyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdRecord"},t})(),n.SyncdSnapshot=(function(){function t(i){if(this.records=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=p.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.records&&s.records.length||(s.records=[]),s.records.push(p.proto.SyncdRecord.decode(e,e.uint32()));break}case 3:{s.mac=e.bytes();break}case 4:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdSnapshot)return e;var a=new p.proto.SyncdSnapshot;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdSnapshot.version: object expected");a.version=p.proto.SyncdVersion.fromObject(e.version)}if(e.records){if(!Array.isArray(e.records))throw TypeError(".proto.SyncdSnapshot.records: array expected");a.records=[];for(var A=0;A=0&&(a.mac=e.mac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdSnapshot.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}return a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.records=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.SyncdVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.records&&e.records.length){A.records=[];for(var r=0;r>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdValue)return e;var a=new p.proto.SyncdValue;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,a.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(a.blob=e.blob)),a},t.toObject=function(e,a){a||(a={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=a.bytes===String?l.base64.encode(e.blob,0,e.blob.length):a.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,a.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdValue"},t})(),n.SyncdVersion=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.SyncdVersion)return e;var a=new p.proto.SyncdVersion;return e.version!=null&&(l.Long?(a.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?a.version=parseInt(e.version,10):typeof e.version=="number"?a.version=e.version:typeof e.version=="object"&&(a.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),a},t.toObject=function(e,a){a||(a={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=a.longs===String?String(e.version):e.version:A.version=a.longs===String?ge(e.version,!0):a.longs===Number?ce(e.version,!0):e.version,a.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdVersion"},t})(),n.TapLinkAction=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.title=e.string();break}case 2:{s.tapUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.TapLinkAction)return e;var a=new p.proto.TapLinkAction;return e.title!=null&&(a.title=String(e.title)),e.tapUrl!=null&&(a.tapUrl=String(e.tapUrl)),a},t.toObject=function(e,a){a||(a={});var A={};return e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.tapUrl!=null&&e.hasOwnProperty("tapUrl")&&(A.tapUrl=e.tapUrl,a.oneofs&&(A._tapUrl="tapUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TapLinkAction"},t})(),n.TemplateButton=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=p.proto.TemplateButton.URLButton.decode(e,e.uint32());break}case 3:{s.callButton=p.proto.TemplateButton.CallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.TemplateButton)return e;var a=new p.proto.TemplateButton;if(e.index!=null&&(a.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.TemplateButton.quickReplyButton: object expected");a.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.TemplateButton.urlButton: object expected");a.urlButton=p.proto.TemplateButton.URLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.TemplateButton.callButton: object expected");a.callButton=p.proto.TemplateButton.CallButton.fromObject(e.callButton)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.toObject(e.quickReplyButton,a),a.oneofs&&(A.button="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=p.proto.TemplateButton.URLButton.toObject(e.urlButton,a),a.oneofs&&(A.button="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=p.proto.TemplateButton.CallButton.toObject(e.callButton,a),a.oneofs&&(A.button="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,a.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TemplateButton"},t.CallButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.phoneNumber=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.CallButton)return A;var r=new p.proto.TemplateButton.CallButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected");r.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.phoneNumber!=null){if(typeof A.phoneNumber!="object")throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected");r.phoneNumber=p.proto.Message.HighlyStructuredMessage.fromObject(A.phoneNumber)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=p.proto.Message.HighlyStructuredMessage.toObject(A.phoneNumber,r),r.oneofs&&(s._phoneNumber="phoneNumber")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.CallButton"},i})(),t.QuickReplyButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.QuickReplyButton)return A;var r=new p.proto.TemplateButton.QuickReplyButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected");r.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}return A.id!=null&&(r.id=String(A.id)),r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.QuickReplyButton"},i})(),t.URLButton=(function(){function i(a){if(a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.url=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.URLButton)return A;var r=new p.proto.TemplateButton.URLButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected");r.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.url!=null){if(typeof A.url!="object")throw TypeError(".proto.TemplateButton.URLButton.url: object expected");r.url=p.proto.Message.HighlyStructuredMessage.fromObject(A.url)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=p.proto.Message.HighlyStructuredMessage.toObject(A.url,r),r.oneofs&&(s._url="url")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.URLButton"},i})(),t})(),n.ThreadID=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.threadType=e.int32();break}case 2:{s.threadKey=p.proto.MessageKey.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.ThreadID)return e;var a=new p.proto.ThreadID;switch(e.threadType){default:if(typeof e.threadType=="number"){a.threadType=e.threadType;break}break;case"UNKNOWN":case 0:a.threadType=0;break;case"VIEW_REPLIES":case 1:a.threadType=1;break;case"AI_THREAD":case 2:a.threadType=2;break}if(e.threadKey!=null){if(typeof e.threadKey!="object")throw TypeError(".proto.ThreadID.threadKey: object expected");a.threadKey=p.proto.MessageKey.fromObject(e.threadKey)}return a},t.toObject=function(e,a){a||(a={});var A={};return e.threadType!=null&&e.hasOwnProperty("threadType")&&(A.threadType=a.enums===String?p.proto.ThreadID.ThreadType[e.threadType]===void 0?e.threadType:p.proto.ThreadID.ThreadType[e.threadType]:e.threadType,a.oneofs&&(A._threadType="threadType")),e.threadKey!=null&&e.hasOwnProperty("threadKey")&&(A.threadKey=p.proto.MessageKey.toObject(e.threadKey,a),a.oneofs&&(A._threadKey="threadKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ThreadID"},t.ThreadType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="VIEW_REPLIES"]=1,e[i[2]="AI_THREAD"]=2,e})(),t})(),n.UrlTrackingMap=(function(){function t(o){if(this.urlTrackingMapElements=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{r.urlTrackingMapElements&&r.urlTrackingMapElements.length||(r.urlTrackingMapElements=[]),r.urlTrackingMapElements.push(p.proto.UrlTrackingMap.UrlTrackingMapElement.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return r},t.fromObject=function(i){if(i instanceof p.proto.UrlTrackingMap)return i;var e=new p.proto.UrlTrackingMap;if(i.urlTrackingMapElements){if(!Array.isArray(i.urlTrackingMapElements))throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected");e.urlTrackingMapElements=[];for(var a=0;a>>3){case 1:{g.originalUrl=a.string();break}case 2:{g.unconsentedUsersUrl=a.string();break}case 3:{g.consentedUsersUrl=a.string();break}case 4:{g.cardIndex=a.uint32();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.UrlTrackingMap.UrlTrackingMapElement)return a;var A=new p.proto.UrlTrackingMap.UrlTrackingMapElement;return a.originalUrl!=null&&(A.originalUrl=String(a.originalUrl)),a.unconsentedUsersUrl!=null&&(A.unconsentedUsersUrl=String(a.unconsentedUsersUrl)),a.consentedUsersUrl!=null&&(A.consentedUsersUrl=String(a.consentedUsersUrl)),a.cardIndex!=null&&(A.cardIndex=a.cardIndex>>>0),A},o.toObject=function(a,A){A||(A={});var r={};return a.originalUrl!=null&&a.hasOwnProperty("originalUrl")&&(r.originalUrl=a.originalUrl,A.oneofs&&(r._originalUrl="originalUrl")),a.unconsentedUsersUrl!=null&&a.hasOwnProperty("unconsentedUsersUrl")&&(r.unconsentedUsersUrl=a.unconsentedUsersUrl,A.oneofs&&(r._unconsentedUsersUrl="unconsentedUsersUrl")),a.consentedUsersUrl!=null&&a.hasOwnProperty("consentedUsersUrl")&&(r.consentedUsersUrl=a.consentedUsersUrl,A.oneofs&&(r._consentedUsersUrl="consentedUsersUrl")),a.cardIndex!=null&&a.hasOwnProperty("cardIndex")&&(r.cardIndex=a.cardIndex,A.oneofs&&(r._cardIndex="cardIndex")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.UrlTrackingMap.UrlTrackingMapElement"},o})(),t})(),n.UserPassword=(function(){function t(i){if(this.transformerArg=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encoding=e.int32();break}case 2:{s.transformer=e.int32();break}case 3:{s.transformerArg&&s.transformerArg.length||(s.transformerArg=[]),s.transformerArg.push(p.proto.UserPassword.TransformerArg.decode(e,e.uint32()));break}case 4:{s.transformedData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.UserPassword)return e;var a=new p.proto.UserPassword;switch(e.encoding){default:if(typeof e.encoding=="number"){a.encoding=e.encoding;break}break;case"UTF8":case 0:a.encoding=0;break;case"UTF8_BROKEN":case 1:a.encoding=1;break}switch(e.transformer){default:if(typeof e.transformer=="number"){a.transformer=e.transformer;break}break;case"NONE":case 0:a.transformer=0;break;case"PBKDF2_HMAC_SHA512":case 1:a.transformer=1;break;case"PBKDF2_HMAC_SHA384":case 2:a.transformer=2;break}if(e.transformerArg){if(!Array.isArray(e.transformerArg))throw TypeError(".proto.UserPassword.transformerArg: array expected");a.transformerArg=[];for(var A=0;A=0&&(a.transformedData=e.transformedData)),a},t.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.transformerArg=[]),e.encoding!=null&&e.hasOwnProperty("encoding")&&(A.encoding=a.enums===String?p.proto.UserPassword.Encoding[e.encoding]===void 0?e.encoding:p.proto.UserPassword.Encoding[e.encoding]:e.encoding,a.oneofs&&(A._encoding="encoding")),e.transformer!=null&&e.hasOwnProperty("transformer")&&(A.transformer=a.enums===String?p.proto.UserPassword.Transformer[e.transformer]===void 0?e.transformer:p.proto.UserPassword.Transformer[e.transformer]:e.transformer,a.oneofs&&(A._transformer="transformer")),e.transformerArg&&e.transformerArg.length){A.transformerArg=[];for(var r=0;r>>3){case 1:{c.key=A.string();break}case 2:{c.value=p.proto.UserPassword.TransformerArg.Value.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.UserPassword.TransformerArg)return A;var r=new p.proto.UserPassword.TransformerArg;if(A.key!=null&&(r.key=String(A.key)),A.value!=null){if(typeof A.value!="object")throw TypeError(".proto.UserPassword.TransformerArg.value: object expected");r.value=p.proto.UserPassword.TransformerArg.Value.fromObject(A.value)}return r},i.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=A.key,r.oneofs&&(s._key="key")),A.value!=null&&A.hasOwnProperty("value")&&(s.value=p.proto.UserPassword.TransformerArg.Value.toObject(A.value,r),r.oneofs&&(s._value="value")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.UserPassword.TransformerArg"},i.Value=(function(){function a(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{d.asBlob=s.bytes();break}case 2:{d.asUnsignedInteger=s.uint32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.UserPassword.TransformerArg.Value)return s;var g=new p.proto.UserPassword.TransformerArg.Value;return s.asBlob!=null&&(typeof s.asBlob=="string"?l.base64.decode(s.asBlob,g.asBlob=l.newBuffer(l.base64.length(s.asBlob)),0):s.asBlob.length>=0&&(g.asBlob=s.asBlob)),s.asUnsignedInteger!=null&&(g.asUnsignedInteger=s.asUnsignedInteger>>>0),g},a.toObject=function(s,g){g||(g={});var c={};return s.asBlob!=null&&s.hasOwnProperty("asBlob")&&(c.asBlob=g.bytes===String?l.base64.encode(s.asBlob,0,s.asBlob.length):g.bytes===Array?Array.prototype.slice.call(s.asBlob):s.asBlob,g.oneofs&&(c.value="asBlob")),s.asUnsignedInteger!=null&&s.hasOwnProperty("asUnsignedInteger")&&(c.asUnsignedInteger=s.asUnsignedInteger,g.oneofs&&(c.value="asUnsignedInteger")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.UserPassword.TransformerArg.Value"},a})(),i})(),t})(),n.UserReceipt=(function(){function t(i){if(this.pendingDeviceJid=[],this.deliveredDeviceJid=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.receiptTimestamp=e.int64();break}case 3:{s.readTimestamp=e.int64();break}case 4:{s.playedTimestamp=e.int64();break}case 5:{s.pendingDeviceJid&&s.pendingDeviceJid.length||(s.pendingDeviceJid=[]),s.pendingDeviceJid.push(e.string());break}case 6:{s.deliveredDeviceJid&&s.deliveredDeviceJid.length||(s.deliveredDeviceJid=[]),s.deliveredDeviceJid.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.UserReceipt)return e;var a=new p.proto.UserReceipt;if(e.userJid!=null&&(a.userJid=String(e.userJid)),e.receiptTimestamp!=null&&(l.Long?(a.receiptTimestamp=l.Long.fromValue(e.receiptTimestamp)).unsigned=!1:typeof e.receiptTimestamp=="string"?a.receiptTimestamp=parseInt(e.receiptTimestamp,10):typeof e.receiptTimestamp=="number"?a.receiptTimestamp=e.receiptTimestamp:typeof e.receiptTimestamp=="object"&&(a.receiptTimestamp=new l.LongBits(e.receiptTimestamp.low>>>0,e.receiptTimestamp.high>>>0).toNumber())),e.readTimestamp!=null&&(l.Long?(a.readTimestamp=l.Long.fromValue(e.readTimestamp)).unsigned=!1:typeof e.readTimestamp=="string"?a.readTimestamp=parseInt(e.readTimestamp,10):typeof e.readTimestamp=="number"?a.readTimestamp=e.readTimestamp:typeof e.readTimestamp=="object"&&(a.readTimestamp=new l.LongBits(e.readTimestamp.low>>>0,e.readTimestamp.high>>>0).toNumber())),e.playedTimestamp!=null&&(l.Long?(a.playedTimestamp=l.Long.fromValue(e.playedTimestamp)).unsigned=!1:typeof e.playedTimestamp=="string"?a.playedTimestamp=parseInt(e.playedTimestamp,10):typeof e.playedTimestamp=="number"?a.playedTimestamp=e.playedTimestamp:typeof e.playedTimestamp=="object"&&(a.playedTimestamp=new l.LongBits(e.playedTimestamp.low>>>0,e.playedTimestamp.high>>>0).toNumber())),e.pendingDeviceJid){if(!Array.isArray(e.pendingDeviceJid))throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected");a.pendingDeviceJid=[];for(var A=0;A>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}case 3:{s.serverSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.VerifiedNameCertificate)return e;var a=new p.proto.VerifiedNameCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.serverSignature!=null&&(typeof e.serverSignature=="string"?l.base64.decode(e.serverSignature,a.serverSignature=l.newBuffer(l.base64.length(e.serverSignature)),0):e.serverSignature.length>=0&&(a.serverSignature=e.serverSignature)),a},t.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.serverSignature!=null&&e.hasOwnProperty("serverSignature")&&(A.serverSignature=a.bytes===String?l.base64.encode(e.serverSignature,0,e.serverSignature.length):a.bytes===Array?Array.prototype.slice.call(e.serverSignature):e.serverSignature,a.oneofs&&(A._serverSignature="serverSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.VerifiedNameCertificate"},t.Details=(function(){function i(a){if(this.localizedNames=[],a)for(var A=Object.keys(a),r=0;r>>3){case 1:{c.serial=A.uint64();break}case 2:{c.issuer=A.string();break}case 4:{c.verifiedName=A.string();break}case 8:{c.localizedNames&&c.localizedNames.length||(c.localizedNames=[]),c.localizedNames.push(p.proto.LocalizedName.decode(A,A.uint32()));break}case 10:{c.issueTime=A.uint64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.VerifiedNameCertificate.Details)return A;var r=new p.proto.VerifiedNameCertificate.Details;if(A.serial!=null&&(l.Long?(r.serial=l.Long.fromValue(A.serial)).unsigned=!0:typeof A.serial=="string"?r.serial=parseInt(A.serial,10):typeof A.serial=="number"?r.serial=A.serial:typeof A.serial=="object"&&(r.serial=new l.LongBits(A.serial.low>>>0,A.serial.high>>>0).toNumber(!0))),A.issuer!=null&&(r.issuer=String(A.issuer)),A.verifiedName!=null&&(r.verifiedName=String(A.verifiedName)),A.localizedNames){if(!Array.isArray(A.localizedNames))throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected");r.localizedNames=[];for(var s=0;s>>0,A.issueTime.high>>>0).toNumber(!0))),r},i.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.localizedNames=[]),A.serial!=null&&A.hasOwnProperty("serial")&&(typeof A.serial=="number"?s.serial=r.longs===String?String(A.serial):A.serial:s.serial=r.longs===String?ge(A.serial,!0):r.longs===Number?ce(A.serial,!0):A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.verifiedName!=null&&A.hasOwnProperty("verifiedName")&&(s.verifiedName=A.verifiedName,r.oneofs&&(s._verifiedName="verifiedName")),A.localizedNames&&A.localizedNames.length){s.localizedNames=[];for(var g=0;g>>3){case 1:{s.filename=e.string();break}case 2:{s.opacity=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WallpaperSettings)return e;var a=new p.proto.WallpaperSettings;return e.filename!=null&&(a.filename=String(e.filename)),e.opacity!=null&&(a.opacity=e.opacity>>>0),a},t.toObject=function(e,a){a||(a={});var A={};return e.filename!=null&&e.hasOwnProperty("filename")&&(A.filename=e.filename,a.oneofs&&(A._filename="filename")),e.opacity!=null&&e.hasOwnProperty("opacity")&&(A.opacity=e.opacity,a.oneofs&&(A._opacity="opacity")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WallpaperSettings"},t})(),n.WebFeatures=(function(){function t(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.labelsDisplay=e.int32();break}case 2:{s.voipIndividualOutgoing=e.int32();break}case 3:{s.groupsV3=e.int32();break}case 4:{s.groupsV3Create=e.int32();break}case 5:{s.changeNumberV2=e.int32();break}case 6:{s.queryStatusV3Thumbnail=e.int32();break}case 7:{s.liveLocations=e.int32();break}case 8:{s.queryVname=e.int32();break}case 9:{s.voipIndividualIncoming=e.int32();break}case 10:{s.quickRepliesQuery=e.int32();break}case 11:{s.payments=e.int32();break}case 12:{s.stickerPackQuery=e.int32();break}case 13:{s.liveLocationsFinal=e.int32();break}case 14:{s.labelsEdit=e.int32();break}case 15:{s.mediaUpload=e.int32();break}case 18:{s.mediaUploadRichQuickReplies=e.int32();break}case 19:{s.vnameV2=e.int32();break}case 20:{s.videoPlaybackUrl=e.int32();break}case 21:{s.statusRanking=e.int32();break}case 22:{s.voipIndividualVideo=e.int32();break}case 23:{s.thirdPartyStickers=e.int32();break}case 24:{s.frequentlyForwardedSetting=e.int32();break}case 25:{s.groupsV4JoinPermission=e.int32();break}case 26:{s.recentStickers=e.int32();break}case 27:{s.catalog=e.int32();break}case 28:{s.starredStickers=e.int32();break}case 29:{s.voipGroupCall=e.int32();break}case 30:{s.templateMessage=e.int32();break}case 31:{s.templateMessageInteractivity=e.int32();break}case 32:{s.ephemeralMessages=e.int32();break}case 33:{s.e2ENotificationSync=e.int32();break}case 34:{s.recentStickersV2=e.int32();break}case 36:{s.recentStickersV3=e.int32();break}case 37:{s.userNotice=e.int32();break}case 39:{s.support=e.int32();break}case 40:{s.groupUiiCleanup=e.int32();break}case 41:{s.groupDogfoodingInternalOnly=e.int32();break}case 42:{s.settingsSync=e.int32();break}case 43:{s.archiveV2=e.int32();break}case 44:{s.ephemeralAllowGroupMembers=e.int32();break}case 45:{s.ephemeral24HDuration=e.int32();break}case 46:{s.mdForceUpgrade=e.int32();break}case 47:{s.disappearingMode=e.int32();break}case 48:{s.externalMdOptInAvailable=e.int32();break}case 49:{s.noDeleteMessageTimeLimit=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WebFeatures)return e;var a=new p.proto.WebFeatures;switch(e.labelsDisplay){default:if(typeof e.labelsDisplay=="number"){a.labelsDisplay=e.labelsDisplay;break}break;case"NOT_STARTED":case 0:a.labelsDisplay=0;break;case"FORCE_UPGRADE":case 1:a.labelsDisplay=1;break;case"DEVELOPMENT":case 2:a.labelsDisplay=2;break;case"PRODUCTION":case 3:a.labelsDisplay=3;break}switch(e.voipIndividualOutgoing){default:if(typeof e.voipIndividualOutgoing=="number"){a.voipIndividualOutgoing=e.voipIndividualOutgoing;break}break;case"NOT_STARTED":case 0:a.voipIndividualOutgoing=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualOutgoing=1;break;case"DEVELOPMENT":case 2:a.voipIndividualOutgoing=2;break;case"PRODUCTION":case 3:a.voipIndividualOutgoing=3;break}switch(e.groupsV3){default:if(typeof e.groupsV3=="number"){a.groupsV3=e.groupsV3;break}break;case"NOT_STARTED":case 0:a.groupsV3=0;break;case"FORCE_UPGRADE":case 1:a.groupsV3=1;break;case"DEVELOPMENT":case 2:a.groupsV3=2;break;case"PRODUCTION":case 3:a.groupsV3=3;break}switch(e.groupsV3Create){default:if(typeof e.groupsV3Create=="number"){a.groupsV3Create=e.groupsV3Create;break}break;case"NOT_STARTED":case 0:a.groupsV3Create=0;break;case"FORCE_UPGRADE":case 1:a.groupsV3Create=1;break;case"DEVELOPMENT":case 2:a.groupsV3Create=2;break;case"PRODUCTION":case 3:a.groupsV3Create=3;break}switch(e.changeNumberV2){default:if(typeof e.changeNumberV2=="number"){a.changeNumberV2=e.changeNumberV2;break}break;case"NOT_STARTED":case 0:a.changeNumberV2=0;break;case"FORCE_UPGRADE":case 1:a.changeNumberV2=1;break;case"DEVELOPMENT":case 2:a.changeNumberV2=2;break;case"PRODUCTION":case 3:a.changeNumberV2=3;break}switch(e.queryStatusV3Thumbnail){default:if(typeof e.queryStatusV3Thumbnail=="number"){a.queryStatusV3Thumbnail=e.queryStatusV3Thumbnail;break}break;case"NOT_STARTED":case 0:a.queryStatusV3Thumbnail=0;break;case"FORCE_UPGRADE":case 1:a.queryStatusV3Thumbnail=1;break;case"DEVELOPMENT":case 2:a.queryStatusV3Thumbnail=2;break;case"PRODUCTION":case 3:a.queryStatusV3Thumbnail=3;break}switch(e.liveLocations){default:if(typeof e.liveLocations=="number"){a.liveLocations=e.liveLocations;break}break;case"NOT_STARTED":case 0:a.liveLocations=0;break;case"FORCE_UPGRADE":case 1:a.liveLocations=1;break;case"DEVELOPMENT":case 2:a.liveLocations=2;break;case"PRODUCTION":case 3:a.liveLocations=3;break}switch(e.queryVname){default:if(typeof e.queryVname=="number"){a.queryVname=e.queryVname;break}break;case"NOT_STARTED":case 0:a.queryVname=0;break;case"FORCE_UPGRADE":case 1:a.queryVname=1;break;case"DEVELOPMENT":case 2:a.queryVname=2;break;case"PRODUCTION":case 3:a.queryVname=3;break}switch(e.voipIndividualIncoming){default:if(typeof e.voipIndividualIncoming=="number"){a.voipIndividualIncoming=e.voipIndividualIncoming;break}break;case"NOT_STARTED":case 0:a.voipIndividualIncoming=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualIncoming=1;break;case"DEVELOPMENT":case 2:a.voipIndividualIncoming=2;break;case"PRODUCTION":case 3:a.voipIndividualIncoming=3;break}switch(e.quickRepliesQuery){default:if(typeof e.quickRepliesQuery=="number"){a.quickRepliesQuery=e.quickRepliesQuery;break}break;case"NOT_STARTED":case 0:a.quickRepliesQuery=0;break;case"FORCE_UPGRADE":case 1:a.quickRepliesQuery=1;break;case"DEVELOPMENT":case 2:a.quickRepliesQuery=2;break;case"PRODUCTION":case 3:a.quickRepliesQuery=3;break}switch(e.payments){default:if(typeof e.payments=="number"){a.payments=e.payments;break}break;case"NOT_STARTED":case 0:a.payments=0;break;case"FORCE_UPGRADE":case 1:a.payments=1;break;case"DEVELOPMENT":case 2:a.payments=2;break;case"PRODUCTION":case 3:a.payments=3;break}switch(e.stickerPackQuery){default:if(typeof e.stickerPackQuery=="number"){a.stickerPackQuery=e.stickerPackQuery;break}break;case"NOT_STARTED":case 0:a.stickerPackQuery=0;break;case"FORCE_UPGRADE":case 1:a.stickerPackQuery=1;break;case"DEVELOPMENT":case 2:a.stickerPackQuery=2;break;case"PRODUCTION":case 3:a.stickerPackQuery=3;break}switch(e.liveLocationsFinal){default:if(typeof e.liveLocationsFinal=="number"){a.liveLocationsFinal=e.liveLocationsFinal;break}break;case"NOT_STARTED":case 0:a.liveLocationsFinal=0;break;case"FORCE_UPGRADE":case 1:a.liveLocationsFinal=1;break;case"DEVELOPMENT":case 2:a.liveLocationsFinal=2;break;case"PRODUCTION":case 3:a.liveLocationsFinal=3;break}switch(e.labelsEdit){default:if(typeof e.labelsEdit=="number"){a.labelsEdit=e.labelsEdit;break}break;case"NOT_STARTED":case 0:a.labelsEdit=0;break;case"FORCE_UPGRADE":case 1:a.labelsEdit=1;break;case"DEVELOPMENT":case 2:a.labelsEdit=2;break;case"PRODUCTION":case 3:a.labelsEdit=3;break}switch(e.mediaUpload){default:if(typeof e.mediaUpload=="number"){a.mediaUpload=e.mediaUpload;break}break;case"NOT_STARTED":case 0:a.mediaUpload=0;break;case"FORCE_UPGRADE":case 1:a.mediaUpload=1;break;case"DEVELOPMENT":case 2:a.mediaUpload=2;break;case"PRODUCTION":case 3:a.mediaUpload=3;break}switch(e.mediaUploadRichQuickReplies){default:if(typeof e.mediaUploadRichQuickReplies=="number"){a.mediaUploadRichQuickReplies=e.mediaUploadRichQuickReplies;break}break;case"NOT_STARTED":case 0:a.mediaUploadRichQuickReplies=0;break;case"FORCE_UPGRADE":case 1:a.mediaUploadRichQuickReplies=1;break;case"DEVELOPMENT":case 2:a.mediaUploadRichQuickReplies=2;break;case"PRODUCTION":case 3:a.mediaUploadRichQuickReplies=3;break}switch(e.vnameV2){default:if(typeof e.vnameV2=="number"){a.vnameV2=e.vnameV2;break}break;case"NOT_STARTED":case 0:a.vnameV2=0;break;case"FORCE_UPGRADE":case 1:a.vnameV2=1;break;case"DEVELOPMENT":case 2:a.vnameV2=2;break;case"PRODUCTION":case 3:a.vnameV2=3;break}switch(e.videoPlaybackUrl){default:if(typeof e.videoPlaybackUrl=="number"){a.videoPlaybackUrl=e.videoPlaybackUrl;break}break;case"NOT_STARTED":case 0:a.videoPlaybackUrl=0;break;case"FORCE_UPGRADE":case 1:a.videoPlaybackUrl=1;break;case"DEVELOPMENT":case 2:a.videoPlaybackUrl=2;break;case"PRODUCTION":case 3:a.videoPlaybackUrl=3;break}switch(e.statusRanking){default:if(typeof e.statusRanking=="number"){a.statusRanking=e.statusRanking;break}break;case"NOT_STARTED":case 0:a.statusRanking=0;break;case"FORCE_UPGRADE":case 1:a.statusRanking=1;break;case"DEVELOPMENT":case 2:a.statusRanking=2;break;case"PRODUCTION":case 3:a.statusRanking=3;break}switch(e.voipIndividualVideo){default:if(typeof e.voipIndividualVideo=="number"){a.voipIndividualVideo=e.voipIndividualVideo;break}break;case"NOT_STARTED":case 0:a.voipIndividualVideo=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualVideo=1;break;case"DEVELOPMENT":case 2:a.voipIndividualVideo=2;break;case"PRODUCTION":case 3:a.voipIndividualVideo=3;break}switch(e.thirdPartyStickers){default:if(typeof e.thirdPartyStickers=="number"){a.thirdPartyStickers=e.thirdPartyStickers;break}break;case"NOT_STARTED":case 0:a.thirdPartyStickers=0;break;case"FORCE_UPGRADE":case 1:a.thirdPartyStickers=1;break;case"DEVELOPMENT":case 2:a.thirdPartyStickers=2;break;case"PRODUCTION":case 3:a.thirdPartyStickers=3;break}switch(e.frequentlyForwardedSetting){default:if(typeof e.frequentlyForwardedSetting=="number"){a.frequentlyForwardedSetting=e.frequentlyForwardedSetting;break}break;case"NOT_STARTED":case 0:a.frequentlyForwardedSetting=0;break;case"FORCE_UPGRADE":case 1:a.frequentlyForwardedSetting=1;break;case"DEVELOPMENT":case 2:a.frequentlyForwardedSetting=2;break;case"PRODUCTION":case 3:a.frequentlyForwardedSetting=3;break}switch(e.groupsV4JoinPermission){default:if(typeof e.groupsV4JoinPermission=="number"){a.groupsV4JoinPermission=e.groupsV4JoinPermission;break}break;case"NOT_STARTED":case 0:a.groupsV4JoinPermission=0;break;case"FORCE_UPGRADE":case 1:a.groupsV4JoinPermission=1;break;case"DEVELOPMENT":case 2:a.groupsV4JoinPermission=2;break;case"PRODUCTION":case 3:a.groupsV4JoinPermission=3;break}switch(e.recentStickers){default:if(typeof e.recentStickers=="number"){a.recentStickers=e.recentStickers;break}break;case"NOT_STARTED":case 0:a.recentStickers=0;break;case"FORCE_UPGRADE":case 1:a.recentStickers=1;break;case"DEVELOPMENT":case 2:a.recentStickers=2;break;case"PRODUCTION":case 3:a.recentStickers=3;break}switch(e.catalog){default:if(typeof e.catalog=="number"){a.catalog=e.catalog;break}break;case"NOT_STARTED":case 0:a.catalog=0;break;case"FORCE_UPGRADE":case 1:a.catalog=1;break;case"DEVELOPMENT":case 2:a.catalog=2;break;case"PRODUCTION":case 3:a.catalog=3;break}switch(e.starredStickers){default:if(typeof e.starredStickers=="number"){a.starredStickers=e.starredStickers;break}break;case"NOT_STARTED":case 0:a.starredStickers=0;break;case"FORCE_UPGRADE":case 1:a.starredStickers=1;break;case"DEVELOPMENT":case 2:a.starredStickers=2;break;case"PRODUCTION":case 3:a.starredStickers=3;break}switch(e.voipGroupCall){default:if(typeof e.voipGroupCall=="number"){a.voipGroupCall=e.voipGroupCall;break}break;case"NOT_STARTED":case 0:a.voipGroupCall=0;break;case"FORCE_UPGRADE":case 1:a.voipGroupCall=1;break;case"DEVELOPMENT":case 2:a.voipGroupCall=2;break;case"PRODUCTION":case 3:a.voipGroupCall=3;break}switch(e.templateMessage){default:if(typeof e.templateMessage=="number"){a.templateMessage=e.templateMessage;break}break;case"NOT_STARTED":case 0:a.templateMessage=0;break;case"FORCE_UPGRADE":case 1:a.templateMessage=1;break;case"DEVELOPMENT":case 2:a.templateMessage=2;break;case"PRODUCTION":case 3:a.templateMessage=3;break}switch(e.templateMessageInteractivity){default:if(typeof e.templateMessageInteractivity=="number"){a.templateMessageInteractivity=e.templateMessageInteractivity;break}break;case"NOT_STARTED":case 0:a.templateMessageInteractivity=0;break;case"FORCE_UPGRADE":case 1:a.templateMessageInteractivity=1;break;case"DEVELOPMENT":case 2:a.templateMessageInteractivity=2;break;case"PRODUCTION":case 3:a.templateMessageInteractivity=3;break}switch(e.ephemeralMessages){default:if(typeof e.ephemeralMessages=="number"){a.ephemeralMessages=e.ephemeralMessages;break}break;case"NOT_STARTED":case 0:a.ephemeralMessages=0;break;case"FORCE_UPGRADE":case 1:a.ephemeralMessages=1;break;case"DEVELOPMENT":case 2:a.ephemeralMessages=2;break;case"PRODUCTION":case 3:a.ephemeralMessages=3;break}switch(e.e2ENotificationSync){default:if(typeof e.e2ENotificationSync=="number"){a.e2ENotificationSync=e.e2ENotificationSync;break}break;case"NOT_STARTED":case 0:a.e2ENotificationSync=0;break;case"FORCE_UPGRADE":case 1:a.e2ENotificationSync=1;break;case"DEVELOPMENT":case 2:a.e2ENotificationSync=2;break;case"PRODUCTION":case 3:a.e2ENotificationSync=3;break}switch(e.recentStickersV2){default:if(typeof e.recentStickersV2=="number"){a.recentStickersV2=e.recentStickersV2;break}break;case"NOT_STARTED":case 0:a.recentStickersV2=0;break;case"FORCE_UPGRADE":case 1:a.recentStickersV2=1;break;case"DEVELOPMENT":case 2:a.recentStickersV2=2;break;case"PRODUCTION":case 3:a.recentStickersV2=3;break}switch(e.recentStickersV3){default:if(typeof e.recentStickersV3=="number"){a.recentStickersV3=e.recentStickersV3;break}break;case"NOT_STARTED":case 0:a.recentStickersV3=0;break;case"FORCE_UPGRADE":case 1:a.recentStickersV3=1;break;case"DEVELOPMENT":case 2:a.recentStickersV3=2;break;case"PRODUCTION":case 3:a.recentStickersV3=3;break}switch(e.userNotice){default:if(typeof e.userNotice=="number"){a.userNotice=e.userNotice;break}break;case"NOT_STARTED":case 0:a.userNotice=0;break;case"FORCE_UPGRADE":case 1:a.userNotice=1;break;case"DEVELOPMENT":case 2:a.userNotice=2;break;case"PRODUCTION":case 3:a.userNotice=3;break}switch(e.support){default:if(typeof e.support=="number"){a.support=e.support;break}break;case"NOT_STARTED":case 0:a.support=0;break;case"FORCE_UPGRADE":case 1:a.support=1;break;case"DEVELOPMENT":case 2:a.support=2;break;case"PRODUCTION":case 3:a.support=3;break}switch(e.groupUiiCleanup){default:if(typeof e.groupUiiCleanup=="number"){a.groupUiiCleanup=e.groupUiiCleanup;break}break;case"NOT_STARTED":case 0:a.groupUiiCleanup=0;break;case"FORCE_UPGRADE":case 1:a.groupUiiCleanup=1;break;case"DEVELOPMENT":case 2:a.groupUiiCleanup=2;break;case"PRODUCTION":case 3:a.groupUiiCleanup=3;break}switch(e.groupDogfoodingInternalOnly){default:if(typeof e.groupDogfoodingInternalOnly=="number"){a.groupDogfoodingInternalOnly=e.groupDogfoodingInternalOnly;break}break;case"NOT_STARTED":case 0:a.groupDogfoodingInternalOnly=0;break;case"FORCE_UPGRADE":case 1:a.groupDogfoodingInternalOnly=1;break;case"DEVELOPMENT":case 2:a.groupDogfoodingInternalOnly=2;break;case"PRODUCTION":case 3:a.groupDogfoodingInternalOnly=3;break}switch(e.settingsSync){default:if(typeof e.settingsSync=="number"){a.settingsSync=e.settingsSync;break}break;case"NOT_STARTED":case 0:a.settingsSync=0;break;case"FORCE_UPGRADE":case 1:a.settingsSync=1;break;case"DEVELOPMENT":case 2:a.settingsSync=2;break;case"PRODUCTION":case 3:a.settingsSync=3;break}switch(e.archiveV2){default:if(typeof e.archiveV2=="number"){a.archiveV2=e.archiveV2;break}break;case"NOT_STARTED":case 0:a.archiveV2=0;break;case"FORCE_UPGRADE":case 1:a.archiveV2=1;break;case"DEVELOPMENT":case 2:a.archiveV2=2;break;case"PRODUCTION":case 3:a.archiveV2=3;break}switch(e.ephemeralAllowGroupMembers){default:if(typeof e.ephemeralAllowGroupMembers=="number"){a.ephemeralAllowGroupMembers=e.ephemeralAllowGroupMembers;break}break;case"NOT_STARTED":case 0:a.ephemeralAllowGroupMembers=0;break;case"FORCE_UPGRADE":case 1:a.ephemeralAllowGroupMembers=1;break;case"DEVELOPMENT":case 2:a.ephemeralAllowGroupMembers=2;break;case"PRODUCTION":case 3:a.ephemeralAllowGroupMembers=3;break}switch(e.ephemeral24HDuration){default:if(typeof e.ephemeral24HDuration=="number"){a.ephemeral24HDuration=e.ephemeral24HDuration;break}break;case"NOT_STARTED":case 0:a.ephemeral24HDuration=0;break;case"FORCE_UPGRADE":case 1:a.ephemeral24HDuration=1;break;case"DEVELOPMENT":case 2:a.ephemeral24HDuration=2;break;case"PRODUCTION":case 3:a.ephemeral24HDuration=3;break}switch(e.mdForceUpgrade){default:if(typeof e.mdForceUpgrade=="number"){a.mdForceUpgrade=e.mdForceUpgrade;break}break;case"NOT_STARTED":case 0:a.mdForceUpgrade=0;break;case"FORCE_UPGRADE":case 1:a.mdForceUpgrade=1;break;case"DEVELOPMENT":case 2:a.mdForceUpgrade=2;break;case"PRODUCTION":case 3:a.mdForceUpgrade=3;break}switch(e.disappearingMode){default:if(typeof e.disappearingMode=="number"){a.disappearingMode=e.disappearingMode;break}break;case"NOT_STARTED":case 0:a.disappearingMode=0;break;case"FORCE_UPGRADE":case 1:a.disappearingMode=1;break;case"DEVELOPMENT":case 2:a.disappearingMode=2;break;case"PRODUCTION":case 3:a.disappearingMode=3;break}switch(e.externalMdOptInAvailable){default:if(typeof e.externalMdOptInAvailable=="number"){a.externalMdOptInAvailable=e.externalMdOptInAvailable;break}break;case"NOT_STARTED":case 0:a.externalMdOptInAvailable=0;break;case"FORCE_UPGRADE":case 1:a.externalMdOptInAvailable=1;break;case"DEVELOPMENT":case 2:a.externalMdOptInAvailable=2;break;case"PRODUCTION":case 3:a.externalMdOptInAvailable=3;break}switch(e.noDeleteMessageTimeLimit){default:if(typeof e.noDeleteMessageTimeLimit=="number"){a.noDeleteMessageTimeLimit=e.noDeleteMessageTimeLimit;break}break;case"NOT_STARTED":case 0:a.noDeleteMessageTimeLimit=0;break;case"FORCE_UPGRADE":case 1:a.noDeleteMessageTimeLimit=1;break;case"DEVELOPMENT":case 2:a.noDeleteMessageTimeLimit=2;break;case"PRODUCTION":case 3:a.noDeleteMessageTimeLimit=3;break}return a},t.toObject=function(e,a){a||(a={});var A={};return e.labelsDisplay!=null&&e.hasOwnProperty("labelsDisplay")&&(A.labelsDisplay=a.enums===String?p.proto.WebFeatures.Flag[e.labelsDisplay]===void 0?e.labelsDisplay:p.proto.WebFeatures.Flag[e.labelsDisplay]:e.labelsDisplay,a.oneofs&&(A._labelsDisplay="labelsDisplay")),e.voipIndividualOutgoing!=null&&e.hasOwnProperty("voipIndividualOutgoing")&&(A.voipIndividualOutgoing=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualOutgoing]===void 0?e.voipIndividualOutgoing:p.proto.WebFeatures.Flag[e.voipIndividualOutgoing]:e.voipIndividualOutgoing,a.oneofs&&(A._voipIndividualOutgoing="voipIndividualOutgoing")),e.groupsV3!=null&&e.hasOwnProperty("groupsV3")&&(A.groupsV3=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV3]===void 0?e.groupsV3:p.proto.WebFeatures.Flag[e.groupsV3]:e.groupsV3,a.oneofs&&(A._groupsV3="groupsV3")),e.groupsV3Create!=null&&e.hasOwnProperty("groupsV3Create")&&(A.groupsV3Create=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV3Create]===void 0?e.groupsV3Create:p.proto.WebFeatures.Flag[e.groupsV3Create]:e.groupsV3Create,a.oneofs&&(A._groupsV3Create="groupsV3Create")),e.changeNumberV2!=null&&e.hasOwnProperty("changeNumberV2")&&(A.changeNumberV2=a.enums===String?p.proto.WebFeatures.Flag[e.changeNumberV2]===void 0?e.changeNumberV2:p.proto.WebFeatures.Flag[e.changeNumberV2]:e.changeNumberV2,a.oneofs&&(A._changeNumberV2="changeNumberV2")),e.queryStatusV3Thumbnail!=null&&e.hasOwnProperty("queryStatusV3Thumbnail")&&(A.queryStatusV3Thumbnail=a.enums===String?p.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]===void 0?e.queryStatusV3Thumbnail:p.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]:e.queryStatusV3Thumbnail,a.oneofs&&(A._queryStatusV3Thumbnail="queryStatusV3Thumbnail")),e.liveLocations!=null&&e.hasOwnProperty("liveLocations")&&(A.liveLocations=a.enums===String?p.proto.WebFeatures.Flag[e.liveLocations]===void 0?e.liveLocations:p.proto.WebFeatures.Flag[e.liveLocations]:e.liveLocations,a.oneofs&&(A._liveLocations="liveLocations")),e.queryVname!=null&&e.hasOwnProperty("queryVname")&&(A.queryVname=a.enums===String?p.proto.WebFeatures.Flag[e.queryVname]===void 0?e.queryVname:p.proto.WebFeatures.Flag[e.queryVname]:e.queryVname,a.oneofs&&(A._queryVname="queryVname")),e.voipIndividualIncoming!=null&&e.hasOwnProperty("voipIndividualIncoming")&&(A.voipIndividualIncoming=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualIncoming]===void 0?e.voipIndividualIncoming:p.proto.WebFeatures.Flag[e.voipIndividualIncoming]:e.voipIndividualIncoming,a.oneofs&&(A._voipIndividualIncoming="voipIndividualIncoming")),e.quickRepliesQuery!=null&&e.hasOwnProperty("quickRepliesQuery")&&(A.quickRepliesQuery=a.enums===String?p.proto.WebFeatures.Flag[e.quickRepliesQuery]===void 0?e.quickRepliesQuery:p.proto.WebFeatures.Flag[e.quickRepliesQuery]:e.quickRepliesQuery,a.oneofs&&(A._quickRepliesQuery="quickRepliesQuery")),e.payments!=null&&e.hasOwnProperty("payments")&&(A.payments=a.enums===String?p.proto.WebFeatures.Flag[e.payments]===void 0?e.payments:p.proto.WebFeatures.Flag[e.payments]:e.payments,a.oneofs&&(A._payments="payments")),e.stickerPackQuery!=null&&e.hasOwnProperty("stickerPackQuery")&&(A.stickerPackQuery=a.enums===String?p.proto.WebFeatures.Flag[e.stickerPackQuery]===void 0?e.stickerPackQuery:p.proto.WebFeatures.Flag[e.stickerPackQuery]:e.stickerPackQuery,a.oneofs&&(A._stickerPackQuery="stickerPackQuery")),e.liveLocationsFinal!=null&&e.hasOwnProperty("liveLocationsFinal")&&(A.liveLocationsFinal=a.enums===String?p.proto.WebFeatures.Flag[e.liveLocationsFinal]===void 0?e.liveLocationsFinal:p.proto.WebFeatures.Flag[e.liveLocationsFinal]:e.liveLocationsFinal,a.oneofs&&(A._liveLocationsFinal="liveLocationsFinal")),e.labelsEdit!=null&&e.hasOwnProperty("labelsEdit")&&(A.labelsEdit=a.enums===String?p.proto.WebFeatures.Flag[e.labelsEdit]===void 0?e.labelsEdit:p.proto.WebFeatures.Flag[e.labelsEdit]:e.labelsEdit,a.oneofs&&(A._labelsEdit="labelsEdit")),e.mediaUpload!=null&&e.hasOwnProperty("mediaUpload")&&(A.mediaUpload=a.enums===String?p.proto.WebFeatures.Flag[e.mediaUpload]===void 0?e.mediaUpload:p.proto.WebFeatures.Flag[e.mediaUpload]:e.mediaUpload,a.oneofs&&(A._mediaUpload="mediaUpload")),e.mediaUploadRichQuickReplies!=null&&e.hasOwnProperty("mediaUploadRichQuickReplies")&&(A.mediaUploadRichQuickReplies=a.enums===String?p.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]===void 0?e.mediaUploadRichQuickReplies:p.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]:e.mediaUploadRichQuickReplies,a.oneofs&&(A._mediaUploadRichQuickReplies="mediaUploadRichQuickReplies")),e.vnameV2!=null&&e.hasOwnProperty("vnameV2")&&(A.vnameV2=a.enums===String?p.proto.WebFeatures.Flag[e.vnameV2]===void 0?e.vnameV2:p.proto.WebFeatures.Flag[e.vnameV2]:e.vnameV2,a.oneofs&&(A._vnameV2="vnameV2")),e.videoPlaybackUrl!=null&&e.hasOwnProperty("videoPlaybackUrl")&&(A.videoPlaybackUrl=a.enums===String?p.proto.WebFeatures.Flag[e.videoPlaybackUrl]===void 0?e.videoPlaybackUrl:p.proto.WebFeatures.Flag[e.videoPlaybackUrl]:e.videoPlaybackUrl,a.oneofs&&(A._videoPlaybackUrl="videoPlaybackUrl")),e.statusRanking!=null&&e.hasOwnProperty("statusRanking")&&(A.statusRanking=a.enums===String?p.proto.WebFeatures.Flag[e.statusRanking]===void 0?e.statusRanking:p.proto.WebFeatures.Flag[e.statusRanking]:e.statusRanking,a.oneofs&&(A._statusRanking="statusRanking")),e.voipIndividualVideo!=null&&e.hasOwnProperty("voipIndividualVideo")&&(A.voipIndividualVideo=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualVideo]===void 0?e.voipIndividualVideo:p.proto.WebFeatures.Flag[e.voipIndividualVideo]:e.voipIndividualVideo,a.oneofs&&(A._voipIndividualVideo="voipIndividualVideo")),e.thirdPartyStickers!=null&&e.hasOwnProperty("thirdPartyStickers")&&(A.thirdPartyStickers=a.enums===String?p.proto.WebFeatures.Flag[e.thirdPartyStickers]===void 0?e.thirdPartyStickers:p.proto.WebFeatures.Flag[e.thirdPartyStickers]:e.thirdPartyStickers,a.oneofs&&(A._thirdPartyStickers="thirdPartyStickers")),e.frequentlyForwardedSetting!=null&&e.hasOwnProperty("frequentlyForwardedSetting")&&(A.frequentlyForwardedSetting=a.enums===String?p.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]===void 0?e.frequentlyForwardedSetting:p.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]:e.frequentlyForwardedSetting,a.oneofs&&(A._frequentlyForwardedSetting="frequentlyForwardedSetting")),e.groupsV4JoinPermission!=null&&e.hasOwnProperty("groupsV4JoinPermission")&&(A.groupsV4JoinPermission=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV4JoinPermission]===void 0?e.groupsV4JoinPermission:p.proto.WebFeatures.Flag[e.groupsV4JoinPermission]:e.groupsV4JoinPermission,a.oneofs&&(A._groupsV4JoinPermission="groupsV4JoinPermission")),e.recentStickers!=null&&e.hasOwnProperty("recentStickers")&&(A.recentStickers=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickers]===void 0?e.recentStickers:p.proto.WebFeatures.Flag[e.recentStickers]:e.recentStickers,a.oneofs&&(A._recentStickers="recentStickers")),e.catalog!=null&&e.hasOwnProperty("catalog")&&(A.catalog=a.enums===String?p.proto.WebFeatures.Flag[e.catalog]===void 0?e.catalog:p.proto.WebFeatures.Flag[e.catalog]:e.catalog,a.oneofs&&(A._catalog="catalog")),e.starredStickers!=null&&e.hasOwnProperty("starredStickers")&&(A.starredStickers=a.enums===String?p.proto.WebFeatures.Flag[e.starredStickers]===void 0?e.starredStickers:p.proto.WebFeatures.Flag[e.starredStickers]:e.starredStickers,a.oneofs&&(A._starredStickers="starredStickers")),e.voipGroupCall!=null&&e.hasOwnProperty("voipGroupCall")&&(A.voipGroupCall=a.enums===String?p.proto.WebFeatures.Flag[e.voipGroupCall]===void 0?e.voipGroupCall:p.proto.WebFeatures.Flag[e.voipGroupCall]:e.voipGroupCall,a.oneofs&&(A._voipGroupCall="voipGroupCall")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=a.enums===String?p.proto.WebFeatures.Flag[e.templateMessage]===void 0?e.templateMessage:p.proto.WebFeatures.Flag[e.templateMessage]:e.templateMessage,a.oneofs&&(A._templateMessage="templateMessage")),e.templateMessageInteractivity!=null&&e.hasOwnProperty("templateMessageInteractivity")&&(A.templateMessageInteractivity=a.enums===String?p.proto.WebFeatures.Flag[e.templateMessageInteractivity]===void 0?e.templateMessageInteractivity:p.proto.WebFeatures.Flag[e.templateMessageInteractivity]:e.templateMessageInteractivity,a.oneofs&&(A._templateMessageInteractivity="templateMessageInteractivity")),e.ephemeralMessages!=null&&e.hasOwnProperty("ephemeralMessages")&&(A.ephemeralMessages=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeralMessages]===void 0?e.ephemeralMessages:p.proto.WebFeatures.Flag[e.ephemeralMessages]:e.ephemeralMessages,a.oneofs&&(A._ephemeralMessages="ephemeralMessages")),e.e2ENotificationSync!=null&&e.hasOwnProperty("e2ENotificationSync")&&(A.e2ENotificationSync=a.enums===String?p.proto.WebFeatures.Flag[e.e2ENotificationSync]===void 0?e.e2ENotificationSync:p.proto.WebFeatures.Flag[e.e2ENotificationSync]:e.e2ENotificationSync,a.oneofs&&(A._e2ENotificationSync="e2ENotificationSync")),e.recentStickersV2!=null&&e.hasOwnProperty("recentStickersV2")&&(A.recentStickersV2=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickersV2]===void 0?e.recentStickersV2:p.proto.WebFeatures.Flag[e.recentStickersV2]:e.recentStickersV2,a.oneofs&&(A._recentStickersV2="recentStickersV2")),e.recentStickersV3!=null&&e.hasOwnProperty("recentStickersV3")&&(A.recentStickersV3=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickersV3]===void 0?e.recentStickersV3:p.proto.WebFeatures.Flag[e.recentStickersV3]:e.recentStickersV3,a.oneofs&&(A._recentStickersV3="recentStickersV3")),e.userNotice!=null&&e.hasOwnProperty("userNotice")&&(A.userNotice=a.enums===String?p.proto.WebFeatures.Flag[e.userNotice]===void 0?e.userNotice:p.proto.WebFeatures.Flag[e.userNotice]:e.userNotice,a.oneofs&&(A._userNotice="userNotice")),e.support!=null&&e.hasOwnProperty("support")&&(A.support=a.enums===String?p.proto.WebFeatures.Flag[e.support]===void 0?e.support:p.proto.WebFeatures.Flag[e.support]:e.support,a.oneofs&&(A._support="support")),e.groupUiiCleanup!=null&&e.hasOwnProperty("groupUiiCleanup")&&(A.groupUiiCleanup=a.enums===String?p.proto.WebFeatures.Flag[e.groupUiiCleanup]===void 0?e.groupUiiCleanup:p.proto.WebFeatures.Flag[e.groupUiiCleanup]:e.groupUiiCleanup,a.oneofs&&(A._groupUiiCleanup="groupUiiCleanup")),e.groupDogfoodingInternalOnly!=null&&e.hasOwnProperty("groupDogfoodingInternalOnly")&&(A.groupDogfoodingInternalOnly=a.enums===String?p.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]===void 0?e.groupDogfoodingInternalOnly:p.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]:e.groupDogfoodingInternalOnly,a.oneofs&&(A._groupDogfoodingInternalOnly="groupDogfoodingInternalOnly")),e.settingsSync!=null&&e.hasOwnProperty("settingsSync")&&(A.settingsSync=a.enums===String?p.proto.WebFeatures.Flag[e.settingsSync]===void 0?e.settingsSync:p.proto.WebFeatures.Flag[e.settingsSync]:e.settingsSync,a.oneofs&&(A._settingsSync="settingsSync")),e.archiveV2!=null&&e.hasOwnProperty("archiveV2")&&(A.archiveV2=a.enums===String?p.proto.WebFeatures.Flag[e.archiveV2]===void 0?e.archiveV2:p.proto.WebFeatures.Flag[e.archiveV2]:e.archiveV2,a.oneofs&&(A._archiveV2="archiveV2")),e.ephemeralAllowGroupMembers!=null&&e.hasOwnProperty("ephemeralAllowGroupMembers")&&(A.ephemeralAllowGroupMembers=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]===void 0?e.ephemeralAllowGroupMembers:p.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]:e.ephemeralAllowGroupMembers,a.oneofs&&(A._ephemeralAllowGroupMembers="ephemeralAllowGroupMembers")),e.ephemeral24HDuration!=null&&e.hasOwnProperty("ephemeral24HDuration")&&(A.ephemeral24HDuration=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeral24HDuration]===void 0?e.ephemeral24HDuration:p.proto.WebFeatures.Flag[e.ephemeral24HDuration]:e.ephemeral24HDuration,a.oneofs&&(A._ephemeral24HDuration="ephemeral24HDuration")),e.mdForceUpgrade!=null&&e.hasOwnProperty("mdForceUpgrade")&&(A.mdForceUpgrade=a.enums===String?p.proto.WebFeatures.Flag[e.mdForceUpgrade]===void 0?e.mdForceUpgrade:p.proto.WebFeatures.Flag[e.mdForceUpgrade]:e.mdForceUpgrade,a.oneofs&&(A._mdForceUpgrade="mdForceUpgrade")),e.disappearingMode!=null&&e.hasOwnProperty("disappearingMode")&&(A.disappearingMode=a.enums===String?p.proto.WebFeatures.Flag[e.disappearingMode]===void 0?e.disappearingMode:p.proto.WebFeatures.Flag[e.disappearingMode]:e.disappearingMode,a.oneofs&&(A._disappearingMode="disappearingMode")),e.externalMdOptInAvailable!=null&&e.hasOwnProperty("externalMdOptInAvailable")&&(A.externalMdOptInAvailable=a.enums===String?p.proto.WebFeatures.Flag[e.externalMdOptInAvailable]===void 0?e.externalMdOptInAvailable:p.proto.WebFeatures.Flag[e.externalMdOptInAvailable]:e.externalMdOptInAvailable,a.oneofs&&(A._externalMdOptInAvailable="externalMdOptInAvailable")),e.noDeleteMessageTimeLimit!=null&&e.hasOwnProperty("noDeleteMessageTimeLimit")&&(A.noDeleteMessageTimeLimit=a.enums===String?p.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]===void 0?e.noDeleteMessageTimeLimit:p.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]:e.noDeleteMessageTimeLimit,a.oneofs&&(A._noDeleteMessageTimeLimit="noDeleteMessageTimeLimit")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WebFeatures"},t.Flag=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_STARTED"]=0,e[i[1]="FORCE_UPGRADE"]=1,e[i[2]="DEVELOPMENT"]=2,e[i[3]="PRODUCTION"]=3,e})(),t})(),n.WebLinkRenderConfig=(function(){let t={},o=Object.create(t);return o[t[0]="WEBVIEW"]=0,o[t[1]="SYSTEM"]=1,o})(),n.WebMessageInfo=(function(){function t(i){if(this.messageStubParameters=[],this.labels=[],this.userReceipt=[],this.reactions=[],this.pollUpdates=[],this.eventResponses=[],this.statusMentions=[],this.messageAddOns=[],this.statusMentionSources=[],this.supportAiCitations=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.status=e.int32();break}case 5:{s.participant=e.string();break}case 6:{s.messageC2STimestamp=e.uint64();break}case 16:{s.ignore=e.bool();break}case 17:{s.starred=e.bool();break}case 18:{s.broadcast=e.bool();break}case 19:{s.pushName=e.string();break}case 20:{s.mediaCiphertextSha256=e.bytes();break}case 21:{s.multicast=e.bool();break}case 22:{s.urlText=e.bool();break}case 23:{s.urlNumber=e.bool();break}case 24:{s.messageStubType=e.int32();break}case 25:{s.clearMedia=e.bool();break}case 26:{s.messageStubParameters&&s.messageStubParameters.length||(s.messageStubParameters=[]),s.messageStubParameters.push(e.string());break}case 27:{s.duration=e.uint32();break}case 28:{s.labels&&s.labels.length||(s.labels=[]),s.labels.push(e.string());break}case 29:{s.paymentInfo=p.proto.PaymentInfo.decode(e,e.uint32());break}case 30:{s.finalLiveLocation=p.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 31:{s.quotedPaymentInfo=p.proto.PaymentInfo.decode(e,e.uint32());break}case 32:{s.ephemeralStartTimestamp=e.uint64();break}case 33:{s.ephemeralDuration=e.uint32();break}case 34:{s.ephemeralOffToOn=e.bool();break}case 35:{s.ephemeralOutOfSync=e.bool();break}case 36:{s.bizPrivacyStatus=e.int32();break}case 37:{s.verifiedBizName=e.string();break}case 38:{s.mediaData=p.proto.MediaData.decode(e,e.uint32());break}case 39:{s.photoChange=p.proto.PhotoChange.decode(e,e.uint32());break}case 40:{s.userReceipt&&s.userReceipt.length||(s.userReceipt=[]),s.userReceipt.push(p.proto.UserReceipt.decode(e,e.uint32()));break}case 41:{s.reactions&&s.reactions.length||(s.reactions=[]),s.reactions.push(p.proto.Reaction.decode(e,e.uint32()));break}case 42:{s.quotedStickerData=p.proto.MediaData.decode(e,e.uint32());break}case 43:{s.futureproofData=e.bytes();break}case 44:{s.statusPsa=p.proto.StatusPSA.decode(e,e.uint32());break}case 45:{s.pollUpdates&&s.pollUpdates.length||(s.pollUpdates=[]),s.pollUpdates.push(p.proto.PollUpdate.decode(e,e.uint32()));break}case 46:{s.pollAdditionalMetadata=p.proto.PollAdditionalMetadata.decode(e,e.uint32());break}case 47:{s.agentId=e.string();break}case 48:{s.statusAlreadyViewed=e.bool();break}case 49:{s.messageSecret=e.bytes();break}case 50:{s.keepInChat=p.proto.KeepInChat.decode(e,e.uint32());break}case 51:{s.originalSelfAuthorUserJidString=e.string();break}case 52:{s.revokeMessageTimestamp=e.uint64();break}case 54:{s.pinInChat=p.proto.PinInChat.decode(e,e.uint32());break}case 55:{s.premiumMessageInfo=p.proto.PremiumMessageInfo.decode(e,e.uint32());break}case 56:{s.is1PBizBotMessage=e.bool();break}case 57:{s.isGroupHistoryMessage=e.bool();break}case 58:{s.botMessageInvokerJid=e.string();break}case 59:{s.commentMetadata=p.proto.CommentMetadata.decode(e,e.uint32());break}case 61:{s.eventResponses&&s.eventResponses.length||(s.eventResponses=[]),s.eventResponses.push(p.proto.EventResponse.decode(e,e.uint32()));break}case 62:{s.reportingTokenInfo=p.proto.ReportingTokenInfo.decode(e,e.uint32());break}case 63:{s.newsletterServerId=e.uint64();break}case 64:{s.eventAdditionalMetadata=p.proto.EventAdditionalMetadata.decode(e,e.uint32());break}case 65:{s.isMentionedInStatus=e.bool();break}case 66:{s.statusMentions&&s.statusMentions.length||(s.statusMentions=[]),s.statusMentions.push(e.string());break}case 67:{s.targetMessageId=p.proto.MessageKey.decode(e,e.uint32());break}case 68:{s.messageAddOns&&s.messageAddOns.length||(s.messageAddOns=[]),s.messageAddOns.push(p.proto.MessageAddOn.decode(e,e.uint32()));break}case 69:{s.statusMentionMessageInfo=p.proto.StatusMentionMessage.decode(e,e.uint32());break}case 70:{s.isSupportAiMessage=e.bool();break}case 71:{s.statusMentionSources&&s.statusMentionSources.length||(s.statusMentionSources=[]),s.statusMentionSources.push(e.string());break}case 72:{s.supportAiCitations&&s.supportAiCitations.length||(s.supportAiCitations=[]),s.supportAiCitations.push(p.proto.Citation.decode(e,e.uint32()));break}case 73:{s.botTargetId=e.string();break}case 74:{s.groupHistoryIndividualMessageInfo=p.proto.GroupHistoryIndividualMessageInfo.decode(e,e.uint32());break}case 75:{s.groupHistoryBundleInfo=p.proto.GroupHistoryBundleInfo.decode(e,e.uint32());break}case 76:{s.interactiveMessageAdditionalMetadata=p.proto.InteractiveMessageAdditionalMetadata.decode(e,e.uint32());break}case 77:{s.quarantinedMessage=p.proto.QuarantinedMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WebMessageInfo)return e;var a=new p.proto.WebMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.WebMessageInfo.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.WebMessageInfo.message: object expected");a.message=p.proto.Message.fromObject(e.message)}switch(e.messageTimestamp!=null&&(l.Long?(a.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?a.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?a.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(a.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"ERROR":case 0:a.status=0;break;case"PENDING":case 1:a.status=1;break;case"SERVER_ACK":case 2:a.status=2;break;case"DELIVERY_ACK":case 3:a.status=3;break;case"READ":case 4:a.status=4;break;case"PLAYED":case 5:a.status=5;break}switch(e.participant!=null&&(a.participant=String(e.participant)),e.messageC2STimestamp!=null&&(l.Long?(a.messageC2STimestamp=l.Long.fromValue(e.messageC2STimestamp)).unsigned=!0:typeof e.messageC2STimestamp=="string"?a.messageC2STimestamp=parseInt(e.messageC2STimestamp,10):typeof e.messageC2STimestamp=="number"?a.messageC2STimestamp=e.messageC2STimestamp:typeof e.messageC2STimestamp=="object"&&(a.messageC2STimestamp=new l.LongBits(e.messageC2STimestamp.low>>>0,e.messageC2STimestamp.high>>>0).toNumber(!0))),e.ignore!=null&&(a.ignore=!!e.ignore),e.starred!=null&&(a.starred=!!e.starred),e.broadcast!=null&&(a.broadcast=!!e.broadcast),e.pushName!=null&&(a.pushName=String(e.pushName)),e.mediaCiphertextSha256!=null&&(typeof e.mediaCiphertextSha256=="string"?l.base64.decode(e.mediaCiphertextSha256,a.mediaCiphertextSha256=l.newBuffer(l.base64.length(e.mediaCiphertextSha256)),0):e.mediaCiphertextSha256.length>=0&&(a.mediaCiphertextSha256=e.mediaCiphertextSha256)),e.multicast!=null&&(a.multicast=!!e.multicast),e.urlText!=null&&(a.urlText=!!e.urlText),e.urlNumber!=null&&(a.urlNumber=!!e.urlNumber),e.messageStubType){default:if(typeof e.messageStubType=="number"){a.messageStubType=e.messageStubType;break}break;case"UNKNOWN":case 0:a.messageStubType=0;break;case"REVOKE":case 1:a.messageStubType=1;break;case"CIPHERTEXT":case 2:a.messageStubType=2;break;case"FUTUREPROOF":case 3:a.messageStubType=3;break;case"NON_VERIFIED_TRANSITION":case 4:a.messageStubType=4;break;case"UNVERIFIED_TRANSITION":case 5:a.messageStubType=5;break;case"VERIFIED_TRANSITION":case 6:a.messageStubType=6;break;case"VERIFIED_LOW_UNKNOWN":case 7:a.messageStubType=7;break;case"VERIFIED_HIGH":case 8:a.messageStubType=8;break;case"VERIFIED_INITIAL_UNKNOWN":case 9:a.messageStubType=9;break;case"VERIFIED_INITIAL_LOW":case 10:a.messageStubType=10;break;case"VERIFIED_INITIAL_HIGH":case 11:a.messageStubType=11;break;case"VERIFIED_TRANSITION_ANY_TO_NONE":case 12:a.messageStubType=12;break;case"VERIFIED_TRANSITION_ANY_TO_HIGH":case 13:a.messageStubType=13;break;case"VERIFIED_TRANSITION_HIGH_TO_LOW":case 14:a.messageStubType=14;break;case"VERIFIED_TRANSITION_HIGH_TO_UNKNOWN":case 15:a.messageStubType=15;break;case"VERIFIED_TRANSITION_UNKNOWN_TO_LOW":case 16:a.messageStubType=16;break;case"VERIFIED_TRANSITION_LOW_TO_UNKNOWN":case 17:a.messageStubType=17;break;case"VERIFIED_TRANSITION_NONE_TO_LOW":case 18:a.messageStubType=18;break;case"VERIFIED_TRANSITION_NONE_TO_UNKNOWN":case 19:a.messageStubType=19;break;case"GROUP_CREATE":case 20:a.messageStubType=20;break;case"GROUP_CHANGE_SUBJECT":case 21:a.messageStubType=21;break;case"GROUP_CHANGE_ICON":case 22:a.messageStubType=22;break;case"GROUP_CHANGE_INVITE_LINK":case 23:a.messageStubType=23;break;case"GROUP_CHANGE_DESCRIPTION":case 24:a.messageStubType=24;break;case"GROUP_CHANGE_RESTRICT":case 25:a.messageStubType=25;break;case"GROUP_CHANGE_ANNOUNCE":case 26:a.messageStubType=26;break;case"GROUP_PARTICIPANT_ADD":case 27:a.messageStubType=27;break;case"GROUP_PARTICIPANT_REMOVE":case 28:a.messageStubType=28;break;case"GROUP_PARTICIPANT_PROMOTE":case 29:a.messageStubType=29;break;case"GROUP_PARTICIPANT_DEMOTE":case 30:a.messageStubType=30;break;case"GROUP_PARTICIPANT_INVITE":case 31:a.messageStubType=31;break;case"GROUP_PARTICIPANT_LEAVE":case 32:a.messageStubType=32;break;case"GROUP_PARTICIPANT_CHANGE_NUMBER":case 33:a.messageStubType=33;break;case"BROADCAST_CREATE":case 34:a.messageStubType=34;break;case"BROADCAST_ADD":case 35:a.messageStubType=35;break;case"BROADCAST_REMOVE":case 36:a.messageStubType=36;break;case"GENERIC_NOTIFICATION":case 37:a.messageStubType=37;break;case"E2E_IDENTITY_CHANGED":case 38:a.messageStubType=38;break;case"E2E_ENCRYPTED":case 39:a.messageStubType=39;break;case"CALL_MISSED_VOICE":case 40:a.messageStubType=40;break;case"CALL_MISSED_VIDEO":case 41:a.messageStubType=41;break;case"INDIVIDUAL_CHANGE_NUMBER":case 42:a.messageStubType=42;break;case"GROUP_DELETE":case 43:a.messageStubType=43;break;case"GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE":case 44:a.messageStubType=44;break;case"CALL_MISSED_GROUP_VOICE":case 45:a.messageStubType=45;break;case"CALL_MISSED_GROUP_VIDEO":case 46:a.messageStubType=46;break;case"PAYMENT_CIPHERTEXT":case 47:a.messageStubType=47;break;case"PAYMENT_FUTUREPROOF":case 48:a.messageStubType=48;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED":case 49:a.messageStubType=49;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED":case 50:a.messageStubType=50;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED":case 51:a.messageStubType=51;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP":case 52:a.messageStubType=52;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP":case 53:a.messageStubType=53;break;case"PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER":case 54:a.messageStubType=54;break;case"PAYMENT_ACTION_SEND_PAYMENT_REMINDER":case 55:a.messageStubType=55;break;case"PAYMENT_ACTION_SEND_PAYMENT_INVITATION":case 56:a.messageStubType=56;break;case"PAYMENT_ACTION_REQUEST_DECLINED":case 57:a.messageStubType=57;break;case"PAYMENT_ACTION_REQUEST_EXPIRED":case 58:a.messageStubType=58;break;case"PAYMENT_ACTION_REQUEST_CANCELLED":case 59:a.messageStubType=59;break;case"BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM":case 60:a.messageStubType=60;break;case"BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP":case 61:a.messageStubType=61;break;case"BIZ_INTRO_TOP":case 62:a.messageStubType=62;break;case"BIZ_INTRO_BOTTOM":case 63:a.messageStubType=63;break;case"BIZ_NAME_CHANGE":case 64:a.messageStubType=64;break;case"BIZ_MOVE_TO_CONSUMER_APP":case 65:a.messageStubType=65;break;case"BIZ_TWO_TIER_MIGRATION_TOP":case 66:a.messageStubType=66;break;case"BIZ_TWO_TIER_MIGRATION_BOTTOM":case 67:a.messageStubType=67;break;case"OVERSIZED":case 68:a.messageStubType=68;break;case"GROUP_CHANGE_NO_FREQUENTLY_FORWARDED":case 69:a.messageStubType=69;break;case"GROUP_V4_ADD_INVITE_SENT":case 70:a.messageStubType=70;break;case"GROUP_PARTICIPANT_ADD_REQUEST_JOIN":case 71:a.messageStubType=71;break;case"CHANGE_EPHEMERAL_SETTING":case 72:a.messageStubType=72;break;case"E2E_DEVICE_CHANGED":case 73:a.messageStubType=73;break;case"VIEWED_ONCE":case 74:a.messageStubType=74;break;case"E2E_ENCRYPTED_NOW":case 75:a.messageStubType=75;break;case"BLUE_MSG_BSP_FB_TO_BSP_PREMISE":case 76:a.messageStubType=76;break;case"BLUE_MSG_BSP_FB_TO_SELF_FB":case 77:a.messageStubType=77;break;case"BLUE_MSG_BSP_FB_TO_SELF_PREMISE":case 78:a.messageStubType=78;break;case"BLUE_MSG_BSP_FB_UNVERIFIED":case 79:a.messageStubType=79;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 80:a.messageStubType=80;break;case"BLUE_MSG_BSP_FB_VERIFIED":case 81:a.messageStubType=81;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 82:a.messageStubType=82;break;case"BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE":case 83:a.messageStubType=83;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED":case 84:a.messageStubType=84;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 85:a.messageStubType=85;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED":case 86:a.messageStubType=86;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 87:a.messageStubType=87;break;case"BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED":case 88:a.messageStubType=88;break;case"BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED":case 89:a.messageStubType=89;break;case"BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED":case 90:a.messageStubType=90;break;case"BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED":case 91:a.messageStubType=91;break;case"BLUE_MSG_SELF_FB_TO_BSP_PREMISE":case 92:a.messageStubType=92;break;case"BLUE_MSG_SELF_FB_TO_SELF_PREMISE":case 93:a.messageStubType=93;break;case"BLUE_MSG_SELF_FB_UNVERIFIED":case 94:a.messageStubType=94;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 95:a.messageStubType=95;break;case"BLUE_MSG_SELF_FB_VERIFIED":case 96:a.messageStubType=96;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 97:a.messageStubType=97;break;case"BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE":case 98:a.messageStubType=98;break;case"BLUE_MSG_SELF_PREMISE_UNVERIFIED":case 99:a.messageStubType=99;break;case"BLUE_MSG_SELF_PREMISE_VERIFIED":case 100:a.messageStubType=100;break;case"BLUE_MSG_TO_BSP_FB":case 101:a.messageStubType=101;break;case"BLUE_MSG_TO_CONSUMER":case 102:a.messageStubType=102;break;case"BLUE_MSG_TO_SELF_FB":case 103:a.messageStubType=103;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED":case 104:a.messageStubType=104;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 105:a.messageStubType=105;break;case"BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED":case 106:a.messageStubType=106;break;case"BLUE_MSG_UNVERIFIED_TO_VERIFIED":case 107:a.messageStubType=107;break;case"BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED":case 108:a.messageStubType=108;break;case"BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 109:a.messageStubType=109;break;case"BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED":case 110:a.messageStubType=110;break;case"BLUE_MSG_VERIFIED_TO_UNVERIFIED":case 111:a.messageStubType=111;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 112:a.messageStubType=112;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED":case 113:a.messageStubType=113;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 114:a.messageStubType=114;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED":case 115:a.messageStubType=115;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 116:a.messageStubType=116;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 117:a.messageStubType=117;break;case"E2E_IDENTITY_UNAVAILABLE":case 118:a.messageStubType=118;break;case"GROUP_CREATING":case 119:a.messageStubType=119;break;case"GROUP_CREATE_FAILED":case 120:a.messageStubType=120;break;case"GROUP_BOUNCED":case 121:a.messageStubType=121;break;case"BLOCK_CONTACT":case 122:a.messageStubType=122;break;case"EPHEMERAL_SETTING_NOT_APPLIED":case 123:a.messageStubType=123;break;case"SYNC_FAILED":case 124:a.messageStubType=124;break;case"SYNCING":case 125:a.messageStubType=125;break;case"BIZ_PRIVACY_MODE_INIT_FB":case 126:a.messageStubType=126;break;case"BIZ_PRIVACY_MODE_INIT_BSP":case 127:a.messageStubType=127;break;case"BIZ_PRIVACY_MODE_TO_FB":case 128:a.messageStubType=128;break;case"BIZ_PRIVACY_MODE_TO_BSP":case 129:a.messageStubType=129;break;case"DISAPPEARING_MODE":case 130:a.messageStubType=130;break;case"E2E_DEVICE_FETCH_FAILED":case 131:a.messageStubType=131;break;case"ADMIN_REVOKE":case 132:a.messageStubType=132;break;case"GROUP_INVITE_LINK_GROWTH_LOCKED":case 133:a.messageStubType=133;break;case"COMMUNITY_LINK_PARENT_GROUP":case 134:a.messageStubType=134;break;case"COMMUNITY_LINK_SIBLING_GROUP":case 135:a.messageStubType=135;break;case"COMMUNITY_LINK_SUB_GROUP":case 136:a.messageStubType=136;break;case"COMMUNITY_UNLINK_PARENT_GROUP":case 137:a.messageStubType=137;break;case"COMMUNITY_UNLINK_SIBLING_GROUP":case 138:a.messageStubType=138;break;case"COMMUNITY_UNLINK_SUB_GROUP":case 139:a.messageStubType=139;break;case"GROUP_PARTICIPANT_ACCEPT":case 140:a.messageStubType=140;break;case"GROUP_PARTICIPANT_LINKED_GROUP_JOIN":case 141:a.messageStubType=141;break;case"COMMUNITY_CREATE":case 142:a.messageStubType=142;break;case"EPHEMERAL_KEEP_IN_CHAT":case 143:a.messageStubType=143;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST":case 144:a.messageStubType=144;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE":case 145:a.messageStubType=145;break;case"INTEGRITY_UNLINK_PARENT_GROUP":case 146:a.messageStubType=146;break;case"COMMUNITY_PARTICIPANT_PROMOTE":case 147:a.messageStubType=147;break;case"COMMUNITY_PARTICIPANT_DEMOTE":case 148:a.messageStubType=148;break;case"COMMUNITY_PARENT_GROUP_DELETED":case 149:a.messageStubType=149;break;case"COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL":case 150:a.messageStubType=150;break;case"GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP":case 151:a.messageStubType=151;break;case"MASKED_THREAD_CREATED":case 152:a.messageStubType=152;break;case"MASKED_THREAD_UNMASKED":case 153:a.messageStubType=153;break;case"BIZ_CHAT_ASSIGNMENT":case 154:a.messageStubType=154;break;case"CHAT_PSA":case 155:a.messageStubType=155;break;case"CHAT_POLL_CREATION_MESSAGE":case 156:a.messageStubType=156;break;case"CAG_MASKED_THREAD_CREATED":case 157:a.messageStubType=157;break;case"COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED":case 158:a.messageStubType=158;break;case"CAG_INVITE_AUTO_ADD":case 159:a.messageStubType=159;break;case"BIZ_CHAT_ASSIGNMENT_UNASSIGN":case 160:a.messageStubType=160;break;case"CAG_INVITE_AUTO_JOINED":case 161:a.messageStubType=161;break;case"SCHEDULED_CALL_START_MESSAGE":case 162:a.messageStubType=162;break;case"COMMUNITY_INVITE_RICH":case 163:a.messageStubType=163;break;case"COMMUNITY_INVITE_AUTO_ADD_RICH":case 164:a.messageStubType=164;break;case"SUB_GROUP_INVITE_RICH":case 165:a.messageStubType=165;break;case"SUB_GROUP_PARTICIPANT_ADD_RICH":case 166:a.messageStubType=166;break;case"COMMUNITY_LINK_PARENT_GROUP_RICH":case 167:a.messageStubType=167;break;case"COMMUNITY_PARTICIPANT_ADD_RICH":case 168:a.messageStubType=168;break;case"SILENCED_UNKNOWN_CALLER_AUDIO":case 169:a.messageStubType=169;break;case"SILENCED_UNKNOWN_CALLER_VIDEO":case 170:a.messageStubType=170;break;case"GROUP_MEMBER_ADD_MODE":case 171:a.messageStubType=171;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD":case 172:a.messageStubType=172;break;case"COMMUNITY_CHANGE_DESCRIPTION":case 173:a.messageStubType=173;break;case"SENDER_INVITE":case 174:a.messageStubType=174;break;case"RECEIVER_INVITE":case 175:a.messageStubType=175;break;case"COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS":case 176:a.messageStubType=176;break;case"PINNED_MESSAGE_IN_CHAT":case 177:a.messageStubType=177;break;case"PAYMENT_INVITE_SETUP_INVITER":case 178:a.messageStubType=178;break;case"PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY":case 179:a.messageStubType=179;break;case"PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE":case 180:a.messageStubType=180;break;case"LINKED_GROUP_CALL_START":case 181:a.messageStubType=181;break;case"REPORT_TO_ADMIN_ENABLED_STATUS":case 182:a.messageStubType=182;break;case"EMPTY_SUBGROUP_CREATE":case 183:a.messageStubType=183;break;case"SCHEDULED_CALL_CANCEL":case 184:a.messageStubType=184;break;case"SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH":case 185:a.messageStubType=185;break;case"GROUP_CHANGE_RECENT_HISTORY_SHARING":case 186:a.messageStubType=186;break;case"PAID_MESSAGE_SERVER_CAMPAIGN_ID":case 187:a.messageStubType=187;break;case"GENERAL_CHAT_CREATE":case 188:a.messageStubType=188;break;case"GENERAL_CHAT_ADD":case 189:a.messageStubType=189;break;case"GENERAL_CHAT_AUTO_ADD_DISABLED":case 190:a.messageStubType=190;break;case"SUGGESTED_SUBGROUP_ANNOUNCE":case 191:a.messageStubType=191;break;case"BIZ_BOT_1P_MESSAGING_ENABLED":case 192:a.messageStubType=192;break;case"CHANGE_USERNAME":case 193:a.messageStubType=193;break;case"BIZ_COEX_PRIVACY_INIT_SELF":case 194:a.messageStubType=194;break;case"BIZ_COEX_PRIVACY_TRANSITION_SELF":case 195:a.messageStubType=195;break;case"SUPPORT_AI_EDUCATION":case 196:a.messageStubType=196;break;case"BIZ_BOT_3P_MESSAGING_ENABLED":case 197:a.messageStubType=197;break;case"REMINDER_SETUP_MESSAGE":case 198:a.messageStubType=198;break;case"REMINDER_SENT_MESSAGE":case 199:a.messageStubType=199;break;case"REMINDER_CANCEL_MESSAGE":case 200:a.messageStubType=200;break;case"BIZ_COEX_PRIVACY_INIT":case 201:a.messageStubType=201;break;case"BIZ_COEX_PRIVACY_TRANSITION":case 202:a.messageStubType=202;break;case"GROUP_DEACTIVATED":case 203:a.messageStubType=203;break;case"COMMUNITY_DEACTIVATE_SIBLING_GROUP":case 204:a.messageStubType=204;break;case"EVENT_UPDATED":case 205:a.messageStubType=205;break;case"EVENT_CANCELED":case 206:a.messageStubType=206;break;case"COMMUNITY_OWNER_UPDATED":case 207:a.messageStubType=207;break;case"COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN":case 208:a.messageStubType=208;break;case"CAPI_GROUP_NE2EE_SYSTEM_MESSAGE":case 209:a.messageStubType=209;break;case"STATUS_MENTION":case 210:a.messageStubType=210;break;case"USER_CONTROLS_SYSTEM_MESSAGE":case 211:a.messageStubType=211;break;case"SUPPORT_SYSTEM_MESSAGE":case 212:a.messageStubType=212;break;case"CHANGE_LID":case 213:a.messageStubType=213;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE":case 214:a.messageStubType=214;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE":case 215:a.messageStubType=215;break;case"CHANGE_LIMIT_SHARING":case 216:a.messageStubType=216;break;case"GROUP_MEMBER_LINK_MODE":case 217:a.messageStubType=217;break;case"BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE":case 218:a.messageStubType=218;break;case"PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE":case 219:a.messageStubType=219;break;case"QUARANTINED_MESSAGE":case 220:a.messageStubType=220;break;case"GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE":case 221:a.messageStubType=221;break}if(e.clearMedia!=null&&(a.clearMedia=!!e.clearMedia),e.messageStubParameters){if(!Array.isArray(e.messageStubParameters))throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected");a.messageStubParameters=[];for(var A=0;A>>0),e.labels){if(!Array.isArray(e.labels))throw TypeError(".proto.WebMessageInfo.labels: array expected");a.labels=[];for(var A=0;A>>0,e.ephemeralStartTimestamp.high>>>0).toNumber(!0))),e.ephemeralDuration!=null&&(a.ephemeralDuration=e.ephemeralDuration>>>0),e.ephemeralOffToOn!=null&&(a.ephemeralOffToOn=!!e.ephemeralOffToOn),e.ephemeralOutOfSync!=null&&(a.ephemeralOutOfSync=!!e.ephemeralOutOfSync),e.bizPrivacyStatus){default:if(typeof e.bizPrivacyStatus=="number"){a.bizPrivacyStatus=e.bizPrivacyStatus;break}break;case"E2EE":case 0:a.bizPrivacyStatus=0;break;case"FB":case 2:a.bizPrivacyStatus=2;break;case"BSP":case 1:a.bizPrivacyStatus=1;break;case"BSP_AND_FB":case 3:a.bizPrivacyStatus=3;break}if(e.verifiedBizName!=null&&(a.verifiedBizName=String(e.verifiedBizName)),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.WebMessageInfo.mediaData: object expected");a.mediaData=p.proto.MediaData.fromObject(e.mediaData)}if(e.photoChange!=null){if(typeof e.photoChange!="object")throw TypeError(".proto.WebMessageInfo.photoChange: object expected");a.photoChange=p.proto.PhotoChange.fromObject(e.photoChange)}if(e.userReceipt){if(!Array.isArray(e.userReceipt))throw TypeError(".proto.WebMessageInfo.userReceipt: array expected");a.userReceipt=[];for(var A=0;A=0&&(a.futureproofData=e.futureproofData)),e.statusPsa!=null){if(typeof e.statusPsa!="object")throw TypeError(".proto.WebMessageInfo.statusPsa: object expected");a.statusPsa=p.proto.StatusPSA.fromObject(e.statusPsa)}if(e.pollUpdates){if(!Array.isArray(e.pollUpdates))throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected");a.pollUpdates=[];for(var A=0;A=0&&(a.messageSecret=e.messageSecret)),e.keepInChat!=null){if(typeof e.keepInChat!="object")throw TypeError(".proto.WebMessageInfo.keepInChat: object expected");a.keepInChat=p.proto.KeepInChat.fromObject(e.keepInChat)}if(e.originalSelfAuthorUserJidString!=null&&(a.originalSelfAuthorUserJidString=String(e.originalSelfAuthorUserJidString)),e.revokeMessageTimestamp!=null&&(l.Long?(a.revokeMessageTimestamp=l.Long.fromValue(e.revokeMessageTimestamp)).unsigned=!0:typeof e.revokeMessageTimestamp=="string"?a.revokeMessageTimestamp=parseInt(e.revokeMessageTimestamp,10):typeof e.revokeMessageTimestamp=="number"?a.revokeMessageTimestamp=e.revokeMessageTimestamp:typeof e.revokeMessageTimestamp=="object"&&(a.revokeMessageTimestamp=new l.LongBits(e.revokeMessageTimestamp.low>>>0,e.revokeMessageTimestamp.high>>>0).toNumber(!0))),e.pinInChat!=null){if(typeof e.pinInChat!="object")throw TypeError(".proto.WebMessageInfo.pinInChat: object expected");a.pinInChat=p.proto.PinInChat.fromObject(e.pinInChat)}if(e.premiumMessageInfo!=null){if(typeof e.premiumMessageInfo!="object")throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected");a.premiumMessageInfo=p.proto.PremiumMessageInfo.fromObject(e.premiumMessageInfo)}if(e.is1PBizBotMessage!=null&&(a.is1PBizBotMessage=!!e.is1PBizBotMessage),e.isGroupHistoryMessage!=null&&(a.isGroupHistoryMessage=!!e.isGroupHistoryMessage),e.botMessageInvokerJid!=null&&(a.botMessageInvokerJid=String(e.botMessageInvokerJid)),e.commentMetadata!=null){if(typeof e.commentMetadata!="object")throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected");a.commentMetadata=p.proto.CommentMetadata.fromObject(e.commentMetadata)}if(e.eventResponses){if(!Array.isArray(e.eventResponses))throw TypeError(".proto.WebMessageInfo.eventResponses: array expected");a.eventResponses=[];for(var A=0;A>>0,e.newsletterServerId.high>>>0).toNumber(!0))),e.eventAdditionalMetadata!=null){if(typeof e.eventAdditionalMetadata!="object")throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected");a.eventAdditionalMetadata=p.proto.EventAdditionalMetadata.fromObject(e.eventAdditionalMetadata)}if(e.isMentionedInStatus!=null&&(a.isMentionedInStatus=!!e.isMentionedInStatus),e.statusMentions){if(!Array.isArray(e.statusMentions))throw TypeError(".proto.WebMessageInfo.statusMentions: array expected");a.statusMentions=[];for(var A=0;A>>3){case 2:{s.timestamp=e.uint64();break}case 3:{s.unreadChats=e.uint32();break}case 4:{s.notifyMessageCount=e.uint32();break}case 5:{s.notifyMessages&&s.notifyMessages.length||(s.notifyMessages=[]),s.notifyMessages.push(p.proto.WebMessageInfo.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof p.proto.WebNotificationsInfo)return e;var a=new p.proto.WebNotificationsInfo;if(e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.unreadChats!=null&&(a.unreadChats=e.unreadChats>>>0),e.notifyMessageCount!=null&&(a.notifyMessageCount=e.notifyMessageCount>>>0),e.notifyMessages){if(!Array.isArray(e.notifyMessages))throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected");a.notifyMessages=[];for(var A=0;ASa.hasSubscribers||BB.hasSubscribers,AX=new Set,eX=typeof process=="object"&&process?process:{},QUe=(n,t,o,i)=>{typeof eX.emitWarning=="function"?eX.emitWarning(n,t,o,i):console.error(`[${o}] ${t}: ${n}`)},yUe=n=>!AX.has(n),qc=n=>!!n&&n===Math.floor(n)&&n>0&&isFinite(n),tX=n=>qc(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Xw:null:null,Xw=class extends Array{constructor(n){super(n),this.fill(0)}},mUe=class fB{heap;length;static#e=!1;static create(t){let o=tX(t);if(!o)return[];fB.#e=!0;let i=new fB(t,o);return fB.#e=!1,i}constructor(t,o){if(!fB.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Gg=class rX{#e;#A;#t;#r;#l;#o;#i;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#s;#p;#c;#g;#I;#d;#h;#C;#u;#B;#f;#Q;#S;#y;#m;#D;#E;#N;static unsafeExposeInternals(t){return{starts:t.#Q,ttls:t.#S,autopurgeTimers:t.#y,sizes:t.#f,keyMap:t.#p,keyList:t.#c,valList:t.#g,next:t.#I,prev:t.#d,get head(){return t.#h},get tail(){return t.#C},free:t.#u,isBackgroundFetch:o=>t.#M(o),backgroundFetch:(o,i,e,a)=>t.#z(o,i,e,a),moveToTail:o=>t.#Y(o),indexes:o=>t.#H(o),rindexes:o=>t.#U(o),isStale:o=>t.#_(o)}}get max(){return this.#e}get maxSize(){return this.#A}get calculatedSize(){return this.#s}get size(){return this.#n}get fetchMethod(){return this.#o}get memoMethod(){return this.#i}get dispose(){return this.#t}get onInsert(){return this.#r}get disposeAfter(){return this.#l}constructor(t){let{max:o=0,ttl:i,ttlResolution:e=1,ttlAutopurge:a,updateAgeOnGet:A,updateAgeOnHas:r,allowStale:s,dispose:g,onInsert:c,disposeAfter:I,noDisposeOnSet:d,noUpdateTTL:B,maxSize:f=0,maxEntrySize:Q=0,sizeCalculation:y,fetchMethod:m,memoMethod:T,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:K,allowStaleOnFetchAbort:L,ignoreFetchAbort:F,backgroundFetchSize:q=1,perf:V}=t;if(this.backgroundFetchSize=q,V!==void 0&&typeof V?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=V??fUe,o!==0&&!qc(o))throw new TypeError("max option must be a nonnegative integer");let x=o?tX(o):Array;if(!x)throw new Error("invalid max value: "+o);if(this.#e=o,this.#A=f,this.maxEntrySize=Q||this.#A,this.sizeCalculation=y,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#i=T,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=m,this.#D=!!m,this.#p=new Map,this.#c=Array.from({length:o}).fill(void 0),this.#g=Array.from({length:o}).fill(void 0),this.#I=new x(o),this.#d=new x(o),this.#h=0,this.#C=0,this.#u=mUe.create(o),this.#n=0,this.#s=0,typeof g=="function"&&(this.#t=g),typeof c=="function"&&(this.#r=c),typeof I=="function"?(this.#l=I,this.#B=[]):(this.#l=void 0,this.#B=void 0),this.#m=!!this.#t,this.#N=!!this.#r,this.#E=!!this.#l,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!K,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(this.#A!==0&&!qc(this.#A))throw new TypeError("maxSize must be a positive integer if specified");if(!qc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!A,this.updateAgeOnHas=!!r,this.ttlResolution=qc(e)||e===0?e:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!qc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#e===0&&this.ttl===0&&this.#A===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#A){let G="LRU_CACHE_UNBOUNDED";yUe(G)&&(AX.add(G),QUe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,rX))}}getRemainingTTL(t){return this.#p.has(t)?1/0:0}#T(){let t=new Xw(this.#e),o=new Xw(this.#e);this.#S=t,this.#Q=o;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#y=i,this.#R=(s,g,c=this.#a.now())=>{o[s]=g!==0?c:0,t[s]=g,e(s,g)},this.#O=s=>{o[s]=t[s]!==0?this.#a.now():0,e(s,t[s])};let e=this.ttlAutopurge?(s,g)=>{if(i?.[s]&&(clearTimeout(i[s]),i[s]=void 0),g&&g!==0&&i){let c=setTimeout(()=>{this.#_(s)?(this.#J(this.#c[s],"expire"),i[s]=void 0):e(s,r(s))},g+1);c.unref&&c.unref(),i[s]=c}}:()=>{};this.#w=(s,g)=>{if(t[g]){let c=t[g],I=o[g];if(!c||!I)return;s.ttl=c,s.start=I,s.now=a||A();let d=s.now-I;s.remainingTTL=c-d}};let a=0,A=()=>{let s=this.#a.now();if(this.ttlResolution>0){a=s;let g=setTimeout(()=>a=0,this.ttlResolution);g.unref&&g.unref()}return s};this.getRemainingTTL=s=>{let g=this.#p.get(s);return g===void 0?0:r(g)};let r=s=>{let g=t[s],c=o[s];if(!g||!c)return 1/0;let I=(a||A())-c;return g-I};this.#_=s=>{let g=o[s],c=t[s];return!!c&&!!g&&(a||A())-g>c}}#O=()=>{};#w=()=>{};#R=()=>{};#_=()=>!1;#G(){let t=new Xw(this.#e);this.#s=0,this.#f=t,this.#k=o=>{this.#s-=t[o],t[o]=0},this.#P=(o,i,e,a)=>{if(!qc(e)){if(this.#M(i))return this.backgroundFetchSize;if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(e=a(i,o),!qc(e))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return e},this.#F=(o,i,e)=>{if(t[o]=i,this.#A){let a=this.#A-t[o];for(;this.#s>a;)this.#K(!0)}this.#s+=t[o],e&&(e.entrySize=i,e.totalCalculatedSize=this.#s)}}#k=t=>{};#F=(t,o,i)=>{};#P=(t,o,i,e)=>{if(i||e)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#H({allowStale:t=this.allowStale}={}){if(this.#n)for(let o=this.#C;this.#L(o)&&((t||!this.#_(o))&&(yield o),o!==this.#h);)o=this.#d[o]}*#U({allowStale:t=this.allowStale}={}){if(this.#n)for(let o=this.#h;this.#L(o)&&((t||!this.#_(o))&&(yield o),o!==this.#C);)o=this.#I[o]}#L(t){return t!==void 0&&this.#p.get(this.#c[t])===t}*entries(){for(let t of this.#H())this.#g[t]!==void 0&&this.#c[t]!==void 0&&!this.#M(this.#g[t])&&(yield[this.#c[t],this.#g[t]])}*rentries(){for(let t of this.#U())this.#g[t]!==void 0&&this.#c[t]!==void 0&&!this.#M(this.#g[t])&&(yield[this.#c[t],this.#g[t]])}*keys(){for(let t of this.#H()){let o=this.#c[t];o!==void 0&&!this.#M(this.#g[t])&&(yield o)}}*rkeys(){for(let t of this.#U()){let o=this.#c[t];o!==void 0&&!this.#M(this.#g[t])&&(yield o)}}*values(){for(let t of this.#H())this.#g[t]!==void 0&&!this.#M(this.#g[t])&&(yield this.#g[t])}*rvalues(){for(let t of this.#U())this.#g[t]!==void 0&&!this.#M(this.#g[t])&&(yield this.#g[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,o={}){for(let i of this.#H()){let e=this.#g[i],a=this.#M(e)?e.__staleWhileFetching:e;if(a!==void 0&&t(a,this.#c[i],this))return this.#Z(this.#c[i],o)}}forEach(t,o=this){for(let i of this.#H()){let e=this.#g[i],a=this.#M(e)?e.__staleWhileFetching:e;a!==void 0&&t.call(o,a,this.#c[i],this)}}rforEach(t,o=this){for(let i of this.#U()){let e=this.#g[i],a=this.#M(e)?e.__staleWhileFetching:e;a!==void 0&&t.call(o,a,this.#c[i],this)}}purgeStale(){let t=!1;for(let o of this.#U({allowStale:!0}))this.#_(o)&&(this.#J(this.#c[o],"expire"),t=!0);return t}info(t){let o=this.#p.get(t);if(o===void 0)return;let i=this.#g[o],e=this.#M(i)?i.__staleWhileFetching:i;if(e===void 0)return;let a={value:e};if(this.#S&&this.#Q){let A=this.#S[o],r=this.#Q[o];if(A&&r){let s=A-(this.#a.now()-r);a.ttl=s,a.start=Date.now()}}return this.#f&&(a.size=this.#f[o]),a}dump(){let t=[];for(let o of this.#H({allowStale:!0})){let i=this.#c[o],e=this.#g[o],a=this.#M(e)?e.__staleWhileFetching:e;if(a===void 0||i===void 0)continue;let A={value:a};if(this.#S&&this.#Q){A.ttl=this.#S[o];let r=this.#a.now()-this.#Q[o];A.start=Math.floor(Date.now()-r)}this.#f&&(A.size=this.#f[o]),t.unshift([i,A])}return t}load(t){this.clear();for(let[o,i]of t){if(i.start){let e=Date.now()-i.start;i.start=this.#a.now()-e}this.#v(o,i.value,i)}}set(t,o,i={}){let{status:e=Sa.hasSubscribers?{}:void 0}=i;i.status=e,e&&(e.op="set",e.key=t,o!==void 0&&(e.value=o),e.cache=this);let a=this.#v(t,o,i);return e&&Sa.hasSubscribers&&Sa.publish(e),a}#v(t,o,i,e){let{ttl:a=this.ttl,start:A,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:g}=i,c=this.#M(o);if(o===void 0)return g&&(g.set="deleted"),this.delete(t),this;let{noUpdateTTL:I=this.noUpdateTTL}=i;g&&!c&&(g.value=o);let d=this.#P(t,o,i.size||0,s,g);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#J(t,"set"),g&&(g.set="miss",g.maxEntrySizeExceeded=!0),this;let B=this.#n===0?void 0:this.#p.get(t);if(B===void 0)B=this.#n===0?this.#C:this.#u.length!==0?this.#u.pop():this.#n===this.#e?this.#K(!1):this.#n,this.#c[B]=t,this.#g[B]=o,this.#p.set(t,B),this.#I[this.#C]=B,this.#d[B]=this.#C,this.#C=B,this.#n++,this.#F(B,d,g),g&&(g.set="add"),I=!1,this.#N&&!c&&this.#r?.(o,t,"add");else{this.#Y(B);let f=this.#g[B];if(o!==f){if(!r)if(this.#M(f)){f!==e&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Q}=f;Q!==void 0&&Q!==o&&(this.#m&&this.#t?.(Q,t,"set"),this.#E&&this.#B?.push([Q,t,"set"]))}else this.#m&&this.#t?.(f,t,"set"),this.#E&&this.#B?.push([f,t,"set"]);if(this.#k(B),this.#F(B,d,g),this.#g[B]=o,!c){let Q=f&&this.#M(f)?f.__staleWhileFetching:f,y=Q===void 0?"add":o!==Q?"replace":"update";g&&(g.set=y,Q!==void 0&&(g.oldValue=Q)),this.#N&&this.onInsert?.(o,t,y)}}else c||(g&&(g.set="update"),this.#N&&this.onInsert?.(o,t,"update"))}if(a!==0&&!this.#S&&this.#T(),this.#S&&(I||this.#R(B,a,A),g&&this.#w(g,B)),!r&&this.#E&&this.#B){let f=this.#B,Q;for(;Q=f?.shift();)this.#l?.(...Q)}return this}pop(){try{for(;this.#n;){let t=this.#g[this.#h];if(this.#K(!0),this.#M(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#E&&this.#B){let t=this.#B,o;for(;o=t?.shift();)this.#l?.(...o)}}}#K(t){let o=this.#h,i=this.#c[o],e=this.#g[o],a=this.#M(e);a&&e.__abortController.abort(new Error("evicted"));let A=a?e.__staleWhileFetching:e;return(this.#m||this.#E)&&A!==void 0&&(this.#m&&this.#t?.(A,i,"evict"),this.#E&&this.#B?.push([A,i,"evict"])),this.#k(o),this.#y?.[o]&&(clearTimeout(this.#y[o]),this.#y[o]=void 0),t&&(this.#c[o]=void 0,this.#g[o]=void 0,this.#u.push(o)),this.#n===1?(this.#h=this.#C=0,this.#u.length=0):this.#h=this.#I[o],this.#p.delete(i),this.#n--,o}has(t,o={}){let{status:i=Sa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="has",i.key=t,i.cache=this);let e=this.#q(t,o);return Sa.hasSubscribers&&Sa.publish(i),e}#q(t,o={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:e}=o,a=this.#p.get(t);if(a!==void 0){let A=this.#g[a];if(this.#M(A)&&A.__staleWhileFetching===void 0)return!1;if(this.#_(a))e&&(e.has="stale",this.#w(e,a));else return i&&this.#O(a),e&&(e.has="hit",this.#w(e,a)),!0}else e&&(e.has="miss");return!1}peek(t,o={}){let{status:i=bF()?{}:void 0}=o;i&&(i.op="peek",i.key=t,i.cache=this),o.status=i;let e=this.#W(t,o);return Sa.hasSubscribers&&Sa.publish(i),e}#W(t,o){let{status:i,allowStale:e=this.allowStale}=o,a=this.#p.get(t);if(a===void 0||!e&&this.#_(a)){i&&(i.peek=a===void 0?"miss":"stale");return}let A=this.#g[a],r=this.#M(A)?A.__staleWhileFetching:A;return i&&(r!==void 0?(i.peek="hit",i.value=r):i.peek="miss"),r}#z(t,o,i,e){let a=o===void 0?void 0:this.#g[o];if(this.#M(a))return a;let A=new AbortController,{signal:r}=i;r?.addEventListener("abort",()=>A.abort(r.reason),{signal:A.signal});let s={signal:A.signal,options:i,context:e},g=(Q,y=!1)=>{let{aborted:m}=A.signal,T=i.ignoreFetchAbort&&Q!==void 0,_=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&Q!==void 0);if(i.status&&(m&&!y?(i.status.fetchAborted=!0,i.status.fetchError=A.signal.reason,T&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),m&&!T&&!y)return I(A.signal.reason,_);let R=B,K=this.#g[o];return(K===B||K===void 0&&T&&y)&&(Q===void 0?R.__staleWhileFetching!==void 0?this.#g[o]=R.__staleWhileFetching:this.#J(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#v(t,Q,s.options,R))),Q},c=Q=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=Q),I(Q,!1)),I=(Q,y)=>{let{aborted:m}=A.signal,T=m&&i.allowStaleOnFetchAbort,_=T||i.allowStaleOnFetchRejection,R=_||i.noDeleteOnFetchRejection,K=B;if(this.#g[o]===B&&(!R||!y&&K.__staleWhileFetching===void 0?this.#J(t,"fetch"):T||(this.#g[o]=K.__staleWhileFetching)),_)return i.status&&K.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),K.__staleWhileFetching;if(K.__returned===K)throw Q},d=(Q,y)=>{let m=this.#o?.(t,a,s);A.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(Q(void 0),i.allowStaleOnFetchAbort&&(Q=T=>g(T,!0)))}),m&&m instanceof Promise?m.then(T=>Q(T===void 0?void 0:T),y):m!==void 0&&Q(m)};i.status&&(i.status.fetchDispatched=!0);let B=new Promise(d).then(g,c),f=Object.assign(B,{__abortController:A,__staleWhileFetching:a,__returned:void 0});return o===void 0?(this.#v(t,f,{...s.options,status:void 0}),o=this.#p.get(t)):this.#g[o]=f,f}#M(t){if(!this.#D)return!1;let o=t;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController}fetch(t,o={}){let i=BB.hasSubscribers,{status:e=bF()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let a=this.#j(t,o);return e&&i&&(e.trace=!0,BB.tracePromise(()=>a,e).catch(()=>{})),a}async#j(t,o={}){let{allowStale:i=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:A=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:s=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:I=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:Q,forceRefresh:y=!1,status:m,signal:T}=o;if(m&&(m.op="fetch",m.key=t,y&&(m.forceRefresh=!0),m.cache=this),!this.#D)return m&&(m.fetch="get"),this.#Z(t,{allowStale:i,updateAgeOnGet:e,noDeleteOnStaleGet:a,status:m});let _={allowStale:i,updateAgeOnGet:e,noDeleteOnStaleGet:a,ttl:A,noDisposeOnSet:r,size:s,sizeCalculation:g,noUpdateTTL:c,noDeleteOnFetchRejection:I,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:f,ignoreFetchAbort:B,status:m,signal:T},R=this.#p.get(t);if(R===void 0){m&&(m.fetch="miss");let K=this.#z(t,R,_,Q);return K.__returned=K}else{let K=this.#g[R];if(this.#M(K)){let V=i&&K.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",V&&(m.returnedStale=!0)),V?K.__staleWhileFetching:K.__returned=K}let L=this.#_(R);if(!y&&!L)return m&&(m.fetch="hit"),this.#Y(R),e&&this.#O(R),m&&this.#w(m,R),K;let F=this.#z(t,R,_,Q),q=F.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=L?"stale":"refresh",q&&L&&(m.returnedStale=!0)),q?F.__staleWhileFetching:F.__returned=F}}forceFetch(t,o={}){let i=BB.hasSubscribers,{status:e=bF()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let a=this.#ee(t,o);return e&&i&&(e.trace=!0,BB.tracePromise(()=>a,e).catch(()=>{})),a}async#ee(t,o={}){let i=await this.#j(t,o);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,o={}){let{status:i=Sa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="memo",i.key=t,o.context&&(i.context=o.context),i.cache=this);let e=this.#ie(t,o);return i&&(i.value=e),Sa.hasSubscribers&&Sa.publish(i),e}#ie(t,o={}){let i=this.#i;if(!i)throw new Error("no memoMethod provided to constructor");let{context:e,status:a,forceRefresh:A,...r}=o;a&&A&&(a.forceRefresh=!0);let s=this.#Z(t,r),g=A||s===void 0;if(a&&(a.memo=g?"miss":"hit",g||(a.value=s)),!g)return s;let c=i(t,s,{options:r,context:e});return a&&(a.value=c),this.#v(t,c,r),c}get(t,o={}){let{status:i=Sa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="get",i.key=t,i.cache=this);let e=this.#Z(t,o);return i&&(e!==void 0&&(i.value=e),Sa.hasSubscribers&&Sa.publish(i)),e}#Z(t,o={}){let{allowStale:i=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:A}=o,r=this.#p.get(t);if(r===void 0){A&&(A.get="miss");return}let s=this.#g[r],g=this.#M(s);return A&&this.#w(A,r),this.#_(r)?g?(A&&(A.get="stale-fetching"),i&&s.__staleWhileFetching!==void 0?(A&&(A.returnedStale=!0),s.__staleWhileFetching):void 0):(a||this.#J(t,"expire"),A&&(A.get="stale"),i?(A&&(A.returnedStale=!0),s):void 0):(A&&(A.get=g?"fetching":"hit"),this.#Y(r),e&&this.#O(r),g?s.__staleWhileFetching:s)}#te(t,o){this.#d[o]=t,this.#I[t]=o}#Y(t){t!==this.#C&&(t===this.#h?this.#h=this.#I[t]:this.#te(this.#d[t],this.#I[t]),this.#te(this.#C,t),this.#C=t)}delete(t){return this.#J(t,"delete")}#J(t,o){Sa.hasSubscribers&&Sa.publish({op:"delete",delete:o,key:t,cache:this});let i=!1;if(this.#n!==0){let e=this.#p.get(t);if(e!==void 0)if(this.#y?.[e]&&(clearTimeout(this.#y[e]),this.#y[e]=void 0),i=!0,this.#n===1)this.#x(o);else{this.#k(e);let a=this.#g[e];if(this.#M(a)?a.__abortController.abort(new Error("deleted")):(this.#m||this.#E)&&(this.#m&&this.#t?.(a,t,o),this.#E&&this.#B?.push([a,t,o])),this.#p.delete(t),this.#c[e]=void 0,this.#g[e]=void 0,e===this.#C)this.#C=this.#d[e];else if(e===this.#h)this.#h=this.#I[e];else{let A=this.#d[e];this.#I[A]=this.#I[e];let r=this.#I[e];this.#d[r]=this.#d[e]}this.#n--,this.#u.push(e)}}if(this.#E&&this.#B?.length){let e=this.#B,a;for(;a=e?.shift();)this.#l?.(...a)}return i}clear(){return this.#x("delete")}#x(t){for(let o of this.#U({allowStale:!0})){let i=this.#g[o];if(this.#M(i))i.__abortController.abort(new Error("deleted"));else{let e=this.#c[o];this.#m&&this.#t?.(i,e,t),this.#E&&this.#B?.push([i,e,t])}}if(this.#p.clear(),this.#g.fill(void 0),this.#c.fill(void 0),this.#S&&this.#Q){this.#S.fill(0),this.#Q.fill(0);for(let o of this.#y??[])o!==void 0&&clearTimeout(o);this.#y?.fill(void 0)}if(this.#f&&this.#f.fill(0),this.#h=0,this.#C=0,this.#u.length=0,this.#s=0,this.#n=0,this.#E&&this.#B){let o=this.#B,i;for(;i=o?.shift();)this.#l?.(...i)}}};var ED=qe(Kr(),1);import{createHash as nHe,randomBytes as NB}from"crypto";var $X=["critical_block","critical_unblock_low","regular_high","regular_low","regular"];var ZfA=qe(Kr(),1),ga;(function(n){n[n.Connecting=0]="Connecting",n[n.AwaitingInitialSync=1]="AwaitingInitialSync",n[n.Syncing=2]="Syncing",n[n.Online=3]="Online"})(ga||(ga={}));var Vc;(function(n){n.BIZ_COMMERCE_VIOLATION_ALCOHOL="BIZ_COMMERCE_VIOLATION_ALCOHOL",n.BIZ_COMMERCE_VIOLATION_ADULT="BIZ_COMMERCE_VIOLATION_ADULT",n.BIZ_COMMERCE_VIOLATION_ANIMALS="BIZ_COMMERCE_VIOLATION_ANIMALS",n.BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS="BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS",n.BIZ_COMMERCE_VIOLATION_DATING="BIZ_COMMERCE_VIOLATION_DATING",n.BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS="BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS",n.BIZ_COMMERCE_VIOLATION_DRUGS="BIZ_COMMERCE_VIOLATION_DRUGS",n.BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC="BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC",n.BIZ_COMMERCE_VIOLATION_GAMBLING="BIZ_COMMERCE_VIOLATION_GAMBLING",n.BIZ_COMMERCE_VIOLATION_HEALTHCARE="BIZ_COMMERCE_VIOLATION_HEALTHCARE",n.BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY="BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY",n.BIZ_COMMERCE_VIOLATION_SUPPLEMENTS="BIZ_COMMERCE_VIOLATION_SUPPLEMENTS",n.BIZ_COMMERCE_VIOLATION_TOBACCO="BIZ_COMMERCE_VIOLATION_TOBACCO",n.BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT="BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT",n.BIZ_COMMERCE_VIOLATION_WEAPONS="BIZ_COMMERCE_VIOLATION_WEAPONS",n.BIZ_QUALITY="BIZ_QUALITY",n.DEFAULT="DEFAULT",n.WEB_COMPANION_ONLY="WEB_COMPANION_ONLY"})(Vc||(Vc={}));var e7;(function(n){n.NONE="NONE",n.FIRST_WARNING="FIRST_WARNING",n.SECOND_WARNING="SECOND_WARNING",n.CAPPED="CAPPED"})(e7||(e7={}));var A7;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.NOT_ACTIVE="NOT_ACTIVE",n.ACTIVE="ACTIVE",n.ACTIVE_UPGRADE_AVAILABLE="ACTIVE_UPGRADE_AVAILABLE"})(A7||(A7={}));var t7;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.ELIGIBLE="ELIGIBLE",n.ACTIVE_IN_CURRENT_CYCLE="ACTIVE_IN_CURRENT_CYCLE",n.EXHAUSTED="EXHAUSTED"})(t7||(t7={}));var RA=oe.WebMessageInfo.StubType,lh=oe.WebMessageInfo.Status,yB;(function(n){n.PN="pn",n.LID="lid"})(yB||(yB={}));var wa;(function(n){n.xwa2_newsletter_create="xwa2_newsletter_create",n.xwa2_newsletter_subscribers="xwa2_newsletter_subscribers",n.xwa2_newsletter_view="xwa2_newsletter_view",n.xwa2_newsletter_metadata="xwa2_newsletter",n.xwa2_newsletter_admin_count="xwa2_newsletter_admin",n.xwa2_newsletter_mute_v2="xwa2_newsletter_mute_v2",n.xwa2_newsletter_unmute_v2="xwa2_newsletter_unmute_v2",n.xwa2_newsletter_follow="xwa2_newsletter_follow",n.xwa2_newsletter_unfollow="xwa2_newsletter_unfollow",n.xwa2_newsletter_join_v2="xwa2_newsletter_join_v2",n.xwa2_newsletter_leave_v2="xwa2_newsletter_leave_v2",n.xwa2_newsletter_change_owner="xwa2_newsletter_change_owner",n.xwa2_newsletter_demote="xwa2_newsletter_demote",n.xwa2_newsletter_delete_v2="xwa2_newsletter_delete_v2",n.xwa2_fetch_account_reachout_timelock="xwa2_fetch_account_reachout_timelock",n.xwa2_message_capping_info="xwa2_message_capping_info"})(wa||(wa={}));var ca;(function(n){n.CREATE="8823471724422422",n.UPDATE_METADATA="24250201037901610",n.METADATA="6563316087068696",n.SUBSCRIBERS="9783111038412085",n.FOLLOW="24404358912487870",n.UNFOLLOW="9767147403369991",n.MUTE="29766401636284406",n.UNMUTE="9864994326891137",n.ADMIN_COUNT="7130823597031706",n.CHANGE_OWNER="7341777602580933",n.DEMOTE="6551828931592903",n.DELETE="30062808666639665",n.REACHOUT_TIMELOCK="23983697327930364",n.MESSAGE_CAPPING_INFO="24503548349331633"})(ca||(ca={}));var $t;(function(n){n[n.connectionClosed=428]="connectionClosed",n[n.connectionLost=408]="connectionLost",n[n.connectionReplaced=440]="connectionReplaced",n[n.timedOut=408]="timedOut",n[n.loggedOut=401]="loggedOut",n[n.badSession=500]="badSession",n[n.restartRequired=515]="restartRequired",n[n.multideviceMismatch=411]="multideviceMismatch",n[n.forbidden=403]="forbidden",n[n.unavailableService=503]="unavailableService"})($t||($t={}));var mB={};Fr(mB,{DOUBLE_BYTE_TOKENS:()=>r7,SINGLE_BYTE_TOKENS:()=>a7,TAGS:()=>PUe,TOKEN_MAP:()=>LF});var PUe={LIST_EMPTY:0,DICTIONARY_0:236,DICTIONARY_1:237,DICTIONARY_2:238,DICTIONARY_3:239,INTEROP_JID:245,FB_JID:246,AD_JID:247,LIST_8:248,LIST_16:249,JID_PAIR:250,HEX_8:251,BINARY_8:252,BINARY_20:253,BINARY_32:254,NIBBLE_8:255,PACKED_MAX:127},r7=[["read-self","active","fbns","protocol","reaction","screen_width","heartbeat","deviceid","2:47DEQpj8","uploadfieldstat","voip_settings","retry","priority","longitude","conflict","false","ig_professional","replaced","preaccept","cover_photo","uncompressed","encopt","ppic","04","passive","status-revoke-drop","keygen","540","offer","rate","opus","latitude","w:gp2","ver","4","business_profile","medium","sender","prev_v_id","email","website","invited","sign_credential","05","transport","skey","reason","peer_abtest_bucket","America/Sao_Paulo","appid","refresh","100","06","404","101","104","107","102","109","103","member_add_mode","105","transaction-id","110","106","outgoing","108","111","tokens","followers","ig_handle","self_pid","tue","dec","thu","joinable","peer_pid","mon","features","wed","peer_device_presence","pn","delete","07","fri","audio_duration","admin","connected","delta","rcat","disable","collection","08","480","sat","phash","all","invite","accept","critical_unblock_low","group_update","signed_credential","blinded_credential","eph_setting","net","09","background_location","refresh_id","Asia/Kolkata","privacy_mode_ts","account_sync","voip_payload_type","service_areas","acs_public_key","v_id","0a","fallback_class","relay","actual_actors","metadata","w:biz","5","connected-limit","notice","0b","host_storage","fb_page","subject","privatestats","invis","groupadd","010","note.m4r","uuid","0c","8000","sun","372","1020","stage","1200","720","canonical","fb","011","video_duration","0d","1140","superadmin","012","Opening.m4r","keystore_attestation","dleq_proof","013","timestamp","ab_key","w:sync:app:state","0e","vertical","600","p_v_id","6","likes","014","500","1260","creator","0f","rte","destination","group","group_info","syncd_anti_tampering_fatal_exception_enabled","015","dl_bw","Asia/Jakarta","vp8/h.264","online","1320","fb:multiway","10","timeout","016","nse_retry","urn:xmpp:whatsapp:dirty","017","a_v_id","web_shops_chat_header_button_enabled","nse_call","inactive-upgrade","none","web","groups","2250","mms_hot_content_timespan_in_seconds","contact_blacklist","nse_read","suspended_group_deletion_notification","binary_version","018","https://www.whatsapp.com/otp/copy/","reg_push","shops_hide_catalog_attachment_entrypoint","server_sync",".","ephemeral_messages_allowed_values","019","mms_vcache_aggregation_enabled","iphone","America/Argentina/Buenos_Aires","01a","mms_vcard_autodownload_size_kb","nse_ver","shops_header_dropdown_menu_item","dhash","catalog_status","communities_mvp_new_iqs_serverprop","blocklist","default","11","ephemeral_messages_enabled","01b","original_dimensions","8","mms4_media_retry_notification_encryption_enabled","mms4_server_error_receipt_encryption_enabled","original_image_url","sync","multiway","420","companion_enc_static","shops_profile_drawer_entrypoint","01c","vcard_as_document_size_kb","status_video_max_duration","request_image_url","01d","regular_high","s_t","abt","share_ext_min_preliminary_image_quality","01e","32","syncd_key_rotation_enabled","data_namespace","md_downgrade_read_receipts2","patch","polltype","ephemeral_messages_setting","userrate","15","partial_pjpeg_bw_threshold","played-self","catalog_exists","01f","mute_v2"],["reject","dirty","announcement","020","13","9","status_video_max_bitrate","fb:thrift_iq","offline_batch","022","full","ctwa_first_business_reply_logging","h.264","smax_id","group_description_length","https://www.whatsapp.com/otp/code","status_image_max_edge","smb_upsell_business_profile_enabled","021","web_upgrade_to_md_modal","14","023","s_o","smaller_video_thumbs_status_enabled","media_max_autodownload","960","blocking_status","peer_msg","joinable_group_call_client_version","group_call_video_maximization_enabled","return_snapshot","high","America/Mexico_City","entry_point_block_logging_enabled","pop","024","1050","16","1380","one_tap_calling_in_group_chat_size","regular_low","inline_joinable_education_enabled","hq_image_max_edge","locked","America/Bogota","smb_biztools_deeplink_enabled","status_image_quality","1088","025","payments_upi_intent_transaction_limit","voip","w:g2","027","md_pin_chat_enabled","026","multi_scan_pjpeg_download_enabled","shops_product_grid","transaction_id","ctwa_context_enabled","20","fna","hq_image_quality","alt_jpeg_doc_detection_quality","group_call_max_participants","pkey","America/Belem","image_max_kbytes","web_cart_v1_1_order_message_changes_enabled","ctwa_context_enterprise_enabled","urn:xmpp:whatsapp:account","840","Asia/Kuala_Lumpur","max_participants","video_remux_after_repair_enabled","stella_addressbook_restriction_type","660","900","780","context_menu_ios13_enabled","mute-state","ref","payments_request_messages","029","frskmsg","vcard_max_size_kb","sample_buffer_gif_player_enabled","match_last_seen","510","4983","video_max_bitrate","028","w:comms:chat","17","frequently_forwarded_max","groups_privacy_blacklist","Asia/Karachi","02a","web_download_document_thumb_mms_enabled","02b","hist_sync","biz_block_reasons_version","1024","18","web_is_direct_connection_for_plm_transparent","view_once_write","file_max_size","paid_convo_id","online_privacy_setting","video_max_edge","view_once_read","enhanced_storage_management","multi_scan_pjpeg_encoding_enabled","ctwa_context_forward_enabled","video_transcode_downgrade_enable","template_doc_mime_types","hq_image_bw_threshold","30","body","u_aud_limit_sil_restarts_ctrl","other","participating","w:biz:directory","1110","vp8","4018","meta","doc_detection_image_max_edge","image_quality","1170","02c","smb_upsell_chat_banner_enabled","key_expiry_time_second","pid","stella_interop_enabled","19","linked_device_max_count","md_device_sync_enabled","02d","02e","360","enhanced_block_enabled","ephemeral_icon_in_forwarding","paid_convo_status","gif_provider","project_name","server-error","canonical_url_validation_enabled","wallpapers_v2","syncd_clear_chat_delete_chat_enabled","medianotify","02f","shops_required_tos_version","vote","reset_skey_on_id_change","030","image_max_edge","multicast_limit_global","ul_bw","21","25","5000","poll","570","22","031","1280","WhatsApp","032","bloks_shops_enabled","50","upload_host_switching_enabled","web_ctwa_context_compose_enabled","ptt_forwarded_features_enabled","unblocked","partial_pjpeg_enabled","fbid:devices","height","ephemeral_group_query_ts","group_join_permissions","order","033","alt_jpeg_status_quality","migrate","popular-bank","win_uwp_deprecation_killswitch_enabled","web_download_status_thumb_mms_enabled","blocking","url_text","035","web_forwarding_limit_to_groups","1600","val","1000","syncd_msg_date_enabled","bank-ref-id","max_subject","payments_web_enabled","web_upload_document_thumb_mms_enabled","size","request","ephemeral","24","receipt_agg","ptt_remember_play_position","sampling_weight","enc_rekey","mute_always","037","034","23","036","action","click_to_chat_qr_enabled","width","disabled","038","md_blocklist_v2","played_self_enabled","web_buttons_message_enabled","flow_id","clear","450","fbid:thread","bloks_session_state","America/Lima","attachment_picker_refresh","download_host_switching_enabled","1792","u_aud_limit_sil_restarts_test2","custom_urls","device_fanout","optimistic_upload","2000","key_cipher_suite","web_smb_upsell_in_biz_profile_enabled","e","039","siri_post_status_shortcut","pair-device","lg","lc","stream_attribution_url","model","mspjpeg_phash_gen","catalog_send_all","new_multi_vcards_ui","share_biz_vcard_enabled","-","clean","200","md_blocklist_v2_server","03b","03a","web_md_migration_experience","ptt_conversation_waveform","u_aud_limit_sil_restarts_test1"],["64","ptt_playback_speed_enabled","web_product_list_message_enabled","paid_convo_ts","27","manufacturer","psp-routing","grp_uii_cleanup","ptt_draft_enabled","03c","business_initiated","web_catalog_products_onoff","web_upload_link_thumb_mms_enabled","03e","mediaretry","35","hfm_string_changes","28","America/Fortaleza","max_keys","md_mhfs_days","streaming_upload_chunk_size","5541","040","03d","2675","03f","...","512","mute","48","041","alt_jpeg_quality","60","042","md_smb_quick_reply","5183","c","1343","40","1230","043","044","mms_cat_v1_forward_hot_override_enabled","user_notice","ptt_waveform_send","047","Asia/Calcutta","250","md_privacy_v2","31","29","128","md_messaging_enabled","046","crypto","690","045","enc_iv","75","failure","ptt_oot_playback","AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk","w","048","2201","web_large_files_ui","Asia/Makassar","812","status_collapse_muted","1334","257","2HP4dm","049","patches","1290","43cY6T","America/Caracas","web_sticker_maker","campaign","ptt_pausable_enabled","33","42","attestation","biz","04b","query_linked","s","125","04a","810","availability","1411","responsiveness_v2_m1","catalog_not_created","34","America/Santiago","1465","enc_p","04d","status_info","04f","key_version","..","04c","04e","md_group_notification","1598","1215","web_cart_enabled","37","630","1920","2394","-1","vcard","38","elapsed","36","828","peer","pricing_category","1245","invalid","stella_ios_enabled","2687","45","1528","39","u_is_redial_audio_1104_ctrl","1025","1455","58","2524","2603","054","bsp_system_message_enabled","web_pip_redesign","051","verify_apps","1974","1272","1322","1755","052","70","050","1063","1135","1361","80","1096","1828","1851","1251","1921","key_config_id","1254","1566","1252","2525","critical_block","1669","max_available","w:auth:backup:token","product","2530","870","1022","participant_uuid","web_cart_on_off","1255","1432","1867","41","1415","1440","240","1204","1608","1690","1846","1483","1687","1749","69","url_number","053","1325","1040","365","59","Asia/Riyadh","1177","test_recommended","057","1612","43","1061","1518","1635","055","1034","1375","750","1430","event_code","1682","503","55","865","78","1309","1365","44","America/Guayaquil","535","LIMITED","1377","1613","1420","1599","1822","05a","1681","password","1111","1214","1376","1478","47","1082","4282","Europe/Istanbul","1307","46","058","1124","256","rate-overlimit","retail","u_a_socket_err_fix_succ_test","1292","1370","1388","520","861","psa","regular","1181","1766","05b","1183","1213","1304","1537"],["1724","profile_picture","1071","1314","1605","407","990","1710","746","pricing_model","056","059","061","1119","6027","65","877","1607","05d","917","seen","1516","49","470","973","1037","1350","1394","1480","1796","keys","794","1536","1594","2378","1333","1524","1825","116","309","52","808","827","909","495","1660","361","957","google","1357","1565","1967","996","1775","586","736","1052","1670","bank","177","1416","2194","2222","1454","1839","1275","53","997","1629","6028","smba","1378","1410","05c","1849","727","create","1559","536","1106","1310","1944","670","1297","1316","1762","en","1148","1295","1551","1853","1890","1208","1784","7200","05f","178","1283","1332","381","643","1056","1238","2024","2387","179","981","1547","1705","05e","290","903","1069","1285","2436","062","251","560","582","719","56","1700","2321","325","448","613","777","791","51","488","902","Asia/Almaty","is_hidden","1398","1527","1893","1999","2367","2642","237","busy","065","067","233","590","993","1511","54","723","860","363","487","522","605","995","1321","1691","1865","2447","2462","NON_TRANSACTIONAL","433","871","432","1004","1207","2032","2050","2379","2446","279","636","703","904","248","370","691","700","1068","1655","2334","060","063","364","533","534","567","1191","1210","1473","1827","069","701","2531","514","prev_dhash","064","496","790","1046","1139","1505","1521","1108","207","544","637","final","1173","1293","1694","1939","1951","1993","2353","2515","504","601","857","modify","spam_request","p_121_aa_1101_test4","866","1427","1502","1638","1744","2153","068","382","725","1704","1864","1990","2003","Asia/Dubai","508","531","1387","1474","1632","2307","2386","819","2014","066","387","1468","1706","2186","2261","471","728","1147","1372","1961"]],a7=["","xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","notification","disappearing_mode","status","jid","broadcast","user","devices","device_hash","to","offline","message","result","class","xmlns","duration","notify","iq","t","ack","g.us","enc","urn:xmpp:whatsapp:push","presence","config_value","picture","verified_name","config_code","key-index-list","contact","mediatype","routing_info","edge_routing","get","read","urn:xmpp:ping","fallback_hostname","0","chatstate","business_hours_config","unavailable","download_buckets","skmsg","verified_level","composing","handshake","device-list","media","text","fallback_ip4","media_conn","device","creation","location","config","item","fallback_ip6","count","w:profile:picture","image","business","2","hostname","call-creator","display_name","relaylatency","platform","abprops","success","msg","offline_preview","prop","key-index","v","day_of_week","pkmsg","version","1","ping","w:p","download","video","set","specific_hours","props","primary","unknown","hash","commerce_experience","last","subscribe","max_buckets","call","profile","member_since_text","close_time","call-id","sticker","mode","participants","value","query","profile_options","open_time","code","list","host","ts","contacts","upload","lid","preview","update","usync","w:stats","delivery","auth_ttl","context","fail","cart_enabled","appdata","category","atn","direct_connection","decrypt-fail","relay_id","mmg-fallback.whatsapp.net","target","available","name","last_id","mmg.whatsapp.net","categories","401","is_new","index","tctoken","ip4","token_id","latency","recipient","edit","ip6","add","thumbnail-document","26","paused","true","identity","stream:error","key","sidelist","background","audio","3","thumbnail-image","biz-cover-photo","cat","gcm","thumbnail-video","error","auth","deny","serial","in","registration","thumbnail-link","remove","00","gif","thumbnail-gif","tag","capability","multicast","item-not-found","description","business_hours","config_expo_key","md-app-state","expiration","fallback","ttl","300","md-msg-hist","device_orientation","out","w:m","open_24h","side_list","token","inactive","01","document","te2","played","encrypt","msgr","hide","direct_path","12","state","not-authorized","url","terminate","signature","status-revoke-delay","02","te","linked_accounts","trusted_contact","timezone","ptt","kyc-id","privacy_token","readreceipts","appointment_only","address","expected_ts","privacy","7","android","interactive","device-identity","enabled","attribute_padding","1080","03","screen_height"],LF={};for(let[n,t]of a7.entries())LF[t]={index:n};for(let[n,t]of r7.entries())for(let[o,i]of t.entries())LF[i]={dict:n,index:o};var OA="@s.whatsapp.net";var i7="0@c.us";var Jt;(function(n){n[n.WHATSAPP=0]="WHATSAPP",n[n.LID=1]="LID",n[n.HOSTED=128]="HOSTED",n[n.HOSTED_LID=129]="HOSTED_LID"})(Jt||(Jt={}));var o7=(n,t)=>{switch(t){case Jt.LID:return"lid";case Jt.HOSTED:return"hosted";case Jt.HOSTED_LID:return"hosted.lid";case Jt.WHATSAPP:default:return n}},yr=(n,t,o,i)=>`${n||""}${i?`_${i}`:""}${o?`:${o}`:""}@${t}`,fA=n=>{let t=typeof n=="string"?n.indexOf("@"):-1;if(t<0)return;let o=n.slice(t+1),i=n.slice(0,t),[e,a]=i.split(":"),[A,r]=e.split("_"),s=Jt.WHATSAPP;return o==="lid"?s=Jt.LID:o==="hosted"?s=Jt.HOSTED:o==="hosted.lid"?s=Jt.HOSTED_LID:r&&(s=parseInt(r)),{server:o,user:A,domainType:s,device:a?+a:void 0}},Rt=(n,t)=>fA(n)?.user===fA(t)?.user,ph=n=>n?.endsWith("@bot"),_t=n=>n?.endsWith("@s.whatsapp.net"),qA=n=>n?.endsWith("@lid"),SB=n=>n?.endsWith("@broadcast"),xr=n=>n?.endsWith("@g.us"),Lg=n=>n==="status@broadcast",Wc=n=>n?.endsWith("@newsletter"),mr=n=>n?.endsWith("@hosted"),Ia=n=>n?.endsWith("@hosted.lid"),GUe=/^1313555\d{4}$|^131655500\d{2}$/,n7=n=>n&&GUe.test(n.split("@")[0])&&n.endsWith("@c.us"),uA=n=>{let t=fA(n);if(!t)return"";let{user:o,server:i}=t;return yr(o,i==="c.us"?"s.whatsapp.net":i)},s7=(n,t)=>{let i=fA(n)?.device||0,{server:e,user:a}=fA(t);return yr(a,e,i)};var g7=(n,t=mB,o=[0])=>{let i=c7(n,t,o);return Buffer.from(i)},c7=({tag:n,attrs:t,content:o},i,e)=>{let{TAGS:a,TOKEN_MAP:A}=i,r=F=>e.push(F&255),s=(F,q,V=!1)=>{for(let x=0;x>G*8&255)}},g=F=>{for(let q of F)e.push(q)},c=F=>{g([F>>8&255,F&255])},I=F=>g([F>>16&15,F>>8&255,F&255]),d=F=>{if(F>=4294967296)throw new Error("string too large to encode: "+F);F>=1<<20?(r(a.BINARY_32),s(F,4)):F>=256?(r(a.BINARY_20),I(F)):(r(a.BINARY_8),r(F))},B=F=>{let q=Buffer.from(F,"utf-8");d(q.length),g(q)},f=({domainType:F,device:q,user:V,server:x})=>{typeof q<"u"?(r(a.AD_JID),r(F||0),r(q||0),R(V)):(r(a.JID_PAIR),V.length?R(V):r(a.LIST_EMPTY),R(x))},Q=F=>{switch(F){case"-":return 10;case".":return 11;case"\0":return 15;default:if(F>="0"&&F<="9")return F.charCodeAt(0)-48;throw new Error(`invalid byte for nibble "${F}"`)}},y=F=>{if(F>="0"&&F<="9")return F.charCodeAt(0)-48;if(F>="A"&&F<="F")return 10+F.charCodeAt(0)-65;if(F>="a"&&F<="f")return 10+F.charCodeAt(0)-97;if(F==="\0")return 15;throw new Error(`Invalid hex char "${F}"`)},m=(F,q)=>{if(F.length>a.PACKED_MAX)throw new Error("Too many bytes to pack");r(q==="nibble"?a.NIBBLE_8:a.HEX_8);let V=Math.ceil(F.length/2);F.length%2!==0&&(V|=128),r(V);let x=q==="nibble"?Q:y,G=(U,N)=>x(U)<<4|x(N),J=Math.floor(F.length/2);for(let U=0;U{if(!F||F.length>a.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&q!=="-"&&q!==".")return!1;return!0},_=F=>{if(!F||F.length>a.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&!(q>="A"&&q<="F"))return!1;return!0},R=F=>{if(F==null){r(a.LIST_EMPTY);return}if(F===""){B(F);return}let q=A[F];if(q)typeof q.dict=="number"&&r(a.DICTIONARY_0+q.dict),r(q.index);else if(T(F))m(F,"nibble");else if(_(F))m(F,"hex");else{let V=fA(F);V?f(V):B(F)}},K=F=>{F===0?r(a.LIST_EMPTY):F<256?g([a.LIST_8,F]):(r(a.LIST_16),c(F))};if(!n)throw new Error("Invalid node: tag cannot be undefined");let L=Object.keys(t||{}).filter(F=>typeof t[F]<"u"&&t[F]!==null);K(2*L.length+1+(typeof o<"u"?1:0)),R(n);for(let F of L)typeof t[F]=="string"&&(R(F),R(t[F]));if(typeof o=="string")R(o);else if(Buffer.isBuffer(o)||o instanceof Uint8Array)d(o.length),g(o);else if(Array.isArray(o)){let F=o.filter(q=>q&&(q.tag||Buffer.isBuffer(q)||q instanceof Uint8Array||typeof q=="string"));K(F.length);for(let q of F)c7(q,i,e)}else if(!(typeof o>"u"))throw new Error(`invalid children for header "${n}": ${o} (${typeof o})`);return e};import{promisify as FUe}from"util";import{inflate as LUe}from"zlib";var UUe=FUe(LUe),HUe=async n=>(2&n.readUInt8()?n=await UUe(n.slice(1)):n=n.slice(1),n),I7=(n,t,o={index:0})=>{let{DOUBLE_BYTE_TOKENS:i,SINGLE_BYTE_TOKENS:e,TAGS:a}=t,A=k=>{if(o.index+k>n.length)throw new Error("end of stream")},r=()=>{let k=n[o.index];return o.index+=1,k},s=()=>(A(1),r()),g=k=>{A(k);let z=n.slice(o.index,o.index+k);return o.index+=k,z},c=k=>g(k).toString("utf-8"),I=(k,z=!1)=>{A(k);let Ae=0;for(let ie=0;ie(A(3),((r()&15)<<16)+(r()<<8)+r()),B=k=>{if(k>=0&&k<16)return k<10?48+k:65+k-10;throw new Error("invalid hex: "+k)},f=k=>{if(k>=0&&k<=9)return 48+k;switch(k){case 10:return 45;case 11:return 46;case 15:return 0;default:throw new Error("invalid nibble: "+k)}},Q=(k,z)=>{if(k===a.NIBBLE_8)return f(z);if(k===a.HEX_8)return B(z);throw new Error("unknown tag: "+k)},y=k=>{let z=s(),Ae="";for(let ie=0;ie<(z&127);ie++){let we=s();Ae+=String.fromCharCode(Q(k,(we&240)>>4)),Ae+=String.fromCharCode(Q(k,we&15))}return z>>7!==0&&(Ae=Ae.slice(0,-1)),Ae},m=k=>k===a.LIST_EMPTY||k===a.LIST_8||k===a.LIST_16,T=k=>{switch(k){case a.LIST_EMPTY:return 0;case a.LIST_8:return s();case a.LIST_16:return I(2);default:throw new Error("invalid tag for list size: "+k)}},_=()=>{let k=F(s()),z=F(s());if(z)return(k||"")+"@"+z;throw new Error("invalid jid pair: "+k+", "+z)},R=()=>{let k=s(),z=Number(k),Ae=s(),ie=F(s()),we="s.whatsapp.net";return z===Jt.LID?we="lid":z===Jt.HOSTED?we="hosted":z===Jt.HOSTED_LID&&(we="hosted.lid"),yr(ie,we,Ae)},K=()=>{let k=F(s()),z=I(2),Ae=F(s());return`${k}:${z}@${Ae}`},L=()=>{let k=F(s()),z=I(2),Ae=I(2),ie="interop",we=o.index;try{ie=F(s())}catch{o.index=we}return`${Ae}-${k}:${z}@${ie}`},F=k=>{if(k>=1&&k{let z=[],Ae=T(k);for(let ie=0;ie{let Ae=i[k];if(!Ae)throw new Error(`Invalid double token dict (${k})`);let ie=Ae[z];if(typeof ie>"u")throw new Error(`Invalid double token (${z})`);return ie},x=T(s()),G=F(s());if(!x||!G.length)throw new Error("invalid node");let J={},U;if(x===0||!G)throw new Error("invalid node");let N=x-1>>1;for(let k=0;k{let t=await HUe(n);return I7(t,mB)};var d7=qe(Kr(),1);var p7=new WeakMap,PA=(n,t)=>{if(!n||!Array.isArray(n.content))return[];let o=p7.get(n);if(!o){o=new Map;for(let i of n.content){let e=o.get(i.tag);e||o.set(i.tag,e=[]),e.push(i)}p7.set(n,o)}return o.get(t)||[]},le=(n,t)=>PA(n,t)[0],_s=({content:n})=>Array.isArray(n)?n:[],Da=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return o},jA=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return Buffer.from(o).toString("utf-8");if(typeof o=="string")return o},Zc=(n,t,o)=>{let i=Da(n,t);if(i)return KUe(i,o)},Ji=n=>{let t=le(n,"error");if(t)throw new d7.Boom(t.attrs.text||"Unknown error",{data:+t.attrs.code})},UF=(n,t)=>PA(n,t).reduce((e,{attrs:a})=>(typeof a.name=="string"?e[a.name]=a.value||a.config_value:e[a.config_code]=a.value||a.config_value,e),{});function KUe(n,t){let o=0;for(let i=0;i" ".repeat(n);function Gn(n,t=0){if(!n)return n;if(typeof n=="string")return iD(t)+n;if(n instanceof Uint8Array)return iD(t)+Buffer.from(n).toString("hex");if(Array.isArray(n))return n.map(a=>iD(t+1)+Gn(a,t+1)).join(` `);let o=Gn(n.content,t+1),i=`<${n.tag} ${Object.entries(n.attrs||{}).filter(([,a])=>a!==void 0).map(([a,A])=>`${a}='${A}'`).join(" ")}`,e=o?`> ${o} -${iD(t)}`:"/>";return i+e}var eI=qe(xc(),1);import{createCipheriv as JF,createDecipheriv as qF,createHash as rHe,createHmac as aHe,randomBytes as iHe}from"crypto";var MB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,h7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,h7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_expandedappstatekeys_free(t,0)}get indexKey(){let t=ae.expandedappstatekeys_indexKey(this.__wbg_ptr);return mA(t)}get patchMacKey(){let t=ae.expandedappstatekeys_patchMacKey(this.__wbg_ptr);return mA(t)}get snapshotMacKey(){let t=ae.expandedappstatekeys_snapshotMacKey(this.__wbg_ptr);return mA(t)}get valueEncryptionKey(){let t=ae.expandedappstatekeys_valueEncryptionKey(this.__wbg_ptr);return mA(t)}get valueMacKey(){let t=ae.expandedappstatekeys_valueMacKey(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(MB.prototype[Symbol.dispose]=MB.prototype.free);var nD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,E7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_groupcipher_free(t,0)}decrypt(t){let o=Rt(t,ae.__wbindgen_export),i=KA,e=ae.groupcipher_decrypt(this.__wbg_ptr,o,i);return mA(e)}encrypt(t){let o=Rt(t,ae.__wbindgen_export),i=KA,e=ae.groupcipher_encrypt(this.__wbg_ptr,o,i);return mA(e)}constructor(t,o,i){let e=Ln(o,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;Xc(i,$c);let A=ae.groupcipher_new(rA(t),e,a,i.__wbg_ptr);return this.__wbg_ptr=A>>>0,E7.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(nD.prototype[Symbol.dispose]=nD.prototype.free);var sD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,C7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_groupsessionbuilder_free(t,0)}create(t){Xc(t,Eh);let o=ae.groupsessionbuilder_create(this.__wbg_ptr,t.__wbg_ptr);return mA(o)}constructor(t){let o=ae.groupsessionbuilder_new(rA(t));return this.__wbg_ptr=o>>>0,C7.register(this,this.__wbg_ptr,this),this}process(t,o){Xc(t,Eh),Xc(o,hh);let i=ae.groupsessionbuilder_process(this.__wbg_ptr,t.__wbg_ptr,o.__wbg_ptr);return mA(i)}};Symbol.dispose&&(sD.prototype[Symbol.dispose]=sD.prototype.free);var _B=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,u7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,u7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_internalbinarynode_free(t,0)}get attrs(){let t=ae.internalbinarynode_attrs(this.__wbg_ptr);return mA(t)}get content(){let t=ae.internalbinarynode_content(this.__wbg_ptr);return mA(t)}set attrs(t){ae.internalbinarynode_set_attrs(this.__wbg_ptr,rA(t))}set content(t){ae.internalbinarynode_set_content(this.__wbg_ptr,rA(t))}get tag(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.internalbinarynode_tag(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}toJSON(){let t=ae.internalbinarynode_toJSON(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(_B.prototype[Symbol.dispose]=_B.prototype.free);var dh=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,B7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_lthashantitampering_free(t,0)}constructor(){let t=ae.lthashantitampering_new();return this.__wbg_ptr=t>>>0,B7.register(this,this.__wbg_ptr,this),this}subtractThenAdd(t,o,i){try{let r=ae.__wbindgen_add_to_stack_pointer(-16),s=Rt(t,ae.__wbindgen_export),g=KA,c=O7(o,ae.__wbindgen_export),I=KA,d=O7(i,ae.__wbindgen_export),B=KA;ae.lthashantitampering_subtractThenAdd(r,this.__wbg_ptr,s,g,c,I,d,B);var e=eA().getInt32(r+0,!0),a=eA().getInt32(r+4,!0),A=eA().getInt32(r+8,!0);if(A)throw mA(a);return mA(e)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(dh.prototype[Symbol.dispose]=dh.prototype.free);var gD=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,HF.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,HF.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_lthashstate_free(t,0)}clone(){let t=ae.lthashstate_clone(this.__wbg_ptr);return n.__wrap(t)}deleteValueMac(t){let o=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;return ae.lthashstate_deleteValueMac(this.__wbg_ptr,o,i)!==0}getValueMac(t){let o=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA,e=ae.lthashstate_getValueMac(this.__wbg_ptr,o,i);return mA(e)}hasValueMac(t){let o=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;return ae.lthashstate_hasValueMac(this.__wbg_ptr,o,i)!==0}get hash(){let t=ae.lthashstate_hash(this.__wbg_ptr);return mA(t)}constructor(){let t=ae.lthashstate_new();return this.__wbg_ptr=t>>>0,HF.register(this,this.__wbg_ptr,this),this}setValueMac(t,o){let i=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),e=KA,a=Rt(o,ae.__wbindgen_export),A=KA;ae.lthashstate_setValueMac(this.__wbg_ptr,i,e,a,A)}set hash(t){let o=Rt(t,ae.__wbindgen_export),i=KA;ae.lthashstate_set_hash(this.__wbg_ptr,o,i)}set version(t){ae.lthashstate_set_version(this.__wbg_ptr,t)}get version(){let t=ae.lthashstate_version(this.__wbg_ptr);return BigInt.asUintN(64,t)}};Symbol.dispose&&(gD.prototype[Symbol.dispose]=gD.prototype.free);var cD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,f7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_noisesession_free(t,0)}authenticate(t){let o=Rt(t,ae.__wbindgen_export),i=KA;ae.noisesession_authenticate(this.__wbg_ptr,o,i)}get bufferedBytes(){return ae.noisesession_bufferedBytes(this.__wbg_ptr)>>>0}clearBuffer(){ae.noisesession_clearBuffer(this.__wbg_ptr)}decodeFrame(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=Rt(t,ae.__wbindgen_export),r=KA;ae.noisesession_decodeFrame(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=Rt(t,ae.__wbindgen_export),r=KA;ae.noisesession_decrypt(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encodeFrame(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.noisesession_encodeFrame(a,this.__wbg_ptr,rA(t));var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encodeFrameRaw(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=Rt(t,ae.__wbindgen_export),r=KA;ae.noisesession_encodeFrameRaw(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encrypt(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=Rt(t,ae.__wbindgen_export),r=KA;ae.noisesession_encrypt(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}finishInit(){try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.noisesession_finishInit(i,this.__wbg_ptr);var t=eA().getInt32(i+0,!0),o=eA().getInt32(i+4,!0);if(o)throw mA(t)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}getHash(){let t=ae.noisesession_getHash(this.__wbg_ptr);return mA(t)}get isFinished(){return ae.noisesession_isFinished(this.__wbg_ptr)!==0}mixIntoKey(t){try{let e=ae.__wbindgen_add_to_stack_pointer(-16),a=Rt(t,ae.__wbindgen_export),A=KA;ae.noisesession_mixIntoKey(e,this.__wbg_ptr,a,A);var o=eA().getInt32(e+0,!0),i=eA().getInt32(e+4,!0);if(i)throw mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}constructor(t,o,i){try{let g=ae.__wbindgen_add_to_stack_pointer(-16),c=Rt(t,ae.__wbindgen_export),I=KA,d=Rt(o,ae.__wbindgen_export),B=KA;var e=Fn(i)?0:Rt(i,ae.__wbindgen_export),a=KA;ae.noisesession_new(g,c,I,d,B,e,a);var A=eA().getInt32(g+0,!0),r=eA().getInt32(g+4,!0),s=eA().getInt32(g+8,!0);if(s)throw mA(r);return this.__wbg_ptr=A>>>0,f7.register(this,this.__wbg_ptr,this),this}finally{ae.__wbindgen_add_to_stack_pointer(16)}}processHandshakeFinish(t,o,i){try{let r=ae.__wbindgen_add_to_stack_pointer(-16),s=Rt(t,ae.__wbindgen_export),g=KA,c=Rt(o,ae.__wbindgen_export),I=KA,d=Rt(i,ae.__wbindgen_export),B=KA;ae.noisesession_processHandshakeFinish(r,this.__wbg_ptr,s,g,c,I,d,B);var e=eA().getInt32(r+0,!0),a=eA().getInt32(r+4,!0),A=eA().getInt32(r+8,!0);if(A)throw mA(a);return mA(e)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}processHandshakeInit(t,o,i,e){try{let s=ae.__wbindgen_add_to_stack_pointer(-16),g=Rt(t,ae.__wbindgen_export),c=KA,I=Rt(o,ae.__wbindgen_export),d=KA,B=Rt(i,ae.__wbindgen_export),f=KA,Q=Rt(e,ae.__wbindgen_export),y=KA;ae.noisesession_processHandshakeInit(s,this.__wbg_ptr,g,c,I,d,B,f,Q,y);var a=eA().getInt32(s+0,!0),A=eA().getInt32(s+4,!0),r=eA().getInt32(s+8,!0);if(r)throw mA(A);return mA(a)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(cD.prototype[Symbol.dispose]=cD.prototype.free);var $c=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,KF.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,KF.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_protocoladdress_free(t,0)}get deviceId(){return ae.protocoladdress_deviceId(this.__wbg_ptr)>>>0}static from(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_from(a,rA(t));var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}get id(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_id(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}is(t){return Xc(t,n),ae.protocoladdress_is(this.__wbg_ptr,t.__wbg_ptr)!==0}constructor(t,o){try{let A=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_new(A,rA(t),rA(o));var i=eA().getInt32(A+0,!0),e=eA().getInt32(A+4,!0),a=eA().getInt32(A+8,!0);if(a)throw mA(e);return this.__wbg_ptr=i>>>0,KF.register(this,this.__wbg_ptr,this),this}finally{ae.__wbindgen_add_to_stack_pointer(16)}}toString(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_toString(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}};Symbol.dispose&&($c.prototype[Symbol.dispose]=$c.prototype.free);var hh=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,Q7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Q7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeydistributionmessage_free(t,0)}static deserialize(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=Rt(t,ae.__wbindgen_export),r=KA;ae.senderkeydistributionmessage_deserialize(a,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}serialize(){let t=ae.senderkeydistributionmessage_serialize(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(hh.prototype[Symbol.dispose]=hh.prototype.free);var Eh=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,y7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeyname_free(t,0)}constructor(t,o){let i=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),e=KA;Xc(o,$c);let a=ae.senderkeyname_new(i,e,o.__wbg_ptr);return this.__wbg_ptr=a>>>0,y7.register(this,this.__wbg_ptr,this),this}toString(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.senderkeyname_toString(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}};Symbol.dispose&&(Eh.prototype[Symbol.dispose]=Eh.prototype.free);var ID=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,xF.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,xF.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeyrecord_free(t,0)}static deserialize(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=Rt(t,ae.__wbindgen_export),r=KA;ae.senderkeyrecord_deserialize(a,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}isEmpty(){return ae.senderkeyrecord_isEmpty(this.__wbg_ptr)!==0}constructor(){let t=ae.senderkeyrecord_new();return this.__wbg_ptr=t>>>0,xF.register(this,this.__wbg_ptr,this),this}serialize(){try{let e=ae.__wbindgen_add_to_stack_pointer(-16);ae.senderkeyrecord_serialize(e,this.__wbg_ptr);var t=eA().getInt32(e+0,!0),o=eA().getInt32(e+4,!0),i=eA().getInt32(e+8,!0);if(i)throw mA(o);return mA(t)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(ID.prototype[Symbol.dispose]=ID.prototype.free);var lD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,m7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessionbuilder_free(t,0)}initOutgoing(t){let o=ae.sessionbuilder_initOutgoing(this.__wbg_ptr,rA(t));return mA(o)}constructor(t,o){Xc(o,$c);let i=ae.sessionbuilder_new(rA(t),o.__wbg_ptr);return this.__wbg_ptr=i>>>0,m7.register(this,this.__wbg_ptr,this),this}processPreKeyBundle(t){let o=ae.sessionbuilder_processPreKeyBundle(this.__wbg_ptr,rA(t));return mA(o)}};Symbol.dispose&&(lD.prototype[Symbol.dispose]=lD.prototype.free);var pD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,S7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessioncipher_free(t,0)}decryptPreKeyWhisperMessage(t){let o=Rt(t,ae.__wbindgen_export),i=KA,e=ae.sessioncipher_decryptPreKeyWhisperMessage(this.__wbg_ptr,o,i);return mA(e)}decryptWhisperMessage(t){let o=Rt(t,ae.__wbindgen_export),i=KA,e=ae.sessioncipher_decryptWhisperMessage(this.__wbg_ptr,o,i);return mA(e)}encrypt(t){let o=Rt(t,ae.__wbindgen_export),i=KA,e=ae.sessioncipher_encrypt(this.__wbg_ptr,o,i);return mA(e)}hasOpenSession(){let t=ae.sessioncipher_hasOpenSession(this.__wbg_ptr);return mA(t)}constructor(t,o){Xc(o,$c);let i=ae.sessioncipher_new(rA(t),o.__wbg_ptr);return this.__wbg_ptr=i>>>0,S7.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(pD.prototype[Symbol.dispose]=pD.prototype.free);var TB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,w7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,w7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessionrecord_free(t,0)}static deserialize(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.sessionrecord_deserialize(a,rA(t));var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}haveOpenSession(){return ae.sessionrecord_haveOpenSession(this.__wbg_ptr)!==0}serialize(){let t=ae.sessionrecord_serialize(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(TB.prototype[Symbol.dispose]=TB.prototype.free);function b7(n){let t=Rt(n,ae.__wbindgen_export),o=KA,i=ae.expandAppStateKeys(t,o);return MB.__wrap(i)}function Un(n,t,o){try{let A=ae.__wbindgen_add_to_stack_pointer(-16),r=Rt(n,ae.__wbindgen_export),s=KA;ae.hkdf(A,r,s,t,rA(o));var i=eA().getInt32(A+0,!0),e=eA().getInt32(A+4,!0),a=eA().getInt32(A+8,!0);if(a)throw mA(e);return mA(i)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}function xUe(){return{__proto__:null,"./whatsapp_rust_bridge_bg.js":{__proto__:null,__wbg_Error_83742b46f01ce22d:function(t,o){let i=Error(kr(t,o));return rA(i)},__wbg_Number_a5a435bd7bbec835:function(t){return Number(Fe(t))},__wbg_String_8564e559799eccda:function(t,o){let i=String(Fe(o)),e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda:function(t,o){let i=Fe(o),e=typeof i=="bigint"?i:void 0;eA().setBigInt64(t+8,Fn(e)?BigInt(0):e,!0),eA().setInt32(t+0,!Fn(e),!0)},__wbg___wbindgen_boolean_get_c0f3f60bac5a78d1:function(t){let o=Fe(t),i=typeof o=="boolean"?o:void 0;return Fn(i)?16777215:i?1:0},__wbg___wbindgen_debug_string_5398f5bb970e0daa:function(t,o){let i=jF(Fe(o)),e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg___wbindgen_in_41dbb8413020e076:function(t,o){return Fe(t)in Fe(o)},__wbg___wbindgen_is_bigint_e2141d4f045b7eda:function(t){return typeof Fe(t)=="bigint"},__wbg___wbindgen_is_function_3c846841762788c1:function(t){return typeof Fe(t)=="function"},__wbg___wbindgen_is_null_0b605fc6b167c56f:function(t){return Fe(t)===null},__wbg___wbindgen_is_object_781bc9f159099513:function(t){let o=Fe(t);return typeof o=="object"&&o!==null},__wbg___wbindgen_is_undefined_52709e72fb9f179c:function(t){return Fe(t)===void 0},__wbg___wbindgen_jsval_eq_ee31bfad3e536463:function(t,o){return Fe(t)===Fe(o)},__wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b:function(t,o){return Fe(t)==Fe(o)},__wbg___wbindgen_number_get_34bb9d9dcfa21373:function(t,o){let i=Fe(o),e=typeof i=="number"?i:void 0;eA().setFloat64(t+8,Fn(e)?0:e,!0),eA().setInt32(t+0,!Fn(e),!0)},__wbg___wbindgen_string_get_395e606bd0ee4427:function(t,o){let i=Fe(o),e=typeof i=="string"?i:void 0;var a=Fn(e)?0:Ln(e,ae.__wbindgen_export,ae.__wbindgen_export2),A=KA;eA().setInt32(t+4,A,!0),eA().setInt32(t+0,a,!0)},__wbg___wbindgen_throw_6ddd609b62940d55:function(t,o){throw new Error(kr(t,o))},__wbg__wbg_cb_unref_6b5b6b8576d35cb1:function(t){Fe(t)._wbg_cb_unref()},__wbg_attrs_eb268b5ce109b817:function(t){let o=Fe(t).attrs;return rA(o)},__wbg_call_2d781c1f4d5c0ef8:function(){return Rr(function(t,o,i){let e=Fe(t).call(Fe(o),Fe(i));return rA(e)},arguments)},__wbg_call_e133b57c9155d22c:function(){return Rr(function(t,o){let i=Fe(t).call(Fe(o));return rA(i)},arguments)},__wbg_content_54fb4ecf37d1b68a:function(t){let o=Fe(t).content;return rA(o)},__wbg_debug_10ca7029b12f8d85:function(t,o,i,e){Fe(t).debug(Fe(o),i===0?void 0:kr(i,e))},__wbg_done_08ce71ee07e3bd17:function(t){return Fe(t).done},__wbg_entries_e8a20ff8c9757101:function(t){let o=Object.entries(Fe(t));return rA(o)},__wbg_error_9cce413345f88385:function(t,o,i,e){Fe(t).error(Fe(o),i===0?void 0:kr(i,e))},__wbg_from_4bdf88943703fd48:function(t){let o=Array.from(Fe(t));return rA(o)},__wbg_getOurIdentity_85a51d9b5b46c006:function(){return Rr(function(t){let o=Fe(t).getOurIdentity();return rA(o)},arguments)},__wbg_getOurRegistrationId_6d41d022f3c2af8a:function(){return Rr(function(t){let o=Fe(t).getOurRegistrationId();return rA(o)},arguments)},__wbg_getRandomValues_3f44b700395062e5:function(){return Rr(function(t,o){globalThis.crypto.getRandomValues(wB(t,o))},arguments)},__wbg_get_326e41e095fb2575:function(){return Rr(function(t,o){let i=Reflect.get(Fe(t),Fe(o));return rA(i)},arguments)},__wbg_get_3ef1eba1850ade27:function(){return Rr(function(t,o){let i=Reflect.get(Fe(t),Fe(o));return rA(i)},arguments)},__wbg_get_a8ee5c45dabc1b3b:function(t,o){let i=Fe(t)[o>>>0];return rA(i)},__wbg_get_unchecked_329cfe50afab7352:function(t,o){let i=Fe(t)[o>>>0];return rA(i)},__wbg_get_with_ref_key_6412cf3094599694:function(t,o){let i=Fe(t)[Fe(o)];return rA(i)},__wbg_has_926ef2ff40b308cf:function(){return Rr(function(t,o){return Reflect.has(Fe(t),Fe(o))},arguments)},__wbg_info_b728e87a346ff6a2:function(t,o,i,e){Fe(t).info(Fe(o),i===0?void 0:kr(i,e))},__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6:function(t){let o;try{o=Fe(t)instanceof ArrayBuffer}catch{o=!1}return o},__wbg_instanceof_Map_f194b366846aca0c:function(t){let o;try{o=Fe(t)instanceof Map}catch{o=!1}return o},__wbg_instanceof_Object_be1962063fcc0c9f:function(t){let o;try{o=Fe(t)instanceof Object}catch{o=!1}return o},__wbg_instanceof_Promise_7c3bdd7805c2c6e6:function(t){let o;try{o=Fe(t)instanceof Promise}catch{o=!1}return o},__wbg_instanceof_Uint8Array_740438561a5b956d:function(t){let o;try{o=Fe(t)instanceof Uint8Array}catch{o=!1}return o},__wbg_internalbinarynode_new:function(t){let o=_B.__wrap(t);return rA(o)},__wbg_isArray_33b91feb269ff46e:function(t){return Array.isArray(Fe(t))},__wbg_isSafeInteger_ecd6a7f9c3e053cd:function(t){return Number.isSafeInteger(Fe(t))},__wbg_isTrustedIdentity_8beedd37958ed6af:function(){return Rr(function(t,o,i,e,a){let A=Fe(t).isTrustedIdentity(kr(o,i),Fe(e),a>>>0);return rA(A)},arguments)},__wbg_iterator_d8f549ec8fb061b1:function(){return rA(Symbol.iterator)},__wbg_keys_ab0d051a1c55236d:function(t){let o=Object.keys(Fe(t));return rA(o)},__wbg_length_b3416cf66a5452c8:function(t){return Fe(t).length},__wbg_length_ea16607d7b61445b:function(t){return Fe(t).length},__wbg_level_4b50b181832c5acf:function(t,o){let i=Fe(o).level,e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg_loadPreKey_db3458e3339f7328:function(){return Rr(function(t,o){let i=Fe(t).loadPreKey(o>>>0);return rA(i)},arguments)},__wbg_loadSenderKey_fd075b57283fd71b:function(){return Rr(function(t,o,i){let e=Fe(t).loadSenderKey(kr(o,i));return rA(e)},arguments)},__wbg_loadSession_8564b20b09724f27:function(){return Rr(function(t,o,i){let e=Fe(t).loadSession(kr(o,i));return rA(e)},arguments)},__wbg_loadSignedPreKey_3d5c6c6819f3adf3:function(){return Rr(function(t,o){let i=Fe(t).loadSignedPreKey(o>>>0);return rA(i)},arguments)},__wbg_new_5f486cdf45a04d78:function(t){let o=new Uint8Array(Fe(t));return rA(o)},__wbg_new_7dce085c132c6f91:function(t,o){let i=new TypeError(kr(t,o));return rA(i)},__wbg_new_a70fbab9066b301f:function(){let t=new Array;return rA(t)},__wbg_new_ab79df5bd7c26067:function(){let t=new Object;return rA(t)},__wbg_new_from_slice_22da9388ac046e50:function(t,o){let i=new Uint8Array(wB(t,o));return rA(i)},__wbg_new_typed_aaaeaf29cf802876:function(t,o){try{var i={a:t,b:o},e=(A,r)=>{let s=i.a;i.a=0;try{return jUe(s,i.b,A,r)}finally{i.a=s}};let a=new Promise(e);return rA(a)}finally{i.a=i.b=0}},__wbg_new_with_length_3259a525196bd8cc:function(t){let o=new Array(t>>>0);return rA(o)},__wbg_new_with_length_825018a1616e9e55:function(t){let o=new Uint8Array(t>>>0);return rA(o)},__wbg_next_11b99ee6237339e3:function(){return Rr(function(t){let o=Fe(t).next();return rA(o)},arguments)},__wbg_next_e01a967809d1aa68:function(t){let o=Fe(t).next;return rA(o)},__wbg_parse_e9eddd2a82c706eb:function(){return Rr(function(t,o){let i=JSON.parse(kr(t,o));return rA(i)},arguments)},__wbg_prototypesetcall_d62e5099504357e6:function(t,o,i){Uint8Array.prototype.set.call(wB(t,o),Fe(i))},__wbg_push_e87b0e732085a946:function(t,o){return Fe(t).push(Fe(o))},__wbg_queueMicrotask_0c399741342fb10f:function(t){let o=Fe(t).queueMicrotask;return rA(o)},__wbg_queueMicrotask_a082d78ce798393e:function(t){queueMicrotask(Fe(t))},__wbg_removePreKey_c0b0a066eb6f2e1e:function(){return Rr(function(t,o){let i=Fe(t).removePreKey(o>>>0);return rA(i)},arguments)},__wbg_resolve_ae8d83246e5bcc12:function(t){let o=Promise.resolve(Fe(t));return rA(o)},__wbg_senderkeydistributionmessage_new:function(t){let o=hh.__wrap(t);return rA(o)},__wbg_sessionrecord_new:function(t){let o=TB.__wrap(t);return rA(o)},__wbg_set_282384002438957f:function(t,o,i){Fe(t)[o>>>0]=mA(i)},__wbg_set_6be42768c690e380:function(t,o,i){Fe(t)[mA(o)]=mA(i)},__wbg_set_7eaa4f96924fd6b3:function(){return Rr(function(t,o,i){return Reflect.set(Fe(t),Fe(o),Fe(i))},arguments)},__wbg_set_8c0b3ffcf05d61c2:function(t,o,i){Fe(t).set(wB(o,i))},__wbg_static_accessor_GLOBAL_8adb955bd33fac2f:function(){let t=typeof global>"u"?null:global;return Fn(t)?0:rA(t)},__wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913:function(){let t=typeof globalThis>"u"?null:globalThis;return Fn(t)?0:rA(t)},__wbg_static_accessor_SELF_f207c857566db248:function(){let t=typeof self>"u"?null:self;return Fn(t)?0:rA(t)},__wbg_static_accessor_WINDOW_bb9f1ba69d61b386:function(){let t=typeof window>"u"?null:window;return Fn(t)?0:rA(t)},__wbg_storeSenderKey_8a6c9ec5f7e1cd2e:function(){return Rr(function(t,o,i,e){let a=Fe(t).storeSenderKey(kr(o,i),Fe(e));return rA(a)},arguments)},__wbg_storeSessionRaw_09b5cc73064d12d8:function(){return Rr(function(t,o,i,e){let a=Fe(t).storeSessionRaw(kr(o,i),Fe(e));return rA(a)},arguments)},__wbg_storeSession_4d419555ce654965:function(){return Rr(function(t,o,i,e){let a=Fe(t).storeSession(kr(o,i),mA(e));return rA(a)},arguments)},__wbg_tag_33cfe8e9ee66b4db:function(t,o){let i=Fe(o).tag,e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg_then_098abe61755d12f6:function(t,o){let i=Fe(t).then(Fe(o));return rA(i)},__wbg_then_9e335f6dd892bc11:function(t,o,i){let e=Fe(t).then(Fe(o),Fe(i));return rA(e)},__wbg_trace_58264fbce2ceb5e6:function(t,o,i,e){Fe(t).trace(Fe(o),i===0?void 0:kr(i,e))},__wbg_value_21fc78aab0322612:function(t){let o=Fe(t).value;return rA(o)},__wbg_warn_db531770752932a9:function(t,o,i,e){Fe(t).warn(Fe(o),i===0?void 0:kr(i,e))},__wbindgen_cast_0000000000000001:function(t,o){let i=qUe(t,o,ae.__wasm_bindgen_func_elem_694,YUe);return rA(i)},__wbindgen_cast_0000000000000002:function(t){return rA(t)},__wbindgen_cast_0000000000000003:function(t){return rA(t)},__wbindgen_cast_0000000000000004:function(t,o){let i=wB(t,o);return rA(i)},__wbindgen_cast_0000000000000005:function(t,o){let i=kr(t,o);return rA(i)},__wbindgen_cast_0000000000000006:function(t){let o=BigInt.asUintN(64,t);return rA(o)},__wbindgen_object_clone_ref:function(t){let o=Fe(t);return rA(o)},__wbindgen_object_drop_ref:function(t){mA(t)}}}}function YUe(n,t,o){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.__wasm_bindgen_func_elem_699(a,n,t,rA(o));var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);if(e)throw mA(i)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}function jUe(n,t,o,i){ae.__wasm_bindgen_func_elem_1248(n,t,rA(o),rA(i))}var h7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_expandedappstatekeys_free(n>>>0,1)),E7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_groupcipher_free(n>>>0,1)),C7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_groupsessionbuilder_free(n>>>0,1)),u7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_internalbinarynode_free(n>>>0,1)),B7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_lthashantitampering_free(n>>>0,1)),HF=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_lthashstate_free(n>>>0,1)),f7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_noisesession_free(n>>>0,1)),KF=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_protocoladdress_free(n>>>0,1)),Q7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeydistributionmessage_free(n>>>0,1)),y7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeyname_free(n>>>0,1)),xF=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeyrecord_free(n>>>0,1)),m7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessionbuilder_free(n>>>0,1)),S7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessioncipher_free(n>>>0,1)),w7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessionrecord_free(n>>>0,1));function rA(n){OB===Ug.length&&Ug.push(Ug.length+1);let t=OB;return OB=Ug[t],Ug[t]=n,t}function Xc(n,t){if(!(n instanceof t))throw new Error(`expected instance of ${t.name}`)}var D7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function jF(n){let t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){let e=n.description;return e==null?"Symbol":`Symbol(${e})`}if(t=="function"){let e=n.name;return typeof e=="string"&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){let e=n.length,a="[";e>0&&(a+=jF(n[0]));for(let A=1;A1)i=o[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:i}function JUe(n){n<1028||(Ug[n]=OB,OB=n)}function wB(n,t){return n=n>>>0,ph().subarray(n/1,n/1+t)}var vl=null;function eA(){return(vl===null||vl.buffer.detached===!0||vl.buffer.detached===void 0&&vl.buffer!==ae.memory.buffer)&&(vl=new DataView(ae.memory.buffer)),vl}function kr(n,t){return n=n>>>0,VUe(n,t)}var DB=null;function ph(){return(DB===null||DB.byteLength===0)&&(DB=new Uint8Array(ae.memory.buffer)),DB}function Fe(n){return Ug[n]}function Rr(n,t){try{return n.apply(this,t)}catch(o){ae.__wbindgen_export3(rA(o))}}var Ug=new Array(1024).fill(void 0);Ug.push(void 0,null,!0,!1);var OB=Ug.length;function Fn(n){return n==null}function qUe(n,t,o,i){let e={a:n,b:t,cnt:1,dtor:o},a=(...A)=>{e.cnt++;let r=e.a;e.a=0;try{return i(r,e.b,...A)}finally{e.a=r,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--e.cnt===0&&(e.dtor(e.a,e.b),e.a=0,D7.unregister(e))},D7.register(a,e,e),a}function Rt(n,t){let o=t(n.length*1,1)>>>0;return ph().set(n,o/1),KA=n.length,o}function O7(n,t){let o=t(n.length*4,4)>>>0,i=eA();for(let e=0;e>>0;return ph().subarray(s,s+r.length).set(r),KA=r.length,s}let i=n.length,e=t(i,1)>>>0,a=ph(),A=0;for(;A127)break;a[e+A]=r}if(A!==i){A!==0&&(n=n.slice(A)),e=o(e,i,i=A+n.length*3,1)>>>0;let r=ph().subarray(e+A,e+i),s=bB.encodeInto(n,r);A+=s.written,e=o(e,i,A,1)>>>0}return KA=A,e}function mA(n){let t=Fe(n);return JUe(n),t}var oD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});oD.decode();var zUe=2146435072,YF=0;function VUe(n,t){return YF+=t,YF>=zUe&&(oD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),oD.decode(),YF=t),oD.decode(ph().subarray(n,n+t))}var bB=new TextEncoder;"encodeInto"in bB||(bB.encodeInto=function(n,t){let o=bB.encode(n);return t.set(o),{read:n.length,written:o.length}});var KA=0,WUe,ae;function ZUe(n,t){return ae=n.exports,WUe=t,vl=null,DB=null,ae}function M7(n){if(ae!==void 0)return ae;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=xUe();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));let o=new WebAssembly.Instance(n,t);return ZUe(o,n)}var XUe=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function _7(n){let t=atob(n),o=new Uint8Array(t.length);for(let i=0;in.length===33?n:Buffer.concat([Hg,n]),Sr={generateKeyPair:()=>{let{pubKey:n,privKey:t}=eI.generateKeyPair();return{private:Buffer.from(t),public:Buffer.from(n.slice(1))}},sharedKey:(n,t)=>{let o=eI.calculateAgreement(Vo(t),n);return Buffer.from(o)},sign:(n,t)=>eI.calculateSignature(n,t),verify:(n,t,o)=>{try{return eI.verifySignature(Vo(n),t,o),!0}catch{return!1}}},dD=(n,t)=>{let o=Sr.generateKeyPair(),i=Vo(o.public),e=Sr.sign(n.private,i);return{keyPair:o,signature:e,keyId:t}},N7=16;function Pl(n,t,o,i){let e=JF("aes-256-gcm",t,o);return e.setAAD(i),Buffer.concat([e.update(n),e.final(),e.getAuthTag()])}function Gl(n,t,o,i){let e=qF("aes-256-gcm",t,o),a=n.slice(0,n.length-N7),A=n.slice(n.length-N7);return e.setAAD(i),e.setAuthTag(A),Buffer.concat([e.update(a),e.final()])}function R7(n,t,o){let i=JF("aes-256-ctr",t,o);return Buffer.concat([i.update(n),i.final()])}function k7(n,t,o){let i=qF("aes-256-ctr",t,o);return Buffer.concat([i.update(n),i.final()])}function v7(n,t){return oHe(n.subarray(16),t,n.subarray(0,16))}function oHe(n,t,o){let i=qF("aes-256-cbc",t,o);return Buffer.concat([i.update(n),i.final()])}function P7(n,t){let o=iHe(16),i=JF("aes-256-cbc",t,o);return Buffer.concat([o,i.update(n),i.final()])}function Hn(n,t,o="sha256"){return aHe(o,t).update(n).digest()}function Ch(n){return rHe("sha256").update(n).digest()}async function hD(n,t){let i=new TextEncoder().encode(n),e=new Uint8Array(t instanceof Uint8Array?t:new Uint8Array(t)),a=await T7.importKey("raw",i,{name:"PBKDF2"},!1,["deriveBits"]),A=await T7.deriveBits({name:"PBKDF2",salt:e,iterations:2<<16,hash:"SHA-256"},a,256);return Buffer.from(A)}var RB={replacer:(n,t)=>Buffer.isBuffer(t)||t instanceof Uint8Array||t?.type==="Buffer"?{type:"Buffer",data:Buffer.from(t?.data||t).toString("base64")}:t,reviver:(n,t)=>{if(typeof t=="object"&&t!==null&&t.type==="Buffer"&&typeof t.data=="string")return Buffer.from(t.data,"base64");if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=Object.keys(t);if(o.length>0&&o.every(i=>!isNaN(parseInt(i,10)))){let i=Object.values(t);if(i.every(e=>typeof e=="number"))return Buffer.from(i)}}return t}},uh=(n,t="me")=>(n?.fromMe?t:n?.participantAlt||n?.remoteJidAlt||n?.participant||n?.remoteJid)||"",L7=n=>n==null||n==="",sHe=n=>{let o=(NB(1)[0]&15)+1;return Buffer.concat([n,Buffer.alloc(o,o)])},U7=n=>{let t=new Uint8Array(n);if(t.length===0)throw new Error("unpadPkcs7 given empty bytes");var o=t[t.length-1];if(o>t.length)throw new Error(`unpad given ${t.length} bytes, but pad is ${o}`);return new Uint8Array(t.buffer,t.byteOffset,t.length-o)},H7=n=>(n.sort(),"2:"+Ch(Buffer.from(n.join(""))).toString("base64").slice(0,6)),Bh=n=>sHe(oe.Message.encode(n).finish()),K7=()=>Uint16Array.from(NB(2))[0]&16383,Kg=(n,t=4)=>{let o=n,i=new Uint8Array(t);for(let e=t-1;e>=0;e--)i[e]=255&o,o>>>=8;return i},Yr=n=>typeof n=="object"&&n?"toNumber"in n?n.toNumber():n.low:n||0,Oa=(n=new Date)=>Math.floor(n.getTime()/1e3);var kB=n=>x7(n).delay,x7=n=>{let t=new Error().stack,o,i;return{delay:new Promise((A,r)=>{o=setTimeout(A,n),i=r}),cancel:()=>{clearTimeout(o),i(new ED.Boom("Cancelled",{statusCode:500,data:{stack:t}}))}}};async function fh(n,t){if(!n)return new Promise(t);let o=new Error().stack,{delay:i,cancel:e}=x7(n);return new Promise((A,r)=>{i.then(()=>r(new ED.Boom("Timed Out",{statusCode:$t.timedOut,data:{stack:o}}))).catch(s=>r(s)),t(A,r)}).finally(e)}var jr=n=>{let t=Buffer.alloc(44);if(t.writeBigUInt64BE(BigInt(Math.floor(Date.now()/1e3))),n){let e=fA(n);e?.user&&(t.write(e.user,8),t.write("@c.us",8+e.user.length))}return NB(16).copy(t,28),"3EB0"+nHe("sha256").update(t).digest().toString("hex").toUpperCase().substring(0,18)},zF=()=>"3EB0"+NB(18).toString("hex").toUpperCase();function VF(n,t){return async(o,i)=>{let e,a;await fh(i,(A,r)=>{a=({connection:s,lastDisconnect:g})=>{s==="close"&&r(g?.error||new ED.Boom("Connection Closed",{statusCode:$t.connectionClosed}))},n.on("connection.update",a),e=async s=>{await o(s)&&A()},n.on(t,e)}).finally(()=>{n.off(t,e),n.off("connection.update",a)})}}var Y7=n=>VF(n,"connection.update");var j7=()=>{let n=NB(4);return`${n.readUInt16BE()}.${n.readUInt16BE(2)}-`},gHe={sender:oe.WebMessageInfo.Status.SERVER_ACK,played:oe.WebMessageInfo.Status.PLAYED,read:oe.WebMessageInfo.Status.READ,"read-self":oe.WebMessageInfo.Status.READ},J7=n=>{let t=gHe[n];return typeof n>"u"?oe.WebMessageInfo.Status.DELIVERY_ACK:t},cHe={conflict:$t.connectionReplaced},q7=n=>{let[t]=_s(n),o=t?.tag||"unknown",i=+(n.attrs.code||cHe[o]||$t.badSession);return i===$t.restartRequired&&(o="restart required"),{reason:o,statusCode:i}},z7=({tag:n,attrs:t})=>{let o;switch(n){case"offer":case"offer_notice":o="offer";break;case"terminate":t.reason==="timeout"?o="timeout":o="terminate";break;case"preaccept":o="preaccept";break;case"transport":o="transport";break;case"relaylatency":o="relaylatency";break;case"reject":o="reject";break;case"accept":o="accept";break;default:o="ringing";break}return o},G7="Unexpected server response: ",V7=n=>{let t=500;if(n?.message?.includes(G7)){let o=+n?.message.slice(G7.length);!Number.isNaN(o)&&o>=400&&(t=o)}else(n?.code?.startsWith("E")||n?.message?.includes("timed out"))&&(t=408);return t};function CD(n){for(let t in n)typeof n[t]>"u"&&delete n[t];return n}var F7="123456789ABCDEFGHJKLMNPQRSTVWXYZ";function W7(n){let t=0,o=0,i=[];for(let e of n)for(t=t<<8|e&255,o+=8;o>=5;)i.push(F7.charAt(t>>>o-5&31)),o-=5;return o>0&&i.push(F7.charAt(t<<5-o&31)),i.join("")}function Z7(n){return oe.Message.encode(n).finish()}var Fl=qe(Kr(),1);var IHe=async(n,t)=>qA(n)||Ia(n)?n:await t.lidMapping.getLIDForPN(n)||n,lHe=async(n,t,o,i,e)=>{let{senderAlt:a}=BD(n);if(a&&qA(a)&&_t(t)&&i===t)try{await o.lidMapping.storeLIDPNMappings([{lid:a,pn:t}]),await o.migrateSession(t,a),e.debug({sender:t,senderAlt:a},"Stored LID mapping from envelope")}catch(A){e.warn({sender:t,senderAlt:a,error:A},"Failed to store LID mapping")}},uD="Message absent from node",X7="Key used already or never filled",$7="Your account has been restricted",pHe={maxRetries:3,baseDelayMs:100,sessionRecordErrors:["No session record","SessionError: No session record"]},Ll={SenderReachoutTimelocked:463,ParsingError:487,UnrecognizedStanza:488,UnrecognizedStanzaClass:489,UnrecognizedStanzaType:490,InvalidProtobuf:491,InvalidHostedCompanionStanza:493,MissingMessageSecret:495,SignalErrorOldCounter:496,MessageDeletedOnPeer:499,UnhandledError:500,UnsupportedAdminRevoke:550,UnsupportedLIDGroup:551,DBOperationFailed:552},WF={MessageAccountRestriction:"463",SmaxInvalid:"479"},BD=n=>{let t,o,i=n.attrs.participant||n.attrs.from,e=n.attrs.addressing_mode||(i?.endsWith("lid")?"lid":"pn");return e==="lid"?(t=n.attrs.participant_pn||n.attrs.sender_pn||n.attrs.peer_recipient_pn,o=n.attrs.recipient_pn):(t=n.attrs.participant_lid||n.attrs.sender_lid||n.attrs.peer_recipient_lid,o=n.attrs.recipient_lid),{addressingMode:e,senderAlt:t,recipientAlt:o}};function ZF(n,t,o){let i,e,a,A=!1,r=n.attrs.id,s=n.attrs.from,g=n.attrs.participant,c=n.attrs.recipient;if(!r)throw new Fl.Boom("Invalid message stanza: missing id attribute",{data:n});if(!s)throw new Fl.Boom("Invalid message stanza: missing from attribute",{data:n});let I=BD(n),d=m=>Nt(m,t),B=m=>Nt(m,o);if(_t(s)||qA(s)||Ia(s)||mr(s)){if(c&&!lh(c)){if(!d(s)&&!B(s))throw new Fl.Boom("receipient present, but msg not from me",{data:n});(d(s)||B(s))&&(A=!0),e=c}else(d(s)||B(s))&&(A=!0),e=s;i="chat",a=s}else if(xr(s)){if(!g)throw new Fl.Boom("No participant in group message");(d(g)||B(g))&&(A=!0),i="group",a=g,e=s}else if(SB(s)){if(!g)throw new Fl.Boom("No participant in group message");let m=d(g);Lg(s)?i=m?"direct_peer_status":"other_status":i=m?"peer_broadcast":"other_broadcast",A=m,e=s,a=g}else if(Wc(s))i="newsletter",e=s,a=s,(d(s)||B(s))&&(A=!0);else throw new Fl.Boom("Unknown message type",{data:n});let f=n?.attrs?.notify,Q={remoteJid:e,remoteJidAlt:xr(e)?void 0:I.senderAlt,remoteJidUsername:xr(e)?void 0:n.attrs.peer_recipient_username||n.attrs.recipient_username,fromMe:A,id:r,participant:g,participantAlt:xr(e)?I.senderAlt:void 0,participantUsername:n.attrs.participant?n.attrs.participant_username:void 0,addressingMode:I.addressingMode,...i==="newsletter"&&n.attrs.server_id?{server_id:n.attrs.server_id}:{}},y={key:Q,category:n.attrs.category,messageTimestamp:+n.attrs.t,pushName:f,broadcast:SB(s)};return Q.fromMe&&(y.status=oe.WebMessageInfo.Status.SERVER_ACK),{fullMessage:y,author:a,sender:i==="chat"?a:e}}var e$=(n,t,o,i,e)=>{let{fullMessage:a,author:A,sender:r}=ZF(n,t,o);return{fullMessage:a,category:n.attrs.category,author:A,async decrypt(){let s=0;if(Array.isArray(n.content))for(let{tag:g,attrs:c,content:I}of n.content){if(g==="verified_name"&&I instanceof Uint8Array){let f=oe.VerifiedNameCertificate.decode(I),Q=oe.VerifiedNameCertificate.Details.decode(f.details);a.verifiedBizName=Q.verifiedName}if(g==="unavailable"&&c.type==="view_once"&&(a.key.isViewOnce=!0),c.count&&g==="enc"&&(a.retryCount=Number(c.count)),g!=="enc"&&g!=="plaintext"||!(I instanceof Uint8Array))continue;s+=1;let d,B=await IHe(A,i);g!=="plaintext"&&await lHe(n,A,i,B,e);try{let f=g==="plaintext"?"plaintext":c.type;switch(f){case"skmsg":d=await i.decryptGroupMessage({group:r,authorJid:A,msg:I});break;case"pkmsg":case"msg":d=await i.decryptMessage({jid:B,type:f,ciphertext:I});break;case"plaintext":d=I;break;default:throw new Error(`Unknown e2e type: ${f}`)}let Q=oe.Message.decode(f!=="plaintext"?U7(d):d);if(Q=Q.deviceSentMessage?.message||Q,Q.senderKeyDistributionMessage)try{await i.processSenderKeyDistributionMessage({authorJid:A,item:Q.senderKeyDistributionMessage})}catch(y){e.error({key:a.key,err:y},"failed to process sender key distribution message")}a.message?Object.assign(a.message,Q):a.message=Q}catch(f){let Q={key:a.key,err:f,messageType:g==="plaintext"?"plaintext":c.type,sender:r,author:A,isSessionRecordError:dHe(f)};e.error(Q,"failed to decrypt message"),a.messageStubType=oe.WebMessageInfo.StubType.CIPHERTEXT,a.messageStubParameters=[f.message.toString()]}}!s&&!a.key?.isViewOnce&&(a.messageStubType=oe.WebMessageInfo.StubType.CIPHERTEXT,a.messageStubParameters=[uD])}}};function dHe(n){let t=n?.message||n?.toString()||"";return pHe.sessionRecordErrors.some(o=>t.includes(o))}var Xg=qe(Kr(),1);import{randomBytes as IU}from"crypto";import{promises as lU}from"fs";var xn=qe(Kr(),1);import{exec as d4e}from"child_process";import*as fo from"crypto";import{once as nE}from"events";import{createReadStream as Eb,createWriteStream as rU,promises as gE}from"fs";import{tmpdir as Doe}from"os";import{join as db}from"path";import{Readable as Df,Transform as h4e}from"stream";import{URL as aU}from"url";var iU=()=>Doe(),Ooe=async()=>{let[n,t]=await Promise.all([import("jimp").catch(()=>{}),Promise.resolve().then(()=>(Ite(),cte)).catch(()=>{})]);if(t)return{sharp:t};if(n)return{jimp:n};throw new xn.Boom("No image processing library available")},E4e=n=>`WhatsApp ${Loe[n]} Keys`,Cb=async(n,t,o)=>{let{stream:i}=await Of(n);o?.debug("got stream for raw upload");let e=fo.createHash("sha256"),a=db(Doe(),t+jr()),A=rU(a),r=0;try{for await(let g of i)r+=g.length,e.update(g),A.write(g)||await nE(A,"drain");A.end(),await nE(A,"finish"),i.destroy();let s=e.digest();return o?.debug("hashed data for raw upload"),{filePath:a,fileSha256:s,fileLength:r}}catch(s){A.destroy(),i.destroy();try{await gE.unlink(a)}catch{}throw s}};async function boe(n,t){if(!n)throw new xn.Boom("Cannot derive from empty media key");typeof n=="string"&&(n=Buffer.from(n.replace("data:;base64,",""),"base64"));let o=Un(n,112,{info:E4e(t)});return{iv:o.slice(0,16),cipherKey:o.slice(16,48),macKey:o.slice(48,80)}}var C4e=async(n,t,o,i)=>new Promise((e,a)=>{let A=`ffmpeg -ss ${o} -i ${n} -y -vf scale=${i.width}:-1 -vframes 1 -f image2 ${t}`;d4e(A,r=>{r?a(r):e()})}),oU=async(n,t=32)=>{n instanceof Df&&(n=await hb(n));let o=await Ooe();if("sharp"in o&&typeof o.sharp?.default=="function"){let i=o.sharp.default(n),e=await i.metadata();return{buffer:await i.resize(t).jpeg({quality:50}).toBuffer(),original:{width:e.width,height:e.height}}}else if("jimp"in o&&typeof o.jimp?.Jimp=="object"){let i=await o.jimp.Jimp.read(n),e={width:i.width,height:i.height};return{buffer:await i.resize({w:t,mode:o.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50}),original:e}}else throw new xn.Boom("No image processing library available")},u4e=n=>encodeURIComponent(n.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")),ub=async(n,t)=>{let o,{width:i=640,height:e=640}=t||{};if(Buffer.isBuffer(n))o=n;else{let{stream:r}=await Of(n);o=await hb(r)}let a=await Ooe(),A;if("sharp"in a&&typeof a.sharp?.default=="function")A=a.sharp.default(o).resize(i,e).jpeg({quality:50}).toBuffer();else if("jimp"in a&&typeof a.jimp?.Jimp=="function"){let r=await a.jimp.Jimp.read(o),s=Math.min(r.width,r.height);A=r.crop({x:0,y:0,w:s,h:s}).resize({w:i,h:e,mode:a.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50})}else throw new xn.Boom("No image processing library available");return{img:await A}};async function Moe(n){let t=await Promise.resolve().then(()=>(Soe(),moe)),o,i={duration:!0};return Buffer.isBuffer(n)?o=await t.parseBuffer(n,void 0,i):typeof n=="string"?o=await t.parseFile(n,i):o=await t.parseStream(n,void 0,i),o.format.duration}async function _oe(n,t){try{let{default:o}=await import("audio-decode"),i;if(Buffer.isBuffer(n))i=n;else if(typeof n=="string"){let d=Eb(n);i=await hb(d)}else i=await hb(n);let a=(await o(i)).getChannelData(0),A=64,r=Math.floor(a.length/A),s=[];for(let d=0;dd*g);return new Uint8Array(c.map(d=>Math.floor(100*d)))}catch(o){t?.debug("Failed to generate waveform: "+o)}}var woe=n=>{let t=new Df({read:()=>{}});return t.push(n),t.push(null),t},hb=async n=>{let t=[];for await(let o of n)t.push(o);return n.destroy(),Buffer.concat(t)},Of=async(n,t)=>{if(Buffer.isBuffer(n))return{stream:woe(n),type:"buffer"};if("stream"in n)return{stream:n.stream,type:"readable"};let o=n.url.toString();if(o.startsWith("data:")){let i=Buffer.from(o.split(",")[1],"base64");return{stream:woe(i),type:"buffer"}}return o.startsWith("http://")||o.startsWith("https://")?{stream:await Bb(n.url,t),type:"remote"}:{stream:Eb(n.url),type:"file"}};async function Toe(n,t,o){let i,e;if(t==="image"){let{buffer:a,original:A}=await oU(n);i=a.toString("base64"),A.width&&A.height&&(e={width:A.width,height:A.height})}else if(t==="video"){let a=db(iU(),jr()+".jpg");try{await C4e(n,a,"00:00:00",{width:32,height:32}),i=(await gE.readFile(a)).toString("base64"),await gE.unlink(a)}catch(A){o.logger?.debug("could not generate video thumb: "+A)}}return{thumbnail:i,originalImageDimensions:e}}var Bb=async(n,t={})=>{let o=await fetch(n.toString(),{dispatcher:t.dispatcher,method:"GET",headers:t.headers});if(!o.ok)throw new xn.Boom(`Failed to fetch stream from ${n}`,{statusCode:o.status,data:{url:n}});return o.body instanceof Df?o.body:Df.fromWeb(o.body)},Noe=async(n,t,{logger:o,saveOriginalFileIfRequired:i,opts:e}={})=>{let{stream:a,type:A}=await Of(n,e);o?.debug("fetched media stream");let r=fo.randomBytes(32),{cipherKey:s,iv:g,macKey:c}=await boe(r,t),I=db(iU(),t+jr()+"-enc"),d=rU(I),B,f;i&&(f=db(iU(),t+jr()+"-original"),B=rU(f));let Q=0,y=fo.createCipheriv("aes-256-cbc",s,g),m=fo.createHmac("sha256",c).update(g),T=fo.createHash("sha256"),_=fo.createHash("sha256"),R=async K=>{_.update(K),m.update(K),d.write(K)||await nE(d,"drain")};try{for await(let x of a){if(Q+=x.length,A==="remote"&&e?.maxContentLength&&Q+x.length>e.maxContentLength)throw new xn.Boom(`content length exceeded when encrypting "${A}"`,{data:{media:n,type:A}});B&&(B.write(x)||await nE(B,"drain")),T.update(x),await R(y.update(x))}await R(y.final());let K=m.digest().slice(0,10);_.update(K);let L=T.digest(),F=_.digest();d.write(K);let q=nE(d,"finish"),V=B?nE(B,"finish"):Promise.resolve();return d.end(),B?.end?.(),a.destroy(),await q,await V,o?.debug("encrypted data successfully"),{mediaKey:r,originalFilePath:f,encFilePath:I,mac:K,fileEncSha256:F,fileSha256:L,fileLength:Q}}catch(K){d.destroy(),B?.destroy?.(),y.destroy(),m.destroy(),T.destroy(),_.destroy(),a.destroy();try{await gE.unlink(I),f&&await gE.unlink(f)}catch(L){o?.error({err:L},"failed deleting tmp files")}throw K}},nU="mmg.whatsapp.net",sE=16,tU=n=>Math.floor(n/sE)*sE,bf=(n,t=nU)=>`https://${t}${n}`,B4e=n=>{if(n)try{return new aU(n).host}catch{return}},cE=async({mediaKey:n,directPath:t,url:o},i,e={})=>{let a=e.host??B4e(o),A=t?bf(t,a):o;if(!A)throw new xn.Boom("No valid media URL or directPath present in message",{statusCode:400});let r=await boe(n,i);return f4e(A,r,e)},f4e=async(n,{cipherKey:t,iv:o},{startByte:i,endByte:e,options:a}={})=>{let A=0,r=0,s=!1;if(i){let m=tU(i||0);m&&(r=m-sE,A=m,s=!0)}let g=e?tU(e||0)+sE:void 0,c=a?.headers?a.headers:void 0,I={...c?Array.isArray(c)?Object.fromEntries(c):c:{},Origin:Mf};(r||g)&&(I.Range=`bytes=${r}-`,g&&(I.Range+=g));let d=await Bb(n,{...a||{},headers:I}),B=Buffer.from([]),f,Q=(m,T)=>{if(i||e){let _=A>=i?void 0:Math.max(i-A,0),R=A+m.lengththis.push(L)),_()}catch(L){_(L)}},final(m){try{Q(f.final(),T=>this.push(T)),m()}catch(T){m(T)}}});return d.pipe(y,{end:!0})};var Q4e=()=>typeof process<"u"&&process.versions?.node!==null&&typeof process.versions.bun>"u"&&typeof globalThis.Deno>"u",Roe=async({url:n,filePath:t,headers:o,timeoutMs:i,agent:e},a=0)=>{if(a>5)throw new Error("Too many redirects");let A=new aU(n),r=A.protocol==="https:"?await import("https"):await import("http"),g=(await gE.stat(t)).size;return new Promise((c,I)=>{let d=r.request({hostname:A.hostname,port:A.port||(A.protocol==="https:"?443:80),path:A.pathname+A.search,method:"POST",headers:{...o,"Content-Length":g},agent:e,timeout:i},f=>{if(f.statusCode&&f.statusCode>=300&&f.statusCode<400&&f.headers.location){f.resume();let y=new aU(f.headers.location,n).toString();c(Roe({url:y,filePath:t,headers:o,timeoutMs:i,agent:e},a+1));return}let Q="";f.on("data",y=>Q+=y),f.on("end",()=>{try{c(JSON.parse(Q))}catch{c(void 0)}})});d.on("error",I),d.on("timeout",()=>{d.destroy(),I(new Error("Upload timeout"))});let B=Eb(t);B.pipe(d),B.on("error",f=>{d.destroy(),I(f)})})},y4e=async({url:n,filePath:t,headers:o,timeoutMs:i,agent:e})=>{let a=Eb(t),A=Df.toWeb(a),r=typeof e?.dispatch=="function"?e:void 0,s=await fetch(n,{...r?{dispatcher:r}:{},method:"POST",body:A,headers:o,duplex:"half",signal:i?AbortSignal.timeout(i):void 0});try{return await s.json()}catch{return}},m4e=async(n,t)=>Q4e()?(t?.debug("Using Node.js https module for upload (avoids undici buffering bug)"),Roe(n)):(t?.debug("Using web-standard Fetch API for upload"),y4e(n)),koe=({customUploadHosts:n,fetchAgent:t,logger:o,options:i},e)=>async(a,{mediaType:A,fileEncSha256B64:r,timeoutMs:s})=>{let g=await e(!1),c,I=[...n,...g.hosts];r=u4e(r);let B={...(()=>{let f=i?.headers;return f?Array.isArray(f)?Object.fromEntries(f):f:{}})(),"Content-Type":"application/octet-stream",Origin:Mf};for(let{hostname:f}of I){o.debug(`uploading to "${f}"`);let Q=encodeURIComponent(g.auth),y=`https://${f}${gU[A]}/${r}?auth=${Q}&token=${r}`,m;try{if(m=await m4e({url:y,filePath:a,headers:B,timeoutMs:s,agent:t},o),m?.url||m?.direct_path){c={mediaUrl:m.url,directPath:m.direct_path,meta_hmac:m.meta_hmac,fbid:m.fbid,ts:m.ts};break}else throw g=await e(!0),new Error(`upload failed, reason: ${JSON.stringify(m)}`)}catch(T){let _=f===I[g.hosts.length-1]?.hostname;o.warn({trace:T?.stack,uploadResult:m},`Error in uploading to ${f} ${_?"":", retrying..."}`)}}if(!c)throw new xn.Boom("Media upload failed on all hosts",{statusCode:500});return c},voe=n=>Un(n,32,{info:"WhatsApp Media Retry Notification"}),Poe=(n,t,o)=>{let i={stanzaId:n.id},e=oe.ServerErrorReceipt.encode(i).finish(),a=fo.randomBytes(12),A=voe(t),r=Pl(e,A,a,Buffer.from(n.id));return{tag:"receipt",attrs:{id:n.id,to:uA(o),type:"server-error"},content:[{tag:"encrypt",attrs:{},content:[{tag:"enc_p",attrs:{},content:r},{tag:"enc_iv",attrs:{},content:a}]},{tag:"rmr",attrs:{jid:n.remoteJid,from_me:(!!n.fromMe).toString(),participant:n.participant||void 0}}]}},Goe=n=>{let t=le(n,"rmr"),o={key:{id:n.attrs.id,remoteJid:t.attrs.jid,fromMe:t.attrs.from_me==="true",participant:t.attrs.participant}},i=le(n,"error");if(i){let e=+i.attrs.code;o.error=new xn.Boom(`Failed to re-upload media (${e})`,{data:i.attrs,statusCode:sU(e)})}else{let e=le(n,"encrypt"),a=Da(e,"enc_p"),A=Da(e,"enc_iv");a&&A?o.media={ciphertext:a,iv:A}:o.error=new xn.Boom("Failed to re-upload media (missing ciphertext)",{statusCode:404})}return o},Foe=({ciphertext:n,iv:t},o,i)=>{let e=voe(o),a=Gl(n,e,t,Buffer.from(i));return oe.MediaRetryNotification.decode(a)},sU=n=>S4e[n],S4e={[oe.MediaRetryNotification.ResultType.SUCCESS]:200,[oe.MediaRetryNotification.ResultType.DECRYPTION_ERROR]:412,[oe.MediaRetryNotification.ResultType.NOT_FOUND]:404,[oe.MediaRetryNotification.ResultType.GENERAL_ERROR]:418};import{createHmac as w4e}from"crypto";var D4e=[{f:1},{f:3,s:[{f:2},{f:3},{f:8},{f:11},{f:17,s:[{f:21},{f:22}]},{f:25}]},{f:4,s:[{f:1},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:5,s:[{f:3},{f:4},{f:5},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:6,s:[{f:1},{f:17,s:[{f:21},{f:22}]},{f:30}]},{f:7,s:[{f:2},{f:7},{f:10},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:8,s:[{f:2},{f:7},{f:9},{f:17,s:[{f:21},{f:22}]},{f:21}]},{f:9,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:12,s:[{f:1},{f:2},{f:14,m:!0},{f:15}]},{f:18,s:[{f:6},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:26,s:[{f:4},{f:5},{f:8},{f:13},{f:17,s:[{f:21},{f:22}]}]},{f:28,s:[{f:1},{f:2},{f:4},{f:5},{f:6},{f:7,s:[{f:21},{f:22}]}]},{f:37,s:[{f:1,m:!0}]},{f:49,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:53,s:[{f:1,m:!0}]},{f:55,s:[{f:1,m:!0}]},{f:58,s:[{f:1,m:!0}]},{f:59,s:[{f:1,m:!0}]},{f:60,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:64,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:66,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:74,s:[{f:1,m:!0}]},{f:87,s:[{f:1,m:!0}]},{f:88,s:[{f:1},{f:2,s:[{f:1}]},{f:3,s:[{f:21},{f:22}]}]},{f:92,s:[{f:1,m:!0}]},{f:93,s:[{f:1,m:!0}]},{f:94,s:[{f:1,m:!0}]}],Hoe=n=>{let t=new Map;for(let o of n)t.set(o.f,{m:o.m,children:o.s?Hoe(o.s):void 0});return t},O4e=Hoe(D4e),b4e=new Map,M4e="Report Token",fb={VARINT:0,FIXED64:1,BYTES:2,FIXED32:5},Qb=n=>!n.reactionMessage&&!n.encReactionMessage&&!n.encEventResponseMessage&&!n.pollUpdateMessage,_4e=(n,t,o,i,e)=>{let a=Buffer.concat([Buffer.from(t,"utf8"),Buffer.from(o,"utf8"),Buffer.from(i,"utf8"),Buffer.from(n,"utf8")]);return Un(e,32,{info:a.toString("latin1")})},Koe=(n,t)=>{let o=[],i=0;for(;i>3,A=e.value&7,r=i;i+=e.bytes;let s=t.get(a),g=I=>I>n.length?!1:(o.push({num:a,bytes:n.subarray(r,I)}),i=I,!0),c=I=>I>n.length?!1:(i=I,!0);if(A===fb.VARINT){let I=cU(n,i);if(!I.ok)return null;let d=i+I.bytes;if(!s){if(!c(d))return null;continue}if(!g(d))return null;continue}if(A===fb.FIXED64){let I=i+8;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===fb.FIXED32){let I=i+4;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===fb.BYTES){let I=cU(n,i);if(!I.ok)return null;let d=i+I.bytes,B=d+I.value;if(B>n.length)return null;if(!s){i=B;continue}if(s.m||s.children){let f=Koe(n.subarray(d,B),s.children??b4e);if(f===null)return null;if(f.length>0){let Q=Uoe(e.value),y=Uoe(f.length);o.push({num:a,bytes:Buffer.concat([Q,y,f])})}i=B;continue}o.push({num:a,bytes:n.subarray(r,B)}),i=B;continue}return null}return o.length===0?Buffer.alloc(0):(o.sort((e,a)=>e.num-a.num),Buffer.concat(o.map(e=>e.bytes)))},cU=(n,t)=>{let o=0,i=0,e=0;for(;t+i35)return{value:0,bytes:0,ok:!1}}return{value:0,bytes:0,ok:!1}},Uoe=n=>{let t=[],o=n>>>0;for(;o>127;)t.push(o&127|128),o>>>=7;return t.push(o),Buffer.from(t)},xoe=async(n,t,o)=>{let i=t.messageContextInfo?.messageSecret;if(!i||!o.id)return null;let e=o.fromMe?o.remoteJid:o.participant||o.remoteJid,a=o.fromMe&&o.participant||o.remoteJid,A=_4e(M4e,o.id,e,a,i),r=Koe(n,O4e);if(!r||r.length===0)return null;let s=w4e("sha256",A).update(r).digest().subarray(0,16);return{tag:"reporting",attrs:{},content:[{tag:"reporting_token",attrs:{v:"2"},content:s}]}};var T4e={image:"image/jpeg",video:"video/mp4",document:"application/pdf",audio:"audio/ogg; codecs=opus",sticker:"image/webp","product-catalog-image":"image/jpeg"},Yoe={image:oe.Message.ImageMessage,video:oe.Message.VideoMessage,audio:oe.Message.AudioMessage,sticker:oe.Message.StickerMessage,document:oe.Message.DocumentMessage},N4e=n=>n.match(Xoe)?.[0],R4e=async(n,t,o)=>{let i=N4e(n);if(t&&i)try{return await t(i)}catch(e){o?.warn({trace:e.stack},"url generation failed")}},joe=async n=>{let t;if(typeof n=="number")t=n>0?n:4294967295+Number(n)+1;else{let o=n.trim().replace("#","");return o.length<=6&&(o="FF"+o.padStart(6,"0")),t=parseInt(o,16),t}},_f=async(n,t)=>{let o=t.logger,i;for(let L of $oe)L in n&&(i=L);if(!i)throw new Xg.Boom("Invalid media type",{statusCode:400});let e={...n,media:n[i]};delete e[i];let a=typeof e.media=="object"&&"url"in e.media&&!!e.media.url&&!!t.mediaCache&&i+":"+e.media.url.toString();if(i==="document"&&!e.fileName&&(e.fileName="file"),e.mimetype||(e.mimetype=T4e[i]),a){let L=await t.mediaCache.get(a);if(L){o?.debug({cacheableKey:a},"got media cache hit");let F=oe.Message.decode(L),q=`${i}Message`;return Object.assign(F[q],{...e,media:void 0}),F}}if(!!t.jid&&Wc(t.jid)){o?.info({key:a},"Preparing raw media for newsletter");let{filePath:L,fileSha256:F,fileLength:q}=await Cb(e.media,t.mediaTypeOverride||i,o),V=F.toString("base64"),{mediaUrl:x,directPath:G}=await t.upload(L,{fileEncSha256B64:V,mediaType:i,timeoutMs:t.mediaUploadTimeoutMs});await lU.unlink(L);let J=oe.Message.fromObject({[`${i}Message`]:Yoe[i].fromObject({url:x,directPath:G,fileSha256:F,fileLength:q,...e,media:void 0})});return e.ptv&&(J.ptvMessage=J.videoMessage,delete J.videoMessage),J.stickerMessage&&(J.stickerMessage.stickerSentTs=Date.now()),a&&(o?.debug({cacheableKey:a},"set cache"),await t.mediaCache.set(a,oe.Message.encode(J).finish())),J}let r=i==="audio"&&typeof e.seconds>"u",s=(i==="image"||i==="video")&&typeof e.jpegThumbnail>"u",g=i==="audio"&&e.ptt===!0&&typeof e.waveform>"u",c=t.backgroundColor&&i==="audio"&&e.ptt===!0,I=r||s,{mediaKey:d,encFilePath:B,originalFilePath:f,fileEncSha256:Q,fileSha256:y,fileLength:m}=await Noe(e.media,t.mediaTypeOverride||i,{logger:o,saveOriginalFileIfRequired:I,opts:t.options}),T=Q.toString("base64"),[{mediaUrl:_,directPath:R}]=await Promise.all([(async()=>{let L=await t.upload(B,{fileEncSha256B64:T,mediaType:i,timeoutMs:t.mediaUploadTimeoutMs});return o?.debug({mediaType:i,cacheableKey:a},"uploaded media"),L})(),(async()=>{try{if(s){let{thumbnail:L,originalImageDimensions:F}=await Toe(f,i,t);e.jpegThumbnail=L,!e.width&&F&&(e.width=F.width,e.height=F.height,o?.debug("set dimensions")),o?.debug("generated thumbnail")}r&&(e.seconds=await Moe(f),o?.debug("computed audio duration")),g&&(e.waveform=await _oe(f,o),o?.debug("processed waveform")),c&&(e.backgroundArgb=await joe(t.backgroundColor),o?.debug("computed backgroundColor audio status"))}catch(L){o?.warn({trace:L.stack},"failed to obtain extra info")}})()]).finally(async()=>{try{await lU.unlink(B),f&&await lU.unlink(f),o?.debug("removed tmp files")}catch{o?.warn("failed to remove tmp file")}}),K=oe.Message.fromObject({[`${i}Message`]:Yoe[i].fromObject({url:_,directPath:R,mediaKey:d,fileEncSha256:Q,fileSha256:y,fileLength:m,mediaKeyTimestamp:Oa(),...e,media:void 0})});return e.ptv&&(K.ptvMessage=K.videoMessage,delete K.videoMessage),a&&(o?.debug({cacheableKey:a},"set cache"),await t.mediaCache.set(a,oe.Message.encode(K).finish())),K},k4e=n=>{n=n||0;let t={ephemeralMessage:{message:{protocolMessage:{type:oe.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:n}}}};return oe.Message.fromObject(t)},v4e=(n,t)=>{let o=n.message;if(!o)throw new Xg.Boom("no content in message",{statusCode:400});o=Na(o),o=oe.Message.decode(oe.Message.encode(o).finish());let i=Object.keys(o)[0],e=o?.[i]?.contextInfo?.forwardingScore||0;e+=n.key.fromMe&&!t?0:1,i==="conversation"&&(o.extendedTextMessage={text:o[i]},delete o.conversation,i="extendedTextMessage");let a=o?.[i];return e>0?a.contextInfo={forwardingScore:e,isForwarded:!0}:a.contextInfo={},o},Ea=(n,t)=>typeof n=="object"&&n!==null&&t in n&&n[t]!==null&&n[t]!==void 0;function op(n,t){return typeof n=="object"&&n!==null&&t in n&&n[t]!==null}var P4e=async(n,t)=>{var o,i;let e={};if(Ea(n,"text")){let a={text:n.text},A=n.linkPreview;if(typeof A>"u"&&(A=await R4e(n.text,t.getUrlInfo,t.logger)),A){a.matchedText=A["matched-text"],a.jpegThumbnail=A.jpegThumbnail,a.description=A.description,a.title=A.title,a.previewType=0;let r=A.highQualityThumbnail;r&&(a.thumbnailDirectPath=r.directPath,a.mediaKey=r.mediaKey,a.mediaKeyTimestamp=r.mediaKeyTimestamp,a.thumbnailWidth=r.width,a.thumbnailHeight=r.height,a.thumbnailSha256=r.fileSha256,a.thumbnailEncSha256=r.fileEncSha256)}t.backgroundColor&&(a.backgroundArgb=await joe(t.backgroundColor)),t.font&&(a.font=t.font),e.extendedTextMessage=a}else if(Ea(n,"contacts")){let a=n.contacts.contacts.length;if(!a)throw new Xg.Boom("require atleast 1 contact",{statusCode:400});a===1?e.contactMessage=oe.Message.ContactMessage.create(n.contacts.contacts[0]):e.contactsArrayMessage=oe.Message.ContactsArrayMessage.create(n.contacts)}else if(Ea(n,"location"))e.locationMessage=oe.Message.LocationMessage.create(n.location);else if(Ea(n,"react"))n.react.senderTimestampMs||(n.react.senderTimestampMs=Date.now()),e.reactionMessage=oe.Message.ReactionMessage.create(n.react);else if(Ea(n,"delete"))e.protocolMessage={key:n.delete,type:oe.Message.ProtocolMessage.Type.REVOKE};else if(Ea(n,"forward"))e=v4e(n.forward,n.force);else if(Ea(n,"disappearingMessagesInChat")){let a=typeof n.disappearingMessagesInChat=="boolean"?n.disappearingMessagesInChat?Nf:0:n.disappearingMessagesInChat;e=k4e(a)}else if(Ea(n,"groupInvite")){if(e.groupInviteMessage={},e.groupInviteMessage.inviteCode=n.groupInvite.inviteCode,e.groupInviteMessage.inviteExpiration=n.groupInvite.inviteExpiration,e.groupInviteMessage.caption=n.groupInvite.text,e.groupInviteMessage.groupJid=n.groupInvite.jid,e.groupInviteMessage.groupName=n.groupInvite.subject,t.getProfilePicUrl){let a=await t.getProfilePicUrl(n.groupInvite.jid,"preview");if(a){let A=await fetch(a,{method:"GET",dispatcher:t?.options?.dispatcher});if(A.ok){let r=Buffer.from(await A.arrayBuffer());e.groupInviteMessage.jpegThumbnail=r}}}}else if(Ea(n,"pin"))e.pinInChatMessage={},e.messageContextInfo={},e.pinInChatMessage.key=n.pin,e.pinInChatMessage.type=n.type,e.pinInChatMessage.senderTimestampMs=Date.now(),e.messageContextInfo.messageAddOnDurationInSecs=n.type===1?n.time||86400:0;else if(Ea(n,"buttonReply"))switch(n.type){case"template":e.templateButtonReplyMessage={selectedDisplayText:n.buttonReply.displayText,selectedId:n.buttonReply.id,selectedIndex:n.buttonReply.index};break;case"plain":e.buttonsResponseMessage={selectedButtonId:n.buttonReply.id,selectedDisplayText:n.buttonReply.displayText,type:oe.Message.ButtonsResponseMessage.Type.DISPLAY_TEXT};break}else if(op(n,"ptv")&&n.ptv){let{videoMessage:a}=await _f({video:n.video},t);e.ptvMessage=a}else if(Ea(n,"product")){let{imageMessage:a}=await _f({image:n.product.productImage},t);e.productMessage=oe.Message.ProductMessage.create({...n,product:{...n.product,productImage:a}})}else if(Ea(n,"listReply"))e.listResponseMessage={...n.listReply};else if(Ea(n,"event")){e.eventMessage={};let a=Math.floor(n.event.startDate.getTime()/1e3);if(n.event.call&&t.getCallLink){let A=await t.getCallLink(n.event.call,{startTime:a});e.eventMessage.joinLink=(n.event.call==="audio"?Zoe:Woe)+A}e.messageContextInfo={messageSecret:n.event.messageSecret||IU(32)},e.eventMessage.name=n.event.name,e.eventMessage.description=n.event.description,e.eventMessage.startTime=a,e.eventMessage.endTime=n.event.endDate?n.event.endDate.getTime()/1e3:void 0,e.eventMessage.isCanceled=n.event.isCancelled??!1,e.eventMessage.extraGuestsAllowed=n.event.extraGuestsAllowed,e.eventMessage.isScheduleCall=n.event.isScheduleCall??!1,e.eventMessage.location=n.event.location}else if(Ea(n,"poll")){if((o=n.poll).selectableCount||(o.selectableCount=0),(i=n.poll).toAnnouncementGroup||(i.toAnnouncementGroup=!1),!Array.isArray(n.poll.values))throw new Xg.Boom("Invalid poll values",{statusCode:400});if(n.poll.selectableCount<0||n.poll.selectableCount>n.poll.values.length)throw new Xg.Boom(`poll.selectableCount in poll should be >= 0 and <= ${n.poll.values.length}`,{statusCode:400});e.messageContextInfo={messageSecret:n.poll.messageSecret||IU(32)};let a={name:n.poll.name,selectableOptionsCount:n.poll.selectableCount,options:n.poll.values.map(A=>({optionName:A}))};n.poll.toAnnouncementGroup?e.pollCreationMessageV2=a:n.poll.selectableCount===1?e.pollCreationMessageV3=a:e.pollCreationMessage=a}else Ea(n,"album")?e.albumMessage={expectedImageCount:n.album.expectedImageCount,expectedVideoCount:n.album.expectedVideoCount}:Ea(n,"sharePhoneNumber")?e.protocolMessage={type:oe.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER}:Ea(n,"requestPhoneNumber")?e.requestPhoneNumberMessage={}:Ea(n,"limitSharing")?e.protocolMessage={type:oe.Message.ProtocolMessage.Type.LIMIT_SHARING,limitSharing:{sharingLimited:n.limitSharing===!0,trigger:1,limitSharingSettingTimestamp:Date.now(),initiatedByMe:!0}}:e=await _f(n,t);if(op(n,"viewOnce")&&n.viewOnce&&(e={viewOnceMessage:{message:e}}),op(n,"mentions")&&n.mentions?.length||op(n,"mentionAll")&&n.mentionAll){let a=Object.keys(e)[0],A=e[a];A&&"contextInfo"in A?(A.contextInfo=A.contextInfo||{},n.mentions?.length&&(A.contextInfo.mentionedJid=n.mentions),n.mentionAll&&(A.contextInfo.nonJidMentions=1)):A&&(A.contextInfo={mentionedJid:n.mentions,nonJidMentions:n.mentionAll?1:0})}if(op(n,"edit")&&(e={protocolMessage:{key:n.edit,editedMessage:e,timestampMs:Date.now(),type:oe.Message.ProtocolMessage.Type.MESSAGE_EDIT}}),op(n,"contextInfo")&&n.contextInfo){let a=Object.keys(e)[0],A=e[a];"contextInfo"in A&&A.contextInfo?A.contextInfo={...A.contextInfo,...n.contextInfo}:A&&(A.contextInfo=n.contextInfo)}return op(n,"albumParentKey")&&n.albumParentKey&&(e.messageContextInfo={...e.messageContextInfo,messageAssociation:{associationType:oe.MessageAssociation.AssociationType.MEDIA_ALBUM,parentMessageKey:n.albumParentKey}}),Qb(e)&&(e.messageContextInfo=e.messageContextInfo||{},e.messageContextInfo.messageSecret||(e.messageContextInfo.messageSecret=IU(32))),oe.Message.create(e)},G4e=(n,t,o)=>{o.timestamp||(o.timestamp=new Date);let i=Na(t),e=Tf(i),a=Oa(o.timestamp),{quoted:A,userJid:r}=o;if(A&&!Wc(n)){let g=A.key.fromMe?r:A.participant||A.key.participant||A.key.remoteJid,c=Na(A.message),I=Tf(c);c=oe.Message.create({[I]:c[I]});let d=c[I];typeof d=="object"&&d&&"contextInfo"in d&&delete d.contextInfo;let B="contextInfo"in i[e]&&i[e]?.contextInfo||{};B.participant=uA(g),B.stanzaId=A.key.id,B.quotedMessage=c,n!==A.key.remoteJid&&(B.remoteJid=A.key.remoteJid),B&&i[e]&&(i[e].contextInfo=B)}o?.ephemeralExpiration&&e!=="protocolMessage"&&e!=="ephemeralMessage"&&!Wc(n)&&(i[e].contextInfo={...i[e].contextInfo||{},expiration:o.ephemeralExpiration||Nf}),t=oe.Message.create(t);let s={key:{remoteJid:n,fromMe:!0,id:o?.messageId||jr()},message:t,messageTimestamp:a,messageStubParameters:[],participant:xr(n)||Lg(n)?r:void 0,status:Ih.PENDING};return oe.WebMessageInfo.fromObject(s)},Joe=async(n,t,o)=>(o.logger=o?.logger?.child({msgId:o.messageId}),G4e(n,await P4e(t,{...o,jid:n}),o)),Tf=n=>{if(n)return Object.keys(n).find(i=>(i==="conversation"||i.includes("Message"))&&i!=="senderKeyDistributionMessage")},Na=n=>{if(!n)return;for(let o=0;o<5;o++){let i=t(n);if(!i)break;n=i.message}return n;function t(o){return o?.ephemeralMessage||o?.viewOnceMessage||o?.documentWithCaptionMessage||o?.viewOnceMessageV2||o?.viewOnceMessageV2Extension||o?.editedMessage||o?.associatedChildMessage||o?.groupStatusMessage||o?.groupStatusMessageV2}},qoe=n=>{let t=o=>o.imageMessage?{imageMessage:o.imageMessage}:o.documentMessage?{documentMessage:o.documentMessage}:o.videoMessage?{videoMessage:o.videoMessage}:o.locationMessage?{locationMessage:o.locationMessage}:{conversation:"contentText"in o?o.contentText:"hydratedContentText"in o?o.hydratedContentText:""};return n=Na(n),n?.buttonsMessage?t(n.buttonsMessage):n?.templateMessage?.hydratedFourRowTemplate?t(n?.templateMessage?.hydratedFourRowTemplate):n?.templateMessage?.hydratedTemplate?t(n?.templateMessage?.hydratedTemplate):n?.templateMessage?.fourRowTemplate?t(n?.templateMessage?.fourRowTemplate):n};var pU=(n,t)=>{n.userReceipt=n.userReceipt||[];let o=n.userReceipt.find(i=>i.userJid===t.userJid);o?Object.assign(o,t):n.userReceipt.push(t)},dU=(n,t)=>{let o=uh(t.key),i=(n.reactions||[]).filter(e=>uh(e.key)!==o);t.text=t.text||"",i.push(t),n.reactions=i};var zoe=n=>{let t={};for(let{remoteJid:o,id:i,participant:e,fromMe:a}of n)if(!a){let A=`${o}:${e||""}`;t[A]||(t[A]={jid:o,participant:e,messageIds:[]}),t[A].messageIds.push(i)}return Object.values(t)},F4e=[410,404],hU=async(n,t,o,i)=>{return await a().catch(async A=>{if(i&&typeof A?.status=="number"&&F4e.includes(A.status))return i.logger.info({key:n.key},"sending reupload media request..."),n=await i.reuploadRequest(n),await a();throw A});async function a(){let A=qoe(n.message);if(!A)throw new Xg.Boom("No message present",{statusCode:400,data:n});let r=Tf(A),s=r?.replace("Message",""),g=A[r];if(!g||typeof g!="object"||!("url"in g)&&!("thumbnailDirectPath"in g))throw new Xg.Boom(`"${r}" message is not a media message`);let c;"thumbnailDirectPath"in g&&!("url"in g)?(c={directPath:g.thumbnailDirectPath,mediaKey:g.mediaKey},s="thumbnail-link"):c=g;let I=await cE(c,s,o);if(t==="buffer"){let d=[];for await(let B of I)d.push(B);return Buffer.concat(d)}return I}},Voe=n=>{n=qoe(n);let t=n?.documentMessage||n?.imageMessage||n?.videoMessage||n?.audioMessage||n?.stickerMessage;if(!t)throw new Xg.Boom("given message is not a media message",{statusCode:400,data:n});return t};var yb=qe(Kr(),1);import{createHash as K4e}from"crypto";function L4e(n,t){let o=[];for(let i=0;i({identifier:{name:n,deviceId:0},identifierKey:Vo(t)}),U4e=async({get:n},t,o)=>{let i=[];for(let e=t;e{let o=n.nextPreKeyId-n.firstUnuploadedPreKeyId,i=t-o,e=n.nextPreKeyId+i-1,a={};if(i>0)for(let A=n.nextPreKeyId;A<=e;A++)a[A]=Sr.generateKeyPair();return{newPreKeys:a,lastPreKeyId:e,preKeysRange:[n.firstUnuploadedPreKeyId,t]}},Rf=n=>({tag:"skey",attrs:{},content:[{tag:"id",attrs:{},content:Kg(n.keyId,3)},{tag:"value",attrs:{},content:n.keyPair.public},{tag:"signature",attrs:{},content:n.signature}]}),CU=(n,t)=>({tag:"key",attrs:{},content:[{tag:"id",attrs:{},content:Kg(t,3)},{tag:"value",attrs:{},content:n.public}]}),EU=n=>typeof n=="number"&&Number.isInteger(n),Ane=n=>{let t=le(n,"keys");if(!t)return null;let o=Da(t,"type");if(!o||o.length!==1||o[0]!==Hg[0])return null;let i=Da(t,"identity"),e=le(t,"skey");if(!i||i.length!==32||!e)return null;let a=Zc(n,"registration",4);if(!EU(a))return null;let A=Da(e,"value"),r=Da(e,"signature"),s=Zc(e,"id",3);if(!A||A.length!==32||!r||!EU(s))return null;let g=le(t,"key"),c;if(g){let I=Da(g,"value"),d=Zc(g,"id",3);if(!I||I.length!==32||!EU(d))return null;c={keyId:d,publicKey:Vo(I)}}return{registrationId:a,identityKey:Vo(i),signedPreKey:{keyId:s,publicKey:Vo(A),signature:r},preKey:c}},tne=async(n,t)=>{let o=A=>A?{keyId:Zc(A,"id",3),publicKey:Vo(Da(A,"value")),signature:Da(A,"signature")}:void 0,i=PA(le(n,"list"),"user");for(let A of i)Ji(A);let a=L4e(i,100);for(let A of a)for(let r of A){let s=le(r,"skey"),g=le(r,"key"),c=Da(r,"identity"),I=r.attrs.jid,d=Zc(r,"registration",4);await t.injectE2ESession({jid:I,session:{registrationId:d,identityKey:Vo(c),signedPreKey:o(s),preKey:o(g)}})}},rne=(n,t,o,i)=>{let{user:e,device:a}=fA(t),A=[];for(let r of n){let{devices:s,id:g}=r,c=fA(g),{user:I,server:d}=c,{domainType:B}=c,f=s?.deviceList;if(Array.isArray(f))for(let{id:Q,keyIndex:y,isHosted:m}of f)(!i||Q!==0)&&(e!==I&&o!==I||a!==Q)&&(Q===0||y)&&(m&&(B=B===Jt.LID?Jt.HOSTED_LID:Jt.HOSTED),A.push({user:I,device:Q,domainType:B,server:o7(d,B)}))}return A},uU=async({creds:n,keys:t},o)=>{let{newPreKeys:i,lastPreKeyId:e,preKeysRange:a}=H4e(n,o),A={nextPreKeyId:Math.max(e+1,n.nextPreKeyId),firstUnuploadedPreKeyId:Math.max(n.firstUnuploadedPreKeyId,e+1)};await t.set({"pre-key":i});let r=await U4e(t,a[0],a[0]+a[1]);return{update:A,preKeys:r}},ane=async(n,t)=>{let{creds:o}=n,{update:i,preKeys:e}=await uU(n,t),a={tag:"iq",attrs:{xmlns:"encrypt",type:"set",to:OA},content:[{tag:"registration",attrs:{},content:Kg(o.registrationId)},{tag:"type",attrs:{},content:Hg},{tag:"identity",attrs:{},content:o.signedIdentityKey.public},{tag:"list",attrs:{},content:Object.keys(e).map(A=>CU(e[+A],+A))},Rf(o.signedPreKey)]};return{update:i,node:a}};var x4e=n=>({appVersion:{primary:n.version[0],secondary:n.version[1],tertiary:n.version[2]},platform:n.browser[1].toLocaleLowerCase().includes("android")?oe.ClientPayload.UserAgent.Platform.ANDROID:oe.ClientPayload.UserAgent.Platform.WEB,releaseChannel:oe.ClientPayload.UserAgent.ReleaseChannel.RELEASE,osVersion:"0.1",device:"Desktop",osBuildNumber:"0.1",localeLanguageIso6391:"en",mnc:"000",mcc:"000",localeCountryIso31661Alpha2:n.countryCode}),ine={"Mac OS":oe.ClientPayload.WebInfo.WebSubPlatform.DARWIN,Windows:oe.ClientPayload.WebInfo.WebSubPlatform.WIN32},Y4e=n=>{let t=oe.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER;return n.syncFullHistory&&ine[n.browser[0]]&&n.browser[1]==="Desktop"&&(t=ine[n.browser[0]]),{webSubPlatform:t}},one=n=>{let t={connectType:oe.ClientPayload.ConnectType.WIFI_UNKNOWN,connectReason:oe.ClientPayload.ConnectReason.USER_ACTIVATED,userAgent:x4e(n)};return n.browser[1].toLocaleLowerCase().includes("android")||(t.webInfo=Y4e(n)),n.pushName&&(t.pushName=n.pushName),t},nne=(n,t)=>{let{user:o,device:i}=fA(n),e={...one(t),passive:!0,pull:!0,username:+o,device:i,lidDbMigrated:!1};return oe.ClientPayload.fromObject(e)},j4e=n=>{let t=n.toUpperCase();return t==="ANDROID"?oe.DeviceProps.PlatformType.ANDROID_PHONE:oe.DeviceProps.PlatformType[t]||oe.DeviceProps.PlatformType.CHROME},sne=({registrationId:n,signedPreKey:t,signedIdentityKey:o},i)=>{let e=K4e("md5").update(i.version.join(".")).digest(),a={os:i.browser[0],platformType:j4e(i.browser[1]),requireFullSync:i.syncFullHistory,historySyncConfig:{storageQuotaMb:10240,inlineInitialPayloadInE2EeMsg:!0,recentSyncDaysLimit:void 0,supportCallLogHistory:!1,supportBotUserAgentChatHistory:!0,supportCagReactionsAndPolls:!0,supportBizHostedMsg:!0,supportRecentSyncChunkMessageCountTuning:!0,supportHostedGroupMsg:!0,supportFbidBotChatHistory:!0,supportAddOnHistorySyncMigration:void 0,supportMessageAssociation:!0,supportGroupHistory:!1,onDemandReady:void 0,supportGuestChat:void 0},version:{primary:10,secondary:15,tertiary:7}},A=oe.DeviceProps.encode(a).finish(),r={...one(i),passive:!1,pull:!1,devicePairingData:{buildHash:e,deviceProps:A,eRegid:Kg(n),eKeytype:Hg,eIdent:o.public,eSkeyId:Kg(t.keyId,3),eSkeyVal:t.keyPair.public,eSkeySig:t.signature}};return oe.ClientPayload.fromObject(r)},gne=(n,{advSecretKey:t,signedIdentityKey:o,signalIdentities:i})=>{let e=n.attrs.id,a=le(n,"pair-success"),A=le(a,"device-identity"),r=le(a,"platform"),s=le(a,"device"),g=le(a,"biz");if(!A||!s)throw new yb.Boom("Missing device-identity or device in pair success node",{data:n});let c=g?.attrs.name,I=s.attrs.jid,d=s.attrs.lid,{details:B,hmac:f,accountType:Q}=oe.ADVSignedDeviceIdentityHMAC.decode(A.content),y=Buffer.from([]);Q!==void 0&&Q===oe.ADVEncryptionType.HOSTED&&(y=BU);let m=Hn(Buffer.concat([y,B]),Buffer.from(t,"base64"));if(Buffer.compare(f,m)!==0)throw new yb.Boom("Invalid account signature");let T=oe.ADVSignedDeviceIdentity.decode(B),{accountSignatureKey:_,accountSignature:R,details:K}=T,L=oe.ADVDeviceIdentity.decode(K),F=L.deviceType===oe.ADVEncryptionType.HOSTED?BU:cne,q=Buffer.concat([F,K,o.public]);if(!Sr.verify(_,q,R))throw new yb.Boom("Failed to verify account signature");let V=Buffer.concat([Ine,K,o.public,_]);T.deviceSignature=Sr.sign(o.private,V);let x=ene(d,_),G=kf(T,!1),J={tag:"iq",attrs:{to:OA,type:"result",id:e},content:[{tag:"pair-device-sign",attrs:{},content:[{tag:"device-identity",attrs:{"key-index":L.keyIndex.toString()},content:G}]}]};return{creds:{account:T,me:{id:I,name:c,lid:d},signalIdentities:[...i||[],x],platform:r?.attrs.name},reply:J}},kf=(n,t)=>(n={...n},(!t||!n.accountSignatureKey?.length)&&(n.accountSignatureKey=null),oe.ADVSignedDeviceIdentity.encode(n).finish());var IE=qe(Kr(),1);var dne=12,lne=Buffer.alloc(0),pne=n=>{let t=new ArrayBuffer(dne);return new DataView(t).setUint32(8,n),new Uint8Array(t)},fU=class{constructor(t,o){this.encKey=t,this.decKey=o,this.readCounter=0,this.writeCounter=0,this.iv=new Uint8Array(dne)}encrypt(t){let o=this.writeCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,Pl(t,this.encKey,this.iv,lne)}decrypt(t){let o=this.readCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,Gl(t,this.decKey,this.iv,lne)}},hne=({keyPair:{private:n,public:t},NOISE_HEADER:o,logger:i,routingInfo:e})=>{i=i.child({class:"ns"});let a=Buffer.from(Ene),A=a.byteLength===32?a:Ch(a),r=A,s=A,g=A,c=0,I=!1,d=Buffer.alloc(0),B=null,f=!1,Q=null,y;e?(y=Buffer.alloc(7+e.byteLength+o.length),y.write("ED",0,"utf8"),y.writeUint8(0,2),y.writeUint8(1,3),y.writeUint8(e.byteLength>>16,4),y.writeUint16BE(e.byteLength&65535,5),y.set(e,7),y.set(o,7+e.byteLength)):y=Buffer.from(o);let m=q=>{B||(A=Ch(Buffer.concat([A,q])))},T=q=>{if(B)return B.encrypt(q);let V=Pl(q,s,pne(c++),A);return m(V),V},_=q=>{if(B)return B.decrypt(q);let V=Gl(q,g,pne(c++),A);return m(q),V},R=q=>{let V=Un(Buffer.from(q),64,{salt:r,info:""});return[V.subarray(0,32),V.subarray(32)]},K=q=>{let[V,x]=R(q);r=V,s=x,g=x,c=0},L=async()=>{f=!0;let[q,V]=R(new Uint8Array(0));B=new fU(q,V),f=!1,i.trace("Noise handler transitioned to Transport state"),Q&&(i.trace({length:d.length},"Flushing buffered frames after transport ready"),await F(Q),Q=null)},F=async q=>{let V;for(;;){if(d.length<3||(V=d[0]<<16|d[1]<<8|d[2],d.length{m(q.ephemeral),K(Sr.sharedKey(n,q.ephemeral));let x=_(q.static);K(Sr.sharedKey(n,x));let G=_(q.payload),{intermediate:J,leaf:U}=oe.CertChain.decode(G);if(!U?.details||!U?.signature)throw new IE.Boom("invalid noise leaf certificate",{statusCode:400});if(!J?.details||!J?.signature)throw new IE.Boom("invalid noise intermediate certificate",{statusCode:400});let N=oe.CertChain.NoiseCertificate.Details.decode(J.details),{issuerSerial:k}=N,z=Sr.verify(N.key,U.details,U.signature),Ae=Sr.verify(QU.PUBLIC_KEY,J.details,J.signature);if(!z)throw new IE.Boom("noise certificate signature invalid",{statusCode:400});if(!Ae)throw new IE.Boom("noise intermediate certificate signature invalid",{statusCode:400});if(k!==QU.SERIAL)throw new IE.Boom("certification match failed",{statusCode:400});let ie=T(V.public);return K(Sr.sharedKey(V.private,q.ephemeral)),ie},encodeFrame:q=>{B&&(q=B.encrypt(q));let V=q.byteLength,x=I?0:y.length,G=Buffer.allocUnsafe(x+3+V);return I||(G.set(y),I=!0),G[x]=V>>>16&255,G[x+1]=V>>>8&255,G[x+2]=V&255,G.set(q,x+3),G},decodeFrame:async(q,V)=>{if(f){d=Buffer.concat([d,q]),Q=V;return}d.length===0?d=Buffer.from(q):d=Buffer.concat([d,q]),await F(V)}}};import{pipeline as J4e}from"stream/promises";import{promisify as q4e}from"util";import{createInflate as z4e,inflate as V4e}from"zlib";var W4e=q4e(V4e),Z4e=n=>{for(let t of n){let o=t.message;if(!o?.key?.fromMe||!o.userReceipt?.length)continue;let i=o.userReceipt[0]?.userJid;if(i&&(_t(i)||mr(i)))return i}},X4e=async(n,t)=>{let o=await cE(n,"md-msg-hist",{options:t}),i=z4e(),e=[];i.on("data",r=>e.push(r)),await J4e(o,i);let a=Buffer.concat(e);return oe.HistorySync.decode(a)},$4e=(n,t)=>{let o=[],i=[],e=[],a=[];t?.trace({progress:n.progress},"processing history of type "+n.syncType?.toString());for(let A of n.phoneNumberToLidMappings||[])A.lidJid&&A.pnJid&&a.push({lid:A.lidJid,pn:A.pnJid});switch(n.syncType){case oe.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP:case oe.HistorySync.HistorySyncType.RECENT:case oe.HistorySync.HistorySyncType.FULL:case oe.HistorySync.HistorySyncType.ON_DEMAND:for(let A of n.conversations){i.push({id:A.id,name:A.displayName||A.name||A.username||void 0,username:A.username||void 0,lid:A.lidJid||A.accountLid||void 0,phoneNumber:A.pnJid||void 0});let r=A.id,s=qA(r)||Ia(r),g=_t(r)||mr(r);if(s&&A.pnJid)a.push({lid:r,pn:A.pnJid});else if(g&&A.lidJid)a.push({lid:A.lidJid,pn:r});else if(s&&!A.pnJid){let I=Z4e(A.messages||[]);I&&a.push({lid:r,pn:I})}let c=A.messages||[];delete A.messages;for(let I of c){let d=I.message;o.push(d),A.messages?.length||(A.messages=[{message:d}]),!d.key.fromMe&&!A.lastMessageRecvTimestamp&&(A.lastMessageRecvTimestamp=Yr(d.messageTimestamp)),(d.messageStubType===RA.BIZ_PRIVACY_MODE_TO_BSP||d.messageStubType===RA.BIZ_PRIVACY_MODE_TO_FB)&&d.messageStubParameters?.[0]&&i.push({id:d.key.participant||d.key.remoteJid,verifiedName:d.messageStubParameters?.[0]})}e.push(A)}break;case oe.HistorySync.HistorySyncType.PUSH_NAME:for(let A of n.pushnames)i.push({id:A.id,notify:A.pushname});break}return{chats:e,contacts:i,messages:o,lidPnMappings:a,pastParticipants:n.pastParticipants,syncType:n.syncType,progress:n.progress}},Cne=async(n,t,o)=>{let i;return n.initialHistBootstrapInlinePayload?i=oe.HistorySync.decode(await W4e(n.initialHistBootstrapInlinePayload)):i=await X4e(n,t),$4e(i,o)},mb=n=>(n?Na(n):void 0)?.protocolMessage?.historySyncNotification;var nn=qe(Kr(),1);var Zs;(function(n){n.Chat="label_jid",n.Message="label_message"})(Zs||(Zs={}));var une=new dh;var Bne=(n,t,o)=>{let i=[];if(!t)return o?.warn({hasFullName:!!n.fullName,hasLidJid:!!n.lidJid,hasPnJid:!!n.pnJid},"contactAction sync: missing id in index"),i;let e=n.lidJid,a=_t(t),A=a?t:n.pnJid||void 0;return i.push({event:"contacts.upsert",data:[{id:t,name:n.fullName||n.firstName||n.username||void 0,username:n.username||void 0,lid:e||void 0,phoneNumber:A}]}),e&&qA(e)&&a&&i.push({event:"lid-mapping.update",data:{lid:e,pn:t}}),i},fne=(n,t)=>{for(let o of t)o.event==="contacts.upsert"?n.emit("contacts.upsert",o.data):n.emit("lid-mapping.update",o.data)};var vf=n=>{let t=b7(n);return{indexKey:t.indexKey,valueEncryptionKey:t.valueEncryptionKey,valueMacKey:t.valueMacKey,snapshotMacKey:t.snapshotMacKey,patchMacKey:t.patchMacKey}},Qne=(n,t,o,i)=>{let e=n===oe.SyncdMutation.SyncdOperation.SET?1:2,a=typeof o=="string"?Buffer.from(o,"base64"):o,A=new Uint8Array(1+a.length);A[0]=e,A.set(a,1);let r=new Uint8Array(8);r[7]=A.length;let s=new Uint8Array(A.length+t.length+r.length);return s.set(A,0),s.set(t,A.length),s.set(r,A.length+t.length),Hn(s,i,"sha512").subarray(0,32)},yne=n=>{let t=Buffer.alloc(8);return t.writeUint32BE(n,4),t},mne=({indexValueMap:n,hash:t})=>{n={...n};let o=[],i=[];return{mix:({indexMac:e,valueMac:a,operation:A})=>{let r=Buffer.from(e).toString("base64"),s=n[r];if(A===oe.SyncdMutation.SyncdOperation.REMOVE){if(!s)return;delete n[r]}else o.push(a),n[r]={valueMac:a};s&&i.push(s.valueMac)},finish:()=>{let e=une.subtractThenAdd(t,i,o);return{hash:Buffer.from(e),indexValueMap:n}}}},yU=(n,t,o,i)=>{let e=Buffer.concat([n,yne(t),Buffer.from(o,"utf-8")]);return Hn(e,i,"sha256")},Sne=(n,t,o,i,e)=>{let a=Buffer.concat([n,...t,yne(o),Buffer.from(i,"utf-8")]);return Hn(a,e)},Sb=()=>({version:0,hash:Buffer.alloc(128),indexValueMap:{}}),mU=n=>((typeof n.version!="number"||isNaN(n.version))&&(n.version=0),n),SU=2,Pf=n=>n?.data?.isMissingKey===!0,wne=(n,t)=>t>=SU||n?.name==="TypeError",Dne=async({type:n,index:t,syncAction:o,apiVersion:i,operation:e},a,A,r)=>{let s=a?await r(a):void 0;if(!s)throw new nn.Boom(`myAppStateKey ("${a}") not present`,{data:{isMissingKey:!0}});let g=Buffer.from(a,"base64");A={...A,indexValueMap:{...A.indexValueMap}};let c=Buffer.from(JSON.stringify(t)),I=oe.SyncActionData.fromObject({index:c,value:o,padding:new Uint8Array(0),version:i}),d=oe.SyncActionData.encode(I).finish(),B=vf(s.keyData),f=P7(d,B.valueEncryptionKey),Q=Qne(e,f,g,B.valueMacKey),y=Hn(c,B.indexKey),m=mne(A);m.mix({indexMac:y,valueMac:Q,operation:e}),Object.assign(A,m.finish()),A.version+=1;let T=yU(A.hash,A.version,n,B.snapshotMacKey),_={patchMac:Sne(T,[Q],A.version,n,B.patchMacKey),snapshotMac:T,keyId:{id:g},mutations:[{operation:e,record:{index:{blob:y},value:{blob:Buffer.concat([f,Q])},keyId:{id:g}}}]},R=y.toString("base64");return A.indexValueMap[R]={valueMac:Q},{patch:_,state:A}},One=async(n,t,o,i,e)=>{let a=mne(t),A=new Map;for(let s of n){let g="operation"in s?s.operation:oe.SyncdMutation.SyncdOperation.SET,c="record"in s&&s.record?s.record:s,I;try{I=await r(c.keyId.id)}catch(T){if(Pf(T))throw T;continue}let d=c.value.blob,B=d.subarray(0,-32),f=d.subarray(-32);if(e){let T=Qne(g,B,c.keyId.id,I.valueMacKey);if(Buffer.compare(T,f)!==0)continue}let Q;try{Q=v7(B,I.valueEncryptionKey)}catch{continue}let y=oe.SyncActionData.decode(Q);if(e){let T=Hn(y.index,I.indexKey);if(Buffer.compare(T,c.index.blob)!==0)throw new nn.Boom("HMAC index verification failed")}let m=Buffer.from(y.index).toString();i({syncAction:y,index:JSON.parse(m)}),a.mix({indexMac:c.index.blob,valueMac:f,operation:g})}return a.finish();async function r(s){let g=Buffer.from(s).toString("base64"),c=A.get(g);if(c)return c;let I=await o(g);if(!I)throw new nn.Boom(`failed to find key "${g}" to decode mutation`,{data:{isMissingKey:!0,msgMutations:n}});let d=vf(I.keyData);return A.set(g,d),d}},e8e=async(n,t,o,i,e,a)=>{if(a){let r=Buffer.from(n.keyId.id).toString("base64"),s=await i(r);if(!s)throw new nn.Boom(`failed to find key "${r}" to decode patch`,{data:{isMissingKey:!0,msg:n}});let g=vf(s.keyData),c=n.mutations.map(d=>d.record.value.blob.slice(-32)),I=Sne(n.snapshotMac,c,Yr(n.version.version),t,g.patchMacKey);if(Buffer.compare(I,n.patchMac)!==0)throw new nn.Boom("Invalid patch mac")}return await One(n.mutations,o,i,e,a)},bne=async(n,t)=>{let o=le(n,"sync"),i=PA(o,"collection"),e={};return await Promise.all(i.map(async a=>{let A=le(a,"patches"),r=PA(A||a,"patch"),s=le(a,"snapshot"),g=[],c=a.attrs.name,I=a.attrs.has_more_patches==="true",d;if(s&&s.content){Buffer.isBuffer(s)||(s.content=Buffer.from(Object.values(s.content)));let B=oe.ExternalBlobReference.decode(s.content),f=await Mne(B,t);d=oe.SyncdSnapshot.decode(f)}for(let{content:B}of r)if(B){Buffer.isBuffer(B)||(B=Buffer.from(Object.values(B)));let f=oe.SyncdPatch.decode(B);f.version||(f.version={version:+a.attrs.version+1}),g.push(f)}e[c]={patches:g,hasMorePatches:I,snapshot:d}})),e},Mne=async(n,t)=>{let o=await cE(n,"md-app-state",{options:t}),i=[];for await(let e of o)i.push(e);return Buffer.concat(i)},A8e=async(n,t)=>{let o=await Mne(n,t);return oe.SyncdMutations.decode(o)},_ne=async(n,t,o,i,e=!0,a)=>{let A=Sb();A.version=Yr(t.version.version);let r={},s=typeof i>"u"||A.version>i,{hash:g,indexValueMap:c}=await One(t.records,A,o,s?I=>{let d=I.syncAction.index?.toString();r[d]=I}:()=>{},e);if(A.hash=g,A.indexValueMap=c,e){let I=Buffer.from(t.keyId.id).toString("base64"),d=await o(I);if(!d)throw new nn.Boom(`failed to find key "${I}" to decode mutation`,{data:{isMissingKey:!0}});let B=vf(d.keyData),f=yU(A.hash,A.version,n,B.snapshotMacKey);Buffer.compare(t.mac,f)!==0&&a?.warn({name:n,version:A.version},"LTHash verification failed on snapshot, continuing with partial state")}return{state:A,mutationMap:r}},wU=async(n,t,o,i,e,a,A,r=!0)=>{let s={...o,indexValueMap:{...o.indexValueMap}},g={};for(let c of t){let{version:I,keyId:d,snapshotMac:B}=c;if(c.externalMutations){A?.trace({name:n,version:I},"downloading external patch");let m=await A8e(c.externalMutations,e);A?.debug({name:n,version:I,mutations:m.mutations.length},"downloaded external patch"),c.mutations?.push(...m.mutations)}let f=Yr(I.version);s.version=f;let Q=typeof a>"u"||f>a,y;try{y=await e8e(c,n,s,i,Q?m=>{let T=m.syncAction.index?.toString();g[T]=m}:()=>{},r)}catch(m){if(Pf(m))throw m;A?.warn({name:n,version:f,error:m.message},"failed to decode patch, skipping");continue}if(s.hash=y.hash,s.indexValueMap=y.indexValueMap,r){let m=Buffer.from(d.id).toString("base64"),T=await i(m);if(!T)throw new nn.Boom(`failed to find key "${m}" to decode mutation`,{data:{isMissingKey:!0}});let _=vf(T.keyData),R=yU(s.hash,s.version,n,_.snapshotMacKey);if(Buffer.compare(B,R)!==0){A?.warn({name:n,version:s.version},"LTHash verification failed, skipping remaining patches");break}}c.mutations=[]}return{state:s,mutationMap:g}},Tne=(n,t)=>{let o=oe.SyncdMutation.SyncdOperation,i=a=>{let A;return Array.isArray(a)?A={lastMessageTimestamp:a[a.length-1]?.messageTimestamp,messages:a?.length?a.map(s=>{if(!s.key?.id||!s.key?.remoteJid)throw new nn.Boom("Incomplete key",{statusCode:400,data:s});if(xr(s.key.remoteJid)&&!s.key.fromMe&&!s.key.participant)throw new nn.Boom("Expected not from me message to have participant",{statusCode:400,data:s});if(!s.messageTimestamp||!Yr(s.messageTimestamp))throw new nn.Boom("Missing timestamp in last message list",{statusCode:400,data:s});return s.key.participant&&(s.key.participant=uA(s.key.participant)),s}):void 0}:A=a,A},e;if("mute"in n)e={syncAction:{muteAction:{muted:!!n.mute,muteEndTimestamp:n.mute||void 0}},index:["mute",t],type:"regular_high",apiVersion:2,operation:o.SET};else if("archive"in n)e={syncAction:{archiveChatAction:{archived:!!n.archive,messageRange:i(n.lastMessages)}},index:["archive",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("markRead"in n)e={syncAction:{markChatAsReadAction:{read:n.markRead,messageRange:i(n.lastMessages)}},index:["markChatAsRead",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("deleteForMe"in n){let{timestamp:a,key:A,deleteMedia:r}=n.deleteForMe;e={syncAction:{deleteMessageForMeAction:{deleteMedia:r,messageTimestamp:a}},index:["deleteMessageForMe",t,A.id,A.fromMe?"1":"0","0"],type:"regular_high",apiVersion:3,operation:o.SET}}else if("clear"in n)e={syncAction:{clearChatAction:{messageRange:i(n.lastMessages)}},index:["clearChat",t,"1","0"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pin"in n)e={syncAction:{pinAction:{pinned:!!n.pin}},index:["pin_v1",t],type:"regular_low",apiVersion:5,operation:o.SET};else if("contact"in n)e={syncAction:{contactAction:n.contact||{}},index:["contact",t],type:"critical_unblock_low",apiVersion:2,operation:n.contact?o.SET:o.REMOVE};else if("disableLinkPreviews"in n)e={syncAction:{privacySettingDisableLinkPreviewsAction:n.disableLinkPreviews||{}},index:["setting_disableLinkPreviews"],type:"regular",apiVersion:8,operation:o.SET};else if("star"in n){let a=n.star.messages[0];e={syncAction:{starAction:{starred:!!n.star.star}},index:["star",t,a.id,a.fromMe?"1":"0","0"],type:"regular_low",apiVersion:2,operation:o.SET}}else if("delete"in n)e={syncAction:{deleteChatAction:{messageRange:i(n.lastMessages)}},index:["deleteChat",t,"1"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pushNameSetting"in n)e={syncAction:{pushNameSetting:{name:n.pushNameSetting}},index:["setting_pushName"],type:"critical_block",apiVersion:1,operation:o.SET};else if("quickReply"in n)e={syncAction:{quickReplyAction:{count:0,deleted:n.quickReply.deleted||!1,keywords:[],message:n.quickReply.message||"",shortcut:n.quickReply.shortcut||""}},index:["quick_reply",n.quickReply.timestamp||String(Math.floor(Date.now()/1e3))],type:"regular",apiVersion:2,operation:o.SET};else if("addLabel"in n)e={syncAction:{labelEditAction:{name:n.addLabel.name,color:n.addLabel.color,predefinedId:n.addLabel.predefinedId,deleted:n.addLabel.deleted}},index:["label_edit",n.addLabel.id],type:"regular",apiVersion:3,operation:o.SET};else if("addChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[Zs.Chat,n.addChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("removeChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[Zs.Chat,n.removeChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("addMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[Zs.Message,n.addMessageLabel.labelId,t,n.addMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else if("removeMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[Zs.Message,n.removeMessageLabel.labelId,t,n.removeMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else throw new nn.Boom("not supported");return e.syncAction.timestamp=Date.now(),e},Nne=(n,t,o,i,e)=>{let a=!!i,A=i?.accountSettings;e?.trace({syncAction:n,initialSync:!!i},"processing sync action");let{syncAction:{value:r},index:[s,g,c,I]}=n;if(r?.muteAction)t.emit("chats.update",[{id:g,muteEndTime:r.muteAction?.muted?Yr(r.muteAction.muteEndTimestamp):null,conditional:d(g,void 0)}]);else if(r?.archiveChatAction||s==="archive"||s==="unarchive"){let f=r?.archiveChatAction,Q=f?f.archived:s==="archive",y=A?.unarchiveChats?f?.messageRange:void 0;t.emit("chats.update",[{id:g,archived:Q,conditional:d(g,y)}])}else if(r?.markChatAsReadAction){let f=r.markChatAsReadAction,Q=a&&f.read;t.emit("chats.update",[{id:g,unreadCount:Q?null:f?.read?0:-1,conditional:d(g,f?.messageRange)}])}else if(r?.deleteMessageForMeAction||s==="deleteMessageForMe")t.emit("messages.delete",{keys:[{remoteJid:g,id:c,fromMe:I==="1"}]});else if(r?.contactAction){let f=Bne(r.contactAction,g,e);fne(t,f)}else if(r?.pushNameSetting){let f=r?.pushNameSetting?.name;f&&o?.name!==f&&t.emit("creds.update",{me:{...o,name:f}})}else if(r?.pinAction)t.emit("chats.update",[{id:g,pinned:r.pinAction?.pinned?Yr(r.timestamp):null,conditional:d(g,void 0)}]);else if(r?.unarchiveChatsSetting){let f=!!r.unarchiveChatsSetting.unarchiveChats;t.emit("creds.update",{accountSettings:{unarchiveChats:f}}),e?.info(`archive setting updated => '${r.unarchiveChatsSetting.unarchiveChats}'`),A&&(A.unarchiveChats=f)}else if(r?.starAction||s==="star"){let f=r?.starAction?.starred;typeof f!="boolean"&&(f=n.index[n.index.length-1]==="1"),t.emit("messages.update",[{key:{remoteJid:g,id:c,fromMe:I==="1"},update:{starred:f}}])}else if(r?.deleteChatAction||s==="deleteChat")a||t.emit("chats.delete",[g]);else if(r?.labelEditAction){let{name:f,color:Q,deleted:y,predefinedId:m}=r.labelEditAction;t.emit("labels.edit",{id:g,name:f,color:Q,deleted:y,predefinedId:m?String(m):void 0})}else r?.labelAssociationAction?t.emit("labels.association",{type:r.labelAssociationAction.labeled?"add":"remove",association:s===Zs.Chat?{type:Zs.Chat,chatId:n.index[2],labelId:n.index[1]}:{type:Zs.Message,chatId:n.index[2],messageId:n.index[3],labelId:n.index[1]}}):r?.localeSetting?.locale?t.emit("settings.update",{setting:"locale",value:r.localeSetting.locale}):r?.timeFormatAction?t.emit("settings.update",{setting:"timeFormat",value:r.timeFormatAction}):r?.pnForLidChatAction?r.pnForLidChatAction.pnJid&&t.emit("lid-mapping.update",{lid:g,pn:r.pnForLidChatAction.pnJid}):r?.privacySettingRelayAllCalls?t.emit("settings.update",{setting:"privacySettingRelayAllCalls",value:r.privacySettingRelayAllCalls}):r?.statusPrivacy?t.emit("settings.update",{setting:"statusPrivacy",value:r.statusPrivacy}):r?.lockChatAction?t.emit("chats.lock",{id:g,locked:!!r.lockChatAction.locked}):r?.privacySettingDisableLinkPreviewsAction?t.emit("settings.update",{setting:"disableLinkPreviews",value:r.privacySettingDisableLinkPreviewsAction}):r?.notificationActivitySettingAction?.notificationActivitySetting?t.emit("settings.update",{setting:"notificationActivitySetting",value:r.notificationActivitySettingAction.notificationActivitySetting}):r?.lidContactAction?t.emit("contacts.upsert",[{id:g,name:r.lidContactAction.fullName||r.lidContactAction.firstName||r.lidContactAction.username||void 0,username:r.lidContactAction.username||void 0,lid:g,phoneNumber:void 0}]):r?.privacySettingChannelsPersonalisedRecommendationAction?t.emit("settings.update",{setting:"channelsPersonalisedRecommendation",value:r.privacySettingChannelsPersonalisedRecommendationAction}):e?.debug({syncAction:n,id:g},"unprocessable update");function d(f,Q){return a?y=>{let m=y.historySets.chats[f]||y.chatUpserts[f];if(m)return Q?B(m,Q):!0}:void 0}function B(f,Q){let y=Number(Q?.lastMessageTimestamp||Q?.lastSystemMessageTimestamp||0),m=Number(f?.lastMessageRecvTimestamp||0);return y>=m}};var t8e=class{_eventListeners;_maxListeners;_logger;_throwOnEmitError=!1;_throwOnEmptyListeners=!1;_errorEvent="error";constructor(n){this._eventListeners=new Map,this._maxListeners=100,this._logger=n?.logger,n?.throwOnEmitError!==void 0&&(this._throwOnEmitError=n.throwOnEmitError),n?.throwOnEmptyListeners!==void 0&&(this._throwOnEmptyListeners=n.throwOnEmptyListeners)}get logger(){return this._logger}set logger(n){this._logger=n}get throwOnEmitError(){return this._throwOnEmitError}set throwOnEmitError(n){this._throwOnEmitError=n}get throwOnEmptyListeners(){return this._throwOnEmptyListeners}set throwOnEmptyListeners(n){this._throwOnEmptyListeners=n}once(n,t){let o=(...i)=>{this.off(n,o),t(...i)};return this.on(n,o),this}listenerCount(n){if(n===void 0)return this.getAllListeners().length;let t=this._eventListeners.get(n);return t?t.length:0}eventNames(){return[...this._eventListeners.keys()]}rawListeners(n){return n===void 0?this.getAllListeners():this._eventListeners.get(n)??[]}prependListener(n,t){let o=this._eventListeners.get(n)??[];return o.unshift(t),this._eventListeners.set(n,o),this}prependOnceListener(n,t){let o=(...i)=>{this.off(n,o),t(...i)};return this.prependListener(n,o),this}maxListeners(){return this._maxListeners}addListener(n,t){return this.on(n,t),this}on(n,t){this._eventListeners.has(n)||this._eventListeners.set(n,[]);let o=this._eventListeners.get(n);return o&&(o.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${o.length+1} ${n} listeners added. Use setMaxListeners() to increase limit.`),o.push(t)),this}removeListener(n,t){return this.off(n,t),this}off(n,t){let o=this._eventListeners.get(n)??[],i=o.indexOf(t);return i!==-1&&o.splice(i,1),o.length===0&&this._eventListeners.delete(n),this}emit(n,...t){let o=!1,i=this._eventListeners.get(n);if(i&&i.length>0)for(let e of i)e(...t),o=!0;if(n===this._errorEvent){let e=t[0]instanceof Error?t[0]:new Error(`${t[0]}`);if(this._throwOnEmitError&&!o)throw e;if(this.listeners(this._errorEvent).length===0&&this._throwOnEmptyListeners===!0)throw e}return this.sendLog(n,t),o}listeners(n){return this._eventListeners.get(n)??[]}removeAllListeners(n){return n!==void 0?this._eventListeners.delete(n):this._eventListeners.clear(),this}setMaxListeners(n){this._maxListeners=n;for(let t of this._eventListeners.values())t.length>n&&t.splice(n)}getAllListeners(){let n=[];for(let t of this._eventListeners.values())n=[...n,...t];return n}sendLog(n,t){if(!this._logger)return;let o;switch(typeof t=="string"?o=t:Array.isArray(t)&&t.length>0&&t[0]instanceof Error?o=t[0].message:t instanceof Error?o=t.message:Array.isArray(t)&&t.length>0&&typeof t[0]?.message=="string"?o=t[0].message:o=JSON.stringify(t),n){case"error":{this._logger.error?.(o,{event:n,data:t});break}case"warn":{this._logger.warn?.(o,{event:n,data:t});break}case"trace":{this._logger.trace?.(o,{event:n,data:t});break}case"debug":{this._logger.debug?.(o,{event:n,data:t});break}case"fatal":{this._logger.fatal?.(o,{event:n,data:t});break}default:{this._logger.info?.(o,{event:n,data:t});break}}}},QI=class extends t8e{_hooks;_throwOnHookError=!1;_enforceBeforeAfter=!1;_deprecatedHooks;_allowDeprecated=!0;constructor(n){super({logger:n?.logger,throwOnEmitError:n?.throwOnEmitError,throwOnEmptyListeners:n?.throwOnEmptyListeners}),this._hooks=new Map,this._deprecatedHooks=n?.deprecatedHooks?new Map(n.deprecatedHooks):new Map,n?.throwOnHookError!==void 0?this._throwOnHookError=n.throwOnHookError:n?.throwHookErrors!==void 0&&(this._throwOnHookError=n.throwHookErrors),n?.enforceBeforeAfter!==void 0&&(this._enforceBeforeAfter=n.enforceBeforeAfter),n?.allowDeprecated!==void 0&&(this._allowDeprecated=n.allowDeprecated)}get hooks(){return this._hooks}get throwHookErrors(){return this._throwOnHookError}set throwHookErrors(n){this._throwOnHookError=n}get throwOnHookError(){return this._throwOnHookError}set throwOnHookError(n){this._throwOnHookError=n}get enforceBeforeAfter(){return this._enforceBeforeAfter}set enforceBeforeAfter(n){this._enforceBeforeAfter=n}get deprecatedHooks(){return this._deprecatedHooks}set deprecatedHooks(n){this._deprecatedHooks=n}get allowDeprecated(){return this._allowDeprecated}set allowDeprecated(n){this._allowDeprecated=n}validateHookName(n){if(this._enforceBeforeAfter){let t=n.trim().toLocaleLowerCase();if(!t.startsWith("before")&&!t.startsWith("after"))throw new Error(`Hook event "${n}" must start with "before" or "after" when enforceBeforeAfter is enabled`)}}checkDeprecatedHook(n){if(this._deprecatedHooks.has(n)){let t=this._deprecatedHooks.get(n),o=`Hook "${n}" is deprecated${t?`: ${t}`:""}`;return this.emit("warn",{hook:n,message:o}),this._allowDeprecated}return!0}onHook(n,t){this.onHookEntry({event:n,handler:t})}onHookEntry(n){if(this.validateHookName(n.event),!this.checkDeprecatedHook(n.event))return;let t=this._hooks.get(n.event);t?t.push(n.handler):this._hooks.set(n.event,[n.handler])}addHook(n,t){this.onHookEntry({event:n,handler:t})}onHooks(n){for(let t of n)this.onHook(t.event,t.handler)}prependHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);o?o.unshift(t):this._hooks.set(n,[t])}prependOnceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...i)=>(this.removeHook(n,o),t(...i));this.prependHook(n,o)}onceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...i)=>(this.removeHook(n,o),t(...i));this.onHook(n,o)}removeHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){let i=o.indexOf(t);i!==-1&&o.splice(i,1)}}removeHooks(n){for(let t of n)this.removeHook(t.event,t.handler)}async hook(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o)for(let i of o)try{await i(...t)}catch(e){let a=`${n}: ${e.message}`;if(this.emit("error",new Error(a)),this._throwOnHookError)throw new Error(a)}}hookSync(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){for(let i of o)if(i.constructor.name!=="AsyncFunction")try{i(...t)}catch(e){let a=`${n}: ${e.message}`;if(this.emit("error",new Error(a)),this._throwOnHookError)throw new Error(a)}}}async beforeHook(n,...t){await this.hook(`before:${n}`,...t)}async afterHook(n,...t){await this.hook(`after:${n}`,...t)}async callHook(n,...t){await this.hook(n,...t)}getHooks(n){if(this.validateHookName(n),!!this.checkDeprecatedHook(n))return this._hooks.get(n)}clearHooks(){this._hooks.clear()}};var r8e=class{_enabled=!0;_maxSize=4e3;_store=new Map;_keys=[];constructor(n){n?.enabled!==void 0&&(this._enabled=n.enabled),n?.maxSize!==void 0&&(this._maxSize=n.maxSize)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get maxSize(){return this._maxSize}set maxSize(n){this._maxSize=n}get store(){return this._store}get size(){return this._store.size}get(n){return this._store.get(n)}set(n,t){if(this._enabled){if(this._store.has(n)){this._store.set(n,t);return}if(this._store.size>=this._maxSize){let o=this._keys.shift();o&&this._store.delete(o)}this._keys.push(n),this._store.set(n,t)}}has(n){return this._store.has(n)}clear(){this._store.clear(),this._keys=[]}},a8e=class{get name(){return"crc32"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let a=n;t=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let o=3988292384,i=4294967295;for(let a=0;a>>1^o&-(i&1)}return i=(i^4294967295)>>>0,i.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},wb=class{_algorithm="SHA-256";constructor(n){n?.algorithm&&(this._algorithm=n?.algorithm)}get name(){return this._algorithm}async toHash(n){let t=await crypto.subtle.digest(this._algorithm,n);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}},i8e=class{get name(){return"djb2"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let e=n;t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let o=5381;for(let e=0;e>>0;return o.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},o8e=class{get name(){return"fnv1"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let A=n;t=new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}let o=2166136261,i=16777619,e=o;for(let A=0;A>>0;return e.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},n8e=class{_seed;constructor(n=0){this._seed=n>>>0}get name(){return"murmur"}get seed(){return this._seed}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let c=n;t=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}let o=3432918353,i=461845907,e=t.length,a=Math.floor(e/4),A=this._seed;for(let c=0;c>>16,A=this._imul(A,2246822507),A^=A>>>13,A=this._imul(A,3266489909),A^=A>>>16,A=A>>>0,A.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}_imul(n,t){if(Math.imul)return Math.imul(n,t);let o=n>>>16&65535,i=n&65535,e=t>>>16&65535,a=t&65535;return i*a+(o*a+i*e<<16>>>0)|0}_rotl32(n,t){return n<>>32-t}},s8e=class{_providers=new Map;_getFuzzy=!0;constructor(n){n?.providers&&this.loadProviders(n?.providers),n?.getFuzzy!==void 0&&(this._getFuzzy=!!n?.getFuzzy)}loadProviders(n){for(let t of n)this._providers.set(t.name,t)}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return Array.from(this._providers.keys())}get(n,t){let o=t?.fuzzy??this._getFuzzy;n=n.trim();let i=this._providers.get(n);return i===void 0&&o===!0&&(n=n.toLowerCase(),i=this._providers.get(n)),i===void 0&&o===!0&&(n=n.replaceAll("-",""),i=this._providers.get(n)),i}add(n){this._providers.set(n.name,n)}remove(n){return this._providers.delete(n)}},DU=class extends QI{_parse=JSON.parse;_stringify=JSON.stringify;_providers=new s8e;_defaultAlgorithm="SHA-256";_defaultAlgorithmSync="djb2";_cache;constructor(n){super(n),n?.parse&&(this._parse=n.parse),n?.stringify&&(this._stringify=n.stringify),n?.defaultAlgorithm&&(this._defaultAlgorithm=n.defaultAlgorithm),n?.defaultAlgorithmSync&&(this._defaultAlgorithmSync=n.defaultAlgorithmSync),this._cache=new r8e(n?.cache),this.loadProviders(n?.providers,{includeBase:n?.includeBase??!0})}get parse(){return this._parse}set parse(n){this._parse=n}get stringify(){return this._stringify}set stringify(n){this._stringify=n}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return this._providers.names}get defaultAlgorithm(){return this._defaultAlgorithm}set defaultAlgorithm(n){this._defaultAlgorithm=n}get defaultAlgorithmSync(){return this._defaultAlgorithmSync}set defaultAlgorithmSync(n){this._defaultAlgorithmSync=n}get cache(){return this._cache}async toHash(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithm,maxLength:t?.maxLength};await this.beforeHook("toHash",o);let i=this._stringify(o.data),e=`${o.algorithm}:${i}`;if(this._cache.enabled){let c=this._cache.get(e);if(c!==void 0){let I=c;t?.maxLength&&I.length>t.maxLength&&(I=I.substring(0,t.maxLength));let d={hash:I,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",d),d.hash}}let A=new TextEncoder().encode(i),r=this._providers.get(o.algorithm);r||(this.emit("warn",`Invalid algorithm '${o.algorithm}' not found. Falling back to default algorithm '${this._defaultAlgorithm}'.`),r=new wb({algorithm:this._defaultAlgorithm}));let s=await r.toHash(A);this._cache.enabled&&this._cache.set(e,s),t?.maxLength&&s.length>t?.maxLength&&(s=s.substring(0,t.maxLength));let g={hash:s,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",g),g.hash}async toNumber(n,t={}){let{min:o=0,max:i=100,algorithm:e=this._defaultAlgorithm,hashLength:a=16}=t;if(o>i)throw new Error("min cannot be greater than max");let A=await this.toHash(n,{algorithm:e,maxLength:a}),r=Number.parseInt(A,16),s=i-o+1;return o+r%s}toHashSync(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithmSync,maxLength:t?.maxLength};this.hookSync("before:toHashSync",o);let i=o.algorithm,e=this._stringify(o.data),a=`${i}:${e}`;if(this._cache.enabled){let I=this._cache.get(a);if(I!==void 0){let d=I;t?.maxLength&&d.length>t.maxLength&&(d=d.substring(0,t.maxLength));let B={hash:d,data:o.data,algorithm:i};return this.hookSync("after:toHashSync",B),B.hash}}let r=new TextEncoder().encode(e),s=this._providers.get(i);if(!s&&(this.emit("warn",`Invalid algorithm '${i}' not found. Falling back to default algorithm '${this._defaultAlgorithmSync}'.`),s=this._providers.get(this._defaultAlgorithmSync),!s))throw new Error(`Hash provider '${this._defaultAlgorithmSync}' (default) not found`);if(!s.toHashSync)throw new Error(`Hash provider '${i}' does not support synchronous hashing. Use toHash() instead or choose a different algorithm (djb2, fnv1, murmur, crc32).`);let g=s.toHashSync(r);this._cache.enabled&&this._cache.set(a,g),t?.maxLength&&g.length>t?.maxLength&&(g=g.substring(0,t.maxLength));let c={hash:g,data:o.data,algorithm:o.algorithm};return this.hookSync("after:toHashSync",c),c.hash}toNumberSync(n,t={}){let{min:o=0,max:i=100,algorithm:e=this._defaultAlgorithmSync,hashLength:a=16}=t;if(o>i)throw new Error("min cannot be greater than max");let A=this.toHashSync(n,{algorithm:e,maxLength:a}),r=Number.parseInt(A,16),s=i-o+1;return o+r%s}loadProviders(n,t={includeBase:!0}){if(n)for(let o of n)this._providers.add(o);t.includeBase&&(this.providers.add(new wb({algorithm:"SHA-256"})),this.providers.add(new wb({algorithm:"SHA-384"})),this.providers.add(new wb({algorithm:"SHA-512"})),this.providers.add(new a8e),this.providers.add(new i8e),this.providers.add(new o8e),this.providers.add(new n8e))}};var MU=n=>{let t;if(n!==void 0){if(typeof n=="number")t=n;else{if(typeof n!="string")return;if(n=n.trim(),Number.isNaN(Number(n))){let o=/^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(n);if(!o)throw new Error(`Unsupported time format: "${n}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.`);let[,i,e]=o,a=Number.parseFloat(i);switch(e.toLowerCase()){case"ms":t=a;break;case"s":t=a*1e3;break;case"m":t=a*1e3*60;break;case"h":t=a*1e3*60*60;break;case"hr":t=a*1e3*60*60;break;case"d":t=a*1e3*60*60*24;break;default:t=Number(n)}}else t=Number(n)}return t}},np=(n,t)=>{t??=new Date;let o=MU(n);return o===void 0?t.getTime():t.getTime()+o};var Gf=(function(n){return n.SHA256="SHA-256",n.SHA384="SHA-384",n.SHA512="SHA-512",n.DJB2="djb2",n.FNV1="fnv1",n.MURMER="murmer",n.CRC32="crc32",n})({});function OU(n,t={algorithm:"djb2",serialize:JSON.stringify}){let o=t?.algorithm??"djb2",i=(t?.serialize??JSON.stringify)(n);return new DU().toHashSync(i,{algorithm:o})}function Rne(n,t={min:0,max:10,algorithm:"djb2",serialize:JSON.stringify}){let o=t?.min??0,i=t?.max??10,e=t?.algorithm??"djb2",a=t?.serialize??JSON.stringify,A=t?.hashLength??16;if(o>=i)throw new Error(`Invalid range: min (${o}) must be less than max (${i})`);let r=a(n);return new DU().toNumberSync(r,{algorithm:e,min:o,max:i,hashLength:A})}function _U(n,t){let{ttl:o,keyPrefix:i,cache:e,serialize:a}=t;return(...A)=>{let r=g8e(n,A,{keyPrefix:i,serialize:a});t.createKey&&(r=t.createKey(n,A,t));let s=e.get(r);if(s===void 0)try{s=n(...A),e.set(r,s,o)}catch(g){e.emit("error",g),t.cacheErrors&&e.set(r,g,o)}return s}}function TU(n,t,o){let i=typeof n=="function"?n(o):n,e;try{e=o.cache.get(i)}catch(a){if(o.cache.emit("error",a),o.throwErrors===!0||o.throwErrors==="store")throw a}if(e===void 0)try{try{e=t()}catch(a){throw new Db(a,"function")}try{o.cache.set(i,e,o.ttl)}catch(a){throw new Db(a,"store")}}catch(a){let A=a instanceof Db?a.context:void 0,r=a instanceof Db?a.error:a;if(o.cache.emit("error",r),o.cacheErrors&&A==="function")try{o.cache.set(i,r,o.ttl)}catch(s){o.cache.emit("error",s)}if(o.throwErrors===!0||o.throwErrors===A)throw r}return e}function g8e(n,t,o){let{keyPrefix:i,serialize:e}=o||{};return i?`${i}::${n.name}::${OU(t,{serialize:e})}`:`${n.name}::${OU(t,{serialize:e})}`}var Db=class{error;context;constructor(n,t){this.error=n,this.context=t}};var yI=class{_counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0};_vsize=0;_ksize=0;_enabled=!1;_lastUpdated;_lastReset;_subscriptions=[];_trackedKeys=new Map;_trackKeys=!1;_maxTrackedKeys;constructor(n){n?.enabled&&(this._enabled=n.enabled),n?.trackKeys&&(this._trackKeys=n.trackKeys),n?.maxTrackedKeys!==void 0&&(this._maxTrackedKeys=n.maxTrackedKeys),n?.emitter&&n?.eventMap&&this.subscribe(n.emitter,n.eventMap)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get trackKeys(){return this._trackKeys}set trackKeys(n){this._trackKeys=n}get maxTrackedKeys(){return this._maxTrackedKeys}set maxTrackedKeys(n){this._maxTrackedKeys=n}get trackedKeys(){return this._trackedKeys}get hits(){return this._counters.hits}get misses(){return this._counters.misses}get gets(){return this._counters.gets}get sets(){return this._counters.sets}get deletes(){return this._counters.deletes}get clears(){return this._counters.clears}get vsize(){return this._vsize}get ksize(){return this._ksize}get count(){return this._counters.count}get hitRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.hits/n}get missRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.misses/n}get lastUpdated(){return this._lastUpdated}get lastReset(){return this._lastReset}increment(n,t=1){this._enabled&&(this._counters[n]+=t,this.touch())}decrement(n,t=1){this._enabled&&(this._counters[n]-=t,this.touch())}incrementHits(n=1){this.increment("hits",n)}incrementMisses(n=1){this.increment("misses",n)}incrementGets(n=1){this.increment("gets",n)}incrementSets(n=1){this.increment("sets",n)}incrementDeletes(n=1){this.increment("deletes",n)}incrementClears(n=1){this.increment("clears",n)}incrementVSize(n){this._enabled&&(this._vsize+=this.roughSizeOfObject(n),this.touch())}decreaseVSize(n){this._enabled&&(this._vsize=Math.max(0,this._vsize-this.roughSizeOfObject(n)),this.touch())}incrementKSize(n){this._enabled&&(this._ksize+=this.roughSizeOfString(n),this.touch())}decreaseKSize(n){this._enabled&&(this._ksize=Math.max(0,this._ksize-this.roughSizeOfString(n)),this.touch())}incrementCount(n=1){this.increment("count",n)}decreaseCount(n=1){this._enabled&&(this._counters.count=Math.max(0,this._counters.count-n),this.touch())}setCount(n){this._enabled&&(this._counters.count=n,this.touch())}roughSizeOfString(n){return n.length*2}roughSizeOfObject(n){let t=[],o=[n],i=0;for(;o.length>0;){let e=o.pop();if(typeof e=="boolean")i+=4;else if(typeof e=="string")i+=e.length*2;else if(typeof e=="number")i+=8;else{if(e==null){i+=4;continue}if(t.includes(e))continue;t.push(e);for(let a in e)i+=a.length*2,o.push(e[a])}}return i}enable(){this._enabled=!0}disable(){this._enabled=!1}clear(){this.reset()}reset(){this._counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0},this._vsize=0,this._ksize=0,this._trackedKeys.clear(),this._lastReset=Date.now(),this._lastUpdated=void 0}resetStoreValues(){this._vsize=0,this._ksize=0,this._counters.count=0}toJSON(){return{enabled:this._enabled,hits:this._counters.hits,misses:this._counters.misses,gets:this._counters.gets,sets:this._counters.sets,deletes:this._counters.deletes,clears:this._counters.clears,vsize:this._vsize,ksize:this._ksize,count:this._counters.count,hitRate:this.hitRate,missRate:this.missRate,trackedKeys:this._trackedKeys.size,lastUpdated:this._lastUpdated,lastReset:this._lastReset}}snapshot(){return this.toJSON()}recordKey(n,t,o=1){if(!this._enabled||!this._trackKeys)return;let i=this._trackedKeys.get(n);i||(i={hits:0,misses:0,gets:0,sets:0,deletes:0},this._trackedKeys.set(n,i),this.pruneTrackedKeys(n)),i[t]+=o,this.touch()}mostUsedKeys(n=100,t){return this.sortedKeyEntries(t,"desc").slice(0,n)}leastUsedKeys(n=100,t){return this.sortedKeyEntries(t,"asc").slice(0,n)}keyStats(n){let t=this._trackedKeys.get(n);return t?this.toKeyEntry(n,t):void 0}clearKeys(){this._trackedKeys.clear()}totalOf(n){return n.hits+n.misses+n.gets+n.sets+n.deletes}toKeyEntry(n,t){let o=t.hits+t.misses;return{key:n,count:this.totalOf(t),hits:t.hits,misses:t.misses,gets:t.gets,sets:t.sets,deletes:t.deletes,hitRate:o===0?0:t.hits/o}}sortedKeyEntries(n,t){let o=[];for(let[e,a]of this._trackedKeys)o.push(this.toKeyEntry(e,a));let i=t==="asc"?1:-1;return o.sort((e,a)=>{let A=n?e[n]:e.count,r=n?a[n]:a.count;return A!==r?(A-r)*i:e.keythis.totalOf(i[1])-this.totalOf(e[1]));for(let[i]of o){if(this._trackedKeys.size<=t)break;i!==n&&this._trackedKeys.delete(i)}}subscribe(n,t){for(let[o,i]of Object.entries(t)){let e=(...a)=>{this.applyEvent(i,a)};n.on(o,e),this._subscriptions.push({emitter:n,event:o,listener:e})}}unsubscribe(n){let t=[];for(let o of this._subscriptions){if(n&&o.emitter!==n){t.push(o);continue}(o.emitter.off??o.emitter.removeListener)?.call(o.emitter,o.event,o.listener)}this._subscriptions=t}applyEvent(n,t){if(this._enabled){if(typeof n=="function"){n(this,...t);return}if(Array.isArray(n)){for(let o of n)this.increment(o);return}this.increment(n)}}touch(){this._lastUpdated=Date.now()}};var c8e=class{value;prev=void 0;next=void 0;constructor(n){this.value=n}},NU=class{head=void 0;tail=void 0;nodesMap=new Map;addToFront(n){let t=new c8e(n);this.head?(t.next=this.head,this.head.prev=t,this.head=t):this.head=this.tail=t,this.nodesMap.set(n,t)}moveToFront(n){let t=this.nodesMap.get(n);if(!t||this.head===t)return;t.prev&&(t.prev.next=t.next);t.next&&(t.next.prev=t.prev);t===this.tail&&(this.tail=t.prev),t.prev=void 0,t.next=this.head;this.head&&(this.head.prev=t),this.head=t,this.tail??=t}getOldest(){return this.tail?this.tail.value:void 0}removeOldest(){if(!this.tail)return;let n=this.tail.value;return this.tail.prev?(this.tail=this.tail.prev,this.tail.next=void 0):this.head=this.tail=void 0,this.nodesMap.delete(n),n}remove(n){let t=this.nodesMap.get(n);return t?(t.prev?t.prev.next=t.next:(this.head=t.next,this.head&&(this.head.prev=void 0)),t.next?t.next.prev=t.prev:(this.tail=t.prev,this.tail&&(this.tail.next=void 0)),this.nodesMap.delete(n),!0):!1}get size(){return this.nodesMap.size}};var kne=16777216,RU=class extends QI{_lru=new NU;_storeHashSize=16;_storeHashAlgorithm=Gf.DJB2;_store=Array.from({length:this._storeHashSize},()=>new Map);_ttl;_maxTtl;_useClone=!0;_lruSize=0;_checkInterval=0;_interval=0;_stats=new yI({enabled:!1});constructor(n){super(),n?.ttl&&this.setTtl(n.ttl),n?.maxTtl!==void 0&&this.setMaxTtl(n.maxTtl),n?.useClone!==void 0&&(this._useClone=n.useClone),n?.stats&&(this._stats.enabled=n.stats),n?.storeHashSize&&n.storeHashSize>0&&(this._storeHashSize=n.storeHashSize),n?.lruSize&&(n.lruSize>16777216?this.emit("error",new Error(`LRU size cannot be larger than ${kne} due to Map limitations.`)):this._lruSize=n.lruSize),n?.checkInterval&&(this._checkInterval=n.checkInterval),n?.storeHashAlgorithm&&(this._storeHashAlgorithm=n.storeHashAlgorithm),this._store=Array.from({length:this._storeHashSize},()=>new Map),this.startIntervalCheck()}get ttl(){return this._ttl}set ttl(n){this.setTtl(n)}get maxTtl(){return this._maxTtl}set maxTtl(n){this.setMaxTtl(n)}get useClone(){return this._useClone}set useClone(n){this._useClone=n}get lruSize(){return this._lruSize}set lruSize(n){if(n>16777216){this.emit("error",new Error(`LRU size cannot be larger than ${kne} due to Map limitations.`));return}if(this._lruSize=n,this._lruSize===0){this._lru=new NU;return}this.lruResize()}get checkInterval(){return this._checkInterval}set checkInterval(n){this._checkInterval=n}get size(){let n=0;for(let t of this._store)n+=t.size;return n}get stats(){return this._stats}get storeHashSize(){return this._storeHashSize}set storeHashSize(n){n!==this._storeHashSize&&(this._storeHashSize=n,this._store=Array.from({length:this._storeHashSize},()=>new Map),this._stats.enabled&&this._stats.resetStoreValues())}get storeHashAlgorithm(){return this._storeHashAlgorithm}set storeHashAlgorithm(n){this._storeHashAlgorithm=n}get keys(){let n=[];for(let t of this._store)for(let o of t.keys()){let i=t.get(o);if(i&&this.hasExpired(i)){this.recordExpiration(i),t.delete(o),this.lruRemove(o);continue}n.push(o)}return n.values()}get items(){let n=[];for(let t of this._store)for(let o of t.values()){if(this.hasExpired(o)){this.recordExpiration(o),t.delete(o.key),this.lruRemove(o.key);continue}n.push(o)}return n.values()}get store(){return this._store}get(n){this.hookSync("BEFORE_GET",n);let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}this.lruMoveToFront(n);let i;return this._useClone?i=this.clone(o.value):i=o.value,this.recordRead(!0),this.hookSync("AFTER_GET",{key:n,result:i}),i}getMany(n){this.hookSync("BEFORE_GET_MANY",n);let t=[];for(let o of n)t.push(this.get(o));return this.hookSync("AFTER_GET_MANY",{keys:n,result:t}),t}getRaw(n){let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1);return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1);return}return this.lruMoveToFront(n),this.recordRead(!0),o}getManyRaw(n){let t=[];for(let o of n)t.push(this.getRaw(o));return t}set(n,t,o){let i={key:n,value:t,ttl:o};this.hookSync("BEFORE_SET",i);let e=this.getStore(i.key),a,A=i.ttl;if(A!==void 0||this._ttl!==void 0)if(typeof A=="object"){if(A.expire&&(a=typeof A.expire=="number"?A.expire:A.expire.getTime()),A.ttl){let s=np(A.ttl);s!==void 0&&(a=s)}}else{let s=np(A??this._ttl);s!==void 0&&(a=s)}if(this._maxTtl!==void 0){let s=np(this._maxTtl);(a===void 0||a>s)&&(a=s)}if(this._lruSize>0){if(e.has(i.key))this.lruMoveToFront(i.key);else if(this.lruAddToFront(i.key),this._lru.size>this._lruSize){let s=this._lru.getOldest();s&&(this._lru.removeOldest(),this.delete(s))}}if(this._stats.enabled){let s=e.get(i.key);s?this._stats.decreaseVSize(s.value):(this._stats.incrementKSize(i.key),this._stats.incrementCount()),this._stats.incrementVSize(i.value),this._stats.incrementSets()}let r={key:i.key,value:i.value,expires:a};e.set(i.key,r),this.hookSync("AFTER_SET",i)}setMany(n){this.hookSync("BEFORE_SET_MANY",n);for(let t of n)this.set(t.key,t.value,t.ttl);this.hookSync("AFTER_SET_MANY",n)}has(n){return!!this.get(n)}hasMany(n){let t=[];for(let o of n){let i=this.get(o);t.push(!!i)}return t}take(n){let t=this.get(n);if(t)return this.delete(n),t}takeMany(n){let t=[];for(let o of n)t.push(this.take(o));return t}delete(n){this.hookSync("BEFORE_DELETE",n);let t=this.getStore(n);if(this._stats.enabled){let o=t.get(n);o&&(this._stats.decreaseKSize(n),this._stats.decreaseVSize(o.value),this._stats.decreaseCount(),this._stats.incrementDeletes())}t.delete(n),this.lruRemove(n),this.hookSync("AFTER_DELETE",n)}deleteMany(n){this.hookSync("BEFORE_DELETE_MANY",n);for(let t of n)this.delete(t);this.hookSync("AFTER_DELETE_MANY",n)}clear(){this.hookSync("BEFORE_CLEAR"),this._store=Array.from({length:this._storeHashSize},()=>new Map),this._lru=new NU,this._stats.enabled&&(this._stats.resetStoreValues(),this._stats.incrementClears()),this.hookSync("AFTER_CLEAR")}getStore(n){let t=this.getKeyStoreHash(n);return this._store[t]||=new Map,this._store[t]}getKeyStoreHash(n){return this._store.length===1?0:typeof this._storeHashAlgorithm=="function"?this._storeHashAlgorithm(n,this._storeHashSize):Rne(n,{min:0,max:this._storeHashSize-1,algorithm:this._storeHashAlgorithm})}clone(n){return this.isPrimitive(n)?n:structuredClone(n)}lruAddToFront(n){this._lruSize!==0&&this._lru.addToFront(n)}lruMoveToFront(n){this._lruSize!==0&&this._lru.moveToFront(n)}lruRemove(n){this._lruSize!==0&&this._lru.remove(n)}lruResize(){for(;this._lru.size>this._lruSize;){let n=this._lru.getOldest();n&&(this._lru.removeOldest(),this.delete(n))}}checkExpiration(){for(let n of this._store)for(let t of n.values())t.expires&&Date.now()>t.expires&&(this.recordExpiration(t),n.delete(t.key),this.lruRemove(t.key))}startIntervalCheck(){if(this._checkInterval>0){this._interval&&clearInterval(this._interval),this._interval=setInterval(()=>{this.checkExpiration()},this._checkInterval).unref()}}stopIntervalCheck(){this._interval&&clearInterval(this._interval),this._interval=0,this._checkInterval=0}wrap(n,t){return _U(n,{ttl:t?.ttl??this._ttl,keyPrefix:t?.keyPrefix,createKey:t?.createKey,cache:this})}getOrSet(n,t,o){return TU(n,t,{cache:this,ttl:o?.ttl??this._ttl,cacheErrors:o?.cacheErrors,throwErrors:o?.throwErrors})}recordRead(n){this._stats.enabled&&(n?this._stats.incrementHits():this._stats.incrementMisses(),this._stats.incrementGets())}recordExpiration(n){this._stats.enabled&&(this._stats.decreaseKSize(n.key),this._stats.decreaseVSize(n.value),this._stats.decreaseCount())}isPrimitive(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}setTtl(n){typeof n=="string"||n===void 0?this._ttl=n:n>0?this._ttl=n:this._ttl=void 0}setMaxTtl(n){typeof n=="string"||n===void 0?this._maxTtl=n:n>0?this._maxTtl=n:this._maxTtl=void 0}hasExpired(n){return!!(n.expires&&Date.now()>n.expires)}};var C8e=class extends QI{options={stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,maxKeys:-1};store=new Map;_stats=new yI({enabled:!0});_cacheable=new RU;intervalId=0;constructor(n){super(),n&&(this.options={...this.options,...n}),this.startInterval()}set(n,t,o=0){if(typeof n!="string"&&typeof n!="number")throw this.createError("The key argument has to be of type `string` or `number`. Found: `__key`",n);if(o&&typeof o!="number"&&typeof o!="string")throw this.createError("The ttl argument has to be a number or a string for shorthand ttl.",this.formatKey(n));let i=this.formatKey(n),e=0;this.options.stdTTL&&(e=this.getExpirationTimestamp(this.options.stdTTL)),o&&(e=this.getExpirationTimestamp(o));let a=0;if(e&&e>0&&(a=e),this.options.maxKeys){let{maxKeys:A}=this.options;if(A>-1&&this.store.size>=A)throw this.createError("Cache max keys amount exceeded",this.formatKey(n))}return this.store.set(i,{key:i,value:t,ttl:a}),this.emit("set",i,t,e),this._stats.incrementKSize(i),this._stats.incrementVSize(t),this._stats.setCount(this.store.size),!0}mset(n){if(!Array.isArray(n))throw this.createError("The keys argument has to be an array.");for(let t of n)this.set(t.key,t.value,t.ttl);return!0}get(n){let t=this.store.get(this.formatKey(n));if(t){if(t.ttl>0){if(t.ttl0){let n=this.options.checkperiod*1e3;this.intervalId=setInterval(()=>{this.checkData()},n).unref();return}this.intervalId=0}stopInterval(){this.intervalId!==0&&(clearInterval(this.intervalId),this.intervalId=0)}formatKey(n){return n.toString()}getExpirationTimestamp(n){if(typeof n=="string")return np(n);let t=Date.now(),o=n*1e3;return t+o}checkData(){for(let[n,t]of this.store.entries())t.ttl>0&&t.ttl{let a={resolve:i,reject:e,weight:t,priority:o},A=Pne(this._queue,r=>o<=r.priority);A===-1&&t<=this._value?this._dispatchItem(a):this._queue.splice(A+1,0,a)})}runExclusive(t){return B8e(this,arguments,void 0,function*(o,i=1,e=0){let[a,A]=yield this.acquire(i,e);try{return yield o(a)}finally{A()}})}waitForUnlock(t=1,o=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,o)?Promise.resolve():new Promise(i=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),f8e(this._weightedWaiters[t-1],{resolve:i,priority:o})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){let o=this._value;this._value-=t.weight,t.resolve([o,this._newReleaser(t.weight)])}_newReleaser(t){let o=!1;return()=>{o||(o=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){let o=this._weightedWaiters[t-1];o&&(o.forEach(i=>i.resolve()),this._weightedWaiters[t-1]=[])}else{let t=this._queue[0].priority;for(let o=this._value;o>0;o--){let i=this._weightedWaiters[o-1];if(!i)continue;let e=i.findIndex(a=>a.priority<=t);(e===-1?i:i.splice(0,e)).forEach((a=>a.resolve()))}}}_couldLockImmediately(t,o){return(this._queue.length===0||this._queue[0].priorityt.priority<=i.priority);n.splice(o+1,0,t)}function Pne(n,t){for(let o=n.length-1;o>=0;o--)if(t(n[o]))return o;return-1}var Q8e=function(n,t,o,i){function e(a){return a instanceof o?a:new o(function(A){A(a)})}return new(o||(o=Promise))(function(a,A){function r(c){try{g(i.next(c))}catch(I){A(I)}}function s(c){try{g(i.throw(c))}catch(I){A(I)}}function g(c){c.done?a(c.value):e(c.value).then(r,s)}g((i=i.apply(n,t||[])).next())})},ec=class{constructor(t){this._semaphore=new kU(1,t)}acquire(){return Q8e(this,arguments,void 0,function*(t=0){let[,o]=yield this._semaphore.acquire(1,t);return o})}runExclusive(t,o=0){return this._semaphore.runExclusive(()=>t(),1,o)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};import{randomBytes as D8e}from"crypto";var PU=qe(Fne(),1);var GU=class n extends Error{name="TimeoutError";constructor(t,o){super(t,o),Error.captureStackTrace?.(this,n)}},Lne=n=>n.reason??new DOMException("This operation was aborted.","AbortError");function FU(n,t){let{milliseconds:o,fallback:i,message:e,customTimers:a={setTimeout,clearTimeout},signal:A}=t,r,s,c=new Promise((I,d)=>{if(typeof o!="number"||Math.sign(o)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(A?.aborted){d(Lne(A));return}if(A&&(s=()=>{d(Lne(A))},A.addEventListener("abort",s,{once:!0})),n.then(I,d),o===Number.POSITIVE_INFINITY)return;let B=new GU;r=a.setTimeout.call(void 0,()=>{if(i){try{I(i())}catch(f){d(f)}return}typeof n.cancel=="function"&&n.cancel(),e===!1?I():e instanceof Error?d(e):(B.message=e??`Promise timed out after ${o} milliseconds`,d(B))},o)}).finally(()=>{c.clear(),s&&A&&A.removeEventListener("abort",s)});return c.clear=()=>{a.clearTimeout.call(void 0,r),r=void 0},c}function LU(n,t,o){let i=0,e=n.length;for(;e>0;){let a=Math.trunc(e/2),A=i+a;o(n[A],t)<=0?(i=++A,e-=a+1):e=a}return i}var S8e=100,lE=class{#e=[];#A=0;enqueue(t,o){let{priority:i=0,id:e}=o??{},{size:a}=this,A={priority:i,id:e,run:t};if(a===0){this.#e.length=0,this.#A=0,this.#e.push(A);return}if(this.#e.at(-1).priority>=i){this.#e.push(A);return}this.#t();let r=LU(this.#e,A,(s,g)=>g.priority-s.priority);this.#e.splice(r,0,A)}setPriority(t,o){let i=this.#e.findIndex((a,A)=>A>=this.#A&&a.id===t);if(i===-1)throw new ReferenceError(`No promise function with the id "${t}" exists in the queue.`);let[e]=this.#e.splice(i,1);this.enqueue(e.run,{priority:o,id:t})}remove(t){let o=this.#e.findIndex((i,e)=>eS8e&&this.#A>this.#e.length/2&&this.#t(),t?.run}filter(t){let o=[];for(let i=this.#A;i=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);if(t.strict&&t.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(t.strict&&t.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#e=t.carryoverIntervalCount??t.carryoverConcurrencyCount??!1,this.#A=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#i=t.interval,this.#p=t.strict,this.#I=new t.queueClass,this.#d=t.queueClass,this.concurrency=t.concurrency,t.timeout!==void 0&&!(Number.isFinite(t.timeout)&&t.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);this.timeout=t.timeout,this.#u=t.autoStart===!1,this.#L()}#S(t){for(;this.#g=this.#i)this.#g++;else break}(this.#g>100&&this.#g>this.#c.length/2||this.#g===this.#c.length)&&(this.#c=this.#c.slice(this.#g),this.#g=0)}#y(t){this.#p?this.#c.push(t):this.#t++}#m(){this.#p?this.#c.length>this.#g&&this.#c.pop():this.#t>0&&this.#t--}#D(){return this.#c.length-this.#g}get#E(){return this.#A?!0:this.#p?this.#D()=this.#r){let i=this.#c[this.#g],e=this.#i-(t-i);return this.#R(e),!0}return!1}if(this.#n===void 0){let o=this.#a-t;if(o<0)this.#t=this.#e?this.#h:0;else return this.#R(o),!0}return!1}#R(t){this.#s===void 0&&(this.#s=setTimeout(()=>{this.#O()},t))}#_(){this.#n&&(clearInterval(this.#n),this.#n=void 0)}#G(){this.#s&&(clearTimeout(this.#s),this.#s=void 0)}#k(){if(this.#I.size===0){if(this.#_(),this.emit("empty"),this.#h===0){if(this.#G(),this.#p&&this.#g>0){let o=Date.now();this.#S(o)}this.emit("idle")}return!1}let t=!1;if(!this.#u){let o=Date.now(),i=!this.#w(o);if(this.#E&&this.#N){let e=this.#I.dequeue();this.#A||(this.#y(o),this.#v()),i&&this.#F(),this.emit("active"),e(),t=!0}}return t}#F(){this.#A||this.#n!==void 0||this.#p||(this.#n=setInterval(()=>{this.#P()},this.#i),this.#a=Date.now()+this.#i)}#P(){this.#p||(this.#n!==void 0&&(this.#t===0&&this.#h===0?this.#_():this.#a=Date.now()+this.#i),this.#t=this.#e?this.#h:0),this.#H(),this.#v()}#H(){for(;this.#k(););}get concurrency(){return this.#C}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#C=t,this.#H()}setPriority(t,o){if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${o}\` (${typeof o})`);this.#I.setPriority(t,o)}async add(t,o={}){if(o={timeout:this.timeout,...o,id:o.id??(this.#B++).toString()},o.timeout!==void 0&&!(Number.isFinite(o.timeout)&&o.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${o.timeout}\` (${typeof o.timeout})`);return new Promise((i,e)=>{let a=Symbol(`task-${o.id}`),A=()=>{},r=async()=>{A(),this.#h++,this.#f.set(a,{id:o.id,priority:o.priority??0,startTime:Date.now(),timeout:o.timeout});let g;try{try{o.signal?.throwIfAborted()}catch(d){throw this.#K(),this.#f.delete(a),d}let c=t({signal:o.signal});if(o.timeout!==void 0&&(c=FU(Promise.resolve(c),{milliseconds:o.timeout,message:`Task timed out after ${o.timeout}ms (queue has ${this.#h} running, ${this.#I.size} waiting)`})),o.signal){let{signal:d}=o;c=Promise.race([c,new Promise((B,f)=>{g=()=>{f(d.reason)},d.addEventListener("abort",g,{once:!0})})])}let I=await c;i(I),this.emit("completed",I)}catch(c){e(c),this.emit("error",c)}finally{g&&o.signal?.removeEventListener("abort",g),this.#f.delete(a),queueMicrotask(()=>{this.#T()})}};this.#I.enqueue(r,o);let s=()=>{if(this.#I instanceof lE){this.#I.remove(r);return}this.#I.remove?.(o.id)};if(o.signal){let{signal:g}=o,c=()=>{A(),s(),e(g.reason),this.#k(),this.emit("next")};if(A=()=>{g.removeEventListener("abort",c),this.#Q.delete(A)},g.aborted){c();return}g.addEventListener("abort",c,{once:!0}),this.#Q.add(A)}this.emit("add"),this.#k()})}async addAll(t,o){return Promise.all(t.map(async i=>this.add(i,o)))}start(){return this.#u?(this.#u=!1,this.#H(),this):this}pause(){this.#u=!0}clear(){for(let t of this.#Q)t();this.#I=new this.#d,this.#_(),this.#q(),this.emit("empty"),this.#h===0&&(this.#G(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#I.size!==0&&await this.#U("empty")}async onSizeLessThan(t){this.#I.sizethis.#I.size{let i=e=>{this.off("error",i),o(e)};this.on("error",i)})}async#U(t,o){let i=Array.isArray(t)?t:[t];return new Promise(e=>{let a=()=>{if(!(o&&!o())){for(let A of i)this.off(A,a);e()}};for(let A of i)this.on(A,a)})}get size(){return this.#I.size}sizeBy(t){return this.#I.filter(t).length}get pending(){return this.#h}get isPaused(){return this.#u}#L(){this.#A||(this.on("add",()=>{this.#I.size>0&&this.#v()}),this.on("next",()=>{this.#v()}))}#v(){this.#A||this.#o||(this.#o=!0,queueMicrotask(()=>{this.#o=!1,this.#q()}))}#K(){this.#A||(this.#m(),this.#v())}#q(){let t=this.#l;if(this.#A||this.#I.size===0){t&&(this.#l=!1,this.emit("rateLimitCleared"));return}let o;if(this.#p){let e=Date.now();this.#S(e),o=this.#D()}else o=this.#t;let i=o>=this.#r;i!==t&&(this.#l=i,this.emit(i?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#l}get isSaturated(){return this.#h===this.#C&&this.#I.size>0||this.isRateLimited&&this.#I.size>0}get runningTasks(){return[...this.#f.values()].map(t=>({...t,timeoutRemaining:t.timeout?Math.max(0,t.startTime+t.timeout-Date.now()):void 0}))}};var bb=class{constructor(t,o){this.store=t,this.logger=o,this.queues=new Map}getQueue(t){return this.queues.has(t)||this.queues.set(t,new sp({concurrency:1})),this.queues.get(t)}async processOperations(t,o,i,e,a){let A=t[o];if(A)return this.getQueue(o).add(async()=>{i[o]=i[o]||{},e[o]=e[o]||{};let r=[],s={};for(let g in A)A[g]===null?r.push(g):s[g]=A[g];Object.keys(s).length>0&&(Object.assign(i[o],s),Object.assign(e[o],s)),r.length>0&&await this.processDeletions(o,r,i,e,a)})}async processDeletions(t,o,i,e,a){if(a)for(let A of o)i[t]?.[A]?(i[t][A]=null,e[t][A]=null):this.logger.warn(`Skipping deletion of non-existent ${t} in transaction: ${A}`);else{let A=await this.store.get(t,o);for(let r of o)A[r]?(i[t][r]=null,e[t][r]=null):this.logger.warn(`Skipping deletion of non-existent ${t}: ${r}`)}}async validateDeletions(t,o){let i=t[o];if(i)return this.getQueue(o).add(async()=>{let e=Object.keys(i).filter(A=>i[A]===null);if(e.length===0)return;let a=await this.store.get(o,e);for(let A of e)a[A]||(this.logger.warn(`Skipping deletion of non-existent ${o}: ${A}`),delete t[o][A])})}};var Hne=(n,t,{maxCommitRetries:o,delayBetweenTriesMs:i})=>{let e=new w8e,a=new Map,A=new Map,r=new Map,s=new bb(n,t);function g(Q){return a.has(Q)||a.set(Q,new sp({concurrency:1})),a.get(Q)}function c(Q){return A.has(Q)||(A.set(Q,new ec),r.set(Q,0)),A.get(Q)}function I(Q){let y=r.get(Q)??0;r.set(Q,y+1)}function d(Q){let y=(r.get(Q)??1)-1;if(r.set(Q,y),y<=0){let m=A.get(Q);m&&!m.isLocked()&&(A.delete(Q),r.delete(Q))}}function B(){return!!e.getStore()}async function f(Q){if(Object.keys(Q).length===0){t.trace("no mutations in transaction");return}t.trace("committing transaction");for(let y=0;y{let m=e.getStore();if(!m)return n.get(Q,y);let T=m.cache[Q]||{},_=y.filter(K=>!(K in T));if(_.length>0){m.dbQueries++,t.trace({type:Q,count:_.length},"fetching missing keys in transaction");let K=await c(Q).runExclusive(()=>n.get(Q,_));m.cache[Q]=m.cache[Q]||{},Object.assign(m.cache[Q],K)}let R={};for(let K of y){let L=m.cache[Q]?.[K];L!=null&&(R[K]=L)}return R},set:async Q=>{let y=e.getStore();if(!y){let m=Object.keys(Q);for(let T of m){let _=T;_==="pre-key"&&await s.validateDeletions(Q,_)}await Promise.all(m.map(T=>g(T).add(async()=>{let _={[T]:Q[T]};await n.set(_)})));return}t.trace({types:Object.keys(Q)},"caching in transaction");for(let m in Q){let T=m;y.cache[T]=y.cache[T]||{},y.mutations[T]=y.mutations[T]||{},T==="pre-key"?await s.processOperations(Q,T,y.cache,y.mutations,!0):(Object.assign(y.cache[T],Q[T]),Object.assign(y.mutations[T],Q[T]))}},isInTransaction:B,transaction:async(Q,y)=>{if(e.getStore())return t.trace("reusing existing transaction context"),Q();let T=c(y);I(y);try{return await T.runExclusive(async()=>{let _={cache:{},mutations:{},dbQueries:0};t.trace("entering transaction");try{let R=await e.run(_,Q);return await f(_.mutations),t.trace({dbQueries:_.dbQueries},"transaction completed"),R}catch(R){throw t.error({error:R},"transaction failed, rolling back"),R}})}finally{d(y)}}}},Kne=n=>{let t=n.me?.id;if(!t)throw new Une.Boom("Cannot proceed: socket is not authenticated yet (creds.me.id is missing)",{statusCode:401});return t},xne=()=>{let n=Sr.generateKeyPair();return{noiseKey:Sr.generateKeyPair(),pairingEphemeralKeyPair:Sr.generateKeyPair(),signedIdentityKey:n,signedPreKey:dD(n,1),registrationId:K7(),advSecretKey:D8e(32).toString("base64"),processedHistoryMessages:[],nextPreKeyId:1,firstUnuploadedPreKeyId:1,accountSyncCounter:0,accountSettings:{unarchiveChats:!1},registered:!1,pairingCode:void 0,lastPropHash:void 0,routingInfo:void 0,additionalData:void 0}};import{mkdir as O8e,readFile as b8e,stat as M8e,unlink as _8e,writeFile as T8e}from"fs/promises";import{join as UU}from"path";var Yne=new Map,HU=n=>{let t=Yne.get(n);return t||(t=new ec,Yne.set(n,t)),t},jne=async n=>{let t=async(r,s)=>{let g=UU(n,a(s));return HU(g).acquire().then(async I=>{try{await T8e(g,JSON.stringify(r,RB.replacer))}finally{I()}})},o=async r=>{try{let s=UU(n,a(r));return await HU(s).acquire().then(async c=>{try{let I=await b8e(s,{encoding:"utf-8"});return JSON.parse(I,RB.reviver)}finally{c()}})}catch{return null}},i=async r=>{try{let s=UU(n,a(r));return HU(s).acquire().then(async c=>{try{await _8e(s)}catch{}finally{c()}})}catch{}},e=await M8e(n).catch(()=>{});if(e){if(!e.isDirectory())throw new Error(`found something that is not a directory at ${n}, either delete it or specify a different location`)}else await O8e(n,{recursive:!0});let a=r=>r?.replace(/\//g,"__")?.replace(/:/g,"-"),A=await o("creds.json")||xne();return{state:{creds:A,keys:{get:async(r,s)=>{let g={};return await Promise.all(s.map(async c=>{let I=await o(`${r}-${c}.json`);r==="app-state-sync-key"&&I&&(I=oe.Message.AppStateSyncKeyData.fromObject(I)),g[c]=I})),g},set:async r=>{let s=[];for(let g in r)for(let c in r[g]){let I=r[g][c],d=`${g}-${c}.json`;s.push(I?t(I,d):i(d))}await Promise.all(s)}}},saveCreds:async()=>t(A,"creds.json")}};var N8e=192,R8e=async(n,{thumbnailWidth:t,fetchOpts:o})=>{let i=await Bb(n,o);return await oU(i,t)},Jne=async(n,t={thumbnailWidth:N8e,fetchOpts:{timeout:3e3}})=>{try{let o=0,i=5,{getLinkPreview:e}=await import("link-preview-js"),a=n;!n.startsWith("https://")&&!n.startsWith("http://")&&(a="https://"+a);let A=await e(a,{...t.fetchOpts,followRedirects:"follow",handleRedirects:(r,s)=>{let g=new URL(r),c=new URL(s);return o>=i?!1:c.hostname===g.hostname||c.hostname==="www."+g.hostname||"www."+c.hostname===g.hostname?(o+=1,!0):!1},headers:t.fetchOpts?.headers});if(A&&"title"in A&&A.title){let[r]=A.images,s={"canonical-url":A.url,"matched-text":n,title:A.title,description:A.description,originalThumbnailUrl:r};if(t.uploadImage){let{imageMessage:g}=await _f({image:{url:r}},{upload:t.uploadImage,mediaTypeOverride:"thumbnail-link",options:t.fetchOpts});s.jpegThumbnail=g?.jpegThumbnail?Buffer.from(g.jpegThumbnail):void 0,s.highQualityThumbnail=g||void 0}else try{s.jpegThumbnail=r?(await R8e(r,t)).buffer:void 0}catch(g){t.logger?.debug({err:g.stack,url:a},"error in generating thumbnail")}return s}}catch(o){if(!o.message.includes("receive a valid"))throw o}};import x8e from"events";var xU=qe(Kr(),1);var k8e=/^1313555\d{4}$|^131655500\d{2}$/;function v8e(n){if(!n)return!1;let t=n.split("@")[0]??"";return t==="0"||k8e.test(t)||lh(n)?!1:!!(_t(n)||qA(n)||mr(n)||Ia(n)||n.endsWith("@c.us"))}var Mb=604800,P8e=4,SI="__index";async function _b(n){let o=(await n.get("tctoken",[SI]))[SI];if(!o?.token?.length)return[];try{let i=JSON.parse(Buffer.from(o.token).toString());return Array.isArray(i)?i.filter(e=>typeof e=="string"&&e.length>0&&e!==SI):[]}catch{return[]}}async function pE(n,t){let o=await _b(n),i=new Set(o);for(let e of t)e&&e!==SI&&i.add(e);return{[SI]:{token:Buffer.from(JSON.stringify([...i]))}}}function gp(n){if(n==null)return!0;let t=typeof n=="string"?parseInt(n):n;if(isNaN(t))return!0;let o=Math.floor(Date.now()/1e3),a=(Math.floor(o/Mb)-(P8e-1))*Mb;return ti}async function Xs(n,t){return qA(n)?n:await t(n)??n}async function Lf(n,t,o,i){return t?qA(n)?n:await o(n)??n:qA(n)&&i?await i(n)??n:n}async function KU({authState:n,jid:t,baseContent:o=[],getLIDForPN:i}){try{let e=await Xs(t,i),A=(await n.keys.get("tctoken",[e]))?.[e],r=A?.token,s=A?.timestamp;if(!r?.length||s===void 0||gp(s)){if(r){let g=A?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:A.senderTimestamp}:null;await n.keys.set({tctoken:{[e]:g}})}return o.length>0?o:void 0}return o.push({tag:"tctoken",attrs:{t:String(s)},content:r}),o}catch{return o.length>0?o:void 0}}async function dE({result:n,fallbackJid:t,keys:o,getLIDForPN:i,onNewJidStored:e}){let a=le(n,"tokens");if(!a)return;let A=PA(a,"token");for(let r of A){if(r.attrs.type!=="trusted_contact"||!(r.content instanceof Uint8Array))continue;let s=uA(t||r.attrs.jid);if(!v8e(s))continue;let g=await Xs(s,i),I=(await o.get("tctoken",[g]))[g],d=I?.timestamp?Number(I.timestamp):0,B=r.attrs.t?Number(r.attrs.t):0;B&&(d>0&&d>B||(await o.set({tctoken:{[g]:{...I,token:Buffer.from(r.content),timestamp:r.attrs.t}}}),e?.(g)))}}var G8e=new Set([RA.CALL_MISSED_GROUP_VIDEO,RA.CALL_MISSED_GROUP_VOICE,RA.CALL_MISSED_VIDEO,RA.CALL_MISSED_VOICE]),F8e=new Set([RA.GROUP_PARTICIPANT_ADD]);async function L8e(n,t,o,i){let e=t.lidMapping.getLIDForPN.bind(t.lidMapping),a=[];for(let g of n){let c=g.tcTokenTimestamp?Yr(g.tcTokenTimestamp):0;if(g.tcToken?.length&&c>0){let I=uA(g.id),d=await Xs(I,e);a.push({storageJid:d,token:Buffer.from(g.tcToken),ts:c,senderTs:g.tcTokenSenderTimestamp?Yr(g.tcTokenSenderTimestamp):void 0})}}if(!a.length)return;let A=a.map(g=>g.storageJid),r=await o.get("tctoken",A),s={};for(let g of a){let c=r[g.storageJid],I=c?.timestamp?Number(c.timestamp):0;I>0&&I>=g.ts||(s[g.storageJid]={...c,token:g.token,timestamp:String(g.ts),...g.senderTs!==void 0?{senderTimestamp:g.senderTs}:{}})}if(Object.keys(s).length){i?.debug({count:Object.keys(s).length},"storing tctokens from history sync");try{let g=await pE(o,Object.keys(s));await o.set({tctoken:{...s,...g}})}catch(g){i?.warn({err:g},"failed to store tctokens from history sync")}}}var zne=(n,t,o)=>{mr(n.key.remoteJid)||Ia(n.key.remoteJid)?n.key.remoteJid=yr(fA(n.key?.remoteJid)?.user,mr(n.key.remoteJid)?"s.whatsapp.net":"lid"):n.key.remoteJid=uA(n.key.remoteJid),mr(n.key.participant)||Ia(n.key.participant)?n.key.participant=yr(fA(n.key.participant)?.user,mr(n.key.participant)?"s.whatsapp.net":"lid"):n.key.participant=uA(n.key.participant);let i=Na(n.message);i?.reactionMessage&&e(i.reactionMessage.key),i?.pollUpdateMessage&&e(i.pollUpdateMessage.pollCreationMessageKey);function e(a){n.key.fromMe||(a.fromMe=a.fromMe?!1:Nt(a.participant||a.remoteJid,t)||Nt(a.participant||a.remoteJid,o),a.remoteJid=n.key.remoteJid,a.participant=a.participant||n.key.participant)}},YU=n=>{let t=Na(n.message),o=!!Tf(t);return(!!t||G8e.has(n.messageStubType)||F8e.has(n.messageStubType))&&o&&!t?.protocolMessage&&!t?.reactionMessage&&!t?.pollUpdateMessage},jU=n=>!n.key.fromMe&&!n.messageStubType,U8e=({remoteJid:n,participant:t,fromMe:o})=>{if(!n)throw new xU.Boom("Cannot derive chat id: message key is missing remoteJid",{data:{remoteJid:n,participant:t,fromMe:o}});if(SB(n)&&!Lg(n)&&!o){if(!t)throw new xU.Boom("Cannot derive chat id: broadcast message key is missing participant",{data:{remoteJid:n,fromMe:o}});return t}return n};function H8e({encPayload:n,encIv:t},{eventCreatorJid:o,eventMsgId:i,eventEncKey:e,responderJid:a}){let A=Buffer.concat([I(i),I(o),I(a),I("Event Response"),new Uint8Array([1])]),r=Hn(e,new Uint8Array(32),"sha256"),s=Hn(A,r,"sha256"),g=I(`${i}\0${a}`),c=Gl(n,s,t,g);return oe.Message.EventResponseMessage.decode(c);function I(d){return Buffer.from(d)}}var K8e=async(n,{shouldProcessHistoryMsg:t,placeholderResendCache:o,ev:i,creds:e,signalRepository:a,keyStore:A,logger:r,options:s,getMessage:g})=>{let c=e.me.id,{accountSettings:I}=e,d={id:uA(U8e(n.key))},B=YU(n);B&&(d.messages=[{message:n}],d.conversationTimestamp=Yr(n.messageTimestamp),jU(n)&&(d.unreadCount=(d.unreadCount||0)+1));let f=Na(n.message);(B||f?.reactionMessage?.key?.fromMe)&&I?.unarchiveChats&&(d.archived=!1,d.readOnly=!1);let Q=f?.protocolMessage;if(Q){let y=new Set([oe.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION,oe.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE,oe.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC,oe.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE]);if(Q.type!==null&&Q.type!==void 0&&y.has(Q.type)&&!n.key.fromMe){r?.warn({msgId:n.key.id,type:Q.type,from:n.key.participant||n.key.remoteJid},"dropping spoofed self-only protocolMessage from non-self origin");return}switch(Q.type){case oe.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION:let m=Q.historySyncNotification,T=t,_=!e.processedHistoryMessages?.length;if(r?.info({histNotification:m,process:T,id:n.key.id,isLatest:_},"got history notification"),T){m.syncType!==oe.HistorySync.HistorySyncType.ON_DEMAND&&i.emit("creds.update",{processedHistoryMessages:[...e.processedHistoryMessages||[],{key:n.key,messageTimestamp:n.messageTimestamp}]});let G=await Cne(m,s,r);G.lidPnMappings?.length&&(r?.debug({count:G.lidPnMappings.length},"processing LID-PN mappings from history sync"),await a.lidMapping.storeLIDPNMappings(G.lidPnMappings).catch(J=>r?.warn({err:J},"failed to store LID-PN mappings from history sync"))),await L8e(G.chats,a,A,r),i.emit("messaging-history.set",{...G,isLatest:m.syncType!==oe.HistorySync.HistorySyncType.ON_DEMAND?_:void 0,chunkOrder:m.chunkOrder,peerDataRequestSessionId:m.peerDataRequestSessionId})}break;case oe.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE:let R=Q.appStateSyncKeyShare.keys;if(R?.length){let G="";await A.transaction(async()=>{let J=[];for(let{keyData:U,keyId:N}of R){let k=Buffer.from(N.keyId).toString("base64");J.push(k),await A.set({"app-state-sync-key":{[k]:U}}),G=k}r?.info({newAppStateSyncKeyId:G,newKeys:J},"injecting new app state sync keys")},c),i.emit("creds.update",{myAppStateKeyId:G})}else r?.info({protocolMsg:Q},"recv app state sync with 0 keys");break;case oe.Message.ProtocolMessage.Type.REVOKE:i.emit("messages.update",[{key:{...n.key,id:Q.key.id},update:{message:null,messageStubType:RA.REVOKE,key:n.key}}]);break;case oe.Message.ProtocolMessage.Type.EPHEMERAL_SETTING:Object.assign(d,{ephemeralSettingTimestamp:Yr(n.messageTimestamp),ephemeralExpiration:Q.ephemeralExpiration||null});break;case oe.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:let K=Q.peerDataOperationRequestResponseMessage;if(K){let G=K.peerDataOperationResult||[];for(let J of G){let U=J?.placeholderMessageResendResponse;if(U?.webMessageInfoBytes)try{let N=oe.WebMessageInfo.decode(U.webMessageInfoBytes),k=N.key?.id,z=k?await o?.get(k):void 0;k&&await o?.del(k);let Ae;z&&typeof z=="object"?(z.message=N.message,N.messageTimestamp&&(z.messageTimestamp=N.messageTimestamp),Ae=z):Ae=N,r?.debug({msgId:k,requestId:K.stanzaId},"received placeholder resend"),i.emit("messages.upsert",{messages:[Ae],type:"notify",requestId:K.stanzaId})}catch(N){r?.warn({err:N,stanzaId:K.stanzaId},"failed to decode placeholder resend response")}}}break;case oe.Message.ProtocolMessage.Type.MESSAGE_EDIT:i.emit("messages.update",[{key:{...n.key,id:Q.key?.id},update:{message:{editedMessage:{message:Q.editedMessage}},messageTimestamp:Q.timestampMs?Math.floor(Yr(Q.timestampMs)/1e3):n.messageTimestamp}}]);break;case oe.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE:let L=Q.memberLabel;L?.label&&i.emit("group.member-tag.update",{groupId:d.id,label:L.label,participant:n.key.participant,participantAlt:n.key.participantAlt,messageTimestamp:Number(n.messageTimestamp)});break;case oe.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC:let F=Q.lidMigrationMappingSyncMessage?.encodedMappingPayload,{pnToLidMappings:q,chatDbMigrationTimestamp:V}=oe.LIDMigrationMappingSyncPayload.decode(F);r?.debug({pnToLidMappings:q,chatDbMigrationTimestamp:V},"got lid mappings and chat db migration timestamp");let x=[];for(let{pn:G,latestLid:J,assignedLid:U}of q){let N=J||U;x.push({lid:`${N}@lid`,pn:`${G}@s.whatsapp.net`})}if(await a.lidMapping.storeLIDPNMappings(x),x.length)for(let{pn:G,lid:J}of x)await a.migrateSession(G,J)}}else if(f?.reactionMessage){let y={...f.reactionMessage,key:n.key};i.emit("messages.reaction",[{reaction:y,key:f.reactionMessage?.key}])}else if(f?.encEventResponseMessage){let y=f.encEventResponseMessage,m=y.eventCreationMessageKey,T=await g(m);if(T)try{let _=uA(c),R=m.participant||m.remoteJid,K=qA(R)?await a.lidMapping.getPNForLID(R):R,L=uh({remoteJid:uA(K),fromMe:_===K},_),F=uh(n.key,_),q=T?.messageContextInfo?.messageSecret;if(!q)r?.warn({creationMsgKey:m},"event response: missing messageSecret for decryption");else{let V=H8e(y,{eventEncKey:q,eventCreatorJid:L,eventMsgId:m.id,responderJid:F}),x={eventResponseMessageKey:n.key,senderTimestampMs:V.timestampMs,response:V};i.emit("messages.update",[{key:m,update:{eventResponses:[x]}}])}}catch(_){r?.warn({err:_,creationMsgKey:m},"failed to decrypt event response")}else r?.warn({creationMsgKey:m},"event creation message not found, cannot decrypt response")}else if(n.messageStubType){let y=n.key?.remoteJid,m,T=L=>i.emit("group-participants.update",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participants:m,action:L}),_=L=>{i.emit("groups.update",[{id:y,...L,author:n.key.participant??void 0,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername}])},R=(L,F,q)=>{i.emit("group.join-request",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participant:L.lid,participantPn:L.pn,action:F,method:q})},K=()=>m.find(L=>Nt(c,L.phoneNumber));switch(n.messageStubType){case RA.GROUP_PARTICIPANT_CHANGE_NUMBER:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("modify");break;case RA.GROUP_PARTICIPANT_LEAVE:case RA.GROUP_PARTICIPANT_REMOVE:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("remove"),K()&&(d.readOnly=!0);break;case RA.GROUP_PARTICIPANT_ADD:case RA.GROUP_PARTICIPANT_INVITE:case RA.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],K()&&(d.readOnly=!1),T("add");break;case RA.GROUP_PARTICIPANT_DEMOTE:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("demote");break;case RA.GROUP_PARTICIPANT_PROMOTE:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("promote");break;case RA.GROUP_CHANGE_ANNOUNCE:let L=n.messageStubParameters?.[0];_({announce:L==="true"||L==="on"});break;case RA.GROUP_CHANGE_RESTRICT:let F=n.messageStubParameters?.[0];_({restrict:F==="true"||F==="on"});break;case RA.GROUP_CHANGE_SUBJECT:let q=n.messageStubParameters?.[0];d.name=q,_({subject:q});break;case RA.GROUP_CHANGE_DESCRIPTION:let V=n.messageStubParameters?.[0];d.description=V,_({desc:V});break;case RA.GROUP_CHANGE_INVITE_LINK:let x=n.messageStubParameters?.[0];_({inviteCode:x});break;case RA.GROUP_MEMBER_ADD_MODE:let G=n.messageStubParameters?.[0];_({memberAddMode:G==="all_member_add"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:let J=n.messageStubParameters?.[0];_({joinApprovalMode:J==="on"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:let U=JSON.parse(n.messageStubParameters?.[0]),N=n.messageStubParameters?.[1],k=n.messageStubParameters?.[2];R(U,N,k);break}}Object.keys(d).length>1&&i.emit("chats.update",[d])},Vne=K8e;var Y8e=["messaging-history.set","chats.upsert","chats.update","chats.delete","contacts.upsert","contacts.update","messages.upsert","messages.update","messages.delete","messages.reaction","message-receipt.update","groups.update"],j8e=new Set(Y8e),Wne=n=>{let t=new x8e,o=new Set,i=JU(),e=!1,a=null,A=null,r=0,s=1e4,g=3e4;t.on("event",d=>{for(let B in d)t.emit(B,d[B])});function c(){e||(n.debug("Event buffer activated"),e=!0,r=0,a&&clearTimeout(a),a=setTimeout(()=>{e&&(n.warn("Buffer timeout reached, auto-flushing"),I())},g)),r++}function I(){if(!e)return!1;n.debug({bufferCount:r},"Flushing event buffer"),e=!1,r=0,a&&(clearTimeout(a),a=null),A&&(clearTimeout(A),A=null),o.size>s&&(n.debug({cacheSize:o.size},"Clearing history cache"),o.clear());let d=JU(),B=Object.values(i.chatUpdates),f=0;for(let y of B)y.conditional&&(f+=1,d.chatUpdates[y.id]=y,delete i.chatUpdates[y.id]);let Q=q8e(i);return Object.keys(Q).length&&t.emit("event",Q),i=d,n.trace({conditionalChatUpdatesLeft:f},"released buffered events"),!0}return{process(d){let B=async f=>{await d(f)};return t.on("event",B),()=>{t.off("event",B)}},emit(d,B){if(d==="messages.upsert"){let{type:f}=B,Q=Object.values(i.messageUpserts);if(Q.length>0){let y=Q[0].type;y!==f&&(n.debug({bufferedType:y,newType:f},"messages.upsert type mismatch, emitting buffered messages"),t.emit("event",{"messages.upsert":{messages:Q.map(m=>m.message),type:y}}),i.messageUpserts={})}}return e&&j8e.has(d)?(J8e(i,o,d,B,n),!0):t.emit("event",{[d]:B})},isBuffering(){return e},buffer:c,flush:I,createBufferedFunction(d){return async(...B)=>{c();try{let f=await d(...B);return r===1&&setTimeout(()=>{e&&r===1&&I()},100),f}catch(f){throw f}finally{r=Math.max(0,r-1),r===0&&(A||(A=setTimeout(I,100)))}}},on:(...d)=>t.on(...d),off:(...d)=>t.off(...d),removeAllListeners:(...d)=>t.removeAllListeners(...d),destroy(){a&&(clearTimeout(a),a=null),A&&(clearTimeout(A),A=null),o.clear(),i=JU(),e=!1,r=0,t.removeAllListeners(),n.debug("Event buffer destroyed")}}},JU=()=>({historySets:{chats:{},messages:{},contacts:{},isLatest:!1,empty:!0},chatUpserts:{},chatUpdates:{},chatDeletes:new Set,contactUpserts:{},contactUpdates:{},messageUpserts:{},messageUpdates:{},messageReactions:{},messageDeletes:{},messageReceipts:{},groupUpdates:{}});function J8e(n,t,o,i,e){switch(o){case"messaging-history.set":for(let Q of i.chats){let y=Q.id||"",m=n.historySets.chats[y];m&&(m.endOfHistoryTransferType=Q.endOfHistoryTransferType),!m&&!t.has(y)&&(n.historySets.chats[y]=Q,t.add(y),a(Q))}for(let Q of i.contacts){let y=n.historySets.contacts[Q.id];if(y)Object.assign(y,CD(Q));else{let m=`c:${Q.id}`,T=Q.notify||Q.name||Q.verifiedName;(!t.has(m)||T)&&(n.historySets.contacts[Q.id]=Q,t.add(m))}}for(let Q of i.messages){let y=hE(Q.key);!n.historySets.messages[y]&&!t.has(y)&&(n.historySets.messages[y]=Q,t.add(y))}if(n.historySets.empty=!1,n.historySets.syncType=i.syncType,i.pastParticipants?.length){let Q=new Map,y=T=>`${T.userJid||""}:${T.leaveTs||""}:${T.leaveReason||""}`,m=T=>{let _=T.groupJid??JSON.stringify(T),R=Q.get(_);if(!R){Q.set(_,{...T,pastParticipants:[...T.pastParticipants||[]]});return}let K=new Set((R.pastParticipants||[]).map(y));for(let L of T.pastParticipants||[]){let F=y(L);K.has(F)||(R.pastParticipants.push(L),K.add(F))}};for(let T of n.historySets.pastParticipants||[])m(T);for(let T of i.pastParticipants)m(T);n.historySets.pastParticipants=[...Q.values()]}n.historySets.progress=i.progress,n.historySets.chunkOrder=i.chunkOrder,n.historySets.peerDataRequestSessionId=i.peerDataRequestSessionId,n.historySets.isLatest=i.isLatest||n.historySets.isLatest;break;case"chats.upsert":for(let Q of i){let y=Q.id||"",m=n.chatUpserts[y];y&&!m&&(m=n.historySets.chats[y],m&&e.debug({chatId:y},"absorbed chat upsert in chat set")),m?m=Tb(m,Q):(m=Q,n.chatUpserts[y]=m),a(m),n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.update":for(let Q of i){let y=Q.id,m=Q.conditional?Q.conditional(n):!0;if(m){delete Q.conditional;let T=n.historySets.chats[y]||n.chatUpserts[y];if(T)Tb(T,Q);else{let _=n.chatUpdates[y]||{};n.chatUpdates[y]=Tb(_,Q)}}else m===void 0&&(n.chatUpdates[y]=Q);n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.delete":for(let Q of i)n.chatDeletes.has(Q)||n.chatDeletes.add(Q),n.chatUpdates[Q]&&delete n.chatUpdates[Q],n.chatUpserts[Q]&&delete n.chatUpserts[Q],n.historySets.chats[Q]&&delete n.historySets.chats[Q];break;case"contacts.upsert":for(let Q of i){let y=n.contactUpserts[Q.id];y||(y=n.historySets.contacts[Q.id],y&&e.debug({contactId:Q.id},"absorbed contact upsert in contact set")),y?y=Object.assign(y,CD(Q)):(y=Q,n.contactUpserts[Q.id]=y),n.contactUpdates[Q.id]&&(y=Object.assign(n.contactUpdates[Q.id],CD(Q)),delete n.contactUpdates[Q.id])}break;case"contacts.update":let r=i;for(let Q of r){let y=Q.id,m=n.historySets.contacts[y]||n.contactUpserts[y];if(m)Object.assign(m,Q);else{let T=n.contactUpdates[y]||{};n.contactUpdates[y]=Object.assign(T,Q)}}break;case"messages.upsert":let{messages:s,type:g}=i;for(let Q of s){let y=hE(Q.key),m=n.messageUpserts[y]?.message;m||(m=n.historySets.messages[y],m&&e.debug({messageId:y},"absorbed message upsert in message set")),m&&(Q.messageTimestamp=m.messageTimestamp),n.messageUpdates[y]&&(e.debug("absorbed prior message update in message upsert"),Object.assign(Q,n.messageUpdates[y].update),delete n.messageUpdates[y]),n.historySets.messages[y]?n.historySets.messages[y]=Q:n.messageUpserts[y]={message:Q,type:g==="notify"||n.messageUpserts[y]?.type==="notify"?"notify":g}}break;case"messages.update":let c=i;for(let{key:Q,update:y}of c){let m=hE(Q),T=n.historySets.messages[m]||n.messageUpserts[m]?.message;if(T)Object.assign(T,y),y.status===Ih.READ&&!Q.fromMe&&A(T);else{let _=n.messageUpdates[m]||{key:Q,update:{}};Object.assign(_.update,y),n.messageUpdates[m]=_}}break;case"messages.delete":let I=i;if("keys"in I){let{keys:Q}=I;for(let y of Q){let m=hE(y);n.messageDeletes[m]||(n.messageDeletes[m]=y),n.messageUpserts[m]&&delete n.messageUpserts[m],n.messageUpdates[m]&&delete n.messageUpdates[m]}}break;case"messages.reaction":let d=i;for(let{key:Q,reaction:y}of d){let m=hE(Q),T=n.messageUpserts[m];T?dU(T.message,y):(n.messageReactions[m]=n.messageReactions[m]||{key:Q,reactions:[]},dU(n.messageReactions[m],y))}break;case"message-receipt.update":let B=i;for(let{key:Q,receipt:y}of B){let m=hE(Q),T=n.messageUpserts[m];T?pU(T.message,y):(n.messageReceipts[m]=n.messageReceipts[m]||{key:Q,userReceipt:[]},pU(n.messageReceipts[m],y))}break;case"groups.update":let f=i;for(let Q of f){let y=Q.id,m=n.groupUpdates[y]||{};n.groupUpdates[y]||(n.groupUpdates[y]=Object.assign(m,Q))}break;default:throw new Error(`"${o}" cannot be buffered`)}function a(r){let s=r.id||"",g=n.chatUpdates[s];if(g){let c=g.conditional?g.conditional(n):!0;c?(delete g.conditional,e.debug({chatId:s},"absorbed chat update in existing chat"),Object.assign(r,Tb(g,r)),delete n.chatUpdates[s]):c===!1&&(e.debug({chatId:s},"chat update condition fail, removing"),delete n.chatUpdates[s])}}function A(r){let s=r.key.remoteJid,g=n.chatUpdates[s]||n.chatUpserts[s];YU(r)&&jU(r)&&typeof g?.unreadCount=="number"&&g.unreadCount>0&&(e.debug({chatId:g.id},"decrementing chat counter"),g.unreadCount-=1,g.unreadCount===0&&delete g.unreadCount)}}function q8e(n){let t={};n.historySets.empty||(t["messaging-history.set"]={chats:Object.values(n.historySets.chats),messages:Object.values(n.historySets.messages),contacts:Object.values(n.historySets.contacts),pastParticipants:n.historySets.pastParticipants,syncType:n.historySets.syncType,progress:n.historySets.progress,isLatest:n.historySets.isLatest,chunkOrder:n.historySets.chunkOrder,peerDataRequestSessionId:n.historySets.peerDataRequestSessionId});let o=Object.values(n.chatUpserts);o.length&&(t["chats.upsert"]=o);let i=Object.values(n.chatUpdates);i.length&&(t["chats.update"]=i);let e=Array.from(n.chatDeletes);e.length&&(t["chats.delete"]=e);let a=Object.values(n.messageUpserts);if(a.length){let B=a[0].type;t["messages.upsert"]={messages:a.map(f=>f.message),type:B}}let A=Object.values(n.messageUpdates);A.length&&(t["messages.update"]=A);let r=Object.values(n.messageDeletes);r.length&&(t["messages.delete"]={keys:r});let s=Object.values(n.messageReactions).flatMap(({key:B,reactions:f})=>f.flatMap(Q=>({key:B,reaction:Q})));s.length&&(t["messages.reaction"]=s);let g=Object.values(n.messageReceipts).flatMap(({key:B,userReceipt:f})=>f.flatMap(Q=>({key:B,receipt:Q})));g.length&&(t["message-receipt.update"]=g);let c=Object.values(n.contactUpserts);c.length&&(t["contacts.upsert"]=c);let I=Object.values(n.contactUpdates);I.length&&(t["contacts.update"]=I);let d=Object.values(n.groupUpdates);return d.length&&(t["groups.update"]=d),t}function Tb(n,t){return t.unreadCount===null&&n.unreadCount<0&&(n.unreadCount=void 0,t.unreadCount=void 0),typeof n.unreadCount=="number"&&typeof t.unreadCount=="number"&&(t={...t},t.unreadCount>=0&&(t.unreadCount=Math.max(t.unreadCount,0)+Math.max(n.unreadCount,0))),Object.assign(n,t)}var hE=n=>`${n.remoteJid},${n.id},${n.fromMe?"1":"0"}`;var z8e=512,qU="\0",Zne=3600*1e3,V8e=3e3,Ac;(function(n){n[n.UnknownError=0]="UnknownError",n[n.SignalErrorNoSession=1]="SignalErrorNoSession",n[n.SignalErrorInvalidKey=2]="SignalErrorInvalidKey",n[n.SignalErrorInvalidKeyId=3]="SignalErrorInvalidKeyId",n[n.SignalErrorInvalidMessage=4]="SignalErrorInvalidMessage",n[n.SignalErrorInvalidSignature=5]="SignalErrorInvalidSignature",n[n.SignalErrorFutureMessage=6]="SignalErrorFutureMessage",n[n.SignalErrorBadMac=7]="SignalErrorBadMac",n[n.SignalErrorInvalidSession=8]="SignalErrorInvalidSession",n[n.SignalErrorInvalidMsgKey=9]="SignalErrorInvalidMsgKey",n[n.BadBroadcastEphemeralSetting=10]="BadBroadcastEphemeralSetting",n[n.UnknownCompanionNoPrekey=11]="UnknownCompanionNoPrekey",n[n.AdvFailure=12]="AdvFailure",n[n.StatusRevokeDelay=13]="StatusRevokeDelay"})(Ac||(Ac={}));var Xne=new Set([Ac.SignalErrorInvalidMessage,Ac.SignalErrorBadMac]),Nb=class{constructor(t,o){this.logger=t,this.recentMessagesMap=new Gg({max:z8e,ttl:300*1e3,ttlAutopurge:!0,dispose:(i,e)=>{let a=e.lastIndexOf(qU);if(a>-1){let A=e.slice(a+qU.length);this.messageKeyIndex.delete(A)}}}),this.messageKeyIndex=new Map,this.sessionRecreateHistory=new Gg({ttl:Zne*2,ttlAutopurge:!0}),this.retryCounters=new Gg({ttl:900*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),this.baseKeys=new Gg({max:1024,ttl:900*1e3,ttlAutopurge:!0}),this.pendingPhoneRequests={},this.maxMsgRetryCount=5,this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0},this.maxMsgRetryCount=o}addRecentMessage(t,o,i){let e={to:t,id:o},a=this.keyToString(e);this.recentMessagesMap.set(a,{message:i,timestamp:Date.now()}),this.messageKeyIndex.set(o,a),this.logger.debug(`Added message to retry cache: ${t}/${o}`)}getRecentMessage(t,o){let i={to:t,id:o},e=this.keyToString(i);return this.recentMessagesMap.get(e)}shouldRecreateSession(t,o,i){if(!o)return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,{reason:"we don't have a Signal session with them",recreate:!0};if(i!==void 0&&Xne.has(i))return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,this.logger.warn({jid:t,errorCode:Ac[i]},"MAC error detected, forcing immediate session recreation"),{reason:`MAC error (code ${i}: ${Ac[i]}), immediate session recreation`,recreate:!0};let e=Date.now(),a=this.sessionRecreateHistory.get(t);return!a||e-a>Zne?(this.sessionRecreateHistory.set(t,e),this.statistics.sessionRecreations++,{reason:"retry count > 1 and over an hour since last recreation",recreate:!0}):{reason:"",recreate:!1}}parseRetryErrorCode(t){if(t===void 0||t==="")return;let o=parseInt(t,10);if(!Number.isNaN(o))return o>=Ac.UnknownError&&o<=Ac.StatusRevokeDelay?o:Ac.UnknownError}isMacError(t){return t!==void 0&&Xne.has(t)}incrementRetryCount(t){return this.retryCounters.set(t,(this.retryCounters.get(t)||0)+1),this.statistics.totalRetries++,this.retryCounters.get(t)}getRetryCount(t){return this.retryCounters.get(t)||0}hasExceededMaxRetries(t){return this.getRetryCount(t)>=this.maxMsgRetryCount}markRetrySuccess(t){this.statistics.successfulRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}markRetryFailed(t){this.statistics.failedRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}schedulePhoneRequest(t,o,i=V8e){this.cancelPendingPhoneRequest(t),this.pendingPhoneRequests[t]=setTimeout(()=>{delete this.pendingPhoneRequests[t],this.statistics.phoneRequests++,o()},i),this.logger.debug(`Scheduled phone request for message ${t} with ${i}ms delay`)}cancelPendingPhoneRequest(t){let o=this.pendingPhoneRequests[t];o&&(clearTimeout(o),delete this.pendingPhoneRequests[t],this.logger.debug(`Cancelled pending phone request for message ${t}`))}clear(){this.recentMessagesMap.clear(),this.messageKeyIndex.clear(),this.sessionRecreateHistory.clear(),this.retryCounters.clear(),this.baseKeys.clear();for(let t of Object.keys(this.pendingPhoneRequests))this.cancelPendingPhoneRequest(t);this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0}}saveBaseKey(t,o,i){this.baseKeys.set(`${t}:${o}`,i)}hasSameBaseKey(t,o,i){let e=this.baseKeys.get(`${t}:${o}`);if(!e||e.length!==i.length)return!1;for(let a=0;a["Ubuntu",n,"22.04.4"],macOS:n=>["Mac OS",n,"14.4.1"],baileys:n=>["Baileys",n,"6.5.0"],windows:n=>["Windows",n,"10.0.22631"],android:n=>[n,"Android",""],appropriate:n=>[X8e[W8e()]||"Ubuntu",n,Z8e()]};var Yn;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.CHROME=1]="CHROME",n[n.EDGE=2]="EDGE",n[n.FIREFOX=3]="FIREFOX",n[n.IE=4]="IE",n[n.OPERA=5]="OPERA",n[n.SAFARI=6]="SAFARI",n[n.ELECTRON=7]="ELECTRON",n[n.UWP=8]="UWP",n[n.OTHER_WEB_CLIENT=9]="OTHER_WEB_CLIENT"})(Yn||(Yn={}));var $8e={Chrome:Yn.CHROME,Edge:Yn.EDGE,Firefox:Yn.FIREFOX,IE:Yn.IE,Opera:Yn.OPERA,Safari:Yn.SAFARI},eze=([n,t])=>t==="Desktop"?n==="Windows"?Yn.UWP:Yn.ELECTRON:$8e[t]||Yn.OTHER_WEB_CLIENT,zU=n=>eze(n).toString(),$ne=(n,t,o,i,e)=>"https://wa.me/settings/linked_devices#"+[n,t,o,i,zU(e)].join(",");async function ese(n,t){let o=n.attrs.from;if(!o)return{action:"invalid_notification"};if(!le(n,"identity"))return{action:"no_identity_node"};t.logger.info({jid:o},"identity changed");let e=fA(o);if(e?.device&&e.device!==0)return t.logger.debug({jid:o,device:e.device},"ignoring identity change from companion device"),{action:"skipped_companion_device",device:e.device};if(t.meId&&(Nt(o,t.meId)||t.meLid&&Nt(o,t.meLid)))return t.logger.info({jid:o},"self primary identity changed"),{action:"skipped_self_primary"};if(t.debounceCache.get(o))return t.logger.debug({jid:o},"skipping identity assert (debounced)"),{action:"debounced"};t.debounceCache.set(o,!0);let A=!L7(n.attrs.offline);if(!(await t.validateSession(o)).exists)return t.logger.debug({jid:o},"no old session, skipping session refresh"),{action:"skipped_no_session"};if(t.logger.debug({jid:o},"old session exists, will refresh session"),A)return t.logger.debug({jid:o},"skipping session refresh during offline processing"),{action:"skipped_offline"};t.onBeforeSessionRefresh?.(o);try{return await t.assertSessions([o],!0),{action:"session_refreshed"}}catch(s){return t.logger.warn({error:s,jid:o},"failed to assert sessions after identity change"),{action:"session_refresh_failed",error:s}}}function Ase(n,t,o){let{tag:i,attrs:e}=n,a={tag:"ack",attrs:{id:e.id,to:e.from,class:i}};return t&&(a.attrs.error=t.toString()),e.participant&&(a.attrs.participant=e.participant),e.recipient&&(a.attrs.recipient=e.recipient),e.type&&(a.attrs.type=e.type),i==="message"&&o&&(a.attrs.from=o),a}function Aze(n){return n===null||n===""}function tze(n){return n>2147483647||n<-2147483648?n&4294967295:n}function tse(n){let t=0;if(!Aze(n))for(let o=0;oo.iteration===t)}addSenderMessageKey(t){this.senderKeyStateStructure.senderMessageKeys.push({iteration:t.getIteration(),seed:t.getSeed()}),this.senderKeyStateStructure.senderMessageKeys.length>this.MAX_MESSAGE_KEYS&&this.senderKeyStateStructure.senderMessageKeys.shift()}removeSenderMessageKey(t){let o=this.senderKeyStateStructure.senderMessageKeys.findIndex(i=>i.iteration===t);if(o!==-1){let i=this.senderKeyStateStructure.senderMessageKeys[o];return this.senderKeyStateStructure.senderMessageKeys.splice(o,1),new cp(i.iteration,i.seed)}return null}getStructure(){return this.senderKeyStateStructure}};var tc=class n{constructor(t){if(this.MAX_STATES=5,this.senderKeyStates=[],t)for(let o of t)this.senderKeyStates.push(new Ip(null,null,null,null,null,null,o))}isEmpty(){return this.senderKeyStates.length===0}getSenderKeyState(t){return t===void 0&&this.senderKeyStates.length?this.senderKeyStates[this.senderKeyStates.length-1]:this.senderKeyStates.find(o=>o.getKeyId()===t)}addSenderKeyState(t,o,i,e){this.senderKeyStates.push(new Ip(t,o,i,null,e)),this.senderKeyStates.length>this.MAX_STATES&&this.senderKeyStates.shift()}setSenderKeyState(t,o,i,e){this.senderKeyStates.length=0,this.senderKeyStates.push(new Ip(t,o,i,e))}serialize(){return this.senderKeyStates.map(t=>t.getStructure())}static deserialize(t){let o=Buffer.from(t).toString("utf-8"),i=JSON.parse(o,RB.reviver);return new n(i)}};var ise=qe(xc(),1);import*as kb from"crypto";function ose(){return kb.randomBytes(32)}function nse(){return kb.randomInt(2147483647)}function sse(n){return n||(n=(0,ise.generateKeyPair)()),{public:Buffer.from(n.pubKey),private:Buffer.from(n.privKey)}}var lp=class{constructor(){this.UNSUPPORTED_VERSION=1,this.CURRENT_VERSION=3,this.WHISPER_TYPE=2,this.PREKEY_TYPE=3,this.SENDERKEY_TYPE=4,this.SENDERKEY_DISTRIBUTION_TYPE=5,this.ENCRYPTED_MESSAGE_OVERHEAD=53}};var pp=class extends lp{constructor(t,o,i,e,a){if(super(),a)try{let A=a.slice(1),r=oe.SenderKeyDistributionMessage.decode(A).toJSON();this.serialized=a,this.id=r.id,this.iteration=r.iteration,this.chainKey=typeof r.chainKey=="string"?Buffer.from(r.chainKey,"base64"):r.chainKey,this.signatureKey=typeof r.signingKey=="string"?Buffer.from(r.signingKey,"base64"):r.signingKey}catch(A){throw new Error(String(A))}else{let A=this.intsToByteHighAndLow(this.CURRENT_VERSION,this.CURRENT_VERSION);this.id=t,this.iteration=o,this.chainKey=i,this.signatureKey=e;let r=oe.SenderKeyDistributionMessage.encode(oe.SenderKeyDistributionMessage.create({id:t,iteration:o,chainKey:i,signingKey:this.signatureKey})).finish();this.serialized=Buffer.concat([Buffer.from([A]),r])}}intsToByteHighAndLow(t,o){return((t<<4|o)&255)%256}serialize(){return this.serialized}getType(){return this.SENDERKEY_DISTRIBUTION_TYPE}getIteration(){return this.iteration}getChainKey(){return this.chainKey}getSignatureKey(){return this.signatureKey}getId(){return this.id}};var EE=class{constructor(t){this.senderKeyStore=t}async process(t,o){let i=await this.senderKeyStore.loadSenderKey(t);i.addSenderKeyState(o.getId(),o.getIteration(),o.getChainKey(),o.getSignatureKey()),await this.senderKeyStore.storeSenderKey(t,i)}async create(t){let o=await this.senderKeyStore.loadSenderKey(t);if(o.isEmpty()){let e=nse(),a=ose(),A=sse();o.setSenderKeyState(e,0,a,A),await this.senderKeyStore.storeSenderKey(t,o)}let i=o.getSenderKeyState();if(!i)throw new Error("No session state available");return new pp(i.getKeyId(),i.getSenderChainKey().getIteration(),i.getSenderChainKey().getSeed(),i.getSigningKeyPublic())}};var Pb=qe(Nl(),1);var vb=qe(xc(),1);var CE=class extends lp{constructor(t,o,i,e,a){if(super(),this.SIGNATURE_LENGTH=64,a){let A=a[0],r=a.slice(1,a.length-this.SIGNATURE_LENGTH),s=a.slice(-1*this.SIGNATURE_LENGTH),g=oe.SenderKeyMessage.decode(r).toJSON();this.serialized=a,this.messageVersion=(A&255)>>4,this.keyId=g.id,this.iteration=g.iteration,this.ciphertext=typeof g.ciphertext=="string"?Buffer.from(g.ciphertext,"base64"):g.ciphertext,this.signature=s}else{let A=((this.CURRENT_VERSION<<4|this.CURRENT_VERSION)&255)%256,r=Buffer.from(i),s=oe.SenderKeyMessage.encode(oe.SenderKeyMessage.create({id:t,iteration:o,ciphertext:r})).finish(),g=this.getSignature(e,Buffer.concat([Buffer.from([A]),s]));this.serialized=Buffer.concat([Buffer.from([A]),s,Buffer.from(g)]),this.messageVersion=this.CURRENT_VERSION,this.keyId=t,this.iteration=o,this.ciphertext=r,this.signature=g}}getKeyId(){return this.keyId}getIteration(){return this.iteration}getCipherText(){return this.ciphertext}verifySignature(t){let o=this.serialized.slice(0,this.serialized.length-this.SIGNATURE_LENGTH),i=this.serialized.slice(-1*this.SIGNATURE_LENGTH);if(!(0,vb.verifySignature)(t,o,i))throw new Error("Invalid signature!")}getSignature(t,o){return Buffer.from((0,vb.calculateSignature)(t,o))}serialize(){return this.serialized}getType(){return 4}};var uE=class{constructor(t,o){this.senderKeyStore=t,this.senderKeyName=o}async encrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for encryption");let i=o.getSenderKeyState();if(!i)throw new Error("No session to encrypt message");let e=i.getSenderChainKey().getIteration(),a=this.getSenderKey(i,e===0?0:e+1),A=await this.getCipherText(a.getIv(),a.getCipherKey(),t),r=new CE(i.getKeyId(),a.getIteration(),A,i.getSigningKeyPrivate());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),r.serialize()}async decrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for decryption");let i=new CE(null,null,null,null,t),e=o.getSenderKeyState(i.getKeyId());if(!e)throw new Error("No session found to decrypt message");i.verifySignature(e.getSigningKeyPublic());let a=this.getSenderKey(e,i.getIteration()),A=await this.getPlainText(a.getIv(),a.getCipherKey(),i.getCipherText());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),A}getSenderKey(t,o){let i=t.getSenderChainKey();if(i.getIteration()>o){if(t.hasSenderMessageKey(o)){let e=t.removeSenderMessageKey(o);if(!e)throw new Error("No sender message key found for iteration");return e}throw new Error(`Received message with old counter: ${i.getIteration()}, ${o}`)}if(o-i.getIteration()>2e3)throw new Error("Over 2000 messages into the future!");for(;i.getIteration()0){let r=[...i];this.logger.trace(`Batch fetching ${r.length} LID mappings from database`);let s=await this.keys.get("lid-mapping",r);for(let g of r){let c=s[g];c&&(e.set(g,c),this.mappingCache.set(`pn:${g}`,c),this.mappingCache.set(`lid:${c}`,g))}}let a={};for(let{pnUser:r,lidUser:s}of o){if(e.get(r)===s){this.logger.debug({pnUser:r,lidUser:s},"LID mapping already exists, skipping");continue}a[r]=s}if(Object.keys(a).length===0)return;this.logger.trace({pairMap:a},`Storing ${Object.keys(a).length} pn mappings`);let A={};for(let[r,s]of Object.entries(a))A[r]=s,A[`${s}_reverse`]=r;await this.keys.transaction(async()=>{await this.keys.set({"lid-mapping":A})},"lid-mapping");for(let[r,s]of Object.entries(a))this.mappingCache.set(`pn:${r}`,s),this.mappingCache.set(`lid:${s}`,r)}async getLIDForPN(t){return(await this.getLIDsForPNs([t]))?.[0]?.lid||null}async getLIDsForPNs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),i=o.join(","),e=this.inflightLIDLookups.get(i);if(e)return this.logger.trace(`Coalescing getLIDsForPNs request for ${o.length} PNs`),e;let a=this._getLIDsForPNsImpl(t);this.inflightLIDLookups.set(i,a);try{return await a}finally{this.inflightLIDLookups.delete(i)}}async _getLIDsForPNsImpl(t){let o={},i={},e=[],a=(A,r,s)=>{let g=s.toString();if(!g)return this.logger.warn(`Invalid or empty LID user for PN ${A}: lidUser = "${s}"`),!1;let c=r.device!==void 0?r.device:0,I=`${g}${c?`:${c}`:""}@${r.server==="hosted"?"hosted.lid":"lid"}`;return this.logger.trace(`getLIDForPN: ${A} \u2192 ${I} (user mapping with device ${c})`),i[A]={lid:I,pn:A},!0};for(let A of t){if(!_t(A)&&!mr(A))continue;let r=fA(A);if(!r)continue;let s=r.user,g=this.mappingCache.get(`pn:${s}`);if(g&&typeof g=="string"){if(!a(A,r,g)){this.logger.warn(`Invalid entry for ${A} (pair not resolved)`);continue}continue}e.push({pn:A,pnUser:s,decoded:r})}if(e.length){let A=[...new Set(e.map(s=>s.pnUser))],r=await this.keys.get("lid-mapping",A);for(let s of A){let g=r[s];g&&typeof g=="string"&&(this.mappingCache.set(`pn:${s}`,g),this.mappingCache.set(`lid:${g}`,s))}for(let{pn:s,pnUser:g,decoded:c}of e){let I=this.mappingCache.get(`pn:${g}`);if(I&&typeof I=="string"){if(!a(s,c,I)){this.logger.warn(`Invalid entry for ${s} (pair not resolved)`);continue}}else{this.logger.trace(`No LID mapping found for PN user ${g}; batch getting from USync`);let d=c.device||0,B=uA(s);mr(B)&&(B=`${g}@s.whatsapp.net`),o[B]?o[B]?.push(d):o[B]=[d]}}}if(Object.keys(o).length>0){let A=await this.pnToLIDFunc?.(Object.keys(o));if(A&&A.length>0){await this.storeLIDPNMappings(A);for(let r of A){let g=fA(r.pn)?.user;if(!g)continue;let c=fA(r.lid)?.user;if(c)for(let I of o[r.pn]){let d=`${c}${I?`:${I}`:""}@${I===99?"hosted.lid":"lid"}`;this.logger.trace(`getLIDForPN: USYNC success for ${r.pn} \u2192 ${d} (user mapping with device ${I})`);let B=`${g}${I?`:${I}`:""}@${I===99?"hosted":"s.whatsapp.net"}`;i[B]={lid:d,pn:B}}}}else this.logger.warn("USync fetch yielded no results for pending PNs")}return Object.values(i).length>0?Object.values(i):null}async getPNForLID(t){return(await this.getPNsForLIDs([t]))?.[0]?.pn||null}async getPNsForLIDs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),i=o.join(","),e=this.inflightPNLookups.get(i);if(e)return this.logger.trace(`Coalescing getPNsForLIDs request for ${o.length} LIDs`),e;let a=this._getPNsForLIDsImpl(t);this.inflightPNLookups.set(i,a);try{return await a}finally{this.inflightPNLookups.delete(i)}}async _getPNsForLIDsImpl(t){let o={},i=[],e=(a,A,r)=>{if(!r||typeof r!="string")return!1;let s=A.device!==void 0?A.device:0,g=`${r}:${s}@${A.domainType===Jt.HOSTED_LID?"hosted":"s.whatsapp.net"}`;return this.logger.trace(`Found reverse mapping: ${a} \u2192 ${g}`),o[a]={lid:a,pn:g},!0};for(let a of t){if(!qA(a))continue;let A=fA(a);if(!A)continue;let r=A.user,s=this.mappingCache.get(`lid:${r}`);if(s&&typeof s=="string"){e(a,A,s);continue}i.push({lid:a,lidUser:r,decoded:A})}if(i.length){let a=[...new Set(i.map(r=>`${r.lidUser}_reverse`))],A=await this.keys.get("lid-mapping",a);for(let{lid:r,lidUser:s,decoded:g}of i){let c=this.mappingCache.get(`lid:${s}`);(!c||typeof c!="string")&&(c=A[`${s}_reverse`],c&&typeof c=="string"&&(this.mappingCache.set(`lid:${s}`,c),this.mappingCache.set(`pn:${c}`,s))),c&&typeof c=="string"?e(r,g,c):this.logger.trace(`No reverse mapping found for LID user: ${s}`)}}return Object.values(o).length?Object.values(o):null}close(){this.mappingCache.clear()}};function rze(n){try{if(!n||n.length<2||(n[0]&15)!==3)return;let o=cse.PreKeyWhisperMessage.decode(n.slice(1));return o.identityKey?.length===33?new Uint8Array(o.identityKey):void 0}catch{return}}function Ise(n,t,o){let i=new Gb(n.keys,t,o),e=aze(n,i),a=n.keys,A=new Gg({ttl:4320*60*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),r=async(g,c)=>{let I=Fb(g,c),d=I.toString(),{[d]:B}=await n.keys.get("sender-key",[d]);B||await e.storeSenderKey(I,new tc);let f=await new EE(e).create(I);return{senderName:I,skdm:f}};return{decryptGroupMessage({group:g,authorJid:c,msg:I}){let d=Fb(g,c),B=new uE(e,d);return a.transaction(async()=>B.decrypt(I),g)},async processSenderKeyDistributionMessage({item:g,authorJid:c}){let I=new EE(e);if(!g.groupId)throw new Error("Group ID is required for sender key distribution message");let d=Fb(g.groupId,c),B=new pp(null,null,null,null,g.axolotlSenderKeyDistributionMessage),f=d.toString(),{[f]:Q}=await n.keys.get("sender-key",[f]);return Q||await e.storeSenderKey(d,new tc),a.transaction(async()=>{let{[f]:y}=await n.keys.get("sender-key",[f]);y||await e.storeSenderKey(d,new tc),await I.process(d,B)},g.groupId)},async decryptMessage({jid:g,type:c,ciphertext:I}){let d=jn(g),B=new $s.SessionCipher(e,d);if(c==="pkmsg"){let Q=rze(I);if(Q){let y=d.toString();await e.saveIdentity(y,Q)&&t.info({jid:g,addr:y},"identity key changed or new contact, session will be re-established")}}async function f(){let Q;switch(c){case"pkmsg":Q=await B.decryptPreKeyWhisperMessage(I);break;case"msg":Q=await B.decryptWhisperMessage(I);break}return Q}return a.transaction(async()=>await f(),g)},async encryptMessage({jid:g,data:c}){let I=jn(g),d=new $s.SessionCipher(e,I);return a.transaction(async()=>{let{type:B,body:f}=await d.encrypt(c);return{type:B===3?"pkmsg":"msg",ciphertext:Buffer.from(f,"binary")}},g)},async encryptGroupMessage({group:g,meId:c,data:I}){return a.transaction(async()=>{let{senderName:d,skdm:B}=await r(g,c);return{ciphertext:await new uE(e,d).encrypt(I),senderKeyDistributionMessage:B.serialize()}},g)},async getSenderKeyDistributionMessage({group:g,meId:c}){return a.transaction(async()=>{let{skdm:I}=await r(g,c);return I.serialize()},g)},async hasSenderKey({group:g,meId:c}){let I=Fb(g,c).toString(),{[I]:d}=await n.keys.get("sender-key",[I]);return!!d},async getSessionInfo(g){let c=jn(g).toString(),I=await e.loadSession(c);if(!I)return null;let d=I.getOpenSession?.(),B=d?.indexInfo?.baseKey,f=d?.registrationId;return!B||typeof f!="number"?null:{baseKey:new Uint8Array(B),registrationId:f}},async injectE2ESession({jid:g,session:c}){t.trace({jid:g},"injecting E2EE session");let I=new $s.SessionBuilder(e,jn(g));return a.transaction(async()=>{await I.initOutgoing(c)},g)},jidToSignalProtocolAddress(g){return jn(g).toString()},lidMapping:i,async validateSession(g){try{let c=jn(g),I=await e.loadSession(c.toString());return I?I.haveOpenSession()?{exists:!0}:{exists:!1,reason:"no open session"}:{exists:!1,reason:"no session"}}catch{return{exists:!1,reason:"validation error"}}},async deleteSession(g){if(!g.length)return;let c={};return g.forEach(I=>{let d=jn(I);c[d.toString()]=null}),a.transaction(async()=>{await n.keys.set({session:c})},`delete-${g.length}-sessions`)},close(){A.clear(),i.close()},async migrateSession(g,c){if(!g||!qA(c)&&!Ia(c))return{migrated:0,skipped:0,total:0};if(!_t(g)&&!mr(g))return{migrated:0,skipped:0,total:1};let{user:I}=fA(g);t.debug({fromJid:g},"bulk device migration - loading all user devices");let{[I]:d}=await a.get("device-list",[I]);if(!d)return{migrated:0,skipped:0,total:0};let{device:B}=fA(g),f=B?.toString()||"0";d.includes(f)||d.push(f);let y=d.filter(_=>{let R=`${I}.${_}`;return!A.has(R)}).map(_=>`${I}.${_}`),m=await a.get("session",y),T=[];for(let[_,R]of Object.entries(m))if(R){let K=_.split(".")[1];if(!K)continue;let L=parseInt(K),F=L===0?`${I}@s.whatsapp.net`:`${I}:${L}@s.whatsapp.net`;L===99&&(F=`${I}:99@hosted`),T.push(F)}return t.debug({fromJid:g,totalDevices:d.length,devicesWithSessions:T.length,devices:T},"bulk device migration complete - all user devices processed"),a.transaction(async()=>{let _=T.map(x=>{let G=s7(x,c),J=fA(x),U=fA(G);return{fromJid:x,toJid:G,pnUser:J.user,lidUser:U.user,deviceId:J.device||0,fromAddr:jn(x),toAddr:jn(G)}}),R=_.length,K=0,L=Array.from(new Set(_.map(x=>x.fromAddr.toString()))),F=await a.get("session",L),q={};for(let x of _){let G=x.fromAddr.toString(),J=x.toAddr.toString(),U=F[G];if(U){let N=$s.SessionRecord.deserialize(U);N.haveOpenSession()&&(q[J]=N.serialize(),q[G]=null,K++)}}if(Object.keys(q).length>0){await a.set({session:q}),t.debug({migratedSessions:K},"bulk session migration complete");for(let x of _)if(q[x.toAddr.toString()]){let G=`${x.pnUser}.${x.deviceId}`;A.set(G,!0)}}let V=R-K;return{migrated:K,skipped:V,total:R}},`migrate-${T.length}-sessions-${fA(c)?.user}`)}}}var jn=n=>{let t=fA(n),{user:o,device:i,server:e,domainType:a}=t;if(!o)throw new Error(`JID decoded but user is empty: "${n}" -> user: "${o}", server: "${e}", device: ${i}`);let A=a!==Jt.WHATSAPP?`${o}_${a}`:o,r=i||0;if(i===99&&t.server!=="hosted"&&t.server!=="hosted.lid")throw new Error("Unexpected non-hosted device JID with device 99. This ID seems invalid. ID:"+n);return new $s.ProtocolAddress(A,r)},Fb=(n,t)=>new Uf(n,jn(t));function aze({creds:n,keys:t},o){let i=async e=>{if(e.includes(".")){let[a,A]=e.split("."),[r,s]=a.split("_"),g=parseInt(s||"0");if(g===Jt.LID||g===Jt.HOSTED_LID)return e;let c=`${r}${A!=="0"?`:${A}`:""}@${g===Jt.HOSTED?"hosted":"s.whatsapp.net"}`,I=await o.getLIDForPN(c);if(I)return jn(I).toString()}return e};return{loadSession:async e=>{try{let a=await i(e),{[a]:A}=await t.get("session",[a]);if(A)return $s.SessionRecord.deserialize(A)}catch{return null}return null},storeSession:async(e,a)=>{let A=await i(e);await t.set({session:{[A]:a.serialize()}})},isTrustedIdentity:()=>!0,loadIdentityKey:async e=>{let a=await i(e),{[a]:A}=await t.get("identity-key",[a]);return A||void 0},saveIdentity:async(e,a)=>{let A=await i(e),{[A]:r}=await t.get("identity-key",[A]),s=r?.length===a.length&&r.every((g,c)=>g===a[c]);return r&&!s?(await t.set({session:{[A]:null},"identity-key":{[A]:a}}),!0):r?!1:(await t.set({"identity-key":{[A]:a}}),!0)},loadPreKey:async e=>{let a=e.toString(),{[a]:A}=await t.get("pre-key",[a]);if(A)return{privKey:Buffer.from(A.private),pubKey:Buffer.from(A.public)}},removePreKey:e=>t.set({"pre-key":{[e]:null}}),loadSignedPreKey:()=>{let e=n.signedPreKey;return{privKey:Buffer.from(e.keyPair.private),pubKey:Buffer.from(e.keyPair.public)}},loadSenderKey:async e=>{let a=e.toString(),{[a]:A}=await t.get("sender-key",[a]);return A?tc.deserialize(A):new tc},storeSenderKey:async(e,a)=>{let A=e.toString(),r=JSON.stringify(a.serialize());await t.set({"sender-key":{[A]:Buffer.from(r,"utf-8")}})},getOurRegistrationId:()=>n.registrationId,getOurIdentity:()=>{let{signedIdentityKey:e}=n;return{privKey:Buffer.from(e.private),pubKey:Buffer.from(Vo(e.public))}}}}var pce=qe(lce(),1),Jf=(0,pce.default)({timestamp:()=>`,"time":"${new Date().toJSON()}"`});var R5e=[2,3e3,1043857760];var Mf="https://web.whatsapp.com",Woe="https://call.whatsapp.com/video/",Zoe="https://call.whatsapp.com/voice/",mE="CB:",dce="TAG:";var cne=Buffer.from([6,0]),Ine=Buffer.from([6,1]),BU=Buffer.from([6,5]),lvA=Buffer.from([6,6]),Nf=10080*60,hce=1440*60,Ece=336*60*60,Ene="Noise_XX_25519_AESGCM_SHA256\0\0\0\0",k5e=3,Hg=Buffer.from([5]),Cce=Buffer.from([87,65,6,k5e]),Xoe=/https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g,QU={SERIAL:0,ISSUER:"WhatsAppLongTerm1",PUBLIC_KEY:Buffer.from("142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b","hex")},qf=[oe.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,oe.HistorySync.HistorySyncType.PUSH_NAME,oe.HistorySync.HistorySyncType.RECENT,oe.HistorySync.HistorySyncType.FULL,oe.HistorySync.HistorySyncType.ON_DEMAND,oe.HistorySync.HistorySyncType.NON_BLOCKING_DATA,oe.HistorySync.HistorySyncType.INITIAL_STATUS_V3],mI={SIGNAL_STORE:300,MSG_RETRY:3600,CALL_OFFER:300,USER_DEVICES:300},uce={version:R5e,browser:Rb.macOS("Chrome"),waWebSocketUrl:"wss://web.whatsapp.com/ws/chat",connectTimeoutMs:2e4,keepAliveIntervalMs:3e4,logger:Jf.child({class:"baileys"}),emitOwnEvents:!0,defaultQueryTimeoutMs:6e4,customUploadHosts:[],retryRequestDelayMs:250,maxMsgRetryCount:5,fireInitQueries:!0,auth:void 0,markOnlineOnConnect:!0,syncFullHistory:!0,patchMessageBeforeSending:n=>n,shouldSyncHistoryMessage:({syncType:n})=>n!==oe.HistorySync.HistorySyncType.FULL,shouldIgnoreJid:()=>!1,linkPreviewImageThumbnailWidth:192,transactionOpts:{maxCommitRetries:10,delayBetweenTriesMs:3e3},generateHighQualityLinkPreview:!1,enableAutoSessionRecreation:!0,enableRecentMessageCache:!0,options:{},appStateMacVerification:{patch:!1,snapshot:!1},countryCode:"US",getMessage:async()=>{},cachedGroupMetadata:async()=>{},makeSignalRepository:Ise},gU={image:"/mms/image",video:"/mms/video",document:"/mms/document",audio:"/mms/audio",sticker:"/mms/image","thumbnail-link":"/mms/image","product-catalog-image":"/product/image","md-app-state":"","md-msg-hist":"/mms/md-app-state","biz-cover-photo":"/pps/biz-cover-photo"},Loe={audio:"Audio",document:"Document",gif:"Video",image:"Image",ppic:"",product:"Image",ptt:"Audio",sticker:"Image",video:"Video","thumbnail-document":"Document Thumbnail","thumbnail-image":"Image Thumbnail","thumbnail-video":"Video Thumbnail","thumbnail-link":"Link Thumbnail","md-msg-hist":"History","md-app-state":"App State","product-catalog-image":"","payment-bg-image":"Payment Background",ptv:"Video","biz-cover-photo":"Image"},$oe=Object.keys(gU),Bce=12e4,zf=5,fce=812,Qce=3e4,HH={Minute:60*1e3,Hour:3600*1e3,Day:1440*60*1e3,Week:10080*60*1e3};var yce=qe(Kr(),1);import{createHash as v5e}from"crypto";import{createWriteStream as P5e,promises as G5e}from"fs";import{tmpdir as F5e}from"os";import{join as L5e}from"path";var mce=n=>{let t=le(n,"product_catalog"),o=PA(t,"product").map(Vf),i=le(t,"paging");return{products:o,nextPageCursor:i?jA(i,"after"):void 0}},Sce=n=>{let t=le(n,"collections");return{collections:PA(t,"collection").map(i=>{let e=jA(i,"id"),a=jA(i,"name"),A=PA(i,"product").map(Vf);return{id:e,name:a,products:A,status:K5e(i)}})}},wce=n=>{let t=le(n,"order"),o=PA(t,"product").map(a=>{let A=le(a,"image");return{id:jA(a,"id"),name:jA(a,"name"),imageUrl:jA(A,"url"),price:+jA(a,"price"),currency:jA(a,"currency"),quantity:+jA(a,"quantity")}}),i=le(t,"price");return{price:{total:+jA(i,"total"),currency:jA(i,"currency")},products:o}},KH=(n,t)=>{let o={},i=[];return typeof n<"u"&&i.push({tag:"id",attrs:{},content:Buffer.from(n)}),typeof t.name<"u"&&i.push({tag:"name",attrs:{},content:Buffer.from(t.name)}),typeof t.description<"u"&&i.push({tag:"description",attrs:{},content:Buffer.from(t.description)}),typeof t.retailerId<"u"&&i.push({tag:"retailer_id",attrs:{},content:Buffer.from(t.retailerId)}),t.images.length&&i.push({tag:"media",attrs:{},content:t.images.map(a=>{if(!("url"in a))throw new yce.Boom("Expected img for product to already be uploaded",{statusCode:400});return{tag:"image",attrs:{},content:[{tag:"url",attrs:{},content:Buffer.from(a.url.toString())}]}})}),typeof t.price<"u"&&i.push({tag:"price",attrs:{},content:Buffer.from(t.price.toString())}),typeof t.currency<"u"&&i.push({tag:"currency",attrs:{},content:Buffer.from(t.currency)}),"originCountryCode"in t&&(typeof t.originCountryCode>"u"?o.compliance_category="COUNTRY_ORIGIN_EXEMPT":i.push({tag:"compliance_info",attrs:{},content:[{tag:"country_code_origin",attrs:{},content:Buffer.from(t.originCountryCode)}]})),typeof t.isHidden<"u"&&(o.is_hidden=t.isHidden.toString()),{tag:"product",attrs:o,content:i}},Vf=n=>{let t=n.attrs.is_hidden==="true",o=jA(n,"id"),i=le(n,"media"),e=le(n,"status_info");return{id:o,imageUrls:H5e(i),reviewStatus:{whatsapp:jA(e,"status")},availability:"in stock",name:jA(n,"name"),retailerId:jA(n,"retailer_id"),url:jA(n,"url"),description:jA(n,"description"),price:+jA(n,"price"),currency:jA(n,"currency"),isHidden:t}};async function xH(n,t,o=3e4){return n={...n,images:n.images?await U5e(n.images,t,o):n.images},n}var U5e=async(n,t,o=3e4)=>await Promise.all(n.map(async e=>{if("url"in e){let I=e.url.toString();if(I.includes(".whatsapp.net"))return{url:I}}let{stream:a}=await Of(e),A=v5e("sha256"),r=L5e(F5e(),"img"+jr()),s=P5e(r);for await(let I of a)A.update(I),s.write(I);let g=A.digest("base64"),{directPath:c}=await t(r,{mediaType:"product-catalog-image",fileEncSha256B64:g,timeoutMs:o});return await G5e.unlink(r).catch(I=>console.log("Error deleting temp file ",I)),{url:bf(c)}})),H5e=n=>{let t=le(n,"image");return{requested:jA(t,"request_image_url"),original:jA(t,"original_image_url")}},K5e=n=>{let t=le(n,"status_info");return{status:jA(t,"status"),canAppeal:jA(t,"can_appeal")==="true"}};var Zf=qe(Kr(),1);import{randomBytes as VH}from"crypto";var cn=null;try{cn=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function vt(n,t,o){this.low=n|0,this.high=t|0,this.unsigned=!!o}vt.prototype.__isLong__;Object.defineProperty(vt.prototype,"__isLong__",{value:!0});function oi(n){return(n&&n.__isLong__)===!0}function Dce(n){var t=Math.clz32(n&-n);return n?31-t:t}vt.isLong=oi;var Oce={},bce={};function up(n,t){var o,i,e;return t?(n>>>=0,(e=0<=n&&n<256)&&(i=bce[n],i)?i:(o=yt(n,0,!0),e&&(bce[n]=o),o)):(n|=0,(e=-128<=n&&n<128)&&(i=Oce[n],i)?i:(o=yt(n,n<0?-1:0,!1),e&&(Oce[n]=o),o))}vt.fromInt=up;function In(n,t){if(isNaN(n))return t?rc:zn;if(t){if(n<0)return rc;if(n>=Nce)return vce}else{if(n<=-_ce)return Xi;if(n+1>=_ce)return kce}return n<0?In(-n,t).neg():yt(n%wE|0,n/wE|0,t)}vt.fromNumber=In;function yt(n,t,o){return new vt(n,t,o)}vt.fromBits=yt;var oM=Math.pow;function jH(n,t,o){if(n.length===0)throw Error("empty string");if(typeof t=="number"?(o=t,t=!1):t=!!t,n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return t?rc:zn;if(o=o||10,o<2||360)throw Error("interior hyphen");if(i===0)return jH(n.substring(1),t,o).neg();for(var e=In(oM(o,8)),a=zn,A=0;A>>0:this.low};He.toNumber=function(){return this.unsigned?(this.high>>>0)*wE+(this.low>>>0):this.high*wE+(this.low>>>0)};He.toString=function(t){if(t=t||10,t<2||36>>0,c=g.toString(t);if(A=s,A.isZero())return c+r;for(;c.length<6;)c="0"+c;r=""+c+r}};He.getHighBits=function(){return this.high};He.getHighBitsUnsigned=function(){return this.high>>>0};He.getLowBits=function(){return this.low};He.getLowBitsUnsigned=function(){return this.low>>>0};He.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Xi)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,o=31;o>0&&(t&1<>21;return t?this.unsigned?!1:t===-1&&!(this.low===0&&this.high===-2097152):!0};He.isZero=function(){return this.high===0&&this.low===0};He.eqz=He.isZero;He.isNegative=function(){return!this.unsigned&&this.high<0};He.isPositive=function(){return this.unsigned||this.high>=0};He.isOdd=function(){return(this.low&1)===1};He.isEven=function(){return(this.low&1)===0};He.equals=function(t){return oi(t)||(t=ln(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};He.eq=He.equals;He.notEquals=function(t){return!this.eq(t)};He.neq=He.notEquals;He.ne=He.notEquals;He.lessThan=function(t){return this.comp(t)<0};He.lt=He.lessThan;He.lessThanOrEqual=function(t){return this.comp(t)<=0};He.lte=He.lessThanOrEqual;He.le=He.lessThanOrEqual;He.greaterThan=function(t){return this.comp(t)>0};He.gt=He.greaterThan;He.greaterThanOrEqual=function(t){return this.comp(t)>=0};He.gte=He.greaterThanOrEqual;He.ge=He.greaterThanOrEqual;He.compare=function(t){if(oi(t)||(t=ln(t)),this.eq(t))return 0;var o=this.isNegative(),i=t.isNegative();return o&&!i?-1:!o&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};He.comp=He.compare;He.negate=function(){return!this.unsigned&&this.eq(Xi)?Xi:this.not().add(SE)};He.neg=He.negate;He.add=function(t){oi(t)||(t=ln(t));var o=this.high>>>16,i=this.high&65535,e=this.low>>>16,a=this.low&65535,A=t.high>>>16,r=t.high&65535,s=t.low>>>16,g=t.low&65535,c=0,I=0,d=0,B=0;return B+=a+g,d+=B>>>16,B&=65535,d+=e+s,I+=d>>>16,d&=65535,I+=i+r,c+=I>>>16,I&=65535,c+=o+A,c&=65535,yt(d<<16|B,c<<16|I,this.unsigned)};He.subtract=function(t){return oi(t)||(t=ln(t)),this.add(t.neg())};He.sub=He.subtract;He.multiply=function(t){if(this.isZero())return this;if(oi(t)||(t=ln(t)),cn){var o=cn.mul(this.low,this.high,t.low,t.high);return yt(o,cn.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?rc:zn;if(this.eq(Xi))return t.isOdd()?Xi:zn;if(t.eq(Xi))return this.isOdd()?Xi:zn;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(Tce)&&t.lt(Tce))return In(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,e=this.high&65535,a=this.low>>>16,A=this.low&65535,r=t.high>>>16,s=t.high&65535,g=t.low>>>16,c=t.low&65535,I=0,d=0,B=0,f=0;return f+=A*c,B+=f>>>16,f&=65535,B+=a*c,d+=B>>>16,B&=65535,B+=A*g,d+=B>>>16,B&=65535,d+=e*c,I+=d>>>16,d&=65535,d+=a*g,I+=d>>>16,d&=65535,d+=A*s,I+=d>>>16,d&=65535,I+=i*c+e*g+a*s+A*r,I&=65535,yt(B<<16|f,I<<16|d,this.unsigned)};He.mul=He.multiply;He.divide=function(t){if(oi(t)||(t=ln(t)),t.isZero())throw Error("division by zero");if(cn){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var o=(this.unsigned?cn.div_u:cn.div_s)(this.low,this.high,t.low,t.high);return yt(o,cn.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?rc:zn;var i,e,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return rc;if(t.gt(this.shru(1)))return Rce;a=rc}else{if(this.eq(Xi)){if(t.eq(SE)||t.eq(YH))return Xi;if(t.eq(Xi))return SE;var A=this.shr(1);return i=A.div(t).shl(1),i.eq(zn)?t.isNegative()?SE:YH:(e=this.sub(t.mul(i)),a=i.add(e.div(t)),a)}else if(t.eq(Xi))return this.unsigned?rc:zn;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=zn}for(e=this;e.gte(t);){i=Math.max(1,Math.floor(e.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(i)/Math.LN2),s=r<=48?1:oM(2,r-48),g=In(i),c=g.mul(t);c.isNegative()||c.gt(e);)i-=s,g=In(i,this.unsigned),c=g.mul(t);g.isZero()&&(g=SE),a=a.add(g),e=e.sub(c)}return a};He.div=He.divide;He.modulo=function(t){if(oi(t)||(t=ln(t)),cn){var o=(this.unsigned?cn.rem_u:cn.rem_s)(this.low,this.high,t.low,t.high);return yt(o,cn.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};He.mod=He.modulo;He.rem=He.modulo;He.not=function(){return yt(~this.low,~this.high,this.unsigned)};He.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};He.clz=He.countLeadingZeros;He.countTrailingZeros=function(){return this.low?Dce(this.low):Dce(this.high)+32};He.ctz=He.countTrailingZeros;He.and=function(t){return oi(t)||(t=ln(t)),yt(this.low&t.low,this.high&t.high,this.unsigned)};He.or=function(t){return oi(t)||(t=ln(t)),yt(this.low|t.low,this.high|t.high,this.unsigned)};He.xor=function(t){return oi(t)||(t=ln(t)),yt(this.low^t.low,this.high^t.high,this.unsigned)};He.shiftLeft=function(t){return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?yt(this.low<>>32-t,this.unsigned):yt(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):yt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};He.shr=He.shiftRight;He.shiftRightUnsigned=function(t){return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?yt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?yt(this.high,0,this.unsigned):yt(this.high>>>t-32,0,this.unsigned)};He.shru=He.shiftRightUnsigned;He.shr_u=He.shiftRightUnsigned;He.rotateLeft=function(t){var o;return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?yt(this.high,this.low,this.unsigned):t<32?(o=32-t,yt(this.low<>>o,this.high<>>o,this.unsigned)):(t-=32,o=32-t,yt(this.high<>>o,this.low<>>o,this.unsigned))};He.rotl=He.rotateLeft;He.rotateRight=function(t){var o;return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?yt(this.high,this.low,this.unsigned):t<32?(o=32-t,yt(this.high<>>t,this.low<>>t,this.unsigned)):(t-=32,o=32-t,yt(this.low<>>t,this.high<>>t,this.unsigned))};He.rotr=He.rotateRight;He.toSigned=function(){return this.unsigned?yt(this.low,this.high,!1):this};He.toUnsigned=function(){return this.unsigned?this:yt(this.low,this.high,!0)};He.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};He.toBytesLE=function(){var t=this.high,o=this.low;return[o&255,o>>>8&255,o>>>16&255,o>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};He.toBytesBE=function(){var t=this.high,o=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,o>>>24,o>>>16&255,o>>>8&255,o&255]};vt.fromBytes=function(t,o,i){return i?vt.fromBytesLE(t,o):vt.fromBytesBE(t,o)};vt.fromBytesLE=function(t,o){return new vt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,o)};vt.fromBytesBE=function(t,o){return new vt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],o)};typeof BigInt=="function"&&(vt.fromBigInt=function(t,o){var i=Number(BigInt.asIntN(32,t)),e=Number(BigInt.asIntN(32,t>>BigInt(32)));return yt(i,e,o)},vt.fromValue=function(t,o){return typeof t=="bigint"?vt.fromBigInt(t,o):ln(t,o)},He.toBigInt=function(){var t=BigInt(this.low>>>0),o=BigInt(this.unsigned?this.high>>>0:this.high);return o<{let n=new ec;return{mutex(t){return n.runExclusive(t)}}},Pce=()=>{let n=new Map;return{async mutex(t,o){let i=n.get(t);i||(i={mutex:new ec,refCount:0},n.set(t,i)),i.refCount++;try{return await i.mutex.runExclusive(o)}finally{i.refCount--,i.refCount===0&&n.get(t)===i&&n.delete(t)}}}};function Gce(n,t,o=10){let i=[],e=!1;return{enqueue:(A,r)=>{if(i.push({type:A,node:r}),e)return;e=!0,(async()=>{let g=0;for(;i.length&&t.isWsOpen();){let{type:c,node:I}=i.shift(),d=n.get(c);if(!d){t.onUnexpectedError(new Error(`unknown offline node type: ${c}`),"processing offline node");continue}await d(I).catch(B=>t.onUnexpectedError(B,`processing offline ${c}`)),g++,g>=o&&(g=0,await t.yieldToEventLoop())}e=!1})().catch(g=>t.onUnexpectedError(g,"processing offline nodes"))}}}var CM=qe(Kr(),1);var DI=qe(Kr(),1);var nM=class{constructor(){this.name="devices"}getQueryElement(){return{tag:"devices",attrs:{version:"2"}}}getUserElement(){return null}parser(t){let o=[],i;if(t.tag==="devices"){Ji(t);let e=le(t,"device-list"),a=le(t,"key-index-list");if(Array.isArray(e?.content))for(let{tag:A,attrs:r}of e.content){let s=+r.id,g=+r["key-index"];A==="device"&&o.push({id:s,keyIndex:g,isHosted:!!(r.is_hosted&&r.is_hosted==="true")})}a?.tag==="key-index-list"&&(i={timestamp:+a.attrs.ts,signedKeyIndex:a?.content,expectedTimestamp:a.attrs.expected_ts?+a.attrs.expected_ts:void 0})}return{deviceList:o,keyIndex:i}}};var tg=class{withId(t){return this.id=t,this}withLid(t){return this.lid=t,this}withPhone(t){return this.phone=t,this}withUsername(t){return this.username=t,this}withUsernameKey(t){return this.usernameKey=t,this}withType(t){return this.type=t,this}withPersonaId(t){return this.personaId=t,this}};var sM=class{constructor(){this.name="contact"}getQueryElement(){return{tag:"contact",attrs:{}}}getUserElement(t){return t.phone?{tag:"contact",attrs:{},content:t.phone}:t.username?{tag:"contact",attrs:{username:t.username,...t.usernameKey?{pin:t.usernameKey}:{},...t.lid?{lid:t.lid}:{}}}:t.type?{tag:"contact",attrs:{type:t.type}}:{tag:"contact",attrs:{}}}parser(t){return t.tag==="contact"?(Ji(t),t?.attrs?.type==="in"):!1}};var gM=class{constructor(){this.name="status"}getQueryElement(){return{tag:"status",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="status"){Ji(t);let o=t?.content?.toString()??null,i=new Date(+(t?.attrs.t||0)*1e3);return o?typeof o=="string"&&o.length===0&&(o=null):t.attrs?.code&&+t.attrs.code==401?o="":o=null,{status:o,setAt:i}}}};var cM=class{constructor(){this.name="disappearing_mode"}getQueryElement(){return{tag:"disappearing_mode",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="disappearing_mode"){Ji(t);let o=+t?.attrs.duration,i=new Date(+(t?.attrs.t||0)*1e3);return{duration:o,setAt:i}}}};var IM=class{constructor(){this.name="username"}getQueryElement(){return{tag:"username",attrs:{}}}getUserElement(t){return null}parser(t){return t.tag==="username"?(Ji(t),typeof t.content=="string"?t.content:null):null}};var lM=class{constructor(){this.name="bot"}getQueryElement(){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{v:"1"}}]}}getUserElement(t){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{persona_id:t.personaId}}]}}parser(t){let o=le(t,"bot"),i=le(o,"profile"),e=le(i,"commands"),a=le(i,"prompts"),A=[],r=[];for(let s of PA(e,"command"))A.push({name:jA(s,"name"),description:jA(s,"description")});for(let s of PA(a,"prompt"))r.push(`${jA(s,"emoji")} ${jA(s,"text")}`);return{isDefault:!!le(i,"default"),jid:t.attrs.jid,name:jA(i,"name"),attributes:jA(i,"attributes"),description:jA(i,"description"),category:jA(i,"category"),personaId:i.attrs.persona_id,commandsDescription:jA(e,"description"),commands:A,prompts:r}}};var pM=class{constructor(){this.name="lid"}getQueryElement(){return{tag:"lid",attrs:{}}}getUserElement(t){return t.lid?{tag:"lid",attrs:{jid:t.lid}}:null}parser(t){return t.tag==="lid"?t.attrs.val:null}};var rg=class{constructor(){this.protocols=[],this.users=[],this.context="interactive",this.mode="query"}withMode(t){return this.mode=t,this}withContext(t){return this.context=t,this}withUser(t){return this.users.push(t),this}parseUSyncQueryResult(t){if(t?.attrs.type!=="result")return;let o=Object.fromEntries(this.protocols.map(A=>[A.name,A.parser])),i={list:[],sideList:[]},e=le(t,"usync"),a=e?le(e,"list"):void 0;return a?.content&&Array.isArray(a.content)&&(i.list=a.content.reduce((A,r)=>{let s=r?.attrs.jid;if(s){let g=Array.isArray(r?.content)?Object.fromEntries(r.content.map(c=>{let I=c.tag,d=o[I];return d?[I,d(c)]:[I,null]}).filter(([,c])=>c!==null)):{};A.push({...g,id:s})}return A},[])),i}withDeviceProtocol(){return this.protocols.push(new nM),this}withContactProtocol(){return this.protocols.push(new sM),this}withStatusProtocol(){return this.protocols.push(new gM),this}withDisappearingModeProtocol(){return this.protocols.push(new cM),this}withBotProfileProtocol(){return this.protocols.push(new lM),this}withLIDProtocol(){return this.protocols.push(new pM),this}withUsernameProtocol(){return this.protocols.push(new IM),this}};var Wr=qe(Kr(),1);import{randomBytes as qH}from"crypto";import{URL as J5e}from"url";import{promisify as q5e}from"util";var dM=class{constructor(t={}){this.protocolVersion=5,this.sequence=0,this.events=[],this.buffer=[],Object.assign(this,t)}};import{EventEmitter as Y5e}from"events";var hM=class extends Y5e{constructor(t,o){super(),this.url=t,this.config=o,this.setMaxListeners(0)}};var EM=class extends hM{constructor(){super(...arguments),this.socket=null}get isOpen(){return this.socket?.readyState===Uo.OPEN}get isClosed(){return this.socket===null||this.socket?.readyState===Uo.CLOSED}get isClosing(){return this.socket===null||this.socket?.readyState===Uo.CLOSING}get isConnecting(){return this.socket?.readyState===Uo.CONNECTING}connect(){if(this.socket)return;this.socket=new Uo(this.url,{origin:Mf,headers:this.config.options?.headers,handshakeTimeout:this.config.connectTimeoutMs,timeout:this.config.connectTimeoutMs,agent:this.config.agent}),this.socket.setMaxListeners(0);let t=["close","error","upgrade","message","open","ping","pong","unexpected-response"];for(let o of t)this.socket?.on(o,(...i)=>this.emit(o,...i))}async close(){if(!this.socket)return;let t=new Promise(o=>{this.socket?.once("close",o)});this.socket.close(),await t,this.socket=null}send(t,o){return this.socket?.send(t,o),!!this.socket}};var JH=qe(Kr(),1);var j5e=(n,t,o,i)=>o({tag:"iq",attrs:{id:i(),type:"get",to:OA,xmlns:"w:mex"},content:[{tag:"query",attrs:{query_id:t},content:Buffer.from(JSON.stringify({variables:n}),"utf-8")}]}),Wf=async(n,t,o,i,e)=>{let a=await j5e(n,t,i,e),A=le(a,"result");if(A?.content){let s=JSON.parse(A.content.toString());if(s.errors&&s.errors.length>0){let c=s.errors.map(B=>B.message||"Unknown error").join(", "),I=s.errors[0],d=I.extensions?.error_code||400;throw new JH.Boom(`GraphQL server error: ${c}`,{statusCode:d,data:I})}let g=o?s?.data?.[o]:s?.data;if(typeof g<"u")return g}let r=(o||"").startsWith("xwa2_")?o.substring(5).replace(/_/g," "):o?.replace(/_/g," ");throw new JH.Boom(`Failed to ${r}, unexpected response structure.`,{statusCode:400,data:a})};var Fce=n=>{let{waWebSocketUrl:t,connectTimeoutMs:o,logger:i,keepAliveIntervalMs:e,browser:a,auth:A,printQRInTerminal:r,defaultQueryTimeoutMs:s,transactionOpts:g,qrTimeout:c,makeSignalRepository:I}=n,d=new dM,B=0,f=j7(),Q=()=>`${f}${se++}`;r&&i.warn({},"\u26A0\uFE0F The printQRInTerminal option has been deprecated. You will no longer receive QR codes in the terminal automatically. Please listen to the connection.update event yourself and handle the QR your way. You can remove this message by removing this opttion. This message will be removed in a future version."),a[1].toLocaleLowerCase().includes("android")&&i.warn("\u26A0\uFE0F Using the Android browser is experimental and may lead to unexpected behavior. Use at your own risk."),qf.map(pe=>n.shouldSyncHistoryMessage({syncType:pe})).filter(pe=>pe===!1).length===qf.length&&i.warn("\u26A0\uFE0F DANGER: DISABLING ALL SYNC BY shouldSyncHistoryMsg PREVENTS BAILEYS FROM ACCESSING INITIAL LID MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS");let m=typeof t=="string"?new J5e(t):t;if(n.mobile||m.protocol==="tcp:")throw new Wr.Boom("Mobile API is not supported anymore",{statusCode:$t.loggedOut});m.protocol==="wss"&&A?.creds?.routingInfo&&m.searchParams.append("ED",A.creds.routingInfo.toString("base64url"));let T=Sr.generateKeyPair(),_=hne({keyPair:T,NOISE_HEADER:Cce,logger:i,routingInfo:A?.creds?.routingInfo}),R=new EM(m,n);R.connect();let K=q5e(R.send),L=async pe=>{if(!R.isOpen)throw new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed});let Qe=_.encodeFrame(pe);await fh(o,async(be,oA)=>{try{await K.call(R,Qe),be()}catch(pA){oA(pA)}})},F=pe=>{i.level==="trace"&&i.trace({xml:Gn(pe),msg:"xml send"});let Qe=g7(pe);return L(Qe)},q=async(pe,Qe=s)=>{let be,oA;try{return await fh(Qe,(FA,Kt)=>(be=st=>{FA(st)},oA=st=>{Kt(st||new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed}))},R.on(`TAG:${pe}`,be),R.on("close",oA),R.on("error",oA),()=>Kt(new Wr.Boom("Query Cancelled"))))}catch(pA){if(pA instanceof Wr.Boom&&pA.output?.statusCode===$t.timedOut){i?.warn?.({msgId:pe},"timed out waiting for message");return}throw pA}finally{be&&R.off(`TAG:${pe}`,be),oA&&(R.off("close",oA),R.off("error",oA))}},V=async(pe,Qe)=>{pe.attrs.id||(pe.attrs.id=Q());let be=pe.attrs.id,oA=await fh(Qe,async(pA,FA)=>{let Kt=q(be,Qe).catch(FA);F(pe).then(async()=>pA(await Kt)).catch(FA)});return oA&&"tag"in oA&&Ji(oA),oA},x=async()=>{let pe=await V({tag:"iq",attrs:{to:OA,type:"get",xmlns:"encrypt"},content:[{tag:"digest",attrs:{}}]});if(!le(pe,"digest"))throw await Xe(),new Error("encrypt/get digest returned no digest node")},G=async()=>{let pe=(z.signedPreKey.keyId||0)+1,Qe=await dD(z.signedIdentityKey,pe);await V({tag:"iq",attrs:{to:OA,type:"set",xmlns:"encrypt"},content:[{tag:"rotate",attrs:{},content:[Rf(Qe)]}]}),k.emit("creds.update",{signedPreKey:Qe})},J=async pe=>{if(pe.protocols.length===0)throw new Wr.Boom("USyncQuery must have at least one protocol");let be=pe.users.map(st=>({tag:"user",attrs:{jid:st.phone?void 0:st.id},content:pe.protocols.map(Dr=>Dr.getUserElement(st)).filter(Dr=>Dr!==null)})),oA={tag:"list",attrs:{},content:be},pA={tag:"query",attrs:{},content:pe.protocols.map(st=>st.getQueryElement())},FA={tag:"iq",attrs:{to:OA,type:"get",xmlns:"usync"},content:[{tag:"usync",attrs:{context:pe.context,mode:pe.mode,sid:Q(),last:"true",index:"0"},content:[pA,oA]}]},Kt=await V(FA);return pe.parseUSyncQueryResult(Kt)},U=async(...pe)=>{let Qe=new rg,be=!1;for(let pA of pe)if(qA(pA)){i?.warn("LIDs are not supported with onWhatsApp");continue}else{be||(be=!0,Qe=Qe.withContactProtocol());let FA=`+${pA.replace("+","").split("@")[0]?.split(":")[0]}`;Qe.withUser(new tg().withPhone(FA))}if(Qe.users.length===0)return[];let oA=await J(Qe);if(oA)return oA.list.filter(pA=>!!pA.contact).map(({contact:pA,id:FA})=>({jid:FA,exists:pA}))},N=async pe=>{let Qe=new rg().withLIDProtocol().withContext("background");for(let oA of pe)if(qA(oA)){i?.warn("LID user found in LID fetch call");continue}else Qe.withUser(new tg().withId(oA));if(Qe.users.length===0)return[];let be=await J(Qe);return be?be.list.filter(oA=>!!oA.lid).map(({lid:oA,id:pA})=>({pn:pA,lid:oA})):[]},k=Wne(i),{creds:z}=A,Ae=Hne(A.keys,i,g),ie=I({creds:z,keys:Ae},i,N),we,se=1,Te,fe,ke=!1,Re=[],We=(pe,Qe)=>{i.error({err:pe},`unexpected error in '${Qe}'`)},ve=async pe=>{if(!R.isOpen)throw new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed});let Qe,be,oA=fh(o,(pA,FA)=>{Qe=pA,be=zH(FA),R.on("frame",Qe),R.on("close",be),R.on("error",be)}).finally(()=>{R.off("frame",Qe),R.off("close",be),R.off("error",be)});return pe&&L(pe).catch(be),oA},aA=async()=>{let pe={clientHello:{ephemeral:T.public}};pe=oe.HandshakeMessage.fromObject(pe),i.info({browser:a,helloMsg:pe},"connected to WA");let Qe=oe.HandshakeMessage.encode(pe).finish(),be=await ve(Qe),oA=oe.HandshakeMessage.decode(be);i.trace({handshake:oA},"handshake recv from WA");let pA=_.processHandshake(oA,z.noiseKey),FA;z.me?(FA=nne(z.me.id,n),i.info({node:FA},"logging in...")):(FA=sne(z,n),i.info({node:FA},"not logged in, attempting registration..."));let Kt=_.encrypt(oe.ClientPayload.encode(FA).finish());await L(oe.HandshakeMessage.encode({clientFinish:{static:pA,payload:Kt}}).finish()),await _.finishInit(),Ze()},Be=async()=>{let pe=await V({tag:"iq",attrs:{id:Q(),xmlns:"encrypt",type:"get",to:OA},content:[{tag:"count",attrs:{}}]});return+le(pe,"count").attrs.value},Ie=null,Xe=async(pe=zf)=>{if(Ie){i.debug("Pre-key upload already in progress, waiting for completion"),await Ie;return}let Qe=async be=>{i.info({count:pe,retryCount:be},"uploading pre-keys");let oA=await Ae.transaction(async()=>{i.debug({requestedCount:pe},"generating pre-keys with requested count");let{update:pA,node:FA}=await ane({creds:z,keys:Ae},pe);return k.emit("creds.update",pA),FA},z?.me?.id||"upload-pre-keys");try{await V(oA),i.info({count:pe},"uploaded pre-keys successfully")}catch(pA){if(i.error({uploadError:pA.toString(),count:pe},"Failed to upload pre-keys to server"),be<3){let FA=Math.min(1e3*Math.pow(2,be),1e4);return i.info(`Retrying pre-key upload in ${FA}ms`),await new Promise(Kt=>setTimeout(Kt,FA)),Qe(be+1)}throw pA}};Ie=Promise.race([Qe(0),new Promise((be,oA)=>setTimeout(()=>oA(new Wr.Boom("Pre-key upload timeout",{statusCode:408})),Qce))]);try{await Ie}finally{Ie=null}},je=async()=>{let pe=z.nextPreKeyId-1;return pe<=0?{exists:!1,currentPreKeyId:0}:{exists:!!(await Ae.get("pre-key",[pe.toString()]))[pe.toString()],currentPreKeyId:pe}},Oe=async()=>{try{let pe=0,Qe=await Be();Qe===0?pe=fce:pe=zf;let{exists:be,currentPreKeyId:oA}=await je();i.info(`${Qe} pre-keys found on server`),i.info(`Current prekey ID: ${oA}, exists in storage: ${be}`);let pA=Qe<=pe,FA=!be&&oA>0;if(pA||FA){let st=[];pA&&st.push(`server count low (${Qe})`),FA&&st.push(`current prekey ${oA} missing from storage`),i.info(`Uploading PreKeys due to: ${st.join(", ")}`),await Xe(pe)}else i.info(`PreKey validation passed - Server: ${Qe}, Current prekey ${oA} exists`)}catch(pe){i.error({error:pe},"Failed to check/upload pre-keys during initialization")}},EA=async pe=>{await _.decodeFrame(pe,Qe=>{we=new Date;let be=!1;if(be=R.emit("frame",Qe),!(Qe instanceof Uint8Array)){let oA=Qe.attrs.id;i.level==="trace"&&i.trace({xml:Gn(Qe),msg:"recv xml"}),be=R.emit(`${dce}${oA}`,Qe)||be;let pA=Qe.tag,FA=Qe.attrs||{},Kt=Array.isArray(Qe.content)?Qe.content[0]?.tag:"";for(let st of Object.keys(FA))be=R.emit(`${mE}${pA},${st}:${FA[st]},${Kt}`,Qe)||be,be=R.emit(`${mE}${pA},${st}:${FA[st]}`,Qe)||be,be=R.emit(`${mE}${pA},${st}`,Qe)||be;be=R.emit(`${mE}${pA},,${Kt}`,Qe)||be,be=R.emit(`${mE}${pA}`,Qe)||be,!be&&i.level==="debug"&&i.debug({unhandled:!0,msgId:oA,fromMe:!1,frame:Qe},"communication recv")}})},hA=async pe=>{if(ke){i.trace({trace:pe?.stack},"connection already closed");return}if(ke=!0,i.info({trace:pe?.stack},pe?"connection errored":"connection closed"),clearInterval(Te),clearTimeout(fe),R.removeAllListeners("close"),R.removeAllListeners("open"),R.removeAllListeners("message"),ie.close?.(),!R.isClosed&&!R.isClosing)try{await R.close()}catch{}for(let Qe of Re)try{await Qe(pe)}catch(be){i.error({err:be},"error in socket end handler")}k.emit("connection.update",{connection:"close",lastDisconnect:{error:pe,date:new Date}}),k.removeAllListeners("connection.update"),k.destroy()},iA=async()=>{if(R.isOpen)return;if(R.isClosed||R.isClosing)throw new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed});let pe,Qe;await new Promise((be,oA)=>{pe=()=>be(void 0),Qe=zH(oA),R.on("open",pe),R.on("close",Qe),R.on("error",Qe)}).finally(()=>{R.off("open",pe),R.off("close",Qe),R.off("error",Qe)})},Ze=()=>Te=setInterval(()=>{we||(we=new Date),Date.now()-we.getTime()>e+5e3?hA(new Wr.Boom("Connection was lost",{statusCode:$t.connectionLost})):R.isOpen?V({tag:"iq",attrs:{id:Q(),to:OA,type:"get",xmlns:"w:p"},content:[{tag:"ping",attrs:{}}]}).catch(Qe=>{i.error({trace:Qe.stack},"error in sending keep alive")}):i.warn("keep alive called when WS not open")},e),bA=pe=>V({tag:"iq",attrs:{to:OA,xmlns:"passive",type:"set"},content:[{tag:pe,attrs:{}}]}),ue=async pe=>{let Qe=A.creds.me?.id;Qe&&await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"remove-companion-device",attrs:{jid:Qe,reason:"user_initiated"}}]}),hA(new Wr.Boom(pe||"Intentional Logout",{statusCode:$t.loggedOut}))},Ne=async(pe,Qe)=>{let be=Qe??W7(qH(5));if(Qe&&Qe?.length!==8)throw new Error("Custom pairing code must be exactly 8 chars");return A.creds.pairingCode=be,A.creds.me={id:yr(pe,"s.whatsapp.net"),name:"~"},k.emit("creds.update",A.creds),await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:A.creds.me.id,stage:"companion_hello",should_show_push_notification:"true"},content:[{tag:"link_code_pairing_wrapped_companion_ephemeral_pub",attrs:{},content:await Ue()},{tag:"companion_server_auth_key_pub",attrs:{},content:A.creds.noiseKey.public},{tag:"companion_platform_id",attrs:{},content:zU(a)},{tag:"companion_platform_display",attrs:{},content:`${a[1]} (${a[0]})`},{tag:"link_code_pairing_nonce",attrs:{},content:"0"}]}]}),A.creds.pairingCode};async function Ue(){let pe=qH(32),Qe=qH(16),be=await hD(A.creds.pairingCode,pe),oA=R7(A.creds.pairingEphemeralKeyPair.public,be,Qe);return Buffer.concat([pe,Qe,oA])}let MA=pe=>V({tag:"iq",attrs:{to:OA,id:Q(),xmlns:"w:stats"},content:[{tag:"add",attrs:{t:Math.round(Date.now()/1e3)+""},content:pe}]});R.on("message",EA),R.on("open",async()=>{try{await aA()}catch(pe){i.error({err:pe},"error in validating connection"),hA(pe)}}),R.on("error",zH(hA)),R.on("close",()=>void hA(new Wr.Boom("Connection Terminated",{statusCode:$t.connectionClosed}))),R.on("CB:xmlstreamend",()=>void hA(new Wr.Boom("Connection Terminated by Server",{statusCode:$t.connectionClosed}))),R.on("CB:iq,type:set,pair-device",async pe=>{let Qe={tag:"iq",attrs:{to:OA,type:"result",id:pe.attrs.id}};await F(Qe);let be=le(pe,"pair-device"),oA=PA(be,"ref"),pA=Buffer.from(z.noiseKey.public).toString("base64"),FA=Buffer.from(z.signedIdentityKey.public).toString("base64"),Kt=z.advSecretKey,st=c||6e4,Dr=()=>{if(!R.isOpen)return;let rr=oA.shift();if(!rr){hA(new Wr.Boom("QR refs attempts ended",{statusCode:$t.timedOut}));return}let Qo=rr.content.toString("utf-8"),$i=$ne(Qo,pA,FA,Kt,a);k.emit("connection.update",{qr:$i}),fe=setTimeout(Dr,st),st=c||2e4};Dr()}),R.on("CB:iq,,pair-success",async pe=>{i.debug("pair success recv");try{_A(pe);let{reply:Qe,creds:be}=gne(pe,z);i.info({me:be.me,platform:be.platform},"pairing configured successfully, expect to restart the connection..."),k.emit("creds.update",be),k.emit("connection.update",{isNewLogin:!0,qr:void 0}),await F(Qe),wA()}catch(Qe){i.info({trace:Qe.stack},"error in pairing"),hA(Qe)}}),R.on("CB:success",async pe=>{try{_A(pe),await Oe(),await bA("active");try{await x()}catch(Qe){i.warn({e:Qe},"failed to run digest after login")}}catch(Qe){i.warn({err:Qe},"failed to send initial passive iq")}if(i.info("opened connection to WA"),clearTimeout(fe),k.emit("creds.update",{me:{...A.creds.me,lid:pe.attrs.lid}}),k.emit("connection.update",{connection:"open"}),wA(),pe.attrs.lid&&A.creds.me?.id){let Qe=pe.attrs.lid;process.nextTick(async()=>{try{let be=A.creds.me.id;await ie.lidMapping.storeLIDPNMappings([{lid:Qe,pn:be}]);let{user:oA,device:pA}=fA(be);await A.keys.set({"device-list":{[oA]:[pA?.toString()||"0"]}}),await ie.migrateSession(be,Qe),i.info({myPN:be,myLID:Qe},"Own LID session created successfully")}catch(be){i.error({error:be,lid:Qe},"Failed to create own LID session")}})}}),R.on("CB:stream:error",pe=>{let[Qe]=_s(pe);i.error({reasonNode:Qe,fullErrorNode:pe},"stream errored out");let{reason:be,statusCode:oA}=q7(pe);hA(new Wr.Boom(`Stream Errored (${be})`,{statusCode:oA,data:Qe||pe}))}),R.on("CB:failure",pe=>{let Qe=+(pe.attrs.reason||500);hA(new Wr.Boom("Connection Failure",{statusCode:Qe,data:pe.attrs}))}),R.on("CB:ib,,downgrade_webclient",()=>{hA(new Wr.Boom("Multi-device beta not joined",{statusCode:$t.multideviceMismatch}))}),R.on("CB:ib,,offline_preview",async pe=>{i.info("offline preview received",JSON.stringify(pe)),await F({tag:"ib",attrs:{},content:[{tag:"offline_batch",attrs:{count:"100"}}]})}),R.on("CB:ib,,edge_routing",pe=>{let Qe=le(pe,"edge_routing"),be=le(Qe,"routing_info");be?.content&&(A.creds.routingInfo=Buffer.from(be?.content),k.emit("creds.update",A.creds))});let Ke=!1;process.nextTick(()=>{z.me?.id&&(k.buffer(),Ke=!0),k.emit("connection.update",{connection:"connecting",receivedPendingNotifications:!1,qr:void 0})}),R.on("CB:ib,,offline",pe=>{let be=+(le(pe,"offline")?.attrs.count||0);i.info(`handled ${be} offline messages/notifications`),Ke&&(k.flush(),i.trace("flushed events for initial buffer")),k.emit("connection.update",{receivedPendingNotifications:!0})}),k.on("creds.update",pe=>{let Qe=pe.me?.name;z.me?.name!==Qe&&(i.debug({name:Qe},"updated pushName"),F({tag:"presence",attrs:{name:Qe}}).catch(be=>{i.warn({trace:be.stack},"error in sending presence update on name change")})),Object.assign(z,pe)});let _A=({attrs:pe})=>{let Qe=pe?.t;if(!Qe)return;let be=Number(Qe);if(Number.isNaN(be)||be<=0)return;let oA=Date.now();B=be*1e3-oA,i.debug({offset:B},"calculated server time offset")},at=()=>{let pe=3*HH.Day;return((Date.now()+B+pe)%HH.Week).toString()},wA=async()=>{if(!R.isOpen)return;let pe={tag:"ib",attrs:{},content:[{tag:"unified_session",attrs:{id:at()}}]};try{await F(pe)}catch(Qe){i.debug({error:Qe},"failed to send unified_session telemetry")}},lt=pe=>{Re.push(pe)},Er=async()=>{let pe=await Wf({},ca.REACHOUT_TIMELOCK,wa.xwa2_fetch_account_reachout_timelock,V,Q),Qe={isActive:!!pe?.is_active,timeEnforcementEnds:pe?.time_enforcement_ends&&pe?.time_enforcement_ends!=="0"?new Date(parseInt(pe.time_enforcement_ends,10)*1e3):void 0,enforcementType:pe?.enforcement_type??Vc.DEFAULT};return k.emit("connection.update",{reachoutTimeLock:Qe}),Qe},UA=async()=>Wf({input:{type:"INDIVIDUAL_NEW_CHAT_MSG"}},ca.MESSAGE_CAPPING_INFO,wa.xwa2_message_capping_info,V,Q);return{type:"md",ws:R,ev:k,authState:{creds:z,keys:Ae},signalRepository:ie,get user(){return A.creds.me},generateMessageTag:Q,query:V,waitForMessage:q,waitForSocketOpen:iA,sendRawMessage:L,sendNode:F,logout:ue,end:hA,registerSocketEndHandler:lt,onUnexpectedError:We,uploadPreKeys:Xe,uploadPreKeysToServerIfRequired:Oe,digestKeyBundle:x,rotateSignedPreKey:G,requestPairingCode:Ne,updateServerTimeOffset:_A,sendUnifiedSession:wA,wamBuffer:d,waitForConnectionUpdate:Y7(k),sendWAMBuffer:MA,executeUSyncQuery:J,onWhatsApp:U,fetchAccountReachoutTimelock:Er,fetchNewChatMessageCap:UA}};function zH(n){return t=>{n(new Wr.Boom(`WebSocket Error (${t?.message})`,{statusCode:V7(t),data:t}))}}var z5e=(n,t)=>{let o={tag:"picture",attrs:{type:n,query:"url"}};return t?.length&&(o.content=t),[o]},Lce=n=>{let{logger:t,markOnlineOnConnect:o,fireInitQueries:i,appStateMacVerification:e,shouldIgnoreJid:a,shouldSyncHistoryMessage:A,getMessage:r}=n,s=Fce(n),{ev:g,ws:c,authState:I,generateMessageTag:d,sendNode:B,query:f,signalRepository:Q,onUnexpectedError:y,sendUnifiedSession:m,registerSocketEndHandler:T}=s,_=Q.lidMapping.getLIDForPN.bind(Q.lidMapping),R,K={privacyTokenOn1to1:!0,profilePicPrivacyToken:!0,lidTrustedTokenIssueToLid:!1},L=ga.Connecting,F=ac(),q=ac(),V=ac(),x=ac(),G,J={initialBootstrapComplete:!1,recentSyncComplete:!1},U,N=new Set,k=n.placeholderResendCache||new $g({stdTTL:mI.MSG_RETRY,useClones:!1}),z=async W=>{let{[W]:X}=await I.keys.get("app-state-sync-key",[W]);return X},Ae=async(W=!1)=>{if(!R||W){let{content:X}=await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"get"},content:[{tag:"privacy",attrs:{}}]});R=UF(X?.[0],"category")}return R},ie=async(W,X)=>{await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"set"},content:[{tag:"privacy",attrs:{},content:[{tag:"category",attrs:{name:W,value:X}}]}]})},we=async W=>{await ie("messages",W)},se=async W=>{await ie("calladd",W)},Te=async W=>{await ie("last",W)},fe=async W=>{await ie("online",W)},ke=async W=>{await ie("profile",W)},Re=async W=>{await ie("status",W)},We=async W=>{await ie("readreceipts",W)},ve=async W=>{await ie("groupadd",W)},aA=async W=>{await f({tag:"iq",attrs:{xmlns:"disappearing_mode",to:OA,type:"set"},content:[{tag:"disappearing_mode",attrs:{duration:W.toString()}}]})},Be=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"bot",to:OA,type:"get"},content:[{tag:"bot",attrs:{v:"2"}}]}),X=le(W,"bot"),re=[];for(let ne of PA(X,"section"))if(ne.attrs.type==="all")for(let Se of PA(ne,"bot"))re.push({jid:Se.attrs.jid,personaId:Se.attrs.persona_id});return re},Ie=async(...W)=>{let X=new rg().withStatusProtocol();for(let ne of W)X.withUser(new tg().withId(ne));let re=await s.executeUSyncQuery(X);if(re)return re.list},Xe=async(...W)=>{let X=new rg().withDisappearingModeProtocol();for(let ne of W)X.withUser(new tg().withId(ne));let re=await s.executeUSyncQuery(X);if(re)return re.list},je=async(W,X,re)=>{let ne;if(!W)throw new DI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");uA(W)!==uA(I.creds.me.id)?ne=uA(W):ne=void 0;let{img:Se}=await ub(X,re);await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...ne?{target:ne}:{}},content:[{tag:"picture",attrs:{type:"image"},content:Se}]})},Oe=async W=>{let X;if(!W)throw new DI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");uA(W)!==uA(I.creds.me.id)?X=uA(W):X=void 0,await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...X?{target:X}:{}}})},EA=async W=>{await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"status"},content:[{tag:"status",attrs:{},content:Buffer.from(W,"utf-8")}]})},hA=async W=>{await UA({pushNameSetting:W},"")},iA=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"get"}}),X=le(W,"list");return PA(X,"item").map(re=>re.attrs.jid)},Ze=async(W,X)=>{let re=uA(W),ne,Se;if(qA(re)||Ia(re)){if(ne=re,X==="block"){let he=await Q.lidMapping.getPNForLID(re);if(!he)throw new DI.Boom(`Unable to resolve PN JID for LID: ${W}`,{statusCode:400});Se=uA(he)}}else if(_t(re)||mr(re)){let he=await Q.lidMapping.getLIDForPN(re);if(!he)throw new DI.Boom(`Unable to resolve LID for PN JID: ${W}`,{statusCode:400});ne=he,X==="block"&&(Se=uA(re))}else throw new DI.Boom(`Invalid jid: ${W}`,{statusCode:400});let Ee={action:X,jid:ne};if(X==="block"){if(!Se)throw new DI.Boom(`pn_jid required for block: ${W}`,{statusCode:400});Ee.pn_jid=Se}await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"set"},content:[{tag:"item",attrs:Ee}]})},bA=async W=>{let X=await f({tag:"iq",attrs:{to:"s.whatsapp.net",xmlns:"w:biz",type:"get"},content:[{tag:"business_profile",attrs:{v:"244"},content:[{tag:"profile",attrs:{jid:W}}]}]}),re=le(X,"business_profile"),ne=le(re,"profile");if(ne){let Se=le(ne,"address"),Ee=le(ne,"description"),he=le(ne,"website"),ye=le(ne,"email"),Je=le(le(ne,"categories"),"category"),IA=le(ne,"business_hours"),yA=IA?PA(IA,"business_hours_config"):void 0,XA=he?.content?.toString();return{wid:ne.attrs?.jid,address:Se?.content?.toString(),description:Ee?.content?.toString()||"",website:XA?[XA]:[],email:ye?.content?.toString(),category:Je?.content?.toString(),business_hours:{timezone:IA?.attrs?.timezone,business_config:yA?.map(({attrs:vA})=>vA)}}}},ue=async(W,X)=>{t.info({fromTimestamp:X},"clean dirty bits "+W),await B({tag:"iq",attrs:{to:OA,type:"set",xmlns:"urn:xmpp:whatsapp:dirty",id:d()},content:[{tag:"clean",attrs:{type:W,...X?{timestamp:X.toString()}:null}}]})},Ne=W=>({onMutation(X){Nne(X,g,I.creds.me,W?{accountSettings:I.creds.accountSettings}:void 0,t)}}),Ue=g.createBufferedFunction(async(W,X)=>{let re=new Map,ne=async ye=>{if(re.has(ye))return re.get(ye)??void 0;let Je=await z(ye);return re.set(ye,Je??null),Je},Se={},Ee={};await I.keys.transaction(async()=>{let ye=new Set(W),Je={},IA=new Set;for(;ye.size;){let yA={},XA=[];for(let $A of ye){let tA=(await I.keys.get("app-state-sync-version",[$A]))[$A];tA?(tA=mU(tA),typeof Se[$A]>"u"&&(Se[$A]=tA.version)):tA=Sb(),yA[$A]=tA;let et=IA.has($A);et&&IA.delete($A),t.info(`resyncing ${$A} from v${tA.version}${et?" (forcing snapshot)":""}`),XA.push({tag:"collection",attrs:{name:$A,version:tA.version.toString(),return_snapshot:(et||!tA.version).toString()}})}let vA=await f({tag:"iq",attrs:{to:OA,xmlns:"w:sync:app:state",type:"set"},content:[{tag:"sync",attrs:{},content:XA}]}),YA=await bne(vA,n?.options);for(let $A in YA){let Ge=$A,{patches:tA,hasMorePatches:et,snapshot:Zr}=YA[Ge];try{if(Zr){let{state:ar,mutationMap:yo}=await _ne(Ge,Zr,ne,Se[Ge],e.snapshot,t);yA[Ge]=ar,Object.assign(Ee,yo),t.info(`restored state of ${Ge} from snapshot to v${ar.version} with mutations`),await I.keys.set({"app-state-sync-version":{[Ge]:ar}})}if(tA.length){let{state:ar,mutationMap:yo}=await wU(Ge,tA,yA[Ge],ne,n.options,Se[Ge],t,e.patch);await I.keys.set({"app-state-sync-version":{[Ge]:ar}}),t.info(`synced ${Ge} to v${ar.version}`),Se[Ge]=ar.version,Object.assign(Ee,yo)}et?t.info(`${Ge} has more patches...`):ye.delete(Ge)}catch(ar){Je[Ge]=(Je[Ge]||0)+1;let yo={name:Ge,attempt:Je[Ge],version:yA[Ge].version,statusCode:ar.output?.statusCode,errorType:ar.name,error:ar.stack};Pf(ar)&&Je[Ge]>=SU?(t.warn(yo,`${Ge} blocked on missing key from v${yA[Ge].version}, parking after ${Je[Ge]} attempts`),N.add(Ge),ye.delete(Ge)):Pf(ar)?(t.info(yo,`${Ge} blocked on missing key from v${yA[Ge].version}, retrying with snapshot`),IA.add(Ge)):wne(ar,Je[Ge])?(t.warn(yo,`failed to sync ${Ge} from v${yA[Ge].version}, giving up`),ye.delete(Ge)):(t.info(yo,`failed to sync ${Ge} from v${yA[Ge].version}, forcing snapshot retry`),IA.add(Ge))}}}},I?.creds?.me?.id||"resync-app-state");let{onMutation:he}=Ne(X);for(let ye in Ee)he(Ee[ye])}),MA=async(W,X="preview",re)=>{let ne=uA(W),Se=_t(ne)||qA(ne),Ee=I.creds.me,he=Ee&&(ne===uA(Ee.id)||Ee.lid&&ne===uA(Ee.lid)),ye;K.profilePicPrivacyToken&&Se&&!he&&(ye=await KU({authState:I,jid:ne,getLIDForPN:_})),W=uA(W);let Je=await f({tag:"iq",attrs:{target:W,to:OA,type:"get",xmlns:"w:profile:picture"},content:z5e(X,ye)},re);return le(Je,"picture")?.attrs?.url},Ke=async(W,X,re)=>{let ne=await f({tag:"call",attrs:{id:d(),to:"@call"},content:[{tag:"link_create",attrs:{media:W},content:X?[{tag:"event",attrs:{start_time:String(X.startTime)}}]:void 0}]},re);return le(ne,"link_create")?.attrs?.token},_A=async(W,X)=>{let re=I.creds.me,ne=W==="available";if(ne||W==="unavailable"){if(!re.name){t.warn("no name present, ignoring presence update request...");return}g.emit("connection.update",{isOnline:ne}),ne&&m(),await B({tag:"presence",attrs:{name:re.name.replace(/@/g,""),type:W}})}else{let{server:Se}=fA(X);await B({tag:"chatstate",attrs:{from:Se==="lid"?re.lid:re.id,to:X},content:[{tag:W==="recording"?"composing":W,attrs:W==="recording"?{media:"audio"}:{}}]})}},at=async W=>{let X=uA(W),ne=_t(X)||qA(X)?await KU({authState:I,jid:X,getLIDForPN:_}):void 0;return B({tag:"presence",attrs:{to:W,id:d(),type:"subscribe"},content:ne})},wA=({tag:W,attrs:X,content:re})=>{let ne,Se=X.from,Ee=X.participant||X.from;if(!(a(Se)&&Se!==OA)){if(W==="presence")ne={lastKnownPresence:X.type==="unavailable"?"unavailable":"available",lastSeen:X.last&&X.last!=="deny"?+X.last:void 0,groupOnlineCount:X.count?+X.count:void 0};else if(Array.isArray(re)){let[he]=re,ye=he.tag;ye==="paused"&&(ye="available"),he.attrs?.media==="audio"&&(ye="recording"),ne={lastKnownPresence:ye}}else t.error({tag:W,attrs:X,content:re},"recv invalid presence node");ne&&g.emit("presence.update",{id:Se,presences:{[Ee]:ne}})}},lt=async W=>{let X=W.type,re=I.creds.myAppStateKeyId;if(!re)throw new DI.Boom("App state key not present!",{statusCode:400});let ne,Se;if(await V.mutex(async()=>{await I.keys.transaction(async()=>{t.debug({patch:W},"applying app patch"),await Ue([X],!1);let{[X]:Ee}=await I.keys.get("app-state-sync-version",[X]);ne=Ee?mU(Ee):Sb(),Se=await Dne(W,re,ne,z);let{patch:he,state:ye}=Se,Je={tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:sync:app:state"},content:[{tag:"sync",attrs:{},content:[{tag:"collection",attrs:{name:X,version:(ye.version-1).toString(),return_snapshot:"false"},content:[{tag:"patch",attrs:{},content:oe.SyncdPatch.encode(he).finish()}]}]}]};await f(Je),await I.keys.set({"app-state-sync-version":{[X]:ye}})},I?.creds?.me?.id||"app-patch")}),n.emitOwnEvents){let{onMutation:Ee}=Ne(!1),{mutationMap:he}=await wU(X,[{...Se.patch,version:{version:Se.state.version}}],ne,z,n.options,void 0,t);for(let ye in he)Ee(he[ye])}},Er=async()=>{let W=await f({tag:"iq",attrs:{to:OA,xmlns:"abt",type:"get"},content:[{tag:"props",attrs:{protocol:"1",...I?.creds?.lastPropHash?{hash:I.creds.lastPropHash}:{}}}]}),X=le(W,"props"),re={};X&&(X.attrs?.hash&&(I.creds.lastPropHash=X?.attrs?.hash,g.emit("creds.update",I.creds)),re=UF(X,"prop"));let ne=re[10518]??re.privacy_token_sending_on_all_1_on_1_messages;ne!==void 0&&(K.privacyTokenOn1to1=ne==="true"||ne==="1");let Se=re[9666]??re.profile_scraping_privacy_token_in_photo_iq;Se!==void 0&&(K.profilePicPrivacyToken=Se==="true"||Se==="1");let Ee=re[14303]??re.lid_trusted_token_issue_to_lid;return Ee!==void 0&&(K.lidTrustedTokenIssueToLid=Ee==="true"||Ee==="1"),t.debug({serverProps:K},"fetched props"),re},UA=(W,X)=>{let re=Tne(W,X);return lt(re)},pe=W=>UA({disableLinkPreviews:{isPreviewsDisabled:W}},""),Qe=(W,X,re)=>UA({star:{messages:X,star:re}},W),be=(W,X)=>UA({contact:X},W),oA=W=>UA({contact:null},W),pA=(W,X)=>UA({addLabel:{...X}},W),FA=(W,X)=>UA({addChatLabel:{labelId:X}},W),Kt=(W,X)=>UA({removeChatLabel:{labelId:X}},W),st=(W,X,re)=>UA({addMessageLabel:{messageId:X,labelId:re}},W),Dr=(W,X,re)=>UA({removeMessageLabel:{messageId:X,labelId:re}},W),rr=W=>UA({quickReply:W},""),Qo=W=>UA({quickReply:{timestamp:W,deleted:!0}},""),$i=async()=>{await Promise.all([Er(),iA(),Ae()])},ee=g.createBufferedFunction(async(W,X)=>{if(g.emit("messages.upsert",{messages:[W],type:X}),W.pushName){let Ee=W.key.fromMe?I.creds.me.id:W.key.participant||W.key.remoteJid;Ee=uA(Ee),W.key.fromMe||g.emit("contacts.update",[{id:Ee,notify:W.pushName,verifiedName:W.verifiedBizName}]),W.key.fromMe&&W.pushName&&I.creds.me?.name!==W.pushName&&g.emit("creds.update",{me:{...I.creds.me,name:W.pushName}})}let re=mb(W.message),ne=re?A(re)&&qf.includes(re.syncType):!1;if(re&&ne){let Ee=re.syncType;Ee===oe.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP&&!J.initialBootstrapComplete&&(J.initialBootstrapComplete=!0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===oe.HistorySync.HistorySyncType.RECENT&&re.progress===100&&!J.recentSyncComplete&&(J.recentSyncComplete=!0,clearTimeout(U),U=void 0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===oe.HistorySync.HistorySyncType.RECENT&&!J.recentSyncComplete&&(clearTimeout(U),U=setTimeout(()=>{J.recentSyncComplete||(J.recentSyncComplete=!0,g.emit("messaging-history.status",{syncType:oe.HistorySync.HistorySyncType.RECENT,status:"paused",explicit:!1})),U=void 0},Bce))}re&&L===ga.AwaitingInitialSync&&(G&&(clearTimeout(G),G=void 0),ne?(L=ga.Syncing,t.info("Transitioned to Syncing state")):(L=ga.Online,t.info("History sync skipped, transitioning to Online state and flushing buffer"),g.flush()));let Se=async()=>{if(L===ga.Syncing){N.clear(),t.info("Doing app state sync"),await Ue($X,!0),L=ga.Online,t.info("App state sync complete, transitioning to Online state and flushing buffer"),g.flush();let Ee=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:Ee})}};await Promise.all([(async()=>{ne&&await Se()})(),Vne(W,{signalRepository:Q,shouldProcessHistoryMsg:ne,placeholderResendCache:k,ev:g,creds:I.creds,keyStore:I.keys,logger:t,options:n.options,getMessage:r})]),W.message?.protocolMessage?.appStateSyncKeyShare&&L===ga.Syncing&&(t.info("App state sync key arrived, triggering app state sync"),await Se())});return c.on("CB:presence",wA),c.on("CB:chatstate",wA),c.on("CB:ib,,dirty",async W=>{let{attrs:X}=le(W,"dirty");switch(X.type){case"account_sync":if(X.timestamp){let{lastAccountSyncTimestamp:ne}=I.creds;ne&&await ue("account_sync",ne),ne=+X.timestamp,g.emit("creds.update",{lastAccountSyncTimestamp:ne})}break;case"groups":break;default:t.info({node:W},"received unknown sync");break}}),g.on("connection.update",({connection:W,receivedPendingNotifications:X})=>{if(W==="close"&&(N.clear(),clearTimeout(U),U=void 0),W==="open"&&(i&&$i().catch(ne=>y(ne,"init queries")),_A(o?"available":"unavailable").catch(ne=>y(ne,"presence update requests"))),!X||L!==ga.Connecting)return;if(J.initialBootstrapComplete=!1,J.recentSyncComplete=!1,clearTimeout(U),U=void 0,L=ga.AwaitingInitialSync,t.info("Connection is now AwaitingInitialSync, buffering events"),g.buffer(),!A(oe.Message.HistorySyncNotification.create({syncType:oe.HistorySync.HistorySyncType.RECENT}))){t.info("History sync is disabled by config, not waiting for notification. Transitioning to Online."),L=ga.Online,setTimeout(()=>g.flush(),0);return}if(I.creds.accountSyncCounter>0){t.info("Reconnection with existing sync data, skipping history sync wait. Transitioning to Online."),L=ga.Online,setTimeout(()=>g.flush(),0);return}t.info("First connection, awaiting history sync notification with a 20s timeout."),G&&clearTimeout(G),G=setTimeout(()=>{if(L===ga.AwaitingInitialSync){t.warn("Timeout in AwaitingInitialSync, forcing state to Online and flushing buffer"),L=ga.Online,g.flush();let ne=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:ne})}},2e4)}),g.on("creds.update",({myAppStateKeyId:W})=>{if(!W||N.size===0)return;if(L===ga.Syncing){N.clear();return}let X=[...N];N.clear(),t.info({collections:X},"app state sync key arrived, re-syncing blocked collections"),Ue(X,!1).catch(re=>y(re,"blocked collections resync"))}),g.on("lid-mapping.update",async({lid:W,pn:X})=>{try{await Q.lidMapping.storeLIDPNMappings([{lid:W,pn:X}])}catch(re){t.warn({lid:W,pn:X,error:re},"Failed to store LID-PN mapping")}}),T(()=>{G&&(clearTimeout(G),G=void 0),!n.placeholderResendCache&&k.close&&k.close(),L=ga.Connecting,R=void 0}),{...s,serverProps:K,createCallLink:Ke,getBotListV2:Be,messageMutex:F,receiptMutex:q,appStatePatchMutex:V,notificationMutex:x,fetchPrivacySettings:Ae,upsertMessage:ee,appPatch:lt,sendPresenceUpdate:_A,presenceSubscribe:at,profilePictureUrl:MA,fetchBlocklist:iA,fetchStatus:Ie,fetchDisappearingDuration:Xe,updateProfilePicture:je,removeProfilePicture:Oe,updateProfileStatus:EA,updateProfileName:hA,updateBlockStatus:Ze,updateDisableLinkPreviewsPrivacy:pe,updateCallPrivacy:se,updateMessagesPrivacy:we,updateLastSeenPrivacy:Te,updateOnlinePrivacy:fe,updateProfilePicturePrivacy:ke,updateStatusPrivacy:Re,updateReadReceiptsPrivacy:We,updateGroupsAddPrivacy:ve,updateDefaultDisappearingMode:aA,getBusinessProfile:bA,resyncAppState:Ue,chatModify:UA,cleanDirtyBits:ue,addOrEditContact:be,removeContact:oA,placeholderResendCache:k,addLabel:pA,addChatLabel:FA,removeChatLabel:Kt,addMessageLabel:st,removeMessageLabel:Dr,star:Qe,addOrEditQuickReply:rr,removeQuickReply:Qo}};var Uce=n=>{let t=Lce(n),{authState:o,ev:i,query:e,upsertMessage:a}=t,A=async(g,c,I)=>e({tag:"iq",attrs:{type:c,xmlns:"w:g2",to:g},content:I}),r=async g=>{let c=await A(g,"get",[{tag:"query",attrs:{request:"interactive"}}]);return DE(c)},s=async()=>{let g=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),c={},I=le(g,"groups");if(I){let d=PA(I,"group");for(let B of d){let f=DE({tag:"result",attrs:{},content:[B]});c[f.id]=f}}return t.ev.emit("groups.update",Object.values(c)),c};return t.ws.on("CB:ib,,dirty",async g=>{let{attrs:c}=le(g,"dirty");c.type==="groups"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,groupMetadata:r,groupCreate:async(g,c)=>{let I=jr(),d=await A("@g.us","set",[{tag:"create",attrs:{subject:g,key:I},content:c.map(B=>({tag:"participant",attrs:{jid:B}}))}]);return DE(d)},groupLeave:async g=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"group",attrs:{id:g}}]}])},groupUpdateSubject:async(g,c)=>{await A(g,"set",[{tag:"subject",attrs:{},content:Buffer.from(c,"utf-8")}])},groupRequestParticipantsList:async g=>{let c=await A(g,"get",[{tag:"membership_approval_requests",attrs:{}}]),I=le(c,"membership_approval_requests");return PA(I,"membership_approval_request").map(B=>B.attrs)},groupRequestParticipantsUpdate:async(g,c,I)=>{let d=await A(g,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:I,attrs:{},content:c.map(y=>({tag:"participant",attrs:{jid:y}}))}]}]),B=le(d,"membership_requests_action"),f=le(B,I);return PA(f,"participant").map(y=>({status:y.attrs.error||"200",jid:y.attrs.jid}))},groupParticipantsUpdate:async(g,c,I)=>{let d=await A(g,"set",[{tag:I,attrs:{},content:c.map(Q=>({tag:"participant",attrs:{jid:Q}}))}]),B=le(d,I);return PA(B,"participant").map(Q=>({status:Q.attrs.error||"200",jid:Q.attrs.jid,content:Q}))},groupUpdateDescription:async(g,c)=>{let d=(await r(g)).descId??null;await A(g,"set",[{tag:"description",attrs:{...c?{id:jr()}:{delete:"true"},...d?{prev:d}:{}},content:c?[{tag:"body",attrs:{},content:Buffer.from(c,"utf-8")}]:void 0}])},groupInviteCode:async g=>{let c=await A(g,"get",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupRevokeInvite:async g=>{let c=await A(g,"set",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupAcceptInvite:async g=>{let c=await A("@g.us","set",[{tag:"invite",attrs:{code:g}}]);return le(c,"group")?.attrs.jid},groupRevokeInviteV4:async(g,c)=>!!await A(g,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:c}}]}]),groupAcceptInviteV4:i.createBufferedFunction(async(g,c)=>{g=typeof g=="string"?{remoteJid:g}:g;let I=await A(c.groupJid,"set",[{tag:"accept",attrs:{code:c.inviteCode,expiration:c.inviteExpiration.toString(),admin:g.remoteJid}}]);return g.id&&(c=oe.Message.GroupInviteMessage.fromObject(c),c.inviteExpiration=0,c.inviteCode="",i.emit("messages.update",[{key:g,update:{message:{groupInviteMessage:c}}}])),await a({key:{remoteJid:c.groupJid,id:jr(t.user?.id),fromMe:!1,participant:g.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:g.remoteJid,messageTimestamp:Oa()},"notify"),I.attrs.from}),groupGetInviteInfo:async g=>{let c=await A("@g.us","get",[{tag:"invite",attrs:{code:g}}]);return DE(c)},groupToggleEphemeral:async(g,c)=>{let I=c?{tag:"ephemeral",attrs:{expiration:c.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(g,"set",[I])},groupSettingUpdate:async(g,c)=>{await A(g,"set",[{tag:c,attrs:{}}])},groupMemberAddMode:async(g,c)=>{await A(g,"set",[{tag:"member_add_mode",attrs:{},content:c}])},groupJoinApprovalMode:async(g,c)=>{await A(g,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"group_join",attrs:{state:c}}]}])},groupFetchAllParticipating:s}},DE=n=>{let t=le(n,"group");if(!t){let B=le(n,"error");if(B){let f=B.attrs.code?+B.attrs.code:500,Q=B.attrs.text||"group metadata query failed";throw new CM.Boom(Q,{statusCode:f,data:B})}throw new CM.Boom("Invalid group metadata response: missing node",{data:n})}if(!t.attrs.id)throw new CM.Boom("Invalid group metadata response: missing group id",{data:t});let o=le(t,"description"),i,e,a,A,r,s;o&&(i=jA(o,"body"),a=o.attrs.participant?uA(o.attrs.participant):void 0,A=o.attrs.participant_pn?uA(o.attrs.participant_pn):void 0,r=o.attrs.participant_username||void 0,s=+o.attrs.t,e=o.attrs.id);let g=t.attrs.id.includes("@")?t.attrs.id:yr(t.attrs.id,"g.us"),c=le(t,"ephemeral")?.attrs.expiration,I=jA(t,"member_add_mode")==="all_member_add";return{id:g,notify:t.attrs.notify,addressingMode:t.attrs.addressing_mode==="lid"?yB.LID:yB.PN,subject:t.attrs.subject,subjectOwner:t.attrs.s_o,subjectOwnerPn:t.attrs.s_o_pn,subjectOwnerUsername:t.attrs.s_o_username,subjectTime:+t.attrs.s_t,size:t.attrs.size?+t.attrs.size:PA(t,"participant").length,creation:+t.attrs.creation,owner:t.attrs.creator?uA(t.attrs.creator):void 0,ownerPn:t.attrs.creator_pn?uA(t.attrs.creator_pn):void 0,ownerUsername:t.attrs.creator_username||void 0,owner_country_code:t.attrs.creator_country_code,desc:i,descId:e,descOwner:a,descOwnerPn:A,descOwnerUsername:r,descTime:s,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_group"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:I,participants:PA(t,"participant").map(({attrs:B})=>({id:B.jid,phoneNumber:qA(B.jid)&&_t(B.phone_number)?B.phone_number:void 0,lid:_t(B.jid)&&qA(B.lid)?B.lid:void 0,username:B.participant_username||B.username||void 0,admin:B.type||null})),ephemeralDuration:c?+c:void 0}};var OE=qe(Kr(),1);var V5e=n=>{let{id:t,thread_metadata:o,viewer_metadata:i}=n;return{id:t,owner:void 0,name:o.name.text,creation_time:parseInt(o.creation_time,10),description:o.description.text,invite:o.invite,subscribers:parseInt(o.subscribers_count,10),verification:o.verification,picture:{id:o.picture.id,directPath:o.picture.direct_path},mute_state:i.mute}},W5e=n=>typeof n!="object"||n===null?null:"id"in n&&typeof n.id=="string"?n:"result"in n&&typeof n.result=="object"&&n.result!==null&&"id"in n.result?n.result:null,Hce=n=>{let t=Uce(n),{query:o,generateMessageTag:i}=t,e=(A,r,s)=>Wf(A,r,s,o,i),a=async(A,r)=>{let s={newsletter_id:A,updates:{...r,settings:null}};return e(s,ca.UPDATE_METADATA,"xwa2_newsletter_update")};return{...t,newsletterCreate:async(A,r)=>{let g=await e({input:{name:A,description:r??null}},ca.CREATE,wa.xwa2_newsletter_create);return V5e(g)},newsletterUpdate:a,newsletterSubscribers:async A=>e({newsletter_id:A},ca.SUBSCRIBERS,wa.xwa2_newsletter_subscribers),newsletterMetadata:async(A,r)=>{let s={fetch_creation_time:!0,fetch_full_image:!0,fetch_viewer_metadata:!0,input:{key:r,type:A.toUpperCase()}},g=await e(s,ca.METADATA,wa.xwa2_newsletter_metadata);return W5e(g)},newsletterFollow:A=>e({newsletter_id:A},ca.FOLLOW,wa.xwa2_newsletter_join_v2),newsletterUnfollow:A=>e({newsletter_id:A},ca.UNFOLLOW,wa.xwa2_newsletter_leave_v2),newsletterMute:A=>e({newsletter_id:A},ca.MUTE,wa.xwa2_newsletter_mute_v2),newsletterUnmute:A=>e({newsletter_id:A},ca.UNMUTE,wa.xwa2_newsletter_unmute_v2),newsletterUpdateName:async(A,r)=>await a(A,{name:r}),newsletterUpdateDescription:async(A,r)=>await a(A,{description:r}),newsletterUpdatePicture:async(A,r)=>{let{img:s}=await ub(r);return await a(A,{picture:s.toString("base64")})},newsletterRemovePicture:async A=>await a(A,{picture:""}),newsletterReactMessage:async(A,r,s)=>{await o({tag:"message",attrs:{to:A,...s?{}:{edit:"7"},type:"reaction",server_id:r,id:i()},content:[{tag:"reaction",attrs:s?{code:s}:{}}]})},newsletterFetchMessages:async(A,r,s,g)=>{let c={count:r.toString()};return typeof s=="number"&&(c.since=s.toString()),g&&(c.after=g.toString()),await o({tag:"iq",attrs:{id:i(),type:"get",xmlns:"newsletter",to:A},content:[{tag:"message_updates",attrs:c}]})},subscribeNewsletterUpdates:async A=>{let r=await o({tag:"iq",attrs:{id:i(),type:"set",xmlns:"newsletter",to:A},content:[{tag:"live_updates",attrs:{},content:[]}]}),g=le(r,"live_updates")?.attrs?.duration;return g?{duration:g}:null},newsletterAdminCount:async A=>(await e({newsletter_id:A},ca.ADMIN_COUNT,wa.xwa2_newsletter_admin_count)).admin_count,newsletterChangeOwner:async(A,r)=>{await e({newsletter_id:A,user_id:r},ca.CHANGE_OWNER,wa.xwa2_newsletter_change_owner)},newsletterDemote:async(A,r)=>{await e({newsletter_id:A,user_id:r},ca.DEMOTE,wa.xwa2_newsletter_demote)},newsletterDelete:async A=>{await e({newsletter_id:A},ca.DELETE,wa.xwa2_newsletter_delete_v2)}}};var Kce=n=>{let{logger:t,linkPreviewImageThumbnailWidth:o,generateHighQualityLinkPreview:i,options:e,patchMessageBeforeSending:a,cachedGroupMetadata:A,enableRecentMessageCache:r,maxMsgRetryCount:s}=n,g=Hce(n),{ev:c,authState:I,messageMutex:d,signalRepository:B,upsertMessage:f,query:Q,fetchPrivacySettings:y,sendNode:m,groupMetadata:T,groupToggleEphemeral:_,registerSocketEndHandler:R}=g,K=B.lidMapping.getLIDForPN.bind(B.lidMapping),L=new Set,F=n.userDevicesCache||new $g({stdTTL:mI.USER_DEVICES,useClones:!1}),q=ac(),V=r?new Nb(t,s):null,x=Pce(),G,J=nU,U=async(Be=!1)=>{let Ie=await G;return(!Ie||Be||new Date().getTime()-Ie.fetchDate.getTime()>Ie.ttl*1e3)&&(G=(async()=>{let Xe=await Q({tag:"iq",attrs:{type:"set",xmlns:"w:m",to:OA},content:[{tag:"media_conn",attrs:{}}]}),je=le(Xe,"media_conn"),Oe={hosts:PA(je,"host").map(({attrs:EA})=>({hostname:EA.hostname,maxContentLengthBytes:+EA.maxContentLengthBytes})),auth:je.attrs.auth,ttl:+je.attrs.ttl,fetchDate:new Date};return t.debug("fetched media conn"),Oe.hosts[0]&&(J=Oe.hosts[0].hostname),Oe})()),G},N=async(Be,Ie,Xe,je)=>{if(!Xe||Xe.length===0)throw new OE.Boom("missing ids in receipt");let Oe={tag:"receipt",attrs:{id:Xe[0]}};(je==="read"||je==="read-self")&&(Oe.attrs.t=Oa().toString()),je==="sender"&&(_t(Be)||qA(Be))?(Oe.attrs.recipient=Be,Oe.attrs.to=Ie):(Oe.attrs.to=Be,Ie&&(Oe.attrs.participant=Ie)),je&&(Oe.attrs.type=je);let hA=Xe.slice(1);hA.length&&(Oe.content=[{tag:"list",attrs:{},content:hA.map(iA=>({tag:"item",attrs:{id:iA}}))}]),t.debug({attrs:Oe.attrs,messageIds:Xe},"sending receipt for messages"),await m(Oe)},k=async(Be,Ie)=>{let Xe=zoe(Be);for(let{jid:je,participant:Oe,messageIds:EA}of Xe)await N(je,Oe,EA,Ie)},z=async Be=>{let Xe=(await y()).readreceipts==="all"?"read":"read-self";await k(Be,Xe)},Ae=async(Be,Ie,Xe)=>{let je=[];Ie||t.debug("not using cache for devices");let Oe=[],EA=Be.map(ue=>{let Ne=fA(ue),Ue=Ne?.user,MA=Ne?.device;return typeof MA=="number"&&MA>=0&&Ue?(je.push({user:Ue,device:MA,jid:ue}),null):(ue=uA(ue),{jid:ue,user:Ue})}).filter(ue=>ue!==null),hA;if(Ie&&F.mget){let ue=EA.map(Ne=>Ne?.user).filter(Boolean);hA=await F.mget(ue)}for(let{jid:ue,user:Ne}of EA)if(Ie){let Ue=hA?.[Ne]||(F.mget?void 0:await F.get(Ne));if(Ue){let MA=Ue.map(Ke=>({...Ke,jid:yr(Ke.user,Ke.server,Ke.device)}));je.push(...MA),t.trace({user:Ne},"using cache for devices")}else Oe.push(ue)}else Oe.push(ue);if(!Oe.length)return je;let iA=new Set;for(let ue of Oe)if(qA(ue)||Ia(ue)){let Ne=fA(ue)?.user;Ne&&iA.add(Ne)}let Ze=new rg().withContext("message").withDeviceProtocol().withLIDProtocol();for(let ue of Oe)Ze.withUser(new tg().withId(ue));let bA=await g.executeUSyncQuery(Ze);if(bA){let ue=bA.list.filter(Ke=>!!Ke.lid);if(ue.length>0){t.trace("Storing LID maps from device call"),await B.lidMapping.storeLIDPNMappings(ue.map(Ke=>({lid:Ke.lid,pn:Ke.id})));try{let Ke=ue.map(_A=>_A.lid);Ke.length&&await we(Ke,!0)}catch(Ke){t.warn({e:Ke,count:ue.length},"failed to assert sessions for newly mapped LIDs")}}let Ne=rne(bA?.list,I.creds.me.id,I.creds.me.lid,Xe),Ue={};for(let Ke of Ne)Ue[Ke.user]=Ue[Ke.user]||[],Ue[Ke.user]?.push(Ke);for(let[Ke,_A]of Object.entries(Ue)){let at=iA.has(Ke);for(let wA of _A){let lt=at?yr(Ke,wA.server,wA.device):yr(wA.user,wA.server,wA.device);je.push({...wA,jid:lt}),t.debug({user:wA.user,device:wA.device,finalJid:lt,usedLid:at},"Processed device with LID priority")}}await q.mutex(async()=>{if(F.mset)await F.mset(Object.entries(Ue).map(([Ke,_A])=>({key:Ke,value:_A})));else for(let Ke in Ue)Ue[Ke]&&await F.set(Ke,Ue[Ke])});let MA={};for(let[Ke,_A]of Object.entries(Ue))_A&&_A.length>0&&(MA[Ke]=_A.map(at=>at.device?.toString()||"0"));if(Object.keys(MA).length>0)try{await I.keys.set({"device-list":MA}),t.debug({userCount:Object.keys(MA).length},"stored user device lists for bulk migration")}catch(Ke){t.warn({error:Ke},"failed to store user device lists")}}return je},ie=(Be,Ie)=>fe(Be,{protocolMessage:{type:oe.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE,memberLabel:{label:Ie?.slice(0,30),labelTimestamp:Oa()}}},{additionalNodes:[{tag:"meta",attrs:{tag_reason:"user_update",appdata:"member_tag"},content:void 0}]}),we=async(Be,Ie)=>{let Xe=!1,je=[...new Set(Be)],Oe=[];t.debug({jids:Be},"assertSessions call with jids");for(let EA of je)!Ie&&(await B.validateSession(EA)).exists||Oe.push(EA);if(Oe.length){let EA=[...Oe.filter(iA=>!!qA(iA)||!!Ia(iA)),...(await B.lidMapping.getLIDsForPNs(Oe.filter(iA=>!!_t(iA)||!!mr(iA)))||[]).map(iA=>iA.lid)];t.debug({jidsRequiringFetch:Oe,wireJids:EA},"fetching sessions");let hA=await Q({tag:"iq",attrs:{xmlns:"encrypt",type:"get",to:OA},content:[{tag:"key",attrs:{},content:EA.map(iA=>{let Ze={jid:iA};return Ie&&(Ze.reason="identity"),{tag:"user",attrs:Ze}})}]});await tne(hA,B),Xe=!0}return Xe},se=async Be=>{if(!I.creds.me?.id)throw new OE.Boom("Not authenticated");let Ie={protocolMessage:{peerDataOperationRequestMessage:Be,type:oe.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_MESSAGE}},Xe=uA(I.creds.me.id);return await fe(Xe,Ie,{additionalAttributes:{category:"peer",push_priority:"high_force"},additionalNodes:[{tag:"meta",attrs:{appdata:"default"}}]})},Te=async(Be,Ie,Xe,je)=>{if(!Be.length)return{nodes:[],shouldIncludeDeviceIdentity:!1};let Oe=await a(Ie,Be),EA=Array.isArray(Oe)?Oe:Be.map(Ue=>({recipientJid:Ue,message:Oe})),hA=!1,iA=I.creds.me.id,Ze=I.creds.me?.lid,bA=Ze?fA(Ze)?.user:null,ue=EA.map(async({recipientJid:Ue,message:MA})=>{try{if(!Ue)return null;let Ke=MA;if(je){let{user:lt}=fA(Ue),{user:Er}=fA(iA),UA=bA;(lt===Er||UA&<===UA)&&!(Ue===iA||Ze&&Ue===Ze)&&(Ke=je,t.debug({jid:Ue,targetUser:lt},"Using DSM for own device"))}let _A=Bh(Ke),at=Ue;return await x.mutex(at,async()=>{let{type:lt,ciphertext:Er}=await B.encryptMessage({jid:Ue,data:_A});return lt==="pkmsg"&&(hA=!0),{tag:"to",attrs:{jid:Ue},content:[{tag:"enc",attrs:{v:"2",type:lt,...Xe||{}},content:Er}]}})}catch(Ke){return t.error({jid:Ue,err:Ke},"Failed to encrypt for recipient"),null}}),Ne=(await Promise.all(ue)).filter(Ue=>Ue!==null);if(Be.length>0&&Ne.length===0)throw new OE.Boom("All encryptions failed",{statusCode:500});return{nodes:Ne,shouldIncludeDeviceIdentity:hA}},fe=async(Be,Ie,{messageId:Xe,participant:je,additionalAttributes:Oe,additionalNodes:EA,useUserDevicesCache:hA,useCachedGroupMetadata:iA,statusJidList:Ze})=>{let bA=Kne(I.creds),ue=I.creds.me?.lid,Ne=!!je?.jid,Ue=Ne,MA="status@broadcast",{user:Ke,server:_A}=fA(Be),at=_A==="g.us",wA=Be===MA,lt=_A==="lid",Er=_A==="newsletter",UA=at||wA,pe=Be;Xe=Xe||jr(bA),hA=hA!==!1,iA=iA!==!1&&!wA;let Qe=[],be=wA?MA:pe,oA=[],pA=[],FA,Kt={deviceSentMessage:{destinationJid:be,message:Ie},messageContextInfo:Ie.messageContextInfo},st={};if(je){!at&&!wA&&(Oe={...Oe,device_fanout:"false"});let{user:Dr,device:rr}=fA(je.jid);pA.push({user:Dr,device:rr,jid:je.jid})}return await I.keys.transaction(async()=>{let Dr=Re(Ie);if(Dr&&(st.mediatype=Dr),Er){let Ee=a?await a(Ie,[]):Ie,he=Z7(Ee);oA.push({tag:"plaintext",attrs:{},content:he});let ye={tag:"message",attrs:{to:Be,id:Xe,type:ke(Ie),...Oe||{}},content:oA};t.debug({msgId:Xe},`sending newsletter message to ${Be}`),await m(ye);return}if((Na(Ie)?.pinInChatMessage||Na(Ie)?.reactionMessage)&&(st["decrypt-fail"]="hide"),UA&&!Ne){let[Ee,he]=await Promise.all([(async()=>{let tA=iA&&A?await A(Be):void 0;return tA&&Array.isArray(tA?.participants)?t.trace({jid:Be,participants:tA.participants.length},"using cached group metadata"):wA||(tA=await T(Be)),tA})(),(async()=>!je&&!wA?(await I.keys.get("sender-key-memory",[Be]))[Be]||{}:{})()]),ye=Ee?Ee.participants.map(tA=>tA.id):[];Ee?.ephemeralDuration&&Ee.ephemeralDuration>0&&(Oe={...Oe,expiration:Ee.ephemeralDuration.toString()}),wA&&Ze&&ye.push(...Ze);let Je=await Ae(ye,!!hA,!1);pA.push(...Je),at&&(Oe={...Oe,addressing_mode:Ee?.addressingMode||"lid"});let IA=await a(Ie);if(Array.isArray(IA))throw new OE.Boom("Per-jid patching is not supported in groups");let yA=Bh(IA);FA=IA;let vA=(Oe?.addressing_mode||Ee?.addressingMode||"lid")==="lid"&&ue?ue:bA,{ciphertext:YA,senderKeyDistributionMessage:$A}=await B.encryptGroupMessage({group:be,data:yA,meId:vA}),Ge=[];for(let tA of pA){let et=tA.jid;(!!!he[et]||je)&&!Ia(et)&&!mr(et)&&tA.device!==99&&(Ge.push(et),he[et]=!0)}if(Ge.length){t.debug({senderKeyJids:Ge},"sending new sender key");let tA={senderKeyDistributionMessage:{axolotlSenderKeyDistributionMessage:$A,groupId:be}};await we(Ge);let Zr=await Te(Ge,tA,st);Ue=Ue||Zr.shouldIncludeDeviceIdentity,Qe.push(...Zr.nodes)}oA.push({tag:"enc",attrs:{v:"2",type:"skmsg",...st},content:YA}),await I.keys.set({"sender-key-memory":{[Be]:he}})}else{let Ee=bA;lt&&ue?(Ee=ue,t.debug({to:Be,ownId:Ee},"Using LID identity for @lid conversation")):t.debug({to:Be,ownId:Ee},"Using PN identity for @s.whatsapp.net conversation");let{user:he}=fA(Ee);if(!je){let tA=await a(Ie,[Be]);FA=Array.isArray(tA)?tA.find(et=>et.recipientJid===Be)||tA[0]:tA}if(!Ne){let tA=lt?"lid":"s.whatsapp.net";if(pA.push({user:Ke,device:0,jid:yr(Ke,tA,0)}),Ke!==he){let et=lt?"lid":"s.whatsapp.net",Zr=lt&&ue?fA(ue).user:fA(bA).user;pA.push({user:Zr,device:0,jid:yr(Zr,et,0)})}if(Oe?.category!=="peer"){pA.length=0;let et=lt&&ue?yr(fA(ue)?.user,"lid",void 0):yr(fA(bA)?.user,"s.whatsapp.net",void 0),Zr=await Ae([et,Be],!0,!1);pA.push(...Zr),t.debug({deviceCount:pA.length,devices:pA.map(ar=>`${ar.user}:${ar.device}@${fA(ar.jid)?.server}`)},"Device enumeration complete with unified addressing")}}let ye=[],Je=[],IA=[],{user:yA}=fA(bA),{user:XA}=ue?fA(ue):{user:null};for(let{user:tA,jid:et}of pA){if(et===bA||ue&&et===ue){t.debug({jid:et,meId:bA,meLid:ue},"Skipping exact sender device (whatsmeow pattern)");continue}tA===yA||tA===XA?Je.push(et):IA.push(et),ye.push(et)}await we(ye);let[{nodes:vA,shouldIncludeDeviceIdentity:YA},{nodes:$A,shouldIncludeDeviceIdentity:Ge}]=await Promise.all([Te(Je,Kt||Ie,st),Te(IA,Ie,st,Kt)]);Qe.push(...vA),Qe.push(...$A),(Je.length>0||IA.length>0)&&(st.phash=H7([...Je,...IA])),Ue=Ue||YA||Ge}if(Ne){let Ee=qA(je.jid),he=Nt(je.jid,Ee?ue:bA),ye=Ie;if(UA){let XA;if(ue&&await B.hasSenderKey({group:be,meId:ue})?XA=ue:await B.hasSenderKey({group:be,meId:bA})&&(XA=bA),XA)try{let vA=await B.getSenderKeyDistributionMessage({group:be,meId:XA});ye={...Ie,senderKeyDistributionMessage:{groupId:be,axolotlSenderKeyDistributionMessage:vA}}}catch(vA){t.warn({err:vA,jid:be},"failed to build SKDM for retry, sending without it")}}let Je=he?Bh({deviceSentMessage:{destinationJid:be,message:ye}}):Bh(ye),{type:IA,ciphertext:yA}=await B.encryptMessage({data:Je,jid:je.jid});oA.push({tag:"enc",attrs:{v:"2",type:IA,count:je.count.toString()},content:yA})}if(Qe.length)if(Oe?.category==="peer"){let Ee=Qe[0]?.content?.[0];Ee&&oA.push(Ee)}else oA.push({tag:"participants",attrs:{},content:Qe});let rr={tag:"message",attrs:{id:Xe,to:be,type:ke(Ie),...Oe||{}},content:oA};if(je?xr(be)?(rr.attrs.to=be,rr.attrs.participant=je.jid):Nt(je.jid,bA)?(rr.attrs.to=je.jid,rr.attrs.recipient=be):rr.attrs.to=je.jid:rr.attrs.to=be,Ue&&(rr.content.push({tag:"device-identity",attrs:{},content:kf(I.creds.account,!0)}),t.debug({jid:Be},"adding device identity")),!Er&&!Ne&&FA?.messageContextInfo?.messageSecret&&Qb(FA))try{let Ee=Bh(FA),he={id:Xe,fromMe:!0,remoteJid:be,participant:je?.jid},ye=await xoe(Ee,FA,he);ye&&(rr.content.push(ye),t.trace({jid:Be},"added reporting token to message"))}catch(Ee){t.warn({jid:Be,trace:Ee?.stack},"failed to attach reporting token")}let Qo=Oe?.category==="peer",$i=!at&&!Ne&&!wA&&!Er&&!Qo,ee=$i?await Xs(be,K):be,X=($i?await I.keys.get("tctoken",[ee]):{})[ee],re=X?.token;if(re?.length&&gp(X?.timestamp)){t.debug({jid:be,timestamp:X?.timestamp},"tctoken expired, clearing"),re=void 0;let Ee=X?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:X.senderTimestamp}:null;try{await I.keys.set({tctoken:{[ee]:Ee}})}catch(he){t.debug({jid:be,err:he?.message},"failed to persist tctoken expiry cleanup")}}re?.length&&g.serverProps.privacyTokenOn1to1&&rr.content.push({tag:"tctoken",attrs:{},content:re}),EA&&EA.length>0&&rr.content.push(...EA),t.debug({msgId:Xe},`sending message to ${Qe.length} devices`),await m(rr);let ne=!!Na(Ie)?.protocolMessage,Se=be===i7||n7(be)||lh(be);if($i&&!ne&&!Se&&qne(X?.senderTimestamp)&&!L.has(ee)){L.add(ee);let Ee=Oa(),he=B.lidMapping.getPNForLID.bind(B.lidMapping);Lf(be,g.serverProps.lidTrustedTokenIssueToLid,K,he).then(ye=>We([ye],Ee)).then(async ye=>{await dE({result:ye,fallbackJid:ee,keys:I.keys,getLIDForPN:K});let IA=(await I.keys.get("tctoken",[ee]))[ee],yA=await pE(I.keys,[ee]);await I.keys.set({tctoken:{[ee]:{token:Buffer.alloc(0),...IA,senderTimestamp:Ee},...yA}})}).catch(ye=>{t.debug({jid:be,err:ye?.message},"fire-and-forget tctoken issuance failed")}).finally(()=>{L.delete(ee)})}V&&!je&&V.addRecentMessage(be,Xe,Ie)},bA),Xe},ke=Be=>{let Ie=Na(Be);return Ie?Ie.reactionMessage||Ie.encReactionMessage?"reaction":Ie.pollCreationMessage||Ie.pollCreationMessageV2||Ie.pollCreationMessageV3||Ie.pollUpdateMessage?"poll":Ie.eventMessage?"event":Re(Ie)!==""?"media":"text":"text"},Re=Be=>Be.imageMessage?"image":Be.videoMessage?Be.videoMessage.gifPlayback?"gif":"video":Be.audioMessage?Be.audioMessage.ptt?"ptt":"audio":Be.contactMessage?"vcard":Be.documentMessage?"document":Be.contactsArrayMessage?"contact_array":Be.liveLocationMessage?"livelocation":Be.stickerMessage?"sticker":Be.listMessage?"list":Be.listResponseMessage?"list_response":Be.buttonsResponseMessage?"buttons_response":Be.orderMessage?"order":Be.productMessage?"product":Be.interactiveResponseMessage?"native_flow_response":Be.groupInviteMessage?"url":"",We=async(Be,Ie)=>{let Xe=(Ie??Oa()).toString();return await Q({tag:"iq",attrs:{to:OA,type:"set",xmlns:"privacy"},content:[{tag:"tokens",attrs:{},content:Be.map(Oe=>({tag:"token",attrs:{jid:uA(Oe),t:Xe,type:"trusted_contact"}}))}]})},ve=koe(n,U),aA=VF(c,"messages.media-update");return R(()=>{!n.userDevicesCache&&F.close&&F.close(),G=void 0,V&&V.clear()}),{...g,userDevicesCache:F,devicesMutex:q,issuePrivacyTokens:We,assertSessions:we,relayMessage:fe,sendReceipt:N,sendReceipts:k,readMessages:z,refreshMediaConn:U,getMediaHost:()=>J,waUploadToServer:ve,fetchPrivacySettings:y,sendPeerDataOperationMessage:se,createParticipantNodes:Te,getUSyncDevices:Ae,messageRetryManager:V,updateMemberLabel:ie,updateMediaMessage:async Be=>{let Ie=Voe(Be.message),Xe=Ie.mediaKey,je=I.creds.me.id,Oe=Poe(Be.key,Xe,je),EA;if(await Promise.all([m(Oe),aA(async hA=>{let iA=hA.find(Ze=>Ze.key.id===Be.key.id);if(iA){if(iA.error)EA=iA.error;else try{let Ze=Foe(iA.media,Xe,iA.key.id);if(Ze.result!==oe.MediaRetryNotification.ResultType.SUCCESS){let bA=oe.MediaRetryNotification.ResultType[Ze.result];throw new OE.Boom(`Media re-upload failed by device (${bA})`,{data:Ze,statusCode:sU(Ze.result)||404})}Ie.directPath=Ze.directPath,Ie.url=bf(Ie.directPath,J),t.debug({directPath:Ze.directPath,key:iA.key},"media update successful")}catch(Ze){EA=Ze}return!0}})]),EA)throw EA;return c.emit("messages.update",[{key:Be.key,update:{message:Be.message}}]),Be},sendMessage:async(Be,Ie,Xe={})=>{let je=I.creds.me.id;if(typeof Ie=="object"&&"disappearingMessagesInChat"in Ie&&typeof Ie.disappearingMessagesInChat<"u"&&xr(Be)){let{disappearingMessagesInChat:Oe}=Ie;await _(Be,typeof Oe=="boolean"?Oe?Nf:0:Oe)}else{let Oe=await Joe(Be,Ie,{logger:t,userJid:je,getUrlInfo:Ue=>Jne(Ue,{thumbnailWidth:o,fetchOpts:{timeout:3e3,...e||{}},logger:t,uploadImage:i?ve:void 0}),getProfilePicUrl:g.profilePictureUrl,getCallLink:g.createCallLink,upload:ve,mediaCache:n.mediaCache,options:n.options,messageId:jr(g.user?.id),...Xe}),EA="event"in Ie&&!!Ie.event,hA="delete"in Ie&&!!Ie.delete,iA="edit"in Ie&&!!Ie.edit,Ze="pin"in Ie&&!!Ie.pin,bA="poll"in Ie&&!!Ie.poll,ue={},Ne=[];return hA?xr(Ie.delete?.remoteJid)&&!Ie.delete?.fromMe?ue.edit="8":ue.edit="7":iA?ue.edit="1":Ze?ue.edit="2":bA?Ne.push({tag:"meta",attrs:{polltype:"creation"}}):EA&&Ne.push({tag:"meta",attrs:{event_type:"creation"}}),await fe(Be,Oe.message,{messageId:Oe.key.id,useCachedGroupMetadata:Xe.useCachedGroupMetadata,additionalAttributes:ue,statusJidList:Xe.statusJidList,additionalNodes:Ne}),n.emitOwnEvents&&process.nextTick(async()=>{await d.mutex(()=>f(Oe,"append"))}),Oe}}}};var Z5e=new Set(Object.values(Vc));function X5e(n){return typeof n=="string"&&Z5e.has(n)}var xce=n=>{let{logger:t,retryRequestDelayMs:o,maxMsgRetryCount:i,getMessage:e,shouldIgnoreJid:a,enableAutoSessionRecreation:A}=n,r=Kce(n),{userDevicesCache:s,devicesMutex:g,ev:c,authState:I,ws:d,messageMutex:B,notificationMutex:f,receiptMutex:Q,signalRepository:y,query:m,upsertMessage:T,resyncAppState:_,onUnexpectedError:R,assertSessions:K,sendNode:L,relayMessage:F,sendReceipt:q,uploadPreKeys:V,sendPeerDataOperationMessage:x,messageRetryManager:G,registerSocketEndHandler:J,issuePrivacyTokens:U,fetchAccountReachoutTimelock:N,placeholderResendCache:k}=r,z=y.lidMapping.getLIDForPN.bind(y.lidMapping),Ae=ac(),ie=n.msgRetryCounterCache||new $g({stdTTL:mI.MSG_RETRY,useClones:!1}),we=n.callOfferCache||new $g({stdTTL:mI.CALL_OFFER,useClones:!1}),se=new $g({stdTTL:5,useClones:!1}),Te=!1,fe=async(ee,W,X)=>{if(!I.creds.me?.id)throw new Zf.Boom("Not authenticated");let re={historySyncOnDemandRequest:{chatJid:W.remoteJid,oldestMsgFromMe:W.fromMe,oldestMsgId:W.id,oldestMsgTimestampMs:X,onDemandMsgCount:ee},peerDataOperationRequestType:oe.Message.PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND};return x(re)},ke=async(ee,W)=>{if(!I.creds.me?.id)throw new Zf.Boom("Not authenticated");if(await k.get(ee?.id)){t.debug({messageKey:ee},"already requested resend");return}else await k.set(ee?.id,W||!0);if(await kB(2e3),!await k.get(ee?.id))return t.debug({messageKey:ee},"message received while resend requested"),"RESOLVED";let X={placeholderMessageResendRequest:[{messageKey:ee}],peerDataOperationRequestType:oe.Message.PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND};return setTimeout(async()=>{await k.get(ee?.id)&&(t.debug({messageKey:ee},"PDO message without response after 8 seconds. Phone possibly offline"),await k.del(ee?.id))},8e3),x(X)},Re=async ee=>{let W=le(ee,"update");if(W){let X=W.attrs?.op_name;if(!X){t.warn({node:Gn(ee)},"mex notification missing op_name, fallback to legacy"),await aA(ee);return}let re;try{re=JSON.parse(W.content.toString())}catch(Se){t.error({err:Se,opName:X},"failed to parse mex notification JSON");return}if(re.errors?.length){t.warn({errors:re.errors,opName:X},"mex notification has GQL errors");return}let ne=re.data;if(!ne){t.warn({opName:X},"mex notification has null data");return}switch(t.debug({opName:X},"processing mex notification"),X){case"NotificationUserReachoutTimelockUpdate":We(ne);break;case"MessageCappingInfoNotification":ve(ne);break;case"NotificationNewsletterUpdate":case"NotificationLinkedProfilesUpdates":case"NotificationNewsletterAdminPromote":case"NotificationNewsletterAdminDemote":case"NotificationNewsletterUserSettingChange":case"NotificationNewsletterJoin":case"NotificationNewsletterLeave":case"NotificationNewsletterStateChange":case"NotificationNewsletterAdminMetadataUpdate":case"NotificationNewsletterOwnerUpdate":case"NotificationNewsletterAdminInviteRevoke":case"NotificationNewsletterWamoSubStatusChange":case"NotificationNewsletterBlockUser":case"NotificationNewsletterPaidPartnership":case"NotificationNewsletterMilestone":case"NewsletterResponseStateUpdate":await aA(ee);break;default:t.debug({opName:X},"unhandled mex notification");break}return}await aA(ee)},We=ee=>{let W=ee.xwa2_notify_account_reachout_timelock;if(!W){t.warn("reachout timelock notification missing payload");return}if(!W.is_active){t.info("reachout timelock restriction lifted"),c.emit("connection.update",{reachoutTimeLock:{isActive:!1,enforcementType:Vc.DEFAULT}});return}let X=W.time_enforcement_ends?new Date(parseInt(W.time_enforcement_ends,10)*1e3):new Date(Date.now()+6e4),re=X5e(W.enforcement_type)?W.enforcement_type:Vc.DEFAULT;t.info({enforcementType:re,timeEnforcementEnds:X},"reachout timelock restriction set"),c.emit("connection.update",{reachoutTimeLock:{isActive:!0,timeEnforcementEnds:X,enforcementType:re}})},ve=ee=>{let W=ee.xwa2_notify_new_chat_messages_capping_info_update;if(!W){t.warn("message capping notification missing payload");return}t.info({payload:W},"received message capping update"),c.emit("message-capping.update",W)},aA=async ee=>{let W=le(ee,"mex"),X=W?.content?null:le(ee,"update")||_s(ee)[0],re=W?.content?W:X;if(!re?.content){t.warn({node:Gn(ee)},"invalid mex newsletter notification");return}let ne;try{let he=re.content;if(Array.isArray(he)){t.warn({payloadNode:re},"invalid mex newsletter notification payload format");return}let ye=typeof he=="string"?Buffer.from(he,"binary"):Buffer.from(he);ne=JSON.parse(ye.toString())}catch(he){t.error({err:he,node:Gn(ee)},"failed to parse mex newsletter notification");return}let Se=ne?.operation??re?.attrs?.op_name,Ee=ne?.updates;if(!Ee){let he=ne?.data?.xwa2_notify_linked_profiles;he&&(Ee=[he])}if(!Ee||!Se){t.warn({data:ne},"invalid mex newsletter notification content");return}switch(t.info({operation:Se,updates:Ee},"got mex newsletter notification"),Se){case"NotificationNewsletterUpdate":for(let he of Ee)he.jid&&he.settings&&Object.keys(he.settings).length>0&&c.emit("newsletter-settings.update",{id:he.jid,update:he.settings});break;case"NotificationNewsletterAdminPromote":for(let he of Ee)he.jid&&he.user&&c.emit("newsletter-participants.update",{id:he.jid,author:ee.attrs.from,user:he.user,new_role:"ADMIN",action:"promote"});break;case"NotificationLinkedProfilesUpdates":for(let he of Ee){let ye=he?.jid,Je=Array.isArray(he?.added_profiles)?he.added_profiles:[],IA=[];for(let yA of Je){let XA=typeof yA=="string"?yA:yA?.pn??yA?.jid??null;if(ye&&XA){let vA={lid:ye,pn:XA};c.emit("lid-mapping.update",vA),IA.push(vA)}}await y.lidMapping.storeLIDPNMappings(IA)}break;default:t.info({operation:Se,data:ne},"unhandled mex newsletter notification");break}},Be=async ee=>{let W=ee.attrs.from,X=_s(ee),re=ee.attrs.participant;for(let ne of X)switch(t.debug({from:W,child:ne},"got newsletter notification"),ne.tag){case"reaction":{let Se={id:W,server_id:ne.attrs.message_id,reaction:{code:jA(ne,"reaction"),count:1}};c.emit("newsletter.reaction",Se);break}case"view":{let Se={id:W,server_id:ne.attrs.message_id,count:parseInt(ne.content?.toString()||"0",10)};c.emit("newsletter.view",Se);break}case"participant":{let Se={id:W,author:re,user:ne.attrs.jid,action:ne.attrs.action,new_role:ne.attrs.role};c.emit("newsletter-participants.update",Se);break}case"update":{let Se=le(ne,"settings");if(Se){let Ee={},he=le(Se,"name");he?.content&&(Ee.name=he.content.toString());let ye=le(Se,"description");ye?.content&&(Ee.description=ye.content.toString()),c.emit("newsletter-settings.update",{id:W,update:Ee})}break}case"message":{let Se=le(ne,"plaintext");if(Se?.content)try{let Ee=typeof Se.content=="string"?Buffer.from(Se.content,"binary"):Buffer.from(Se.content),he=oe.Message.decode(Ee).toJSON(),ye=oe.WebMessageInfo.fromObject({key:{remoteJid:W,id:ne.attrs.message_id||ne.attrs.server_id,fromMe:!1},message:he,messageTimestamp:+ne.attrs.t}).toJSON();await T(ye,"append"),t.debug("Processed plaintext newsletter message")}catch(Ee){t.error({error:Ee},"Failed to decode plaintext newsletter message")}break}default:t.warn({node:ee,child:ne},"Unknown newsletter notification child");break}},Ie=async(ee,W)=>{let X=Ase(ee,W,I.creds.me.id);t.debug({recv:{tag:ee.tag,attrs:ee.attrs},sent:X.attrs},"sent ack"),await L(X)},Xe=async(ee,W)=>{let X={tag:"call",attrs:{from:I.creds.me.id,to:W},content:[{tag:"reject",attrs:{"call-id":ee,"call-creator":W,count:"0"},content:void 0}]};await m(X)},je=async(ee,W=!1)=>{let{fullMessage:X}=ZF(ee,I.creds.me.id,I.creds.me.lid||""),{key:re}=X,ne=re.id;if(G){if(G.hasExceededMaxRetries(ne)){t.debug({msgId:ne},"reached retry limit with new retry manager, clearing"),G.markRetryFailed(ne);return}let YA=G.incrementRetryCount(ne),$A=`${ne}:${re?.participant}`;await ie.set($A,YA)}else{let YA=`${ne}:${re?.participant}`,$A=await ie.get(YA)||0;if($A>=i){t.debug({retryCount:$A,msgId:ne},"reached retry limit, clearing"),await ie.del(YA);return}$A+=1,await ie.set(YA,$A)}let Se=`${ne}:${re?.participant}`,Ee=await ie.get(Se)||1,{account:he,signedPreKey:ye,signedIdentityKey:Je}=I.creds,IA=ee.attrs.from,yA=!1,XA="";if(A&&G&&Ee>1)try{let YA=y.jidToSignalProtocolAddress(IA),$A=await y.validateSession(IA),Ge=G.shouldRecreateSession(IA,$A.exists);yA=Ge.recreate,XA=Ge.reason,yA&&(t.debug({fromJid:IA,retryCount:Ee,reason:XA},"recreating session for retry"),await I.keys.set({session:{[YA]:null}}),W=!0)}catch(YA){t.warn({error:YA,fromJid:IA},"failed to check session recreation")}if(Ee<=2)if(G)G.schedulePhoneRequest(ne,async()=>{try{let YA=await ke(re);t.debug(`sendRetryRequest: requested placeholder resend (${YA}) for message ${ne} (scheduled)`)}catch(YA){t.warn({error:YA,msgId:ne},"failed to send scheduled phone request")}});else{let YA=await ke(re);t.debug(`sendRetryRequest: requested placeholder resend for message ${YA}`)}let vA=kf(he,!0);await I.keys.transaction(async()=>{let YA={tag:"receipt",attrs:{id:ne,type:"retry",to:ee.attrs.from},content:[{tag:"retry",attrs:{count:Ee.toString(),id:ee.attrs.id,t:ee.attrs.t,v:"1",error:"0"}},{tag:"registration",attrs:{},content:Kg(I.creds.registrationId)}]};if(ee.attrs.recipient&&(YA.attrs.recipient=ee.attrs.recipient),ee.attrs.participant&&(YA.attrs.participant=ee.attrs.participant),Ee>1||W||yA){let{update:$A,preKeys:Ge}=await uU(I,1),[tA]=Object.keys(Ge),et=Ge[+tA];YA.content.push({tag:"keys",attrs:{},content:[{tag:"type",attrs:{},content:Buffer.from(Hg)},{tag:"identity",attrs:{},content:Je.public},CU(et,+tA),Rf(ye),{tag:"device-identity",attrs:{},content:vA}]}),c.emit("creds.update",$A)}await L(YA),t.info({msgAttrs:ee.attrs,retryCount:Ee},"sent retry receipt")},I?.creds?.me?.id||"sendRetryRequest")},Oe=new Set,EA=ee=>{(async()=>{let W=uA(ee),X=await Xs(W,z),ne=(await I.keys.get("tctoken",[X]))?.[X]?.senderTimestamp;if(ne==null||gp(ne))return;t.debug({jid:W,senderTimestamp:ne},"identity changed, re-issuing tctoken");let Se=y.lidMapping.getPNForLID.bind(y.lidMapping),Ee=await Lf(W,r.serverProps.lidTrustedTokenIssueToLid,z,Se),he=await U([Ee],ne);await dE({result:he,fallbackJid:X,keys:I.keys,getLIDForPN:z,onNewJidStored:_A})})().catch(W=>{t.debug({jid:ee,err:W?.message},"failed to re-issue tctoken after identity change")})},hA=async ee=>{if(ee.attrs.from===OA){let X=ee.attrs.id;if(X&&Oe.has(X))return;let ne=+le(ee,"count").attrs.value,Se=ne{let re=ee.attrs.participant,ne=ee.attrs.participant_pn,Se=ee.attrs.participant_username,Ee=le(W,"participant")?.attrs?.jid||re,he=le(W,"participant")?.attrs?.phone_number||ne;switch(W?.tag){case"create":let ye=DE(W);X.messageStubType=RA.GROUP_CREATE,X.messageStubParameters=[ye.subject],X.key={participant:ye.owner,participantAlt:ye.ownerPn},c.emit("chats.upsert",[{id:ye.id,name:ye.subject,conversationTimestamp:ye.creation}]),c.emit("groups.upsert",[{...ye,author:re,authorPn:ne,authorUsername:Se}]);break;case"ephemeral":case"not_ephemeral":X.message={protocolMessage:{type:oe.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:+(W.attrs.expiration||0)}};break;case"modify":let Je=PA(W,"participant").map(Ge=>Ge.attrs.jid);X.messageStubParameters=Je||[],X.messageStubType=RA.GROUP_PARTICIPANT_CHANGE_NUMBER;break;case"promote":case"demote":case"remove":case"add":case"leave":let IA=`GROUP_PARTICIPANT_${W.tag.toUpperCase()}`;X.messageStubType=RA[IA];let yA=PA(W,"participant").map(({attrs:Ge})=>({id:Ge.jid,phoneNumber:qA(Ge.jid)&&_t(Ge.phone_number)?Ge.phone_number:void 0,lid:_t(Ge.jid)&&qA(Ge.lid)?Ge.lid:void 0,username:Ge.participant_username||Ge.username||void 0,admin:Ge.type||null}));yA.length===1&&(Nt(yA[0].id,re)||Nt(yA[0].id,ne))&&W.tag==="remove"&&(X.messageStubType=RA.GROUP_PARTICIPANT_LEAVE),X.messageStubParameters=yA.map(Ge=>JSON.stringify(Ge));break;case"subject":X.messageStubType=RA.GROUP_CHANGE_SUBJECT,X.messageStubParameters=[W.attrs.subject];break;case"description":let XA=le(W,"body")?.content?.toString();X.messageStubType=RA.GROUP_CHANGE_DESCRIPTION,X.messageStubParameters=XA?[XA]:void 0;break;case"announcement":case"not_announcement":X.messageStubType=RA.GROUP_CHANGE_ANNOUNCE,X.messageStubParameters=[W.tag==="announcement"?"on":"off"];break;case"locked":case"unlocked":X.messageStubType=RA.GROUP_CHANGE_RESTRICT,X.messageStubParameters=[W.tag==="locked"?"on":"off"];break;case"invite":X.messageStubType=RA.GROUP_CHANGE_INVITE_LINK,X.messageStubParameters=[W.attrs.code];break;case"member_add_mode":let vA=W.content;vA&&(X.messageStubType=RA.GROUP_MEMBER_ADD_MODE,X.messageStubParameters=[vA.toString()]);break;case"membership_approval_mode":let YA=le(W,"group_join");YA&&(X.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE,X.messageStubParameters=[YA.attrs.state]);break;case"created_membership_requests":X.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,X.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),"created",W.attrs.request_method];break;case"revoked_membership_requests":let $A=Nt(Ee,re);X.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,X.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),$A?"revoked":"rejected"];break}},Ze=async ee=>{let[W]=_s(ee),X=uA(ee.attrs.from);if(!W){t.debug({from:X},"devices notification missing child, skipping");return}let re=W.tag,ne=W.attrs.device_hash,Se=PA(W,"device");if(Nt(X,I.creds.me.id)||Nt(X,I.creds.me.lid)){let he=Se.map(ye=>ye.attrs.jid);t.info({deviceJids:he},"got my own devices")}if(!Se.length){t.debug({from:X,tag:re},"no devices in notification, skipping");return}let Ee=[];for(let he of Se){let ye=he.attrs.jid;if(!ye)continue;let Je=fA(ye);if(!Je){t.debug({jid:ye},"failed to decode device jid, skipping");continue}Ee.push({jid:ye,user:Je.user,server:Je.server,device:Je.device})}Ee.length&&await g.mutex(async()=>{let he=new Map;for(let ye of Ee){let Je=he.get(ye.user)||[];Je.push(ye),he.set(ye.user,Je)}for(let[ye,Je]of he){if(re==="update"){t.debug({user:ye},`${ye}'s device list updated, dropping cached devices`),await s?.del(ye);continue}re==="remove"&&await y.deleteSession(Je.map(vA=>vA.jid));let IA=await s?.get(ye)||[];if(!IA.length){t.debug({user:ye,tag:re},"device list not cached, deferring to USync refresh");continue}let yA=new Set(Je.map(vA=>vA.device)),XA;switch(re){case"add":t.info({deviceHash:ne,count:Je.length},"devices added"),XA=[...IA.filter(vA=>!yA.has(vA.device)),...Je.map(vA=>({user:vA.user,server:vA.server,device:vA.device}))];break;case"remove":t.info({deviceHash:ne,count:Je.length},"devices removed"),XA=IA.filter(vA=>!yA.has(vA.device));break;default:t.debug({tag:re},"Unknown device list change tag");continue}XA.length===0?await s?.del(ye):await s?.set(ye,XA)}})},bA=async ee=>{let W={},[X]=_s(ee),re=ee.attrs.type,ne=uA(ee.attrs.from);switch(re){case"newsletter":await Be(ee);break;case"mex":await Re(ee);break;case"w:gp2":iA(ee,X,W);break;case"mediaretry":let Se=Goe(ee);c.emit("messages.media-update",[Se]);break;case"encrypt":await hA(ee);break;case"devices":try{await Ze(ee)}catch(mo){t.error({error:mo,node:ee},"failed to handle devices notification")}break;case"server_sync":let Ee=le(ee,"collection");if(Ee){let mo=Ee.attrs.name;await _([mo],!1)}break;case"picture":let he=le(ee,"set"),ye=le(ee,"delete");if(c.emit("contacts.update",[{id:uA(ee?.attrs?.from)||(he||ye)?.attrs?.hash||"",imgUrl:he?"changed":"removed"}]),xr(ne)){let mo=he||ye;W.messageStubType=RA.GROUP_CHANGE_ICON,he&&(W.messageStubParameters=[he.attrs.id]),W.participant=mo?.attrs.author,W.key={...W.key||{},participant:he?.attrs.author}}break;case"account_sync":if(X.tag==="disappearing_mode"){let mo=+X.attrs.duration,yp=+X.attrs.t;t.info({newDuration:mo},"updated account disappearing mode"),c.emit("creds.update",{accountSettings:{...I.creds.accountSettings,defaultDisappearingMode:{ephemeralExpiration:mo,ephemeralSettingTimestamp:yp}}})}else if(X.tag==="blocklist"){let mo=PA(X,"item");for(let{attrs:yp}of mo){let bM=[yp.jid],MM=yp.action==="block"?"add":"remove";c.emit("blocklist.update",{blocklist:bM,type:MM})}}break;case"link_code_companion_reg":let Je=le(ee,"link_code_companion_reg"),IA=lt(Da(Je,"link_code_pairing_ref")),yA=lt(Da(Je,"primary_identity_pub")),XA=lt(Da(Je,"link_code_pairing_wrapped_primary_ephemeral_pub")),vA=await wA(XA),YA=Sr.sharedKey(I.creds.pairingEphemeralKeyPair.private,vA),$A=VH(32),Ge=VH(32),tA=Un(YA,32,{salt:Ge,info:"link_code_pairing_key_bundle_encryption_key"}),et=Buffer.concat([Buffer.from(I.creds.signedIdentityKey.public),yA,$A]),Zr=VH(12),ar=Pl(et,tA,Zr,Buffer.alloc(0)),yo=Buffer.concat([Ge,Zr,ar]),DM=Sr.sharedKey(I.creds.signedIdentityKey.private,yA),OM=Buffer.concat([YA,DM,$A]);I.creds.advSecretKey=Buffer.from(Un(OM,32,{info:"adv_secret"})).toString("base64"),await m({tag:"iq",attrs:{to:OA,type:"set",id:r.generateMessageTag(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:I.creds.me.id,stage:"companion_finish"},content:[{tag:"link_code_pairing_wrapped_key_bundle",attrs:{},content:yo},{tag:"companion_identity_public",attrs:{},content:I.creds.signedIdentityKey.public},{tag:"link_code_pairing_ref",attrs:{},content:IA}]}]}),I.creds.registered=!0,c.emit("creds.update",I.creds);break;case"privacy_token":await at(ee);break}if(Object.keys(W).length)return W},ue=new Set,Ne=(async()=>{try{let ee=await _b(I.keys);for(let W of ee)ue.add(W);t.debug({count:ue.size},"loaded tctoken index")}catch(ee){t.warn({err:ee?.message},"failed to load tctoken index")}})(),Ue;async function MA(){Ue&&(clearTimeout(Ue),Ue=void 0);let ee=await pE(I.keys,ue);return I.keys.set({tctoken:ee})}function Ke(){Ue&&clearTimeout(Ue),Ue=setTimeout(()=>{Ue=void 0,MA().catch(ee=>{t.warn({err:ee?.message},"failed to save tctoken index")})},5e3)}function _A(ee){ee&&ee!==SI&&!ue.has(ee)&&(ue.add(ee),Ke())}let at=async ee=>{if(!le(ee,"tokens"))return;let X=uA(ee.attrs.from),ne=(ee.attrs.sender_lid&&qA(uA(ee.attrs.sender_lid))?uA(ee.attrs.sender_lid):void 0)??await Xs(X,z);t.debug({from:X,storageJid:ne},"processing privacy token notification"),await dE({result:ee,fallbackJid:ne,keys:I.keys,getLIDForPN:z,onNewJidStored:_A})};async function wA(ee){let W=lt(ee),X=W.slice(0,32),re=await hD(I.creds.pairingCode,X),ne=W.slice(32,48),Se=W.slice(48,80);return k7(Se,re,ne)}function lt(ee){if(ee===void 0)throw new Zf.Boom("Invalid buffer",{statusCode:400});return ee instanceof Buffer?ee:Buffer.from(ee)}let Er=async(ee,W)=>{let X=`${ee}:${W}`;return(await ie.get(X)||0){let X=`${ee}:${W}`,re=(await ie.get(X)||0)+1;await ie.set(X,re)},pe=async(ee,W,X,re)=>{let ne=ee.remoteJid,Se=ee.participant||ne,Ee=+X.attrs.count||1,he=W[0],ye=[];for(let Ge of W){let tA;if(G){let et=G.getRecentMessage(ne,Ge);et&&(tA=et.message,t.debug({jid:ne,id:Ge},"found message in retry cache"),G.markRetrySuccess(Ge))}tA||(tA=await e({...ee,id:Ge}),tA&&(t.debug({jid:ne,id:Ge},"found message via getMessage"),G&&G.markRetrySuccess(Ge))),ye.push(tA)}let Je=!fA(Se)?.device,IA=y.jidToSignalProtocolAddress(Se),yA=!1,XA=Ane(re);if(XA)try{await y.injectE2ESession({jid:Se,session:XA}),yA=!0,t.debug({participant:Se,retryCount:Ee},"injected session from retry receipt key bundle")}catch(Ge){t.warn({error:Ge,participant:Se},"failed to inject session from retry receipt")}if(!yA){let Ge=Zc(re,"registration",4);if(typeof Ge=="number"&&Number.isInteger(Ge)){let tA=await y.getSessionInfo(Se);tA&&tA.registrationId!==0&&tA.registrationId!==Ge&&(t.info({participant:Se,stored:tA.registrationId,received:Ge},"reg id mismatch on retry without bundle, deleting session"),await I.keys.set({session:{[IA]:null}}))}}let vA=2;if(he&&G){let Ge=await y.getSessionInfo(Se);Ge&&(Ee===vA?G.saveBaseKey(IA,he,Ge.baseKey):Ee>vA&&(G.hasSameBaseKey(IA,he,Ge.baseKey)&&(t.warn({participant:Se,retryCount:Ee},"base key collision on retry, forcing fresh session"),await I.keys.set({session:{[IA]:null}})),G.deleteBaseKey(IA,he)))}let YA=!1,$A="";if(A&&G&&Ee>1&&!yA)try{let Ge=await y.validateSession(Se),tA=G.shouldRecreateSession(Se,Ge.exists);YA=tA.recreate,$A=tA.reason,YA&&(t.debug({participant:Se,retryCount:Ee,reason:$A},"recreating session for outgoing retry"),await I.keys.set({session:{[IA]:null}}))}catch(Ge){t.warn({error:Ge,participant:Se},"failed to check session recreation for outgoing retry")}yA||await K([Se],!0),xr(ne)&&await I.keys.set({"sender-key-memory":{[ne]:null}}),t.debug({participant:Se,sendToAll:Je,shouldRecreateSession:YA,recreateReason:$A,injectedFromBundle:yA},"prepared session for retry resend");for(let[Ge,tA]of ye.entries())if(W[Ge])if(tA&&await Er(W[Ge],Se)){await UA(W[Ge],Se);let et={messageId:W[Ge]};Je?et.useUserDevicesCache=!1:et.participant={jid:Se,count:+X.attrs.count},await F(ee.remoteJid,tA,et)}else t.debug({jid:ee.remoteJid,id:W[Ge]},"recv retry request, but message not available")},Qe=async ee=>{let{attrs:W,content:X}=ee,re=W.from.includes("lid"),ne=Nt(W.participant||W.from,re?I.creds.me?.lid:I.creds.me?.id),Se=!ne||xr(W.from)?W.from:W.recipient,Ee=!W.recipient||(W.type==="retry"||W.type==="sender")&&ne,he={remoteJid:Se,id:"",fromMe:Ee,participant:W.participant},ye=[W.id];if(Array.isArray(X)){let Je=PA(X[0],"item");ye.push(...Je.map(IA=>IA.attrs.id))}try{await Promise.all([Q.mutex(async()=>{let Je=J7(W.type);if(typeof Je<"u"&&(Je>=oe.WebMessageInfo.Status.SERVER_ACK||!ne))if(xr(Se)||Lg(Se)){if(W.participant){let IA=Je===oe.WebMessageInfo.Status.DELIVERY_ACK?"receiptTimestamp":"readTimestamp";c.emit("message-receipt.update",ye.map(yA=>({key:{...he,id:yA},receipt:{userJid:uA(W.participant),[IA]:+W.t}})))}}else c.emit("messages.update",ye.map(IA=>({key:{...he,id:IA},update:{status:Je,messageTimestamp:Yr(+(W.t??0))}})));if(W.type==="retry"){he.participant=he.participant||W.from;let IA=le(ee,"retry");if(ye[0]&&he.participant&&await Er(ye[0],he.participant))if(he.fromMe)try{await UA(ye[0],he.participant),t.debug({attrs:W,key:he},"recv retry request"),await pe(he,ye,IA,ee)}catch(yA){t.error({key:he,ids:ye,trace:yA instanceof Error?yA.stack:"Unknown error"},"error in sending message again")}else t.info({attrs:W,key:he},"recv retry for not fromMe message");else t.info({attrs:W,key:he},"will not send message again, as sent too many times")}})])}finally{await Ie(ee).catch(Je=>t.error({ackErr:Je},"failed to ack receipt"))}},be=async ee=>{let W=ee.attrs.from;try{await Promise.all([f.mutex(async()=>{let X=await bA(ee);if(X){let re=Nt(ee.attrs.participant||W,I.creds.me.id),{senderAlt:ne,addressingMode:Se}=BD(ee);X.key={remoteJid:W,fromMe:re,participant:ee.attrs.participant,participantAlt:ne,participantUsername:ee.attrs.participant_username,addressingMode:Se,id:ee.attrs.id,...X.key||{}},X.participant??(X.participant=ee.attrs.participant),X.messageTimestamp=+ee.attrs.t;let Ee=oe.WebMessageInfo.fromObject(X);await T(Ee,"append")}})])}finally{await Ie(ee).catch(X=>t.error({ackErr:X},"failed to ack notification"))}},oA=async ee=>{if(le(ee,"enc")?.attrs.type==="msmsg"){t.debug({key:ee.attrs.key},"ignored msmsg"),await Ie(ee,Ll.MissingMessageSecret);return}let X=!1;try{let{fullMessage:re,category:ne,author:Se,decrypt:Ee}=e$(ee,I.creds.me.id,I.creds.me.lid||"",y,t),he=re.key.participantAlt||re.key.remoteJidAlt;if(he){let ye=fA(he)?.server,Je=re.key.participant||re.key.remoteJid;ye==="lid"?await y.lidMapping.getPNForLID(he)||(await y.lidMapping.storeLIDPNMappings([{lid:he,pn:Je}]),await y.migrateSession(Je,he)):(await y.lidMapping.storeLIDPNMappings([{lid:Je,pn:he}]),await y.migrateSession(he,Je))}await B.mutex(async()=>{if(await Ee(),re.key?.remoteJid&&re.key?.id&&re.message&&G&&G.addRecentMessage(re.key.remoteJid,re.key.id,re.message),re.messageStubType===oe.WebMessageInfo.StubType.CIPHERTEXT&&re.category!=="peer"){if(re?.messageStubParameters?.[0]===X7)return X=!0,Ie(ee,Ll.ParsingError);if(re.messageStubParameters?.[0]===uD){let Je=le(ee,"unavailable")?.attrs?.type;if(Je==="bot_unavailable_fanout"||Je==="hosted_unavailable_fanout"||Je==="view_once_unavailable_fanout")return t.debug({msgId:re.key.id,unavailableType:Je},"skipping placeholder resend for excluded unavailable type"),X=!0,Ie(ee);let IA=Oa()-Yr(re.messageTimestamp);if(IA>Ece)return t.debug({msgId:re.key.id,messageAge:IA},"skipping placeholder resend for old message"),X=!0,Ie(ee);let yA={remoteJid:re.key.remoteJid,fromMe:re.key.fromMe,id:re.key.id,participant:re.key.participant},XA={key:re.key,messageTimestamp:re.messageTimestamp,pushName:re.pushName,participant:re.participant,verifiedBizName:re.verifiedBizName};ke(yA,XA).then(vA=>{vA&&vA!=="RESOLVED"&&(t.debug({msgId:re.key.id,requestId:vA},"requested placeholder resend for unavailable message"),c.emit("messages.update",[{key:re.key,update:{messageStubParameters:[uD,vA]}}]))}).catch(vA=>{t.warn({err:vA,msgId:re.key.id},"failed to request placeholder resend for unavailable message")}),X=!0,await Ie(ee)}else{if(Lg(re.key.remoteJid)){let ye=Oa()-Yr(re.messageTimestamp);if(ye>hce)return t.debug({msgId:re.key.id,messageAge:ye,remoteJid:re.key.remoteJid},"skipping retry for expired status message"),X=!0,Ie(ee)}t.debug("[handleMessage] Attempting retry request for failed decryption"),await Ae.mutex(async()=>{try{if(!d.isOpen){t.debug({node:ee},"Connection closed, skipping retry");return}let ye=le(ee,"enc");await je(ee,!ye),o&&await kB(o)}catch(ye){t.error({err:ye},"Failed to send retry")}X=!0,await Ie(ee,Ll.UnhandledError)})}}else if(G&&re.key.id&&G.cancelPendingPhoneRequest(re.key.id),Wc(re.key.remoteJid))X=!0,await Ie(ee),t.debug({key:re.key},"processed newsletter message without receipts");else{let Je,IA=re.key.participant;if(ne==="peer"?Je="peer_msg":re.key.fromMe?(Je="sender",(qA(re.key.remoteJid)||qA(re.key.remoteJidAlt))&&(IA=Se)):Te||(Je="inactive"),X=!0,await q(re.key.remoteJid,IA,[re.key.id],Je),mb(re.message)){let XA=uA(re.key.remoteJid);await q(XA,void 0,[re.key.id],"hist_sync")}}zne(re,I.creds.me.id,I.creds.me.lid),await T(re,ee.attrs.offline?"append":"notify")})}catch(re){t.error({error:re,node:Gn(ee)},"error in handling message"),X||await Ie(ee,Ll.UnhandledError).catch(ne=>t.error({ackErr:ne},"failed to ack message after error"))}},pA=async ee=>{try{let{attrs:W}=ee,[X]=_s(ee);if(!X)throw new Zf.Boom("Missing call info in call node");let re=z7(X),ne=X.attrs["call-id"],Se=X.attrs.from||X.attrs["call-creator"],Ee={chatId:W.from,from:Se,callerPn:X.attrs.caller_pn,id:ne,date:new Date(+W.t*1e3),offline:!!W.offline,status:re};if(re==="relaylatency"){let ye=X.attrs.latency||X.attrs.latency_ms||X.attrs["latency-ms"],Je=ye?Number(ye):void 0;Number.isFinite(Je)&&(Ee.latencyMs=Je)}re==="offer"&&(Ee.isVideo=!!le(X,"video"),Ee.isGroup=X.attrs.type==="group"||!!X.attrs["group-jid"],Ee.groupJid=X.attrs["group-jid"],await we.set(Ee.id,Ee));let he=await we.get(Ee.id);he&&(Ee.isVideo=he.isVideo,Ee.isGroup=he.isGroup,Ee.callerPn=Ee.callerPn||he.callerPn),(re==="reject"||re==="accept"||re==="timeout"||re==="terminate")&&await we.del(Ee.id),c.emit("call",[Ee])}catch(W){t.error({error:W,node:Gn(ee)},"error in handling call")}finally{await Ie(ee).catch(W=>t.error({ackErr:W},"failed to ack call"))}},FA=async({attrs:ee})=>{let W={remoteJid:ee.from,fromMe:!0,id:ee.id};if(ee.error){let X=ee.error===String(Ll.SenderReachoutTimelocked);if(ee.error===WF.MessageAccountRestriction){t.warn({msgId:ee.id,from:ee.from},"error 463: account restricted or missing tctoken for contact");let re=ee.from;re&&!Qo.has(re)&&(Qo.add(re),(async()=>{try{let ne=y.lidMapping.getPNForLID.bind(y.lidMapping),Se=await Xs(re,z),Ee=await Lf(re,r.serverProps.lidTrustedTokenIssueToLid,z,ne),he=await U([Ee],Oa());await dE({result:he,fallbackJid:Se,keys:I.keys,getLIDForPN:z,onNewJidStored:_A}),t.debug({from:re},"completed 463 token recovery issuance")}catch(ne){t.debug({from:re,err:ne?.message},"failed 463 token recovery issuance")}finally{Qo.delete(re)}})())}else ee.error===WF.SmaxInvalid?t.warn({msgId:ee.id,from:ee.from},"smax-invalid (479): stanza rejected by server \u2014 likely stale device session or malformed addressing"):X?(await N().catch(re=>t.warn({err:re},"failed to fetch reachout timelock")),t.warn({attrs:ee},"received error in ack")):t.warn({attrs:ee},"received error in ack");c.emit("messages.update",[{key:W,update:{status:Ih.ERROR,messageStubParameters:X?[ee.error,$7]:[ee.error]}}])}},Kt=async(ee,W,X)=>{c.buffer(),await re(),c.flush();function re(){return X(ee,!1).catch(ne=>R(ne,W))}},st=Gce(new Map([["message",oA],["call",pA],["receipt",Qe],["notification",be]]),{isWsOpen:()=>d.isOpen,onUnexpectedError:R,yieldToEventLoop:()=>new Promise(ee=>setImmediate(ee))}),Dr=async(ee,W,X,re)=>{let ne=W.attrs.from,Se=ne;if(ee==="receipt"&&ne){let he=W.attrs,ye=he.from.includes("lid");Se=!Nt(he.participant||he.from,ye?I.creds.me?.lid:I.creds.me?.id)||xr(he.from)?he.from:he.recipient}if(Se&&Se!==OA&&a(Se)){await Ie(W,ee==="message"?Ll.UnhandledError:void 0);return}!!W.attrs.offline?st.enqueue(ee,W):await Kt(W,X,re)};d.on("CB:message",async ee=>{await Dr("message",ee,"processing message",oA)}),d.on("CB:call",async ee=>{await Dr("call",ee,"handling call",pA)}),d.on("CB:receipt",async ee=>{await Dr("receipt",ee,"handling receipt",Qe)}),d.on("CB:notification",async ee=>{await Dr("notification",ee,"handling notification",be)}),d.on("CB:ack,class:message",ee=>{FA(ee).catch(W=>R(W,"handling bad ack"))}),c.on("call",async([ee])=>{if(ee&&(ee.status==="timeout"||ee.status==="offer"&&ee.isGroup)){let W={key:{remoteJid:ee.chatId,id:ee.id,fromMe:!1},messageTimestamp:Oa(ee.date)};ee.status==="timeout"?ee.isGroup?W.messageStubType=ee.isVideo?RA.CALL_MISSED_GROUP_VIDEO:RA.CALL_MISSED_GROUP_VOICE:W.messageStubType=ee.isVideo?RA.CALL_MISSED_VIDEO:RA.CALL_MISSED_VOICE:W.message={call:{callKey:Buffer.from(ee.id)}};let X=oe.WebMessageInfo.fromObject(W);await T(X,ee.offline?"append":"notify")}});let rr=0,Qo=new Set;c.on("connection.update",({isOnline:ee,connection:W})=>{if(typeof ee<"u"&&(Te=ee,t.trace(`sendActiveReceipts set to "${Te}"`)),W==="close"&&Ue){clearTimeout(Ue),Ue=void 0;try{Promise.resolve(MA()).catch(()=>{})}catch{}}if(ee){let X=Date.now(),re=1440*60*1e3;X-rr>=re&&(rr=X,$i())}}),J(()=>{!n.msgRetryCounterCache&&ie.close&&ie.close(),!n.callOfferCache&&we.close&&we.close(),se.close(),Te=!1});async function $i(){try{await Ne;let ee=await _b(I.keys),W=new Set(ue);for(let he of ee)W.add(he);if(!W.size)return;let X=[...W],re=await I.keys.get("tctoken",X),ne={},Se=new Set,Ee=0;for(let he of X){let ye=re[he];if(!ye){Ee++;continue}let Je=!!ye.token?.length,IA=Je&&gp(ye.timestamp),yA=ye.senderTimestamp!==void 0,XA=yA&&gp(ye.senderTimestamp),vA=Je&&!IA,YA=yA&&!XA;!vA&&!YA?(ne[he]=null,Ee++):IA&&YA?(ne[he]={token:Buffer.alloc(0),senderTimestamp:ye.senderTimestamp},Se.add(he),Ee++):Se.add(he)}if(Ee===0)return;await I.keys.set({tctoken:{...ne,[SI]:{token:Buffer.from(JSON.stringify([...Se]))}}}),ue.clear();for(let he of Se)ue.add(he);t.debug({mutated:Ee,remaining:Se.size},"pruned expired tctokens")}catch(ee){t.warn({err:ee?.message},"failed to prune expired tctokens")}}return{...r,sendMessageAck:Ie,sendRetryRequest:je,rejectCall:Xe,fetchMessageHistory:fe,requestPlaceholderResend:ke,messageRetryManager:G}};var Yce=n=>{let t=xce(n),{authState:o,query:i,waUploadToServer:e}=t,a=async f=>{let Q=[],y=["address","email","description"];return Q.push(...y.filter(T=>f[T]!==void 0&&f[T]!==null).map(T=>({tag:T,attrs:{},content:f[T]}))),f.websites!==void 0&&Q.push(...f.websites.map(T=>({tag:"website",attrs:{},content:T}))),f.hours!==void 0&&Q.push({tag:"business_hours",attrs:{timezone:f.hours.timezone},content:f.hours.days.map(T=>{let _={tag:"business_hours_config",attrs:{day_of_week:T.day,mode:T.mode}};return T.mode==="specific_hours"?{..._,attrs:{..._.attrs,open_time:T.openTimeInMinutes,close_time:T.closeTimeInMinutes}}:_})}),await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:Q}]})},A=async f=>{let{fileSha256:Q,filePath:y}=await Cb(f,"biz-cover-photo"),m=Q.toString("base64"),{meta_hmac:T,fbid:_,ts:R}=await e(y,{fileEncSha256B64:m,mediaType:"biz-cover-photo"});return await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{id:String(_),op:"update",token:T,ts:String(R)}}]}]}),_},r=async f=>await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{op:"delete",id:f}}]}]}),s=async({jid:f,limit:Q,cursor:y})=>{f=f||o.creds.me?.id,f=uA(f);let m=[{tag:"limit",attrs:{},content:Buffer.from((Q||10).toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}];y&&m.push({tag:"after",attrs:{},content:y});let T=await i({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog",attrs:{jid:f,allow_shop_source:"true"},content:m}]});return mce(T)},g=async(f,Q=51)=>{f=f||o.creds.me?.id,f=uA(f);let y=await i({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog",smax_id:"35"},content:[{tag:"collections",attrs:{biz_jid:f},content:[{tag:"collection_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"item_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]}]});return Sce(y)},c=async(f,Q)=>{let y=await i({tag:"iq",attrs:{to:OA,type:"get",xmlns:"fb:thrift_iq",smax_id:"5"},content:[{tag:"order",attrs:{op:"get",id:f},content:[{tag:"image_dimensions",attrs:{},content:[{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]},{tag:"token",attrs:{},content:Buffer.from(Q)}]}]});return wce(y)},I=async(f,Q)=>{Q=await xH(Q,e);let y=KH(f,Q),m=await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_edit",attrs:{v:"1"},content:[y,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),T=le(m,"product_catalog_edit"),_=le(T,"product");return Vf(_)},d=async f=>{f.isHidden=!!f.isHidden,f=await xH(f,e);let Q=KH(void 0,f),y=await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_add",attrs:{v:"1"},content:[Q,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),m=le(y,"product_catalog_add"),T=le(m,"product");return Vf(T)},B=async f=>{let Q=await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_delete",attrs:{v:"1"},content:f.map(m=>({tag:"product",attrs:{},content:[{tag:"id",attrs:{},content:Buffer.from(m)}]}))}]});return{deleted:+(le(Q,"product_catalog_delete")?.attrs.deleted_count||0)}};return{...t,logger:n.logger,getOrderDetails:c,getCatalog:s,getCollections:g,productCreate:d,productDelete:B,productUpdate:I,updateBussinesProfile:a,updateCoverPhoto:A,removeCoverPhoto:r}};var jce=n=>{let t=Yce(n),{authState:o,ev:i,query:e,upsertMessage:a}=t,A=async(I,d,B)=>e({tag:"iq",attrs:{type:d,xmlns:"w:g2",to:I},content:B}),r=async I=>{let d=await A(I,"get",[{tag:"query",attrs:{request:"interactive"}}]);return WH(d)},s=async()=>{let I=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),d={},B=le(I,"communities");if(B){let f=PA(B,"community");for(let Q of f){let y=WH({tag:"result",attrs:{},content:[Q]});d[y.id]=y}}return t.ev.emit("groups.update",Object.values(d)),d};async function g(I){Jf.info({node:I},"parseGroupResult");let d=le(I,"group");if(d)try{Jf.info({groupNode:d},"groupNode");let B=await t.groupMetadata(`${d.attrs.id}@g.us`);return B||c.empty()}catch(B){return console.error("Error parsing group metadata:",B),c.empty()}return c.empty()}let c={empty:()=>null,of:I=>I!==null?{value:I}:null};return t.ws.on("CB:ib,,dirty",async I=>{let{attrs:d}=le(I,"dirty");d.type==="communities"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,communityMetadata:r,communityCreate:async(I,d)=>{let B=zF().substring(0,12),f=await A("@g.us","set",[{tag:"create",attrs:{subject:I},content:[{tag:"description",attrs:{id:B},content:[{tag:"body",attrs:{},content:Buffer.from(d||"","utf-8")}]},{tag:"parent",attrs:{default_membership_approval_mode:"request_required"}},{tag:"allow_non_admin_sub_group_creation",attrs:{}},{tag:"create_general_chat",attrs:{}}]}]);return await g(f)},communityCreateGroup:async(I,d,B)=>{let f=jr(),Q=await A("@g.us","set",[{tag:"create",attrs:{subject:I,key:f},content:[...d.map(y=>({tag:"participant",attrs:{jid:y}})),{tag:"linked_parent",attrs:{jid:B}}]}]);return await g(Q)},communityLeave:async I=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"community",attrs:{id:I}}]}])},communityUpdateSubject:async(I,d)=>{await A(I,"set",[{tag:"subject",attrs:{},content:Buffer.from(d,"utf-8")}])},communityLinkGroup:async(I,d)=>{await A(d,"set",[{tag:"links",attrs:{},content:[{tag:"link",attrs:{link_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}]}])},communityUnlinkGroup:async(I,d)=>{await A(d,"set",[{tag:"unlink",attrs:{unlink_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}])},communityFetchLinkedGroups:async I=>{let d=I,B=!1,f=await t.groupMetadata(I);f.linkedParent?d=f.linkedParent:B=!0;let Q=await A(d,"get",[{tag:"sub_groups",attrs:{}}]),y=[],m=le(Q,"sub_groups");if(m){let T=PA(m,"group");for(let _ of T)y.push({id:_.attrs.id?yr(_.attrs.id,"g.us"):void 0,subject:_.attrs.subject||"",creation:_.attrs.creation?Number(_.attrs.creation):void 0,owner:_.attrs.creator?uA(_.attrs.creator):void 0,size:_.attrs.size?Number(_.attrs.size):void 0})}return{communityJid:d,isCommunity:B,linkedGroups:y}},communityRequestParticipantsList:async I=>{let d=await A(I,"get",[{tag:"membership_approval_requests",attrs:{}}]),B=le(d,"membership_approval_requests");return PA(B,"membership_approval_request").map(Q=>Q.attrs)},communityRequestParticipantsUpdate:async(I,d,B)=>{let f=await A(I,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:B,attrs:{},content:d.map(T=>({tag:"participant",attrs:{jid:T}}))}]}]),Q=le(f,"membership_requests_action"),y=le(Q,B);return PA(y,"participant").map(T=>({status:T.attrs.error||"200",jid:T.attrs.jid}))},communityParticipantsUpdate:async(I,d,B)=>{let f=await A(I,"set",[{tag:B,attrs:B==="remove"?{linked_groups:"true"}:{},content:d.map(m=>({tag:"participant",attrs:{jid:m}}))}]),Q=le(f,B);return PA(Q,"participant").map(m=>({status:m.attrs.error||"200",jid:m.attrs.jid,content:m}))},communityUpdateDescription:async(I,d)=>{let f=(await r(I)).descId??null;await A(I,"set",[{tag:"description",attrs:{...d?{id:zF()}:{delete:"true"},...f?{prev:f}:{}},content:d?[{tag:"body",attrs:{},content:Buffer.from(d,"utf-8")}]:void 0}])},communityInviteCode:async I=>{let d=await A(I,"get",[{tag:"invite",attrs:{}}]);return le(d,"invite")?.attrs.code},communityRevokeInvite:async I=>{let d=await A(I,"set",[{tag:"invite",attrs:{}}]);return le(d,"invite")?.attrs.code},communityAcceptInvite:async I=>{let d=await A("@g.us","set",[{tag:"invite",attrs:{code:I}}]);return le(d,"community")?.attrs.jid},communityRevokeInviteV4:async(I,d)=>!!await A(I,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:d}}]}]),communityAcceptInviteV4:i.createBufferedFunction(async(I,d)=>{I=typeof I=="string"?{remoteJid:I}:I;let B=await A(d.groupJid,"set",[{tag:"accept",attrs:{code:d.inviteCode,expiration:d.inviteExpiration.toString(),admin:I.remoteJid}}]);return I.id&&(d=oe.Message.GroupInviteMessage.fromObject(d),d.inviteExpiration=0,d.inviteCode="",i.emit("messages.update",[{key:I,update:{message:{groupInviteMessage:d}}}])),await a({key:{remoteJid:d.groupJid,id:jr(t.user?.id),fromMe:!1,participant:I.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:I.remoteJid,messageTimestamp:Oa()},"notify"),B.attrs.from}),communityGetInviteInfo:async I=>{let d=await A("@g.us","get",[{tag:"invite",attrs:{code:I}}]);return WH(d)},communityToggleEphemeral:async(I,d)=>{let B=d?{tag:"ephemeral",attrs:{expiration:d.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(I,"set",[B])},communitySettingUpdate:async(I,d)=>{await A(I,"set",[{tag:d,attrs:{}}])},communityMemberAddMode:async(I,d)=>{await A(I,"set",[{tag:"member_add_mode",attrs:{},content:d}])},communityJoinApprovalMode:async(I,d)=>{await A(I,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"community_join",attrs:{state:d}}]}])},communityFetchAllParticipating:s}},WH=n=>{let t=le(n,"community"),o=le(t,"description"),i,e;o&&(i=jA(o,"body"),e=o.attrs.id);let a=t.attrs.id?.includes("@")?t.attrs.id:yr(t.attrs.id||"","g.us"),A=le(t,"ephemeral")?.attrs.expiration,r=jA(t,"member_add_mode")==="all_member_add";return{id:a,subject:t.attrs.subject||"",subjectOwner:t.attrs.s_o,subjectTime:Number(t.attrs.s_t||0),size:PA(t,"participant").length,creation:Number(t.attrs.creation||0),owner:t.attrs.creator?uA(t.attrs.creator):void 0,desc:i,descId:e,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_community"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:r,participants:PA(t,"participant").map(({attrs:g})=>({id:g.jid,admin:g.type||null})),ephemeralDuration:A?+A:void 0,addressingMode:jA(t,"addressing_mode")}};var $5e=n=>{let t={...uce,...n};return jce(t)},Jce=$5e;var qce=Jce;var eZe=Object.freeze({key:"whatsapp",label:"WhatsApp",get connectionLabel(){return w(" Web \u5173\u8054\u8BBE\u5907")},reactions:Object.freeze({processing:"\u{1F440}",success:"\u2705",error:"\u274C"})}),uM=class extends ns{constructor(t){super({...t,descriptor:eZe})}};import{chmod as zce,mkdir as AZe,readdir as tZe}from"node:fs/promises";var rZe=Object.freeze({level:"silent",trace(){},debug(){},info(){},warn(){},error(){},fatal(){},child(){return this}}),aZe=6e4;function Vce(){return Object.assign(new Error("WhatsApp connection was cancelled"),{name:"AbortError"})}function iZe(n){return n?.output?.statusCode??n?.data?.statusCode??n?.statusCode??null}function oZe(n){let t=n;if(typeof t=="string"){if(!/^\d+$/.test(t))return null;t=Number(t)}else typeof t=="bigint"?t=Number(t):t&&typeof t=="object"&&(t=Number(t.valueOf()));return Number.isFinite(t)&&t>=0?t*1e3:null}async function ZH(n){await AZe(n,{recursive:!0,mode:448}),await zce(n,448);let t=await tZe(n,{withFileTypes:!0}).catch(()=>[]);await Promise.all(t.filter(o=>o.isFile()).map(o=>zce(`${n}/${o.name}`,384).catch(()=>{})))}function nZe(n,t){let o=n.user??t.creds.me,i=uA(o?.id);if(!/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(i??""))throw new Error("WhatsApp did not return a valid linked account");return{accountJid:i,name:typeof o?.name=="string"&&o.name.trim()?o.name.trim().slice(0,100):w("WhatsApp\u673A\u5668\u4EBA")}}async function BM({authDir:n,onQr:t,onMessage:o,onDisconnect:i,signal:e,logger:a=console,makeSocket:A=qce,loadAuthState:r=jne}={}){if(!n||typeof t!="function")throw new TypeError("WhatsApp Web session requires an auth directory and QR callback");await ZH(n);let s=Date.now(),{state:g,saveCreds:c}=await r(n),I=g.keys.set.bind(g.keys);g.keys.set=async V=>{await I(V),await ZH(n)};let d=!1,B=!1,f,Q,y=Promise.resolve(),m=null,T=0,_=null,R=new Promise((V,x)=>{f=V,Q=x}),K=V=>{B||(B=!0,Q(V))},L=async()=>{d||(d=!0,T+=1,K(Vce()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.end(void 0).catch(()=>{}))},F=async()=>{d||(d=!0,T+=1,K(Vce()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.logout("Removed from DeepSeek Harness").catch(()=>{}))},q=()=>{let V=++T,x=!1,G=A({auth:g,browser:Rb.macOS("DeepSeek Harness"),logger:rZe,markOnlineOnConnect:!1,syncFullHistory:!1,shouldSyncHistoryMessage:()=>!1,getMessage:async()=>{},generateHighQualityLinkPreview:!1});m=G;let J=()=>{!x||!g.creds.me||B||y.then(()=>{d||B||V!==T||!x||!g.creds.me||(B=!0,f(nZe(G,g)))}).catch(U=>K(U))};G.ev.on("creds.update",()=>{d||V!==T||(y=y.then(async()=>{await c(),await ZH(n)}),y.catch(()=>a.error?.("[dsh-im:whatsapp] failed to persist linked-device state")),J())}),G.ev.on("connection.update",U=>{if(!(d||V!==T)&&(typeof U.qr=="string"&&U.qr&&t(U.qr),U.connection==="open"&&(x=!0,J()),U.connection==="close")){let N=iZe(U.lastDisconnect?.error);if(N===$t.restartRequired){_??=y.then(async()=>{d||V!==T||(await G.end(void 0).catch(()=>{}),!(d||V!==T)&&q())}).catch(Ae=>K(Ae)).finally(()=>{_=null});return}let k=N===$t.loggedOut,z=Object.assign(new Error(k?"WhatsApp linked device was removed from the phone":"WhatsApp Web connection closed"),{code:k?"logged-out":"connection-closed"});B?i?.({error:z,loggedOut:k}):K(z)}}),G.ev.on("messages.upsert",({messages:U,type:N})=>{if(!(d||V!==T||N!=="notify"&&N!=="append"||typeof o!="function"))for(let k of Array.isArray(U)?U:[]){if(N==="append"){let z=oZe(k?.messageTimestamp);if(z===null||z{a.error?.("[dsh-im:whatsapp] failed to process an inbound WhatsApp message")})}})};return q(),e&&(e.aborted?await L():e.addEventListener("abort",()=>void L(),{once:!0})),Object.freeze({get socket(){return m},ready:R,close:L,logout:F})}var $H=new Set(["image/jpeg","image/png","image/webp","image/gif"]),gZe=5*1024*1024,XH=15e3,eK=12e4,cZe=["ephemeralMessage","viewOnceMessage","documentWithCaptionMessage","viewOnceMessageV2","viewOnceMessageV2Extension","editedMessage","associatedChildMessage","groupStatusMessage","groupStatusMessageV2"],IZe=new Set(["viewOnceMessage","viewOnceMessageV2","viewOnceMessageV2Extension"]),lZe=new Set(["s.whatsapp.net","c.us","lid","hosted","hosted.lid"]);function Zce(n){if(typeof n!="string")return null;let t=n.trim();if(/^\+?\d+$/.test(t))return`${t.replace(/^\+/,"")}@s.whatsapp.net`;let o=fA(t);return!o||!/^\d+$/.test(o.user)||!lZe.has(o.server)?null:t}function rK(n,t){let o=Zce(n),i=Zce(t);if(!o||!i)return!1;try{return Nt(o,i)===!0}catch{return!1}}function pZe(n){let t=n;for(let o=0;o<5&&t&&typeof t=="object";o+=1){let i=cZe.find(e=>t[e]?.message);if(!i)return!1;if(IZe.has(i))return!0;t=t[i].message}return!1}function dZe(n){return n?.extendedTextMessage?.contextInfo??n?.imageMessage?.contextInfo??n?.videoMessage?.contextInfo??n?.documentMessage?.contextInfo??null}function hZe(n){return n?.conversation??n?.extendedTextMessage?.text??n?.imageMessage?.caption??n?.videoMessage?.caption??n?.documentMessage?.caption??""}function $ce(n){if(Number.isSafeInteger(n)&&n>=0)return n;let t;try{t=Number(n?.toString?.())}catch{return}return Number.isSafeInteger(t)&&t>=0?t:void 0}async function EZe(n,t,{signal:o,maxBytes:i=gZe}={}){o?.throwIfAborted();let e=AbortSignal.timeout(XH),a=o?AbortSignal.any([o,e]):e,A=Promise.resolve().then(()=>t(n,"stream",{options:{signal:a}})),r=await new Promise((I,d)=>{let B=!1,f=(y,m)=>B?!1:(B=!0,a.removeEventListener("abort",Q),y(m),!0),Q=()=>f(d,a.reason);a.addEventListener("abort",Q,{once:!0}),A.then(y=>{f(I,y)||y?.destroy?.()},y=>f(d,y)),a.aborted&&Q()}).catch(I=>{throw o?.aborted?o.reason??I:e.aborted?new ut("image-download-failed",`WhatsApp image download timed out after ${XH} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}),s=[],g=0,c=()=>r?.destroy?.(a.reason);a.addEventListener("abort",c,{once:!0});try{for await(let I of r){a.throwIfAborted();let d=Buffer.from(I);if(g+=d.length,g>i)throw r.destroy?.(),new ut("image-too-large",`WhatsApp image exceeded ${i} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s.push(d)}}catch(I){throw o?.aborted?o.reason??I:e.aborted?new ut("image-download-failed",`WhatsApp image stream timed out after ${XH} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}finally{a.removeEventListener("abort",c)}return Buffer.concat(s,g)}function CZe(n,t,o,{viewOnce:i=!1}={}){let e,a;if(!i&&t?.imageMessage&&t.imageMessage.viewOnce!==!0)e=t.imageMessage;else if(t?.documentMessage){let r=typeof t.documentMessage.mimetype=="string"?t.documentMessage.mimetype.toLowerCase():"";if(!$H.has(r))return null;e=t.documentMessage,a=typeof e.fileName=="string"?e.fileName:void 0}if(!e)return null;let A=typeof e.mimetype=="string"?e.mimetype.toLowerCase():"";return $H.has(A)?{name:a,mediaType:A,size:$ce(e.fileLength),load:r=>EZe(n,o,r)}:null}function uZe(n,t,o){let i=t?.documentMessage;if(!i)return null;let e=typeof i.mimetype=="string"&&i.mimetype?i.mimetype.toLowerCase():void 0;return $H.has(e)?null:{name:typeof i.fileName=="string"&&i.fileName?i.fileName:"whatsapp-file",...e?{mediaType:e}:{},size:$ce(i.fileLength),async load({signal:a}={}){a?.throwIfAborted();let A=await o(n,"stream",{options:{signal:a}});return a?.throwIfAborted(),{stream:A}}}}function BZe({socket:n,logger:t=console,download:o=hU}={}){if(typeof o!="function")throw new TypeError("WhatsApp media downloader is required");return typeof n?.updateMediaMessage!="function"?o:(i,e,a)=>o(i,e,a,{logger:t,reuploadRequest:A=>n.updateMediaMessage(A)})}function fZe(n,t,{download:o=hU}={}){let i=typeof n?.key?.remoteJid=="string"?n.key.remoteJid:"",e=typeof n?.key?.remoteJidAlt=="string"?n.key.remoteJidAlt:"",a=typeof n?.key?.id=="string"?n.key.id:"";if(!i||!a||i==="status@broadcast"||i.endsWith("@newsletter"))return null;let A=i.endsWith("@g.us"),r=n.key.fromMe===!0,s=r&&!A&&[i,e].some(T=>T&&Nt(T,t));if(r&&!s&&!A)return null;let g=r?t:A?n.key.participant:i,c=A&&!r?n.key.participantAlt:e;if(typeof g!="string"||!g)return null;let I=pZe(n.message),d=Na(n.message),B=dZe(d),f=Array.isArray(B?.mentionedJid)&&B.mentionedJid.some(T=>Nt(T,t)),Q=typeof B?.participant=="string"&&Nt(B.participant,t),y=CZe(n,d,o,{viewOnce:I}),m=uZe(n,d,o);return{messageId:`${i}:${a}`,providerMessageId:a,senderId:g,contextSource:()=>({senderName:n.pushName}),senderAlternateId:typeof c=="string"?c:"",senderIsBot:!1,kind:A?"group":"direct",conversationId:i,content:hZe(d),plainText:typeof d?.conversation=="string"||typeof d?.extendedTextMessage?.text=="string",images:y?[y]:[],files:m?[m]:[],addressed:!A||r||f||Q,selfChat:s,replyTarget:{jid:i,quoted:n,selfChat:s},reactionTarget:{jid:i,key:n.key}}}var AK=class{#e=new Map;has(t){return this.#t(),this.#e.has(t)}remember(t){this.#A(t)}reserve(t){this.#A(t)}#A(t){if(!(typeof t!="string"||!t))for(this.#t(),this.#e.set(t,Date.now()+5*6e4);this.#e.size>256;)this.#e.delete(this.#e.keys().next().value)}#t(){let t=Date.now();for(let[o,i]of this.#e)i>t||this.#e.delete(o)}};function eIe(n){return n?.reason??new DOMException("The operation was aborted.","AbortError")}function Xce(n,t){return t?(t.throwIfAborted(),new Promise((o,i)=>{let e=!1,a=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>a(i,eIe(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>a(o,r),r=>a(i,r)),t.aborted&&A()})):n}function QZe(n){if(n?.code==="artifact-delivery-uncertain")return n;let t=new Error("WhatsApp could not confirm artifact delivery.");return t.code="artifact-delivery-uncertain",t.cause=n,t}function yZe(n){if(n?.code?.startsWith?.("artifact-"))return n;let t=n?.output?.statusCode??n?.data?.statusCode??n?.statusCode,o;if(t===401||t===403?o="artifact-permission-required":t===413?o="artifact-too-large":t===429?o="artifact-rate-limited":[400,404,405,406,410,415,422].includes(t)&&(o="artifact-provider-rejected"),!o)return QZe(n);let i=new Error("WhatsApp rejected artifact delivery.");return i.code=o,i.cause=n,i}var tK=class{#e;#A;#t;#r;#l=new Map;constructor(t,o,{signal:i,mediaUploadTimeoutMs:e=eK}={}){this.#e=t,this.#A=o,this.#t=i,this.#r=e}async sendText(t,o){await this.#a(t.jid);let i=[];for(let[e,a]of ss(o,4e3).entries()){let A=Wce(10).toString("hex").toUpperCase(),r={...e===0&&t.quoted?{quoted:t.quoted}:{},messageId:A};typeof this.#A.reserve=="function"?this.#A.reserve(A):this.#A.remember(A);let s=await this.#e.sendMessage(t.jid,{text:a},r);this.#A.remember(s?.key?.id),typeof s?.key?.id=="string"&&s.key.id&&i.push(s.key.id)}return{providerMessageIds:i}}async sendFile(t,o){return this.#i(t,o,{document:o.bytes,mimetype:o.mediaType??"application/octet-stream",fileName:o.fileName},"file")}async sendImage(t,o){return this.#i(t,o,{image:o.bytes,mimetype:o.mediaType??"image/jpeg"},"image")}async addReaction(t,o,{signal:i}={}){if(typeof o!="string"||!o.trim())throw new TypeError("A WhatsApp reaction emoji is required");let e=o.trim();return await this.#o(t,e,i),e}removeReaction(t,o,{signal:i}={}){return this.#o(t,"",i)}async#o(t,o,i){if(typeof t?.jid!="string"||!t.jid||!t.key?.id)throw new TypeError("A WhatsApp reaction target is required");let e=i??this.#t;e?.throwIfAborted();let a=Wce(10).toString("hex").toUpperCase();typeof this.#A.reserve=="function"?this.#A.reserve(a):this.#A.remember(a);let A=this.#e.sendMessage(t.jid,{react:{text:o,key:t.key}},{messageId:a}),r=await Xce(A,e);return this.#A.remember(r?.key?.id),r}async#i(t,o,i,e){this.#t?.throwIfAborted(),await this.#a(t.jid),this.#t?.throwIfAborted();let a=typeof o.deliveryKey=="string"&&o.deliveryKey?o.deliveryKey:o.artifactId,A=e==="image"?`${a}:image`:a,r=typeof A=="string"&&A?sZe("sha256").update(A).digest("hex").slice(0,20).toUpperCase():void 0,s={...t.quoted?{quoted:t.quoted}:{},...r?{messageId:r}:{},mediaUploadTimeoutMs:this.#r};this.#A.remember(r);let g;try{let c=this.#e.sendMessage(t.jid,i,s);un(o,c);let I=AbortSignal.timeout(this.#r),d=this.#t?AbortSignal.any([this.#t,I]):I;g=await Xce(c,d)}catch(c){throw this.#t?.aborted?eIe(this.#t):yZe(c)}return this.#t?.throwIfAborted(),this.#A.remember(g?.key?.id),g}async sendTyping(t){!t.selfChat&&t.quoted?.key&&await this.#e.readMessages([t.quoted.key]).catch(()=>{}),await this.#e.sendPresenceUpdate("composing",t.jid),await this.#a(t.jid,!1);let o=setInterval(()=>{this.#e.sendPresenceUpdate("composing",t.jid).catch(()=>{this.#a(t.jid)})},2e4);o.unref?.(),this.#l.set(t.jid,o)}async close(){let t=[...this.#l.keys()];await Promise.allSettled(t.map(o=>this.#a(o)))}async#a(t,o=!0){let i=this.#l.get(t);i&&clearInterval(i),this.#l.delete(t),o&&await this.#e.sendPresenceUpdate("paused",t).catch(()=>{})}};function mZe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...io()}}var Xf=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=mZe();#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,authDir:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=3e4,mediaUploadTimeoutMs:c=eK,createSession:I=BM}){if(!t||!o||!i||!e||typeof I!="function")throw new TypeError("WhatsappRuntime requires config, auth directory, Harness, state, and session factory");if(this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,!Number.isSafeInteger(c)||c<=0)throw new TypeError("mediaUploadTimeoutMs must be a positive safe integer");this.#s=Math.min(c,eK),this.#p=I}get status(){return structuredClone(this.#c)}async start(){return this.#c.ready&&this.#I?this.status:this.#C?this.#C:(this.#C=this.#u().finally(()=>{this.#C=null}),this.#C)}async#u(){await this.stop(),this.#c.startedAt=new Date().toISOString(),this.#c.connectionState="connecting",this.#c.lastError=null,await this.#t.ensureRunning(),this.#c.harnessReachable=!0;let t=new AbortController;this.#g=t;let o=new AK,i,e=new Promise((a,A)=>{i=A});e.catch(()=>{});try{let a=await this.#p({authDir:this.#A,signal:t.signal,logger:this.#i,onQr:()=>i(Object.assign(new Error("WhatsApp linked-device session must be scanned again"),{code:"relink-required"})),onMessage:async(c,I)=>{let d=fZe(c,this.#e.accountJid,{download:BZe({socket:I?.socket,logger:this.#i})});!d||o.has(d.providerMessageId)||!this.#h||(this.#c.lastCheckedAt=Date.now(),await this.#h.accept(d))},onDisconnect:({error:c})=>{t.signal.aborted||(this.#c.ready=!1,this.#c.connectionState="failed",this.#c.lastError=c?.message??"WhatsApp Web connection closed")}});this.#I=a;let A,r=await Promise.race([a.ready,e,new Promise((c,I)=>{A=setTimeout(()=>I(new Error("WhatsApp Web did not connect in time")),this.#n)})]).finally(()=>clearTimeout(A));if(!Nt(r.accountJid,this.#e.accountJid))throw new Error("WhatsApp linked account does not match the saved bot");let s=new tK(a.socket,o,{signal:t.signal,mediaUploadTimeoutMs:this.#s});this.#d=s,this.#h=new uM({bot:s,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o?{botId:this.#o.botId,getSettings:(...c)=>this.#o.getSettings(...c),...typeof this.#o.isPrivileged=="function"?{isPrivileged:(...c)=>this.#o.isPrivileged(...c)}:{},equals:rK}:void 0,status:this.#c,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let g=Date.now();return this.#c.ready=!0,this.#c.connectionState="connected",this.#c.lastCheckedAt=g,this.#c.lastConnectedAt=g,this.status}catch(a){throw this.#c.ready=!1,this.#c.connectionState="failed",this.#c.lastError=a?.message??String(a),await this.stop(),a}}async logout(){return await this.#I?.logout().catch(()=>{}),this.stop()}async sendConnectionTest(t){if(!this.#c.ready||!this.#d){let o=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw o.code="test-target-unavailable",o}if(typeof t!="string"||!t.trim())throw new TypeError("WhatsApp connection test text is required");return await this.#d.sendText({jid:this.#e.accountJid,selfChat:!0},t),{sent:!0}}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.jid=="string"?t.route.jid.trim():"",a=t?.kind==="user"&&/^[^@\s]+@(s\.whatsapp\.net|lid)$/.test(e),A=t?.kind==="group"&&/^[^@\s]+@g\.us$/.test(e);if(!a&&!A){let r=new TypeError("Invalid WhatsApp proactive delivery target");throw r.code="invalid-target",r}if(!this.#c.ready||!this.#d){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return i?.throwIfAborted(),this.#d.sendText({jid:e},o)}async stop(){let t=this.#I,o=this.#d,i=this.#h;return this.#g?.abort(),this.#g=null,this.#I=null,this.#d=null,this.#h=null,await o?.close().catch(()=>{}),await t?.close().catch(()=>{}),await Promise.race([i?.waitForIdle()??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),this.#c.ready=!1,this.#c.connectionState="idle",this.status}};var OZe=/^[a-f0-9-]{36}$/;function bZe(n){let t=ic(n.dshHome??process.env.DSH_HOME??bE(DZe(),".dsh")),o=ic(n.dataDir??bE(t,"integrations","dsh-whatsapp")),i=ic(n.authDir??bE(o,"auth")),e=a=>{if(!OZe.test(a??""))throw new TypeError("Invalid WhatsApp auth directory");return ic(i,a)};return{config:ic(n.configPath??bE(o,"config.json")),bots:ic(n.botsDir??bE(o,"bots")),workspaces:ic(n.workspacesPath??bE(o,"workspaces.json")),authPath:e}}async function aK(n,t={},o={}){let i=aa(n,t),e=typeof n.logger=="function"?n.logger("dsh-im:whatsapp"):n.logger??console,a=()=>La(n),A=o.ConfigStore??Rw,r=o.StateStore??Pw,s=o.HarnessClient??vw,g=o.Controller??dB,c=o.Runtime??Xf,I=o.createSession??BM,d=o.createConnectionSupervisor??Yp,B=bZe(t),f=await new A(B.config).load(),Q=ic(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("whatsapp",k)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=new Map,K=k=>ic(B.bots,k,"state.json"),L=async k=>{let z=R.get(k);return z||(z=await new r(K(k)).load(),R.set(k,z)),z},F=ja(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:V,fileIngressExecutor:x}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new s({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...V?{sessionMaintenanceExecutor:V}:{},...x?{fileIngressExecutor:x}:{}}),J=new g({configStore:_,authPath:B.authPath,createSession:I,logger:e,createRuntime:async({botId:k,config:z,authDir:Ae})=>{let ie=await L(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("whatsapp",z)});let we=Ka(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:a});return new c({config:z,authDir:Ae,harness:we.harness,state:we.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:qa(m,k,{channel:"whatsapp",config:z,equals:rK}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??3e4,createSession:I,logger:{error:(...se)=>e.error?.(`[${k}]`,...se),warn:(...se)=>e.warn?.(`[${k}]`,...se),info:(...se)=>e.info?.(`[${k}]`,...se),debug:(...se)=>e.debug?.(`[${k}]`,...se)}})},deleteAuth:k=>SZe(B.authPath(k),{recursive:!0,force:!0}),deleteState:async({botId:k})=>{let z=R.get(k);if(R.delete(k),z&&typeof z.remove=="function")await z.remove();else try{await wZe(K(k))}catch(Ae){if(Ae?.code!=="ENOENT")throw Ae}}}),U=xa(J,{workspaces:m,stateFor:L,agentPresetCatalog:a}),N=d({channel:"whatsapp",controller:U,harness:G,logger:e,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:U,deliveryAdapter:Ya({channel:"whatsapp",workspaces:m,coreController:J,stateFor:L}),ready:N.ready,async close(){await N.close(),await U.close(),G.stopManagedProcess()}}}import MZe from"qrcode";var AIe="/whatsapp",Mr=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setAccessPolicy:Va,setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki}),tIe=Object.freeze(Object.values(Mr)),_Ze=new Set(["qrValue","accountJid","authDirectory"]);function nK(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function fM(n,t){return nK(n)&&Object.keys(n).every(o=>t.includes(o))}function iK(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function TZe(n,t){return nK(t)?[Mr.status,Mr.beginProvisioning].includes(n)?fM(t,[])?null:`${n} does not accept fields.`:[Mr.pollProvisioning,Mr.cancelProvisioning].includes(n)?fM(t,["attemptId"])&&iK(t.attemptId)?null:`${n} requires an attemptId.`:n===Mr.reconnectBot?fM(t,["botId","sendTest"])&&iK(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId and optional sendTest flag.":n===Mr.deleteBot?fM(t,["botId","confirm"])&&iK(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Mr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Mr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Mr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Mr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":"Unknown WhatsApp endpoint.":"Payload must be an object."}function ME(n){if(Array.isArray(n))return n.map(ME);if(!nK(n))return n;let t={};for(let[o,i]of Object.entries(n))_Ze.has(o)||(t[o]=ME(i));return t}async function NZe(n){return MZe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function oK(n,t){return!n||typeof n.qrValue!="string"?ME(n):ME({...n,qrCodeDataUrl:await t(n.qrValue)})}async function Bp(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await oK(o.provisioning,t)),ME(o)}function rIe(n,{encodeQr:t=NZe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete WhatsApp controller is required (${e})`);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!tIe.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown WhatsApp endpoint."}};let r=TZe(e,a);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Mr.status)s=await Bp(await n.status(),i);else if(e===Mr.beginProvisioning)s=await oK(await n.startProvisioning(),i);else if(e===Mr.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await oK(g,i)}else if(e===Mr.cancelProvisioning)s=ME(await n.cancelProvisioning(a.attemptId));else if(e===Mr.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(s=await Bp(g,i),a.sendTest===!0){let c=null;if(!(g?.bots?.some(d=>d?.botId===a.botId&&d.connected===!0)===!0))c=new Error("WhatsApp bot is not connected"),c.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let d=new Error("Connection test is unavailable");throw d.code="test-target-unavailable",d}await n.sendConnectionTest(a.botId)}catch(d){c=d}s={...s,testMessage:or(c)}}}else if(e===Mr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Bp(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===Mr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Bp(g,i))}else if(e===Mr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Bp(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else if(e===Mr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Bp(g,i))}else s=await Bp(await n.deleteBot(a.botId),i);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"whatsapp-operation-failed",message:"WhatsApp \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function QM(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(AIe,rIe(t,o),{authority:fr(i)})}async function aIe(n,t={}){if(t?.controller)return QM(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await aK(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=QM(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close WhatsApp Web connections"),e}var RZe="/dsh-im-delivery",kZe="DSH-IM \u4E3B\u52A8\u6295\u9012\u6D4B\u8BD5\u6210\u529F\u3002",yi=Object.freeze({send:"message.send",listTargets:"target.list",listSuggestions:"target.suggestion.list",createTarget:"target.create",updateTarget:"target.update",deleteTarget:"target.delete",testTarget:"target.test"}),vZe=new Set(Object.values(yi)),PZe=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function eQ(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function OI(n,t){return eQ(n)&&Object.keys(n).length===t.length&&Object.keys(n).every(o=>t.includes(o))}function fp(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function $f(n){return typeof n=="string"&&/^[A-Za-z0-9._:@-]{1,128}$/.test(n)}function iIe(n,{targetId:t}){let o=t?["targetId","name","kind","route"]:["name","kind","route"];return!eQ(n)||Object.keys(n).some(i=>!o.includes(i))||t&&!$f(n.targetId)||n.name!==void 0&&(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)?!1:typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&eQ(n.route)}function GZe(n){return OI(n,["kind","route"])&&typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&eQ(n.route)}function FZe(n,t){return!vZe.has(n)||!eQ(t)?!1:n===yi.send?OI(t,["botId","targetId","text"])&&fp(t.botId)&&$f(t.targetId)&&typeof t.text=="string"&&!!t.text.trim():n===yi.listTargets||n===yi.listSuggestions?OI(t,["botId"])&&fp(t.botId):n===yi.createTarget?OI(t,["botId","target"])&&fp(t.botId)&&iIe(t.target,{targetId:!0}):n===yi.updateTarget?OI(t,["botId","targetId","target"])&&fp(t.botId)&&$f(t.targetId)&&iIe(t.target,{targetId:!1}):n===yi.testTarget?OI(t,["botId","targetId"])&&fp(t.botId)&&$f(t.targetId)||OI(t,["botId","target"])&&fp(t.botId)&&GZe(t.target):OI(t,["botId","targetId"])&&fp(t.botId)&&$f(t.targetId)}function LZe(n){let t=PZe.has(n?.code)?n.code:"delivery-failed";return{code:t,message:t,details:{}}}function sK(n){for(let t of["send","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget"])if(typeof n?.[t]!="function")throw new TypeError(`A complete delivery service is required (${t})`);return async(t,o,i)=>{if(!FZe(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid delivery request.",details:{}}};if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"cancelled",details:{}}};try{let e;return t===yi.send?e=await n.send(o.botId,o.targetId,o.text,{signal:i}):t===yi.listTargets?e=await n.listTargets(o.botId):t===yi.listSuggestions?e=await n.listSuggestions(o.botId):t===yi.createTarget?e=await n.createTarget(o.botId,o.target):t===yi.updateTarget?e=await n.updateTarget(o.botId,o.targetId,o.target):t===yi.deleteTarget?e=await n.deleteTarget(o.botId,o.targetId):e=await n.send(o.botId,Object.hasOwn(o,"target")?o.target:o.targetId,kZe,{signal:i}),{ok:!0,value:e}}catch(e){return{ok:!1,error:LZe(e)}}}}function oIe(n,t,{authority:o}={}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(RZe,sK(t),{authority:fr(o)})}var nIe="/api/dsh-im/delivery/messages",sIe=1024*1024,UZe=Object.freeze({"bad-request":400,"unknown-bot":404,"unknown-target":404,"target-conflict":409,"invalid-target":422,"bot-not-connected":503,"target-rejected":422,"delivery-failed":502,cancelled:408}),TE=class extends Error{constructor(t,o){super(o),this.status=t,this.code=o}};function _E(n,t,o,i={}){if(n.destroyed||n.writableEnded)return;let e=JSON.stringify(o);n.writeHead(t,{"cache-control":"no-store","content-type":"application/json; charset=utf-8","content-length":String(Buffer.byteLength(e)),...i}),n.end(e)}function HZe(n){return typeof n=="string"&&n.split(";",1)[0].trim().toLowerCase()==="application/json"}async function KZe(n){let t=Number(n.headers["content-length"]);if(Number.isFinite(t)&&t>sIe)throw new TE(413,"payload-too-large");let o=[],i=0;for await(let e of n){let a=Buffer.isBuffer(e)?e:Buffer.from(e);if(i+=a.length,i>sIe)throw new TE(413,"payload-too-large");o.push(a)}try{return JSON.parse(Buffer.concat(o,i).toString("utf8"))}catch{throw new TE(400,"bad-request")}}function xZe(n){let t=sK(n);return async(o,i)=>{if(o.method!=="POST"){_E(i,405,{error:{code:"method-not-allowed",message:"method-not-allowed",details:{}}},{allow:"POST"});return}if(!HZe(o.headers["content-type"])){_E(i,415,{error:{code:"unsupported-media-type",message:"unsupported-media-type",details:{}}});return}let e=new AbortController,a=()=>e.abort(),A=()=>{i.writableEnded||a()};o.once("aborted",a),i.once("close",A);try{let r=await KZe(o),s=await t(yi.send,r,e.signal);if(s.ok){_E(i,200,s.value);return}_E(i,UZe[s.error.code]??500,{error:s.error})}catch(r){if(r instanceof TE){_E(i,r.status,{error:{code:r.code,message:r.code,details:{}}});return}_E(i,500,{error:{code:"delivery-failed",message:"delivery-failed",details:{}}})}finally{o.off("aborted",a),i.off("close",A)}}}function gIe(n,t){if(!n?.webServer||typeof n.webServer.register!="function"||typeof n.effect!="function")throw new TypeError("DSH Host WebServer is required");let o={kind:"exact",path:nIe,handler:xZe(t)};return n.effect(()=>n.webServer.register(o),`dsh-im: ${nIe}`)}var YZe=/^[A-Za-z0-9_-]{1,128}$/,jZe=/^[A-Za-z0-9._:@-]{1,128}$/,JZe=/^[a-z][a-z0-9-]{0,31}$/,qZe="__test__",zZe=Object.freeze(["ownsBot","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget","sendText"]),VZe=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function pn(n,t=n,o){let i=new Error(t,o);return i.code=n,i}function NE(n){if(typeof n!="string"||!YZe.test(n))throw pn("bad-request","Invalid bot id");return n}function yM(n){if(typeof n!="string"||!jZe.test(n))throw pn("bad-request","Invalid target id");return n}function gK(n,{includesTargetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw pn("bad-request","Invalid target");if(t)yM(n.targetId);else if(Object.hasOwn(n,"targetId"))throw pn("bad-request","A target id cannot be changed");return n}function WZe(n){gK(n);let t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("route"))throw pn("bad-request","Invalid draft target");return n}function cIe(n){if(n?.aborted)throw pn("cancelled","Request cancelled")}function Qp(n,t="delivery-failed"){return n?.code==="workspace-bot-not-found"?pn("unknown-bot","Unknown bot",{cause:n}):VZe.has(n?.code)?n:pn(t,t,{cause:n})}function ZZe(n){if(!n||typeof n!="object"||typeof n.channel!="string"||!JZe.test(n.channel))throw new TypeError("A delivery adapter with a valid channel is required");for(let t of zZe)if(typeof n[t]!="function")throw new TypeError(`A complete delivery adapter is required (${t})`);return n}var cK=class{#e=new Map;registerAdapter(t){let o=ZZe(t),i=Object.freeze({adapter:o});return this.#e.set(o.channel,i),()=>this.#e.get(o.channel)!==i?!1:(this.#e.delete(o.channel),!0)}async listTargets(t){let o=NE(t),i=await this.#A(o);try{let e=await i.listTargets(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid targets");return{botId:o,channel:i.channel,targets:e}}catch(e){throw Qp(e)}}async listSuggestions(t){let o=NE(t),i=await this.#A(o);try{let e=await i.listSuggestions(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid suggestions");return{botId:o,channel:i.channel,suggestions:e.map(a=>Lp(i.channel,a,{targetIdRequired:!1}))}}catch(e){throw Qp(e)}}async createTarget(t,o){let i=NE(t);gK(o,{includesTargetId:!0});let e=await this.#A(i);try{return await e.createTarget(i,o)}catch(a){throw Qp(a)}}async updateTarget(t,o,i){let e=NE(t),a=yM(o);gK(i);let A=await this.#A(e);try{return await A.updateTarget(e,a,i)}catch(r){throw Qp(r)}}async deleteTarget(t,o){let i=NE(t),e=yM(o),a=await this.#A(i);try{return await a.deleteTarget(i,e),{deleted:!0}}catch(A){throw Qp(A)}}async send(t,o,i,{signal:e}={}){let a=NE(t),A=typeof o=="string"?yM(o):null,r=A===null?WZe(o):null;if(typeof i!="string"||!i.trim())throw pn("bad-request","Message text is required");cIe(e);let s=await this.#A(a);try{let g;if(r)g={targetId:qZe,...r};else{let c=await s.listTargets(a);if(!Array.isArray(c))throw new TypeError("Adapter returned invalid targets");if(g=c.find(I=>I?.targetId===A),!g)throw pn("unknown-target","Unknown target")}return cIe(e),await s.sendText(a,g,i,{signal:e}),{sent:!0}}catch(g){throw e?.aborted||g?.name==="AbortError"||g?.code==="ABORT_ERR"?pn("cancelled","Request cancelled",{cause:g}):Qp(g)}}async#A(t){for(let{adapter:o}of this.#e.values()){let i;try{i=await o.ownsBot(t)}catch(e){throw Qp(e)}if(i)return o}throw pn("unknown-bot","Unknown bot")}};function IIe(){return new cK}var AQ=qe(PD(),1);import{createHash as XZe}from"node:crypto";import{readFile as dIe,realpath as Vn,stat as $Ze}from"node:fs/promises";import{homedir as e9e}from"node:os";import{basename as A9e,dirname as lK,isAbsolute as hK,join as oc,relative as t9e,resolve as SM,sep as r9e}from"node:path";import{fileURLToPath as a9e}from"node:url";var bI="@xmanrui/dsh-im",tQ="https://registry.npmjs.org/",i9e=15*6e4,o9e=1e4,lIe=16*1024;function Wn(n,t={}){return Object.assign(new Error(n),{code:n,...t})}function mM(n,t){return typeof n?.get=="function"?n.get(t):n?.[t]}function pK(n,t){let o=t9e(n,t);return o!==".."&&!o.startsWith(`..${r9e}`)&&!hK(o)}async function n9e(n){try{return await dIe(n,"utf8")}catch(t){if(t.code==="ENOENT")return"";throw t}}async function dK(n){let t=await dIe(oc(n,"package.json"),"utf8");return{directory:await Vn(n),manifest:JSON.parse(t),contents:t}}async function IK(n,t){let o=lK(await Vn(n));for(;;){try{let e=await dK(o);return e.manifest?.name===t?e:null}catch(e){if(e.code!=="ENOENT")throw e}let i=lK(o);if(i===o)return null;o=i}}function s9e(n){return typeof n=="string"&&n.length>0&&Buffer.byteLength(n)<=255&&!n.startsWith("-")&&![".","..","node_modules"].includes(n)&&!/[\\/\x00-\x1f\x7f<>:"|?*]/u.test(n)}function g9e(n){if(n[0]==="web")return"web";let t;for(let o=0;o0&&(AQ.default.validRange(n)!==null||/^[A-Za-z][A-Za-z0-9._-]*$/u.test(n))}async function l9e(n){if(n.manifest?.name!==bI||AQ.default.valid(n.manifest.version)===null)return!1;let t=[n.manifest.main,n.manifest.exports?.["./client"],n.manifest.dsh?.bundle?.patch];for(let o of t){if(typeof o!="string"||!o||hK(o)||o.includes("\0"))return!1;let i=SM(n.directory,o);if(!pK(n.directory,i)||!pK(n.directory,await Vn(i))||!(await $Ze(i)).isFile())return!1}return!0}function p9e(n){if(n==null||n==="")return!0;if(typeof n!="string")return!1;try{return new URL(n).href===tQ}catch{return!1}}async function pIe(n,{signal:t,timeoutMs:o,errorCode:i,capture:e=!1}){if(t?.aborted)throw Wn("install-interrupted");let a=new AbortController,A,r,s=B=>{A??=B,a.abort(),r?.cancel?.()},g=()=>s("install-interrupted");t?.addEventListener("abort",g,{once:!0});let c=setTimeout(()=>s("install-timeout"),o),I="",d="";try{r=n(a.signal),r.stdout?.on("data",f=>{e&&(I=(I+f.toString()).slice(-lIe))}),r.stderr?.on("data",f=>{d=(d+f.toString()).slice(-lIe)}),r.stdout?.on("error",()=>s(i)),r.stderr?.on("error",()=>s(i));let B=await r.done;if(A)throw Wn(A);if(B.exitCode!==0||B.signal)throw Wn(i,{exitCode:B.exitCode,diagnosticCode:d.match(/\bERR_PNPM_[A-Z0-9_]+\b/u)?.[0]});return{exitCode:0,signal:null,...e?{stdout:I}:{}}}catch(B){throw A?Wn(A):B.code===i?B:Wn(i)}finally{clearTimeout(c),t?.removeEventListener("abort",g)}}function hIe(n={}){let t=n.ctx,o=n.env??process.env,i=n.argv??process.argv,e=n.execArgv??process.execArgv,a=n.execPath??process.execPath,A=n.cwd??process.cwd(),r=n.platform??process.platform,s=n.osHome??e9e(),g=n.electron??process.versions.electron,c=n.moduleUrl??import.meta.url,I=IK(a9e(c),bI).catch(()=>null),d;async function B(){let T=mM(t,"desktopProfiles"),_=mM(t,"desktopPnpm"),R=mM(t,"desktopPnpmBootstrap"),K=!!(g||T||_||R),L=T?.current,F=K?L?.name:g9e(i.slice(2)),q=K&&R?.homeDir?SM(R.homeDir):c9e(o,s),V={environmentKind:K?"desktop":"cli",homeDir:q,profileName:F};if(!s9e(F))return{...V,blockedReason:"unknown-profile"};let x=await Vn(oc(q,"profiles",F)),G=await Vn(q),J={...V,homeDir:G,profileDir:x};if(K)try{if(typeof _?.runPlugin!="function"||typeof _?.run!="function"||!R||!L?.dir||R.activeProfileName!==F||await Vn(L.dir)!==x||await Vn(R.activeProfileDir)!==x||await Vn(R.appExecutable)!==await Vn(a))return{...J,blockedReason:"executor-unavailable"};let N=await IK(R.dshBootstrapPath,"dsh-plugin-desktop");return!N||A9e(R.dshBootstrapPath)!=="desktop-cli.js"||lK(await Vn(R.dshBootstrapPath))!==oc(N.directory,"lib")?{...J,blockedReason:"executor-unavailable"}:{...J,desktop:_,executable:a,cliEntry:R.dshBootstrapPath}}catch{return{...J,blockedReason:"executor-unavailable"}}let U=mM(t,"subprocess");if(typeof U?.spawn!="function"||typeof i[1]!="string"||!hK(i[1])||r==="win32")return{...J,blockedReason:"executor-unavailable"};try{let N=await IK(i[1],"@deepseek-ai/dsh");if(!N)return{...J,blockedReason:"executor-unavailable"};let k=await Vn(i[1]),z=typeof N.manifest.bin=="string"?N.manifest.bin:N.manifest.bin?.dsh,Ae=typeof z=="string"?SM(N.directory,z):"";return k!==Ae&&k!==oc(N.directory,"src","bin.ts")?{...J,blockedReason:"executor-unavailable"}:{...J,subprocess:U,executable:a,cliEntry:k}}catch{return{...J,blockedReason:"executor-unavailable"}}}function f(T,_,R,K=!1){let L=T.subprocess.spawn({argv:K?["pnpm",..._]:[a,...e,T.cliEntry,..._],cwd:K?T.profileDir:A,env:{DSH_HOME:T.homeDir,CI:"true"},stdio:{stdin:"ignore",stdout:"pipe",stderr:"pipe"},graceMs:3e3,signal:R});return{stdout:L.stdout,stderr:L.stderr,cancel:()=>L.terminate(),done:(async()=>{try{return await L.done}finally{await L.waitForExit()}})()}}async function Q(T,_){let R=["config","get","@xmanrui:registry","--json"],L=(await pIe(q=>T.desktop?T.desktop.run(R,q):f(T,R,q,!0),{signal:_,timeoutMs:n.configTimeoutMs??o9e,errorCode:"registry-check-failed",capture:!0})).stdout.trim(),F;try{F=L===""||L==="undefined"?void 0:JSON.parse(L)}catch{throw Wn("registry-check-failed")}if(!p9e(F))throw Wn("registry-conflict")}async function y({preflight:T=!1}={}){let _,R={installedVersion:null,packageValid:!1,eligible:!1,installationKey:null};try{_=await B();for(let G of["homeDir","profileDir","profileName","environmentKind","executable","cliEntry"])R[G]=_[G]??null;if(!_.profileDir)return{...R,blockedReason:_.blockedReason??"unknown-profile"};let K=await dK(_.profileDir),L=await dK(oc(_.profileDir,"node_modules",bI));R.sourceInstall=!I9e(K.manifest.dependencies?.[bI])||!pK(oc(_.profileDir,"node_modules"),L.directory),R.installedVersion=typeof L.manifest.version=="string"?L.manifest.version:null,R.packageValid=await l9e(L);let F=await I,q=`${_.homeDir}\0${_.profileDir}\0${_.profileName}`,V=F?.directory===L.directory&&F?.manifest.version===L.manifest.version;d===void 0&&V&&R.packageValid&&(d=q);let x=await Promise.all(["pnpm-lock.yaml","pnpm-workspace.yaml","package-lock.json"].map(G=>n9e(oc(_.profileDir,G))));return R.installationKey=XZe("sha256").update(JSON.stringify([q,K.contents,L.directory,L.contents,_.cliEntry,_.executable,...x])).digest("hex"),d!==void 0&&d!==q||!V&&d===void 0?R.blockedReason="installation-changed":R.packageValid?R.sourceInstall?R.blockedReason="source-install":_.blockedReason?R.blockedReason=_.blockedReason:V?T&&await Q(_):R.blockedReason="pending-restart":R.blockedReason="invalid-installation",R.eligible=!R.blockedReason,{...R,blockedReason:R.blockedReason??null}}catch(K){return{...R,blockedReason:["registry-conflict","registry-check-failed","install-timeout","install-interrupted"].includes(K.code)?K.code:_?.profileDir?"invalid-installation":"unknown-profile"}}}async function m(T,{signal:_,expectedInstallationKey:R}={}){if(AQ.default.valid(T)!==T||AQ.default.prerelease(T))throw Wn("invalid-version");let K=await y();if(R!==void 0&&K.installationKey!==R)throw Wn("installation-changed");if(!K.eligible)throw Wn(K.blockedReason);let L=await B();await Q(L,_);let F=await y();if(!F.eligible||F.installationKey!==K.installationKey)throw Wn("installation-changed");let q=["add","-w","--save-exact",`${bI}@${T}`,`--registry=${tQ}`];return pIe(V=>L.desktop?L.desktop.runPlugin(q,L.profileDir,V):f(L,["plugin","--profile",L.profileName,...q],V),{signal:_,timeoutMs:n.installTimeoutMs??i9e,errorCode:"install-failed"})}return Object.freeze({inspect:y,install:m})}var MI=qe(PD(),1);import{createHash as d9e,randomUUID as CK}from"node:crypto";import{mkdir as h9e,open as E9e,readFile as fIe,rename as C9e,stat as QIe,unlink as yIe,writeFile as u9e}from"node:fs/promises";import{isAbsolute as EIe,join as aQ}from"node:path";var iQ=new Set(["installing","verifying"]),B9e=new Set([...iQ,"restart-required","completed","failed","interrupted"]),CIe=256*1024,f9e=["package.json","pnpm-lock.yaml","pnpm-workspace.yaml"],wM=Symbol("no update lock");function bt(n){return Object.assign(new Error(n),{code:n})}async function uIe(n=globalThis.fetch,t=1e4){let o;try{if(o=await n(`${tQ}${encodeURIComponent(bI)}/latest`,{headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(t)}),!o.ok)throw bt("check-failed");if(Number(o.headers.get("content-length"))>CIe)throw bt("invalid-release");let i=[],e=0;for await(let c of o.body){if(e+=c.byteLength,e>CIe)throw bt("invalid-release");i.push(Buffer.from(c))}let a=JSON.parse(Buffer.concat(i).toString("utf8")),A=a.version;if(a.name!==bI||typeof A!="string"||MI.default.valid(A)!==A||MI.default.prerelease(A))throw bt("invalid-release");let r=a.engines?.node;if(r!==void 0&&(typeof r!="string"||!MI.default.validRange(r)))throw bt("invalid-release");let s=new URL(a.dist?.tarball),g=a.dist?.integrity;if(s.origin!==new URL(tQ).origin||s.username||s.password||s.search||s.hash||s.pathname!==`/@xmanrui/dsh-im/-/dsh-im-${A}.tgz`||typeof g!="string"||!/^sha512-[A-Za-z0-9+/]{86}==$/.test(g))throw bt("invalid-release");return{version:A,nodeRange:r??"*",integrity:g,tarball:s.href}}catch(i){throw i?.code==="invalid-release"||i instanceof SyntaxError||i instanceof TypeError&&o?.ok?bt("invalid-release"):bt("check-failed")}}function BIe(n){if(!EIe(n.homeDir??"")||!EIe(n.profileDir??""))return null;let t=d9e("sha256").update(n.profileDir).digest("hex").slice(0,24),o=aQ(n.homeDir,"updates","dsh-im",t);return{directory:o,state:aQ(o,"state.json"),lock:aQ(o,"install.lock"),backup:aQ(o,"before.json")}}async function EK(n,t=null){try{if((await QIe(n)).size>10*1024*1024)throw bt("state-unavailable");return JSON.parse(await fIe(n,"utf8"))}catch(o){if(o.code==="ENOENT")return t;throw bt("state-unavailable")}}async function rQ(n,t){let o=`${n}.${CK()}.tmp`;try{await u9e(o,`${JSON.stringify(t,null,2)} +${iD(t)}`:"/>";return i+e}var eI=qe(xc(),1);import{createCipheriv as JF,createDecipheriv as qF,createHash as rHe,createHmac as aHe,randomBytes as iHe}from"crypto";var MB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,h7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,h7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_expandedappstatekeys_free(t,0)}get indexKey(){let t=ae.expandedappstatekeys_indexKey(this.__wbg_ptr);return mA(t)}get patchMacKey(){let t=ae.expandedappstatekeys_patchMacKey(this.__wbg_ptr);return mA(t)}get snapshotMacKey(){let t=ae.expandedappstatekeys_snapshotMacKey(this.__wbg_ptr);return mA(t)}get valueEncryptionKey(){let t=ae.expandedappstatekeys_valueEncryptionKey(this.__wbg_ptr);return mA(t)}get valueMacKey(){let t=ae.expandedappstatekeys_valueMacKey(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(MB.prototype[Symbol.dispose]=MB.prototype.free);var nD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,E7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_groupcipher_free(t,0)}decrypt(t){let o=kt(t,ae.__wbindgen_export),i=KA,e=ae.groupcipher_decrypt(this.__wbg_ptr,o,i);return mA(e)}encrypt(t){let o=kt(t,ae.__wbindgen_export),i=KA,e=ae.groupcipher_encrypt(this.__wbg_ptr,o,i);return mA(e)}constructor(t,o,i){let e=Ln(o,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;Xc(i,$c);let A=ae.groupcipher_new(rA(t),e,a,i.__wbg_ptr);return this.__wbg_ptr=A>>>0,E7.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(nD.prototype[Symbol.dispose]=nD.prototype.free);var sD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,C7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_groupsessionbuilder_free(t,0)}create(t){Xc(t,Ch);let o=ae.groupsessionbuilder_create(this.__wbg_ptr,t.__wbg_ptr);return mA(o)}constructor(t){let o=ae.groupsessionbuilder_new(rA(t));return this.__wbg_ptr=o>>>0,C7.register(this,this.__wbg_ptr,this),this}process(t,o){Xc(t,Ch),Xc(o,Eh);let i=ae.groupsessionbuilder_process(this.__wbg_ptr,t.__wbg_ptr,o.__wbg_ptr);return mA(i)}};Symbol.dispose&&(sD.prototype[Symbol.dispose]=sD.prototype.free);var _B=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,u7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,u7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_internalbinarynode_free(t,0)}get attrs(){let t=ae.internalbinarynode_attrs(this.__wbg_ptr);return mA(t)}get content(){let t=ae.internalbinarynode_content(this.__wbg_ptr);return mA(t)}set attrs(t){ae.internalbinarynode_set_attrs(this.__wbg_ptr,rA(t))}set content(t){ae.internalbinarynode_set_content(this.__wbg_ptr,rA(t))}get tag(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.internalbinarynode_tag(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}toJSON(){let t=ae.internalbinarynode_toJSON(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(_B.prototype[Symbol.dispose]=_B.prototype.free);var hh=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,B7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_lthashantitampering_free(t,0)}constructor(){let t=ae.lthashantitampering_new();return this.__wbg_ptr=t>>>0,B7.register(this,this.__wbg_ptr,this),this}subtractThenAdd(t,o,i){try{let r=ae.__wbindgen_add_to_stack_pointer(-16),s=kt(t,ae.__wbindgen_export),g=KA,c=O7(o,ae.__wbindgen_export),I=KA,d=O7(i,ae.__wbindgen_export),B=KA;ae.lthashantitampering_subtractThenAdd(r,this.__wbg_ptr,s,g,c,I,d,B);var e=eA().getInt32(r+0,!0),a=eA().getInt32(r+4,!0),A=eA().getInt32(r+8,!0);if(A)throw mA(a);return mA(e)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(hh.prototype[Symbol.dispose]=hh.prototype.free);var gD=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,HF.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,HF.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_lthashstate_free(t,0)}clone(){let t=ae.lthashstate_clone(this.__wbg_ptr);return n.__wrap(t)}deleteValueMac(t){let o=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;return ae.lthashstate_deleteValueMac(this.__wbg_ptr,o,i)!==0}getValueMac(t){let o=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA,e=ae.lthashstate_getValueMac(this.__wbg_ptr,o,i);return mA(e)}hasValueMac(t){let o=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;return ae.lthashstate_hasValueMac(this.__wbg_ptr,o,i)!==0}get hash(){let t=ae.lthashstate_hash(this.__wbg_ptr);return mA(t)}constructor(){let t=ae.lthashstate_new();return this.__wbg_ptr=t>>>0,HF.register(this,this.__wbg_ptr,this),this}setValueMac(t,o){let i=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),e=KA,a=kt(o,ae.__wbindgen_export),A=KA;ae.lthashstate_setValueMac(this.__wbg_ptr,i,e,a,A)}set hash(t){let o=kt(t,ae.__wbindgen_export),i=KA;ae.lthashstate_set_hash(this.__wbg_ptr,o,i)}set version(t){ae.lthashstate_set_version(this.__wbg_ptr,t)}get version(){let t=ae.lthashstate_version(this.__wbg_ptr);return BigInt.asUintN(64,t)}};Symbol.dispose&&(gD.prototype[Symbol.dispose]=gD.prototype.free);var cD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,f7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_noisesession_free(t,0)}authenticate(t){let o=kt(t,ae.__wbindgen_export),i=KA;ae.noisesession_authenticate(this.__wbg_ptr,o,i)}get bufferedBytes(){return ae.noisesession_bufferedBytes(this.__wbg_ptr)>>>0}clearBuffer(){ae.noisesession_clearBuffer(this.__wbg_ptr)}decodeFrame(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=kt(t,ae.__wbindgen_export),r=KA;ae.noisesession_decodeFrame(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=kt(t,ae.__wbindgen_export),r=KA;ae.noisesession_decrypt(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encodeFrame(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.noisesession_encodeFrame(a,this.__wbg_ptr,rA(t));var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encodeFrameRaw(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=kt(t,ae.__wbindgen_export),r=KA;ae.noisesession_encodeFrameRaw(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encrypt(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=kt(t,ae.__wbindgen_export),r=KA;ae.noisesession_encrypt(a,this.__wbg_ptr,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}finishInit(){try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.noisesession_finishInit(i,this.__wbg_ptr);var t=eA().getInt32(i+0,!0),o=eA().getInt32(i+4,!0);if(o)throw mA(t)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}getHash(){let t=ae.noisesession_getHash(this.__wbg_ptr);return mA(t)}get isFinished(){return ae.noisesession_isFinished(this.__wbg_ptr)!==0}mixIntoKey(t){try{let e=ae.__wbindgen_add_to_stack_pointer(-16),a=kt(t,ae.__wbindgen_export),A=KA;ae.noisesession_mixIntoKey(e,this.__wbg_ptr,a,A);var o=eA().getInt32(e+0,!0),i=eA().getInt32(e+4,!0);if(i)throw mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}constructor(t,o,i){try{let g=ae.__wbindgen_add_to_stack_pointer(-16),c=kt(t,ae.__wbindgen_export),I=KA,d=kt(o,ae.__wbindgen_export),B=KA;var e=Fn(i)?0:kt(i,ae.__wbindgen_export),a=KA;ae.noisesession_new(g,c,I,d,B,e,a);var A=eA().getInt32(g+0,!0),r=eA().getInt32(g+4,!0),s=eA().getInt32(g+8,!0);if(s)throw mA(r);return this.__wbg_ptr=A>>>0,f7.register(this,this.__wbg_ptr,this),this}finally{ae.__wbindgen_add_to_stack_pointer(16)}}processHandshakeFinish(t,o,i){try{let r=ae.__wbindgen_add_to_stack_pointer(-16),s=kt(t,ae.__wbindgen_export),g=KA,c=kt(o,ae.__wbindgen_export),I=KA,d=kt(i,ae.__wbindgen_export),B=KA;ae.noisesession_processHandshakeFinish(r,this.__wbg_ptr,s,g,c,I,d,B);var e=eA().getInt32(r+0,!0),a=eA().getInt32(r+4,!0),A=eA().getInt32(r+8,!0);if(A)throw mA(a);return mA(e)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}processHandshakeInit(t,o,i,e){try{let s=ae.__wbindgen_add_to_stack_pointer(-16),g=kt(t,ae.__wbindgen_export),c=KA,I=kt(o,ae.__wbindgen_export),d=KA,B=kt(i,ae.__wbindgen_export),f=KA,Q=kt(e,ae.__wbindgen_export),y=KA;ae.noisesession_processHandshakeInit(s,this.__wbg_ptr,g,c,I,d,B,f,Q,y);var a=eA().getInt32(s+0,!0),A=eA().getInt32(s+4,!0),r=eA().getInt32(s+8,!0);if(r)throw mA(A);return mA(a)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(cD.prototype[Symbol.dispose]=cD.prototype.free);var $c=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,KF.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,KF.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_protocoladdress_free(t,0)}get deviceId(){return ae.protocoladdress_deviceId(this.__wbg_ptr)>>>0}static from(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_from(a,rA(t));var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}get id(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_id(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}is(t){return Xc(t,n),ae.protocoladdress_is(this.__wbg_ptr,t.__wbg_ptr)!==0}constructor(t,o){try{let A=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_new(A,rA(t),rA(o));var i=eA().getInt32(A+0,!0),e=eA().getInt32(A+4,!0),a=eA().getInt32(A+8,!0);if(a)throw mA(e);return this.__wbg_ptr=i>>>0,KF.register(this,this.__wbg_ptr,this),this}finally{ae.__wbindgen_add_to_stack_pointer(16)}}toString(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_toString(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}};Symbol.dispose&&($c.prototype[Symbol.dispose]=$c.prototype.free);var Eh=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,Q7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Q7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeydistributionmessage_free(t,0)}static deserialize(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=kt(t,ae.__wbindgen_export),r=KA;ae.senderkeydistributionmessage_deserialize(a,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}serialize(){let t=ae.senderkeydistributionmessage_serialize(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(Eh.prototype[Symbol.dispose]=Eh.prototype.free);var Ch=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,y7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeyname_free(t,0)}constructor(t,o){let i=Ln(t,ae.__wbindgen_export,ae.__wbindgen_export2),e=KA;Xc(o,$c);let a=ae.senderkeyname_new(i,e,o.__wbg_ptr);return this.__wbg_ptr=a>>>0,y7.register(this,this.__wbg_ptr,this),this}toString(){let t,o;try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.senderkeyname_toString(a,this.__wbg_ptr);var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);return t=i,o=e,kr(i,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}};Symbol.dispose&&(Ch.prototype[Symbol.dispose]=Ch.prototype.free);var ID=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,xF.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,xF.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeyrecord_free(t,0)}static deserialize(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16),A=kt(t,ae.__wbindgen_export),r=KA;ae.senderkeyrecord_deserialize(a,A,r);var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}isEmpty(){return ae.senderkeyrecord_isEmpty(this.__wbg_ptr)!==0}constructor(){let t=ae.senderkeyrecord_new();return this.__wbg_ptr=t>>>0,xF.register(this,this.__wbg_ptr,this),this}serialize(){try{let e=ae.__wbindgen_add_to_stack_pointer(-16);ae.senderkeyrecord_serialize(e,this.__wbg_ptr);var t=eA().getInt32(e+0,!0),o=eA().getInt32(e+4,!0),i=eA().getInt32(e+8,!0);if(i)throw mA(o);return mA(t)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(ID.prototype[Symbol.dispose]=ID.prototype.free);var lD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,m7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessionbuilder_free(t,0)}initOutgoing(t){let o=ae.sessionbuilder_initOutgoing(this.__wbg_ptr,rA(t));return mA(o)}constructor(t,o){Xc(o,$c);let i=ae.sessionbuilder_new(rA(t),o.__wbg_ptr);return this.__wbg_ptr=i>>>0,m7.register(this,this.__wbg_ptr,this),this}processPreKeyBundle(t){let o=ae.sessionbuilder_processPreKeyBundle(this.__wbg_ptr,rA(t));return mA(o)}};Symbol.dispose&&(lD.prototype[Symbol.dispose]=lD.prototype.free);var pD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,S7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessioncipher_free(t,0)}decryptPreKeyWhisperMessage(t){let o=kt(t,ae.__wbindgen_export),i=KA,e=ae.sessioncipher_decryptPreKeyWhisperMessage(this.__wbg_ptr,o,i);return mA(e)}decryptWhisperMessage(t){let o=kt(t,ae.__wbindgen_export),i=KA,e=ae.sessioncipher_decryptWhisperMessage(this.__wbg_ptr,o,i);return mA(e)}encrypt(t){let o=kt(t,ae.__wbindgen_export),i=KA,e=ae.sessioncipher_encrypt(this.__wbg_ptr,o,i);return mA(e)}hasOpenSession(){let t=ae.sessioncipher_hasOpenSession(this.__wbg_ptr);return mA(t)}constructor(t,o){Xc(o,$c);let i=ae.sessioncipher_new(rA(t),o.__wbg_ptr);return this.__wbg_ptr=i>>>0,S7.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(pD.prototype[Symbol.dispose]=pD.prototype.free);var TB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,w7.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,w7.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessionrecord_free(t,0)}static deserialize(t){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.sessionrecord_deserialize(a,rA(t));var o=eA().getInt32(a+0,!0),i=eA().getInt32(a+4,!0),e=eA().getInt32(a+8,!0);if(e)throw mA(i);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}haveOpenSession(){return ae.sessionrecord_haveOpenSession(this.__wbg_ptr)!==0}serialize(){let t=ae.sessionrecord_serialize(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(TB.prototype[Symbol.dispose]=TB.prototype.free);function b7(n){let t=kt(n,ae.__wbindgen_export),o=KA,i=ae.expandAppStateKeys(t,o);return MB.__wrap(i)}function Un(n,t,o){try{let A=ae.__wbindgen_add_to_stack_pointer(-16),r=kt(n,ae.__wbindgen_export),s=KA;ae.hkdf(A,r,s,t,rA(o));var i=eA().getInt32(A+0,!0),e=eA().getInt32(A+4,!0),a=eA().getInt32(A+8,!0);if(a)throw mA(e);return mA(i)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}function xUe(){return{__proto__:null,"./whatsapp_rust_bridge_bg.js":{__proto__:null,__wbg_Error_83742b46f01ce22d:function(t,o){let i=Error(kr(t,o));return rA(i)},__wbg_Number_a5a435bd7bbec835:function(t){return Number(Fe(t))},__wbg_String_8564e559799eccda:function(t,o){let i=String(Fe(o)),e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda:function(t,o){let i=Fe(o),e=typeof i=="bigint"?i:void 0;eA().setBigInt64(t+8,Fn(e)?BigInt(0):e,!0),eA().setInt32(t+0,!Fn(e),!0)},__wbg___wbindgen_boolean_get_c0f3f60bac5a78d1:function(t){let o=Fe(t),i=typeof o=="boolean"?o:void 0;return Fn(i)?16777215:i?1:0},__wbg___wbindgen_debug_string_5398f5bb970e0daa:function(t,o){let i=jF(Fe(o)),e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg___wbindgen_in_41dbb8413020e076:function(t,o){return Fe(t)in Fe(o)},__wbg___wbindgen_is_bigint_e2141d4f045b7eda:function(t){return typeof Fe(t)=="bigint"},__wbg___wbindgen_is_function_3c846841762788c1:function(t){return typeof Fe(t)=="function"},__wbg___wbindgen_is_null_0b605fc6b167c56f:function(t){return Fe(t)===null},__wbg___wbindgen_is_object_781bc9f159099513:function(t){let o=Fe(t);return typeof o=="object"&&o!==null},__wbg___wbindgen_is_undefined_52709e72fb9f179c:function(t){return Fe(t)===void 0},__wbg___wbindgen_jsval_eq_ee31bfad3e536463:function(t,o){return Fe(t)===Fe(o)},__wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b:function(t,o){return Fe(t)==Fe(o)},__wbg___wbindgen_number_get_34bb9d9dcfa21373:function(t,o){let i=Fe(o),e=typeof i=="number"?i:void 0;eA().setFloat64(t+8,Fn(e)?0:e,!0),eA().setInt32(t+0,!Fn(e),!0)},__wbg___wbindgen_string_get_395e606bd0ee4427:function(t,o){let i=Fe(o),e=typeof i=="string"?i:void 0;var a=Fn(e)?0:Ln(e,ae.__wbindgen_export,ae.__wbindgen_export2),A=KA;eA().setInt32(t+4,A,!0),eA().setInt32(t+0,a,!0)},__wbg___wbindgen_throw_6ddd609b62940d55:function(t,o){throw new Error(kr(t,o))},__wbg__wbg_cb_unref_6b5b6b8576d35cb1:function(t){Fe(t)._wbg_cb_unref()},__wbg_attrs_eb268b5ce109b817:function(t){let o=Fe(t).attrs;return rA(o)},__wbg_call_2d781c1f4d5c0ef8:function(){return Rr(function(t,o,i){let e=Fe(t).call(Fe(o),Fe(i));return rA(e)},arguments)},__wbg_call_e133b57c9155d22c:function(){return Rr(function(t,o){let i=Fe(t).call(Fe(o));return rA(i)},arguments)},__wbg_content_54fb4ecf37d1b68a:function(t){let o=Fe(t).content;return rA(o)},__wbg_debug_10ca7029b12f8d85:function(t,o,i,e){Fe(t).debug(Fe(o),i===0?void 0:kr(i,e))},__wbg_done_08ce71ee07e3bd17:function(t){return Fe(t).done},__wbg_entries_e8a20ff8c9757101:function(t){let o=Object.entries(Fe(t));return rA(o)},__wbg_error_9cce413345f88385:function(t,o,i,e){Fe(t).error(Fe(o),i===0?void 0:kr(i,e))},__wbg_from_4bdf88943703fd48:function(t){let o=Array.from(Fe(t));return rA(o)},__wbg_getOurIdentity_85a51d9b5b46c006:function(){return Rr(function(t){let o=Fe(t).getOurIdentity();return rA(o)},arguments)},__wbg_getOurRegistrationId_6d41d022f3c2af8a:function(){return Rr(function(t){let o=Fe(t).getOurRegistrationId();return rA(o)},arguments)},__wbg_getRandomValues_3f44b700395062e5:function(){return Rr(function(t,o){globalThis.crypto.getRandomValues(wB(t,o))},arguments)},__wbg_get_326e41e095fb2575:function(){return Rr(function(t,o){let i=Reflect.get(Fe(t),Fe(o));return rA(i)},arguments)},__wbg_get_3ef1eba1850ade27:function(){return Rr(function(t,o){let i=Reflect.get(Fe(t),Fe(o));return rA(i)},arguments)},__wbg_get_a8ee5c45dabc1b3b:function(t,o){let i=Fe(t)[o>>>0];return rA(i)},__wbg_get_unchecked_329cfe50afab7352:function(t,o){let i=Fe(t)[o>>>0];return rA(i)},__wbg_get_with_ref_key_6412cf3094599694:function(t,o){let i=Fe(t)[Fe(o)];return rA(i)},__wbg_has_926ef2ff40b308cf:function(){return Rr(function(t,o){return Reflect.has(Fe(t),Fe(o))},arguments)},__wbg_info_b728e87a346ff6a2:function(t,o,i,e){Fe(t).info(Fe(o),i===0?void 0:kr(i,e))},__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6:function(t){let o;try{o=Fe(t)instanceof ArrayBuffer}catch{o=!1}return o},__wbg_instanceof_Map_f194b366846aca0c:function(t){let o;try{o=Fe(t)instanceof Map}catch{o=!1}return o},__wbg_instanceof_Object_be1962063fcc0c9f:function(t){let o;try{o=Fe(t)instanceof Object}catch{o=!1}return o},__wbg_instanceof_Promise_7c3bdd7805c2c6e6:function(t){let o;try{o=Fe(t)instanceof Promise}catch{o=!1}return o},__wbg_instanceof_Uint8Array_740438561a5b956d:function(t){let o;try{o=Fe(t)instanceof Uint8Array}catch{o=!1}return o},__wbg_internalbinarynode_new:function(t){let o=_B.__wrap(t);return rA(o)},__wbg_isArray_33b91feb269ff46e:function(t){return Array.isArray(Fe(t))},__wbg_isSafeInteger_ecd6a7f9c3e053cd:function(t){return Number.isSafeInteger(Fe(t))},__wbg_isTrustedIdentity_8beedd37958ed6af:function(){return Rr(function(t,o,i,e,a){let A=Fe(t).isTrustedIdentity(kr(o,i),Fe(e),a>>>0);return rA(A)},arguments)},__wbg_iterator_d8f549ec8fb061b1:function(){return rA(Symbol.iterator)},__wbg_keys_ab0d051a1c55236d:function(t){let o=Object.keys(Fe(t));return rA(o)},__wbg_length_b3416cf66a5452c8:function(t){return Fe(t).length},__wbg_length_ea16607d7b61445b:function(t){return Fe(t).length},__wbg_level_4b50b181832c5acf:function(t,o){let i=Fe(o).level,e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg_loadPreKey_db3458e3339f7328:function(){return Rr(function(t,o){let i=Fe(t).loadPreKey(o>>>0);return rA(i)},arguments)},__wbg_loadSenderKey_fd075b57283fd71b:function(){return Rr(function(t,o,i){let e=Fe(t).loadSenderKey(kr(o,i));return rA(e)},arguments)},__wbg_loadSession_8564b20b09724f27:function(){return Rr(function(t,o,i){let e=Fe(t).loadSession(kr(o,i));return rA(e)},arguments)},__wbg_loadSignedPreKey_3d5c6c6819f3adf3:function(){return Rr(function(t,o){let i=Fe(t).loadSignedPreKey(o>>>0);return rA(i)},arguments)},__wbg_new_5f486cdf45a04d78:function(t){let o=new Uint8Array(Fe(t));return rA(o)},__wbg_new_7dce085c132c6f91:function(t,o){let i=new TypeError(kr(t,o));return rA(i)},__wbg_new_a70fbab9066b301f:function(){let t=new Array;return rA(t)},__wbg_new_ab79df5bd7c26067:function(){let t=new Object;return rA(t)},__wbg_new_from_slice_22da9388ac046e50:function(t,o){let i=new Uint8Array(wB(t,o));return rA(i)},__wbg_new_typed_aaaeaf29cf802876:function(t,o){try{var i={a:t,b:o},e=(A,r)=>{let s=i.a;i.a=0;try{return jUe(s,i.b,A,r)}finally{i.a=s}};let a=new Promise(e);return rA(a)}finally{i.a=i.b=0}},__wbg_new_with_length_3259a525196bd8cc:function(t){let o=new Array(t>>>0);return rA(o)},__wbg_new_with_length_825018a1616e9e55:function(t){let o=new Uint8Array(t>>>0);return rA(o)},__wbg_next_11b99ee6237339e3:function(){return Rr(function(t){let o=Fe(t).next();return rA(o)},arguments)},__wbg_next_e01a967809d1aa68:function(t){let o=Fe(t).next;return rA(o)},__wbg_parse_e9eddd2a82c706eb:function(){return Rr(function(t,o){let i=JSON.parse(kr(t,o));return rA(i)},arguments)},__wbg_prototypesetcall_d62e5099504357e6:function(t,o,i){Uint8Array.prototype.set.call(wB(t,o),Fe(i))},__wbg_push_e87b0e732085a946:function(t,o){return Fe(t).push(Fe(o))},__wbg_queueMicrotask_0c399741342fb10f:function(t){let o=Fe(t).queueMicrotask;return rA(o)},__wbg_queueMicrotask_a082d78ce798393e:function(t){queueMicrotask(Fe(t))},__wbg_removePreKey_c0b0a066eb6f2e1e:function(){return Rr(function(t,o){let i=Fe(t).removePreKey(o>>>0);return rA(i)},arguments)},__wbg_resolve_ae8d83246e5bcc12:function(t){let o=Promise.resolve(Fe(t));return rA(o)},__wbg_senderkeydistributionmessage_new:function(t){let o=Eh.__wrap(t);return rA(o)},__wbg_sessionrecord_new:function(t){let o=TB.__wrap(t);return rA(o)},__wbg_set_282384002438957f:function(t,o,i){Fe(t)[o>>>0]=mA(i)},__wbg_set_6be42768c690e380:function(t,o,i){Fe(t)[mA(o)]=mA(i)},__wbg_set_7eaa4f96924fd6b3:function(){return Rr(function(t,o,i){return Reflect.set(Fe(t),Fe(o),Fe(i))},arguments)},__wbg_set_8c0b3ffcf05d61c2:function(t,o,i){Fe(t).set(wB(o,i))},__wbg_static_accessor_GLOBAL_8adb955bd33fac2f:function(){let t=typeof global>"u"?null:global;return Fn(t)?0:rA(t)},__wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913:function(){let t=typeof globalThis>"u"?null:globalThis;return Fn(t)?0:rA(t)},__wbg_static_accessor_SELF_f207c857566db248:function(){let t=typeof self>"u"?null:self;return Fn(t)?0:rA(t)},__wbg_static_accessor_WINDOW_bb9f1ba69d61b386:function(){let t=typeof window>"u"?null:window;return Fn(t)?0:rA(t)},__wbg_storeSenderKey_8a6c9ec5f7e1cd2e:function(){return Rr(function(t,o,i,e){let a=Fe(t).storeSenderKey(kr(o,i),Fe(e));return rA(a)},arguments)},__wbg_storeSessionRaw_09b5cc73064d12d8:function(){return Rr(function(t,o,i,e){let a=Fe(t).storeSessionRaw(kr(o,i),Fe(e));return rA(a)},arguments)},__wbg_storeSession_4d419555ce654965:function(){return Rr(function(t,o,i,e){let a=Fe(t).storeSession(kr(o,i),mA(e));return rA(a)},arguments)},__wbg_tag_33cfe8e9ee66b4db:function(t,o){let i=Fe(o).tag,e=Ln(i,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;eA().setInt32(t+4,a,!0),eA().setInt32(t+0,e,!0)},__wbg_then_098abe61755d12f6:function(t,o){let i=Fe(t).then(Fe(o));return rA(i)},__wbg_then_9e335f6dd892bc11:function(t,o,i){let e=Fe(t).then(Fe(o),Fe(i));return rA(e)},__wbg_trace_58264fbce2ceb5e6:function(t,o,i,e){Fe(t).trace(Fe(o),i===0?void 0:kr(i,e))},__wbg_value_21fc78aab0322612:function(t){let o=Fe(t).value;return rA(o)},__wbg_warn_db531770752932a9:function(t,o,i,e){Fe(t).warn(Fe(o),i===0?void 0:kr(i,e))},__wbindgen_cast_0000000000000001:function(t,o){let i=qUe(t,o,ae.__wasm_bindgen_func_elem_694,YUe);return rA(i)},__wbindgen_cast_0000000000000002:function(t){return rA(t)},__wbindgen_cast_0000000000000003:function(t){return rA(t)},__wbindgen_cast_0000000000000004:function(t,o){let i=wB(t,o);return rA(i)},__wbindgen_cast_0000000000000005:function(t,o){let i=kr(t,o);return rA(i)},__wbindgen_cast_0000000000000006:function(t){let o=BigInt.asUintN(64,t);return rA(o)},__wbindgen_object_clone_ref:function(t){let o=Fe(t);return rA(o)},__wbindgen_object_drop_ref:function(t){mA(t)}}}}function YUe(n,t,o){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.__wasm_bindgen_func_elem_699(a,n,t,rA(o));var i=eA().getInt32(a+0,!0),e=eA().getInt32(a+4,!0);if(e)throw mA(i)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}function jUe(n,t,o,i){ae.__wasm_bindgen_func_elem_1248(n,t,rA(o),rA(i))}var h7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_expandedappstatekeys_free(n>>>0,1)),E7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_groupcipher_free(n>>>0,1)),C7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_groupsessionbuilder_free(n>>>0,1)),u7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_internalbinarynode_free(n>>>0,1)),B7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_lthashantitampering_free(n>>>0,1)),HF=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_lthashstate_free(n>>>0,1)),f7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_noisesession_free(n>>>0,1)),KF=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_protocoladdress_free(n>>>0,1)),Q7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeydistributionmessage_free(n>>>0,1)),y7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeyname_free(n>>>0,1)),xF=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeyrecord_free(n>>>0,1)),m7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessionbuilder_free(n>>>0,1)),S7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessioncipher_free(n>>>0,1)),w7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessionrecord_free(n>>>0,1));function rA(n){OB===Ug.length&&Ug.push(Ug.length+1);let t=OB;return OB=Ug[t],Ug[t]=n,t}function Xc(n,t){if(!(n instanceof t))throw new Error(`expected instance of ${t.name}`)}var D7=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function jF(n){let t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){let e=n.description;return e==null?"Symbol":`Symbol(${e})`}if(t=="function"){let e=n.name;return typeof e=="string"&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){let e=n.length,a="[";e>0&&(a+=jF(n[0]));for(let A=1;A1)i=o[1];else return toString.call(n);if(i=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} +${n.stack}`:i}function JUe(n){n<1028||(Ug[n]=OB,OB=n)}function wB(n,t){return n=n>>>0,dh().subarray(n/1,n/1+t)}var vl=null;function eA(){return(vl===null||vl.buffer.detached===!0||vl.buffer.detached===void 0&&vl.buffer!==ae.memory.buffer)&&(vl=new DataView(ae.memory.buffer)),vl}function kr(n,t){return n=n>>>0,VUe(n,t)}var DB=null;function dh(){return(DB===null||DB.byteLength===0)&&(DB=new Uint8Array(ae.memory.buffer)),DB}function Fe(n){return Ug[n]}function Rr(n,t){try{return n.apply(this,t)}catch(o){ae.__wbindgen_export3(rA(o))}}var Ug=new Array(1024).fill(void 0);Ug.push(void 0,null,!0,!1);var OB=Ug.length;function Fn(n){return n==null}function qUe(n,t,o,i){let e={a:n,b:t,cnt:1,dtor:o},a=(...A)=>{e.cnt++;let r=e.a;e.a=0;try{return i(r,e.b,...A)}finally{e.a=r,a._wbg_cb_unref()}};return a._wbg_cb_unref=()=>{--e.cnt===0&&(e.dtor(e.a,e.b),e.a=0,D7.unregister(e))},D7.register(a,e,e),a}function kt(n,t){let o=t(n.length*1,1)>>>0;return dh().set(n,o/1),KA=n.length,o}function O7(n,t){let o=t(n.length*4,4)>>>0,i=eA();for(let e=0;e>>0;return dh().subarray(s,s+r.length).set(r),KA=r.length,s}let i=n.length,e=t(i,1)>>>0,a=dh(),A=0;for(;A127)break;a[e+A]=r}if(A!==i){A!==0&&(n=n.slice(A)),e=o(e,i,i=A+n.length*3,1)>>>0;let r=dh().subarray(e+A,e+i),s=bB.encodeInto(n,r);A+=s.written,e=o(e,i,A,1)>>>0}return KA=A,e}function mA(n){let t=Fe(n);return JUe(n),t}var oD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});oD.decode();var zUe=2146435072,YF=0;function VUe(n,t){return YF+=t,YF>=zUe&&(oD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),oD.decode(),YF=t),oD.decode(dh().subarray(n,n+t))}var bB=new TextEncoder;"encodeInto"in bB||(bB.encodeInto=function(n,t){let o=bB.encode(n);return t.set(o),{read:n.length,written:o.length}});var KA=0,WUe,ae;function ZUe(n,t){return ae=n.exports,WUe=t,vl=null,DB=null,ae}function M7(n){if(ae!==void 0)return ae;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=xUe();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));let o=new WebAssembly.Instance(n,t);return ZUe(o,n)}var XUe=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function _7(n){let t=atob(n),o=new Uint8Array(t.length);for(let i=0;in.length===33?n:Buffer.concat([Hg,n]),Sr={generateKeyPair:()=>{let{pubKey:n,privKey:t}=eI.generateKeyPair();return{private:Buffer.from(t),public:Buffer.from(n.slice(1))}},sharedKey:(n,t)=>{let o=eI.calculateAgreement(Vo(t),n);return Buffer.from(o)},sign:(n,t)=>eI.calculateSignature(n,t),verify:(n,t,o)=>{try{return eI.verifySignature(Vo(n),t,o),!0}catch{return!1}}},dD=(n,t)=>{let o=Sr.generateKeyPair(),i=Vo(o.public),e=Sr.sign(n.private,i);return{keyPair:o,signature:e,keyId:t}},N7=16;function Pl(n,t,o,i){let e=JF("aes-256-gcm",t,o);return e.setAAD(i),Buffer.concat([e.update(n),e.final(),e.getAuthTag()])}function Gl(n,t,o,i){let e=qF("aes-256-gcm",t,o),a=n.slice(0,n.length-N7),A=n.slice(n.length-N7);return e.setAAD(i),e.setAuthTag(A),Buffer.concat([e.update(a),e.final()])}function R7(n,t,o){let i=JF("aes-256-ctr",t,o);return Buffer.concat([i.update(n),i.final()])}function k7(n,t,o){let i=qF("aes-256-ctr",t,o);return Buffer.concat([i.update(n),i.final()])}function v7(n,t){return oHe(n.subarray(16),t,n.subarray(0,16))}function oHe(n,t,o){let i=qF("aes-256-cbc",t,o);return Buffer.concat([i.update(n),i.final()])}function P7(n,t){let o=iHe(16),i=JF("aes-256-cbc",t,o);return Buffer.concat([o,i.update(n),i.final()])}function Hn(n,t,o="sha256"){return aHe(o,t).update(n).digest()}function uh(n){return rHe("sha256").update(n).digest()}async function hD(n,t){let i=new TextEncoder().encode(n),e=new Uint8Array(t instanceof Uint8Array?t:new Uint8Array(t)),a=await T7.importKey("raw",i,{name:"PBKDF2"},!1,["deriveBits"]),A=await T7.deriveBits({name:"PBKDF2",salt:e,iterations:2<<16,hash:"SHA-256"},a,256);return Buffer.from(A)}var RB={replacer:(n,t)=>Buffer.isBuffer(t)||t instanceof Uint8Array||t?.type==="Buffer"?{type:"Buffer",data:Buffer.from(t?.data||t).toString("base64")}:t,reviver:(n,t)=>{if(typeof t=="object"&&t!==null&&t.type==="Buffer"&&typeof t.data=="string")return Buffer.from(t.data,"base64");if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=Object.keys(t);if(o.length>0&&o.every(i=>!isNaN(parseInt(i,10)))){let i=Object.values(t);if(i.every(e=>typeof e=="number"))return Buffer.from(i)}}return t}},Bh=(n,t="me")=>(n?.fromMe?t:n?.participantAlt||n?.remoteJidAlt||n?.participant||n?.remoteJid)||"",L7=n=>n==null||n==="",sHe=n=>{let o=(NB(1)[0]&15)+1;return Buffer.concat([n,Buffer.alloc(o,o)])},U7=n=>{let t=new Uint8Array(n);if(t.length===0)throw new Error("unpadPkcs7 given empty bytes");var o=t[t.length-1];if(o>t.length)throw new Error(`unpad given ${t.length} bytes, but pad is ${o}`);return new Uint8Array(t.buffer,t.byteOffset,t.length-o)},H7=n=>(n.sort(),"2:"+uh(Buffer.from(n.join(""))).toString("base64").slice(0,6)),fh=n=>sHe(oe.Message.encode(n).finish()),K7=()=>Uint16Array.from(NB(2))[0]&16383,Kg=(n,t=4)=>{let o=n,i=new Uint8Array(t);for(let e=t-1;e>=0;e--)i[e]=255&o,o>>>=8;return i},Yr=n=>typeof n=="object"&&n?"toNumber"in n?n.toNumber():n.low:n||0,Oa=(n=new Date)=>Math.floor(n.getTime()/1e3);var kB=n=>x7(n).delay,x7=n=>{let t=new Error().stack,o,i;return{delay:new Promise((A,r)=>{o=setTimeout(A,n),i=r}),cancel:()=>{clearTimeout(o),i(new ED.Boom("Cancelled",{statusCode:500,data:{stack:t}}))}}};async function Qh(n,t){if(!n)return new Promise(t);let o=new Error().stack,{delay:i,cancel:e}=x7(n);return new Promise((A,r)=>{i.then(()=>r(new ED.Boom("Timed Out",{statusCode:$t.timedOut,data:{stack:o}}))).catch(s=>r(s)),t(A,r)}).finally(e)}var jr=n=>{let t=Buffer.alloc(44);if(t.writeBigUInt64BE(BigInt(Math.floor(Date.now()/1e3))),n){let e=fA(n);e?.user&&(t.write(e.user,8),t.write("@c.us",8+e.user.length))}return NB(16).copy(t,28),"3EB0"+nHe("sha256").update(t).digest().toString("hex").toUpperCase().substring(0,18)},zF=()=>"3EB0"+NB(18).toString("hex").toUpperCase();function VF(n,t){return async(o,i)=>{let e,a;await Qh(i,(A,r)=>{a=({connection:s,lastDisconnect:g})=>{s==="close"&&r(g?.error||new ED.Boom("Connection Closed",{statusCode:$t.connectionClosed}))},n.on("connection.update",a),e=async s=>{await o(s)&&A()},n.on(t,e)}).finally(()=>{n.off(t,e),n.off("connection.update",a)})}}var Y7=n=>VF(n,"connection.update");var j7=()=>{let n=NB(4);return`${n.readUInt16BE()}.${n.readUInt16BE(2)}-`},gHe={sender:oe.WebMessageInfo.Status.SERVER_ACK,played:oe.WebMessageInfo.Status.PLAYED,read:oe.WebMessageInfo.Status.READ,"read-self":oe.WebMessageInfo.Status.READ},J7=n=>{let t=gHe[n];return typeof n>"u"?oe.WebMessageInfo.Status.DELIVERY_ACK:t},cHe={conflict:$t.connectionReplaced},q7=n=>{let[t]=_s(n),o=t?.tag||"unknown",i=+(n.attrs.code||cHe[o]||$t.badSession);return i===$t.restartRequired&&(o="restart required"),{reason:o,statusCode:i}},z7=({tag:n,attrs:t})=>{let o;switch(n){case"offer":case"offer_notice":o="offer";break;case"terminate":t.reason==="timeout"?o="timeout":o="terminate";break;case"preaccept":o="preaccept";break;case"transport":o="transport";break;case"relaylatency":o="relaylatency";break;case"reject":o="reject";break;case"accept":o="accept";break;default:o="ringing";break}return o},G7="Unexpected server response: ",V7=n=>{let t=500;if(n?.message?.includes(G7)){let o=+n?.message.slice(G7.length);!Number.isNaN(o)&&o>=400&&(t=o)}else(n?.code?.startsWith("E")||n?.message?.includes("timed out"))&&(t=408);return t};function CD(n){for(let t in n)typeof n[t]>"u"&&delete n[t];return n}var F7="123456789ABCDEFGHJKLMNPQRSTVWXYZ";function W7(n){let t=0,o=0,i=[];for(let e of n)for(t=t<<8|e&255,o+=8;o>=5;)i.push(F7.charAt(t>>>o-5&31)),o-=5;return o>0&&i.push(F7.charAt(t<<5-o&31)),i.join("")}function Z7(n){return oe.Message.encode(n).finish()}var Fl=qe(Kr(),1);var IHe=async(n,t)=>qA(n)||Ia(n)?n:await t.lidMapping.getLIDForPN(n)||n,lHe=async(n,t,o,i,e)=>{let{senderAlt:a}=BD(n);if(a&&qA(a)&&_t(t)&&i===t)try{await o.lidMapping.storeLIDPNMappings([{lid:a,pn:t}]),await o.migrateSession(t,a),e.debug({sender:t,senderAlt:a},"Stored LID mapping from envelope")}catch(A){e.warn({sender:t,senderAlt:a,error:A},"Failed to store LID mapping")}},uD="Message absent from node",X7="Key used already or never filled",$7="Your account has been restricted",pHe={maxRetries:3,baseDelayMs:100,sessionRecordErrors:["No session record","SessionError: No session record"]},Ll={SenderReachoutTimelocked:463,ParsingError:487,UnrecognizedStanza:488,UnrecognizedStanzaClass:489,UnrecognizedStanzaType:490,InvalidProtobuf:491,InvalidHostedCompanionStanza:493,MissingMessageSecret:495,SignalErrorOldCounter:496,MessageDeletedOnPeer:499,UnhandledError:500,UnsupportedAdminRevoke:550,UnsupportedLIDGroup:551,DBOperationFailed:552},WF={MessageAccountRestriction:"463",SmaxInvalid:"479"},BD=n=>{let t,o,i=n.attrs.participant||n.attrs.from,e=n.attrs.addressing_mode||(i?.endsWith("lid")?"lid":"pn");return e==="lid"?(t=n.attrs.participant_pn||n.attrs.sender_pn||n.attrs.peer_recipient_pn,o=n.attrs.recipient_pn):(t=n.attrs.participant_lid||n.attrs.sender_lid||n.attrs.peer_recipient_lid,o=n.attrs.recipient_lid),{addressingMode:e,senderAlt:t,recipientAlt:o}};function ZF(n,t,o){let i,e,a,A=!1,r=n.attrs.id,s=n.attrs.from,g=n.attrs.participant,c=n.attrs.recipient;if(!r)throw new Fl.Boom("Invalid message stanza: missing id attribute",{data:n});if(!s)throw new Fl.Boom("Invalid message stanza: missing from attribute",{data:n});let I=BD(n),d=m=>Rt(m,t),B=m=>Rt(m,o);if(_t(s)||qA(s)||Ia(s)||mr(s)){if(c&&!ph(c)){if(!d(s)&&!B(s))throw new Fl.Boom("receipient present, but msg not from me",{data:n});(d(s)||B(s))&&(A=!0),e=c}else(d(s)||B(s))&&(A=!0),e=s;i="chat",a=s}else if(xr(s)){if(!g)throw new Fl.Boom("No participant in group message");(d(g)||B(g))&&(A=!0),i="group",a=g,e=s}else if(SB(s)){if(!g)throw new Fl.Boom("No participant in group message");let m=d(g);Lg(s)?i=m?"direct_peer_status":"other_status":i=m?"peer_broadcast":"other_broadcast",A=m,e=s,a=g}else if(Wc(s))i="newsletter",e=s,a=s,(d(s)||B(s))&&(A=!0);else throw new Fl.Boom("Unknown message type",{data:n});let f=n?.attrs?.notify,Q={remoteJid:e,remoteJidAlt:xr(e)?void 0:I.senderAlt,remoteJidUsername:xr(e)?void 0:n.attrs.peer_recipient_username||n.attrs.recipient_username,fromMe:A,id:r,participant:g,participantAlt:xr(e)?I.senderAlt:void 0,participantUsername:n.attrs.participant?n.attrs.participant_username:void 0,addressingMode:I.addressingMode,...i==="newsletter"&&n.attrs.server_id?{server_id:n.attrs.server_id}:{}},y={key:Q,category:n.attrs.category,messageTimestamp:+n.attrs.t,pushName:f,broadcast:SB(s)};return Q.fromMe&&(y.status=oe.WebMessageInfo.Status.SERVER_ACK),{fullMessage:y,author:a,sender:i==="chat"?a:e}}var e$=(n,t,o,i,e)=>{let{fullMessage:a,author:A,sender:r}=ZF(n,t,o);return{fullMessage:a,category:n.attrs.category,author:A,async decrypt(){let s=0;if(Array.isArray(n.content))for(let{tag:g,attrs:c,content:I}of n.content){if(g==="verified_name"&&I instanceof Uint8Array){let f=oe.VerifiedNameCertificate.decode(I),Q=oe.VerifiedNameCertificate.Details.decode(f.details);a.verifiedBizName=Q.verifiedName}if(g==="unavailable"&&c.type==="view_once"&&(a.key.isViewOnce=!0),c.count&&g==="enc"&&(a.retryCount=Number(c.count)),g!=="enc"&&g!=="plaintext"||!(I instanceof Uint8Array))continue;s+=1;let d,B=await IHe(A,i);g!=="plaintext"&&await lHe(n,A,i,B,e);try{let f=g==="plaintext"?"plaintext":c.type;switch(f){case"skmsg":d=await i.decryptGroupMessage({group:r,authorJid:A,msg:I});break;case"pkmsg":case"msg":d=await i.decryptMessage({jid:B,type:f,ciphertext:I});break;case"plaintext":d=I;break;default:throw new Error(`Unknown e2e type: ${f}`)}let Q=oe.Message.decode(f!=="plaintext"?U7(d):d);if(Q=Q.deviceSentMessage?.message||Q,Q.senderKeyDistributionMessage)try{await i.processSenderKeyDistributionMessage({authorJid:A,item:Q.senderKeyDistributionMessage})}catch(y){e.error({key:a.key,err:y},"failed to process sender key distribution message")}a.message?Object.assign(a.message,Q):a.message=Q}catch(f){let Q={key:a.key,err:f,messageType:g==="plaintext"?"plaintext":c.type,sender:r,author:A,isSessionRecordError:dHe(f)};e.error(Q,"failed to decrypt message"),a.messageStubType=oe.WebMessageInfo.StubType.CIPHERTEXT,a.messageStubParameters=[f.message.toString()]}}!s&&!a.key?.isViewOnce&&(a.messageStubType=oe.WebMessageInfo.StubType.CIPHERTEXT,a.messageStubParameters=[uD])}}};function dHe(n){let t=n?.message||n?.toString()||"";return pHe.sessionRecordErrors.some(o=>t.includes(o))}var Xg=qe(Kr(),1);import{randomBytes as IU}from"crypto";import{promises as lU}from"fs";var xn=qe(Kr(),1);import{exec as d4e}from"child_process";import*as fo from"crypto";import{once as sE}from"events";import{createReadStream as Eb,createWriteStream as rU,promises as cE}from"fs";import{tmpdir as Doe}from"os";import{join as db}from"path";import{Readable as Df,Transform as h4e}from"stream";import{URL as aU}from"url";var iU=()=>Doe(),Ooe=async()=>{let[n,t]=await Promise.all([import("jimp").catch(()=>{}),Promise.resolve().then(()=>(Ite(),cte)).catch(()=>{})]);if(t)return{sharp:t};if(n)return{jimp:n};throw new xn.Boom("No image processing library available")},E4e=n=>`WhatsApp ${Loe[n]} Keys`,Cb=async(n,t,o)=>{let{stream:i}=await Of(n);o?.debug("got stream for raw upload");let e=fo.createHash("sha256"),a=db(Doe(),t+jr()),A=rU(a),r=0;try{for await(let g of i)r+=g.length,e.update(g),A.write(g)||await sE(A,"drain");A.end(),await sE(A,"finish"),i.destroy();let s=e.digest();return o?.debug("hashed data for raw upload"),{filePath:a,fileSha256:s,fileLength:r}}catch(s){A.destroy(),i.destroy();try{await cE.unlink(a)}catch{}throw s}};async function boe(n,t){if(!n)throw new xn.Boom("Cannot derive from empty media key");typeof n=="string"&&(n=Buffer.from(n.replace("data:;base64,",""),"base64"));let o=Un(n,112,{info:E4e(t)});return{iv:o.slice(0,16),cipherKey:o.slice(16,48),macKey:o.slice(48,80)}}var C4e=async(n,t,o,i)=>new Promise((e,a)=>{let A=`ffmpeg -ss ${o} -i ${n} -y -vf scale=${i.width}:-1 -vframes 1 -f image2 ${t}`;d4e(A,r=>{r?a(r):e()})}),oU=async(n,t=32)=>{n instanceof Df&&(n=await hb(n));let o=await Ooe();if("sharp"in o&&typeof o.sharp?.default=="function"){let i=o.sharp.default(n),e=await i.metadata();return{buffer:await i.resize(t).jpeg({quality:50}).toBuffer(),original:{width:e.width,height:e.height}}}else if("jimp"in o&&typeof o.jimp?.Jimp=="object"){let i=await o.jimp.Jimp.read(n),e={width:i.width,height:i.height};return{buffer:await i.resize({w:t,mode:o.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50}),original:e}}else throw new xn.Boom("No image processing library available")},u4e=n=>encodeURIComponent(n.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")),ub=async(n,t)=>{let o,{width:i=640,height:e=640}=t||{};if(Buffer.isBuffer(n))o=n;else{let{stream:r}=await Of(n);o=await hb(r)}let a=await Ooe(),A;if("sharp"in a&&typeof a.sharp?.default=="function")A=a.sharp.default(o).resize(i,e).jpeg({quality:50}).toBuffer();else if("jimp"in a&&typeof a.jimp?.Jimp=="function"){let r=await a.jimp.Jimp.read(o),s=Math.min(r.width,r.height);A=r.crop({x:0,y:0,w:s,h:s}).resize({w:i,h:e,mode:a.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50})}else throw new xn.Boom("No image processing library available");return{img:await A}};async function Moe(n){let t=await Promise.resolve().then(()=>(Soe(),moe)),o,i={duration:!0};return Buffer.isBuffer(n)?o=await t.parseBuffer(n,void 0,i):typeof n=="string"?o=await t.parseFile(n,i):o=await t.parseStream(n,void 0,i),o.format.duration}async function _oe(n,t){try{let{default:o}=await import("audio-decode"),i;if(Buffer.isBuffer(n))i=n;else if(typeof n=="string"){let d=Eb(n);i=await hb(d)}else i=await hb(n);let a=(await o(i)).getChannelData(0),A=64,r=Math.floor(a.length/A),s=[];for(let d=0;dd*g);return new Uint8Array(c.map(d=>Math.floor(100*d)))}catch(o){t?.debug("Failed to generate waveform: "+o)}}var woe=n=>{let t=new Df({read:()=>{}});return t.push(n),t.push(null),t},hb=async n=>{let t=[];for await(let o of n)t.push(o);return n.destroy(),Buffer.concat(t)},Of=async(n,t)=>{if(Buffer.isBuffer(n))return{stream:woe(n),type:"buffer"};if("stream"in n)return{stream:n.stream,type:"readable"};let o=n.url.toString();if(o.startsWith("data:")){let i=Buffer.from(o.split(",")[1],"base64");return{stream:woe(i),type:"buffer"}}return o.startsWith("http://")||o.startsWith("https://")?{stream:await Bb(n.url,t),type:"remote"}:{stream:Eb(n.url),type:"file"}};async function Toe(n,t,o){let i,e;if(t==="image"){let{buffer:a,original:A}=await oU(n);i=a.toString("base64"),A.width&&A.height&&(e={width:A.width,height:A.height})}else if(t==="video"){let a=db(iU(),jr()+".jpg");try{await C4e(n,a,"00:00:00",{width:32,height:32}),i=(await cE.readFile(a)).toString("base64"),await cE.unlink(a)}catch(A){o.logger?.debug("could not generate video thumb: "+A)}}return{thumbnail:i,originalImageDimensions:e}}var Bb=async(n,t={})=>{let o=await fetch(n.toString(),{dispatcher:t.dispatcher,method:"GET",headers:t.headers});if(!o.ok)throw new xn.Boom(`Failed to fetch stream from ${n}`,{statusCode:o.status,data:{url:n}});return o.body instanceof Df?o.body:Df.fromWeb(o.body)},Noe=async(n,t,{logger:o,saveOriginalFileIfRequired:i,opts:e}={})=>{let{stream:a,type:A}=await Of(n,e);o?.debug("fetched media stream");let r=fo.randomBytes(32),{cipherKey:s,iv:g,macKey:c}=await boe(r,t),I=db(iU(),t+jr()+"-enc"),d=rU(I),B,f;i&&(f=db(iU(),t+jr()+"-original"),B=rU(f));let Q=0,y=fo.createCipheriv("aes-256-cbc",s,g),m=fo.createHmac("sha256",c).update(g),T=fo.createHash("sha256"),_=fo.createHash("sha256"),R=async K=>{_.update(K),m.update(K),d.write(K)||await sE(d,"drain")};try{for await(let x of a){if(Q+=x.length,A==="remote"&&e?.maxContentLength&&Q+x.length>e.maxContentLength)throw new xn.Boom(`content length exceeded when encrypting "${A}"`,{data:{media:n,type:A}});B&&(B.write(x)||await sE(B,"drain")),T.update(x),await R(y.update(x))}await R(y.final());let K=m.digest().slice(0,10);_.update(K);let L=T.digest(),F=_.digest();d.write(K);let q=sE(d,"finish"),V=B?sE(B,"finish"):Promise.resolve();return d.end(),B?.end?.(),a.destroy(),await q,await V,o?.debug("encrypted data successfully"),{mediaKey:r,originalFilePath:f,encFilePath:I,mac:K,fileEncSha256:F,fileSha256:L,fileLength:Q}}catch(K){d.destroy(),B?.destroy?.(),y.destroy(),m.destroy(),T.destroy(),_.destroy(),a.destroy();try{await cE.unlink(I),f&&await cE.unlink(f)}catch(L){o?.error({err:L},"failed deleting tmp files")}throw K}},nU="mmg.whatsapp.net",gE=16,tU=n=>Math.floor(n/gE)*gE,bf=(n,t=nU)=>`https://${t}${n}`,B4e=n=>{if(n)try{return new aU(n).host}catch{return}},IE=async({mediaKey:n,directPath:t,url:o},i,e={})=>{let a=e.host??B4e(o),A=t?bf(t,a):o;if(!A)throw new xn.Boom("No valid media URL or directPath present in message",{statusCode:400});let r=await boe(n,i);return f4e(A,r,e)},f4e=async(n,{cipherKey:t,iv:o},{startByte:i,endByte:e,options:a}={})=>{let A=0,r=0,s=!1;if(i){let m=tU(i||0);m&&(r=m-gE,A=m,s=!0)}let g=e?tU(e||0)+gE:void 0,c=a?.headers?a.headers:void 0,I={...c?Array.isArray(c)?Object.fromEntries(c):c:{},Origin:Mf};(r||g)&&(I.Range=`bytes=${r}-`,g&&(I.Range+=g));let d=await Bb(n,{...a||{},headers:I}),B=Buffer.from([]),f,Q=(m,T)=>{if(i||e){let _=A>=i?void 0:Math.max(i-A,0),R=A+m.lengththis.push(L)),_()}catch(L){_(L)}},final(m){try{Q(f.final(),T=>this.push(T)),m()}catch(T){m(T)}}});return d.pipe(y,{end:!0})};var Q4e=()=>typeof process<"u"&&process.versions?.node!==null&&typeof process.versions.bun>"u"&&typeof globalThis.Deno>"u",Roe=async({url:n,filePath:t,headers:o,timeoutMs:i,agent:e},a=0)=>{if(a>5)throw new Error("Too many redirects");let A=new aU(n),r=A.protocol==="https:"?await import("https"):await import("http"),g=(await cE.stat(t)).size;return new Promise((c,I)=>{let d=r.request({hostname:A.hostname,port:A.port||(A.protocol==="https:"?443:80),path:A.pathname+A.search,method:"POST",headers:{...o,"Content-Length":g},agent:e,timeout:i},f=>{if(f.statusCode&&f.statusCode>=300&&f.statusCode<400&&f.headers.location){f.resume();let y=new aU(f.headers.location,n).toString();c(Roe({url:y,filePath:t,headers:o,timeoutMs:i,agent:e},a+1));return}let Q="";f.on("data",y=>Q+=y),f.on("end",()=>{try{c(JSON.parse(Q))}catch{c(void 0)}})});d.on("error",I),d.on("timeout",()=>{d.destroy(),I(new Error("Upload timeout"))});let B=Eb(t);B.pipe(d),B.on("error",f=>{d.destroy(),I(f)})})},y4e=async({url:n,filePath:t,headers:o,timeoutMs:i,agent:e})=>{let a=Eb(t),A=Df.toWeb(a),r=typeof e?.dispatch=="function"?e:void 0,s=await fetch(n,{...r?{dispatcher:r}:{},method:"POST",body:A,headers:o,duplex:"half",signal:i?AbortSignal.timeout(i):void 0});try{return await s.json()}catch{return}},m4e=async(n,t)=>Q4e()?(t?.debug("Using Node.js https module for upload (avoids undici buffering bug)"),Roe(n)):(t?.debug("Using web-standard Fetch API for upload"),y4e(n)),koe=({customUploadHosts:n,fetchAgent:t,logger:o,options:i},e)=>async(a,{mediaType:A,fileEncSha256B64:r,timeoutMs:s})=>{let g=await e(!1),c,I=[...n,...g.hosts];r=u4e(r);let B={...(()=>{let f=i?.headers;return f?Array.isArray(f)?Object.fromEntries(f):f:{}})(),"Content-Type":"application/octet-stream",Origin:Mf};for(let{hostname:f}of I){o.debug(`uploading to "${f}"`);let Q=encodeURIComponent(g.auth),y=`https://${f}${gU[A]}/${r}?auth=${Q}&token=${r}`,m;try{if(m=await m4e({url:y,filePath:a,headers:B,timeoutMs:s,agent:t},o),m?.url||m?.direct_path){c={mediaUrl:m.url,directPath:m.direct_path,meta_hmac:m.meta_hmac,fbid:m.fbid,ts:m.ts};break}else throw g=await e(!0),new Error(`upload failed, reason: ${JSON.stringify(m)}`)}catch(T){let _=f===I[g.hosts.length-1]?.hostname;o.warn({trace:T?.stack,uploadResult:m},`Error in uploading to ${f} ${_?"":", retrying..."}`)}}if(!c)throw new xn.Boom("Media upload failed on all hosts",{statusCode:500});return c},voe=n=>Un(n,32,{info:"WhatsApp Media Retry Notification"}),Poe=(n,t,o)=>{let i={stanzaId:n.id},e=oe.ServerErrorReceipt.encode(i).finish(),a=fo.randomBytes(12),A=voe(t),r=Pl(e,A,a,Buffer.from(n.id));return{tag:"receipt",attrs:{id:n.id,to:uA(o),type:"server-error"},content:[{tag:"encrypt",attrs:{},content:[{tag:"enc_p",attrs:{},content:r},{tag:"enc_iv",attrs:{},content:a}]},{tag:"rmr",attrs:{jid:n.remoteJid,from_me:(!!n.fromMe).toString(),participant:n.participant||void 0}}]}},Goe=n=>{let t=le(n,"rmr"),o={key:{id:n.attrs.id,remoteJid:t.attrs.jid,fromMe:t.attrs.from_me==="true",participant:t.attrs.participant}},i=le(n,"error");if(i){let e=+i.attrs.code;o.error=new xn.Boom(`Failed to re-upload media (${e})`,{data:i.attrs,statusCode:sU(e)})}else{let e=le(n,"encrypt"),a=Da(e,"enc_p"),A=Da(e,"enc_iv");a&&A?o.media={ciphertext:a,iv:A}:o.error=new xn.Boom("Failed to re-upload media (missing ciphertext)",{statusCode:404})}return o},Foe=({ciphertext:n,iv:t},o,i)=>{let e=voe(o),a=Gl(n,e,t,Buffer.from(i));return oe.MediaRetryNotification.decode(a)},sU=n=>S4e[n],S4e={[oe.MediaRetryNotification.ResultType.SUCCESS]:200,[oe.MediaRetryNotification.ResultType.DECRYPTION_ERROR]:412,[oe.MediaRetryNotification.ResultType.NOT_FOUND]:404,[oe.MediaRetryNotification.ResultType.GENERAL_ERROR]:418};import{createHmac as w4e}from"crypto";var D4e=[{f:1},{f:3,s:[{f:2},{f:3},{f:8},{f:11},{f:17,s:[{f:21},{f:22}]},{f:25}]},{f:4,s:[{f:1},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:5,s:[{f:3},{f:4},{f:5},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:6,s:[{f:1},{f:17,s:[{f:21},{f:22}]},{f:30}]},{f:7,s:[{f:2},{f:7},{f:10},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:8,s:[{f:2},{f:7},{f:9},{f:17,s:[{f:21},{f:22}]},{f:21}]},{f:9,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:12,s:[{f:1},{f:2},{f:14,m:!0},{f:15}]},{f:18,s:[{f:6},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:26,s:[{f:4},{f:5},{f:8},{f:13},{f:17,s:[{f:21},{f:22}]}]},{f:28,s:[{f:1},{f:2},{f:4},{f:5},{f:6},{f:7,s:[{f:21},{f:22}]}]},{f:37,s:[{f:1,m:!0}]},{f:49,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:53,s:[{f:1,m:!0}]},{f:55,s:[{f:1,m:!0}]},{f:58,s:[{f:1,m:!0}]},{f:59,s:[{f:1,m:!0}]},{f:60,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:64,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:66,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:74,s:[{f:1,m:!0}]},{f:87,s:[{f:1,m:!0}]},{f:88,s:[{f:1},{f:2,s:[{f:1}]},{f:3,s:[{f:21},{f:22}]}]},{f:92,s:[{f:1,m:!0}]},{f:93,s:[{f:1,m:!0}]},{f:94,s:[{f:1,m:!0}]}],Hoe=n=>{let t=new Map;for(let o of n)t.set(o.f,{m:o.m,children:o.s?Hoe(o.s):void 0});return t},O4e=Hoe(D4e),b4e=new Map,M4e="Report Token",fb={VARINT:0,FIXED64:1,BYTES:2,FIXED32:5},Qb=n=>!n.reactionMessage&&!n.encReactionMessage&&!n.encEventResponseMessage&&!n.pollUpdateMessage,_4e=(n,t,o,i,e)=>{let a=Buffer.concat([Buffer.from(t,"utf8"),Buffer.from(o,"utf8"),Buffer.from(i,"utf8"),Buffer.from(n,"utf8")]);return Un(e,32,{info:a.toString("latin1")})},Koe=(n,t)=>{let o=[],i=0;for(;i>3,A=e.value&7,r=i;i+=e.bytes;let s=t.get(a),g=I=>I>n.length?!1:(o.push({num:a,bytes:n.subarray(r,I)}),i=I,!0),c=I=>I>n.length?!1:(i=I,!0);if(A===fb.VARINT){let I=cU(n,i);if(!I.ok)return null;let d=i+I.bytes;if(!s){if(!c(d))return null;continue}if(!g(d))return null;continue}if(A===fb.FIXED64){let I=i+8;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===fb.FIXED32){let I=i+4;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===fb.BYTES){let I=cU(n,i);if(!I.ok)return null;let d=i+I.bytes,B=d+I.value;if(B>n.length)return null;if(!s){i=B;continue}if(s.m||s.children){let f=Koe(n.subarray(d,B),s.children??b4e);if(f===null)return null;if(f.length>0){let Q=Uoe(e.value),y=Uoe(f.length);o.push({num:a,bytes:Buffer.concat([Q,y,f])})}i=B;continue}o.push({num:a,bytes:n.subarray(r,B)}),i=B;continue}return null}return o.length===0?Buffer.alloc(0):(o.sort((e,a)=>e.num-a.num),Buffer.concat(o.map(e=>e.bytes)))},cU=(n,t)=>{let o=0,i=0,e=0;for(;t+i35)return{value:0,bytes:0,ok:!1}}return{value:0,bytes:0,ok:!1}},Uoe=n=>{let t=[],o=n>>>0;for(;o>127;)t.push(o&127|128),o>>>=7;return t.push(o),Buffer.from(t)},xoe=async(n,t,o)=>{let i=t.messageContextInfo?.messageSecret;if(!i||!o.id)return null;let e=o.fromMe?o.remoteJid:o.participant||o.remoteJid,a=o.fromMe&&o.participant||o.remoteJid,A=_4e(M4e,o.id,e,a,i),r=Koe(n,O4e);if(!r||r.length===0)return null;let s=w4e("sha256",A).update(r).digest().subarray(0,16);return{tag:"reporting",attrs:{},content:[{tag:"reporting_token",attrs:{v:"2"},content:s}]}};var T4e={image:"image/jpeg",video:"video/mp4",document:"application/pdf",audio:"audio/ogg; codecs=opus",sticker:"image/webp","product-catalog-image":"image/jpeg"},Yoe={image:oe.Message.ImageMessage,video:oe.Message.VideoMessage,audio:oe.Message.AudioMessage,sticker:oe.Message.StickerMessage,document:oe.Message.DocumentMessage},N4e=n=>n.match(Xoe)?.[0],R4e=async(n,t,o)=>{let i=N4e(n);if(t&&i)try{return await t(i)}catch(e){o?.warn({trace:e.stack},"url generation failed")}},joe=async n=>{let t;if(typeof n=="number")t=n>0?n:4294967295+Number(n)+1;else{let o=n.trim().replace("#","");return o.length<=6&&(o="FF"+o.padStart(6,"0")),t=parseInt(o,16),t}},_f=async(n,t)=>{let o=t.logger,i;for(let L of $oe)L in n&&(i=L);if(!i)throw new Xg.Boom("Invalid media type",{statusCode:400});let e={...n,media:n[i]};delete e[i];let a=typeof e.media=="object"&&"url"in e.media&&!!e.media.url&&!!t.mediaCache&&i+":"+e.media.url.toString();if(i==="document"&&!e.fileName&&(e.fileName="file"),e.mimetype||(e.mimetype=T4e[i]),a){let L=await t.mediaCache.get(a);if(L){o?.debug({cacheableKey:a},"got media cache hit");let F=oe.Message.decode(L),q=`${i}Message`;return Object.assign(F[q],{...e,media:void 0}),F}}if(!!t.jid&&Wc(t.jid)){o?.info({key:a},"Preparing raw media for newsletter");let{filePath:L,fileSha256:F,fileLength:q}=await Cb(e.media,t.mediaTypeOverride||i,o),V=F.toString("base64"),{mediaUrl:x,directPath:G}=await t.upload(L,{fileEncSha256B64:V,mediaType:i,timeoutMs:t.mediaUploadTimeoutMs});await lU.unlink(L);let J=oe.Message.fromObject({[`${i}Message`]:Yoe[i].fromObject({url:x,directPath:G,fileSha256:F,fileLength:q,...e,media:void 0})});return e.ptv&&(J.ptvMessage=J.videoMessage,delete J.videoMessage),J.stickerMessage&&(J.stickerMessage.stickerSentTs=Date.now()),a&&(o?.debug({cacheableKey:a},"set cache"),await t.mediaCache.set(a,oe.Message.encode(J).finish())),J}let r=i==="audio"&&typeof e.seconds>"u",s=(i==="image"||i==="video")&&typeof e.jpegThumbnail>"u",g=i==="audio"&&e.ptt===!0&&typeof e.waveform>"u",c=t.backgroundColor&&i==="audio"&&e.ptt===!0,I=r||s,{mediaKey:d,encFilePath:B,originalFilePath:f,fileEncSha256:Q,fileSha256:y,fileLength:m}=await Noe(e.media,t.mediaTypeOverride||i,{logger:o,saveOriginalFileIfRequired:I,opts:t.options}),T=Q.toString("base64"),[{mediaUrl:_,directPath:R}]=await Promise.all([(async()=>{let L=await t.upload(B,{fileEncSha256B64:T,mediaType:i,timeoutMs:t.mediaUploadTimeoutMs});return o?.debug({mediaType:i,cacheableKey:a},"uploaded media"),L})(),(async()=>{try{if(s){let{thumbnail:L,originalImageDimensions:F}=await Toe(f,i,t);e.jpegThumbnail=L,!e.width&&F&&(e.width=F.width,e.height=F.height,o?.debug("set dimensions")),o?.debug("generated thumbnail")}r&&(e.seconds=await Moe(f),o?.debug("computed audio duration")),g&&(e.waveform=await _oe(f,o),o?.debug("processed waveform")),c&&(e.backgroundArgb=await joe(t.backgroundColor),o?.debug("computed backgroundColor audio status"))}catch(L){o?.warn({trace:L.stack},"failed to obtain extra info")}})()]).finally(async()=>{try{await lU.unlink(B),f&&await lU.unlink(f),o?.debug("removed tmp files")}catch{o?.warn("failed to remove tmp file")}}),K=oe.Message.fromObject({[`${i}Message`]:Yoe[i].fromObject({url:_,directPath:R,mediaKey:d,fileEncSha256:Q,fileSha256:y,fileLength:m,mediaKeyTimestamp:Oa(),...e,media:void 0})});return e.ptv&&(K.ptvMessage=K.videoMessage,delete K.videoMessage),a&&(o?.debug({cacheableKey:a},"set cache"),await t.mediaCache.set(a,oe.Message.encode(K).finish())),K},k4e=n=>{n=n||0;let t={ephemeralMessage:{message:{protocolMessage:{type:oe.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:n}}}};return oe.Message.fromObject(t)},v4e=(n,t)=>{let o=n.message;if(!o)throw new Xg.Boom("no content in message",{statusCode:400});o=Na(o),o=oe.Message.decode(oe.Message.encode(o).finish());let i=Object.keys(o)[0],e=o?.[i]?.contextInfo?.forwardingScore||0;e+=n.key.fromMe&&!t?0:1,i==="conversation"&&(o.extendedTextMessage={text:o[i]},delete o.conversation,i="extendedTextMessage");let a=o?.[i];return e>0?a.contextInfo={forwardingScore:e,isForwarded:!0}:a.contextInfo={},o},Ea=(n,t)=>typeof n=="object"&&n!==null&&t in n&&n[t]!==null&&n[t]!==void 0;function op(n,t){return typeof n=="object"&&n!==null&&t in n&&n[t]!==null}var P4e=async(n,t)=>{var o,i;let e={};if(Ea(n,"text")){let a={text:n.text},A=n.linkPreview;if(typeof A>"u"&&(A=await R4e(n.text,t.getUrlInfo,t.logger)),A){a.matchedText=A["matched-text"],a.jpegThumbnail=A.jpegThumbnail,a.description=A.description,a.title=A.title,a.previewType=0;let r=A.highQualityThumbnail;r&&(a.thumbnailDirectPath=r.directPath,a.mediaKey=r.mediaKey,a.mediaKeyTimestamp=r.mediaKeyTimestamp,a.thumbnailWidth=r.width,a.thumbnailHeight=r.height,a.thumbnailSha256=r.fileSha256,a.thumbnailEncSha256=r.fileEncSha256)}t.backgroundColor&&(a.backgroundArgb=await joe(t.backgroundColor)),t.font&&(a.font=t.font),e.extendedTextMessage=a}else if(Ea(n,"contacts")){let a=n.contacts.contacts.length;if(!a)throw new Xg.Boom("require atleast 1 contact",{statusCode:400});a===1?e.contactMessage=oe.Message.ContactMessage.create(n.contacts.contacts[0]):e.contactsArrayMessage=oe.Message.ContactsArrayMessage.create(n.contacts)}else if(Ea(n,"location"))e.locationMessage=oe.Message.LocationMessage.create(n.location);else if(Ea(n,"react"))n.react.senderTimestampMs||(n.react.senderTimestampMs=Date.now()),e.reactionMessage=oe.Message.ReactionMessage.create(n.react);else if(Ea(n,"delete"))e.protocolMessage={key:n.delete,type:oe.Message.ProtocolMessage.Type.REVOKE};else if(Ea(n,"forward"))e=v4e(n.forward,n.force);else if(Ea(n,"disappearingMessagesInChat")){let a=typeof n.disappearingMessagesInChat=="boolean"?n.disappearingMessagesInChat?Nf:0:n.disappearingMessagesInChat;e=k4e(a)}else if(Ea(n,"groupInvite")){if(e.groupInviteMessage={},e.groupInviteMessage.inviteCode=n.groupInvite.inviteCode,e.groupInviteMessage.inviteExpiration=n.groupInvite.inviteExpiration,e.groupInviteMessage.caption=n.groupInvite.text,e.groupInviteMessage.groupJid=n.groupInvite.jid,e.groupInviteMessage.groupName=n.groupInvite.subject,t.getProfilePicUrl){let a=await t.getProfilePicUrl(n.groupInvite.jid,"preview");if(a){let A=await fetch(a,{method:"GET",dispatcher:t?.options?.dispatcher});if(A.ok){let r=Buffer.from(await A.arrayBuffer());e.groupInviteMessage.jpegThumbnail=r}}}}else if(Ea(n,"pin"))e.pinInChatMessage={},e.messageContextInfo={},e.pinInChatMessage.key=n.pin,e.pinInChatMessage.type=n.type,e.pinInChatMessage.senderTimestampMs=Date.now(),e.messageContextInfo.messageAddOnDurationInSecs=n.type===1?n.time||86400:0;else if(Ea(n,"buttonReply"))switch(n.type){case"template":e.templateButtonReplyMessage={selectedDisplayText:n.buttonReply.displayText,selectedId:n.buttonReply.id,selectedIndex:n.buttonReply.index};break;case"plain":e.buttonsResponseMessage={selectedButtonId:n.buttonReply.id,selectedDisplayText:n.buttonReply.displayText,type:oe.Message.ButtonsResponseMessage.Type.DISPLAY_TEXT};break}else if(op(n,"ptv")&&n.ptv){let{videoMessage:a}=await _f({video:n.video},t);e.ptvMessage=a}else if(Ea(n,"product")){let{imageMessage:a}=await _f({image:n.product.productImage},t);e.productMessage=oe.Message.ProductMessage.create({...n,product:{...n.product,productImage:a}})}else if(Ea(n,"listReply"))e.listResponseMessage={...n.listReply};else if(Ea(n,"event")){e.eventMessage={};let a=Math.floor(n.event.startDate.getTime()/1e3);if(n.event.call&&t.getCallLink){let A=await t.getCallLink(n.event.call,{startTime:a});e.eventMessage.joinLink=(n.event.call==="audio"?Zoe:Woe)+A}e.messageContextInfo={messageSecret:n.event.messageSecret||IU(32)},e.eventMessage.name=n.event.name,e.eventMessage.description=n.event.description,e.eventMessage.startTime=a,e.eventMessage.endTime=n.event.endDate?n.event.endDate.getTime()/1e3:void 0,e.eventMessage.isCanceled=n.event.isCancelled??!1,e.eventMessage.extraGuestsAllowed=n.event.extraGuestsAllowed,e.eventMessage.isScheduleCall=n.event.isScheduleCall??!1,e.eventMessage.location=n.event.location}else if(Ea(n,"poll")){if((o=n.poll).selectableCount||(o.selectableCount=0),(i=n.poll).toAnnouncementGroup||(i.toAnnouncementGroup=!1),!Array.isArray(n.poll.values))throw new Xg.Boom("Invalid poll values",{statusCode:400});if(n.poll.selectableCount<0||n.poll.selectableCount>n.poll.values.length)throw new Xg.Boom(`poll.selectableCount in poll should be >= 0 and <= ${n.poll.values.length}`,{statusCode:400});e.messageContextInfo={messageSecret:n.poll.messageSecret||IU(32)};let a={name:n.poll.name,selectableOptionsCount:n.poll.selectableCount,options:n.poll.values.map(A=>({optionName:A}))};n.poll.toAnnouncementGroup?e.pollCreationMessageV2=a:n.poll.selectableCount===1?e.pollCreationMessageV3=a:e.pollCreationMessage=a}else Ea(n,"album")?e.albumMessage={expectedImageCount:n.album.expectedImageCount,expectedVideoCount:n.album.expectedVideoCount}:Ea(n,"sharePhoneNumber")?e.protocolMessage={type:oe.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER}:Ea(n,"requestPhoneNumber")?e.requestPhoneNumberMessage={}:Ea(n,"limitSharing")?e.protocolMessage={type:oe.Message.ProtocolMessage.Type.LIMIT_SHARING,limitSharing:{sharingLimited:n.limitSharing===!0,trigger:1,limitSharingSettingTimestamp:Date.now(),initiatedByMe:!0}}:e=await _f(n,t);if(op(n,"viewOnce")&&n.viewOnce&&(e={viewOnceMessage:{message:e}}),op(n,"mentions")&&n.mentions?.length||op(n,"mentionAll")&&n.mentionAll){let a=Object.keys(e)[0],A=e[a];A&&"contextInfo"in A?(A.contextInfo=A.contextInfo||{},n.mentions?.length&&(A.contextInfo.mentionedJid=n.mentions),n.mentionAll&&(A.contextInfo.nonJidMentions=1)):A&&(A.contextInfo={mentionedJid:n.mentions,nonJidMentions:n.mentionAll?1:0})}if(op(n,"edit")&&(e={protocolMessage:{key:n.edit,editedMessage:e,timestampMs:Date.now(),type:oe.Message.ProtocolMessage.Type.MESSAGE_EDIT}}),op(n,"contextInfo")&&n.contextInfo){let a=Object.keys(e)[0],A=e[a];"contextInfo"in A&&A.contextInfo?A.contextInfo={...A.contextInfo,...n.contextInfo}:A&&(A.contextInfo=n.contextInfo)}return op(n,"albumParentKey")&&n.albumParentKey&&(e.messageContextInfo={...e.messageContextInfo,messageAssociation:{associationType:oe.MessageAssociation.AssociationType.MEDIA_ALBUM,parentMessageKey:n.albumParentKey}}),Qb(e)&&(e.messageContextInfo=e.messageContextInfo||{},e.messageContextInfo.messageSecret||(e.messageContextInfo.messageSecret=IU(32))),oe.Message.create(e)},G4e=(n,t,o)=>{o.timestamp||(o.timestamp=new Date);let i=Na(t),e=Tf(i),a=Oa(o.timestamp),{quoted:A,userJid:r}=o;if(A&&!Wc(n)){let g=A.key.fromMe?r:A.participant||A.key.participant||A.key.remoteJid,c=Na(A.message),I=Tf(c);c=oe.Message.create({[I]:c[I]});let d=c[I];typeof d=="object"&&d&&"contextInfo"in d&&delete d.contextInfo;let B="contextInfo"in i[e]&&i[e]?.contextInfo||{};B.participant=uA(g),B.stanzaId=A.key.id,B.quotedMessage=c,n!==A.key.remoteJid&&(B.remoteJid=A.key.remoteJid),B&&i[e]&&(i[e].contextInfo=B)}o?.ephemeralExpiration&&e!=="protocolMessage"&&e!=="ephemeralMessage"&&!Wc(n)&&(i[e].contextInfo={...i[e].contextInfo||{},expiration:o.ephemeralExpiration||Nf}),t=oe.Message.create(t);let s={key:{remoteJid:n,fromMe:!0,id:o?.messageId||jr()},message:t,messageTimestamp:a,messageStubParameters:[],participant:xr(n)||Lg(n)?r:void 0,status:lh.PENDING};return oe.WebMessageInfo.fromObject(s)},Joe=async(n,t,o)=>(o.logger=o?.logger?.child({msgId:o.messageId}),G4e(n,await P4e(t,{...o,jid:n}),o)),Tf=n=>{if(n)return Object.keys(n).find(i=>(i==="conversation"||i.includes("Message"))&&i!=="senderKeyDistributionMessage")},Na=n=>{if(!n)return;for(let o=0;o<5;o++){let i=t(n);if(!i)break;n=i.message}return n;function t(o){return o?.ephemeralMessage||o?.viewOnceMessage||o?.documentWithCaptionMessage||o?.viewOnceMessageV2||o?.viewOnceMessageV2Extension||o?.editedMessage||o?.associatedChildMessage||o?.groupStatusMessage||o?.groupStatusMessageV2}},qoe=n=>{let t=o=>o.imageMessage?{imageMessage:o.imageMessage}:o.documentMessage?{documentMessage:o.documentMessage}:o.videoMessage?{videoMessage:o.videoMessage}:o.locationMessage?{locationMessage:o.locationMessage}:{conversation:"contentText"in o?o.contentText:"hydratedContentText"in o?o.hydratedContentText:""};return n=Na(n),n?.buttonsMessage?t(n.buttonsMessage):n?.templateMessage?.hydratedFourRowTemplate?t(n?.templateMessage?.hydratedFourRowTemplate):n?.templateMessage?.hydratedTemplate?t(n?.templateMessage?.hydratedTemplate):n?.templateMessage?.fourRowTemplate?t(n?.templateMessage?.fourRowTemplate):n};var pU=(n,t)=>{n.userReceipt=n.userReceipt||[];let o=n.userReceipt.find(i=>i.userJid===t.userJid);o?Object.assign(o,t):n.userReceipt.push(t)},dU=(n,t)=>{let o=Bh(t.key),i=(n.reactions||[]).filter(e=>Bh(e.key)!==o);t.text=t.text||"",i.push(t),n.reactions=i};var zoe=n=>{let t={};for(let{remoteJid:o,id:i,participant:e,fromMe:a}of n)if(!a){let A=`${o}:${e||""}`;t[A]||(t[A]={jid:o,participant:e,messageIds:[]}),t[A].messageIds.push(i)}return Object.values(t)},F4e=[410,404],hU=async(n,t,o,i)=>{return await a().catch(async A=>{if(i&&typeof A?.status=="number"&&F4e.includes(A.status))return i.logger.info({key:n.key},"sending reupload media request..."),n=await i.reuploadRequest(n),await a();throw A});async function a(){let A=qoe(n.message);if(!A)throw new Xg.Boom("No message present",{statusCode:400,data:n});let r=Tf(A),s=r?.replace("Message",""),g=A[r];if(!g||typeof g!="object"||!("url"in g)&&!("thumbnailDirectPath"in g))throw new Xg.Boom(`"${r}" message is not a media message`);let c;"thumbnailDirectPath"in g&&!("url"in g)?(c={directPath:g.thumbnailDirectPath,mediaKey:g.mediaKey},s="thumbnail-link"):c=g;let I=await IE(c,s,o);if(t==="buffer"){let d=[];for await(let B of I)d.push(B);return Buffer.concat(d)}return I}},Voe=n=>{n=qoe(n);let t=n?.documentMessage||n?.imageMessage||n?.videoMessage||n?.audioMessage||n?.stickerMessage;if(!t)throw new Xg.Boom("given message is not a media message",{statusCode:400,data:n});return t};var yb=qe(Kr(),1);import{createHash as K4e}from"crypto";function L4e(n,t){let o=[];for(let i=0;i({identifier:{name:n,deviceId:0},identifierKey:Vo(t)}),U4e=async({get:n},t,o)=>{let i=[];for(let e=t;e{let o=n.nextPreKeyId-n.firstUnuploadedPreKeyId,i=t-o,e=n.nextPreKeyId+i-1,a={};if(i>0)for(let A=n.nextPreKeyId;A<=e;A++)a[A]=Sr.generateKeyPair();return{newPreKeys:a,lastPreKeyId:e,preKeysRange:[n.firstUnuploadedPreKeyId,t]}},Rf=n=>({tag:"skey",attrs:{},content:[{tag:"id",attrs:{},content:Kg(n.keyId,3)},{tag:"value",attrs:{},content:n.keyPair.public},{tag:"signature",attrs:{},content:n.signature}]}),CU=(n,t)=>({tag:"key",attrs:{},content:[{tag:"id",attrs:{},content:Kg(t,3)},{tag:"value",attrs:{},content:n.public}]}),EU=n=>typeof n=="number"&&Number.isInteger(n),Ane=n=>{let t=le(n,"keys");if(!t)return null;let o=Da(t,"type");if(!o||o.length!==1||o[0]!==Hg[0])return null;let i=Da(t,"identity"),e=le(t,"skey");if(!i||i.length!==32||!e)return null;let a=Zc(n,"registration",4);if(!EU(a))return null;let A=Da(e,"value"),r=Da(e,"signature"),s=Zc(e,"id",3);if(!A||A.length!==32||!r||!EU(s))return null;let g=le(t,"key"),c;if(g){let I=Da(g,"value"),d=Zc(g,"id",3);if(!I||I.length!==32||!EU(d))return null;c={keyId:d,publicKey:Vo(I)}}return{registrationId:a,identityKey:Vo(i),signedPreKey:{keyId:s,publicKey:Vo(A),signature:r},preKey:c}},tne=async(n,t)=>{let o=A=>A?{keyId:Zc(A,"id",3),publicKey:Vo(Da(A,"value")),signature:Da(A,"signature")}:void 0,i=PA(le(n,"list"),"user");for(let A of i)Ji(A);let a=L4e(i,100);for(let A of a)for(let r of A){let s=le(r,"skey"),g=le(r,"key"),c=Da(r,"identity"),I=r.attrs.jid,d=Zc(r,"registration",4);await t.injectE2ESession({jid:I,session:{registrationId:d,identityKey:Vo(c),signedPreKey:o(s),preKey:o(g)}})}},rne=(n,t,o,i)=>{let{user:e,device:a}=fA(t),A=[];for(let r of n){let{devices:s,id:g}=r,c=fA(g),{user:I,server:d}=c,{domainType:B}=c,f=s?.deviceList;if(Array.isArray(f))for(let{id:Q,keyIndex:y,isHosted:m}of f)(!i||Q!==0)&&(e!==I&&o!==I||a!==Q)&&(Q===0||y)&&(m&&(B=B===Jt.LID?Jt.HOSTED_LID:Jt.HOSTED),A.push({user:I,device:Q,domainType:B,server:o7(d,B)}))}return A},uU=async({creds:n,keys:t},o)=>{let{newPreKeys:i,lastPreKeyId:e,preKeysRange:a}=H4e(n,o),A={nextPreKeyId:Math.max(e+1,n.nextPreKeyId),firstUnuploadedPreKeyId:Math.max(n.firstUnuploadedPreKeyId,e+1)};await t.set({"pre-key":i});let r=await U4e(t,a[0],a[0]+a[1]);return{update:A,preKeys:r}},ane=async(n,t)=>{let{creds:o}=n,{update:i,preKeys:e}=await uU(n,t),a={tag:"iq",attrs:{xmlns:"encrypt",type:"set",to:OA},content:[{tag:"registration",attrs:{},content:Kg(o.registrationId)},{tag:"type",attrs:{},content:Hg},{tag:"identity",attrs:{},content:o.signedIdentityKey.public},{tag:"list",attrs:{},content:Object.keys(e).map(A=>CU(e[+A],+A))},Rf(o.signedPreKey)]};return{update:i,node:a}};var x4e=n=>({appVersion:{primary:n.version[0],secondary:n.version[1],tertiary:n.version[2]},platform:n.browser[1].toLocaleLowerCase().includes("android")?oe.ClientPayload.UserAgent.Platform.ANDROID:oe.ClientPayload.UserAgent.Platform.WEB,releaseChannel:oe.ClientPayload.UserAgent.ReleaseChannel.RELEASE,osVersion:"0.1",device:"Desktop",osBuildNumber:"0.1",localeLanguageIso6391:"en",mnc:"000",mcc:"000",localeCountryIso31661Alpha2:n.countryCode}),ine={"Mac OS":oe.ClientPayload.WebInfo.WebSubPlatform.DARWIN,Windows:oe.ClientPayload.WebInfo.WebSubPlatform.WIN32},Y4e=n=>{let t=oe.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER;return n.syncFullHistory&&ine[n.browser[0]]&&n.browser[1]==="Desktop"&&(t=ine[n.browser[0]]),{webSubPlatform:t}},one=n=>{let t={connectType:oe.ClientPayload.ConnectType.WIFI_UNKNOWN,connectReason:oe.ClientPayload.ConnectReason.USER_ACTIVATED,userAgent:x4e(n)};return n.browser[1].toLocaleLowerCase().includes("android")||(t.webInfo=Y4e(n)),n.pushName&&(t.pushName=n.pushName),t},nne=(n,t)=>{let{user:o,device:i}=fA(n),e={...one(t),passive:!0,pull:!0,username:+o,device:i,lidDbMigrated:!1};return oe.ClientPayload.fromObject(e)},j4e=n=>{let t=n.toUpperCase();return t==="ANDROID"?oe.DeviceProps.PlatformType.ANDROID_PHONE:oe.DeviceProps.PlatformType[t]||oe.DeviceProps.PlatformType.CHROME},sne=({registrationId:n,signedPreKey:t,signedIdentityKey:o},i)=>{let e=K4e("md5").update(i.version.join(".")).digest(),a={os:i.browser[0],platformType:j4e(i.browser[1]),requireFullSync:i.syncFullHistory,historySyncConfig:{storageQuotaMb:10240,inlineInitialPayloadInE2EeMsg:!0,recentSyncDaysLimit:void 0,supportCallLogHistory:!1,supportBotUserAgentChatHistory:!0,supportCagReactionsAndPolls:!0,supportBizHostedMsg:!0,supportRecentSyncChunkMessageCountTuning:!0,supportHostedGroupMsg:!0,supportFbidBotChatHistory:!0,supportAddOnHistorySyncMigration:void 0,supportMessageAssociation:!0,supportGroupHistory:!1,onDemandReady:void 0,supportGuestChat:void 0},version:{primary:10,secondary:15,tertiary:7}},A=oe.DeviceProps.encode(a).finish(),r={...one(i),passive:!1,pull:!1,devicePairingData:{buildHash:e,deviceProps:A,eRegid:Kg(n),eKeytype:Hg,eIdent:o.public,eSkeyId:Kg(t.keyId,3),eSkeyVal:t.keyPair.public,eSkeySig:t.signature}};return oe.ClientPayload.fromObject(r)},gne=(n,{advSecretKey:t,signedIdentityKey:o,signalIdentities:i})=>{let e=n.attrs.id,a=le(n,"pair-success"),A=le(a,"device-identity"),r=le(a,"platform"),s=le(a,"device"),g=le(a,"biz");if(!A||!s)throw new yb.Boom("Missing device-identity or device in pair success node",{data:n});let c=g?.attrs.name,I=s.attrs.jid,d=s.attrs.lid,{details:B,hmac:f,accountType:Q}=oe.ADVSignedDeviceIdentityHMAC.decode(A.content),y=Buffer.from([]);Q!==void 0&&Q===oe.ADVEncryptionType.HOSTED&&(y=BU);let m=Hn(Buffer.concat([y,B]),Buffer.from(t,"base64"));if(Buffer.compare(f,m)!==0)throw new yb.Boom("Invalid account signature");let T=oe.ADVSignedDeviceIdentity.decode(B),{accountSignatureKey:_,accountSignature:R,details:K}=T,L=oe.ADVDeviceIdentity.decode(K),F=L.deviceType===oe.ADVEncryptionType.HOSTED?BU:cne,q=Buffer.concat([F,K,o.public]);if(!Sr.verify(_,q,R))throw new yb.Boom("Failed to verify account signature");let V=Buffer.concat([Ine,K,o.public,_]);T.deviceSignature=Sr.sign(o.private,V);let x=ene(d,_),G=kf(T,!1),J={tag:"iq",attrs:{to:OA,type:"result",id:e},content:[{tag:"pair-device-sign",attrs:{},content:[{tag:"device-identity",attrs:{"key-index":L.keyIndex.toString()},content:G}]}]};return{creds:{account:T,me:{id:I,name:c,lid:d},signalIdentities:[...i||[],x],platform:r?.attrs.name},reply:J}},kf=(n,t)=>(n={...n},(!t||!n.accountSignatureKey?.length)&&(n.accountSignatureKey=null),oe.ADVSignedDeviceIdentity.encode(n).finish());var lE=qe(Kr(),1);var dne=12,lne=Buffer.alloc(0),pne=n=>{let t=new ArrayBuffer(dne);return new DataView(t).setUint32(8,n),new Uint8Array(t)},fU=class{constructor(t,o){this.encKey=t,this.decKey=o,this.readCounter=0,this.writeCounter=0,this.iv=new Uint8Array(dne)}encrypt(t){let o=this.writeCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,Pl(t,this.encKey,this.iv,lne)}decrypt(t){let o=this.readCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,Gl(t,this.decKey,this.iv,lne)}},hne=({keyPair:{private:n,public:t},NOISE_HEADER:o,logger:i,routingInfo:e})=>{i=i.child({class:"ns"});let a=Buffer.from(Ene),A=a.byteLength===32?a:uh(a),r=A,s=A,g=A,c=0,I=!1,d=Buffer.alloc(0),B=null,f=!1,Q=null,y;e?(y=Buffer.alloc(7+e.byteLength+o.length),y.write("ED",0,"utf8"),y.writeUint8(0,2),y.writeUint8(1,3),y.writeUint8(e.byteLength>>16,4),y.writeUint16BE(e.byteLength&65535,5),y.set(e,7),y.set(o,7+e.byteLength)):y=Buffer.from(o);let m=q=>{B||(A=uh(Buffer.concat([A,q])))},T=q=>{if(B)return B.encrypt(q);let V=Pl(q,s,pne(c++),A);return m(V),V},_=q=>{if(B)return B.decrypt(q);let V=Gl(q,g,pne(c++),A);return m(q),V},R=q=>{let V=Un(Buffer.from(q),64,{salt:r,info:""});return[V.subarray(0,32),V.subarray(32)]},K=q=>{let[V,x]=R(q);r=V,s=x,g=x,c=0},L=async()=>{f=!0;let[q,V]=R(new Uint8Array(0));B=new fU(q,V),f=!1,i.trace("Noise handler transitioned to Transport state"),Q&&(i.trace({length:d.length},"Flushing buffered frames after transport ready"),await F(Q),Q=null)},F=async q=>{let V;for(;;){if(d.length<3||(V=d[0]<<16|d[1]<<8|d[2],d.length{m(q.ephemeral),K(Sr.sharedKey(n,q.ephemeral));let x=_(q.static);K(Sr.sharedKey(n,x));let G=_(q.payload),{intermediate:J,leaf:U}=oe.CertChain.decode(G);if(!U?.details||!U?.signature)throw new lE.Boom("invalid noise leaf certificate",{statusCode:400});if(!J?.details||!J?.signature)throw new lE.Boom("invalid noise intermediate certificate",{statusCode:400});let N=oe.CertChain.NoiseCertificate.Details.decode(J.details),{issuerSerial:k}=N,z=Sr.verify(N.key,U.details,U.signature),Ae=Sr.verify(QU.PUBLIC_KEY,J.details,J.signature);if(!z)throw new lE.Boom("noise certificate signature invalid",{statusCode:400});if(!Ae)throw new lE.Boom("noise intermediate certificate signature invalid",{statusCode:400});if(k!==QU.SERIAL)throw new lE.Boom("certification match failed",{statusCode:400});let ie=T(V.public);return K(Sr.sharedKey(V.private,q.ephemeral)),ie},encodeFrame:q=>{B&&(q=B.encrypt(q));let V=q.byteLength,x=I?0:y.length,G=Buffer.allocUnsafe(x+3+V);return I||(G.set(y),I=!0),G[x]=V>>>16&255,G[x+1]=V>>>8&255,G[x+2]=V&255,G.set(q,x+3),G},decodeFrame:async(q,V)=>{if(f){d=Buffer.concat([d,q]),Q=V;return}d.length===0?d=Buffer.from(q):d=Buffer.concat([d,q]),await F(V)}}};import{pipeline as J4e}from"stream/promises";import{promisify as q4e}from"util";import{createInflate as z4e,inflate as V4e}from"zlib";var W4e=q4e(V4e),Z4e=n=>{for(let t of n){let o=t.message;if(!o?.key?.fromMe||!o.userReceipt?.length)continue;let i=o.userReceipt[0]?.userJid;if(i&&(_t(i)||mr(i)))return i}},X4e=async(n,t)=>{let o=await IE(n,"md-msg-hist",{options:t}),i=z4e(),e=[];i.on("data",r=>e.push(r)),await J4e(o,i);let a=Buffer.concat(e);return oe.HistorySync.decode(a)},$4e=(n,t)=>{let o=[],i=[],e=[],a=[];t?.trace({progress:n.progress},"processing history of type "+n.syncType?.toString());for(let A of n.phoneNumberToLidMappings||[])A.lidJid&&A.pnJid&&a.push({lid:A.lidJid,pn:A.pnJid});switch(n.syncType){case oe.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP:case oe.HistorySync.HistorySyncType.RECENT:case oe.HistorySync.HistorySyncType.FULL:case oe.HistorySync.HistorySyncType.ON_DEMAND:for(let A of n.conversations){i.push({id:A.id,name:A.displayName||A.name||A.username||void 0,username:A.username||void 0,lid:A.lidJid||A.accountLid||void 0,phoneNumber:A.pnJid||void 0});let r=A.id,s=qA(r)||Ia(r),g=_t(r)||mr(r);if(s&&A.pnJid)a.push({lid:r,pn:A.pnJid});else if(g&&A.lidJid)a.push({lid:A.lidJid,pn:r});else if(s&&!A.pnJid){let I=Z4e(A.messages||[]);I&&a.push({lid:r,pn:I})}let c=A.messages||[];delete A.messages;for(let I of c){let d=I.message;o.push(d),A.messages?.length||(A.messages=[{message:d}]),!d.key.fromMe&&!A.lastMessageRecvTimestamp&&(A.lastMessageRecvTimestamp=Yr(d.messageTimestamp)),(d.messageStubType===RA.BIZ_PRIVACY_MODE_TO_BSP||d.messageStubType===RA.BIZ_PRIVACY_MODE_TO_FB)&&d.messageStubParameters?.[0]&&i.push({id:d.key.participant||d.key.remoteJid,verifiedName:d.messageStubParameters?.[0]})}e.push(A)}break;case oe.HistorySync.HistorySyncType.PUSH_NAME:for(let A of n.pushnames)i.push({id:A.id,notify:A.pushname});break}return{chats:e,contacts:i,messages:o,lidPnMappings:a,pastParticipants:n.pastParticipants,syncType:n.syncType,progress:n.progress}},Cne=async(n,t,o)=>{let i;return n.initialHistBootstrapInlinePayload?i=oe.HistorySync.decode(await W4e(n.initialHistBootstrapInlinePayload)):i=await X4e(n,t),$4e(i,o)},mb=n=>(n?Na(n):void 0)?.protocolMessage?.historySyncNotification;var nn=qe(Kr(),1);var Zs;(function(n){n.Chat="label_jid",n.Message="label_message"})(Zs||(Zs={}));var une=new hh;var Bne=(n,t,o)=>{let i=[];if(!t)return o?.warn({hasFullName:!!n.fullName,hasLidJid:!!n.lidJid,hasPnJid:!!n.pnJid},"contactAction sync: missing id in index"),i;let e=n.lidJid,a=_t(t),A=a?t:n.pnJid||void 0;return i.push({event:"contacts.upsert",data:[{id:t,name:n.fullName||n.firstName||n.username||void 0,username:n.username||void 0,lid:e||void 0,phoneNumber:A}]}),e&&qA(e)&&a&&i.push({event:"lid-mapping.update",data:{lid:e,pn:t}}),i},fne=(n,t)=>{for(let o of t)o.event==="contacts.upsert"?n.emit("contacts.upsert",o.data):n.emit("lid-mapping.update",o.data)};var vf=n=>{let t=b7(n);return{indexKey:t.indexKey,valueEncryptionKey:t.valueEncryptionKey,valueMacKey:t.valueMacKey,snapshotMacKey:t.snapshotMacKey,patchMacKey:t.patchMacKey}},Qne=(n,t,o,i)=>{let e=n===oe.SyncdMutation.SyncdOperation.SET?1:2,a=typeof o=="string"?Buffer.from(o,"base64"):o,A=new Uint8Array(1+a.length);A[0]=e,A.set(a,1);let r=new Uint8Array(8);r[7]=A.length;let s=new Uint8Array(A.length+t.length+r.length);return s.set(A,0),s.set(t,A.length),s.set(r,A.length+t.length),Hn(s,i,"sha512").subarray(0,32)},yne=n=>{let t=Buffer.alloc(8);return t.writeUint32BE(n,4),t},mne=({indexValueMap:n,hash:t})=>{n={...n};let o=[],i=[];return{mix:({indexMac:e,valueMac:a,operation:A})=>{let r=Buffer.from(e).toString("base64"),s=n[r];if(A===oe.SyncdMutation.SyncdOperation.REMOVE){if(!s)return;delete n[r]}else o.push(a),n[r]={valueMac:a};s&&i.push(s.valueMac)},finish:()=>{let e=une.subtractThenAdd(t,i,o);return{hash:Buffer.from(e),indexValueMap:n}}}},yU=(n,t,o,i)=>{let e=Buffer.concat([n,yne(t),Buffer.from(o,"utf-8")]);return Hn(e,i,"sha256")},Sne=(n,t,o,i,e)=>{let a=Buffer.concat([n,...t,yne(o),Buffer.from(i,"utf-8")]);return Hn(a,e)},Sb=()=>({version:0,hash:Buffer.alloc(128),indexValueMap:{}}),mU=n=>((typeof n.version!="number"||isNaN(n.version))&&(n.version=0),n),SU=2,Pf=n=>n?.data?.isMissingKey===!0,wne=(n,t)=>t>=SU||n?.name==="TypeError",Dne=async({type:n,index:t,syncAction:o,apiVersion:i,operation:e},a,A,r)=>{let s=a?await r(a):void 0;if(!s)throw new nn.Boom(`myAppStateKey ("${a}") not present`,{data:{isMissingKey:!0}});let g=Buffer.from(a,"base64");A={...A,indexValueMap:{...A.indexValueMap}};let c=Buffer.from(JSON.stringify(t)),I=oe.SyncActionData.fromObject({index:c,value:o,padding:new Uint8Array(0),version:i}),d=oe.SyncActionData.encode(I).finish(),B=vf(s.keyData),f=P7(d,B.valueEncryptionKey),Q=Qne(e,f,g,B.valueMacKey),y=Hn(c,B.indexKey),m=mne(A);m.mix({indexMac:y,valueMac:Q,operation:e}),Object.assign(A,m.finish()),A.version+=1;let T=yU(A.hash,A.version,n,B.snapshotMacKey),_={patchMac:Sne(T,[Q],A.version,n,B.patchMacKey),snapshotMac:T,keyId:{id:g},mutations:[{operation:e,record:{index:{blob:y},value:{blob:Buffer.concat([f,Q])},keyId:{id:g}}}]},R=y.toString("base64");return A.indexValueMap[R]={valueMac:Q},{patch:_,state:A}},One=async(n,t,o,i,e)=>{let a=mne(t),A=new Map;for(let s of n){let g="operation"in s?s.operation:oe.SyncdMutation.SyncdOperation.SET,c="record"in s&&s.record?s.record:s,I;try{I=await r(c.keyId.id)}catch(T){if(Pf(T))throw T;continue}let d=c.value.blob,B=d.subarray(0,-32),f=d.subarray(-32);if(e){let T=Qne(g,B,c.keyId.id,I.valueMacKey);if(Buffer.compare(T,f)!==0)continue}let Q;try{Q=v7(B,I.valueEncryptionKey)}catch{continue}let y=oe.SyncActionData.decode(Q);if(e){let T=Hn(y.index,I.indexKey);if(Buffer.compare(T,c.index.blob)!==0)throw new nn.Boom("HMAC index verification failed")}let m=Buffer.from(y.index).toString();i({syncAction:y,index:JSON.parse(m)}),a.mix({indexMac:c.index.blob,valueMac:f,operation:g})}return a.finish();async function r(s){let g=Buffer.from(s).toString("base64"),c=A.get(g);if(c)return c;let I=await o(g);if(!I)throw new nn.Boom(`failed to find key "${g}" to decode mutation`,{data:{isMissingKey:!0,msgMutations:n}});let d=vf(I.keyData);return A.set(g,d),d}},e8e=async(n,t,o,i,e,a)=>{if(a){let r=Buffer.from(n.keyId.id).toString("base64"),s=await i(r);if(!s)throw new nn.Boom(`failed to find key "${r}" to decode patch`,{data:{isMissingKey:!0,msg:n}});let g=vf(s.keyData),c=n.mutations.map(d=>d.record.value.blob.slice(-32)),I=Sne(n.snapshotMac,c,Yr(n.version.version),t,g.patchMacKey);if(Buffer.compare(I,n.patchMac)!==0)throw new nn.Boom("Invalid patch mac")}return await One(n.mutations,o,i,e,a)},bne=async(n,t)=>{let o=le(n,"sync"),i=PA(o,"collection"),e={};return await Promise.all(i.map(async a=>{let A=le(a,"patches"),r=PA(A||a,"patch"),s=le(a,"snapshot"),g=[],c=a.attrs.name,I=a.attrs.has_more_patches==="true",d;if(s&&s.content){Buffer.isBuffer(s)||(s.content=Buffer.from(Object.values(s.content)));let B=oe.ExternalBlobReference.decode(s.content),f=await Mne(B,t);d=oe.SyncdSnapshot.decode(f)}for(let{content:B}of r)if(B){Buffer.isBuffer(B)||(B=Buffer.from(Object.values(B)));let f=oe.SyncdPatch.decode(B);f.version||(f.version={version:+a.attrs.version+1}),g.push(f)}e[c]={patches:g,hasMorePatches:I,snapshot:d}})),e},Mne=async(n,t)=>{let o=await IE(n,"md-app-state",{options:t}),i=[];for await(let e of o)i.push(e);return Buffer.concat(i)},A8e=async(n,t)=>{let o=await Mne(n,t);return oe.SyncdMutations.decode(o)},_ne=async(n,t,o,i,e=!0,a)=>{let A=Sb();A.version=Yr(t.version.version);let r={},s=typeof i>"u"||A.version>i,{hash:g,indexValueMap:c}=await One(t.records,A,o,s?I=>{let d=I.syncAction.index?.toString();r[d]=I}:()=>{},e);if(A.hash=g,A.indexValueMap=c,e){let I=Buffer.from(t.keyId.id).toString("base64"),d=await o(I);if(!d)throw new nn.Boom(`failed to find key "${I}" to decode mutation`,{data:{isMissingKey:!0}});let B=vf(d.keyData),f=yU(A.hash,A.version,n,B.snapshotMacKey);Buffer.compare(t.mac,f)!==0&&a?.warn({name:n,version:A.version},"LTHash verification failed on snapshot, continuing with partial state")}return{state:A,mutationMap:r}},wU=async(n,t,o,i,e,a,A,r=!0)=>{let s={...o,indexValueMap:{...o.indexValueMap}},g={};for(let c of t){let{version:I,keyId:d,snapshotMac:B}=c;if(c.externalMutations){A?.trace({name:n,version:I},"downloading external patch");let m=await A8e(c.externalMutations,e);A?.debug({name:n,version:I,mutations:m.mutations.length},"downloaded external patch"),c.mutations?.push(...m.mutations)}let f=Yr(I.version);s.version=f;let Q=typeof a>"u"||f>a,y;try{y=await e8e(c,n,s,i,Q?m=>{let T=m.syncAction.index?.toString();g[T]=m}:()=>{},r)}catch(m){if(Pf(m))throw m;A?.warn({name:n,version:f,error:m.message},"failed to decode patch, skipping");continue}if(s.hash=y.hash,s.indexValueMap=y.indexValueMap,r){let m=Buffer.from(d.id).toString("base64"),T=await i(m);if(!T)throw new nn.Boom(`failed to find key "${m}" to decode mutation`,{data:{isMissingKey:!0}});let _=vf(T.keyData),R=yU(s.hash,s.version,n,_.snapshotMacKey);if(Buffer.compare(B,R)!==0){A?.warn({name:n,version:s.version},"LTHash verification failed, skipping remaining patches");break}}c.mutations=[]}return{state:s,mutationMap:g}},Tne=(n,t)=>{let o=oe.SyncdMutation.SyncdOperation,i=a=>{let A;return Array.isArray(a)?A={lastMessageTimestamp:a[a.length-1]?.messageTimestamp,messages:a?.length?a.map(s=>{if(!s.key?.id||!s.key?.remoteJid)throw new nn.Boom("Incomplete key",{statusCode:400,data:s});if(xr(s.key.remoteJid)&&!s.key.fromMe&&!s.key.participant)throw new nn.Boom("Expected not from me message to have participant",{statusCode:400,data:s});if(!s.messageTimestamp||!Yr(s.messageTimestamp))throw new nn.Boom("Missing timestamp in last message list",{statusCode:400,data:s});return s.key.participant&&(s.key.participant=uA(s.key.participant)),s}):void 0}:A=a,A},e;if("mute"in n)e={syncAction:{muteAction:{muted:!!n.mute,muteEndTimestamp:n.mute||void 0}},index:["mute",t],type:"regular_high",apiVersion:2,operation:o.SET};else if("archive"in n)e={syncAction:{archiveChatAction:{archived:!!n.archive,messageRange:i(n.lastMessages)}},index:["archive",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("markRead"in n)e={syncAction:{markChatAsReadAction:{read:n.markRead,messageRange:i(n.lastMessages)}},index:["markChatAsRead",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("deleteForMe"in n){let{timestamp:a,key:A,deleteMedia:r}=n.deleteForMe;e={syncAction:{deleteMessageForMeAction:{deleteMedia:r,messageTimestamp:a}},index:["deleteMessageForMe",t,A.id,A.fromMe?"1":"0","0"],type:"regular_high",apiVersion:3,operation:o.SET}}else if("clear"in n)e={syncAction:{clearChatAction:{messageRange:i(n.lastMessages)}},index:["clearChat",t,"1","0"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pin"in n)e={syncAction:{pinAction:{pinned:!!n.pin}},index:["pin_v1",t],type:"regular_low",apiVersion:5,operation:o.SET};else if("contact"in n)e={syncAction:{contactAction:n.contact||{}},index:["contact",t],type:"critical_unblock_low",apiVersion:2,operation:n.contact?o.SET:o.REMOVE};else if("disableLinkPreviews"in n)e={syncAction:{privacySettingDisableLinkPreviewsAction:n.disableLinkPreviews||{}},index:["setting_disableLinkPreviews"],type:"regular",apiVersion:8,operation:o.SET};else if("star"in n){let a=n.star.messages[0];e={syncAction:{starAction:{starred:!!n.star.star}},index:["star",t,a.id,a.fromMe?"1":"0","0"],type:"regular_low",apiVersion:2,operation:o.SET}}else if("delete"in n)e={syncAction:{deleteChatAction:{messageRange:i(n.lastMessages)}},index:["deleteChat",t,"1"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pushNameSetting"in n)e={syncAction:{pushNameSetting:{name:n.pushNameSetting}},index:["setting_pushName"],type:"critical_block",apiVersion:1,operation:o.SET};else if("quickReply"in n)e={syncAction:{quickReplyAction:{count:0,deleted:n.quickReply.deleted||!1,keywords:[],message:n.quickReply.message||"",shortcut:n.quickReply.shortcut||""}},index:["quick_reply",n.quickReply.timestamp||String(Math.floor(Date.now()/1e3))],type:"regular",apiVersion:2,operation:o.SET};else if("addLabel"in n)e={syncAction:{labelEditAction:{name:n.addLabel.name,color:n.addLabel.color,predefinedId:n.addLabel.predefinedId,deleted:n.addLabel.deleted}},index:["label_edit",n.addLabel.id],type:"regular",apiVersion:3,operation:o.SET};else if("addChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[Zs.Chat,n.addChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("removeChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[Zs.Chat,n.removeChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("addMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[Zs.Message,n.addMessageLabel.labelId,t,n.addMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else if("removeMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[Zs.Message,n.removeMessageLabel.labelId,t,n.removeMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else throw new nn.Boom("not supported");return e.syncAction.timestamp=Date.now(),e},Nne=(n,t,o,i,e)=>{let a=!!i,A=i?.accountSettings;e?.trace({syncAction:n,initialSync:!!i},"processing sync action");let{syncAction:{value:r},index:[s,g,c,I]}=n;if(r?.muteAction)t.emit("chats.update",[{id:g,muteEndTime:r.muteAction?.muted?Yr(r.muteAction.muteEndTimestamp):null,conditional:d(g,void 0)}]);else if(r?.archiveChatAction||s==="archive"||s==="unarchive"){let f=r?.archiveChatAction,Q=f?f.archived:s==="archive",y=A?.unarchiveChats?f?.messageRange:void 0;t.emit("chats.update",[{id:g,archived:Q,conditional:d(g,y)}])}else if(r?.markChatAsReadAction){let f=r.markChatAsReadAction,Q=a&&f.read;t.emit("chats.update",[{id:g,unreadCount:Q?null:f?.read?0:-1,conditional:d(g,f?.messageRange)}])}else if(r?.deleteMessageForMeAction||s==="deleteMessageForMe")t.emit("messages.delete",{keys:[{remoteJid:g,id:c,fromMe:I==="1"}]});else if(r?.contactAction){let f=Bne(r.contactAction,g,e);fne(t,f)}else if(r?.pushNameSetting){let f=r?.pushNameSetting?.name;f&&o?.name!==f&&t.emit("creds.update",{me:{...o,name:f}})}else if(r?.pinAction)t.emit("chats.update",[{id:g,pinned:r.pinAction?.pinned?Yr(r.timestamp):null,conditional:d(g,void 0)}]);else if(r?.unarchiveChatsSetting){let f=!!r.unarchiveChatsSetting.unarchiveChats;t.emit("creds.update",{accountSettings:{unarchiveChats:f}}),e?.info(`archive setting updated => '${r.unarchiveChatsSetting.unarchiveChats}'`),A&&(A.unarchiveChats=f)}else if(r?.starAction||s==="star"){let f=r?.starAction?.starred;typeof f!="boolean"&&(f=n.index[n.index.length-1]==="1"),t.emit("messages.update",[{key:{remoteJid:g,id:c,fromMe:I==="1"},update:{starred:f}}])}else if(r?.deleteChatAction||s==="deleteChat")a||t.emit("chats.delete",[g]);else if(r?.labelEditAction){let{name:f,color:Q,deleted:y,predefinedId:m}=r.labelEditAction;t.emit("labels.edit",{id:g,name:f,color:Q,deleted:y,predefinedId:m?String(m):void 0})}else r?.labelAssociationAction?t.emit("labels.association",{type:r.labelAssociationAction.labeled?"add":"remove",association:s===Zs.Chat?{type:Zs.Chat,chatId:n.index[2],labelId:n.index[1]}:{type:Zs.Message,chatId:n.index[2],messageId:n.index[3],labelId:n.index[1]}}):r?.localeSetting?.locale?t.emit("settings.update",{setting:"locale",value:r.localeSetting.locale}):r?.timeFormatAction?t.emit("settings.update",{setting:"timeFormat",value:r.timeFormatAction}):r?.pnForLidChatAction?r.pnForLidChatAction.pnJid&&t.emit("lid-mapping.update",{lid:g,pn:r.pnForLidChatAction.pnJid}):r?.privacySettingRelayAllCalls?t.emit("settings.update",{setting:"privacySettingRelayAllCalls",value:r.privacySettingRelayAllCalls}):r?.statusPrivacy?t.emit("settings.update",{setting:"statusPrivacy",value:r.statusPrivacy}):r?.lockChatAction?t.emit("chats.lock",{id:g,locked:!!r.lockChatAction.locked}):r?.privacySettingDisableLinkPreviewsAction?t.emit("settings.update",{setting:"disableLinkPreviews",value:r.privacySettingDisableLinkPreviewsAction}):r?.notificationActivitySettingAction?.notificationActivitySetting?t.emit("settings.update",{setting:"notificationActivitySetting",value:r.notificationActivitySettingAction.notificationActivitySetting}):r?.lidContactAction?t.emit("contacts.upsert",[{id:g,name:r.lidContactAction.fullName||r.lidContactAction.firstName||r.lidContactAction.username||void 0,username:r.lidContactAction.username||void 0,lid:g,phoneNumber:void 0}]):r?.privacySettingChannelsPersonalisedRecommendationAction?t.emit("settings.update",{setting:"channelsPersonalisedRecommendation",value:r.privacySettingChannelsPersonalisedRecommendationAction}):e?.debug({syncAction:n,id:g},"unprocessable update");function d(f,Q){return a?y=>{let m=y.historySets.chats[f]||y.chatUpserts[f];if(m)return Q?B(m,Q):!0}:void 0}function B(f,Q){let y=Number(Q?.lastMessageTimestamp||Q?.lastSystemMessageTimestamp||0),m=Number(f?.lastMessageRecvTimestamp||0);return y>=m}};var t8e=class{_eventListeners;_maxListeners;_logger;_throwOnEmitError=!1;_throwOnEmptyListeners=!1;_errorEvent="error";constructor(n){this._eventListeners=new Map,this._maxListeners=100,this._logger=n?.logger,n?.throwOnEmitError!==void 0&&(this._throwOnEmitError=n.throwOnEmitError),n?.throwOnEmptyListeners!==void 0&&(this._throwOnEmptyListeners=n.throwOnEmptyListeners)}get logger(){return this._logger}set logger(n){this._logger=n}get throwOnEmitError(){return this._throwOnEmitError}set throwOnEmitError(n){this._throwOnEmitError=n}get throwOnEmptyListeners(){return this._throwOnEmptyListeners}set throwOnEmptyListeners(n){this._throwOnEmptyListeners=n}once(n,t){let o=(...i)=>{this.off(n,o),t(...i)};return this.on(n,o),this}listenerCount(n){if(n===void 0)return this.getAllListeners().length;let t=this._eventListeners.get(n);return t?t.length:0}eventNames(){return[...this._eventListeners.keys()]}rawListeners(n){return n===void 0?this.getAllListeners():this._eventListeners.get(n)??[]}prependListener(n,t){let o=this._eventListeners.get(n)??[];return o.unshift(t),this._eventListeners.set(n,o),this}prependOnceListener(n,t){let o=(...i)=>{this.off(n,o),t(...i)};return this.prependListener(n,o),this}maxListeners(){return this._maxListeners}addListener(n,t){return this.on(n,t),this}on(n,t){this._eventListeners.has(n)||this._eventListeners.set(n,[]);let o=this._eventListeners.get(n);return o&&(o.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${o.length+1} ${n} listeners added. Use setMaxListeners() to increase limit.`),o.push(t)),this}removeListener(n,t){return this.off(n,t),this}off(n,t){let o=this._eventListeners.get(n)??[],i=o.indexOf(t);return i!==-1&&o.splice(i,1),o.length===0&&this._eventListeners.delete(n),this}emit(n,...t){let o=!1,i=this._eventListeners.get(n);if(i&&i.length>0)for(let e of i)e(...t),o=!0;if(n===this._errorEvent){let e=t[0]instanceof Error?t[0]:new Error(`${t[0]}`);if(this._throwOnEmitError&&!o)throw e;if(this.listeners(this._errorEvent).length===0&&this._throwOnEmptyListeners===!0)throw e}return this.sendLog(n,t),o}listeners(n){return this._eventListeners.get(n)??[]}removeAllListeners(n){return n!==void 0?this._eventListeners.delete(n):this._eventListeners.clear(),this}setMaxListeners(n){this._maxListeners=n;for(let t of this._eventListeners.values())t.length>n&&t.splice(n)}getAllListeners(){let n=[];for(let t of this._eventListeners.values())n=[...n,...t];return n}sendLog(n,t){if(!this._logger)return;let o;switch(typeof t=="string"?o=t:Array.isArray(t)&&t.length>0&&t[0]instanceof Error?o=t[0].message:t instanceof Error?o=t.message:Array.isArray(t)&&t.length>0&&typeof t[0]?.message=="string"?o=t[0].message:o=JSON.stringify(t),n){case"error":{this._logger.error?.(o,{event:n,data:t});break}case"warn":{this._logger.warn?.(o,{event:n,data:t});break}case"trace":{this._logger.trace?.(o,{event:n,data:t});break}case"debug":{this._logger.debug?.(o,{event:n,data:t});break}case"fatal":{this._logger.fatal?.(o,{event:n,data:t});break}default:{this._logger.info?.(o,{event:n,data:t});break}}}},QI=class extends t8e{_hooks;_throwOnHookError=!1;_enforceBeforeAfter=!1;_deprecatedHooks;_allowDeprecated=!0;constructor(n){super({logger:n?.logger,throwOnEmitError:n?.throwOnEmitError,throwOnEmptyListeners:n?.throwOnEmptyListeners}),this._hooks=new Map,this._deprecatedHooks=n?.deprecatedHooks?new Map(n.deprecatedHooks):new Map,n?.throwOnHookError!==void 0?this._throwOnHookError=n.throwOnHookError:n?.throwHookErrors!==void 0&&(this._throwOnHookError=n.throwHookErrors),n?.enforceBeforeAfter!==void 0&&(this._enforceBeforeAfter=n.enforceBeforeAfter),n?.allowDeprecated!==void 0&&(this._allowDeprecated=n.allowDeprecated)}get hooks(){return this._hooks}get throwHookErrors(){return this._throwOnHookError}set throwHookErrors(n){this._throwOnHookError=n}get throwOnHookError(){return this._throwOnHookError}set throwOnHookError(n){this._throwOnHookError=n}get enforceBeforeAfter(){return this._enforceBeforeAfter}set enforceBeforeAfter(n){this._enforceBeforeAfter=n}get deprecatedHooks(){return this._deprecatedHooks}set deprecatedHooks(n){this._deprecatedHooks=n}get allowDeprecated(){return this._allowDeprecated}set allowDeprecated(n){this._allowDeprecated=n}validateHookName(n){if(this._enforceBeforeAfter){let t=n.trim().toLocaleLowerCase();if(!t.startsWith("before")&&!t.startsWith("after"))throw new Error(`Hook event "${n}" must start with "before" or "after" when enforceBeforeAfter is enabled`)}}checkDeprecatedHook(n){if(this._deprecatedHooks.has(n)){let t=this._deprecatedHooks.get(n),o=`Hook "${n}" is deprecated${t?`: ${t}`:""}`;return this.emit("warn",{hook:n,message:o}),this._allowDeprecated}return!0}onHook(n,t){this.onHookEntry({event:n,handler:t})}onHookEntry(n){if(this.validateHookName(n.event),!this.checkDeprecatedHook(n.event))return;let t=this._hooks.get(n.event);t?t.push(n.handler):this._hooks.set(n.event,[n.handler])}addHook(n,t){this.onHookEntry({event:n,handler:t})}onHooks(n){for(let t of n)this.onHook(t.event,t.handler)}prependHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);o?o.unshift(t):this._hooks.set(n,[t])}prependOnceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...i)=>(this.removeHook(n,o),t(...i));this.prependHook(n,o)}onceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...i)=>(this.removeHook(n,o),t(...i));this.onHook(n,o)}removeHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){let i=o.indexOf(t);i!==-1&&o.splice(i,1)}}removeHooks(n){for(let t of n)this.removeHook(t.event,t.handler)}async hook(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o)for(let i of o)try{await i(...t)}catch(e){let a=`${n}: ${e.message}`;if(this.emit("error",new Error(a)),this._throwOnHookError)throw new Error(a)}}hookSync(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){for(let i of o)if(i.constructor.name!=="AsyncFunction")try{i(...t)}catch(e){let a=`${n}: ${e.message}`;if(this.emit("error",new Error(a)),this._throwOnHookError)throw new Error(a)}}}async beforeHook(n,...t){await this.hook(`before:${n}`,...t)}async afterHook(n,...t){await this.hook(`after:${n}`,...t)}async callHook(n,...t){await this.hook(n,...t)}getHooks(n){if(this.validateHookName(n),!!this.checkDeprecatedHook(n))return this._hooks.get(n)}clearHooks(){this._hooks.clear()}};var r8e=class{_enabled=!0;_maxSize=4e3;_store=new Map;_keys=[];constructor(n){n?.enabled!==void 0&&(this._enabled=n.enabled),n?.maxSize!==void 0&&(this._maxSize=n.maxSize)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get maxSize(){return this._maxSize}set maxSize(n){this._maxSize=n}get store(){return this._store}get size(){return this._store.size}get(n){return this._store.get(n)}set(n,t){if(this._enabled){if(this._store.has(n)){this._store.set(n,t);return}if(this._store.size>=this._maxSize){let o=this._keys.shift();o&&this._store.delete(o)}this._keys.push(n),this._store.set(n,t)}}has(n){return this._store.has(n)}clear(){this._store.clear(),this._keys=[]}},a8e=class{get name(){return"crc32"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let a=n;t=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let o=3988292384,i=4294967295;for(let a=0;a>>1^o&-(i&1)}return i=(i^4294967295)>>>0,i.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},wb=class{_algorithm="SHA-256";constructor(n){n?.algorithm&&(this._algorithm=n?.algorithm)}get name(){return this._algorithm}async toHash(n){let t=await crypto.subtle.digest(this._algorithm,n);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}},i8e=class{get name(){return"djb2"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let e=n;t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let o=5381;for(let e=0;e>>0;return o.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},o8e=class{get name(){return"fnv1"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let A=n;t=new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}let o=2166136261,i=16777619,e=o;for(let A=0;A>>0;return e.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},n8e=class{_seed;constructor(n=0){this._seed=n>>>0}get name(){return"murmur"}get seed(){return this._seed}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let c=n;t=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}let o=3432918353,i=461845907,e=t.length,a=Math.floor(e/4),A=this._seed;for(let c=0;c>>16,A=this._imul(A,2246822507),A^=A>>>13,A=this._imul(A,3266489909),A^=A>>>16,A=A>>>0,A.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}_imul(n,t){if(Math.imul)return Math.imul(n,t);let o=n>>>16&65535,i=n&65535,e=t>>>16&65535,a=t&65535;return i*a+(o*a+i*e<<16>>>0)|0}_rotl32(n,t){return n<>>32-t}},s8e=class{_providers=new Map;_getFuzzy=!0;constructor(n){n?.providers&&this.loadProviders(n?.providers),n?.getFuzzy!==void 0&&(this._getFuzzy=!!n?.getFuzzy)}loadProviders(n){for(let t of n)this._providers.set(t.name,t)}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return Array.from(this._providers.keys())}get(n,t){let o=t?.fuzzy??this._getFuzzy;n=n.trim();let i=this._providers.get(n);return i===void 0&&o===!0&&(n=n.toLowerCase(),i=this._providers.get(n)),i===void 0&&o===!0&&(n=n.replaceAll("-",""),i=this._providers.get(n)),i}add(n){this._providers.set(n.name,n)}remove(n){return this._providers.delete(n)}},DU=class extends QI{_parse=JSON.parse;_stringify=JSON.stringify;_providers=new s8e;_defaultAlgorithm="SHA-256";_defaultAlgorithmSync="djb2";_cache;constructor(n){super(n),n?.parse&&(this._parse=n.parse),n?.stringify&&(this._stringify=n.stringify),n?.defaultAlgorithm&&(this._defaultAlgorithm=n.defaultAlgorithm),n?.defaultAlgorithmSync&&(this._defaultAlgorithmSync=n.defaultAlgorithmSync),this._cache=new r8e(n?.cache),this.loadProviders(n?.providers,{includeBase:n?.includeBase??!0})}get parse(){return this._parse}set parse(n){this._parse=n}get stringify(){return this._stringify}set stringify(n){this._stringify=n}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return this._providers.names}get defaultAlgorithm(){return this._defaultAlgorithm}set defaultAlgorithm(n){this._defaultAlgorithm=n}get defaultAlgorithmSync(){return this._defaultAlgorithmSync}set defaultAlgorithmSync(n){this._defaultAlgorithmSync=n}get cache(){return this._cache}async toHash(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithm,maxLength:t?.maxLength};await this.beforeHook("toHash",o);let i=this._stringify(o.data),e=`${o.algorithm}:${i}`;if(this._cache.enabled){let c=this._cache.get(e);if(c!==void 0){let I=c;t?.maxLength&&I.length>t.maxLength&&(I=I.substring(0,t.maxLength));let d={hash:I,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",d),d.hash}}let A=new TextEncoder().encode(i),r=this._providers.get(o.algorithm);r||(this.emit("warn",`Invalid algorithm '${o.algorithm}' not found. Falling back to default algorithm '${this._defaultAlgorithm}'.`),r=new wb({algorithm:this._defaultAlgorithm}));let s=await r.toHash(A);this._cache.enabled&&this._cache.set(e,s),t?.maxLength&&s.length>t?.maxLength&&(s=s.substring(0,t.maxLength));let g={hash:s,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",g),g.hash}async toNumber(n,t={}){let{min:o=0,max:i=100,algorithm:e=this._defaultAlgorithm,hashLength:a=16}=t;if(o>i)throw new Error("min cannot be greater than max");let A=await this.toHash(n,{algorithm:e,maxLength:a}),r=Number.parseInt(A,16),s=i-o+1;return o+r%s}toHashSync(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithmSync,maxLength:t?.maxLength};this.hookSync("before:toHashSync",o);let i=o.algorithm,e=this._stringify(o.data),a=`${i}:${e}`;if(this._cache.enabled){let I=this._cache.get(a);if(I!==void 0){let d=I;t?.maxLength&&d.length>t.maxLength&&(d=d.substring(0,t.maxLength));let B={hash:d,data:o.data,algorithm:i};return this.hookSync("after:toHashSync",B),B.hash}}let r=new TextEncoder().encode(e),s=this._providers.get(i);if(!s&&(this.emit("warn",`Invalid algorithm '${i}' not found. Falling back to default algorithm '${this._defaultAlgorithmSync}'.`),s=this._providers.get(this._defaultAlgorithmSync),!s))throw new Error(`Hash provider '${this._defaultAlgorithmSync}' (default) not found`);if(!s.toHashSync)throw new Error(`Hash provider '${i}' does not support synchronous hashing. Use toHash() instead or choose a different algorithm (djb2, fnv1, murmur, crc32).`);let g=s.toHashSync(r);this._cache.enabled&&this._cache.set(a,g),t?.maxLength&&g.length>t?.maxLength&&(g=g.substring(0,t.maxLength));let c={hash:g,data:o.data,algorithm:o.algorithm};return this.hookSync("after:toHashSync",c),c.hash}toNumberSync(n,t={}){let{min:o=0,max:i=100,algorithm:e=this._defaultAlgorithmSync,hashLength:a=16}=t;if(o>i)throw new Error("min cannot be greater than max");let A=this.toHashSync(n,{algorithm:e,maxLength:a}),r=Number.parseInt(A,16),s=i-o+1;return o+r%s}loadProviders(n,t={includeBase:!0}){if(n)for(let o of n)this._providers.add(o);t.includeBase&&(this.providers.add(new wb({algorithm:"SHA-256"})),this.providers.add(new wb({algorithm:"SHA-384"})),this.providers.add(new wb({algorithm:"SHA-512"})),this.providers.add(new a8e),this.providers.add(new i8e),this.providers.add(new o8e),this.providers.add(new n8e))}};var MU=n=>{let t;if(n!==void 0){if(typeof n=="number")t=n;else{if(typeof n!="string")return;if(n=n.trim(),Number.isNaN(Number(n))){let o=/^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(n);if(!o)throw new Error(`Unsupported time format: "${n}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.`);let[,i,e]=o,a=Number.parseFloat(i);switch(e.toLowerCase()){case"ms":t=a;break;case"s":t=a*1e3;break;case"m":t=a*1e3*60;break;case"h":t=a*1e3*60*60;break;case"hr":t=a*1e3*60*60;break;case"d":t=a*1e3*60*60*24;break;default:t=Number(n)}}else t=Number(n)}return t}},np=(n,t)=>{t??=new Date;let o=MU(n);return o===void 0?t.getTime():t.getTime()+o};var Gf=(function(n){return n.SHA256="SHA-256",n.SHA384="SHA-384",n.SHA512="SHA-512",n.DJB2="djb2",n.FNV1="fnv1",n.MURMER="murmer",n.CRC32="crc32",n})({});function OU(n,t={algorithm:"djb2",serialize:JSON.stringify}){let o=t?.algorithm??"djb2",i=(t?.serialize??JSON.stringify)(n);return new DU().toHashSync(i,{algorithm:o})}function Rne(n,t={min:0,max:10,algorithm:"djb2",serialize:JSON.stringify}){let o=t?.min??0,i=t?.max??10,e=t?.algorithm??"djb2",a=t?.serialize??JSON.stringify,A=t?.hashLength??16;if(o>=i)throw new Error(`Invalid range: min (${o}) must be less than max (${i})`);let r=a(n);return new DU().toNumberSync(r,{algorithm:e,min:o,max:i,hashLength:A})}function _U(n,t){let{ttl:o,keyPrefix:i,cache:e,serialize:a}=t;return(...A)=>{let r=g8e(n,A,{keyPrefix:i,serialize:a});t.createKey&&(r=t.createKey(n,A,t));let s=e.get(r);if(s===void 0)try{s=n(...A),e.set(r,s,o)}catch(g){e.emit("error",g),t.cacheErrors&&e.set(r,g,o)}return s}}function TU(n,t,o){let i=typeof n=="function"?n(o):n,e;try{e=o.cache.get(i)}catch(a){if(o.cache.emit("error",a),o.throwErrors===!0||o.throwErrors==="store")throw a}if(e===void 0)try{try{e=t()}catch(a){throw new Db(a,"function")}try{o.cache.set(i,e,o.ttl)}catch(a){throw new Db(a,"store")}}catch(a){let A=a instanceof Db?a.context:void 0,r=a instanceof Db?a.error:a;if(o.cache.emit("error",r),o.cacheErrors&&A==="function")try{o.cache.set(i,r,o.ttl)}catch(s){o.cache.emit("error",s)}if(o.throwErrors===!0||o.throwErrors===A)throw r}return e}function g8e(n,t,o){let{keyPrefix:i,serialize:e}=o||{};return i?`${i}::${n.name}::${OU(t,{serialize:e})}`:`${n.name}::${OU(t,{serialize:e})}`}var Db=class{error;context;constructor(n,t){this.error=n,this.context=t}};var yI=class{_counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0};_vsize=0;_ksize=0;_enabled=!1;_lastUpdated;_lastReset;_subscriptions=[];_trackedKeys=new Map;_trackKeys=!1;_maxTrackedKeys;constructor(n){n?.enabled&&(this._enabled=n.enabled),n?.trackKeys&&(this._trackKeys=n.trackKeys),n?.maxTrackedKeys!==void 0&&(this._maxTrackedKeys=n.maxTrackedKeys),n?.emitter&&n?.eventMap&&this.subscribe(n.emitter,n.eventMap)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get trackKeys(){return this._trackKeys}set trackKeys(n){this._trackKeys=n}get maxTrackedKeys(){return this._maxTrackedKeys}set maxTrackedKeys(n){this._maxTrackedKeys=n}get trackedKeys(){return this._trackedKeys}get hits(){return this._counters.hits}get misses(){return this._counters.misses}get gets(){return this._counters.gets}get sets(){return this._counters.sets}get deletes(){return this._counters.deletes}get clears(){return this._counters.clears}get vsize(){return this._vsize}get ksize(){return this._ksize}get count(){return this._counters.count}get hitRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.hits/n}get missRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.misses/n}get lastUpdated(){return this._lastUpdated}get lastReset(){return this._lastReset}increment(n,t=1){this._enabled&&(this._counters[n]+=t,this.touch())}decrement(n,t=1){this._enabled&&(this._counters[n]-=t,this.touch())}incrementHits(n=1){this.increment("hits",n)}incrementMisses(n=1){this.increment("misses",n)}incrementGets(n=1){this.increment("gets",n)}incrementSets(n=1){this.increment("sets",n)}incrementDeletes(n=1){this.increment("deletes",n)}incrementClears(n=1){this.increment("clears",n)}incrementVSize(n){this._enabled&&(this._vsize+=this.roughSizeOfObject(n),this.touch())}decreaseVSize(n){this._enabled&&(this._vsize=Math.max(0,this._vsize-this.roughSizeOfObject(n)),this.touch())}incrementKSize(n){this._enabled&&(this._ksize+=this.roughSizeOfString(n),this.touch())}decreaseKSize(n){this._enabled&&(this._ksize=Math.max(0,this._ksize-this.roughSizeOfString(n)),this.touch())}incrementCount(n=1){this.increment("count",n)}decreaseCount(n=1){this._enabled&&(this._counters.count=Math.max(0,this._counters.count-n),this.touch())}setCount(n){this._enabled&&(this._counters.count=n,this.touch())}roughSizeOfString(n){return n.length*2}roughSizeOfObject(n){let t=[],o=[n],i=0;for(;o.length>0;){let e=o.pop();if(typeof e=="boolean")i+=4;else if(typeof e=="string")i+=e.length*2;else if(typeof e=="number")i+=8;else{if(e==null){i+=4;continue}if(t.includes(e))continue;t.push(e);for(let a in e)i+=a.length*2,o.push(e[a])}}return i}enable(){this._enabled=!0}disable(){this._enabled=!1}clear(){this.reset()}reset(){this._counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0},this._vsize=0,this._ksize=0,this._trackedKeys.clear(),this._lastReset=Date.now(),this._lastUpdated=void 0}resetStoreValues(){this._vsize=0,this._ksize=0,this._counters.count=0}toJSON(){return{enabled:this._enabled,hits:this._counters.hits,misses:this._counters.misses,gets:this._counters.gets,sets:this._counters.sets,deletes:this._counters.deletes,clears:this._counters.clears,vsize:this._vsize,ksize:this._ksize,count:this._counters.count,hitRate:this.hitRate,missRate:this.missRate,trackedKeys:this._trackedKeys.size,lastUpdated:this._lastUpdated,lastReset:this._lastReset}}snapshot(){return this.toJSON()}recordKey(n,t,o=1){if(!this._enabled||!this._trackKeys)return;let i=this._trackedKeys.get(n);i||(i={hits:0,misses:0,gets:0,sets:0,deletes:0},this._trackedKeys.set(n,i),this.pruneTrackedKeys(n)),i[t]+=o,this.touch()}mostUsedKeys(n=100,t){return this.sortedKeyEntries(t,"desc").slice(0,n)}leastUsedKeys(n=100,t){return this.sortedKeyEntries(t,"asc").slice(0,n)}keyStats(n){let t=this._trackedKeys.get(n);return t?this.toKeyEntry(n,t):void 0}clearKeys(){this._trackedKeys.clear()}totalOf(n){return n.hits+n.misses+n.gets+n.sets+n.deletes}toKeyEntry(n,t){let o=t.hits+t.misses;return{key:n,count:this.totalOf(t),hits:t.hits,misses:t.misses,gets:t.gets,sets:t.sets,deletes:t.deletes,hitRate:o===0?0:t.hits/o}}sortedKeyEntries(n,t){let o=[];for(let[e,a]of this._trackedKeys)o.push(this.toKeyEntry(e,a));let i=t==="asc"?1:-1;return o.sort((e,a)=>{let A=n?e[n]:e.count,r=n?a[n]:a.count;return A!==r?(A-r)*i:e.keythis.totalOf(i[1])-this.totalOf(e[1]));for(let[i]of o){if(this._trackedKeys.size<=t)break;i!==n&&this._trackedKeys.delete(i)}}subscribe(n,t){for(let[o,i]of Object.entries(t)){let e=(...a)=>{this.applyEvent(i,a)};n.on(o,e),this._subscriptions.push({emitter:n,event:o,listener:e})}}unsubscribe(n){let t=[];for(let o of this._subscriptions){if(n&&o.emitter!==n){t.push(o);continue}(o.emitter.off??o.emitter.removeListener)?.call(o.emitter,o.event,o.listener)}this._subscriptions=t}applyEvent(n,t){if(this._enabled){if(typeof n=="function"){n(this,...t);return}if(Array.isArray(n)){for(let o of n)this.increment(o);return}this.increment(n)}}touch(){this._lastUpdated=Date.now()}};var c8e=class{value;prev=void 0;next=void 0;constructor(n){this.value=n}},NU=class{head=void 0;tail=void 0;nodesMap=new Map;addToFront(n){let t=new c8e(n);this.head?(t.next=this.head,this.head.prev=t,this.head=t):this.head=this.tail=t,this.nodesMap.set(n,t)}moveToFront(n){let t=this.nodesMap.get(n);if(!t||this.head===t)return;t.prev&&(t.prev.next=t.next);t.next&&(t.next.prev=t.prev);t===this.tail&&(this.tail=t.prev),t.prev=void 0,t.next=this.head;this.head&&(this.head.prev=t),this.head=t,this.tail??=t}getOldest(){return this.tail?this.tail.value:void 0}removeOldest(){if(!this.tail)return;let n=this.tail.value;return this.tail.prev?(this.tail=this.tail.prev,this.tail.next=void 0):this.head=this.tail=void 0,this.nodesMap.delete(n),n}remove(n){let t=this.nodesMap.get(n);return t?(t.prev?t.prev.next=t.next:(this.head=t.next,this.head&&(this.head.prev=void 0)),t.next?t.next.prev=t.prev:(this.tail=t.prev,this.tail&&(this.tail.next=void 0)),this.nodesMap.delete(n),!0):!1}get size(){return this.nodesMap.size}};var kne=16777216,RU=class extends QI{_lru=new NU;_storeHashSize=16;_storeHashAlgorithm=Gf.DJB2;_store=Array.from({length:this._storeHashSize},()=>new Map);_ttl;_maxTtl;_useClone=!0;_lruSize=0;_checkInterval=0;_interval=0;_stats=new yI({enabled:!1});constructor(n){super(),n?.ttl&&this.setTtl(n.ttl),n?.maxTtl!==void 0&&this.setMaxTtl(n.maxTtl),n?.useClone!==void 0&&(this._useClone=n.useClone),n?.stats&&(this._stats.enabled=n.stats),n?.storeHashSize&&n.storeHashSize>0&&(this._storeHashSize=n.storeHashSize),n?.lruSize&&(n.lruSize>16777216?this.emit("error",new Error(`LRU size cannot be larger than ${kne} due to Map limitations.`)):this._lruSize=n.lruSize),n?.checkInterval&&(this._checkInterval=n.checkInterval),n?.storeHashAlgorithm&&(this._storeHashAlgorithm=n.storeHashAlgorithm),this._store=Array.from({length:this._storeHashSize},()=>new Map),this.startIntervalCheck()}get ttl(){return this._ttl}set ttl(n){this.setTtl(n)}get maxTtl(){return this._maxTtl}set maxTtl(n){this.setMaxTtl(n)}get useClone(){return this._useClone}set useClone(n){this._useClone=n}get lruSize(){return this._lruSize}set lruSize(n){if(n>16777216){this.emit("error",new Error(`LRU size cannot be larger than ${kne} due to Map limitations.`));return}if(this._lruSize=n,this._lruSize===0){this._lru=new NU;return}this.lruResize()}get checkInterval(){return this._checkInterval}set checkInterval(n){this._checkInterval=n}get size(){let n=0;for(let t of this._store)n+=t.size;return n}get stats(){return this._stats}get storeHashSize(){return this._storeHashSize}set storeHashSize(n){n!==this._storeHashSize&&(this._storeHashSize=n,this._store=Array.from({length:this._storeHashSize},()=>new Map),this._stats.enabled&&this._stats.resetStoreValues())}get storeHashAlgorithm(){return this._storeHashAlgorithm}set storeHashAlgorithm(n){this._storeHashAlgorithm=n}get keys(){let n=[];for(let t of this._store)for(let o of t.keys()){let i=t.get(o);if(i&&this.hasExpired(i)){this.recordExpiration(i),t.delete(o),this.lruRemove(o);continue}n.push(o)}return n.values()}get items(){let n=[];for(let t of this._store)for(let o of t.values()){if(this.hasExpired(o)){this.recordExpiration(o),t.delete(o.key),this.lruRemove(o.key);continue}n.push(o)}return n.values()}get store(){return this._store}get(n){this.hookSync("BEFORE_GET",n);let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}this.lruMoveToFront(n);let i;return this._useClone?i=this.clone(o.value):i=o.value,this.recordRead(!0),this.hookSync("AFTER_GET",{key:n,result:i}),i}getMany(n){this.hookSync("BEFORE_GET_MANY",n);let t=[];for(let o of n)t.push(this.get(o));return this.hookSync("AFTER_GET_MANY",{keys:n,result:t}),t}getRaw(n){let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1);return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1);return}return this.lruMoveToFront(n),this.recordRead(!0),o}getManyRaw(n){let t=[];for(let o of n)t.push(this.getRaw(o));return t}set(n,t,o){let i={key:n,value:t,ttl:o};this.hookSync("BEFORE_SET",i);let e=this.getStore(i.key),a,A=i.ttl;if(A!==void 0||this._ttl!==void 0)if(typeof A=="object"){if(A.expire&&(a=typeof A.expire=="number"?A.expire:A.expire.getTime()),A.ttl){let s=np(A.ttl);s!==void 0&&(a=s)}}else{let s=np(A??this._ttl);s!==void 0&&(a=s)}if(this._maxTtl!==void 0){let s=np(this._maxTtl);(a===void 0||a>s)&&(a=s)}if(this._lruSize>0){if(e.has(i.key))this.lruMoveToFront(i.key);else if(this.lruAddToFront(i.key),this._lru.size>this._lruSize){let s=this._lru.getOldest();s&&(this._lru.removeOldest(),this.delete(s))}}if(this._stats.enabled){let s=e.get(i.key);s?this._stats.decreaseVSize(s.value):(this._stats.incrementKSize(i.key),this._stats.incrementCount()),this._stats.incrementVSize(i.value),this._stats.incrementSets()}let r={key:i.key,value:i.value,expires:a};e.set(i.key,r),this.hookSync("AFTER_SET",i)}setMany(n){this.hookSync("BEFORE_SET_MANY",n);for(let t of n)this.set(t.key,t.value,t.ttl);this.hookSync("AFTER_SET_MANY",n)}has(n){return!!this.get(n)}hasMany(n){let t=[];for(let o of n){let i=this.get(o);t.push(!!i)}return t}take(n){let t=this.get(n);if(t)return this.delete(n),t}takeMany(n){let t=[];for(let o of n)t.push(this.take(o));return t}delete(n){this.hookSync("BEFORE_DELETE",n);let t=this.getStore(n);if(this._stats.enabled){let o=t.get(n);o&&(this._stats.decreaseKSize(n),this._stats.decreaseVSize(o.value),this._stats.decreaseCount(),this._stats.incrementDeletes())}t.delete(n),this.lruRemove(n),this.hookSync("AFTER_DELETE",n)}deleteMany(n){this.hookSync("BEFORE_DELETE_MANY",n);for(let t of n)this.delete(t);this.hookSync("AFTER_DELETE_MANY",n)}clear(){this.hookSync("BEFORE_CLEAR"),this._store=Array.from({length:this._storeHashSize},()=>new Map),this._lru=new NU,this._stats.enabled&&(this._stats.resetStoreValues(),this._stats.incrementClears()),this.hookSync("AFTER_CLEAR")}getStore(n){let t=this.getKeyStoreHash(n);return this._store[t]||=new Map,this._store[t]}getKeyStoreHash(n){return this._store.length===1?0:typeof this._storeHashAlgorithm=="function"?this._storeHashAlgorithm(n,this._storeHashSize):Rne(n,{min:0,max:this._storeHashSize-1,algorithm:this._storeHashAlgorithm})}clone(n){return this.isPrimitive(n)?n:structuredClone(n)}lruAddToFront(n){this._lruSize!==0&&this._lru.addToFront(n)}lruMoveToFront(n){this._lruSize!==0&&this._lru.moveToFront(n)}lruRemove(n){this._lruSize!==0&&this._lru.remove(n)}lruResize(){for(;this._lru.size>this._lruSize;){let n=this._lru.getOldest();n&&(this._lru.removeOldest(),this.delete(n))}}checkExpiration(){for(let n of this._store)for(let t of n.values())t.expires&&Date.now()>t.expires&&(this.recordExpiration(t),n.delete(t.key),this.lruRemove(t.key))}startIntervalCheck(){if(this._checkInterval>0){this._interval&&clearInterval(this._interval),this._interval=setInterval(()=>{this.checkExpiration()},this._checkInterval).unref()}}stopIntervalCheck(){this._interval&&clearInterval(this._interval),this._interval=0,this._checkInterval=0}wrap(n,t){return _U(n,{ttl:t?.ttl??this._ttl,keyPrefix:t?.keyPrefix,createKey:t?.createKey,cache:this})}getOrSet(n,t,o){return TU(n,t,{cache:this,ttl:o?.ttl??this._ttl,cacheErrors:o?.cacheErrors,throwErrors:o?.throwErrors})}recordRead(n){this._stats.enabled&&(n?this._stats.incrementHits():this._stats.incrementMisses(),this._stats.incrementGets())}recordExpiration(n){this._stats.enabled&&(this._stats.decreaseKSize(n.key),this._stats.decreaseVSize(n.value),this._stats.decreaseCount())}isPrimitive(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}setTtl(n){typeof n=="string"||n===void 0?this._ttl=n:n>0?this._ttl=n:this._ttl=void 0}setMaxTtl(n){typeof n=="string"||n===void 0?this._maxTtl=n:n>0?this._maxTtl=n:this._maxTtl=void 0}hasExpired(n){return!!(n.expires&&Date.now()>n.expires)}};var C8e=class extends QI{options={stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,maxKeys:-1};store=new Map;_stats=new yI({enabled:!0});_cacheable=new RU;intervalId=0;constructor(n){super(),n&&(this.options={...this.options,...n}),this.startInterval()}set(n,t,o=0){if(typeof n!="string"&&typeof n!="number")throw this.createError("The key argument has to be of type `string` or `number`. Found: `__key`",n);if(o&&typeof o!="number"&&typeof o!="string")throw this.createError("The ttl argument has to be a number or a string for shorthand ttl.",this.formatKey(n));let i=this.formatKey(n),e=0;this.options.stdTTL&&(e=this.getExpirationTimestamp(this.options.stdTTL)),o&&(e=this.getExpirationTimestamp(o));let a=0;if(e&&e>0&&(a=e),this.options.maxKeys){let{maxKeys:A}=this.options;if(A>-1&&this.store.size>=A)throw this.createError("Cache max keys amount exceeded",this.formatKey(n))}return this.store.set(i,{key:i,value:t,ttl:a}),this.emit("set",i,t,e),this._stats.incrementKSize(i),this._stats.incrementVSize(t),this._stats.setCount(this.store.size),!0}mset(n){if(!Array.isArray(n))throw this.createError("The keys argument has to be an array.");for(let t of n)this.set(t.key,t.value,t.ttl);return!0}get(n){let t=this.store.get(this.formatKey(n));if(t){if(t.ttl>0){if(t.ttl0){let n=this.options.checkperiod*1e3;this.intervalId=setInterval(()=>{this.checkData()},n).unref();return}this.intervalId=0}stopInterval(){this.intervalId!==0&&(clearInterval(this.intervalId),this.intervalId=0)}formatKey(n){return n.toString()}getExpirationTimestamp(n){if(typeof n=="string")return np(n);let t=Date.now(),o=n*1e3;return t+o}checkData(){for(let[n,t]of this.store.entries())t.ttl>0&&t.ttl{let a={resolve:i,reject:e,weight:t,priority:o},A=Pne(this._queue,r=>o<=r.priority);A===-1&&t<=this._value?this._dispatchItem(a):this._queue.splice(A+1,0,a)})}runExclusive(t){return B8e(this,arguments,void 0,function*(o,i=1,e=0){let[a,A]=yield this.acquire(i,e);try{return yield o(a)}finally{A()}})}waitForUnlock(t=1,o=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,o)?Promise.resolve():new Promise(i=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),f8e(this._weightedWaiters[t-1],{resolve:i,priority:o})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){let o=this._value;this._value-=t.weight,t.resolve([o,this._newReleaser(t.weight)])}_newReleaser(t){let o=!1;return()=>{o||(o=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){let o=this._weightedWaiters[t-1];o&&(o.forEach(i=>i.resolve()),this._weightedWaiters[t-1]=[])}else{let t=this._queue[0].priority;for(let o=this._value;o>0;o--){let i=this._weightedWaiters[o-1];if(!i)continue;let e=i.findIndex(a=>a.priority<=t);(e===-1?i:i.splice(0,e)).forEach((a=>a.resolve()))}}}_couldLockImmediately(t,o){return(this._queue.length===0||this._queue[0].priorityt.priority<=i.priority);n.splice(o+1,0,t)}function Pne(n,t){for(let o=n.length-1;o>=0;o--)if(t(n[o]))return o;return-1}var Q8e=function(n,t,o,i){function e(a){return a instanceof o?a:new o(function(A){A(a)})}return new(o||(o=Promise))(function(a,A){function r(c){try{g(i.next(c))}catch(I){A(I)}}function s(c){try{g(i.throw(c))}catch(I){A(I)}}function g(c){c.done?a(c.value):e(c.value).then(r,s)}g((i=i.apply(n,t||[])).next())})},ec=class{constructor(t){this._semaphore=new kU(1,t)}acquire(){return Q8e(this,arguments,void 0,function*(t=0){let[,o]=yield this._semaphore.acquire(1,t);return o})}runExclusive(t,o=0){return this._semaphore.runExclusive(()=>t(),1,o)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};import{randomBytes as D8e}from"crypto";var PU=qe(Fne(),1);var GU=class n extends Error{name="TimeoutError";constructor(t,o){super(t,o),Error.captureStackTrace?.(this,n)}},Lne=n=>n.reason??new DOMException("This operation was aborted.","AbortError");function FU(n,t){let{milliseconds:o,fallback:i,message:e,customTimers:a={setTimeout,clearTimeout},signal:A}=t,r,s,c=new Promise((I,d)=>{if(typeof o!="number"||Math.sign(o)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(A?.aborted){d(Lne(A));return}if(A&&(s=()=>{d(Lne(A))},A.addEventListener("abort",s,{once:!0})),n.then(I,d),o===Number.POSITIVE_INFINITY)return;let B=new GU;r=a.setTimeout.call(void 0,()=>{if(i){try{I(i())}catch(f){d(f)}return}typeof n.cancel=="function"&&n.cancel(),e===!1?I():e instanceof Error?d(e):(B.message=e??`Promise timed out after ${o} milliseconds`,d(B))},o)}).finally(()=>{c.clear(),s&&A&&A.removeEventListener("abort",s)});return c.clear=()=>{a.clearTimeout.call(void 0,r),r=void 0},c}function LU(n,t,o){let i=0,e=n.length;for(;e>0;){let a=Math.trunc(e/2),A=i+a;o(n[A],t)<=0?(i=++A,e-=a+1):e=a}return i}var S8e=100,pE=class{#e=[];#A=0;enqueue(t,o){let{priority:i=0,id:e}=o??{},{size:a}=this,A={priority:i,id:e,run:t};if(a===0){this.#e.length=0,this.#A=0,this.#e.push(A);return}if(this.#e.at(-1).priority>=i){this.#e.push(A);return}this.#t();let r=LU(this.#e,A,(s,g)=>g.priority-s.priority);this.#e.splice(r,0,A)}setPriority(t,o){let i=this.#e.findIndex((a,A)=>A>=this.#A&&a.id===t);if(i===-1)throw new ReferenceError(`No promise function with the id "${t}" exists in the queue.`);let[e]=this.#e.splice(i,1);this.enqueue(e.run,{priority:o,id:t})}remove(t){let o=this.#e.findIndex((i,e)=>eS8e&&this.#A>this.#e.length/2&&this.#t(),t?.run}filter(t){let o=[];for(let i=this.#A;i=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);if(t.strict&&t.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(t.strict&&t.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#e=t.carryoverIntervalCount??t.carryoverConcurrencyCount??!1,this.#A=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#i=t.interval,this.#p=t.strict,this.#I=new t.queueClass,this.#d=t.queueClass,this.concurrency=t.concurrency,t.timeout!==void 0&&!(Number.isFinite(t.timeout)&&t.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);this.timeout=t.timeout,this.#u=t.autoStart===!1,this.#L()}#S(t){for(;this.#g=this.#i)this.#g++;else break}(this.#g>100&&this.#g>this.#c.length/2||this.#g===this.#c.length)&&(this.#c=this.#c.slice(this.#g),this.#g=0)}#y(t){this.#p?this.#c.push(t):this.#t++}#m(){this.#p?this.#c.length>this.#g&&this.#c.pop():this.#t>0&&this.#t--}#D(){return this.#c.length-this.#g}get#E(){return this.#A?!0:this.#p?this.#D()=this.#r){let i=this.#c[this.#g],e=this.#i-(t-i);return this.#R(e),!0}return!1}if(this.#n===void 0){let o=this.#a-t;if(o<0)this.#t=this.#e?this.#h:0;else return this.#R(o),!0}return!1}#R(t){this.#s===void 0&&(this.#s=setTimeout(()=>{this.#O()},t))}#_(){this.#n&&(clearInterval(this.#n),this.#n=void 0)}#G(){this.#s&&(clearTimeout(this.#s),this.#s=void 0)}#k(){if(this.#I.size===0){if(this.#_(),this.emit("empty"),this.#h===0){if(this.#G(),this.#p&&this.#g>0){let o=Date.now();this.#S(o)}this.emit("idle")}return!1}let t=!1;if(!this.#u){let o=Date.now(),i=!this.#w(o);if(this.#E&&this.#N){let e=this.#I.dequeue();this.#A||(this.#y(o),this.#v()),i&&this.#F(),this.emit("active"),e(),t=!0}}return t}#F(){this.#A||this.#n!==void 0||this.#p||(this.#n=setInterval(()=>{this.#P()},this.#i),this.#a=Date.now()+this.#i)}#P(){this.#p||(this.#n!==void 0&&(this.#t===0&&this.#h===0?this.#_():this.#a=Date.now()+this.#i),this.#t=this.#e?this.#h:0),this.#H(),this.#v()}#H(){for(;this.#k(););}get concurrency(){return this.#C}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#C=t,this.#H()}setPriority(t,o){if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${o}\` (${typeof o})`);this.#I.setPriority(t,o)}async add(t,o={}){if(o={timeout:this.timeout,...o,id:o.id??(this.#B++).toString()},o.timeout!==void 0&&!(Number.isFinite(o.timeout)&&o.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${o.timeout}\` (${typeof o.timeout})`);return new Promise((i,e)=>{let a=Symbol(`task-${o.id}`),A=()=>{},r=async()=>{A(),this.#h++,this.#f.set(a,{id:o.id,priority:o.priority??0,startTime:Date.now(),timeout:o.timeout});let g;try{try{o.signal?.throwIfAborted()}catch(d){throw this.#K(),this.#f.delete(a),d}let c=t({signal:o.signal});if(o.timeout!==void 0&&(c=FU(Promise.resolve(c),{milliseconds:o.timeout,message:`Task timed out after ${o.timeout}ms (queue has ${this.#h} running, ${this.#I.size} waiting)`})),o.signal){let{signal:d}=o;c=Promise.race([c,new Promise((B,f)=>{g=()=>{f(d.reason)},d.addEventListener("abort",g,{once:!0})})])}let I=await c;i(I),this.emit("completed",I)}catch(c){e(c),this.emit("error",c)}finally{g&&o.signal?.removeEventListener("abort",g),this.#f.delete(a),queueMicrotask(()=>{this.#T()})}};this.#I.enqueue(r,o);let s=()=>{if(this.#I instanceof pE){this.#I.remove(r);return}this.#I.remove?.(o.id)};if(o.signal){let{signal:g}=o,c=()=>{A(),s(),e(g.reason),this.#k(),this.emit("next")};if(A=()=>{g.removeEventListener("abort",c),this.#Q.delete(A)},g.aborted){c();return}g.addEventListener("abort",c,{once:!0}),this.#Q.add(A)}this.emit("add"),this.#k()})}async addAll(t,o){return Promise.all(t.map(async i=>this.add(i,o)))}start(){return this.#u?(this.#u=!1,this.#H(),this):this}pause(){this.#u=!0}clear(){for(let t of this.#Q)t();this.#I=new this.#d,this.#_(),this.#q(),this.emit("empty"),this.#h===0&&(this.#G(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#I.size!==0&&await this.#U("empty")}async onSizeLessThan(t){this.#I.sizethis.#I.size{let i=e=>{this.off("error",i),o(e)};this.on("error",i)})}async#U(t,o){let i=Array.isArray(t)?t:[t];return new Promise(e=>{let a=()=>{if(!(o&&!o())){for(let A of i)this.off(A,a);e()}};for(let A of i)this.on(A,a)})}get size(){return this.#I.size}sizeBy(t){return this.#I.filter(t).length}get pending(){return this.#h}get isPaused(){return this.#u}#L(){this.#A||(this.on("add",()=>{this.#I.size>0&&this.#v()}),this.on("next",()=>{this.#v()}))}#v(){this.#A||this.#o||(this.#o=!0,queueMicrotask(()=>{this.#o=!1,this.#q()}))}#K(){this.#A||(this.#m(),this.#v())}#q(){let t=this.#l;if(this.#A||this.#I.size===0){t&&(this.#l=!1,this.emit("rateLimitCleared"));return}let o;if(this.#p){let e=Date.now();this.#S(e),o=this.#D()}else o=this.#t;let i=o>=this.#r;i!==t&&(this.#l=i,this.emit(i?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#l}get isSaturated(){return this.#h===this.#C&&this.#I.size>0||this.isRateLimited&&this.#I.size>0}get runningTasks(){return[...this.#f.values()].map(t=>({...t,timeoutRemaining:t.timeout?Math.max(0,t.startTime+t.timeout-Date.now()):void 0}))}};var bb=class{constructor(t,o){this.store=t,this.logger=o,this.queues=new Map}getQueue(t){return this.queues.has(t)||this.queues.set(t,new sp({concurrency:1})),this.queues.get(t)}async processOperations(t,o,i,e,a){let A=t[o];if(A)return this.getQueue(o).add(async()=>{i[o]=i[o]||{},e[o]=e[o]||{};let r=[],s={};for(let g in A)A[g]===null?r.push(g):s[g]=A[g];Object.keys(s).length>0&&(Object.assign(i[o],s),Object.assign(e[o],s)),r.length>0&&await this.processDeletions(o,r,i,e,a)})}async processDeletions(t,o,i,e,a){if(a)for(let A of o)i[t]?.[A]?(i[t][A]=null,e[t][A]=null):this.logger.warn(`Skipping deletion of non-existent ${t} in transaction: ${A}`);else{let A=await this.store.get(t,o);for(let r of o)A[r]?(i[t][r]=null,e[t][r]=null):this.logger.warn(`Skipping deletion of non-existent ${t}: ${r}`)}}async validateDeletions(t,o){let i=t[o];if(i)return this.getQueue(o).add(async()=>{let e=Object.keys(i).filter(A=>i[A]===null);if(e.length===0)return;let a=await this.store.get(o,e);for(let A of e)a[A]||(this.logger.warn(`Skipping deletion of non-existent ${o}: ${A}`),delete t[o][A])})}};var Hne=(n,t,{maxCommitRetries:o,delayBetweenTriesMs:i})=>{let e=new w8e,a=new Map,A=new Map,r=new Map,s=new bb(n,t);function g(Q){return a.has(Q)||a.set(Q,new sp({concurrency:1})),a.get(Q)}function c(Q){return A.has(Q)||(A.set(Q,new ec),r.set(Q,0)),A.get(Q)}function I(Q){let y=r.get(Q)??0;r.set(Q,y+1)}function d(Q){let y=(r.get(Q)??1)-1;if(r.set(Q,y),y<=0){let m=A.get(Q);m&&!m.isLocked()&&(A.delete(Q),r.delete(Q))}}function B(){return!!e.getStore()}async function f(Q){if(Object.keys(Q).length===0){t.trace("no mutations in transaction");return}t.trace("committing transaction");for(let y=0;y{let m=e.getStore();if(!m)return n.get(Q,y);let T=m.cache[Q]||{},_=y.filter(K=>!(K in T));if(_.length>0){m.dbQueries++,t.trace({type:Q,count:_.length},"fetching missing keys in transaction");let K=await c(Q).runExclusive(()=>n.get(Q,_));m.cache[Q]=m.cache[Q]||{},Object.assign(m.cache[Q],K)}let R={};for(let K of y){let L=m.cache[Q]?.[K];L!=null&&(R[K]=L)}return R},set:async Q=>{let y=e.getStore();if(!y){let m=Object.keys(Q);for(let T of m){let _=T;_==="pre-key"&&await s.validateDeletions(Q,_)}await Promise.all(m.map(T=>g(T).add(async()=>{let _={[T]:Q[T]};await n.set(_)})));return}t.trace({types:Object.keys(Q)},"caching in transaction");for(let m in Q){let T=m;y.cache[T]=y.cache[T]||{},y.mutations[T]=y.mutations[T]||{},T==="pre-key"?await s.processOperations(Q,T,y.cache,y.mutations,!0):(Object.assign(y.cache[T],Q[T]),Object.assign(y.mutations[T],Q[T]))}},isInTransaction:B,transaction:async(Q,y)=>{if(e.getStore())return t.trace("reusing existing transaction context"),Q();let T=c(y);I(y);try{return await T.runExclusive(async()=>{let _={cache:{},mutations:{},dbQueries:0};t.trace("entering transaction");try{let R=await e.run(_,Q);return await f(_.mutations),t.trace({dbQueries:_.dbQueries},"transaction completed"),R}catch(R){throw t.error({error:R},"transaction failed, rolling back"),R}})}finally{d(y)}}}},Kne=n=>{let t=n.me?.id;if(!t)throw new Une.Boom("Cannot proceed: socket is not authenticated yet (creds.me.id is missing)",{statusCode:401});return t},xne=()=>{let n=Sr.generateKeyPair();return{noiseKey:Sr.generateKeyPair(),pairingEphemeralKeyPair:Sr.generateKeyPair(),signedIdentityKey:n,signedPreKey:dD(n,1),registrationId:K7(),advSecretKey:D8e(32).toString("base64"),processedHistoryMessages:[],nextPreKeyId:1,firstUnuploadedPreKeyId:1,accountSyncCounter:0,accountSettings:{unarchiveChats:!1},registered:!1,pairingCode:void 0,lastPropHash:void 0,routingInfo:void 0,additionalData:void 0}};import{mkdir as O8e,readFile as b8e,stat as M8e,unlink as _8e,writeFile as T8e}from"fs/promises";import{join as UU}from"path";var Yne=new Map,HU=n=>{let t=Yne.get(n);return t||(t=new ec,Yne.set(n,t)),t},jne=async n=>{let t=async(r,s)=>{let g=UU(n,a(s));return HU(g).acquire().then(async I=>{try{await T8e(g,JSON.stringify(r,RB.replacer))}finally{I()}})},o=async r=>{try{let s=UU(n,a(r));return await HU(s).acquire().then(async c=>{try{let I=await b8e(s,{encoding:"utf-8"});return JSON.parse(I,RB.reviver)}finally{c()}})}catch{return null}},i=async r=>{try{let s=UU(n,a(r));return HU(s).acquire().then(async c=>{try{await _8e(s)}catch{}finally{c()}})}catch{}},e=await M8e(n).catch(()=>{});if(e){if(!e.isDirectory())throw new Error(`found something that is not a directory at ${n}, either delete it or specify a different location`)}else await O8e(n,{recursive:!0});let a=r=>r?.replace(/\//g,"__")?.replace(/:/g,"-"),A=await o("creds.json")||xne();return{state:{creds:A,keys:{get:async(r,s)=>{let g={};return await Promise.all(s.map(async c=>{let I=await o(`${r}-${c}.json`);r==="app-state-sync-key"&&I&&(I=oe.Message.AppStateSyncKeyData.fromObject(I)),g[c]=I})),g},set:async r=>{let s=[];for(let g in r)for(let c in r[g]){let I=r[g][c],d=`${g}-${c}.json`;s.push(I?t(I,d):i(d))}await Promise.all(s)}}},saveCreds:async()=>t(A,"creds.json")}};var N8e=192,R8e=async(n,{thumbnailWidth:t,fetchOpts:o})=>{let i=await Bb(n,o);return await oU(i,t)},Jne=async(n,t={thumbnailWidth:N8e,fetchOpts:{timeout:3e3}})=>{try{let o=0,i=5,{getLinkPreview:e}=await import("link-preview-js"),a=n;!n.startsWith("https://")&&!n.startsWith("http://")&&(a="https://"+a);let A=await e(a,{...t.fetchOpts,followRedirects:"follow",handleRedirects:(r,s)=>{let g=new URL(r),c=new URL(s);return o>=i?!1:c.hostname===g.hostname||c.hostname==="www."+g.hostname||"www."+c.hostname===g.hostname?(o+=1,!0):!1},headers:t.fetchOpts?.headers});if(A&&"title"in A&&A.title){let[r]=A.images,s={"canonical-url":A.url,"matched-text":n,title:A.title,description:A.description,originalThumbnailUrl:r};if(t.uploadImage){let{imageMessage:g}=await _f({image:{url:r}},{upload:t.uploadImage,mediaTypeOverride:"thumbnail-link",options:t.fetchOpts});s.jpegThumbnail=g?.jpegThumbnail?Buffer.from(g.jpegThumbnail):void 0,s.highQualityThumbnail=g||void 0}else try{s.jpegThumbnail=r?(await R8e(r,t)).buffer:void 0}catch(g){t.logger?.debug({err:g.stack,url:a},"error in generating thumbnail")}return s}}catch(o){if(!o.message.includes("receive a valid"))throw o}};import x8e from"events";var xU=qe(Kr(),1);var k8e=/^1313555\d{4}$|^131655500\d{2}$/;function v8e(n){if(!n)return!1;let t=n.split("@")[0]??"";return t==="0"||k8e.test(t)||ph(n)?!1:!!(_t(n)||qA(n)||mr(n)||Ia(n)||n.endsWith("@c.us"))}var Mb=604800,P8e=4,SI="__index";async function _b(n){let o=(await n.get("tctoken",[SI]))[SI];if(!o?.token?.length)return[];try{let i=JSON.parse(Buffer.from(o.token).toString());return Array.isArray(i)?i.filter(e=>typeof e=="string"&&e.length>0&&e!==SI):[]}catch{return[]}}async function dE(n,t){let o=await _b(n),i=new Set(o);for(let e of t)e&&e!==SI&&i.add(e);return{[SI]:{token:Buffer.from(JSON.stringify([...i]))}}}function gp(n){if(n==null)return!0;let t=typeof n=="string"?parseInt(n):n;if(isNaN(t))return!0;let o=Math.floor(Date.now()/1e3),a=(Math.floor(o/Mb)-(P8e-1))*Mb;return ti}async function Xs(n,t){return qA(n)?n:await t(n)??n}async function Lf(n,t,o,i){return t?qA(n)?n:await o(n)??n:qA(n)&&i?await i(n)??n:n}async function KU({authState:n,jid:t,baseContent:o=[],getLIDForPN:i}){try{let e=await Xs(t,i),A=(await n.keys.get("tctoken",[e]))?.[e],r=A?.token,s=A?.timestamp;if(!r?.length||s===void 0||gp(s)){if(r){let g=A?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:A.senderTimestamp}:null;await n.keys.set({tctoken:{[e]:g}})}return o.length>0?o:void 0}return o.push({tag:"tctoken",attrs:{t:String(s)},content:r}),o}catch{return o.length>0?o:void 0}}async function hE({result:n,fallbackJid:t,keys:o,getLIDForPN:i,onNewJidStored:e}){let a=le(n,"tokens");if(!a)return;let A=PA(a,"token");for(let r of A){if(r.attrs.type!=="trusted_contact"||!(r.content instanceof Uint8Array))continue;let s=uA(t||r.attrs.jid);if(!v8e(s))continue;let g=await Xs(s,i),I=(await o.get("tctoken",[g]))[g],d=I?.timestamp?Number(I.timestamp):0,B=r.attrs.t?Number(r.attrs.t):0;B&&(d>0&&d>B||(await o.set({tctoken:{[g]:{...I,token:Buffer.from(r.content),timestamp:r.attrs.t}}}),e?.(g)))}}var G8e=new Set([RA.CALL_MISSED_GROUP_VIDEO,RA.CALL_MISSED_GROUP_VOICE,RA.CALL_MISSED_VIDEO,RA.CALL_MISSED_VOICE]),F8e=new Set([RA.GROUP_PARTICIPANT_ADD]);async function L8e(n,t,o,i){let e=t.lidMapping.getLIDForPN.bind(t.lidMapping),a=[];for(let g of n){let c=g.tcTokenTimestamp?Yr(g.tcTokenTimestamp):0;if(g.tcToken?.length&&c>0){let I=uA(g.id),d=await Xs(I,e);a.push({storageJid:d,token:Buffer.from(g.tcToken),ts:c,senderTs:g.tcTokenSenderTimestamp?Yr(g.tcTokenSenderTimestamp):void 0})}}if(!a.length)return;let A=a.map(g=>g.storageJid),r=await o.get("tctoken",A),s={};for(let g of a){let c=r[g.storageJid],I=c?.timestamp?Number(c.timestamp):0;I>0&&I>=g.ts||(s[g.storageJid]={...c,token:g.token,timestamp:String(g.ts),...g.senderTs!==void 0?{senderTimestamp:g.senderTs}:{}})}if(Object.keys(s).length){i?.debug({count:Object.keys(s).length},"storing tctokens from history sync");try{let g=await dE(o,Object.keys(s));await o.set({tctoken:{...s,...g}})}catch(g){i?.warn({err:g},"failed to store tctokens from history sync")}}}var zne=(n,t,o)=>{mr(n.key.remoteJid)||Ia(n.key.remoteJid)?n.key.remoteJid=yr(fA(n.key?.remoteJid)?.user,mr(n.key.remoteJid)?"s.whatsapp.net":"lid"):n.key.remoteJid=uA(n.key.remoteJid),mr(n.key.participant)||Ia(n.key.participant)?n.key.participant=yr(fA(n.key.participant)?.user,mr(n.key.participant)?"s.whatsapp.net":"lid"):n.key.participant=uA(n.key.participant);let i=Na(n.message);i?.reactionMessage&&e(i.reactionMessage.key),i?.pollUpdateMessage&&e(i.pollUpdateMessage.pollCreationMessageKey);function e(a){n.key.fromMe||(a.fromMe=a.fromMe?!1:Rt(a.participant||a.remoteJid,t)||Rt(a.participant||a.remoteJid,o),a.remoteJid=n.key.remoteJid,a.participant=a.participant||n.key.participant)}},YU=n=>{let t=Na(n.message),o=!!Tf(t);return(!!t||G8e.has(n.messageStubType)||F8e.has(n.messageStubType))&&o&&!t?.protocolMessage&&!t?.reactionMessage&&!t?.pollUpdateMessage},jU=n=>!n.key.fromMe&&!n.messageStubType,U8e=({remoteJid:n,participant:t,fromMe:o})=>{if(!n)throw new xU.Boom("Cannot derive chat id: message key is missing remoteJid",{data:{remoteJid:n,participant:t,fromMe:o}});if(SB(n)&&!Lg(n)&&!o){if(!t)throw new xU.Boom("Cannot derive chat id: broadcast message key is missing participant",{data:{remoteJid:n,fromMe:o}});return t}return n};function H8e({encPayload:n,encIv:t},{eventCreatorJid:o,eventMsgId:i,eventEncKey:e,responderJid:a}){let A=Buffer.concat([I(i),I(o),I(a),I("Event Response"),new Uint8Array([1])]),r=Hn(e,new Uint8Array(32),"sha256"),s=Hn(A,r,"sha256"),g=I(`${i}\0${a}`),c=Gl(n,s,t,g);return oe.Message.EventResponseMessage.decode(c);function I(d){return Buffer.from(d)}}var K8e=async(n,{shouldProcessHistoryMsg:t,placeholderResendCache:o,ev:i,creds:e,signalRepository:a,keyStore:A,logger:r,options:s,getMessage:g})=>{let c=e.me.id,{accountSettings:I}=e,d={id:uA(U8e(n.key))},B=YU(n);B&&(d.messages=[{message:n}],d.conversationTimestamp=Yr(n.messageTimestamp),jU(n)&&(d.unreadCount=(d.unreadCount||0)+1));let f=Na(n.message);(B||f?.reactionMessage?.key?.fromMe)&&I?.unarchiveChats&&(d.archived=!1,d.readOnly=!1);let Q=f?.protocolMessage;if(Q){let y=new Set([oe.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION,oe.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE,oe.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC,oe.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE]);if(Q.type!==null&&Q.type!==void 0&&y.has(Q.type)&&!n.key.fromMe){r?.warn({msgId:n.key.id,type:Q.type,from:n.key.participant||n.key.remoteJid},"dropping spoofed self-only protocolMessage from non-self origin");return}switch(Q.type){case oe.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION:let m=Q.historySyncNotification,T=t,_=!e.processedHistoryMessages?.length;if(r?.info({histNotification:m,process:T,id:n.key.id,isLatest:_},"got history notification"),T){m.syncType!==oe.HistorySync.HistorySyncType.ON_DEMAND&&i.emit("creds.update",{processedHistoryMessages:[...e.processedHistoryMessages||[],{key:n.key,messageTimestamp:n.messageTimestamp}]});let G=await Cne(m,s,r);G.lidPnMappings?.length&&(r?.debug({count:G.lidPnMappings.length},"processing LID-PN mappings from history sync"),await a.lidMapping.storeLIDPNMappings(G.lidPnMappings).catch(J=>r?.warn({err:J},"failed to store LID-PN mappings from history sync"))),await L8e(G.chats,a,A,r),i.emit("messaging-history.set",{...G,isLatest:m.syncType!==oe.HistorySync.HistorySyncType.ON_DEMAND?_:void 0,chunkOrder:m.chunkOrder,peerDataRequestSessionId:m.peerDataRequestSessionId})}break;case oe.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE:let R=Q.appStateSyncKeyShare.keys;if(R?.length){let G="";await A.transaction(async()=>{let J=[];for(let{keyData:U,keyId:N}of R){let k=Buffer.from(N.keyId).toString("base64");J.push(k),await A.set({"app-state-sync-key":{[k]:U}}),G=k}r?.info({newAppStateSyncKeyId:G,newKeys:J},"injecting new app state sync keys")},c),i.emit("creds.update",{myAppStateKeyId:G})}else r?.info({protocolMsg:Q},"recv app state sync with 0 keys");break;case oe.Message.ProtocolMessage.Type.REVOKE:i.emit("messages.update",[{key:{...n.key,id:Q.key.id},update:{message:null,messageStubType:RA.REVOKE,key:n.key}}]);break;case oe.Message.ProtocolMessage.Type.EPHEMERAL_SETTING:Object.assign(d,{ephemeralSettingTimestamp:Yr(n.messageTimestamp),ephemeralExpiration:Q.ephemeralExpiration||null});break;case oe.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:let K=Q.peerDataOperationRequestResponseMessage;if(K){let G=K.peerDataOperationResult||[];for(let J of G){let U=J?.placeholderMessageResendResponse;if(U?.webMessageInfoBytes)try{let N=oe.WebMessageInfo.decode(U.webMessageInfoBytes),k=N.key?.id,z=k?await o?.get(k):void 0;k&&await o?.del(k);let Ae;z&&typeof z=="object"?(z.message=N.message,N.messageTimestamp&&(z.messageTimestamp=N.messageTimestamp),Ae=z):Ae=N,r?.debug({msgId:k,requestId:K.stanzaId},"received placeholder resend"),i.emit("messages.upsert",{messages:[Ae],type:"notify",requestId:K.stanzaId})}catch(N){r?.warn({err:N,stanzaId:K.stanzaId},"failed to decode placeholder resend response")}}}break;case oe.Message.ProtocolMessage.Type.MESSAGE_EDIT:i.emit("messages.update",[{key:{...n.key,id:Q.key?.id},update:{message:{editedMessage:{message:Q.editedMessage}},messageTimestamp:Q.timestampMs?Math.floor(Yr(Q.timestampMs)/1e3):n.messageTimestamp}}]);break;case oe.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE:let L=Q.memberLabel;L?.label&&i.emit("group.member-tag.update",{groupId:d.id,label:L.label,participant:n.key.participant,participantAlt:n.key.participantAlt,messageTimestamp:Number(n.messageTimestamp)});break;case oe.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC:let F=Q.lidMigrationMappingSyncMessage?.encodedMappingPayload,{pnToLidMappings:q,chatDbMigrationTimestamp:V}=oe.LIDMigrationMappingSyncPayload.decode(F);r?.debug({pnToLidMappings:q,chatDbMigrationTimestamp:V},"got lid mappings and chat db migration timestamp");let x=[];for(let{pn:G,latestLid:J,assignedLid:U}of q){let N=J||U;x.push({lid:`${N}@lid`,pn:`${G}@s.whatsapp.net`})}if(await a.lidMapping.storeLIDPNMappings(x),x.length)for(let{pn:G,lid:J}of x)await a.migrateSession(G,J)}}else if(f?.reactionMessage){let y={...f.reactionMessage,key:n.key};i.emit("messages.reaction",[{reaction:y,key:f.reactionMessage?.key}])}else if(f?.encEventResponseMessage){let y=f.encEventResponseMessage,m=y.eventCreationMessageKey,T=await g(m);if(T)try{let _=uA(c),R=m.participant||m.remoteJid,K=qA(R)?await a.lidMapping.getPNForLID(R):R,L=Bh({remoteJid:uA(K),fromMe:_===K},_),F=Bh(n.key,_),q=T?.messageContextInfo?.messageSecret;if(!q)r?.warn({creationMsgKey:m},"event response: missing messageSecret for decryption");else{let V=H8e(y,{eventEncKey:q,eventCreatorJid:L,eventMsgId:m.id,responderJid:F}),x={eventResponseMessageKey:n.key,senderTimestampMs:V.timestampMs,response:V};i.emit("messages.update",[{key:m,update:{eventResponses:[x]}}])}}catch(_){r?.warn({err:_,creationMsgKey:m},"failed to decrypt event response")}else r?.warn({creationMsgKey:m},"event creation message not found, cannot decrypt response")}else if(n.messageStubType){let y=n.key?.remoteJid,m,T=L=>i.emit("group-participants.update",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participants:m,action:L}),_=L=>{i.emit("groups.update",[{id:y,...L,author:n.key.participant??void 0,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername}])},R=(L,F,q)=>{i.emit("group.join-request",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participant:L.lid,participantPn:L.pn,action:F,method:q})},K=()=>m.find(L=>Rt(c,L.phoneNumber));switch(n.messageStubType){case RA.GROUP_PARTICIPANT_CHANGE_NUMBER:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("modify");break;case RA.GROUP_PARTICIPANT_LEAVE:case RA.GROUP_PARTICIPANT_REMOVE:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("remove"),K()&&(d.readOnly=!0);break;case RA.GROUP_PARTICIPANT_ADD:case RA.GROUP_PARTICIPANT_INVITE:case RA.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],K()&&(d.readOnly=!1),T("add");break;case RA.GROUP_PARTICIPANT_DEMOTE:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("demote");break;case RA.GROUP_PARTICIPANT_PROMOTE:m=n.messageStubParameters.map(z=>JSON.parse(z))||[],T("promote");break;case RA.GROUP_CHANGE_ANNOUNCE:let L=n.messageStubParameters?.[0];_({announce:L==="true"||L==="on"});break;case RA.GROUP_CHANGE_RESTRICT:let F=n.messageStubParameters?.[0];_({restrict:F==="true"||F==="on"});break;case RA.GROUP_CHANGE_SUBJECT:let q=n.messageStubParameters?.[0];d.name=q,_({subject:q});break;case RA.GROUP_CHANGE_DESCRIPTION:let V=n.messageStubParameters?.[0];d.description=V,_({desc:V});break;case RA.GROUP_CHANGE_INVITE_LINK:let x=n.messageStubParameters?.[0];_({inviteCode:x});break;case RA.GROUP_MEMBER_ADD_MODE:let G=n.messageStubParameters?.[0];_({memberAddMode:G==="all_member_add"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:let J=n.messageStubParameters?.[0];_({joinApprovalMode:J==="on"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:let U=JSON.parse(n.messageStubParameters?.[0]),N=n.messageStubParameters?.[1],k=n.messageStubParameters?.[2];R(U,N,k);break}}Object.keys(d).length>1&&i.emit("chats.update",[d])},Vne=K8e;var Y8e=["messaging-history.set","chats.upsert","chats.update","chats.delete","contacts.upsert","contacts.update","messages.upsert","messages.update","messages.delete","messages.reaction","message-receipt.update","groups.update"],j8e=new Set(Y8e),Wne=n=>{let t=new x8e,o=new Set,i=JU(),e=!1,a=null,A=null,r=0,s=1e4,g=3e4;t.on("event",d=>{for(let B in d)t.emit(B,d[B])});function c(){e||(n.debug("Event buffer activated"),e=!0,r=0,a&&clearTimeout(a),a=setTimeout(()=>{e&&(n.warn("Buffer timeout reached, auto-flushing"),I())},g)),r++}function I(){if(!e)return!1;n.debug({bufferCount:r},"Flushing event buffer"),e=!1,r=0,a&&(clearTimeout(a),a=null),A&&(clearTimeout(A),A=null),o.size>s&&(n.debug({cacheSize:o.size},"Clearing history cache"),o.clear());let d=JU(),B=Object.values(i.chatUpdates),f=0;for(let y of B)y.conditional&&(f+=1,d.chatUpdates[y.id]=y,delete i.chatUpdates[y.id]);let Q=q8e(i);return Object.keys(Q).length&&t.emit("event",Q),i=d,n.trace({conditionalChatUpdatesLeft:f},"released buffered events"),!0}return{process(d){let B=async f=>{await d(f)};return t.on("event",B),()=>{t.off("event",B)}},emit(d,B){if(d==="messages.upsert"){let{type:f}=B,Q=Object.values(i.messageUpserts);if(Q.length>0){let y=Q[0].type;y!==f&&(n.debug({bufferedType:y,newType:f},"messages.upsert type mismatch, emitting buffered messages"),t.emit("event",{"messages.upsert":{messages:Q.map(m=>m.message),type:y}}),i.messageUpserts={})}}return e&&j8e.has(d)?(J8e(i,o,d,B,n),!0):t.emit("event",{[d]:B})},isBuffering(){return e},buffer:c,flush:I,createBufferedFunction(d){return async(...B)=>{c();try{let f=await d(...B);return r===1&&setTimeout(()=>{e&&r===1&&I()},100),f}catch(f){throw f}finally{r=Math.max(0,r-1),r===0&&(A||(A=setTimeout(I,100)))}}},on:(...d)=>t.on(...d),off:(...d)=>t.off(...d),removeAllListeners:(...d)=>t.removeAllListeners(...d),destroy(){a&&(clearTimeout(a),a=null),A&&(clearTimeout(A),A=null),o.clear(),i=JU(),e=!1,r=0,t.removeAllListeners(),n.debug("Event buffer destroyed")}}},JU=()=>({historySets:{chats:{},messages:{},contacts:{},isLatest:!1,empty:!0},chatUpserts:{},chatUpdates:{},chatDeletes:new Set,contactUpserts:{},contactUpdates:{},messageUpserts:{},messageUpdates:{},messageReactions:{},messageDeletes:{},messageReceipts:{},groupUpdates:{}});function J8e(n,t,o,i,e){switch(o){case"messaging-history.set":for(let Q of i.chats){let y=Q.id||"",m=n.historySets.chats[y];m&&(m.endOfHistoryTransferType=Q.endOfHistoryTransferType),!m&&!t.has(y)&&(n.historySets.chats[y]=Q,t.add(y),a(Q))}for(let Q of i.contacts){let y=n.historySets.contacts[Q.id];if(y)Object.assign(y,CD(Q));else{let m=`c:${Q.id}`,T=Q.notify||Q.name||Q.verifiedName;(!t.has(m)||T)&&(n.historySets.contacts[Q.id]=Q,t.add(m))}}for(let Q of i.messages){let y=EE(Q.key);!n.historySets.messages[y]&&!t.has(y)&&(n.historySets.messages[y]=Q,t.add(y))}if(n.historySets.empty=!1,n.historySets.syncType=i.syncType,i.pastParticipants?.length){let Q=new Map,y=T=>`${T.userJid||""}:${T.leaveTs||""}:${T.leaveReason||""}`,m=T=>{let _=T.groupJid??JSON.stringify(T),R=Q.get(_);if(!R){Q.set(_,{...T,pastParticipants:[...T.pastParticipants||[]]});return}let K=new Set((R.pastParticipants||[]).map(y));for(let L of T.pastParticipants||[]){let F=y(L);K.has(F)||(R.pastParticipants.push(L),K.add(F))}};for(let T of n.historySets.pastParticipants||[])m(T);for(let T of i.pastParticipants)m(T);n.historySets.pastParticipants=[...Q.values()]}n.historySets.progress=i.progress,n.historySets.chunkOrder=i.chunkOrder,n.historySets.peerDataRequestSessionId=i.peerDataRequestSessionId,n.historySets.isLatest=i.isLatest||n.historySets.isLatest;break;case"chats.upsert":for(let Q of i){let y=Q.id||"",m=n.chatUpserts[y];y&&!m&&(m=n.historySets.chats[y],m&&e.debug({chatId:y},"absorbed chat upsert in chat set")),m?m=Tb(m,Q):(m=Q,n.chatUpserts[y]=m),a(m),n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.update":for(let Q of i){let y=Q.id,m=Q.conditional?Q.conditional(n):!0;if(m){delete Q.conditional;let T=n.historySets.chats[y]||n.chatUpserts[y];if(T)Tb(T,Q);else{let _=n.chatUpdates[y]||{};n.chatUpdates[y]=Tb(_,Q)}}else m===void 0&&(n.chatUpdates[y]=Q);n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.delete":for(let Q of i)n.chatDeletes.has(Q)||n.chatDeletes.add(Q),n.chatUpdates[Q]&&delete n.chatUpdates[Q],n.chatUpserts[Q]&&delete n.chatUpserts[Q],n.historySets.chats[Q]&&delete n.historySets.chats[Q];break;case"contacts.upsert":for(let Q of i){let y=n.contactUpserts[Q.id];y||(y=n.historySets.contacts[Q.id],y&&e.debug({contactId:Q.id},"absorbed contact upsert in contact set")),y?y=Object.assign(y,CD(Q)):(y=Q,n.contactUpserts[Q.id]=y),n.contactUpdates[Q.id]&&(y=Object.assign(n.contactUpdates[Q.id],CD(Q)),delete n.contactUpdates[Q.id])}break;case"contacts.update":let r=i;for(let Q of r){let y=Q.id,m=n.historySets.contacts[y]||n.contactUpserts[y];if(m)Object.assign(m,Q);else{let T=n.contactUpdates[y]||{};n.contactUpdates[y]=Object.assign(T,Q)}}break;case"messages.upsert":let{messages:s,type:g}=i;for(let Q of s){let y=EE(Q.key),m=n.messageUpserts[y]?.message;m||(m=n.historySets.messages[y],m&&e.debug({messageId:y},"absorbed message upsert in message set")),m&&(Q.messageTimestamp=m.messageTimestamp),n.messageUpdates[y]&&(e.debug("absorbed prior message update in message upsert"),Object.assign(Q,n.messageUpdates[y].update),delete n.messageUpdates[y]),n.historySets.messages[y]?n.historySets.messages[y]=Q:n.messageUpserts[y]={message:Q,type:g==="notify"||n.messageUpserts[y]?.type==="notify"?"notify":g}}break;case"messages.update":let c=i;for(let{key:Q,update:y}of c){let m=EE(Q),T=n.historySets.messages[m]||n.messageUpserts[m]?.message;if(T)Object.assign(T,y),y.status===lh.READ&&!Q.fromMe&&A(T);else{let _=n.messageUpdates[m]||{key:Q,update:{}};Object.assign(_.update,y),n.messageUpdates[m]=_}}break;case"messages.delete":let I=i;if("keys"in I){let{keys:Q}=I;for(let y of Q){let m=EE(y);n.messageDeletes[m]||(n.messageDeletes[m]=y),n.messageUpserts[m]&&delete n.messageUpserts[m],n.messageUpdates[m]&&delete n.messageUpdates[m]}}break;case"messages.reaction":let d=i;for(let{key:Q,reaction:y}of d){let m=EE(Q),T=n.messageUpserts[m];T?dU(T.message,y):(n.messageReactions[m]=n.messageReactions[m]||{key:Q,reactions:[]},dU(n.messageReactions[m],y))}break;case"message-receipt.update":let B=i;for(let{key:Q,receipt:y}of B){let m=EE(Q),T=n.messageUpserts[m];T?pU(T.message,y):(n.messageReceipts[m]=n.messageReceipts[m]||{key:Q,userReceipt:[]},pU(n.messageReceipts[m],y))}break;case"groups.update":let f=i;for(let Q of f){let y=Q.id,m=n.groupUpdates[y]||{};n.groupUpdates[y]||(n.groupUpdates[y]=Object.assign(m,Q))}break;default:throw new Error(`"${o}" cannot be buffered`)}function a(r){let s=r.id||"",g=n.chatUpdates[s];if(g){let c=g.conditional?g.conditional(n):!0;c?(delete g.conditional,e.debug({chatId:s},"absorbed chat update in existing chat"),Object.assign(r,Tb(g,r)),delete n.chatUpdates[s]):c===!1&&(e.debug({chatId:s},"chat update condition fail, removing"),delete n.chatUpdates[s])}}function A(r){let s=r.key.remoteJid,g=n.chatUpdates[s]||n.chatUpserts[s];YU(r)&&jU(r)&&typeof g?.unreadCount=="number"&&g.unreadCount>0&&(e.debug({chatId:g.id},"decrementing chat counter"),g.unreadCount-=1,g.unreadCount===0&&delete g.unreadCount)}}function q8e(n){let t={};n.historySets.empty||(t["messaging-history.set"]={chats:Object.values(n.historySets.chats),messages:Object.values(n.historySets.messages),contacts:Object.values(n.historySets.contacts),pastParticipants:n.historySets.pastParticipants,syncType:n.historySets.syncType,progress:n.historySets.progress,isLatest:n.historySets.isLatest,chunkOrder:n.historySets.chunkOrder,peerDataRequestSessionId:n.historySets.peerDataRequestSessionId});let o=Object.values(n.chatUpserts);o.length&&(t["chats.upsert"]=o);let i=Object.values(n.chatUpdates);i.length&&(t["chats.update"]=i);let e=Array.from(n.chatDeletes);e.length&&(t["chats.delete"]=e);let a=Object.values(n.messageUpserts);if(a.length){let B=a[0].type;t["messages.upsert"]={messages:a.map(f=>f.message),type:B}}let A=Object.values(n.messageUpdates);A.length&&(t["messages.update"]=A);let r=Object.values(n.messageDeletes);r.length&&(t["messages.delete"]={keys:r});let s=Object.values(n.messageReactions).flatMap(({key:B,reactions:f})=>f.flatMap(Q=>({key:B,reaction:Q})));s.length&&(t["messages.reaction"]=s);let g=Object.values(n.messageReceipts).flatMap(({key:B,userReceipt:f})=>f.flatMap(Q=>({key:B,receipt:Q})));g.length&&(t["message-receipt.update"]=g);let c=Object.values(n.contactUpserts);c.length&&(t["contacts.upsert"]=c);let I=Object.values(n.contactUpdates);I.length&&(t["contacts.update"]=I);let d=Object.values(n.groupUpdates);return d.length&&(t["groups.update"]=d),t}function Tb(n,t){return t.unreadCount===null&&n.unreadCount<0&&(n.unreadCount=void 0,t.unreadCount=void 0),typeof n.unreadCount=="number"&&typeof t.unreadCount=="number"&&(t={...t},t.unreadCount>=0&&(t.unreadCount=Math.max(t.unreadCount,0)+Math.max(n.unreadCount,0))),Object.assign(n,t)}var EE=n=>`${n.remoteJid},${n.id},${n.fromMe?"1":"0"}`;var z8e=512,qU="\0",Zne=3600*1e3,V8e=3e3,Ac;(function(n){n[n.UnknownError=0]="UnknownError",n[n.SignalErrorNoSession=1]="SignalErrorNoSession",n[n.SignalErrorInvalidKey=2]="SignalErrorInvalidKey",n[n.SignalErrorInvalidKeyId=3]="SignalErrorInvalidKeyId",n[n.SignalErrorInvalidMessage=4]="SignalErrorInvalidMessage",n[n.SignalErrorInvalidSignature=5]="SignalErrorInvalidSignature",n[n.SignalErrorFutureMessage=6]="SignalErrorFutureMessage",n[n.SignalErrorBadMac=7]="SignalErrorBadMac",n[n.SignalErrorInvalidSession=8]="SignalErrorInvalidSession",n[n.SignalErrorInvalidMsgKey=9]="SignalErrorInvalidMsgKey",n[n.BadBroadcastEphemeralSetting=10]="BadBroadcastEphemeralSetting",n[n.UnknownCompanionNoPrekey=11]="UnknownCompanionNoPrekey",n[n.AdvFailure=12]="AdvFailure",n[n.StatusRevokeDelay=13]="StatusRevokeDelay"})(Ac||(Ac={}));var Xne=new Set([Ac.SignalErrorInvalidMessage,Ac.SignalErrorBadMac]),Nb=class{constructor(t,o){this.logger=t,this.recentMessagesMap=new Gg({max:z8e,ttl:300*1e3,ttlAutopurge:!0,dispose:(i,e)=>{let a=e.lastIndexOf(qU);if(a>-1){let A=e.slice(a+qU.length);this.messageKeyIndex.delete(A)}}}),this.messageKeyIndex=new Map,this.sessionRecreateHistory=new Gg({ttl:Zne*2,ttlAutopurge:!0}),this.retryCounters=new Gg({ttl:900*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),this.baseKeys=new Gg({max:1024,ttl:900*1e3,ttlAutopurge:!0}),this.pendingPhoneRequests={},this.maxMsgRetryCount=5,this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0},this.maxMsgRetryCount=o}addRecentMessage(t,o,i){let e={to:t,id:o},a=this.keyToString(e);this.recentMessagesMap.set(a,{message:i,timestamp:Date.now()}),this.messageKeyIndex.set(o,a),this.logger.debug(`Added message to retry cache: ${t}/${o}`)}getRecentMessage(t,o){let i={to:t,id:o},e=this.keyToString(i);return this.recentMessagesMap.get(e)}shouldRecreateSession(t,o,i){if(!o)return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,{reason:"we don't have a Signal session with them",recreate:!0};if(i!==void 0&&Xne.has(i))return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,this.logger.warn({jid:t,errorCode:Ac[i]},"MAC error detected, forcing immediate session recreation"),{reason:`MAC error (code ${i}: ${Ac[i]}), immediate session recreation`,recreate:!0};let e=Date.now(),a=this.sessionRecreateHistory.get(t);return!a||e-a>Zne?(this.sessionRecreateHistory.set(t,e),this.statistics.sessionRecreations++,{reason:"retry count > 1 and over an hour since last recreation",recreate:!0}):{reason:"",recreate:!1}}parseRetryErrorCode(t){if(t===void 0||t==="")return;let o=parseInt(t,10);if(!Number.isNaN(o))return o>=Ac.UnknownError&&o<=Ac.StatusRevokeDelay?o:Ac.UnknownError}isMacError(t){return t!==void 0&&Xne.has(t)}incrementRetryCount(t){return this.retryCounters.set(t,(this.retryCounters.get(t)||0)+1),this.statistics.totalRetries++,this.retryCounters.get(t)}getRetryCount(t){return this.retryCounters.get(t)||0}hasExceededMaxRetries(t){return this.getRetryCount(t)>=this.maxMsgRetryCount}markRetrySuccess(t){this.statistics.successfulRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}markRetryFailed(t){this.statistics.failedRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}schedulePhoneRequest(t,o,i=V8e){this.cancelPendingPhoneRequest(t),this.pendingPhoneRequests[t]=setTimeout(()=>{delete this.pendingPhoneRequests[t],this.statistics.phoneRequests++,o()},i),this.logger.debug(`Scheduled phone request for message ${t} with ${i}ms delay`)}cancelPendingPhoneRequest(t){let o=this.pendingPhoneRequests[t];o&&(clearTimeout(o),delete this.pendingPhoneRequests[t],this.logger.debug(`Cancelled pending phone request for message ${t}`))}clear(){this.recentMessagesMap.clear(),this.messageKeyIndex.clear(),this.sessionRecreateHistory.clear(),this.retryCounters.clear(),this.baseKeys.clear();for(let t of Object.keys(this.pendingPhoneRequests))this.cancelPendingPhoneRequest(t);this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0}}saveBaseKey(t,o,i){this.baseKeys.set(`${t}:${o}`,i)}hasSameBaseKey(t,o,i){let e=this.baseKeys.get(`${t}:${o}`);if(!e||e.length!==i.length)return!1;for(let a=0;a["Ubuntu",n,"22.04.4"],macOS:n=>["Mac OS",n,"14.4.1"],baileys:n=>["Baileys",n,"6.5.0"],windows:n=>["Windows",n,"10.0.22631"],android:n=>[n,"Android",""],appropriate:n=>[X8e[W8e()]||"Ubuntu",n,Z8e()]};var Yn;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.CHROME=1]="CHROME",n[n.EDGE=2]="EDGE",n[n.FIREFOX=3]="FIREFOX",n[n.IE=4]="IE",n[n.OPERA=5]="OPERA",n[n.SAFARI=6]="SAFARI",n[n.ELECTRON=7]="ELECTRON",n[n.UWP=8]="UWP",n[n.OTHER_WEB_CLIENT=9]="OTHER_WEB_CLIENT"})(Yn||(Yn={}));var $8e={Chrome:Yn.CHROME,Edge:Yn.EDGE,Firefox:Yn.FIREFOX,IE:Yn.IE,Opera:Yn.OPERA,Safari:Yn.SAFARI},eze=([n,t])=>t==="Desktop"?n==="Windows"?Yn.UWP:Yn.ELECTRON:$8e[t]||Yn.OTHER_WEB_CLIENT,zU=n=>eze(n).toString(),$ne=(n,t,o,i,e)=>"https://wa.me/settings/linked_devices#"+[n,t,o,i,zU(e)].join(",");async function ese(n,t){let o=n.attrs.from;if(!o)return{action:"invalid_notification"};if(!le(n,"identity"))return{action:"no_identity_node"};t.logger.info({jid:o},"identity changed");let e=fA(o);if(e?.device&&e.device!==0)return t.logger.debug({jid:o,device:e.device},"ignoring identity change from companion device"),{action:"skipped_companion_device",device:e.device};if(t.meId&&(Rt(o,t.meId)||t.meLid&&Rt(o,t.meLid)))return t.logger.info({jid:o},"self primary identity changed"),{action:"skipped_self_primary"};if(t.debounceCache.get(o))return t.logger.debug({jid:o},"skipping identity assert (debounced)"),{action:"debounced"};t.debounceCache.set(o,!0);let A=!L7(n.attrs.offline);if(!(await t.validateSession(o)).exists)return t.logger.debug({jid:o},"no old session, skipping session refresh"),{action:"skipped_no_session"};if(t.logger.debug({jid:o},"old session exists, will refresh session"),A)return t.logger.debug({jid:o},"skipping session refresh during offline processing"),{action:"skipped_offline"};t.onBeforeSessionRefresh?.(o);try{return await t.assertSessions([o],!0),{action:"session_refreshed"}}catch(s){return t.logger.warn({error:s,jid:o},"failed to assert sessions after identity change"),{action:"session_refresh_failed",error:s}}}function Ase(n,t,o){let{tag:i,attrs:e}=n,a={tag:"ack",attrs:{id:e.id,to:e.from,class:i}};return t&&(a.attrs.error=t.toString()),e.participant&&(a.attrs.participant=e.participant),e.recipient&&(a.attrs.recipient=e.recipient),e.type&&(a.attrs.type=e.type),i==="message"&&o&&(a.attrs.from=o),a}function Aze(n){return n===null||n===""}function tze(n){return n>2147483647||n<-2147483648?n&4294967295:n}function tse(n){let t=0;if(!Aze(n))for(let o=0;oo.iteration===t)}addSenderMessageKey(t){this.senderKeyStateStructure.senderMessageKeys.push({iteration:t.getIteration(),seed:t.getSeed()}),this.senderKeyStateStructure.senderMessageKeys.length>this.MAX_MESSAGE_KEYS&&this.senderKeyStateStructure.senderMessageKeys.shift()}removeSenderMessageKey(t){let o=this.senderKeyStateStructure.senderMessageKeys.findIndex(i=>i.iteration===t);if(o!==-1){let i=this.senderKeyStateStructure.senderMessageKeys[o];return this.senderKeyStateStructure.senderMessageKeys.splice(o,1),new cp(i.iteration,i.seed)}return null}getStructure(){return this.senderKeyStateStructure}};var tc=class n{constructor(t){if(this.MAX_STATES=5,this.senderKeyStates=[],t)for(let o of t)this.senderKeyStates.push(new Ip(null,null,null,null,null,null,o))}isEmpty(){return this.senderKeyStates.length===0}getSenderKeyState(t){return t===void 0&&this.senderKeyStates.length?this.senderKeyStates[this.senderKeyStates.length-1]:this.senderKeyStates.find(o=>o.getKeyId()===t)}addSenderKeyState(t,o,i,e){this.senderKeyStates.push(new Ip(t,o,i,null,e)),this.senderKeyStates.length>this.MAX_STATES&&this.senderKeyStates.shift()}setSenderKeyState(t,o,i,e){this.senderKeyStates.length=0,this.senderKeyStates.push(new Ip(t,o,i,e))}serialize(){return this.senderKeyStates.map(t=>t.getStructure())}static deserialize(t){let o=Buffer.from(t).toString("utf-8"),i=JSON.parse(o,RB.reviver);return new n(i)}};var ise=qe(xc(),1);import*as kb from"crypto";function ose(){return kb.randomBytes(32)}function nse(){return kb.randomInt(2147483647)}function sse(n){return n||(n=(0,ise.generateKeyPair)()),{public:Buffer.from(n.pubKey),private:Buffer.from(n.privKey)}}var lp=class{constructor(){this.UNSUPPORTED_VERSION=1,this.CURRENT_VERSION=3,this.WHISPER_TYPE=2,this.PREKEY_TYPE=3,this.SENDERKEY_TYPE=4,this.SENDERKEY_DISTRIBUTION_TYPE=5,this.ENCRYPTED_MESSAGE_OVERHEAD=53}};var pp=class extends lp{constructor(t,o,i,e,a){if(super(),a)try{let A=a.slice(1),r=oe.SenderKeyDistributionMessage.decode(A).toJSON();this.serialized=a,this.id=r.id,this.iteration=r.iteration,this.chainKey=typeof r.chainKey=="string"?Buffer.from(r.chainKey,"base64"):r.chainKey,this.signatureKey=typeof r.signingKey=="string"?Buffer.from(r.signingKey,"base64"):r.signingKey}catch(A){throw new Error(String(A))}else{let A=this.intsToByteHighAndLow(this.CURRENT_VERSION,this.CURRENT_VERSION);this.id=t,this.iteration=o,this.chainKey=i,this.signatureKey=e;let r=oe.SenderKeyDistributionMessage.encode(oe.SenderKeyDistributionMessage.create({id:t,iteration:o,chainKey:i,signingKey:this.signatureKey})).finish();this.serialized=Buffer.concat([Buffer.from([A]),r])}}intsToByteHighAndLow(t,o){return((t<<4|o)&255)%256}serialize(){return this.serialized}getType(){return this.SENDERKEY_DISTRIBUTION_TYPE}getIteration(){return this.iteration}getChainKey(){return this.chainKey}getSignatureKey(){return this.signatureKey}getId(){return this.id}};var CE=class{constructor(t){this.senderKeyStore=t}async process(t,o){let i=await this.senderKeyStore.loadSenderKey(t);i.addSenderKeyState(o.getId(),o.getIteration(),o.getChainKey(),o.getSignatureKey()),await this.senderKeyStore.storeSenderKey(t,i)}async create(t){let o=await this.senderKeyStore.loadSenderKey(t);if(o.isEmpty()){let e=nse(),a=ose(),A=sse();o.setSenderKeyState(e,0,a,A),await this.senderKeyStore.storeSenderKey(t,o)}let i=o.getSenderKeyState();if(!i)throw new Error("No session state available");return new pp(i.getKeyId(),i.getSenderChainKey().getIteration(),i.getSenderChainKey().getSeed(),i.getSigningKeyPublic())}};var Pb=qe(Nl(),1);var vb=qe(xc(),1);var uE=class extends lp{constructor(t,o,i,e,a){if(super(),this.SIGNATURE_LENGTH=64,a){let A=a[0],r=a.slice(1,a.length-this.SIGNATURE_LENGTH),s=a.slice(-1*this.SIGNATURE_LENGTH),g=oe.SenderKeyMessage.decode(r).toJSON();this.serialized=a,this.messageVersion=(A&255)>>4,this.keyId=g.id,this.iteration=g.iteration,this.ciphertext=typeof g.ciphertext=="string"?Buffer.from(g.ciphertext,"base64"):g.ciphertext,this.signature=s}else{let A=((this.CURRENT_VERSION<<4|this.CURRENT_VERSION)&255)%256,r=Buffer.from(i),s=oe.SenderKeyMessage.encode(oe.SenderKeyMessage.create({id:t,iteration:o,ciphertext:r})).finish(),g=this.getSignature(e,Buffer.concat([Buffer.from([A]),s]));this.serialized=Buffer.concat([Buffer.from([A]),s,Buffer.from(g)]),this.messageVersion=this.CURRENT_VERSION,this.keyId=t,this.iteration=o,this.ciphertext=r,this.signature=g}}getKeyId(){return this.keyId}getIteration(){return this.iteration}getCipherText(){return this.ciphertext}verifySignature(t){let o=this.serialized.slice(0,this.serialized.length-this.SIGNATURE_LENGTH),i=this.serialized.slice(-1*this.SIGNATURE_LENGTH);if(!(0,vb.verifySignature)(t,o,i))throw new Error("Invalid signature!")}getSignature(t,o){return Buffer.from((0,vb.calculateSignature)(t,o))}serialize(){return this.serialized}getType(){return 4}};var BE=class{constructor(t,o){this.senderKeyStore=t,this.senderKeyName=o}async encrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for encryption");let i=o.getSenderKeyState();if(!i)throw new Error("No session to encrypt message");let e=i.getSenderChainKey().getIteration(),a=this.getSenderKey(i,e===0?0:e+1),A=await this.getCipherText(a.getIv(),a.getCipherKey(),t),r=new uE(i.getKeyId(),a.getIteration(),A,i.getSigningKeyPrivate());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),r.serialize()}async decrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for decryption");let i=new uE(null,null,null,null,t),e=o.getSenderKeyState(i.getKeyId());if(!e)throw new Error("No session found to decrypt message");i.verifySignature(e.getSigningKeyPublic());let a=this.getSenderKey(e,i.getIteration()),A=await this.getPlainText(a.getIv(),a.getCipherKey(),i.getCipherText());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),A}getSenderKey(t,o){let i=t.getSenderChainKey();if(i.getIteration()>o){if(t.hasSenderMessageKey(o)){let e=t.removeSenderMessageKey(o);if(!e)throw new Error("No sender message key found for iteration");return e}throw new Error(`Received message with old counter: ${i.getIteration()}, ${o}`)}if(o-i.getIteration()>2e3)throw new Error("Over 2000 messages into the future!");for(;i.getIteration()0){let r=[...i];this.logger.trace(`Batch fetching ${r.length} LID mappings from database`);let s=await this.keys.get("lid-mapping",r);for(let g of r){let c=s[g];c&&(e.set(g,c),this.mappingCache.set(`pn:${g}`,c),this.mappingCache.set(`lid:${c}`,g))}}let a={};for(let{pnUser:r,lidUser:s}of o){if(e.get(r)===s){this.logger.debug({pnUser:r,lidUser:s},"LID mapping already exists, skipping");continue}a[r]=s}if(Object.keys(a).length===0)return;this.logger.trace({pairMap:a},`Storing ${Object.keys(a).length} pn mappings`);let A={};for(let[r,s]of Object.entries(a))A[r]=s,A[`${s}_reverse`]=r;await this.keys.transaction(async()=>{await this.keys.set({"lid-mapping":A})},"lid-mapping");for(let[r,s]of Object.entries(a))this.mappingCache.set(`pn:${r}`,s),this.mappingCache.set(`lid:${s}`,r)}async getLIDForPN(t){return(await this.getLIDsForPNs([t]))?.[0]?.lid||null}async getLIDsForPNs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),i=o.join(","),e=this.inflightLIDLookups.get(i);if(e)return this.logger.trace(`Coalescing getLIDsForPNs request for ${o.length} PNs`),e;let a=this._getLIDsForPNsImpl(t);this.inflightLIDLookups.set(i,a);try{return await a}finally{this.inflightLIDLookups.delete(i)}}async _getLIDsForPNsImpl(t){let o={},i={},e=[],a=(A,r,s)=>{let g=s.toString();if(!g)return this.logger.warn(`Invalid or empty LID user for PN ${A}: lidUser = "${s}"`),!1;let c=r.device!==void 0?r.device:0,I=`${g}${c?`:${c}`:""}@${r.server==="hosted"?"hosted.lid":"lid"}`;return this.logger.trace(`getLIDForPN: ${A} \u2192 ${I} (user mapping with device ${c})`),i[A]={lid:I,pn:A},!0};for(let A of t){if(!_t(A)&&!mr(A))continue;let r=fA(A);if(!r)continue;let s=r.user,g=this.mappingCache.get(`pn:${s}`);if(g&&typeof g=="string"){if(!a(A,r,g)){this.logger.warn(`Invalid entry for ${A} (pair not resolved)`);continue}continue}e.push({pn:A,pnUser:s,decoded:r})}if(e.length){let A=[...new Set(e.map(s=>s.pnUser))],r=await this.keys.get("lid-mapping",A);for(let s of A){let g=r[s];g&&typeof g=="string"&&(this.mappingCache.set(`pn:${s}`,g),this.mappingCache.set(`lid:${g}`,s))}for(let{pn:s,pnUser:g,decoded:c}of e){let I=this.mappingCache.get(`pn:${g}`);if(I&&typeof I=="string"){if(!a(s,c,I)){this.logger.warn(`Invalid entry for ${s} (pair not resolved)`);continue}}else{this.logger.trace(`No LID mapping found for PN user ${g}; batch getting from USync`);let d=c.device||0,B=uA(s);mr(B)&&(B=`${g}@s.whatsapp.net`),o[B]?o[B]?.push(d):o[B]=[d]}}}if(Object.keys(o).length>0){let A=await this.pnToLIDFunc?.(Object.keys(o));if(A&&A.length>0){await this.storeLIDPNMappings(A);for(let r of A){let g=fA(r.pn)?.user;if(!g)continue;let c=fA(r.lid)?.user;if(c)for(let I of o[r.pn]){let d=`${c}${I?`:${I}`:""}@${I===99?"hosted.lid":"lid"}`;this.logger.trace(`getLIDForPN: USYNC success for ${r.pn} \u2192 ${d} (user mapping with device ${I})`);let B=`${g}${I?`:${I}`:""}@${I===99?"hosted":"s.whatsapp.net"}`;i[B]={lid:d,pn:B}}}}else this.logger.warn("USync fetch yielded no results for pending PNs")}return Object.values(i).length>0?Object.values(i):null}async getPNForLID(t){return(await this.getPNsForLIDs([t]))?.[0]?.pn||null}async getPNsForLIDs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),i=o.join(","),e=this.inflightPNLookups.get(i);if(e)return this.logger.trace(`Coalescing getPNsForLIDs request for ${o.length} LIDs`),e;let a=this._getPNsForLIDsImpl(t);this.inflightPNLookups.set(i,a);try{return await a}finally{this.inflightPNLookups.delete(i)}}async _getPNsForLIDsImpl(t){let o={},i=[],e=(a,A,r)=>{if(!r||typeof r!="string")return!1;let s=A.device!==void 0?A.device:0,g=`${r}:${s}@${A.domainType===Jt.HOSTED_LID?"hosted":"s.whatsapp.net"}`;return this.logger.trace(`Found reverse mapping: ${a} \u2192 ${g}`),o[a]={lid:a,pn:g},!0};for(let a of t){if(!qA(a))continue;let A=fA(a);if(!A)continue;let r=A.user,s=this.mappingCache.get(`lid:${r}`);if(s&&typeof s=="string"){e(a,A,s);continue}i.push({lid:a,lidUser:r,decoded:A})}if(i.length){let a=[...new Set(i.map(r=>`${r.lidUser}_reverse`))],A=await this.keys.get("lid-mapping",a);for(let{lid:r,lidUser:s,decoded:g}of i){let c=this.mappingCache.get(`lid:${s}`);(!c||typeof c!="string")&&(c=A[`${s}_reverse`],c&&typeof c=="string"&&(this.mappingCache.set(`lid:${s}`,c),this.mappingCache.set(`pn:${c}`,s))),c&&typeof c=="string"?e(r,g,c):this.logger.trace(`No reverse mapping found for LID user: ${s}`)}}return Object.values(o).length?Object.values(o):null}close(){this.mappingCache.clear()}};function rze(n){try{if(!n||n.length<2||(n[0]&15)!==3)return;let o=cse.PreKeyWhisperMessage.decode(n.slice(1));return o.identityKey?.length===33?new Uint8Array(o.identityKey):void 0}catch{return}}function Ise(n,t,o){let i=new Gb(n.keys,t,o),e=aze(n,i),a=n.keys,A=new Gg({ttl:4320*60*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),r=async(g,c)=>{let I=Fb(g,c),d=I.toString(),{[d]:B}=await n.keys.get("sender-key",[d]);B||await e.storeSenderKey(I,new tc);let f=await new CE(e).create(I);return{senderName:I,skdm:f}};return{decryptGroupMessage({group:g,authorJid:c,msg:I}){let d=Fb(g,c),B=new BE(e,d);return a.transaction(async()=>B.decrypt(I),g)},async processSenderKeyDistributionMessage({item:g,authorJid:c}){let I=new CE(e);if(!g.groupId)throw new Error("Group ID is required for sender key distribution message");let d=Fb(g.groupId,c),B=new pp(null,null,null,null,g.axolotlSenderKeyDistributionMessage),f=d.toString(),{[f]:Q}=await n.keys.get("sender-key",[f]);return Q||await e.storeSenderKey(d,new tc),a.transaction(async()=>{let{[f]:y}=await n.keys.get("sender-key",[f]);y||await e.storeSenderKey(d,new tc),await I.process(d,B)},g.groupId)},async decryptMessage({jid:g,type:c,ciphertext:I}){let d=jn(g),B=new $s.SessionCipher(e,d);if(c==="pkmsg"){let Q=rze(I);if(Q){let y=d.toString();await e.saveIdentity(y,Q)&&t.info({jid:g,addr:y},"identity key changed or new contact, session will be re-established")}}async function f(){let Q;switch(c){case"pkmsg":Q=await B.decryptPreKeyWhisperMessage(I);break;case"msg":Q=await B.decryptWhisperMessage(I);break}return Q}return a.transaction(async()=>await f(),g)},async encryptMessage({jid:g,data:c}){let I=jn(g),d=new $s.SessionCipher(e,I);return a.transaction(async()=>{let{type:B,body:f}=await d.encrypt(c);return{type:B===3?"pkmsg":"msg",ciphertext:Buffer.from(f,"binary")}},g)},async encryptGroupMessage({group:g,meId:c,data:I}){return a.transaction(async()=>{let{senderName:d,skdm:B}=await r(g,c);return{ciphertext:await new BE(e,d).encrypt(I),senderKeyDistributionMessage:B.serialize()}},g)},async getSenderKeyDistributionMessage({group:g,meId:c}){return a.transaction(async()=>{let{skdm:I}=await r(g,c);return I.serialize()},g)},async hasSenderKey({group:g,meId:c}){let I=Fb(g,c).toString(),{[I]:d}=await n.keys.get("sender-key",[I]);return!!d},async getSessionInfo(g){let c=jn(g).toString(),I=await e.loadSession(c);if(!I)return null;let d=I.getOpenSession?.(),B=d?.indexInfo?.baseKey,f=d?.registrationId;return!B||typeof f!="number"?null:{baseKey:new Uint8Array(B),registrationId:f}},async injectE2ESession({jid:g,session:c}){t.trace({jid:g},"injecting E2EE session");let I=new $s.SessionBuilder(e,jn(g));return a.transaction(async()=>{await I.initOutgoing(c)},g)},jidToSignalProtocolAddress(g){return jn(g).toString()},lidMapping:i,async validateSession(g){try{let c=jn(g),I=await e.loadSession(c.toString());return I?I.haveOpenSession()?{exists:!0}:{exists:!1,reason:"no open session"}:{exists:!1,reason:"no session"}}catch{return{exists:!1,reason:"validation error"}}},async deleteSession(g){if(!g.length)return;let c={};return g.forEach(I=>{let d=jn(I);c[d.toString()]=null}),a.transaction(async()=>{await n.keys.set({session:c})},`delete-${g.length}-sessions`)},close(){A.clear(),i.close()},async migrateSession(g,c){if(!g||!qA(c)&&!Ia(c))return{migrated:0,skipped:0,total:0};if(!_t(g)&&!mr(g))return{migrated:0,skipped:0,total:1};let{user:I}=fA(g);t.debug({fromJid:g},"bulk device migration - loading all user devices");let{[I]:d}=await a.get("device-list",[I]);if(!d)return{migrated:0,skipped:0,total:0};let{device:B}=fA(g),f=B?.toString()||"0";d.includes(f)||d.push(f);let y=d.filter(_=>{let R=`${I}.${_}`;return!A.has(R)}).map(_=>`${I}.${_}`),m=await a.get("session",y),T=[];for(let[_,R]of Object.entries(m))if(R){let K=_.split(".")[1];if(!K)continue;let L=parseInt(K),F=L===0?`${I}@s.whatsapp.net`:`${I}:${L}@s.whatsapp.net`;L===99&&(F=`${I}:99@hosted`),T.push(F)}return t.debug({fromJid:g,totalDevices:d.length,devicesWithSessions:T.length,devices:T},"bulk device migration complete - all user devices processed"),a.transaction(async()=>{let _=T.map(x=>{let G=s7(x,c),J=fA(x),U=fA(G);return{fromJid:x,toJid:G,pnUser:J.user,lidUser:U.user,deviceId:J.device||0,fromAddr:jn(x),toAddr:jn(G)}}),R=_.length,K=0,L=Array.from(new Set(_.map(x=>x.fromAddr.toString()))),F=await a.get("session",L),q={};for(let x of _){let G=x.fromAddr.toString(),J=x.toAddr.toString(),U=F[G];if(U){let N=$s.SessionRecord.deserialize(U);N.haveOpenSession()&&(q[J]=N.serialize(),q[G]=null,K++)}}if(Object.keys(q).length>0){await a.set({session:q}),t.debug({migratedSessions:K},"bulk session migration complete");for(let x of _)if(q[x.toAddr.toString()]){let G=`${x.pnUser}.${x.deviceId}`;A.set(G,!0)}}let V=R-K;return{migrated:K,skipped:V,total:R}},`migrate-${T.length}-sessions-${fA(c)?.user}`)}}}var jn=n=>{let t=fA(n),{user:o,device:i,server:e,domainType:a}=t;if(!o)throw new Error(`JID decoded but user is empty: "${n}" -> user: "${o}", server: "${e}", device: ${i}`);let A=a!==Jt.WHATSAPP?`${o}_${a}`:o,r=i||0;if(i===99&&t.server!=="hosted"&&t.server!=="hosted.lid")throw new Error("Unexpected non-hosted device JID with device 99. This ID seems invalid. ID:"+n);return new $s.ProtocolAddress(A,r)},Fb=(n,t)=>new Uf(n,jn(t));function aze({creds:n,keys:t},o){let i=async e=>{if(e.includes(".")){let[a,A]=e.split("."),[r,s]=a.split("_"),g=parseInt(s||"0");if(g===Jt.LID||g===Jt.HOSTED_LID)return e;let c=`${r}${A!=="0"?`:${A}`:""}@${g===Jt.HOSTED?"hosted":"s.whatsapp.net"}`,I=await o.getLIDForPN(c);if(I)return jn(I).toString()}return e};return{loadSession:async e=>{try{let a=await i(e),{[a]:A}=await t.get("session",[a]);if(A)return $s.SessionRecord.deserialize(A)}catch{return null}return null},storeSession:async(e,a)=>{let A=await i(e);await t.set({session:{[A]:a.serialize()}})},isTrustedIdentity:()=>!0,loadIdentityKey:async e=>{let a=await i(e),{[a]:A}=await t.get("identity-key",[a]);return A||void 0},saveIdentity:async(e,a)=>{let A=await i(e),{[A]:r}=await t.get("identity-key",[A]),s=r?.length===a.length&&r.every((g,c)=>g===a[c]);return r&&!s?(await t.set({session:{[A]:null},"identity-key":{[A]:a}}),!0):r?!1:(await t.set({"identity-key":{[A]:a}}),!0)},loadPreKey:async e=>{let a=e.toString(),{[a]:A}=await t.get("pre-key",[a]);if(A)return{privKey:Buffer.from(A.private),pubKey:Buffer.from(A.public)}},removePreKey:e=>t.set({"pre-key":{[e]:null}}),loadSignedPreKey:()=>{let e=n.signedPreKey;return{privKey:Buffer.from(e.keyPair.private),pubKey:Buffer.from(e.keyPair.public)}},loadSenderKey:async e=>{let a=e.toString(),{[a]:A}=await t.get("sender-key",[a]);return A?tc.deserialize(A):new tc},storeSenderKey:async(e,a)=>{let A=e.toString(),r=JSON.stringify(a.serialize());await t.set({"sender-key":{[A]:Buffer.from(r,"utf-8")}})},getOurRegistrationId:()=>n.registrationId,getOurIdentity:()=>{let{signedIdentityKey:e}=n;return{privKey:Buffer.from(e.private),pubKey:Buffer.from(Vo(e.public))}}}}var pce=qe(lce(),1),Jf=(0,pce.default)({timestamp:()=>`,"time":"${new Date().toJSON()}"`});var R5e=[2,3e3,1043857760];var Mf="https://web.whatsapp.com",Woe="https://call.whatsapp.com/video/",Zoe="https://call.whatsapp.com/voice/",SE="CB:",dce="TAG:";var cne=Buffer.from([6,0]),Ine=Buffer.from([6,1]),BU=Buffer.from([6,5]),lvA=Buffer.from([6,6]),Nf=10080*60,hce=1440*60,Ece=336*60*60,Ene="Noise_XX_25519_AESGCM_SHA256\0\0\0\0",k5e=3,Hg=Buffer.from([5]),Cce=Buffer.from([87,65,6,k5e]),Xoe=/https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g,QU={SERIAL:0,ISSUER:"WhatsAppLongTerm1",PUBLIC_KEY:Buffer.from("142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b","hex")},qf=[oe.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,oe.HistorySync.HistorySyncType.PUSH_NAME,oe.HistorySync.HistorySyncType.RECENT,oe.HistorySync.HistorySyncType.FULL,oe.HistorySync.HistorySyncType.ON_DEMAND,oe.HistorySync.HistorySyncType.NON_BLOCKING_DATA,oe.HistorySync.HistorySyncType.INITIAL_STATUS_V3],mI={SIGNAL_STORE:300,MSG_RETRY:3600,CALL_OFFER:300,USER_DEVICES:300},uce={version:R5e,browser:Rb.macOS("Chrome"),waWebSocketUrl:"wss://web.whatsapp.com/ws/chat",connectTimeoutMs:2e4,keepAliveIntervalMs:3e4,logger:Jf.child({class:"baileys"}),emitOwnEvents:!0,defaultQueryTimeoutMs:6e4,customUploadHosts:[],retryRequestDelayMs:250,maxMsgRetryCount:5,fireInitQueries:!0,auth:void 0,markOnlineOnConnect:!0,syncFullHistory:!0,patchMessageBeforeSending:n=>n,shouldSyncHistoryMessage:({syncType:n})=>n!==oe.HistorySync.HistorySyncType.FULL,shouldIgnoreJid:()=>!1,linkPreviewImageThumbnailWidth:192,transactionOpts:{maxCommitRetries:10,delayBetweenTriesMs:3e3},generateHighQualityLinkPreview:!1,enableAutoSessionRecreation:!0,enableRecentMessageCache:!0,options:{},appStateMacVerification:{patch:!1,snapshot:!1},countryCode:"US",getMessage:async()=>{},cachedGroupMetadata:async()=>{},makeSignalRepository:Ise},gU={image:"/mms/image",video:"/mms/video",document:"/mms/document",audio:"/mms/audio",sticker:"/mms/image","thumbnail-link":"/mms/image","product-catalog-image":"/product/image","md-app-state":"","md-msg-hist":"/mms/md-app-state","biz-cover-photo":"/pps/biz-cover-photo"},Loe={audio:"Audio",document:"Document",gif:"Video",image:"Image",ppic:"",product:"Image",ptt:"Audio",sticker:"Image",video:"Video","thumbnail-document":"Document Thumbnail","thumbnail-image":"Image Thumbnail","thumbnail-video":"Video Thumbnail","thumbnail-link":"Link Thumbnail","md-msg-hist":"History","md-app-state":"App State","product-catalog-image":"","payment-bg-image":"Payment Background",ptv:"Video","biz-cover-photo":"Image"},$oe=Object.keys(gU),Bce=12e4,zf=5,fce=812,Qce=3e4,HH={Minute:60*1e3,Hour:3600*1e3,Day:1440*60*1e3,Week:10080*60*1e3};var yce=qe(Kr(),1);import{createHash as v5e}from"crypto";import{createWriteStream as P5e,promises as G5e}from"fs";import{tmpdir as F5e}from"os";import{join as L5e}from"path";var mce=n=>{let t=le(n,"product_catalog"),o=PA(t,"product").map(Vf),i=le(t,"paging");return{products:o,nextPageCursor:i?jA(i,"after"):void 0}},Sce=n=>{let t=le(n,"collections");return{collections:PA(t,"collection").map(i=>{let e=jA(i,"id"),a=jA(i,"name"),A=PA(i,"product").map(Vf);return{id:e,name:a,products:A,status:K5e(i)}})}},wce=n=>{let t=le(n,"order"),o=PA(t,"product").map(a=>{let A=le(a,"image");return{id:jA(a,"id"),name:jA(a,"name"),imageUrl:jA(A,"url"),price:+jA(a,"price"),currency:jA(a,"currency"),quantity:+jA(a,"quantity")}}),i=le(t,"price");return{price:{total:+jA(i,"total"),currency:jA(i,"currency")},products:o}},KH=(n,t)=>{let o={},i=[];return typeof n<"u"&&i.push({tag:"id",attrs:{},content:Buffer.from(n)}),typeof t.name<"u"&&i.push({tag:"name",attrs:{},content:Buffer.from(t.name)}),typeof t.description<"u"&&i.push({tag:"description",attrs:{},content:Buffer.from(t.description)}),typeof t.retailerId<"u"&&i.push({tag:"retailer_id",attrs:{},content:Buffer.from(t.retailerId)}),t.images.length&&i.push({tag:"media",attrs:{},content:t.images.map(a=>{if(!("url"in a))throw new yce.Boom("Expected img for product to already be uploaded",{statusCode:400});return{tag:"image",attrs:{},content:[{tag:"url",attrs:{},content:Buffer.from(a.url.toString())}]}})}),typeof t.price<"u"&&i.push({tag:"price",attrs:{},content:Buffer.from(t.price.toString())}),typeof t.currency<"u"&&i.push({tag:"currency",attrs:{},content:Buffer.from(t.currency)}),"originCountryCode"in t&&(typeof t.originCountryCode>"u"?o.compliance_category="COUNTRY_ORIGIN_EXEMPT":i.push({tag:"compliance_info",attrs:{},content:[{tag:"country_code_origin",attrs:{},content:Buffer.from(t.originCountryCode)}]})),typeof t.isHidden<"u"&&(o.is_hidden=t.isHidden.toString()),{tag:"product",attrs:o,content:i}},Vf=n=>{let t=n.attrs.is_hidden==="true",o=jA(n,"id"),i=le(n,"media"),e=le(n,"status_info");return{id:o,imageUrls:H5e(i),reviewStatus:{whatsapp:jA(e,"status")},availability:"in stock",name:jA(n,"name"),retailerId:jA(n,"retailer_id"),url:jA(n,"url"),description:jA(n,"description"),price:+jA(n,"price"),currency:jA(n,"currency"),isHidden:t}};async function xH(n,t,o=3e4){return n={...n,images:n.images?await U5e(n.images,t,o):n.images},n}var U5e=async(n,t,o=3e4)=>await Promise.all(n.map(async e=>{if("url"in e){let I=e.url.toString();if(I.includes(".whatsapp.net"))return{url:I}}let{stream:a}=await Of(e),A=v5e("sha256"),r=L5e(F5e(),"img"+jr()),s=P5e(r);for await(let I of a)A.update(I),s.write(I);let g=A.digest("base64"),{directPath:c}=await t(r,{mediaType:"product-catalog-image",fileEncSha256B64:g,timeoutMs:o});return await G5e.unlink(r).catch(I=>console.log("Error deleting temp file ",I)),{url:bf(c)}})),H5e=n=>{let t=le(n,"image");return{requested:jA(t,"request_image_url"),original:jA(t,"original_image_url")}},K5e=n=>{let t=le(n,"status_info");return{status:jA(t,"status"),canAppeal:jA(t,"can_appeal")==="true"}};var Zf=qe(Kr(),1);import{randomBytes as VH}from"crypto";var cn=null;try{cn=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Pt(n,t,o){this.low=n|0,this.high=t|0,this.unsigned=!!o}Pt.prototype.__isLong__;Object.defineProperty(Pt.prototype,"__isLong__",{value:!0});function oi(n){return(n&&n.__isLong__)===!0}function Dce(n){var t=Math.clz32(n&-n);return n?31-t:t}Pt.isLong=oi;var Oce={},bce={};function up(n,t){var o,i,e;return t?(n>>>=0,(e=0<=n&&n<256)&&(i=bce[n],i)?i:(o=yt(n,0,!0),e&&(bce[n]=o),o)):(n|=0,(e=-128<=n&&n<128)&&(i=Oce[n],i)?i:(o=yt(n,n<0?-1:0,!1),e&&(Oce[n]=o),o))}Pt.fromInt=up;function In(n,t){if(isNaN(n))return t?rc:zn;if(t){if(n<0)return rc;if(n>=Nce)return vce}else{if(n<=-_ce)return Xi;if(n+1>=_ce)return kce}return n<0?In(-n,t).neg():yt(n%DE|0,n/DE|0,t)}Pt.fromNumber=In;function yt(n,t,o){return new Pt(n,t,o)}Pt.fromBits=yt;var oM=Math.pow;function jH(n,t,o){if(n.length===0)throw Error("empty string");if(typeof t=="number"?(o=t,t=!1):t=!!t,n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return t?rc:zn;if(o=o||10,o<2||360)throw Error("interior hyphen");if(i===0)return jH(n.substring(1),t,o).neg();for(var e=In(oM(o,8)),a=zn,A=0;A>>0:this.low};He.toNumber=function(){return this.unsigned?(this.high>>>0)*DE+(this.low>>>0):this.high*DE+(this.low>>>0)};He.toString=function(t){if(t=t||10,t<2||36>>0,c=g.toString(t);if(A=s,A.isZero())return c+r;for(;c.length<6;)c="0"+c;r=""+c+r}};He.getHighBits=function(){return this.high};He.getHighBitsUnsigned=function(){return this.high>>>0};He.getLowBits=function(){return this.low};He.getLowBitsUnsigned=function(){return this.low>>>0};He.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Xi)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,o=31;o>0&&(t&1<>21;return t?this.unsigned?!1:t===-1&&!(this.low===0&&this.high===-2097152):!0};He.isZero=function(){return this.high===0&&this.low===0};He.eqz=He.isZero;He.isNegative=function(){return!this.unsigned&&this.high<0};He.isPositive=function(){return this.unsigned||this.high>=0};He.isOdd=function(){return(this.low&1)===1};He.isEven=function(){return(this.low&1)===0};He.equals=function(t){return oi(t)||(t=ln(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};He.eq=He.equals;He.notEquals=function(t){return!this.eq(t)};He.neq=He.notEquals;He.ne=He.notEquals;He.lessThan=function(t){return this.comp(t)<0};He.lt=He.lessThan;He.lessThanOrEqual=function(t){return this.comp(t)<=0};He.lte=He.lessThanOrEqual;He.le=He.lessThanOrEqual;He.greaterThan=function(t){return this.comp(t)>0};He.gt=He.greaterThan;He.greaterThanOrEqual=function(t){return this.comp(t)>=0};He.gte=He.greaterThanOrEqual;He.ge=He.greaterThanOrEqual;He.compare=function(t){if(oi(t)||(t=ln(t)),this.eq(t))return 0;var o=this.isNegative(),i=t.isNegative();return o&&!i?-1:!o&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};He.comp=He.compare;He.negate=function(){return!this.unsigned&&this.eq(Xi)?Xi:this.not().add(wE)};He.neg=He.negate;He.add=function(t){oi(t)||(t=ln(t));var o=this.high>>>16,i=this.high&65535,e=this.low>>>16,a=this.low&65535,A=t.high>>>16,r=t.high&65535,s=t.low>>>16,g=t.low&65535,c=0,I=0,d=0,B=0;return B+=a+g,d+=B>>>16,B&=65535,d+=e+s,I+=d>>>16,d&=65535,I+=i+r,c+=I>>>16,I&=65535,c+=o+A,c&=65535,yt(d<<16|B,c<<16|I,this.unsigned)};He.subtract=function(t){return oi(t)||(t=ln(t)),this.add(t.neg())};He.sub=He.subtract;He.multiply=function(t){if(this.isZero())return this;if(oi(t)||(t=ln(t)),cn){var o=cn.mul(this.low,this.high,t.low,t.high);return yt(o,cn.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?rc:zn;if(this.eq(Xi))return t.isOdd()?Xi:zn;if(t.eq(Xi))return this.isOdd()?Xi:zn;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(Tce)&&t.lt(Tce))return In(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,e=this.high&65535,a=this.low>>>16,A=this.low&65535,r=t.high>>>16,s=t.high&65535,g=t.low>>>16,c=t.low&65535,I=0,d=0,B=0,f=0;return f+=A*c,B+=f>>>16,f&=65535,B+=a*c,d+=B>>>16,B&=65535,B+=A*g,d+=B>>>16,B&=65535,d+=e*c,I+=d>>>16,d&=65535,d+=a*g,I+=d>>>16,d&=65535,d+=A*s,I+=d>>>16,d&=65535,I+=i*c+e*g+a*s+A*r,I&=65535,yt(B<<16|f,I<<16|d,this.unsigned)};He.mul=He.multiply;He.divide=function(t){if(oi(t)||(t=ln(t)),t.isZero())throw Error("division by zero");if(cn){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var o=(this.unsigned?cn.div_u:cn.div_s)(this.low,this.high,t.low,t.high);return yt(o,cn.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?rc:zn;var i,e,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return rc;if(t.gt(this.shru(1)))return Rce;a=rc}else{if(this.eq(Xi)){if(t.eq(wE)||t.eq(YH))return Xi;if(t.eq(Xi))return wE;var A=this.shr(1);return i=A.div(t).shl(1),i.eq(zn)?t.isNegative()?wE:YH:(e=this.sub(t.mul(i)),a=i.add(e.div(t)),a)}else if(t.eq(Xi))return this.unsigned?rc:zn;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=zn}for(e=this;e.gte(t);){i=Math.max(1,Math.floor(e.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(i)/Math.LN2),s=r<=48?1:oM(2,r-48),g=In(i),c=g.mul(t);c.isNegative()||c.gt(e);)i-=s,g=In(i,this.unsigned),c=g.mul(t);g.isZero()&&(g=wE),a=a.add(g),e=e.sub(c)}return a};He.div=He.divide;He.modulo=function(t){if(oi(t)||(t=ln(t)),cn){var o=(this.unsigned?cn.rem_u:cn.rem_s)(this.low,this.high,t.low,t.high);return yt(o,cn.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};He.mod=He.modulo;He.rem=He.modulo;He.not=function(){return yt(~this.low,~this.high,this.unsigned)};He.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};He.clz=He.countLeadingZeros;He.countTrailingZeros=function(){return this.low?Dce(this.low):Dce(this.high)+32};He.ctz=He.countTrailingZeros;He.and=function(t){return oi(t)||(t=ln(t)),yt(this.low&t.low,this.high&t.high,this.unsigned)};He.or=function(t){return oi(t)||(t=ln(t)),yt(this.low|t.low,this.high|t.high,this.unsigned)};He.xor=function(t){return oi(t)||(t=ln(t)),yt(this.low^t.low,this.high^t.high,this.unsigned)};He.shiftLeft=function(t){return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?yt(this.low<>>32-t,this.unsigned):yt(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):yt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};He.shr=He.shiftRight;He.shiftRightUnsigned=function(t){return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?yt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?yt(this.high,0,this.unsigned):yt(this.high>>>t-32,0,this.unsigned)};He.shru=He.shiftRightUnsigned;He.shr_u=He.shiftRightUnsigned;He.rotateLeft=function(t){var o;return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?yt(this.high,this.low,this.unsigned):t<32?(o=32-t,yt(this.low<>>o,this.high<>>o,this.unsigned)):(t-=32,o=32-t,yt(this.high<>>o,this.low<>>o,this.unsigned))};He.rotl=He.rotateLeft;He.rotateRight=function(t){var o;return oi(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?yt(this.high,this.low,this.unsigned):t<32?(o=32-t,yt(this.high<>>t,this.low<>>t,this.unsigned)):(t-=32,o=32-t,yt(this.low<>>t,this.high<>>t,this.unsigned))};He.rotr=He.rotateRight;He.toSigned=function(){return this.unsigned?yt(this.low,this.high,!1):this};He.toUnsigned=function(){return this.unsigned?this:yt(this.low,this.high,!0)};He.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};He.toBytesLE=function(){var t=this.high,o=this.low;return[o&255,o>>>8&255,o>>>16&255,o>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};He.toBytesBE=function(){var t=this.high,o=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,o>>>24,o>>>16&255,o>>>8&255,o&255]};Pt.fromBytes=function(t,o,i){return i?Pt.fromBytesLE(t,o):Pt.fromBytesBE(t,o)};Pt.fromBytesLE=function(t,o){return new Pt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,o)};Pt.fromBytesBE=function(t,o){return new Pt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],o)};typeof BigInt=="function"&&(Pt.fromBigInt=function(t,o){var i=Number(BigInt.asIntN(32,t)),e=Number(BigInt.asIntN(32,t>>BigInt(32)));return yt(i,e,o)},Pt.fromValue=function(t,o){return typeof t=="bigint"?Pt.fromBigInt(t,o):ln(t,o)},He.toBigInt=function(){var t=BigInt(this.low>>>0),o=BigInt(this.unsigned?this.high>>>0:this.high);return o<{let n=new ec;return{mutex(t){return n.runExclusive(t)}}},Pce=()=>{let n=new Map;return{async mutex(t,o){let i=n.get(t);i||(i={mutex:new ec,refCount:0},n.set(t,i)),i.refCount++;try{return await i.mutex.runExclusive(o)}finally{i.refCount--,i.refCount===0&&n.get(t)===i&&n.delete(t)}}}};function Gce(n,t,o=10){let i=[],e=!1;return{enqueue:(A,r)=>{if(i.push({type:A,node:r}),e)return;e=!0,(async()=>{let g=0;for(;i.length&&t.isWsOpen();){let{type:c,node:I}=i.shift(),d=n.get(c);if(!d){t.onUnexpectedError(new Error(`unknown offline node type: ${c}`),"processing offline node");continue}await d(I).catch(B=>t.onUnexpectedError(B,`processing offline ${c}`)),g++,g>=o&&(g=0,await t.yieldToEventLoop())}e=!1})().catch(g=>t.onUnexpectedError(g,"processing offline nodes"))}}}var CM=qe(Kr(),1);var DI=qe(Kr(),1);var nM=class{constructor(){this.name="devices"}getQueryElement(){return{tag:"devices",attrs:{version:"2"}}}getUserElement(){return null}parser(t){let o=[],i;if(t.tag==="devices"){Ji(t);let e=le(t,"device-list"),a=le(t,"key-index-list");if(Array.isArray(e?.content))for(let{tag:A,attrs:r}of e.content){let s=+r.id,g=+r["key-index"];A==="device"&&o.push({id:s,keyIndex:g,isHosted:!!(r.is_hosted&&r.is_hosted==="true")})}a?.tag==="key-index-list"&&(i={timestamp:+a.attrs.ts,signedKeyIndex:a?.content,expectedTimestamp:a.attrs.expected_ts?+a.attrs.expected_ts:void 0})}return{deviceList:o,keyIndex:i}}};var tg=class{withId(t){return this.id=t,this}withLid(t){return this.lid=t,this}withPhone(t){return this.phone=t,this}withUsername(t){return this.username=t,this}withUsernameKey(t){return this.usernameKey=t,this}withType(t){return this.type=t,this}withPersonaId(t){return this.personaId=t,this}};var sM=class{constructor(){this.name="contact"}getQueryElement(){return{tag:"contact",attrs:{}}}getUserElement(t){return t.phone?{tag:"contact",attrs:{},content:t.phone}:t.username?{tag:"contact",attrs:{username:t.username,...t.usernameKey?{pin:t.usernameKey}:{},...t.lid?{lid:t.lid}:{}}}:t.type?{tag:"contact",attrs:{type:t.type}}:{tag:"contact",attrs:{}}}parser(t){return t.tag==="contact"?(Ji(t),t?.attrs?.type==="in"):!1}};var gM=class{constructor(){this.name="status"}getQueryElement(){return{tag:"status",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="status"){Ji(t);let o=t?.content?.toString()??null,i=new Date(+(t?.attrs.t||0)*1e3);return o?typeof o=="string"&&o.length===0&&(o=null):t.attrs?.code&&+t.attrs.code==401?o="":o=null,{status:o,setAt:i}}}};var cM=class{constructor(){this.name="disappearing_mode"}getQueryElement(){return{tag:"disappearing_mode",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="disappearing_mode"){Ji(t);let o=+t?.attrs.duration,i=new Date(+(t?.attrs.t||0)*1e3);return{duration:o,setAt:i}}}};var IM=class{constructor(){this.name="username"}getQueryElement(){return{tag:"username",attrs:{}}}getUserElement(t){return null}parser(t){return t.tag==="username"?(Ji(t),typeof t.content=="string"?t.content:null):null}};var lM=class{constructor(){this.name="bot"}getQueryElement(){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{v:"1"}}]}}getUserElement(t){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{persona_id:t.personaId}}]}}parser(t){let o=le(t,"bot"),i=le(o,"profile"),e=le(i,"commands"),a=le(i,"prompts"),A=[],r=[];for(let s of PA(e,"command"))A.push({name:jA(s,"name"),description:jA(s,"description")});for(let s of PA(a,"prompt"))r.push(`${jA(s,"emoji")} ${jA(s,"text")}`);return{isDefault:!!le(i,"default"),jid:t.attrs.jid,name:jA(i,"name"),attributes:jA(i,"attributes"),description:jA(i,"description"),category:jA(i,"category"),personaId:i.attrs.persona_id,commandsDescription:jA(e,"description"),commands:A,prompts:r}}};var pM=class{constructor(){this.name="lid"}getQueryElement(){return{tag:"lid",attrs:{}}}getUserElement(t){return t.lid?{tag:"lid",attrs:{jid:t.lid}}:null}parser(t){return t.tag==="lid"?t.attrs.val:null}};var rg=class{constructor(){this.protocols=[],this.users=[],this.context="interactive",this.mode="query"}withMode(t){return this.mode=t,this}withContext(t){return this.context=t,this}withUser(t){return this.users.push(t),this}parseUSyncQueryResult(t){if(t?.attrs.type!=="result")return;let o=Object.fromEntries(this.protocols.map(A=>[A.name,A.parser])),i={list:[],sideList:[]},e=le(t,"usync"),a=e?le(e,"list"):void 0;return a?.content&&Array.isArray(a.content)&&(i.list=a.content.reduce((A,r)=>{let s=r?.attrs.jid;if(s){let g=Array.isArray(r?.content)?Object.fromEntries(r.content.map(c=>{let I=c.tag,d=o[I];return d?[I,d(c)]:[I,null]}).filter(([,c])=>c!==null)):{};A.push({...g,id:s})}return A},[])),i}withDeviceProtocol(){return this.protocols.push(new nM),this}withContactProtocol(){return this.protocols.push(new sM),this}withStatusProtocol(){return this.protocols.push(new gM),this}withDisappearingModeProtocol(){return this.protocols.push(new cM),this}withBotProfileProtocol(){return this.protocols.push(new lM),this}withLIDProtocol(){return this.protocols.push(new pM),this}withUsernameProtocol(){return this.protocols.push(new IM),this}};var Wr=qe(Kr(),1);import{randomBytes as qH}from"crypto";import{URL as J5e}from"url";import{promisify as q5e}from"util";var dM=class{constructor(t={}){this.protocolVersion=5,this.sequence=0,this.events=[],this.buffer=[],Object.assign(this,t)}};import{EventEmitter as Y5e}from"events";var hM=class extends Y5e{constructor(t,o){super(),this.url=t,this.config=o,this.setMaxListeners(0)}};var EM=class extends hM{constructor(){super(...arguments),this.socket=null}get isOpen(){return this.socket?.readyState===Uo.OPEN}get isClosed(){return this.socket===null||this.socket?.readyState===Uo.CLOSED}get isClosing(){return this.socket===null||this.socket?.readyState===Uo.CLOSING}get isConnecting(){return this.socket?.readyState===Uo.CONNECTING}connect(){if(this.socket)return;this.socket=new Uo(this.url,{origin:Mf,headers:this.config.options?.headers,handshakeTimeout:this.config.connectTimeoutMs,timeout:this.config.connectTimeoutMs,agent:this.config.agent}),this.socket.setMaxListeners(0);let t=["close","error","upgrade","message","open","ping","pong","unexpected-response"];for(let o of t)this.socket?.on(o,(...i)=>this.emit(o,...i))}async close(){if(!this.socket)return;let t=new Promise(o=>{this.socket?.once("close",o)});this.socket.close(),await t,this.socket=null}send(t,o){return this.socket?.send(t,o),!!this.socket}};var JH=qe(Kr(),1);var j5e=(n,t,o,i)=>o({tag:"iq",attrs:{id:i(),type:"get",to:OA,xmlns:"w:mex"},content:[{tag:"query",attrs:{query_id:t},content:Buffer.from(JSON.stringify({variables:n}),"utf-8")}]}),Wf=async(n,t,o,i,e)=>{let a=await j5e(n,t,i,e),A=le(a,"result");if(A?.content){let s=JSON.parse(A.content.toString());if(s.errors&&s.errors.length>0){let c=s.errors.map(B=>B.message||"Unknown error").join(", "),I=s.errors[0],d=I.extensions?.error_code||400;throw new JH.Boom(`GraphQL server error: ${c}`,{statusCode:d,data:I})}let g=o?s?.data?.[o]:s?.data;if(typeof g<"u")return g}let r=(o||"").startsWith("xwa2_")?o.substring(5).replace(/_/g," "):o?.replace(/_/g," ");throw new JH.Boom(`Failed to ${r}, unexpected response structure.`,{statusCode:400,data:a})};var Fce=n=>{let{waWebSocketUrl:t,connectTimeoutMs:o,logger:i,keepAliveIntervalMs:e,browser:a,auth:A,printQRInTerminal:r,defaultQueryTimeoutMs:s,transactionOpts:g,qrTimeout:c,makeSignalRepository:I}=n,d=new dM,B=0,f=j7(),Q=()=>`${f}${se++}`;r&&i.warn({},"\u26A0\uFE0F The printQRInTerminal option has been deprecated. You will no longer receive QR codes in the terminal automatically. Please listen to the connection.update event yourself and handle the QR your way. You can remove this message by removing this opttion. This message will be removed in a future version."),a[1].toLocaleLowerCase().includes("android")&&i.warn("\u26A0\uFE0F Using the Android browser is experimental and may lead to unexpected behavior. Use at your own risk."),qf.map(pe=>n.shouldSyncHistoryMessage({syncType:pe})).filter(pe=>pe===!1).length===qf.length&&i.warn("\u26A0\uFE0F DANGER: DISABLING ALL SYNC BY shouldSyncHistoryMsg PREVENTS BAILEYS FROM ACCESSING INITIAL LID MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS");let m=typeof t=="string"?new J5e(t):t;if(n.mobile||m.protocol==="tcp:")throw new Wr.Boom("Mobile API is not supported anymore",{statusCode:$t.loggedOut});m.protocol==="wss"&&A?.creds?.routingInfo&&m.searchParams.append("ED",A.creds.routingInfo.toString("base64url"));let T=Sr.generateKeyPair(),_=hne({keyPair:T,NOISE_HEADER:Cce,logger:i,routingInfo:A?.creds?.routingInfo}),R=new EM(m,n);R.connect();let K=q5e(R.send),L=async pe=>{if(!R.isOpen)throw new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed});let Qe=_.encodeFrame(pe);await Qh(o,async(be,oA)=>{try{await K.call(R,Qe),be()}catch(pA){oA(pA)}})},F=pe=>{i.level==="trace"&&i.trace({xml:Gn(pe),msg:"xml send"});let Qe=g7(pe);return L(Qe)},q=async(pe,Qe=s)=>{let be,oA;try{return await Qh(Qe,(FA,Kt)=>(be=st=>{FA(st)},oA=st=>{Kt(st||new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed}))},R.on(`TAG:${pe}`,be),R.on("close",oA),R.on("error",oA),()=>Kt(new Wr.Boom("Query Cancelled"))))}catch(pA){if(pA instanceof Wr.Boom&&pA.output?.statusCode===$t.timedOut){i?.warn?.({msgId:pe},"timed out waiting for message");return}throw pA}finally{be&&R.off(`TAG:${pe}`,be),oA&&(R.off("close",oA),R.off("error",oA))}},V=async(pe,Qe)=>{pe.attrs.id||(pe.attrs.id=Q());let be=pe.attrs.id,oA=await Qh(Qe,async(pA,FA)=>{let Kt=q(be,Qe).catch(FA);F(pe).then(async()=>pA(await Kt)).catch(FA)});return oA&&"tag"in oA&&Ji(oA),oA},x=async()=>{let pe=await V({tag:"iq",attrs:{to:OA,type:"get",xmlns:"encrypt"},content:[{tag:"digest",attrs:{}}]});if(!le(pe,"digest"))throw await Xe(),new Error("encrypt/get digest returned no digest node")},G=async()=>{let pe=(z.signedPreKey.keyId||0)+1,Qe=await dD(z.signedIdentityKey,pe);await V({tag:"iq",attrs:{to:OA,type:"set",xmlns:"encrypt"},content:[{tag:"rotate",attrs:{},content:[Rf(Qe)]}]}),k.emit("creds.update",{signedPreKey:Qe})},J=async pe=>{if(pe.protocols.length===0)throw new Wr.Boom("USyncQuery must have at least one protocol");let be=pe.users.map(st=>({tag:"user",attrs:{jid:st.phone?void 0:st.id},content:pe.protocols.map(Dr=>Dr.getUserElement(st)).filter(Dr=>Dr!==null)})),oA={tag:"list",attrs:{},content:be},pA={tag:"query",attrs:{},content:pe.protocols.map(st=>st.getQueryElement())},FA={tag:"iq",attrs:{to:OA,type:"get",xmlns:"usync"},content:[{tag:"usync",attrs:{context:pe.context,mode:pe.mode,sid:Q(),last:"true",index:"0"},content:[pA,oA]}]},Kt=await V(FA);return pe.parseUSyncQueryResult(Kt)},U=async(...pe)=>{let Qe=new rg,be=!1;for(let pA of pe)if(qA(pA)){i?.warn("LIDs are not supported with onWhatsApp");continue}else{be||(be=!0,Qe=Qe.withContactProtocol());let FA=`+${pA.replace("+","").split("@")[0]?.split(":")[0]}`;Qe.withUser(new tg().withPhone(FA))}if(Qe.users.length===0)return[];let oA=await J(Qe);if(oA)return oA.list.filter(pA=>!!pA.contact).map(({contact:pA,id:FA})=>({jid:FA,exists:pA}))},N=async pe=>{let Qe=new rg().withLIDProtocol().withContext("background");for(let oA of pe)if(qA(oA)){i?.warn("LID user found in LID fetch call");continue}else Qe.withUser(new tg().withId(oA));if(Qe.users.length===0)return[];let be=await J(Qe);return be?be.list.filter(oA=>!!oA.lid).map(({lid:oA,id:pA})=>({pn:pA,lid:oA})):[]},k=Wne(i),{creds:z}=A,Ae=Hne(A.keys,i,g),ie=I({creds:z,keys:Ae},i,N),we,se=1,Te,fe,ke=!1,Re=[],We=(pe,Qe)=>{i.error({err:pe},`unexpected error in '${Qe}'`)},ve=async pe=>{if(!R.isOpen)throw new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed});let Qe,be,oA=Qh(o,(pA,FA)=>{Qe=pA,be=zH(FA),R.on("frame",Qe),R.on("close",be),R.on("error",be)}).finally(()=>{R.off("frame",Qe),R.off("close",be),R.off("error",be)});return pe&&L(pe).catch(be),oA},aA=async()=>{let pe={clientHello:{ephemeral:T.public}};pe=oe.HandshakeMessage.fromObject(pe),i.info({browser:a,helloMsg:pe},"connected to WA");let Qe=oe.HandshakeMessage.encode(pe).finish(),be=await ve(Qe),oA=oe.HandshakeMessage.decode(be);i.trace({handshake:oA},"handshake recv from WA");let pA=_.processHandshake(oA,z.noiseKey),FA;z.me?(FA=nne(z.me.id,n),i.info({node:FA},"logging in...")):(FA=sne(z,n),i.info({node:FA},"not logged in, attempting registration..."));let Kt=_.encrypt(oe.ClientPayload.encode(FA).finish());await L(oe.HandshakeMessage.encode({clientFinish:{static:pA,payload:Kt}}).finish()),await _.finishInit(),Ze()},Be=async()=>{let pe=await V({tag:"iq",attrs:{id:Q(),xmlns:"encrypt",type:"get",to:OA},content:[{tag:"count",attrs:{}}]});return+le(pe,"count").attrs.value},Ie=null,Xe=async(pe=zf)=>{if(Ie){i.debug("Pre-key upload already in progress, waiting for completion"),await Ie;return}let Qe=async be=>{i.info({count:pe,retryCount:be},"uploading pre-keys");let oA=await Ae.transaction(async()=>{i.debug({requestedCount:pe},"generating pre-keys with requested count");let{update:pA,node:FA}=await ane({creds:z,keys:Ae},pe);return k.emit("creds.update",pA),FA},z?.me?.id||"upload-pre-keys");try{await V(oA),i.info({count:pe},"uploaded pre-keys successfully")}catch(pA){if(i.error({uploadError:pA.toString(),count:pe},"Failed to upload pre-keys to server"),be<3){let FA=Math.min(1e3*Math.pow(2,be),1e4);return i.info(`Retrying pre-key upload in ${FA}ms`),await new Promise(Kt=>setTimeout(Kt,FA)),Qe(be+1)}throw pA}};Ie=Promise.race([Qe(0),new Promise((be,oA)=>setTimeout(()=>oA(new Wr.Boom("Pre-key upload timeout",{statusCode:408})),Qce))]);try{await Ie}finally{Ie=null}},je=async()=>{let pe=z.nextPreKeyId-1;return pe<=0?{exists:!1,currentPreKeyId:0}:{exists:!!(await Ae.get("pre-key",[pe.toString()]))[pe.toString()],currentPreKeyId:pe}},Oe=async()=>{try{let pe=0,Qe=await Be();Qe===0?pe=fce:pe=zf;let{exists:be,currentPreKeyId:oA}=await je();i.info(`${Qe} pre-keys found on server`),i.info(`Current prekey ID: ${oA}, exists in storage: ${be}`);let pA=Qe<=pe,FA=!be&&oA>0;if(pA||FA){let st=[];pA&&st.push(`server count low (${Qe})`),FA&&st.push(`current prekey ${oA} missing from storage`),i.info(`Uploading PreKeys due to: ${st.join(", ")}`),await Xe(pe)}else i.info(`PreKey validation passed - Server: ${Qe}, Current prekey ${oA} exists`)}catch(pe){i.error({error:pe},"Failed to check/upload pre-keys during initialization")}},EA=async pe=>{await _.decodeFrame(pe,Qe=>{we=new Date;let be=!1;if(be=R.emit("frame",Qe),!(Qe instanceof Uint8Array)){let oA=Qe.attrs.id;i.level==="trace"&&i.trace({xml:Gn(Qe),msg:"recv xml"}),be=R.emit(`${dce}${oA}`,Qe)||be;let pA=Qe.tag,FA=Qe.attrs||{},Kt=Array.isArray(Qe.content)?Qe.content[0]?.tag:"";for(let st of Object.keys(FA))be=R.emit(`${SE}${pA},${st}:${FA[st]},${Kt}`,Qe)||be,be=R.emit(`${SE}${pA},${st}:${FA[st]}`,Qe)||be,be=R.emit(`${SE}${pA},${st}`,Qe)||be;be=R.emit(`${SE}${pA},,${Kt}`,Qe)||be,be=R.emit(`${SE}${pA}`,Qe)||be,!be&&i.level==="debug"&&i.debug({unhandled:!0,msgId:oA,fromMe:!1,frame:Qe},"communication recv")}})},hA=async pe=>{if(ke){i.trace({trace:pe?.stack},"connection already closed");return}if(ke=!0,i.info({trace:pe?.stack},pe?"connection errored":"connection closed"),clearInterval(Te),clearTimeout(fe),R.removeAllListeners("close"),R.removeAllListeners("open"),R.removeAllListeners("message"),ie.close?.(),!R.isClosed&&!R.isClosing)try{await R.close()}catch{}for(let Qe of Re)try{await Qe(pe)}catch(be){i.error({err:be},"error in socket end handler")}k.emit("connection.update",{connection:"close",lastDisconnect:{error:pe,date:new Date}}),k.removeAllListeners("connection.update"),k.destroy()},iA=async()=>{if(R.isOpen)return;if(R.isClosed||R.isClosing)throw new Wr.Boom("Connection Closed",{statusCode:$t.connectionClosed});let pe,Qe;await new Promise((be,oA)=>{pe=()=>be(void 0),Qe=zH(oA),R.on("open",pe),R.on("close",Qe),R.on("error",Qe)}).finally(()=>{R.off("open",pe),R.off("close",Qe),R.off("error",Qe)})},Ze=()=>Te=setInterval(()=>{we||(we=new Date),Date.now()-we.getTime()>e+5e3?hA(new Wr.Boom("Connection was lost",{statusCode:$t.connectionLost})):R.isOpen?V({tag:"iq",attrs:{id:Q(),to:OA,type:"get",xmlns:"w:p"},content:[{tag:"ping",attrs:{}}]}).catch(Qe=>{i.error({trace:Qe.stack},"error in sending keep alive")}):i.warn("keep alive called when WS not open")},e),bA=pe=>V({tag:"iq",attrs:{to:OA,xmlns:"passive",type:"set"},content:[{tag:pe,attrs:{}}]}),ue=async pe=>{let Qe=A.creds.me?.id;Qe&&await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"remove-companion-device",attrs:{jid:Qe,reason:"user_initiated"}}]}),hA(new Wr.Boom(pe||"Intentional Logout",{statusCode:$t.loggedOut}))},Ne=async(pe,Qe)=>{let be=Qe??W7(qH(5));if(Qe&&Qe?.length!==8)throw new Error("Custom pairing code must be exactly 8 chars");return A.creds.pairingCode=be,A.creds.me={id:yr(pe,"s.whatsapp.net"),name:"~"},k.emit("creds.update",A.creds),await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:A.creds.me.id,stage:"companion_hello",should_show_push_notification:"true"},content:[{tag:"link_code_pairing_wrapped_companion_ephemeral_pub",attrs:{},content:await Ue()},{tag:"companion_server_auth_key_pub",attrs:{},content:A.creds.noiseKey.public},{tag:"companion_platform_id",attrs:{},content:zU(a)},{tag:"companion_platform_display",attrs:{},content:`${a[1]} (${a[0]})`},{tag:"link_code_pairing_nonce",attrs:{},content:"0"}]}]}),A.creds.pairingCode};async function Ue(){let pe=qH(32),Qe=qH(16),be=await hD(A.creds.pairingCode,pe),oA=R7(A.creds.pairingEphemeralKeyPair.public,be,Qe);return Buffer.concat([pe,Qe,oA])}let MA=pe=>V({tag:"iq",attrs:{to:OA,id:Q(),xmlns:"w:stats"},content:[{tag:"add",attrs:{t:Math.round(Date.now()/1e3)+""},content:pe}]});R.on("message",EA),R.on("open",async()=>{try{await aA()}catch(pe){i.error({err:pe},"error in validating connection"),hA(pe)}}),R.on("error",zH(hA)),R.on("close",()=>void hA(new Wr.Boom("Connection Terminated",{statusCode:$t.connectionClosed}))),R.on("CB:xmlstreamend",()=>void hA(new Wr.Boom("Connection Terminated by Server",{statusCode:$t.connectionClosed}))),R.on("CB:iq,type:set,pair-device",async pe=>{let Qe={tag:"iq",attrs:{to:OA,type:"result",id:pe.attrs.id}};await F(Qe);let be=le(pe,"pair-device"),oA=PA(be,"ref"),pA=Buffer.from(z.noiseKey.public).toString("base64"),FA=Buffer.from(z.signedIdentityKey.public).toString("base64"),Kt=z.advSecretKey,st=c||6e4,Dr=()=>{if(!R.isOpen)return;let rr=oA.shift();if(!rr){hA(new Wr.Boom("QR refs attempts ended",{statusCode:$t.timedOut}));return}let Qo=rr.content.toString("utf-8"),$i=$ne(Qo,pA,FA,Kt,a);k.emit("connection.update",{qr:$i}),fe=setTimeout(Dr,st),st=c||2e4};Dr()}),R.on("CB:iq,,pair-success",async pe=>{i.debug("pair success recv");try{_A(pe);let{reply:Qe,creds:be}=gne(pe,z);i.info({me:be.me,platform:be.platform},"pairing configured successfully, expect to restart the connection..."),k.emit("creds.update",be),k.emit("connection.update",{isNewLogin:!0,qr:void 0}),await F(Qe),wA()}catch(Qe){i.info({trace:Qe.stack},"error in pairing"),hA(Qe)}}),R.on("CB:success",async pe=>{try{_A(pe),await Oe(),await bA("active");try{await x()}catch(Qe){i.warn({e:Qe},"failed to run digest after login")}}catch(Qe){i.warn({err:Qe},"failed to send initial passive iq")}if(i.info("opened connection to WA"),clearTimeout(fe),k.emit("creds.update",{me:{...A.creds.me,lid:pe.attrs.lid}}),k.emit("connection.update",{connection:"open"}),wA(),pe.attrs.lid&&A.creds.me?.id){let Qe=pe.attrs.lid;process.nextTick(async()=>{try{let be=A.creds.me.id;await ie.lidMapping.storeLIDPNMappings([{lid:Qe,pn:be}]);let{user:oA,device:pA}=fA(be);await A.keys.set({"device-list":{[oA]:[pA?.toString()||"0"]}}),await ie.migrateSession(be,Qe),i.info({myPN:be,myLID:Qe},"Own LID session created successfully")}catch(be){i.error({error:be,lid:Qe},"Failed to create own LID session")}})}}),R.on("CB:stream:error",pe=>{let[Qe]=_s(pe);i.error({reasonNode:Qe,fullErrorNode:pe},"stream errored out");let{reason:be,statusCode:oA}=q7(pe);hA(new Wr.Boom(`Stream Errored (${be})`,{statusCode:oA,data:Qe||pe}))}),R.on("CB:failure",pe=>{let Qe=+(pe.attrs.reason||500);hA(new Wr.Boom("Connection Failure",{statusCode:Qe,data:pe.attrs}))}),R.on("CB:ib,,downgrade_webclient",()=>{hA(new Wr.Boom("Multi-device beta not joined",{statusCode:$t.multideviceMismatch}))}),R.on("CB:ib,,offline_preview",async pe=>{i.info("offline preview received",JSON.stringify(pe)),await F({tag:"ib",attrs:{},content:[{tag:"offline_batch",attrs:{count:"100"}}]})}),R.on("CB:ib,,edge_routing",pe=>{let Qe=le(pe,"edge_routing"),be=le(Qe,"routing_info");be?.content&&(A.creds.routingInfo=Buffer.from(be?.content),k.emit("creds.update",A.creds))});let Ke=!1;process.nextTick(()=>{z.me?.id&&(k.buffer(),Ke=!0),k.emit("connection.update",{connection:"connecting",receivedPendingNotifications:!1,qr:void 0})}),R.on("CB:ib,,offline",pe=>{let be=+(le(pe,"offline")?.attrs.count||0);i.info(`handled ${be} offline messages/notifications`),Ke&&(k.flush(),i.trace("flushed events for initial buffer")),k.emit("connection.update",{receivedPendingNotifications:!0})}),k.on("creds.update",pe=>{let Qe=pe.me?.name;z.me?.name!==Qe&&(i.debug({name:Qe},"updated pushName"),F({tag:"presence",attrs:{name:Qe}}).catch(be=>{i.warn({trace:be.stack},"error in sending presence update on name change")})),Object.assign(z,pe)});let _A=({attrs:pe})=>{let Qe=pe?.t;if(!Qe)return;let be=Number(Qe);if(Number.isNaN(be)||be<=0)return;let oA=Date.now();B=be*1e3-oA,i.debug({offset:B},"calculated server time offset")},at=()=>{let pe=3*HH.Day;return((Date.now()+B+pe)%HH.Week).toString()},wA=async()=>{if(!R.isOpen)return;let pe={tag:"ib",attrs:{},content:[{tag:"unified_session",attrs:{id:at()}}]};try{await F(pe)}catch(Qe){i.debug({error:Qe},"failed to send unified_session telemetry")}},lt=pe=>{Re.push(pe)},Er=async()=>{let pe=await Wf({},ca.REACHOUT_TIMELOCK,wa.xwa2_fetch_account_reachout_timelock,V,Q),Qe={isActive:!!pe?.is_active,timeEnforcementEnds:pe?.time_enforcement_ends&&pe?.time_enforcement_ends!=="0"?new Date(parseInt(pe.time_enforcement_ends,10)*1e3):void 0,enforcementType:pe?.enforcement_type??Vc.DEFAULT};return k.emit("connection.update",{reachoutTimeLock:Qe}),Qe},UA=async()=>Wf({input:{type:"INDIVIDUAL_NEW_CHAT_MSG"}},ca.MESSAGE_CAPPING_INFO,wa.xwa2_message_capping_info,V,Q);return{type:"md",ws:R,ev:k,authState:{creds:z,keys:Ae},signalRepository:ie,get user(){return A.creds.me},generateMessageTag:Q,query:V,waitForMessage:q,waitForSocketOpen:iA,sendRawMessage:L,sendNode:F,logout:ue,end:hA,registerSocketEndHandler:lt,onUnexpectedError:We,uploadPreKeys:Xe,uploadPreKeysToServerIfRequired:Oe,digestKeyBundle:x,rotateSignedPreKey:G,requestPairingCode:Ne,updateServerTimeOffset:_A,sendUnifiedSession:wA,wamBuffer:d,waitForConnectionUpdate:Y7(k),sendWAMBuffer:MA,executeUSyncQuery:J,onWhatsApp:U,fetchAccountReachoutTimelock:Er,fetchNewChatMessageCap:UA}};function zH(n){return t=>{n(new Wr.Boom(`WebSocket Error (${t?.message})`,{statusCode:V7(t),data:t}))}}var z5e=(n,t)=>{let o={tag:"picture",attrs:{type:n,query:"url"}};return t?.length&&(o.content=t),[o]},Lce=n=>{let{logger:t,markOnlineOnConnect:o,fireInitQueries:i,appStateMacVerification:e,shouldIgnoreJid:a,shouldSyncHistoryMessage:A,getMessage:r}=n,s=Fce(n),{ev:g,ws:c,authState:I,generateMessageTag:d,sendNode:B,query:f,signalRepository:Q,onUnexpectedError:y,sendUnifiedSession:m,registerSocketEndHandler:T}=s,_=Q.lidMapping.getLIDForPN.bind(Q.lidMapping),R,K={privacyTokenOn1to1:!0,profilePicPrivacyToken:!0,lidTrustedTokenIssueToLid:!1},L=ga.Connecting,F=ac(),q=ac(),V=ac(),x=ac(),G,J={initialBootstrapComplete:!1,recentSyncComplete:!1},U,N=new Set,k=n.placeholderResendCache||new $g({stdTTL:mI.MSG_RETRY,useClones:!1}),z=async W=>{let{[W]:X}=await I.keys.get("app-state-sync-key",[W]);return X},Ae=async(W=!1)=>{if(!R||W){let{content:X}=await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"get"},content:[{tag:"privacy",attrs:{}}]});R=UF(X?.[0],"category")}return R},ie=async(W,X)=>{await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"set"},content:[{tag:"privacy",attrs:{},content:[{tag:"category",attrs:{name:W,value:X}}]}]})},we=async W=>{await ie("messages",W)},se=async W=>{await ie("calladd",W)},Te=async W=>{await ie("last",W)},fe=async W=>{await ie("online",W)},ke=async W=>{await ie("profile",W)},Re=async W=>{await ie("status",W)},We=async W=>{await ie("readreceipts",W)},ve=async W=>{await ie("groupadd",W)},aA=async W=>{await f({tag:"iq",attrs:{xmlns:"disappearing_mode",to:OA,type:"set"},content:[{tag:"disappearing_mode",attrs:{duration:W.toString()}}]})},Be=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"bot",to:OA,type:"get"},content:[{tag:"bot",attrs:{v:"2"}}]}),X=le(W,"bot"),re=[];for(let ne of PA(X,"section"))if(ne.attrs.type==="all")for(let Se of PA(ne,"bot"))re.push({jid:Se.attrs.jid,personaId:Se.attrs.persona_id});return re},Ie=async(...W)=>{let X=new rg().withStatusProtocol();for(let ne of W)X.withUser(new tg().withId(ne));let re=await s.executeUSyncQuery(X);if(re)return re.list},Xe=async(...W)=>{let X=new rg().withDisappearingModeProtocol();for(let ne of W)X.withUser(new tg().withId(ne));let re=await s.executeUSyncQuery(X);if(re)return re.list},je=async(W,X,re)=>{let ne;if(!W)throw new DI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");uA(W)!==uA(I.creds.me.id)?ne=uA(W):ne=void 0;let{img:Se}=await ub(X,re);await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...ne?{target:ne}:{}},content:[{tag:"picture",attrs:{type:"image"},content:Se}]})},Oe=async W=>{let X;if(!W)throw new DI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");uA(W)!==uA(I.creds.me.id)?X=uA(W):X=void 0,await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...X?{target:X}:{}}})},EA=async W=>{await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"status"},content:[{tag:"status",attrs:{},content:Buffer.from(W,"utf-8")}]})},hA=async W=>{await UA({pushNameSetting:W},"")},iA=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"get"}}),X=le(W,"list");return PA(X,"item").map(re=>re.attrs.jid)},Ze=async(W,X)=>{let re=uA(W),ne,Se;if(qA(re)||Ia(re)){if(ne=re,X==="block"){let he=await Q.lidMapping.getPNForLID(re);if(!he)throw new DI.Boom(`Unable to resolve PN JID for LID: ${W}`,{statusCode:400});Se=uA(he)}}else if(_t(re)||mr(re)){let he=await Q.lidMapping.getLIDForPN(re);if(!he)throw new DI.Boom(`Unable to resolve LID for PN JID: ${W}`,{statusCode:400});ne=he,X==="block"&&(Se=uA(re))}else throw new DI.Boom(`Invalid jid: ${W}`,{statusCode:400});let Ee={action:X,jid:ne};if(X==="block"){if(!Se)throw new DI.Boom(`pn_jid required for block: ${W}`,{statusCode:400});Ee.pn_jid=Se}await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"set"},content:[{tag:"item",attrs:Ee}]})},bA=async W=>{let X=await f({tag:"iq",attrs:{to:"s.whatsapp.net",xmlns:"w:biz",type:"get"},content:[{tag:"business_profile",attrs:{v:"244"},content:[{tag:"profile",attrs:{jid:W}}]}]}),re=le(X,"business_profile"),ne=le(re,"profile");if(ne){let Se=le(ne,"address"),Ee=le(ne,"description"),he=le(ne,"website"),ye=le(ne,"email"),Je=le(le(ne,"categories"),"category"),IA=le(ne,"business_hours"),yA=IA?PA(IA,"business_hours_config"):void 0,XA=he?.content?.toString();return{wid:ne.attrs?.jid,address:Se?.content?.toString(),description:Ee?.content?.toString()||"",website:XA?[XA]:[],email:ye?.content?.toString(),category:Je?.content?.toString(),business_hours:{timezone:IA?.attrs?.timezone,business_config:yA?.map(({attrs:vA})=>vA)}}}},ue=async(W,X)=>{t.info({fromTimestamp:X},"clean dirty bits "+W),await B({tag:"iq",attrs:{to:OA,type:"set",xmlns:"urn:xmpp:whatsapp:dirty",id:d()},content:[{tag:"clean",attrs:{type:W,...X?{timestamp:X.toString()}:null}}]})},Ne=W=>({onMutation(X){Nne(X,g,I.creds.me,W?{accountSettings:I.creds.accountSettings}:void 0,t)}}),Ue=g.createBufferedFunction(async(W,X)=>{let re=new Map,ne=async ye=>{if(re.has(ye))return re.get(ye)??void 0;let Je=await z(ye);return re.set(ye,Je??null),Je},Se={},Ee={};await I.keys.transaction(async()=>{let ye=new Set(W),Je={},IA=new Set;for(;ye.size;){let yA={},XA=[];for(let $A of ye){let tA=(await I.keys.get("app-state-sync-version",[$A]))[$A];tA?(tA=mU(tA),typeof Se[$A]>"u"&&(Se[$A]=tA.version)):tA=Sb(),yA[$A]=tA;let et=IA.has($A);et&&IA.delete($A),t.info(`resyncing ${$A} from v${tA.version}${et?" (forcing snapshot)":""}`),XA.push({tag:"collection",attrs:{name:$A,version:tA.version.toString(),return_snapshot:(et||!tA.version).toString()}})}let vA=await f({tag:"iq",attrs:{to:OA,xmlns:"w:sync:app:state",type:"set"},content:[{tag:"sync",attrs:{},content:XA}]}),YA=await bne(vA,n?.options);for(let $A in YA){let Ge=$A,{patches:tA,hasMorePatches:et,snapshot:Zr}=YA[Ge];try{if(Zr){let{state:ar,mutationMap:yo}=await _ne(Ge,Zr,ne,Se[Ge],e.snapshot,t);yA[Ge]=ar,Object.assign(Ee,yo),t.info(`restored state of ${Ge} from snapshot to v${ar.version} with mutations`),await I.keys.set({"app-state-sync-version":{[Ge]:ar}})}if(tA.length){let{state:ar,mutationMap:yo}=await wU(Ge,tA,yA[Ge],ne,n.options,Se[Ge],t,e.patch);await I.keys.set({"app-state-sync-version":{[Ge]:ar}}),t.info(`synced ${Ge} to v${ar.version}`),Se[Ge]=ar.version,Object.assign(Ee,yo)}et?t.info(`${Ge} has more patches...`):ye.delete(Ge)}catch(ar){Je[Ge]=(Je[Ge]||0)+1;let yo={name:Ge,attempt:Je[Ge],version:yA[Ge].version,statusCode:ar.output?.statusCode,errorType:ar.name,error:ar.stack};Pf(ar)&&Je[Ge]>=SU?(t.warn(yo,`${Ge} blocked on missing key from v${yA[Ge].version}, parking after ${Je[Ge]} attempts`),N.add(Ge),ye.delete(Ge)):Pf(ar)?(t.info(yo,`${Ge} blocked on missing key from v${yA[Ge].version}, retrying with snapshot`),IA.add(Ge)):wne(ar,Je[Ge])?(t.warn(yo,`failed to sync ${Ge} from v${yA[Ge].version}, giving up`),ye.delete(Ge)):(t.info(yo,`failed to sync ${Ge} from v${yA[Ge].version}, forcing snapshot retry`),IA.add(Ge))}}}},I?.creds?.me?.id||"resync-app-state");let{onMutation:he}=Ne(X);for(let ye in Ee)he(Ee[ye])}),MA=async(W,X="preview",re)=>{let ne=uA(W),Se=_t(ne)||qA(ne),Ee=I.creds.me,he=Ee&&(ne===uA(Ee.id)||Ee.lid&&ne===uA(Ee.lid)),ye;K.profilePicPrivacyToken&&Se&&!he&&(ye=await KU({authState:I,jid:ne,getLIDForPN:_})),W=uA(W);let Je=await f({tag:"iq",attrs:{target:W,to:OA,type:"get",xmlns:"w:profile:picture"},content:z5e(X,ye)},re);return le(Je,"picture")?.attrs?.url},Ke=async(W,X,re)=>{let ne=await f({tag:"call",attrs:{id:d(),to:"@call"},content:[{tag:"link_create",attrs:{media:W},content:X?[{tag:"event",attrs:{start_time:String(X.startTime)}}]:void 0}]},re);return le(ne,"link_create")?.attrs?.token},_A=async(W,X)=>{let re=I.creds.me,ne=W==="available";if(ne||W==="unavailable"){if(!re.name){t.warn("no name present, ignoring presence update request...");return}g.emit("connection.update",{isOnline:ne}),ne&&m(),await B({tag:"presence",attrs:{name:re.name.replace(/@/g,""),type:W}})}else{let{server:Se}=fA(X);await B({tag:"chatstate",attrs:{from:Se==="lid"?re.lid:re.id,to:X},content:[{tag:W==="recording"?"composing":W,attrs:W==="recording"?{media:"audio"}:{}}]})}},at=async W=>{let X=uA(W),ne=_t(X)||qA(X)?await KU({authState:I,jid:X,getLIDForPN:_}):void 0;return B({tag:"presence",attrs:{to:W,id:d(),type:"subscribe"},content:ne})},wA=({tag:W,attrs:X,content:re})=>{let ne,Se=X.from,Ee=X.participant||X.from;if(!(a(Se)&&Se!==OA)){if(W==="presence")ne={lastKnownPresence:X.type==="unavailable"?"unavailable":"available",lastSeen:X.last&&X.last!=="deny"?+X.last:void 0,groupOnlineCount:X.count?+X.count:void 0};else if(Array.isArray(re)){let[he]=re,ye=he.tag;ye==="paused"&&(ye="available"),he.attrs?.media==="audio"&&(ye="recording"),ne={lastKnownPresence:ye}}else t.error({tag:W,attrs:X,content:re},"recv invalid presence node");ne&&g.emit("presence.update",{id:Se,presences:{[Ee]:ne}})}},lt=async W=>{let X=W.type,re=I.creds.myAppStateKeyId;if(!re)throw new DI.Boom("App state key not present!",{statusCode:400});let ne,Se;if(await V.mutex(async()=>{await I.keys.transaction(async()=>{t.debug({patch:W},"applying app patch"),await Ue([X],!1);let{[X]:Ee}=await I.keys.get("app-state-sync-version",[X]);ne=Ee?mU(Ee):Sb(),Se=await Dne(W,re,ne,z);let{patch:he,state:ye}=Se,Je={tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:sync:app:state"},content:[{tag:"sync",attrs:{},content:[{tag:"collection",attrs:{name:X,version:(ye.version-1).toString(),return_snapshot:"false"},content:[{tag:"patch",attrs:{},content:oe.SyncdPatch.encode(he).finish()}]}]}]};await f(Je),await I.keys.set({"app-state-sync-version":{[X]:ye}})},I?.creds?.me?.id||"app-patch")}),n.emitOwnEvents){let{onMutation:Ee}=Ne(!1),{mutationMap:he}=await wU(X,[{...Se.patch,version:{version:Se.state.version}}],ne,z,n.options,void 0,t);for(let ye in he)Ee(he[ye])}},Er=async()=>{let W=await f({tag:"iq",attrs:{to:OA,xmlns:"abt",type:"get"},content:[{tag:"props",attrs:{protocol:"1",...I?.creds?.lastPropHash?{hash:I.creds.lastPropHash}:{}}}]}),X=le(W,"props"),re={};X&&(X.attrs?.hash&&(I.creds.lastPropHash=X?.attrs?.hash,g.emit("creds.update",I.creds)),re=UF(X,"prop"));let ne=re[10518]??re.privacy_token_sending_on_all_1_on_1_messages;ne!==void 0&&(K.privacyTokenOn1to1=ne==="true"||ne==="1");let Se=re[9666]??re.profile_scraping_privacy_token_in_photo_iq;Se!==void 0&&(K.profilePicPrivacyToken=Se==="true"||Se==="1");let Ee=re[14303]??re.lid_trusted_token_issue_to_lid;return Ee!==void 0&&(K.lidTrustedTokenIssueToLid=Ee==="true"||Ee==="1"),t.debug({serverProps:K},"fetched props"),re},UA=(W,X)=>{let re=Tne(W,X);return lt(re)},pe=W=>UA({disableLinkPreviews:{isPreviewsDisabled:W}},""),Qe=(W,X,re)=>UA({star:{messages:X,star:re}},W),be=(W,X)=>UA({contact:X},W),oA=W=>UA({contact:null},W),pA=(W,X)=>UA({addLabel:{...X}},W),FA=(W,X)=>UA({addChatLabel:{labelId:X}},W),Kt=(W,X)=>UA({removeChatLabel:{labelId:X}},W),st=(W,X,re)=>UA({addMessageLabel:{messageId:X,labelId:re}},W),Dr=(W,X,re)=>UA({removeMessageLabel:{messageId:X,labelId:re}},W),rr=W=>UA({quickReply:W},""),Qo=W=>UA({quickReply:{timestamp:W,deleted:!0}},""),$i=async()=>{await Promise.all([Er(),iA(),Ae()])},ee=g.createBufferedFunction(async(W,X)=>{if(g.emit("messages.upsert",{messages:[W],type:X}),W.pushName){let Ee=W.key.fromMe?I.creds.me.id:W.key.participant||W.key.remoteJid;Ee=uA(Ee),W.key.fromMe||g.emit("contacts.update",[{id:Ee,notify:W.pushName,verifiedName:W.verifiedBizName}]),W.key.fromMe&&W.pushName&&I.creds.me?.name!==W.pushName&&g.emit("creds.update",{me:{...I.creds.me,name:W.pushName}})}let re=mb(W.message),ne=re?A(re)&&qf.includes(re.syncType):!1;if(re&&ne){let Ee=re.syncType;Ee===oe.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP&&!J.initialBootstrapComplete&&(J.initialBootstrapComplete=!0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===oe.HistorySync.HistorySyncType.RECENT&&re.progress===100&&!J.recentSyncComplete&&(J.recentSyncComplete=!0,clearTimeout(U),U=void 0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===oe.HistorySync.HistorySyncType.RECENT&&!J.recentSyncComplete&&(clearTimeout(U),U=setTimeout(()=>{J.recentSyncComplete||(J.recentSyncComplete=!0,g.emit("messaging-history.status",{syncType:oe.HistorySync.HistorySyncType.RECENT,status:"paused",explicit:!1})),U=void 0},Bce))}re&&L===ga.AwaitingInitialSync&&(G&&(clearTimeout(G),G=void 0),ne?(L=ga.Syncing,t.info("Transitioned to Syncing state")):(L=ga.Online,t.info("History sync skipped, transitioning to Online state and flushing buffer"),g.flush()));let Se=async()=>{if(L===ga.Syncing){N.clear(),t.info("Doing app state sync"),await Ue($X,!0),L=ga.Online,t.info("App state sync complete, transitioning to Online state and flushing buffer"),g.flush();let Ee=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:Ee})}};await Promise.all([(async()=>{ne&&await Se()})(),Vne(W,{signalRepository:Q,shouldProcessHistoryMsg:ne,placeholderResendCache:k,ev:g,creds:I.creds,keyStore:I.keys,logger:t,options:n.options,getMessage:r})]),W.message?.protocolMessage?.appStateSyncKeyShare&&L===ga.Syncing&&(t.info("App state sync key arrived, triggering app state sync"),await Se())});return c.on("CB:presence",wA),c.on("CB:chatstate",wA),c.on("CB:ib,,dirty",async W=>{let{attrs:X}=le(W,"dirty");switch(X.type){case"account_sync":if(X.timestamp){let{lastAccountSyncTimestamp:ne}=I.creds;ne&&await ue("account_sync",ne),ne=+X.timestamp,g.emit("creds.update",{lastAccountSyncTimestamp:ne})}break;case"groups":break;default:t.info({node:W},"received unknown sync");break}}),g.on("connection.update",({connection:W,receivedPendingNotifications:X})=>{if(W==="close"&&(N.clear(),clearTimeout(U),U=void 0),W==="open"&&(i&&$i().catch(ne=>y(ne,"init queries")),_A(o?"available":"unavailable").catch(ne=>y(ne,"presence update requests"))),!X||L!==ga.Connecting)return;if(J.initialBootstrapComplete=!1,J.recentSyncComplete=!1,clearTimeout(U),U=void 0,L=ga.AwaitingInitialSync,t.info("Connection is now AwaitingInitialSync, buffering events"),g.buffer(),!A(oe.Message.HistorySyncNotification.create({syncType:oe.HistorySync.HistorySyncType.RECENT}))){t.info("History sync is disabled by config, not waiting for notification. Transitioning to Online."),L=ga.Online,setTimeout(()=>g.flush(),0);return}if(I.creds.accountSyncCounter>0){t.info("Reconnection with existing sync data, skipping history sync wait. Transitioning to Online."),L=ga.Online,setTimeout(()=>g.flush(),0);return}t.info("First connection, awaiting history sync notification with a 20s timeout."),G&&clearTimeout(G),G=setTimeout(()=>{if(L===ga.AwaitingInitialSync){t.warn("Timeout in AwaitingInitialSync, forcing state to Online and flushing buffer"),L=ga.Online,g.flush();let ne=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:ne})}},2e4)}),g.on("creds.update",({myAppStateKeyId:W})=>{if(!W||N.size===0)return;if(L===ga.Syncing){N.clear();return}let X=[...N];N.clear(),t.info({collections:X},"app state sync key arrived, re-syncing blocked collections"),Ue(X,!1).catch(re=>y(re,"blocked collections resync"))}),g.on("lid-mapping.update",async({lid:W,pn:X})=>{try{await Q.lidMapping.storeLIDPNMappings([{lid:W,pn:X}])}catch(re){t.warn({lid:W,pn:X,error:re},"Failed to store LID-PN mapping")}}),T(()=>{G&&(clearTimeout(G),G=void 0),!n.placeholderResendCache&&k.close&&k.close(),L=ga.Connecting,R=void 0}),{...s,serverProps:K,createCallLink:Ke,getBotListV2:Be,messageMutex:F,receiptMutex:q,appStatePatchMutex:V,notificationMutex:x,fetchPrivacySettings:Ae,upsertMessage:ee,appPatch:lt,sendPresenceUpdate:_A,presenceSubscribe:at,profilePictureUrl:MA,fetchBlocklist:iA,fetchStatus:Ie,fetchDisappearingDuration:Xe,updateProfilePicture:je,removeProfilePicture:Oe,updateProfileStatus:EA,updateProfileName:hA,updateBlockStatus:Ze,updateDisableLinkPreviewsPrivacy:pe,updateCallPrivacy:se,updateMessagesPrivacy:we,updateLastSeenPrivacy:Te,updateOnlinePrivacy:fe,updateProfilePicturePrivacy:ke,updateStatusPrivacy:Re,updateReadReceiptsPrivacy:We,updateGroupsAddPrivacy:ve,updateDefaultDisappearingMode:aA,getBusinessProfile:bA,resyncAppState:Ue,chatModify:UA,cleanDirtyBits:ue,addOrEditContact:be,removeContact:oA,placeholderResendCache:k,addLabel:pA,addChatLabel:FA,removeChatLabel:Kt,addMessageLabel:st,removeMessageLabel:Dr,star:Qe,addOrEditQuickReply:rr,removeQuickReply:Qo}};var Uce=n=>{let t=Lce(n),{authState:o,ev:i,query:e,upsertMessage:a}=t,A=async(g,c,I)=>e({tag:"iq",attrs:{type:c,xmlns:"w:g2",to:g},content:I}),r=async g=>{let c=await A(g,"get",[{tag:"query",attrs:{request:"interactive"}}]);return OE(c)},s=async()=>{let g=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),c={},I=le(g,"groups");if(I){let d=PA(I,"group");for(let B of d){let f=OE({tag:"result",attrs:{},content:[B]});c[f.id]=f}}return t.ev.emit("groups.update",Object.values(c)),c};return t.ws.on("CB:ib,,dirty",async g=>{let{attrs:c}=le(g,"dirty");c.type==="groups"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,groupMetadata:r,groupCreate:async(g,c)=>{let I=jr(),d=await A("@g.us","set",[{tag:"create",attrs:{subject:g,key:I},content:c.map(B=>({tag:"participant",attrs:{jid:B}}))}]);return OE(d)},groupLeave:async g=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"group",attrs:{id:g}}]}])},groupUpdateSubject:async(g,c)=>{await A(g,"set",[{tag:"subject",attrs:{},content:Buffer.from(c,"utf-8")}])},groupRequestParticipantsList:async g=>{let c=await A(g,"get",[{tag:"membership_approval_requests",attrs:{}}]),I=le(c,"membership_approval_requests");return PA(I,"membership_approval_request").map(B=>B.attrs)},groupRequestParticipantsUpdate:async(g,c,I)=>{let d=await A(g,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:I,attrs:{},content:c.map(y=>({tag:"participant",attrs:{jid:y}}))}]}]),B=le(d,"membership_requests_action"),f=le(B,I);return PA(f,"participant").map(y=>({status:y.attrs.error||"200",jid:y.attrs.jid}))},groupParticipantsUpdate:async(g,c,I)=>{let d=await A(g,"set",[{tag:I,attrs:{},content:c.map(Q=>({tag:"participant",attrs:{jid:Q}}))}]),B=le(d,I);return PA(B,"participant").map(Q=>({status:Q.attrs.error||"200",jid:Q.attrs.jid,content:Q}))},groupUpdateDescription:async(g,c)=>{let d=(await r(g)).descId??null;await A(g,"set",[{tag:"description",attrs:{...c?{id:jr()}:{delete:"true"},...d?{prev:d}:{}},content:c?[{tag:"body",attrs:{},content:Buffer.from(c,"utf-8")}]:void 0}])},groupInviteCode:async g=>{let c=await A(g,"get",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupRevokeInvite:async g=>{let c=await A(g,"set",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupAcceptInvite:async g=>{let c=await A("@g.us","set",[{tag:"invite",attrs:{code:g}}]);return le(c,"group")?.attrs.jid},groupRevokeInviteV4:async(g,c)=>!!await A(g,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:c}}]}]),groupAcceptInviteV4:i.createBufferedFunction(async(g,c)=>{g=typeof g=="string"?{remoteJid:g}:g;let I=await A(c.groupJid,"set",[{tag:"accept",attrs:{code:c.inviteCode,expiration:c.inviteExpiration.toString(),admin:g.remoteJid}}]);return g.id&&(c=oe.Message.GroupInviteMessage.fromObject(c),c.inviteExpiration=0,c.inviteCode="",i.emit("messages.update",[{key:g,update:{message:{groupInviteMessage:c}}}])),await a({key:{remoteJid:c.groupJid,id:jr(t.user?.id),fromMe:!1,participant:g.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:g.remoteJid,messageTimestamp:Oa()},"notify"),I.attrs.from}),groupGetInviteInfo:async g=>{let c=await A("@g.us","get",[{tag:"invite",attrs:{code:g}}]);return OE(c)},groupToggleEphemeral:async(g,c)=>{let I=c?{tag:"ephemeral",attrs:{expiration:c.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(g,"set",[I])},groupSettingUpdate:async(g,c)=>{await A(g,"set",[{tag:c,attrs:{}}])},groupMemberAddMode:async(g,c)=>{await A(g,"set",[{tag:"member_add_mode",attrs:{},content:c}])},groupJoinApprovalMode:async(g,c)=>{await A(g,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"group_join",attrs:{state:c}}]}])},groupFetchAllParticipating:s}},OE=n=>{let t=le(n,"group");if(!t){let B=le(n,"error");if(B){let f=B.attrs.code?+B.attrs.code:500,Q=B.attrs.text||"group metadata query failed";throw new CM.Boom(Q,{statusCode:f,data:B})}throw new CM.Boom("Invalid group metadata response: missing node",{data:n})}if(!t.attrs.id)throw new CM.Boom("Invalid group metadata response: missing group id",{data:t});let o=le(t,"description"),i,e,a,A,r,s;o&&(i=jA(o,"body"),a=o.attrs.participant?uA(o.attrs.participant):void 0,A=o.attrs.participant_pn?uA(o.attrs.participant_pn):void 0,r=o.attrs.participant_username||void 0,s=+o.attrs.t,e=o.attrs.id);let g=t.attrs.id.includes("@")?t.attrs.id:yr(t.attrs.id,"g.us"),c=le(t,"ephemeral")?.attrs.expiration,I=jA(t,"member_add_mode")==="all_member_add";return{id:g,notify:t.attrs.notify,addressingMode:t.attrs.addressing_mode==="lid"?yB.LID:yB.PN,subject:t.attrs.subject,subjectOwner:t.attrs.s_o,subjectOwnerPn:t.attrs.s_o_pn,subjectOwnerUsername:t.attrs.s_o_username,subjectTime:+t.attrs.s_t,size:t.attrs.size?+t.attrs.size:PA(t,"participant").length,creation:+t.attrs.creation,owner:t.attrs.creator?uA(t.attrs.creator):void 0,ownerPn:t.attrs.creator_pn?uA(t.attrs.creator_pn):void 0,ownerUsername:t.attrs.creator_username||void 0,owner_country_code:t.attrs.creator_country_code,desc:i,descId:e,descOwner:a,descOwnerPn:A,descOwnerUsername:r,descTime:s,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_group"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:I,participants:PA(t,"participant").map(({attrs:B})=>({id:B.jid,phoneNumber:qA(B.jid)&&_t(B.phone_number)?B.phone_number:void 0,lid:_t(B.jid)&&qA(B.lid)?B.lid:void 0,username:B.participant_username||B.username||void 0,admin:B.type||null})),ephemeralDuration:c?+c:void 0}};var bE=qe(Kr(),1);var V5e=n=>{let{id:t,thread_metadata:o,viewer_metadata:i}=n;return{id:t,owner:void 0,name:o.name.text,creation_time:parseInt(o.creation_time,10),description:o.description.text,invite:o.invite,subscribers:parseInt(o.subscribers_count,10),verification:o.verification,picture:{id:o.picture.id,directPath:o.picture.direct_path},mute_state:i.mute}},W5e=n=>typeof n!="object"||n===null?null:"id"in n&&typeof n.id=="string"?n:"result"in n&&typeof n.result=="object"&&n.result!==null&&"id"in n.result?n.result:null,Hce=n=>{let t=Uce(n),{query:o,generateMessageTag:i}=t,e=(A,r,s)=>Wf(A,r,s,o,i),a=async(A,r)=>{let s={newsletter_id:A,updates:{...r,settings:null}};return e(s,ca.UPDATE_METADATA,"xwa2_newsletter_update")};return{...t,newsletterCreate:async(A,r)=>{let g=await e({input:{name:A,description:r??null}},ca.CREATE,wa.xwa2_newsletter_create);return V5e(g)},newsletterUpdate:a,newsletterSubscribers:async A=>e({newsletter_id:A},ca.SUBSCRIBERS,wa.xwa2_newsletter_subscribers),newsletterMetadata:async(A,r)=>{let s={fetch_creation_time:!0,fetch_full_image:!0,fetch_viewer_metadata:!0,input:{key:r,type:A.toUpperCase()}},g=await e(s,ca.METADATA,wa.xwa2_newsletter_metadata);return W5e(g)},newsletterFollow:A=>e({newsletter_id:A},ca.FOLLOW,wa.xwa2_newsletter_join_v2),newsletterUnfollow:A=>e({newsletter_id:A},ca.UNFOLLOW,wa.xwa2_newsletter_leave_v2),newsletterMute:A=>e({newsletter_id:A},ca.MUTE,wa.xwa2_newsletter_mute_v2),newsletterUnmute:A=>e({newsletter_id:A},ca.UNMUTE,wa.xwa2_newsletter_unmute_v2),newsletterUpdateName:async(A,r)=>await a(A,{name:r}),newsletterUpdateDescription:async(A,r)=>await a(A,{description:r}),newsletterUpdatePicture:async(A,r)=>{let{img:s}=await ub(r);return await a(A,{picture:s.toString("base64")})},newsletterRemovePicture:async A=>await a(A,{picture:""}),newsletterReactMessage:async(A,r,s)=>{await o({tag:"message",attrs:{to:A,...s?{}:{edit:"7"},type:"reaction",server_id:r,id:i()},content:[{tag:"reaction",attrs:s?{code:s}:{}}]})},newsletterFetchMessages:async(A,r,s,g)=>{let c={count:r.toString()};return typeof s=="number"&&(c.since=s.toString()),g&&(c.after=g.toString()),await o({tag:"iq",attrs:{id:i(),type:"get",xmlns:"newsletter",to:A},content:[{tag:"message_updates",attrs:c}]})},subscribeNewsletterUpdates:async A=>{let r=await o({tag:"iq",attrs:{id:i(),type:"set",xmlns:"newsletter",to:A},content:[{tag:"live_updates",attrs:{},content:[]}]}),g=le(r,"live_updates")?.attrs?.duration;return g?{duration:g}:null},newsletterAdminCount:async A=>(await e({newsletter_id:A},ca.ADMIN_COUNT,wa.xwa2_newsletter_admin_count)).admin_count,newsletterChangeOwner:async(A,r)=>{await e({newsletter_id:A,user_id:r},ca.CHANGE_OWNER,wa.xwa2_newsletter_change_owner)},newsletterDemote:async(A,r)=>{await e({newsletter_id:A,user_id:r},ca.DEMOTE,wa.xwa2_newsletter_demote)},newsletterDelete:async A=>{await e({newsletter_id:A},ca.DELETE,wa.xwa2_newsletter_delete_v2)}}};var Kce=n=>{let{logger:t,linkPreviewImageThumbnailWidth:o,generateHighQualityLinkPreview:i,options:e,patchMessageBeforeSending:a,cachedGroupMetadata:A,enableRecentMessageCache:r,maxMsgRetryCount:s}=n,g=Hce(n),{ev:c,authState:I,messageMutex:d,signalRepository:B,upsertMessage:f,query:Q,fetchPrivacySettings:y,sendNode:m,groupMetadata:T,groupToggleEphemeral:_,registerSocketEndHandler:R}=g,K=B.lidMapping.getLIDForPN.bind(B.lidMapping),L=new Set,F=n.userDevicesCache||new $g({stdTTL:mI.USER_DEVICES,useClones:!1}),q=ac(),V=r?new Nb(t,s):null,x=Pce(),G,J=nU,U=async(Be=!1)=>{let Ie=await G;return(!Ie||Be||new Date().getTime()-Ie.fetchDate.getTime()>Ie.ttl*1e3)&&(G=(async()=>{let Xe=await Q({tag:"iq",attrs:{type:"set",xmlns:"w:m",to:OA},content:[{tag:"media_conn",attrs:{}}]}),je=le(Xe,"media_conn"),Oe={hosts:PA(je,"host").map(({attrs:EA})=>({hostname:EA.hostname,maxContentLengthBytes:+EA.maxContentLengthBytes})),auth:je.attrs.auth,ttl:+je.attrs.ttl,fetchDate:new Date};return t.debug("fetched media conn"),Oe.hosts[0]&&(J=Oe.hosts[0].hostname),Oe})()),G},N=async(Be,Ie,Xe,je)=>{if(!Xe||Xe.length===0)throw new bE.Boom("missing ids in receipt");let Oe={tag:"receipt",attrs:{id:Xe[0]}};(je==="read"||je==="read-self")&&(Oe.attrs.t=Oa().toString()),je==="sender"&&(_t(Be)||qA(Be))?(Oe.attrs.recipient=Be,Oe.attrs.to=Ie):(Oe.attrs.to=Be,Ie&&(Oe.attrs.participant=Ie)),je&&(Oe.attrs.type=je);let hA=Xe.slice(1);hA.length&&(Oe.content=[{tag:"list",attrs:{},content:hA.map(iA=>({tag:"item",attrs:{id:iA}}))}]),t.debug({attrs:Oe.attrs,messageIds:Xe},"sending receipt for messages"),await m(Oe)},k=async(Be,Ie)=>{let Xe=zoe(Be);for(let{jid:je,participant:Oe,messageIds:EA}of Xe)await N(je,Oe,EA,Ie)},z=async Be=>{let Xe=(await y()).readreceipts==="all"?"read":"read-self";await k(Be,Xe)},Ae=async(Be,Ie,Xe)=>{let je=[];Ie||t.debug("not using cache for devices");let Oe=[],EA=Be.map(ue=>{let Ne=fA(ue),Ue=Ne?.user,MA=Ne?.device;return typeof MA=="number"&&MA>=0&&Ue?(je.push({user:Ue,device:MA,jid:ue}),null):(ue=uA(ue),{jid:ue,user:Ue})}).filter(ue=>ue!==null),hA;if(Ie&&F.mget){let ue=EA.map(Ne=>Ne?.user).filter(Boolean);hA=await F.mget(ue)}for(let{jid:ue,user:Ne}of EA)if(Ie){let Ue=hA?.[Ne]||(F.mget?void 0:await F.get(Ne));if(Ue){let MA=Ue.map(Ke=>({...Ke,jid:yr(Ke.user,Ke.server,Ke.device)}));je.push(...MA),t.trace({user:Ne},"using cache for devices")}else Oe.push(ue)}else Oe.push(ue);if(!Oe.length)return je;let iA=new Set;for(let ue of Oe)if(qA(ue)||Ia(ue)){let Ne=fA(ue)?.user;Ne&&iA.add(Ne)}let Ze=new rg().withContext("message").withDeviceProtocol().withLIDProtocol();for(let ue of Oe)Ze.withUser(new tg().withId(ue));let bA=await g.executeUSyncQuery(Ze);if(bA){let ue=bA.list.filter(Ke=>!!Ke.lid);if(ue.length>0){t.trace("Storing LID maps from device call"),await B.lidMapping.storeLIDPNMappings(ue.map(Ke=>({lid:Ke.lid,pn:Ke.id})));try{let Ke=ue.map(_A=>_A.lid);Ke.length&&await we(Ke,!0)}catch(Ke){t.warn({e:Ke,count:ue.length},"failed to assert sessions for newly mapped LIDs")}}let Ne=rne(bA?.list,I.creds.me.id,I.creds.me.lid,Xe),Ue={};for(let Ke of Ne)Ue[Ke.user]=Ue[Ke.user]||[],Ue[Ke.user]?.push(Ke);for(let[Ke,_A]of Object.entries(Ue)){let at=iA.has(Ke);for(let wA of _A){let lt=at?yr(Ke,wA.server,wA.device):yr(wA.user,wA.server,wA.device);je.push({...wA,jid:lt}),t.debug({user:wA.user,device:wA.device,finalJid:lt,usedLid:at},"Processed device with LID priority")}}await q.mutex(async()=>{if(F.mset)await F.mset(Object.entries(Ue).map(([Ke,_A])=>({key:Ke,value:_A})));else for(let Ke in Ue)Ue[Ke]&&await F.set(Ke,Ue[Ke])});let MA={};for(let[Ke,_A]of Object.entries(Ue))_A&&_A.length>0&&(MA[Ke]=_A.map(at=>at.device?.toString()||"0"));if(Object.keys(MA).length>0)try{await I.keys.set({"device-list":MA}),t.debug({userCount:Object.keys(MA).length},"stored user device lists for bulk migration")}catch(Ke){t.warn({error:Ke},"failed to store user device lists")}}return je},ie=(Be,Ie)=>fe(Be,{protocolMessage:{type:oe.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE,memberLabel:{label:Ie?.slice(0,30),labelTimestamp:Oa()}}},{additionalNodes:[{tag:"meta",attrs:{tag_reason:"user_update",appdata:"member_tag"},content:void 0}]}),we=async(Be,Ie)=>{let Xe=!1,je=[...new Set(Be)],Oe=[];t.debug({jids:Be},"assertSessions call with jids");for(let EA of je)!Ie&&(await B.validateSession(EA)).exists||Oe.push(EA);if(Oe.length){let EA=[...Oe.filter(iA=>!!qA(iA)||!!Ia(iA)),...(await B.lidMapping.getLIDsForPNs(Oe.filter(iA=>!!_t(iA)||!!mr(iA)))||[]).map(iA=>iA.lid)];t.debug({jidsRequiringFetch:Oe,wireJids:EA},"fetching sessions");let hA=await Q({tag:"iq",attrs:{xmlns:"encrypt",type:"get",to:OA},content:[{tag:"key",attrs:{},content:EA.map(iA=>{let Ze={jid:iA};return Ie&&(Ze.reason="identity"),{tag:"user",attrs:Ze}})}]});await tne(hA,B),Xe=!0}return Xe},se=async Be=>{if(!I.creds.me?.id)throw new bE.Boom("Not authenticated");let Ie={protocolMessage:{peerDataOperationRequestMessage:Be,type:oe.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_MESSAGE}},Xe=uA(I.creds.me.id);return await fe(Xe,Ie,{additionalAttributes:{category:"peer",push_priority:"high_force"},additionalNodes:[{tag:"meta",attrs:{appdata:"default"}}]})},Te=async(Be,Ie,Xe,je)=>{if(!Be.length)return{nodes:[],shouldIncludeDeviceIdentity:!1};let Oe=await a(Ie,Be),EA=Array.isArray(Oe)?Oe:Be.map(Ue=>({recipientJid:Ue,message:Oe})),hA=!1,iA=I.creds.me.id,Ze=I.creds.me?.lid,bA=Ze?fA(Ze)?.user:null,ue=EA.map(async({recipientJid:Ue,message:MA})=>{try{if(!Ue)return null;let Ke=MA;if(je){let{user:lt}=fA(Ue),{user:Er}=fA(iA),UA=bA;(lt===Er||UA&<===UA)&&!(Ue===iA||Ze&&Ue===Ze)&&(Ke=je,t.debug({jid:Ue,targetUser:lt},"Using DSM for own device"))}let _A=fh(Ke),at=Ue;return await x.mutex(at,async()=>{let{type:lt,ciphertext:Er}=await B.encryptMessage({jid:Ue,data:_A});return lt==="pkmsg"&&(hA=!0),{tag:"to",attrs:{jid:Ue},content:[{tag:"enc",attrs:{v:"2",type:lt,...Xe||{}},content:Er}]}})}catch(Ke){return t.error({jid:Ue,err:Ke},"Failed to encrypt for recipient"),null}}),Ne=(await Promise.all(ue)).filter(Ue=>Ue!==null);if(Be.length>0&&Ne.length===0)throw new bE.Boom("All encryptions failed",{statusCode:500});return{nodes:Ne,shouldIncludeDeviceIdentity:hA}},fe=async(Be,Ie,{messageId:Xe,participant:je,additionalAttributes:Oe,additionalNodes:EA,useUserDevicesCache:hA,useCachedGroupMetadata:iA,statusJidList:Ze})=>{let bA=Kne(I.creds),ue=I.creds.me?.lid,Ne=!!je?.jid,Ue=Ne,MA="status@broadcast",{user:Ke,server:_A}=fA(Be),at=_A==="g.us",wA=Be===MA,lt=_A==="lid",Er=_A==="newsletter",UA=at||wA,pe=Be;Xe=Xe||jr(bA),hA=hA!==!1,iA=iA!==!1&&!wA;let Qe=[],be=wA?MA:pe,oA=[],pA=[],FA,Kt={deviceSentMessage:{destinationJid:be,message:Ie},messageContextInfo:Ie.messageContextInfo},st={};if(je){!at&&!wA&&(Oe={...Oe,device_fanout:"false"});let{user:Dr,device:rr}=fA(je.jid);pA.push({user:Dr,device:rr,jid:je.jid})}return await I.keys.transaction(async()=>{let Dr=Re(Ie);if(Dr&&(st.mediatype=Dr),Er){let Ee=a?await a(Ie,[]):Ie,he=Z7(Ee);oA.push({tag:"plaintext",attrs:{},content:he});let ye={tag:"message",attrs:{to:Be,id:Xe,type:ke(Ie),...Oe||{}},content:oA};t.debug({msgId:Xe},`sending newsletter message to ${Be}`),await m(ye);return}if((Na(Ie)?.pinInChatMessage||Na(Ie)?.reactionMessage)&&(st["decrypt-fail"]="hide"),UA&&!Ne){let[Ee,he]=await Promise.all([(async()=>{let tA=iA&&A?await A(Be):void 0;return tA&&Array.isArray(tA?.participants)?t.trace({jid:Be,participants:tA.participants.length},"using cached group metadata"):wA||(tA=await T(Be)),tA})(),(async()=>!je&&!wA?(await I.keys.get("sender-key-memory",[Be]))[Be]||{}:{})()]),ye=Ee?Ee.participants.map(tA=>tA.id):[];Ee?.ephemeralDuration&&Ee.ephemeralDuration>0&&(Oe={...Oe,expiration:Ee.ephemeralDuration.toString()}),wA&&Ze&&ye.push(...Ze);let Je=await Ae(ye,!!hA,!1);pA.push(...Je),at&&(Oe={...Oe,addressing_mode:Ee?.addressingMode||"lid"});let IA=await a(Ie);if(Array.isArray(IA))throw new bE.Boom("Per-jid patching is not supported in groups");let yA=fh(IA);FA=IA;let vA=(Oe?.addressing_mode||Ee?.addressingMode||"lid")==="lid"&&ue?ue:bA,{ciphertext:YA,senderKeyDistributionMessage:$A}=await B.encryptGroupMessage({group:be,data:yA,meId:vA}),Ge=[];for(let tA of pA){let et=tA.jid;(!!!he[et]||je)&&!Ia(et)&&!mr(et)&&tA.device!==99&&(Ge.push(et),he[et]=!0)}if(Ge.length){t.debug({senderKeyJids:Ge},"sending new sender key");let tA={senderKeyDistributionMessage:{axolotlSenderKeyDistributionMessage:$A,groupId:be}};await we(Ge);let Zr=await Te(Ge,tA,st);Ue=Ue||Zr.shouldIncludeDeviceIdentity,Qe.push(...Zr.nodes)}oA.push({tag:"enc",attrs:{v:"2",type:"skmsg",...st},content:YA}),await I.keys.set({"sender-key-memory":{[Be]:he}})}else{let Ee=bA;lt&&ue?(Ee=ue,t.debug({to:Be,ownId:Ee},"Using LID identity for @lid conversation")):t.debug({to:Be,ownId:Ee},"Using PN identity for @s.whatsapp.net conversation");let{user:he}=fA(Ee);if(!je){let tA=await a(Ie,[Be]);FA=Array.isArray(tA)?tA.find(et=>et.recipientJid===Be)||tA[0]:tA}if(!Ne){let tA=lt?"lid":"s.whatsapp.net";if(pA.push({user:Ke,device:0,jid:yr(Ke,tA,0)}),Ke!==he){let et=lt?"lid":"s.whatsapp.net",Zr=lt&&ue?fA(ue).user:fA(bA).user;pA.push({user:Zr,device:0,jid:yr(Zr,et,0)})}if(Oe?.category!=="peer"){pA.length=0;let et=lt&&ue?yr(fA(ue)?.user,"lid",void 0):yr(fA(bA)?.user,"s.whatsapp.net",void 0),Zr=await Ae([et,Be],!0,!1);pA.push(...Zr),t.debug({deviceCount:pA.length,devices:pA.map(ar=>`${ar.user}:${ar.device}@${fA(ar.jid)?.server}`)},"Device enumeration complete with unified addressing")}}let ye=[],Je=[],IA=[],{user:yA}=fA(bA),{user:XA}=ue?fA(ue):{user:null};for(let{user:tA,jid:et}of pA){if(et===bA||ue&&et===ue){t.debug({jid:et,meId:bA,meLid:ue},"Skipping exact sender device (whatsmeow pattern)");continue}tA===yA||tA===XA?Je.push(et):IA.push(et),ye.push(et)}await we(ye);let[{nodes:vA,shouldIncludeDeviceIdentity:YA},{nodes:$A,shouldIncludeDeviceIdentity:Ge}]=await Promise.all([Te(Je,Kt||Ie,st),Te(IA,Ie,st,Kt)]);Qe.push(...vA),Qe.push(...$A),(Je.length>0||IA.length>0)&&(st.phash=H7([...Je,...IA])),Ue=Ue||YA||Ge}if(Ne){let Ee=qA(je.jid),he=Rt(je.jid,Ee?ue:bA),ye=Ie;if(UA){let XA;if(ue&&await B.hasSenderKey({group:be,meId:ue})?XA=ue:await B.hasSenderKey({group:be,meId:bA})&&(XA=bA),XA)try{let vA=await B.getSenderKeyDistributionMessage({group:be,meId:XA});ye={...Ie,senderKeyDistributionMessage:{groupId:be,axolotlSenderKeyDistributionMessage:vA}}}catch(vA){t.warn({err:vA,jid:be},"failed to build SKDM for retry, sending without it")}}let Je=he?fh({deviceSentMessage:{destinationJid:be,message:ye}}):fh(ye),{type:IA,ciphertext:yA}=await B.encryptMessage({data:Je,jid:je.jid});oA.push({tag:"enc",attrs:{v:"2",type:IA,count:je.count.toString()},content:yA})}if(Qe.length)if(Oe?.category==="peer"){let Ee=Qe[0]?.content?.[0];Ee&&oA.push(Ee)}else oA.push({tag:"participants",attrs:{},content:Qe});let rr={tag:"message",attrs:{id:Xe,to:be,type:ke(Ie),...Oe||{}},content:oA};if(je?xr(be)?(rr.attrs.to=be,rr.attrs.participant=je.jid):Rt(je.jid,bA)?(rr.attrs.to=je.jid,rr.attrs.recipient=be):rr.attrs.to=je.jid:rr.attrs.to=be,Ue&&(rr.content.push({tag:"device-identity",attrs:{},content:kf(I.creds.account,!0)}),t.debug({jid:Be},"adding device identity")),!Er&&!Ne&&FA?.messageContextInfo?.messageSecret&&Qb(FA))try{let Ee=fh(FA),he={id:Xe,fromMe:!0,remoteJid:be,participant:je?.jid},ye=await xoe(Ee,FA,he);ye&&(rr.content.push(ye),t.trace({jid:Be},"added reporting token to message"))}catch(Ee){t.warn({jid:Be,trace:Ee?.stack},"failed to attach reporting token")}let Qo=Oe?.category==="peer",$i=!at&&!Ne&&!wA&&!Er&&!Qo,ee=$i?await Xs(be,K):be,X=($i?await I.keys.get("tctoken",[ee]):{})[ee],re=X?.token;if(re?.length&&gp(X?.timestamp)){t.debug({jid:be,timestamp:X?.timestamp},"tctoken expired, clearing"),re=void 0;let Ee=X?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:X.senderTimestamp}:null;try{await I.keys.set({tctoken:{[ee]:Ee}})}catch(he){t.debug({jid:be,err:he?.message},"failed to persist tctoken expiry cleanup")}}re?.length&&g.serverProps.privacyTokenOn1to1&&rr.content.push({tag:"tctoken",attrs:{},content:re}),EA&&EA.length>0&&rr.content.push(...EA),t.debug({msgId:Xe},`sending message to ${Qe.length} devices`),await m(rr);let ne=!!Na(Ie)?.protocolMessage,Se=be===i7||n7(be)||ph(be);if($i&&!ne&&!Se&&qne(X?.senderTimestamp)&&!L.has(ee)){L.add(ee);let Ee=Oa(),he=B.lidMapping.getPNForLID.bind(B.lidMapping);Lf(be,g.serverProps.lidTrustedTokenIssueToLid,K,he).then(ye=>We([ye],Ee)).then(async ye=>{await hE({result:ye,fallbackJid:ee,keys:I.keys,getLIDForPN:K});let IA=(await I.keys.get("tctoken",[ee]))[ee],yA=await dE(I.keys,[ee]);await I.keys.set({tctoken:{[ee]:{token:Buffer.alloc(0),...IA,senderTimestamp:Ee},...yA}})}).catch(ye=>{t.debug({jid:be,err:ye?.message},"fire-and-forget tctoken issuance failed")}).finally(()=>{L.delete(ee)})}V&&!je&&V.addRecentMessage(be,Xe,Ie)},bA),Xe},ke=Be=>{let Ie=Na(Be);return Ie?Ie.reactionMessage||Ie.encReactionMessage?"reaction":Ie.pollCreationMessage||Ie.pollCreationMessageV2||Ie.pollCreationMessageV3||Ie.pollUpdateMessage?"poll":Ie.eventMessage?"event":Re(Ie)!==""?"media":"text":"text"},Re=Be=>Be.imageMessage?"image":Be.videoMessage?Be.videoMessage.gifPlayback?"gif":"video":Be.audioMessage?Be.audioMessage.ptt?"ptt":"audio":Be.contactMessage?"vcard":Be.documentMessage?"document":Be.contactsArrayMessage?"contact_array":Be.liveLocationMessage?"livelocation":Be.stickerMessage?"sticker":Be.listMessage?"list":Be.listResponseMessage?"list_response":Be.buttonsResponseMessage?"buttons_response":Be.orderMessage?"order":Be.productMessage?"product":Be.interactiveResponseMessage?"native_flow_response":Be.groupInviteMessage?"url":"",We=async(Be,Ie)=>{let Xe=(Ie??Oa()).toString();return await Q({tag:"iq",attrs:{to:OA,type:"set",xmlns:"privacy"},content:[{tag:"tokens",attrs:{},content:Be.map(Oe=>({tag:"token",attrs:{jid:uA(Oe),t:Xe,type:"trusted_contact"}}))}]})},ve=koe(n,U),aA=VF(c,"messages.media-update");return R(()=>{!n.userDevicesCache&&F.close&&F.close(),G=void 0,V&&V.clear()}),{...g,userDevicesCache:F,devicesMutex:q,issuePrivacyTokens:We,assertSessions:we,relayMessage:fe,sendReceipt:N,sendReceipts:k,readMessages:z,refreshMediaConn:U,getMediaHost:()=>J,waUploadToServer:ve,fetchPrivacySettings:y,sendPeerDataOperationMessage:se,createParticipantNodes:Te,getUSyncDevices:Ae,messageRetryManager:V,updateMemberLabel:ie,updateMediaMessage:async Be=>{let Ie=Voe(Be.message),Xe=Ie.mediaKey,je=I.creds.me.id,Oe=Poe(Be.key,Xe,je),EA;if(await Promise.all([m(Oe),aA(async hA=>{let iA=hA.find(Ze=>Ze.key.id===Be.key.id);if(iA){if(iA.error)EA=iA.error;else try{let Ze=Foe(iA.media,Xe,iA.key.id);if(Ze.result!==oe.MediaRetryNotification.ResultType.SUCCESS){let bA=oe.MediaRetryNotification.ResultType[Ze.result];throw new bE.Boom(`Media re-upload failed by device (${bA})`,{data:Ze,statusCode:sU(Ze.result)||404})}Ie.directPath=Ze.directPath,Ie.url=bf(Ie.directPath,J),t.debug({directPath:Ze.directPath,key:iA.key},"media update successful")}catch(Ze){EA=Ze}return!0}})]),EA)throw EA;return c.emit("messages.update",[{key:Be.key,update:{message:Be.message}}]),Be},sendMessage:async(Be,Ie,Xe={})=>{let je=I.creds.me.id;if(typeof Ie=="object"&&"disappearingMessagesInChat"in Ie&&typeof Ie.disappearingMessagesInChat<"u"&&xr(Be)){let{disappearingMessagesInChat:Oe}=Ie;await _(Be,typeof Oe=="boolean"?Oe?Nf:0:Oe)}else{let Oe=await Joe(Be,Ie,{logger:t,userJid:je,getUrlInfo:Ue=>Jne(Ue,{thumbnailWidth:o,fetchOpts:{timeout:3e3,...e||{}},logger:t,uploadImage:i?ve:void 0}),getProfilePicUrl:g.profilePictureUrl,getCallLink:g.createCallLink,upload:ve,mediaCache:n.mediaCache,options:n.options,messageId:jr(g.user?.id),...Xe}),EA="event"in Ie&&!!Ie.event,hA="delete"in Ie&&!!Ie.delete,iA="edit"in Ie&&!!Ie.edit,Ze="pin"in Ie&&!!Ie.pin,bA="poll"in Ie&&!!Ie.poll,ue={},Ne=[];return hA?xr(Ie.delete?.remoteJid)&&!Ie.delete?.fromMe?ue.edit="8":ue.edit="7":iA?ue.edit="1":Ze?ue.edit="2":bA?Ne.push({tag:"meta",attrs:{polltype:"creation"}}):EA&&Ne.push({tag:"meta",attrs:{event_type:"creation"}}),await fe(Be,Oe.message,{messageId:Oe.key.id,useCachedGroupMetadata:Xe.useCachedGroupMetadata,additionalAttributes:ue,statusJidList:Xe.statusJidList,additionalNodes:Ne}),n.emitOwnEvents&&process.nextTick(async()=>{await d.mutex(()=>f(Oe,"append"))}),Oe}}}};var Z5e=new Set(Object.values(Vc));function X5e(n){return typeof n=="string"&&Z5e.has(n)}var xce=n=>{let{logger:t,retryRequestDelayMs:o,maxMsgRetryCount:i,getMessage:e,shouldIgnoreJid:a,enableAutoSessionRecreation:A}=n,r=Kce(n),{userDevicesCache:s,devicesMutex:g,ev:c,authState:I,ws:d,messageMutex:B,notificationMutex:f,receiptMutex:Q,signalRepository:y,query:m,upsertMessage:T,resyncAppState:_,onUnexpectedError:R,assertSessions:K,sendNode:L,relayMessage:F,sendReceipt:q,uploadPreKeys:V,sendPeerDataOperationMessage:x,messageRetryManager:G,registerSocketEndHandler:J,issuePrivacyTokens:U,fetchAccountReachoutTimelock:N,placeholderResendCache:k}=r,z=y.lidMapping.getLIDForPN.bind(y.lidMapping),Ae=ac(),ie=n.msgRetryCounterCache||new $g({stdTTL:mI.MSG_RETRY,useClones:!1}),we=n.callOfferCache||new $g({stdTTL:mI.CALL_OFFER,useClones:!1}),se=new $g({stdTTL:5,useClones:!1}),Te=!1,fe=async(ee,W,X)=>{if(!I.creds.me?.id)throw new Zf.Boom("Not authenticated");let re={historySyncOnDemandRequest:{chatJid:W.remoteJid,oldestMsgFromMe:W.fromMe,oldestMsgId:W.id,oldestMsgTimestampMs:X,onDemandMsgCount:ee},peerDataOperationRequestType:oe.Message.PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND};return x(re)},ke=async(ee,W)=>{if(!I.creds.me?.id)throw new Zf.Boom("Not authenticated");if(await k.get(ee?.id)){t.debug({messageKey:ee},"already requested resend");return}else await k.set(ee?.id,W||!0);if(await kB(2e3),!await k.get(ee?.id))return t.debug({messageKey:ee},"message received while resend requested"),"RESOLVED";let X={placeholderMessageResendRequest:[{messageKey:ee}],peerDataOperationRequestType:oe.Message.PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND};return setTimeout(async()=>{await k.get(ee?.id)&&(t.debug({messageKey:ee},"PDO message without response after 8 seconds. Phone possibly offline"),await k.del(ee?.id))},8e3),x(X)},Re=async ee=>{let W=le(ee,"update");if(W){let X=W.attrs?.op_name;if(!X){t.warn({node:Gn(ee)},"mex notification missing op_name, fallback to legacy"),await aA(ee);return}let re;try{re=JSON.parse(W.content.toString())}catch(Se){t.error({err:Se,opName:X},"failed to parse mex notification JSON");return}if(re.errors?.length){t.warn({errors:re.errors,opName:X},"mex notification has GQL errors");return}let ne=re.data;if(!ne){t.warn({opName:X},"mex notification has null data");return}switch(t.debug({opName:X},"processing mex notification"),X){case"NotificationUserReachoutTimelockUpdate":We(ne);break;case"MessageCappingInfoNotification":ve(ne);break;case"NotificationNewsletterUpdate":case"NotificationLinkedProfilesUpdates":case"NotificationNewsletterAdminPromote":case"NotificationNewsletterAdminDemote":case"NotificationNewsletterUserSettingChange":case"NotificationNewsletterJoin":case"NotificationNewsletterLeave":case"NotificationNewsletterStateChange":case"NotificationNewsletterAdminMetadataUpdate":case"NotificationNewsletterOwnerUpdate":case"NotificationNewsletterAdminInviteRevoke":case"NotificationNewsletterWamoSubStatusChange":case"NotificationNewsletterBlockUser":case"NotificationNewsletterPaidPartnership":case"NotificationNewsletterMilestone":case"NewsletterResponseStateUpdate":await aA(ee);break;default:t.debug({opName:X},"unhandled mex notification");break}return}await aA(ee)},We=ee=>{let W=ee.xwa2_notify_account_reachout_timelock;if(!W){t.warn("reachout timelock notification missing payload");return}if(!W.is_active){t.info("reachout timelock restriction lifted"),c.emit("connection.update",{reachoutTimeLock:{isActive:!1,enforcementType:Vc.DEFAULT}});return}let X=W.time_enforcement_ends?new Date(parseInt(W.time_enforcement_ends,10)*1e3):new Date(Date.now()+6e4),re=X5e(W.enforcement_type)?W.enforcement_type:Vc.DEFAULT;t.info({enforcementType:re,timeEnforcementEnds:X},"reachout timelock restriction set"),c.emit("connection.update",{reachoutTimeLock:{isActive:!0,timeEnforcementEnds:X,enforcementType:re}})},ve=ee=>{let W=ee.xwa2_notify_new_chat_messages_capping_info_update;if(!W){t.warn("message capping notification missing payload");return}t.info({payload:W},"received message capping update"),c.emit("message-capping.update",W)},aA=async ee=>{let W=le(ee,"mex"),X=W?.content?null:le(ee,"update")||_s(ee)[0],re=W?.content?W:X;if(!re?.content){t.warn({node:Gn(ee)},"invalid mex newsletter notification");return}let ne;try{let he=re.content;if(Array.isArray(he)){t.warn({payloadNode:re},"invalid mex newsletter notification payload format");return}let ye=typeof he=="string"?Buffer.from(he,"binary"):Buffer.from(he);ne=JSON.parse(ye.toString())}catch(he){t.error({err:he,node:Gn(ee)},"failed to parse mex newsletter notification");return}let Se=ne?.operation??re?.attrs?.op_name,Ee=ne?.updates;if(!Ee){let he=ne?.data?.xwa2_notify_linked_profiles;he&&(Ee=[he])}if(!Ee||!Se){t.warn({data:ne},"invalid mex newsletter notification content");return}switch(t.info({operation:Se,updates:Ee},"got mex newsletter notification"),Se){case"NotificationNewsletterUpdate":for(let he of Ee)he.jid&&he.settings&&Object.keys(he.settings).length>0&&c.emit("newsletter-settings.update",{id:he.jid,update:he.settings});break;case"NotificationNewsletterAdminPromote":for(let he of Ee)he.jid&&he.user&&c.emit("newsletter-participants.update",{id:he.jid,author:ee.attrs.from,user:he.user,new_role:"ADMIN",action:"promote"});break;case"NotificationLinkedProfilesUpdates":for(let he of Ee){let ye=he?.jid,Je=Array.isArray(he?.added_profiles)?he.added_profiles:[],IA=[];for(let yA of Je){let XA=typeof yA=="string"?yA:yA?.pn??yA?.jid??null;if(ye&&XA){let vA={lid:ye,pn:XA};c.emit("lid-mapping.update",vA),IA.push(vA)}}await y.lidMapping.storeLIDPNMappings(IA)}break;default:t.info({operation:Se,data:ne},"unhandled mex newsletter notification");break}},Be=async ee=>{let W=ee.attrs.from,X=_s(ee),re=ee.attrs.participant;for(let ne of X)switch(t.debug({from:W,child:ne},"got newsletter notification"),ne.tag){case"reaction":{let Se={id:W,server_id:ne.attrs.message_id,reaction:{code:jA(ne,"reaction"),count:1}};c.emit("newsletter.reaction",Se);break}case"view":{let Se={id:W,server_id:ne.attrs.message_id,count:parseInt(ne.content?.toString()||"0",10)};c.emit("newsletter.view",Se);break}case"participant":{let Se={id:W,author:re,user:ne.attrs.jid,action:ne.attrs.action,new_role:ne.attrs.role};c.emit("newsletter-participants.update",Se);break}case"update":{let Se=le(ne,"settings");if(Se){let Ee={},he=le(Se,"name");he?.content&&(Ee.name=he.content.toString());let ye=le(Se,"description");ye?.content&&(Ee.description=ye.content.toString()),c.emit("newsletter-settings.update",{id:W,update:Ee})}break}case"message":{let Se=le(ne,"plaintext");if(Se?.content)try{let Ee=typeof Se.content=="string"?Buffer.from(Se.content,"binary"):Buffer.from(Se.content),he=oe.Message.decode(Ee).toJSON(),ye=oe.WebMessageInfo.fromObject({key:{remoteJid:W,id:ne.attrs.message_id||ne.attrs.server_id,fromMe:!1},message:he,messageTimestamp:+ne.attrs.t}).toJSON();await T(ye,"append"),t.debug("Processed plaintext newsletter message")}catch(Ee){t.error({error:Ee},"Failed to decode plaintext newsletter message")}break}default:t.warn({node:ee,child:ne},"Unknown newsletter notification child");break}},Ie=async(ee,W)=>{let X=Ase(ee,W,I.creds.me.id);t.debug({recv:{tag:ee.tag,attrs:ee.attrs},sent:X.attrs},"sent ack"),await L(X)},Xe=async(ee,W)=>{let X={tag:"call",attrs:{from:I.creds.me.id,to:W},content:[{tag:"reject",attrs:{"call-id":ee,"call-creator":W,count:"0"},content:void 0}]};await m(X)},je=async(ee,W=!1)=>{let{fullMessage:X}=ZF(ee,I.creds.me.id,I.creds.me.lid||""),{key:re}=X,ne=re.id;if(G){if(G.hasExceededMaxRetries(ne)){t.debug({msgId:ne},"reached retry limit with new retry manager, clearing"),G.markRetryFailed(ne);return}let YA=G.incrementRetryCount(ne),$A=`${ne}:${re?.participant}`;await ie.set($A,YA)}else{let YA=`${ne}:${re?.participant}`,$A=await ie.get(YA)||0;if($A>=i){t.debug({retryCount:$A,msgId:ne},"reached retry limit, clearing"),await ie.del(YA);return}$A+=1,await ie.set(YA,$A)}let Se=`${ne}:${re?.participant}`,Ee=await ie.get(Se)||1,{account:he,signedPreKey:ye,signedIdentityKey:Je}=I.creds,IA=ee.attrs.from,yA=!1,XA="";if(A&&G&&Ee>1)try{let YA=y.jidToSignalProtocolAddress(IA),$A=await y.validateSession(IA),Ge=G.shouldRecreateSession(IA,$A.exists);yA=Ge.recreate,XA=Ge.reason,yA&&(t.debug({fromJid:IA,retryCount:Ee,reason:XA},"recreating session for retry"),await I.keys.set({session:{[YA]:null}}),W=!0)}catch(YA){t.warn({error:YA,fromJid:IA},"failed to check session recreation")}if(Ee<=2)if(G)G.schedulePhoneRequest(ne,async()=>{try{let YA=await ke(re);t.debug(`sendRetryRequest: requested placeholder resend (${YA}) for message ${ne} (scheduled)`)}catch(YA){t.warn({error:YA,msgId:ne},"failed to send scheduled phone request")}});else{let YA=await ke(re);t.debug(`sendRetryRequest: requested placeholder resend for message ${YA}`)}let vA=kf(he,!0);await I.keys.transaction(async()=>{let YA={tag:"receipt",attrs:{id:ne,type:"retry",to:ee.attrs.from},content:[{tag:"retry",attrs:{count:Ee.toString(),id:ee.attrs.id,t:ee.attrs.t,v:"1",error:"0"}},{tag:"registration",attrs:{},content:Kg(I.creds.registrationId)}]};if(ee.attrs.recipient&&(YA.attrs.recipient=ee.attrs.recipient),ee.attrs.participant&&(YA.attrs.participant=ee.attrs.participant),Ee>1||W||yA){let{update:$A,preKeys:Ge}=await uU(I,1),[tA]=Object.keys(Ge),et=Ge[+tA];YA.content.push({tag:"keys",attrs:{},content:[{tag:"type",attrs:{},content:Buffer.from(Hg)},{tag:"identity",attrs:{},content:Je.public},CU(et,+tA),Rf(ye),{tag:"device-identity",attrs:{},content:vA}]}),c.emit("creds.update",$A)}await L(YA),t.info({msgAttrs:ee.attrs,retryCount:Ee},"sent retry receipt")},I?.creds?.me?.id||"sendRetryRequest")},Oe=new Set,EA=ee=>{(async()=>{let W=uA(ee),X=await Xs(W,z),ne=(await I.keys.get("tctoken",[X]))?.[X]?.senderTimestamp;if(ne==null||gp(ne))return;t.debug({jid:W,senderTimestamp:ne},"identity changed, re-issuing tctoken");let Se=y.lidMapping.getPNForLID.bind(y.lidMapping),Ee=await Lf(W,r.serverProps.lidTrustedTokenIssueToLid,z,Se),he=await U([Ee],ne);await hE({result:he,fallbackJid:X,keys:I.keys,getLIDForPN:z,onNewJidStored:_A})})().catch(W=>{t.debug({jid:ee,err:W?.message},"failed to re-issue tctoken after identity change")})},hA=async ee=>{if(ee.attrs.from===OA){let X=ee.attrs.id;if(X&&Oe.has(X))return;let ne=+le(ee,"count").attrs.value,Se=ne{let re=ee.attrs.participant,ne=ee.attrs.participant_pn,Se=ee.attrs.participant_username,Ee=le(W,"participant")?.attrs?.jid||re,he=le(W,"participant")?.attrs?.phone_number||ne;switch(W?.tag){case"create":let ye=OE(W);X.messageStubType=RA.GROUP_CREATE,X.messageStubParameters=[ye.subject],X.key={participant:ye.owner,participantAlt:ye.ownerPn},c.emit("chats.upsert",[{id:ye.id,name:ye.subject,conversationTimestamp:ye.creation}]),c.emit("groups.upsert",[{...ye,author:re,authorPn:ne,authorUsername:Se}]);break;case"ephemeral":case"not_ephemeral":X.message={protocolMessage:{type:oe.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:+(W.attrs.expiration||0)}};break;case"modify":let Je=PA(W,"participant").map(Ge=>Ge.attrs.jid);X.messageStubParameters=Je||[],X.messageStubType=RA.GROUP_PARTICIPANT_CHANGE_NUMBER;break;case"promote":case"demote":case"remove":case"add":case"leave":let IA=`GROUP_PARTICIPANT_${W.tag.toUpperCase()}`;X.messageStubType=RA[IA];let yA=PA(W,"participant").map(({attrs:Ge})=>({id:Ge.jid,phoneNumber:qA(Ge.jid)&&_t(Ge.phone_number)?Ge.phone_number:void 0,lid:_t(Ge.jid)&&qA(Ge.lid)?Ge.lid:void 0,username:Ge.participant_username||Ge.username||void 0,admin:Ge.type||null}));yA.length===1&&(Rt(yA[0].id,re)||Rt(yA[0].id,ne))&&W.tag==="remove"&&(X.messageStubType=RA.GROUP_PARTICIPANT_LEAVE),X.messageStubParameters=yA.map(Ge=>JSON.stringify(Ge));break;case"subject":X.messageStubType=RA.GROUP_CHANGE_SUBJECT,X.messageStubParameters=[W.attrs.subject];break;case"description":let XA=le(W,"body")?.content?.toString();X.messageStubType=RA.GROUP_CHANGE_DESCRIPTION,X.messageStubParameters=XA?[XA]:void 0;break;case"announcement":case"not_announcement":X.messageStubType=RA.GROUP_CHANGE_ANNOUNCE,X.messageStubParameters=[W.tag==="announcement"?"on":"off"];break;case"locked":case"unlocked":X.messageStubType=RA.GROUP_CHANGE_RESTRICT,X.messageStubParameters=[W.tag==="locked"?"on":"off"];break;case"invite":X.messageStubType=RA.GROUP_CHANGE_INVITE_LINK,X.messageStubParameters=[W.attrs.code];break;case"member_add_mode":let vA=W.content;vA&&(X.messageStubType=RA.GROUP_MEMBER_ADD_MODE,X.messageStubParameters=[vA.toString()]);break;case"membership_approval_mode":let YA=le(W,"group_join");YA&&(X.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE,X.messageStubParameters=[YA.attrs.state]);break;case"created_membership_requests":X.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,X.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),"created",W.attrs.request_method];break;case"revoked_membership_requests":let $A=Rt(Ee,re);X.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,X.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),$A?"revoked":"rejected"];break}},Ze=async ee=>{let[W]=_s(ee),X=uA(ee.attrs.from);if(!W){t.debug({from:X},"devices notification missing child, skipping");return}let re=W.tag,ne=W.attrs.device_hash,Se=PA(W,"device");if(Rt(X,I.creds.me.id)||Rt(X,I.creds.me.lid)){let he=Se.map(ye=>ye.attrs.jid);t.info({deviceJids:he},"got my own devices")}if(!Se.length){t.debug({from:X,tag:re},"no devices in notification, skipping");return}let Ee=[];for(let he of Se){let ye=he.attrs.jid;if(!ye)continue;let Je=fA(ye);if(!Je){t.debug({jid:ye},"failed to decode device jid, skipping");continue}Ee.push({jid:ye,user:Je.user,server:Je.server,device:Je.device})}Ee.length&&await g.mutex(async()=>{let he=new Map;for(let ye of Ee){let Je=he.get(ye.user)||[];Je.push(ye),he.set(ye.user,Je)}for(let[ye,Je]of he){if(re==="update"){t.debug({user:ye},`${ye}'s device list updated, dropping cached devices`),await s?.del(ye);continue}re==="remove"&&await y.deleteSession(Je.map(vA=>vA.jid));let IA=await s?.get(ye)||[];if(!IA.length){t.debug({user:ye,tag:re},"device list not cached, deferring to USync refresh");continue}let yA=new Set(Je.map(vA=>vA.device)),XA;switch(re){case"add":t.info({deviceHash:ne,count:Je.length},"devices added"),XA=[...IA.filter(vA=>!yA.has(vA.device)),...Je.map(vA=>({user:vA.user,server:vA.server,device:vA.device}))];break;case"remove":t.info({deviceHash:ne,count:Je.length},"devices removed"),XA=IA.filter(vA=>!yA.has(vA.device));break;default:t.debug({tag:re},"Unknown device list change tag");continue}XA.length===0?await s?.del(ye):await s?.set(ye,XA)}})},bA=async ee=>{let W={},[X]=_s(ee),re=ee.attrs.type,ne=uA(ee.attrs.from);switch(re){case"newsletter":await Be(ee);break;case"mex":await Re(ee);break;case"w:gp2":iA(ee,X,W);break;case"mediaretry":let Se=Goe(ee);c.emit("messages.media-update",[Se]);break;case"encrypt":await hA(ee);break;case"devices":try{await Ze(ee)}catch(mo){t.error({error:mo,node:ee},"failed to handle devices notification")}break;case"server_sync":let Ee=le(ee,"collection");if(Ee){let mo=Ee.attrs.name;await _([mo],!1)}break;case"picture":let he=le(ee,"set"),ye=le(ee,"delete");if(c.emit("contacts.update",[{id:uA(ee?.attrs?.from)||(he||ye)?.attrs?.hash||"",imgUrl:he?"changed":"removed"}]),xr(ne)){let mo=he||ye;W.messageStubType=RA.GROUP_CHANGE_ICON,he&&(W.messageStubParameters=[he.attrs.id]),W.participant=mo?.attrs.author,W.key={...W.key||{},participant:he?.attrs.author}}break;case"account_sync":if(X.tag==="disappearing_mode"){let mo=+X.attrs.duration,yp=+X.attrs.t;t.info({newDuration:mo},"updated account disappearing mode"),c.emit("creds.update",{accountSettings:{...I.creds.accountSettings,defaultDisappearingMode:{ephemeralExpiration:mo,ephemeralSettingTimestamp:yp}}})}else if(X.tag==="blocklist"){let mo=PA(X,"item");for(let{attrs:yp}of mo){let bM=[yp.jid],MM=yp.action==="block"?"add":"remove";c.emit("blocklist.update",{blocklist:bM,type:MM})}}break;case"link_code_companion_reg":let Je=le(ee,"link_code_companion_reg"),IA=lt(Da(Je,"link_code_pairing_ref")),yA=lt(Da(Je,"primary_identity_pub")),XA=lt(Da(Je,"link_code_pairing_wrapped_primary_ephemeral_pub")),vA=await wA(XA),YA=Sr.sharedKey(I.creds.pairingEphemeralKeyPair.private,vA),$A=VH(32),Ge=VH(32),tA=Un(YA,32,{salt:Ge,info:"link_code_pairing_key_bundle_encryption_key"}),et=Buffer.concat([Buffer.from(I.creds.signedIdentityKey.public),yA,$A]),Zr=VH(12),ar=Pl(et,tA,Zr,Buffer.alloc(0)),yo=Buffer.concat([Ge,Zr,ar]),DM=Sr.sharedKey(I.creds.signedIdentityKey.private,yA),OM=Buffer.concat([YA,DM,$A]);I.creds.advSecretKey=Buffer.from(Un(OM,32,{info:"adv_secret"})).toString("base64"),await m({tag:"iq",attrs:{to:OA,type:"set",id:r.generateMessageTag(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:I.creds.me.id,stage:"companion_finish"},content:[{tag:"link_code_pairing_wrapped_key_bundle",attrs:{},content:yo},{tag:"companion_identity_public",attrs:{},content:I.creds.signedIdentityKey.public},{tag:"link_code_pairing_ref",attrs:{},content:IA}]}]}),I.creds.registered=!0,c.emit("creds.update",I.creds);break;case"privacy_token":await at(ee);break}if(Object.keys(W).length)return W},ue=new Set,Ne=(async()=>{try{let ee=await _b(I.keys);for(let W of ee)ue.add(W);t.debug({count:ue.size},"loaded tctoken index")}catch(ee){t.warn({err:ee?.message},"failed to load tctoken index")}})(),Ue;async function MA(){Ue&&(clearTimeout(Ue),Ue=void 0);let ee=await dE(I.keys,ue);return I.keys.set({tctoken:ee})}function Ke(){Ue&&clearTimeout(Ue),Ue=setTimeout(()=>{Ue=void 0,MA().catch(ee=>{t.warn({err:ee?.message},"failed to save tctoken index")})},5e3)}function _A(ee){ee&&ee!==SI&&!ue.has(ee)&&(ue.add(ee),Ke())}let at=async ee=>{if(!le(ee,"tokens"))return;let X=uA(ee.attrs.from),ne=(ee.attrs.sender_lid&&qA(uA(ee.attrs.sender_lid))?uA(ee.attrs.sender_lid):void 0)??await Xs(X,z);t.debug({from:X,storageJid:ne},"processing privacy token notification"),await hE({result:ee,fallbackJid:ne,keys:I.keys,getLIDForPN:z,onNewJidStored:_A})};async function wA(ee){let W=lt(ee),X=W.slice(0,32),re=await hD(I.creds.pairingCode,X),ne=W.slice(32,48),Se=W.slice(48,80);return k7(Se,re,ne)}function lt(ee){if(ee===void 0)throw new Zf.Boom("Invalid buffer",{statusCode:400});return ee instanceof Buffer?ee:Buffer.from(ee)}let Er=async(ee,W)=>{let X=`${ee}:${W}`;return(await ie.get(X)||0){let X=`${ee}:${W}`,re=(await ie.get(X)||0)+1;await ie.set(X,re)},pe=async(ee,W,X,re)=>{let ne=ee.remoteJid,Se=ee.participant||ne,Ee=+X.attrs.count||1,he=W[0],ye=[];for(let Ge of W){let tA;if(G){let et=G.getRecentMessage(ne,Ge);et&&(tA=et.message,t.debug({jid:ne,id:Ge},"found message in retry cache"),G.markRetrySuccess(Ge))}tA||(tA=await e({...ee,id:Ge}),tA&&(t.debug({jid:ne,id:Ge},"found message via getMessage"),G&&G.markRetrySuccess(Ge))),ye.push(tA)}let Je=!fA(Se)?.device,IA=y.jidToSignalProtocolAddress(Se),yA=!1,XA=Ane(re);if(XA)try{await y.injectE2ESession({jid:Se,session:XA}),yA=!0,t.debug({participant:Se,retryCount:Ee},"injected session from retry receipt key bundle")}catch(Ge){t.warn({error:Ge,participant:Se},"failed to inject session from retry receipt")}if(!yA){let Ge=Zc(re,"registration",4);if(typeof Ge=="number"&&Number.isInteger(Ge)){let tA=await y.getSessionInfo(Se);tA&&tA.registrationId!==0&&tA.registrationId!==Ge&&(t.info({participant:Se,stored:tA.registrationId,received:Ge},"reg id mismatch on retry without bundle, deleting session"),await I.keys.set({session:{[IA]:null}}))}}let vA=2;if(he&&G){let Ge=await y.getSessionInfo(Se);Ge&&(Ee===vA?G.saveBaseKey(IA,he,Ge.baseKey):Ee>vA&&(G.hasSameBaseKey(IA,he,Ge.baseKey)&&(t.warn({participant:Se,retryCount:Ee},"base key collision on retry, forcing fresh session"),await I.keys.set({session:{[IA]:null}})),G.deleteBaseKey(IA,he)))}let YA=!1,$A="";if(A&&G&&Ee>1&&!yA)try{let Ge=await y.validateSession(Se),tA=G.shouldRecreateSession(Se,Ge.exists);YA=tA.recreate,$A=tA.reason,YA&&(t.debug({participant:Se,retryCount:Ee,reason:$A},"recreating session for outgoing retry"),await I.keys.set({session:{[IA]:null}}))}catch(Ge){t.warn({error:Ge,participant:Se},"failed to check session recreation for outgoing retry")}yA||await K([Se],!0),xr(ne)&&await I.keys.set({"sender-key-memory":{[ne]:null}}),t.debug({participant:Se,sendToAll:Je,shouldRecreateSession:YA,recreateReason:$A,injectedFromBundle:yA},"prepared session for retry resend");for(let[Ge,tA]of ye.entries())if(W[Ge])if(tA&&await Er(W[Ge],Se)){await UA(W[Ge],Se);let et={messageId:W[Ge]};Je?et.useUserDevicesCache=!1:et.participant={jid:Se,count:+X.attrs.count},await F(ee.remoteJid,tA,et)}else t.debug({jid:ee.remoteJid,id:W[Ge]},"recv retry request, but message not available")},Qe=async ee=>{let{attrs:W,content:X}=ee,re=W.from.includes("lid"),ne=Rt(W.participant||W.from,re?I.creds.me?.lid:I.creds.me?.id),Se=!ne||xr(W.from)?W.from:W.recipient,Ee=!W.recipient||(W.type==="retry"||W.type==="sender")&&ne,he={remoteJid:Se,id:"",fromMe:Ee,participant:W.participant},ye=[W.id];if(Array.isArray(X)){let Je=PA(X[0],"item");ye.push(...Je.map(IA=>IA.attrs.id))}try{await Promise.all([Q.mutex(async()=>{let Je=J7(W.type);if(typeof Je<"u"&&(Je>=oe.WebMessageInfo.Status.SERVER_ACK||!ne))if(xr(Se)||Lg(Se)){if(W.participant){let IA=Je===oe.WebMessageInfo.Status.DELIVERY_ACK?"receiptTimestamp":"readTimestamp";c.emit("message-receipt.update",ye.map(yA=>({key:{...he,id:yA},receipt:{userJid:uA(W.participant),[IA]:+W.t}})))}}else c.emit("messages.update",ye.map(IA=>({key:{...he,id:IA},update:{status:Je,messageTimestamp:Yr(+(W.t??0))}})));if(W.type==="retry"){he.participant=he.participant||W.from;let IA=le(ee,"retry");if(ye[0]&&he.participant&&await Er(ye[0],he.participant))if(he.fromMe)try{await UA(ye[0],he.participant),t.debug({attrs:W,key:he},"recv retry request"),await pe(he,ye,IA,ee)}catch(yA){t.error({key:he,ids:ye,trace:yA instanceof Error?yA.stack:"Unknown error"},"error in sending message again")}else t.info({attrs:W,key:he},"recv retry for not fromMe message");else t.info({attrs:W,key:he},"will not send message again, as sent too many times")}})])}finally{await Ie(ee).catch(Je=>t.error({ackErr:Je},"failed to ack receipt"))}},be=async ee=>{let W=ee.attrs.from;try{await Promise.all([f.mutex(async()=>{let X=await bA(ee);if(X){let re=Rt(ee.attrs.participant||W,I.creds.me.id),{senderAlt:ne,addressingMode:Se}=BD(ee);X.key={remoteJid:W,fromMe:re,participant:ee.attrs.participant,participantAlt:ne,participantUsername:ee.attrs.participant_username,addressingMode:Se,id:ee.attrs.id,...X.key||{}},X.participant??(X.participant=ee.attrs.participant),X.messageTimestamp=+ee.attrs.t;let Ee=oe.WebMessageInfo.fromObject(X);await T(Ee,"append")}})])}finally{await Ie(ee).catch(X=>t.error({ackErr:X},"failed to ack notification"))}},oA=async ee=>{if(le(ee,"enc")?.attrs.type==="msmsg"){t.debug({key:ee.attrs.key},"ignored msmsg"),await Ie(ee,Ll.MissingMessageSecret);return}let X=!1;try{let{fullMessage:re,category:ne,author:Se,decrypt:Ee}=e$(ee,I.creds.me.id,I.creds.me.lid||"",y,t),he=re.key.participantAlt||re.key.remoteJidAlt;if(he){let ye=fA(he)?.server,Je=re.key.participant||re.key.remoteJid;ye==="lid"?await y.lidMapping.getPNForLID(he)||(await y.lidMapping.storeLIDPNMappings([{lid:he,pn:Je}]),await y.migrateSession(Je,he)):(await y.lidMapping.storeLIDPNMappings([{lid:Je,pn:he}]),await y.migrateSession(he,Je))}await B.mutex(async()=>{if(await Ee(),re.key?.remoteJid&&re.key?.id&&re.message&&G&&G.addRecentMessage(re.key.remoteJid,re.key.id,re.message),re.messageStubType===oe.WebMessageInfo.StubType.CIPHERTEXT&&re.category!=="peer"){if(re?.messageStubParameters?.[0]===X7)return X=!0,Ie(ee,Ll.ParsingError);if(re.messageStubParameters?.[0]===uD){let Je=le(ee,"unavailable")?.attrs?.type;if(Je==="bot_unavailable_fanout"||Je==="hosted_unavailable_fanout"||Je==="view_once_unavailable_fanout")return t.debug({msgId:re.key.id,unavailableType:Je},"skipping placeholder resend for excluded unavailable type"),X=!0,Ie(ee);let IA=Oa()-Yr(re.messageTimestamp);if(IA>Ece)return t.debug({msgId:re.key.id,messageAge:IA},"skipping placeholder resend for old message"),X=!0,Ie(ee);let yA={remoteJid:re.key.remoteJid,fromMe:re.key.fromMe,id:re.key.id,participant:re.key.participant},XA={key:re.key,messageTimestamp:re.messageTimestamp,pushName:re.pushName,participant:re.participant,verifiedBizName:re.verifiedBizName};ke(yA,XA).then(vA=>{vA&&vA!=="RESOLVED"&&(t.debug({msgId:re.key.id,requestId:vA},"requested placeholder resend for unavailable message"),c.emit("messages.update",[{key:re.key,update:{messageStubParameters:[uD,vA]}}]))}).catch(vA=>{t.warn({err:vA,msgId:re.key.id},"failed to request placeholder resend for unavailable message")}),X=!0,await Ie(ee)}else{if(Lg(re.key.remoteJid)){let ye=Oa()-Yr(re.messageTimestamp);if(ye>hce)return t.debug({msgId:re.key.id,messageAge:ye,remoteJid:re.key.remoteJid},"skipping retry for expired status message"),X=!0,Ie(ee)}t.debug("[handleMessage] Attempting retry request for failed decryption"),await Ae.mutex(async()=>{try{if(!d.isOpen){t.debug({node:ee},"Connection closed, skipping retry");return}let ye=le(ee,"enc");await je(ee,!ye),o&&await kB(o)}catch(ye){t.error({err:ye},"Failed to send retry")}X=!0,await Ie(ee,Ll.UnhandledError)})}}else if(G&&re.key.id&&G.cancelPendingPhoneRequest(re.key.id),Wc(re.key.remoteJid))X=!0,await Ie(ee),t.debug({key:re.key},"processed newsletter message without receipts");else{let Je,IA=re.key.participant;if(ne==="peer"?Je="peer_msg":re.key.fromMe?(Je="sender",(qA(re.key.remoteJid)||qA(re.key.remoteJidAlt))&&(IA=Se)):Te||(Je="inactive"),X=!0,await q(re.key.remoteJid,IA,[re.key.id],Je),mb(re.message)){let XA=uA(re.key.remoteJid);await q(XA,void 0,[re.key.id],"hist_sync")}}zne(re,I.creds.me.id,I.creds.me.lid),await T(re,ee.attrs.offline?"append":"notify")})}catch(re){t.error({error:re,node:Gn(ee)},"error in handling message"),X||await Ie(ee,Ll.UnhandledError).catch(ne=>t.error({ackErr:ne},"failed to ack message after error"))}},pA=async ee=>{try{let{attrs:W}=ee,[X]=_s(ee);if(!X)throw new Zf.Boom("Missing call info in call node");let re=z7(X),ne=X.attrs["call-id"],Se=X.attrs.from||X.attrs["call-creator"],Ee={chatId:W.from,from:Se,callerPn:X.attrs.caller_pn,id:ne,date:new Date(+W.t*1e3),offline:!!W.offline,status:re};if(re==="relaylatency"){let ye=X.attrs.latency||X.attrs.latency_ms||X.attrs["latency-ms"],Je=ye?Number(ye):void 0;Number.isFinite(Je)&&(Ee.latencyMs=Je)}re==="offer"&&(Ee.isVideo=!!le(X,"video"),Ee.isGroup=X.attrs.type==="group"||!!X.attrs["group-jid"],Ee.groupJid=X.attrs["group-jid"],await we.set(Ee.id,Ee));let he=await we.get(Ee.id);he&&(Ee.isVideo=he.isVideo,Ee.isGroup=he.isGroup,Ee.callerPn=Ee.callerPn||he.callerPn),(re==="reject"||re==="accept"||re==="timeout"||re==="terminate")&&await we.del(Ee.id),c.emit("call",[Ee])}catch(W){t.error({error:W,node:Gn(ee)},"error in handling call")}finally{await Ie(ee).catch(W=>t.error({ackErr:W},"failed to ack call"))}},FA=async({attrs:ee})=>{let W={remoteJid:ee.from,fromMe:!0,id:ee.id};if(ee.error){let X=ee.error===String(Ll.SenderReachoutTimelocked);if(ee.error===WF.MessageAccountRestriction){t.warn({msgId:ee.id,from:ee.from},"error 463: account restricted or missing tctoken for contact");let re=ee.from;re&&!Qo.has(re)&&(Qo.add(re),(async()=>{try{let ne=y.lidMapping.getPNForLID.bind(y.lidMapping),Se=await Xs(re,z),Ee=await Lf(re,r.serverProps.lidTrustedTokenIssueToLid,z,ne),he=await U([Ee],Oa());await hE({result:he,fallbackJid:Se,keys:I.keys,getLIDForPN:z,onNewJidStored:_A}),t.debug({from:re},"completed 463 token recovery issuance")}catch(ne){t.debug({from:re,err:ne?.message},"failed 463 token recovery issuance")}finally{Qo.delete(re)}})())}else ee.error===WF.SmaxInvalid?t.warn({msgId:ee.id,from:ee.from},"smax-invalid (479): stanza rejected by server \u2014 likely stale device session or malformed addressing"):X?(await N().catch(re=>t.warn({err:re},"failed to fetch reachout timelock")),t.warn({attrs:ee},"received error in ack")):t.warn({attrs:ee},"received error in ack");c.emit("messages.update",[{key:W,update:{status:lh.ERROR,messageStubParameters:X?[ee.error,$7]:[ee.error]}}])}},Kt=async(ee,W,X)=>{c.buffer(),await re(),c.flush();function re(){return X(ee,!1).catch(ne=>R(ne,W))}},st=Gce(new Map([["message",oA],["call",pA],["receipt",Qe],["notification",be]]),{isWsOpen:()=>d.isOpen,onUnexpectedError:R,yieldToEventLoop:()=>new Promise(ee=>setImmediate(ee))}),Dr=async(ee,W,X,re)=>{let ne=W.attrs.from,Se=ne;if(ee==="receipt"&&ne){let he=W.attrs,ye=he.from.includes("lid");Se=!Rt(he.participant||he.from,ye?I.creds.me?.lid:I.creds.me?.id)||xr(he.from)?he.from:he.recipient}if(Se&&Se!==OA&&a(Se)){await Ie(W,ee==="message"?Ll.UnhandledError:void 0);return}!!W.attrs.offline?st.enqueue(ee,W):await Kt(W,X,re)};d.on("CB:message",async ee=>{await Dr("message",ee,"processing message",oA)}),d.on("CB:call",async ee=>{await Dr("call",ee,"handling call",pA)}),d.on("CB:receipt",async ee=>{await Dr("receipt",ee,"handling receipt",Qe)}),d.on("CB:notification",async ee=>{await Dr("notification",ee,"handling notification",be)}),d.on("CB:ack,class:message",ee=>{FA(ee).catch(W=>R(W,"handling bad ack"))}),c.on("call",async([ee])=>{if(ee&&(ee.status==="timeout"||ee.status==="offer"&&ee.isGroup)){let W={key:{remoteJid:ee.chatId,id:ee.id,fromMe:!1},messageTimestamp:Oa(ee.date)};ee.status==="timeout"?ee.isGroup?W.messageStubType=ee.isVideo?RA.CALL_MISSED_GROUP_VIDEO:RA.CALL_MISSED_GROUP_VOICE:W.messageStubType=ee.isVideo?RA.CALL_MISSED_VIDEO:RA.CALL_MISSED_VOICE:W.message={call:{callKey:Buffer.from(ee.id)}};let X=oe.WebMessageInfo.fromObject(W);await T(X,ee.offline?"append":"notify")}});let rr=0,Qo=new Set;c.on("connection.update",({isOnline:ee,connection:W})=>{if(typeof ee<"u"&&(Te=ee,t.trace(`sendActiveReceipts set to "${Te}"`)),W==="close"&&Ue){clearTimeout(Ue),Ue=void 0;try{Promise.resolve(MA()).catch(()=>{})}catch{}}if(ee){let X=Date.now(),re=1440*60*1e3;X-rr>=re&&(rr=X,$i())}}),J(()=>{!n.msgRetryCounterCache&&ie.close&&ie.close(),!n.callOfferCache&&we.close&&we.close(),se.close(),Te=!1});async function $i(){try{await Ne;let ee=await _b(I.keys),W=new Set(ue);for(let he of ee)W.add(he);if(!W.size)return;let X=[...W],re=await I.keys.get("tctoken",X),ne={},Se=new Set,Ee=0;for(let he of X){let ye=re[he];if(!ye){Ee++;continue}let Je=!!ye.token?.length,IA=Je&&gp(ye.timestamp),yA=ye.senderTimestamp!==void 0,XA=yA&&gp(ye.senderTimestamp),vA=Je&&!IA,YA=yA&&!XA;!vA&&!YA?(ne[he]=null,Ee++):IA&&YA?(ne[he]={token:Buffer.alloc(0),senderTimestamp:ye.senderTimestamp},Se.add(he),Ee++):Se.add(he)}if(Ee===0)return;await I.keys.set({tctoken:{...ne,[SI]:{token:Buffer.from(JSON.stringify([...Se]))}}}),ue.clear();for(let he of Se)ue.add(he);t.debug({mutated:Ee,remaining:Se.size},"pruned expired tctokens")}catch(ee){t.warn({err:ee?.message},"failed to prune expired tctokens")}}return{...r,sendMessageAck:Ie,sendRetryRequest:je,rejectCall:Xe,fetchMessageHistory:fe,requestPlaceholderResend:ke,messageRetryManager:G}};var Yce=n=>{let t=xce(n),{authState:o,query:i,waUploadToServer:e}=t,a=async f=>{let Q=[],y=["address","email","description"];return Q.push(...y.filter(T=>f[T]!==void 0&&f[T]!==null).map(T=>({tag:T,attrs:{},content:f[T]}))),f.websites!==void 0&&Q.push(...f.websites.map(T=>({tag:"website",attrs:{},content:T}))),f.hours!==void 0&&Q.push({tag:"business_hours",attrs:{timezone:f.hours.timezone},content:f.hours.days.map(T=>{let _={tag:"business_hours_config",attrs:{day_of_week:T.day,mode:T.mode}};return T.mode==="specific_hours"?{..._,attrs:{..._.attrs,open_time:T.openTimeInMinutes,close_time:T.closeTimeInMinutes}}:_})}),await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:Q}]})},A=async f=>{let{fileSha256:Q,filePath:y}=await Cb(f,"biz-cover-photo"),m=Q.toString("base64"),{meta_hmac:T,fbid:_,ts:R}=await e(y,{fileEncSha256B64:m,mediaType:"biz-cover-photo"});return await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{id:String(_),op:"update",token:T,ts:String(R)}}]}]}),_},r=async f=>await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{op:"delete",id:f}}]}]}),s=async({jid:f,limit:Q,cursor:y})=>{f=f||o.creds.me?.id,f=uA(f);let m=[{tag:"limit",attrs:{},content:Buffer.from((Q||10).toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}];y&&m.push({tag:"after",attrs:{},content:y});let T=await i({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog",attrs:{jid:f,allow_shop_source:"true"},content:m}]});return mce(T)},g=async(f,Q=51)=>{f=f||o.creds.me?.id,f=uA(f);let y=await i({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog",smax_id:"35"},content:[{tag:"collections",attrs:{biz_jid:f},content:[{tag:"collection_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"item_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]}]});return Sce(y)},c=async(f,Q)=>{let y=await i({tag:"iq",attrs:{to:OA,type:"get",xmlns:"fb:thrift_iq",smax_id:"5"},content:[{tag:"order",attrs:{op:"get",id:f},content:[{tag:"image_dimensions",attrs:{},content:[{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]},{tag:"token",attrs:{},content:Buffer.from(Q)}]}]});return wce(y)},I=async(f,Q)=>{Q=await xH(Q,e);let y=KH(f,Q),m=await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_edit",attrs:{v:"1"},content:[y,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),T=le(m,"product_catalog_edit"),_=le(T,"product");return Vf(_)},d=async f=>{f.isHidden=!!f.isHidden,f=await xH(f,e);let Q=KH(void 0,f),y=await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_add",attrs:{v:"1"},content:[Q,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),m=le(y,"product_catalog_add"),T=le(m,"product");return Vf(T)},B=async f=>{let Q=await i({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_delete",attrs:{v:"1"},content:f.map(m=>({tag:"product",attrs:{},content:[{tag:"id",attrs:{},content:Buffer.from(m)}]}))}]});return{deleted:+(le(Q,"product_catalog_delete")?.attrs.deleted_count||0)}};return{...t,logger:n.logger,getOrderDetails:c,getCatalog:s,getCollections:g,productCreate:d,productDelete:B,productUpdate:I,updateBussinesProfile:a,updateCoverPhoto:A,removeCoverPhoto:r}};var jce=n=>{let t=Yce(n),{authState:o,ev:i,query:e,upsertMessage:a}=t,A=async(I,d,B)=>e({tag:"iq",attrs:{type:d,xmlns:"w:g2",to:I},content:B}),r=async I=>{let d=await A(I,"get",[{tag:"query",attrs:{request:"interactive"}}]);return WH(d)},s=async()=>{let I=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),d={},B=le(I,"communities");if(B){let f=PA(B,"community");for(let Q of f){let y=WH({tag:"result",attrs:{},content:[Q]});d[y.id]=y}}return t.ev.emit("groups.update",Object.values(d)),d};async function g(I){Jf.info({node:I},"parseGroupResult");let d=le(I,"group");if(d)try{Jf.info({groupNode:d},"groupNode");let B=await t.groupMetadata(`${d.attrs.id}@g.us`);return B||c.empty()}catch(B){return console.error("Error parsing group metadata:",B),c.empty()}return c.empty()}let c={empty:()=>null,of:I=>I!==null?{value:I}:null};return t.ws.on("CB:ib,,dirty",async I=>{let{attrs:d}=le(I,"dirty");d.type==="communities"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,communityMetadata:r,communityCreate:async(I,d)=>{let B=zF().substring(0,12),f=await A("@g.us","set",[{tag:"create",attrs:{subject:I},content:[{tag:"description",attrs:{id:B},content:[{tag:"body",attrs:{},content:Buffer.from(d||"","utf-8")}]},{tag:"parent",attrs:{default_membership_approval_mode:"request_required"}},{tag:"allow_non_admin_sub_group_creation",attrs:{}},{tag:"create_general_chat",attrs:{}}]}]);return await g(f)},communityCreateGroup:async(I,d,B)=>{let f=jr(),Q=await A("@g.us","set",[{tag:"create",attrs:{subject:I,key:f},content:[...d.map(y=>({tag:"participant",attrs:{jid:y}})),{tag:"linked_parent",attrs:{jid:B}}]}]);return await g(Q)},communityLeave:async I=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"community",attrs:{id:I}}]}])},communityUpdateSubject:async(I,d)=>{await A(I,"set",[{tag:"subject",attrs:{},content:Buffer.from(d,"utf-8")}])},communityLinkGroup:async(I,d)=>{await A(d,"set",[{tag:"links",attrs:{},content:[{tag:"link",attrs:{link_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}]}])},communityUnlinkGroup:async(I,d)=>{await A(d,"set",[{tag:"unlink",attrs:{unlink_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}])},communityFetchLinkedGroups:async I=>{let d=I,B=!1,f=await t.groupMetadata(I);f.linkedParent?d=f.linkedParent:B=!0;let Q=await A(d,"get",[{tag:"sub_groups",attrs:{}}]),y=[],m=le(Q,"sub_groups");if(m){let T=PA(m,"group");for(let _ of T)y.push({id:_.attrs.id?yr(_.attrs.id,"g.us"):void 0,subject:_.attrs.subject||"",creation:_.attrs.creation?Number(_.attrs.creation):void 0,owner:_.attrs.creator?uA(_.attrs.creator):void 0,size:_.attrs.size?Number(_.attrs.size):void 0})}return{communityJid:d,isCommunity:B,linkedGroups:y}},communityRequestParticipantsList:async I=>{let d=await A(I,"get",[{tag:"membership_approval_requests",attrs:{}}]),B=le(d,"membership_approval_requests");return PA(B,"membership_approval_request").map(Q=>Q.attrs)},communityRequestParticipantsUpdate:async(I,d,B)=>{let f=await A(I,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:B,attrs:{},content:d.map(T=>({tag:"participant",attrs:{jid:T}}))}]}]),Q=le(f,"membership_requests_action"),y=le(Q,B);return PA(y,"participant").map(T=>({status:T.attrs.error||"200",jid:T.attrs.jid}))},communityParticipantsUpdate:async(I,d,B)=>{let f=await A(I,"set",[{tag:B,attrs:B==="remove"?{linked_groups:"true"}:{},content:d.map(m=>({tag:"participant",attrs:{jid:m}}))}]),Q=le(f,B);return PA(Q,"participant").map(m=>({status:m.attrs.error||"200",jid:m.attrs.jid,content:m}))},communityUpdateDescription:async(I,d)=>{let f=(await r(I)).descId??null;await A(I,"set",[{tag:"description",attrs:{...d?{id:zF()}:{delete:"true"},...f?{prev:f}:{}},content:d?[{tag:"body",attrs:{},content:Buffer.from(d,"utf-8")}]:void 0}])},communityInviteCode:async I=>{let d=await A(I,"get",[{tag:"invite",attrs:{}}]);return le(d,"invite")?.attrs.code},communityRevokeInvite:async I=>{let d=await A(I,"set",[{tag:"invite",attrs:{}}]);return le(d,"invite")?.attrs.code},communityAcceptInvite:async I=>{let d=await A("@g.us","set",[{tag:"invite",attrs:{code:I}}]);return le(d,"community")?.attrs.jid},communityRevokeInviteV4:async(I,d)=>!!await A(I,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:d}}]}]),communityAcceptInviteV4:i.createBufferedFunction(async(I,d)=>{I=typeof I=="string"?{remoteJid:I}:I;let B=await A(d.groupJid,"set",[{tag:"accept",attrs:{code:d.inviteCode,expiration:d.inviteExpiration.toString(),admin:I.remoteJid}}]);return I.id&&(d=oe.Message.GroupInviteMessage.fromObject(d),d.inviteExpiration=0,d.inviteCode="",i.emit("messages.update",[{key:I,update:{message:{groupInviteMessage:d}}}])),await a({key:{remoteJid:d.groupJid,id:jr(t.user?.id),fromMe:!1,participant:I.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:I.remoteJid,messageTimestamp:Oa()},"notify"),B.attrs.from}),communityGetInviteInfo:async I=>{let d=await A("@g.us","get",[{tag:"invite",attrs:{code:I}}]);return WH(d)},communityToggleEphemeral:async(I,d)=>{let B=d?{tag:"ephemeral",attrs:{expiration:d.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(I,"set",[B])},communitySettingUpdate:async(I,d)=>{await A(I,"set",[{tag:d,attrs:{}}])},communityMemberAddMode:async(I,d)=>{await A(I,"set",[{tag:"member_add_mode",attrs:{},content:d}])},communityJoinApprovalMode:async(I,d)=>{await A(I,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"community_join",attrs:{state:d}}]}])},communityFetchAllParticipating:s}},WH=n=>{let t=le(n,"community"),o=le(t,"description"),i,e;o&&(i=jA(o,"body"),e=o.attrs.id);let a=t.attrs.id?.includes("@")?t.attrs.id:yr(t.attrs.id||"","g.us"),A=le(t,"ephemeral")?.attrs.expiration,r=jA(t,"member_add_mode")==="all_member_add";return{id:a,subject:t.attrs.subject||"",subjectOwner:t.attrs.s_o,subjectTime:Number(t.attrs.s_t||0),size:PA(t,"participant").length,creation:Number(t.attrs.creation||0),owner:t.attrs.creator?uA(t.attrs.creator):void 0,desc:i,descId:e,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_community"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:r,participants:PA(t,"participant").map(({attrs:g})=>({id:g.jid,admin:g.type||null})),ephemeralDuration:A?+A:void 0,addressingMode:jA(t,"addressing_mode")}};var $5e=n=>{let t={...uce,...n};return jce(t)},Jce=$5e;var qce=Jce;var eZe=Object.freeze({key:"whatsapp",label:"WhatsApp",get connectionLabel(){return w(" Web \u5173\u8054\u8BBE\u5907")},reactions:Object.freeze({processing:"\u{1F440}",success:"\u2705",error:"\u274C"})}),uM=class extends ns{constructor(t){super({...t,descriptor:eZe})}};import{chmod as zce,mkdir as AZe,readdir as tZe}from"node:fs/promises";var rZe=Object.freeze({level:"silent",trace(){},debug(){},info(){},warn(){},error(){},fatal(){},child(){return this}}),aZe=6e4;function Vce(){return Object.assign(new Error("WhatsApp connection was cancelled"),{name:"AbortError"})}function iZe(n){return n?.output?.statusCode??n?.data?.statusCode??n?.statusCode??null}function oZe(n){let t=n;if(typeof t=="string"){if(!/^\d+$/.test(t))return null;t=Number(t)}else typeof t=="bigint"?t=Number(t):t&&typeof t=="object"&&(t=Number(t.valueOf()));return Number.isFinite(t)&&t>=0?t*1e3:null}async function ZH(n){await AZe(n,{recursive:!0,mode:448}),await zce(n,448);let t=await tZe(n,{withFileTypes:!0}).catch(()=>[]);await Promise.all(t.filter(o=>o.isFile()).map(o=>zce(`${n}/${o.name}`,384).catch(()=>{})))}function nZe(n,t){let o=n.user??t.creds.me,i=uA(o?.id);if(!/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(i??""))throw new Error("WhatsApp did not return a valid linked account");return{accountJid:i,name:typeof o?.name=="string"&&o.name.trim()?o.name.trim().slice(0,100):w("WhatsApp\u673A\u5668\u4EBA")}}async function BM({authDir:n,onQr:t,onMessage:o,onDisconnect:i,signal:e,logger:a=console,makeSocket:A=qce,loadAuthState:r=jne}={}){if(!n||typeof t!="function")throw new TypeError("WhatsApp Web session requires an auth directory and QR callback");await ZH(n);let s=Date.now(),{state:g,saveCreds:c}=await r(n),I=g.keys.set.bind(g.keys);g.keys.set=async V=>{await I(V),await ZH(n)};let d=!1,B=!1,f,Q,y=Promise.resolve(),m=null,T=0,_=null,R=new Promise((V,x)=>{f=V,Q=x}),K=V=>{B||(B=!0,Q(V))},L=async()=>{d||(d=!0,T+=1,K(Vce()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.end(void 0).catch(()=>{}))},F=async()=>{d||(d=!0,T+=1,K(Vce()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.logout("Removed from DeepSeek Harness").catch(()=>{}))},q=()=>{let V=++T,x=!1,G=A({auth:g,browser:Rb.macOS("DeepSeek Harness"),logger:rZe,markOnlineOnConnect:!1,syncFullHistory:!1,shouldSyncHistoryMessage:()=>!1,getMessage:async()=>{},generateHighQualityLinkPreview:!1});m=G;let J=()=>{!x||!g.creds.me||B||y.then(()=>{d||B||V!==T||!x||!g.creds.me||(B=!0,f(nZe(G,g)))}).catch(U=>K(U))};G.ev.on("creds.update",()=>{d||V!==T||(y=y.then(async()=>{await c(),await ZH(n)}),y.catch(()=>a.error?.("[dsh-im:whatsapp] failed to persist linked-device state")),J())}),G.ev.on("connection.update",U=>{if(!(d||V!==T)&&(typeof U.qr=="string"&&U.qr&&t(U.qr),U.connection==="open"&&(x=!0,J()),U.connection==="close")){let N=iZe(U.lastDisconnect?.error);if(N===$t.restartRequired){_??=y.then(async()=>{d||V!==T||(await G.end(void 0).catch(()=>{}),!(d||V!==T)&&q())}).catch(Ae=>K(Ae)).finally(()=>{_=null});return}let k=N===$t.loggedOut,z=Object.assign(new Error(k?"WhatsApp linked device was removed from the phone":"WhatsApp Web connection closed"),{code:k?"logged-out":"connection-closed"});B?i?.({error:z,loggedOut:k}):K(z)}}),G.ev.on("messages.upsert",({messages:U,type:N})=>{if(!(d||V!==T||N!=="notify"&&N!=="append"||typeof o!="function"))for(let k of Array.isArray(U)?U:[]){if(N==="append"){let z=oZe(k?.messageTimestamp);if(z===null||z{a.error?.("[dsh-im:whatsapp] failed to process an inbound WhatsApp message")})}})};return q(),e&&(e.aborted?await L():e.addEventListener("abort",()=>void L(),{once:!0})),Object.freeze({get socket(){return m},ready:R,close:L,logout:F})}var $H=new Set(["image/jpeg","image/png","image/webp","image/gif"]),gZe=5*1024*1024,XH=15e3,eK=12e4,cZe=["ephemeralMessage","viewOnceMessage","documentWithCaptionMessage","viewOnceMessageV2","viewOnceMessageV2Extension","editedMessage","associatedChildMessage","groupStatusMessage","groupStatusMessageV2"],IZe=new Set(["viewOnceMessage","viewOnceMessageV2","viewOnceMessageV2Extension"]),lZe=new Set(["s.whatsapp.net","c.us","lid","hosted","hosted.lid"]);function Zce(n){if(typeof n!="string")return null;let t=n.trim();if(/^\+?\d+$/.test(t))return`${t.replace(/^\+/,"")}@s.whatsapp.net`;let o=fA(t);return!o||!/^\d+$/.test(o.user)||!lZe.has(o.server)?null:t}function rK(n,t){let o=Zce(n),i=Zce(t);if(!o||!i)return!1;try{return Rt(o,i)===!0}catch{return!1}}function pZe(n){let t=n;for(let o=0;o<5&&t&&typeof t=="object";o+=1){let i=cZe.find(e=>t[e]?.message);if(!i)return!1;if(IZe.has(i))return!0;t=t[i].message}return!1}function dZe(n){return n?.extendedTextMessage?.contextInfo??n?.imageMessage?.contextInfo??n?.videoMessage?.contextInfo??n?.documentMessage?.contextInfo??null}function hZe(n){return n?.conversation??n?.extendedTextMessage?.text??n?.imageMessage?.caption??n?.videoMessage?.caption??n?.documentMessage?.caption??""}function $ce(n){if(Number.isSafeInteger(n)&&n>=0)return n;let t;try{t=Number(n?.toString?.())}catch{return}return Number.isSafeInteger(t)&&t>=0?t:void 0}async function EZe(n,t,{signal:o,maxBytes:i=gZe}={}){o?.throwIfAborted();let e=AbortSignal.timeout(XH),a=o?AbortSignal.any([o,e]):e,A=Promise.resolve().then(()=>t(n,"stream",{options:{signal:a}})),r=await new Promise((I,d)=>{let B=!1,f=(y,m)=>B?!1:(B=!0,a.removeEventListener("abort",Q),y(m),!0),Q=()=>f(d,a.reason);a.addEventListener("abort",Q,{once:!0}),A.then(y=>{f(I,y)||y?.destroy?.()},y=>f(d,y)),a.aborted&&Q()}).catch(I=>{throw o?.aborted?o.reason??I:e.aborted?new ut("image-download-failed",`WhatsApp image download timed out after ${XH} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}),s=[],g=0,c=()=>r?.destroy?.(a.reason);a.addEventListener("abort",c,{once:!0});try{for await(let I of r){a.throwIfAborted();let d=Buffer.from(I);if(g+=d.length,g>i)throw r.destroy?.(),new ut("image-too-large",`WhatsApp image exceeded ${i} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s.push(d)}}catch(I){throw o?.aborted?o.reason??I:e.aborted?new ut("image-download-failed",`WhatsApp image stream timed out after ${XH} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}finally{a.removeEventListener("abort",c)}return Buffer.concat(s,g)}function CZe(n,t,o,{viewOnce:i=!1}={}){let e,a;if(!i&&t?.imageMessage&&t.imageMessage.viewOnce!==!0)e=t.imageMessage;else if(t?.documentMessage){let r=typeof t.documentMessage.mimetype=="string"?t.documentMessage.mimetype.toLowerCase():"";if(!$H.has(r))return null;e=t.documentMessage,a=typeof e.fileName=="string"?e.fileName:void 0}if(!e)return null;let A=typeof e.mimetype=="string"?e.mimetype.toLowerCase():"";return $H.has(A)?{name:a,mediaType:A,size:$ce(e.fileLength),load:r=>EZe(n,o,r)}:null}function uZe(n,t,o){let i=t?.documentMessage;if(!i)return null;let e=typeof i.mimetype=="string"&&i.mimetype?i.mimetype.toLowerCase():void 0;return $H.has(e)?null:{name:typeof i.fileName=="string"&&i.fileName?i.fileName:"whatsapp-file",...e?{mediaType:e}:{},size:$ce(i.fileLength),async load({signal:a}={}){a?.throwIfAborted();let A=await o(n,"stream",{options:{signal:a}});return a?.throwIfAborted(),{stream:A}}}}function BZe({socket:n,logger:t=console,download:o=hU}={}){if(typeof o!="function")throw new TypeError("WhatsApp media downloader is required");return typeof n?.updateMediaMessage!="function"?o:(i,e,a)=>o(i,e,a,{logger:t,reuploadRequest:A=>n.updateMediaMessage(A)})}function fZe(n,t,{download:o=hU}={}){let i=typeof n?.key?.remoteJid=="string"?n.key.remoteJid:"",e=typeof n?.key?.remoteJidAlt=="string"?n.key.remoteJidAlt:"",a=typeof n?.key?.id=="string"?n.key.id:"";if(!i||!a||i==="status@broadcast"||i.endsWith("@newsletter"))return null;let A=i.endsWith("@g.us"),r=n.key.fromMe===!0,s=r&&!A&&[i,e].some(T=>T&&Rt(T,t));if(r&&!s&&!A)return null;let g=r?t:A?n.key.participant:i,c=A&&!r?n.key.participantAlt:e;if(typeof g!="string"||!g)return null;let I=pZe(n.message),d=Na(n.message),B=dZe(d),f=Array.isArray(B?.mentionedJid)&&B.mentionedJid.some(T=>Rt(T,t)),Q=typeof B?.participant=="string"&&Rt(B.participant,t),y=CZe(n,d,o,{viewOnce:I}),m=uZe(n,d,o);return{messageId:`${i}:${a}`,providerMessageId:a,senderId:g,contextSource:()=>({senderName:n.pushName}),senderAlternateId:typeof c=="string"?c:"",senderIsBot:!1,kind:A?"group":"direct",conversationId:i,content:hZe(d),plainText:typeof d?.conversation=="string"||typeof d?.extendedTextMessage?.text=="string",images:y?[y]:[],files:m?[m]:[],addressed:!A||r||f||Q,selfChat:s,replyTarget:{jid:i,quoted:n,selfChat:s},reactionTarget:{jid:i,key:n.key}}}var AK=class{#e=new Map;has(t){return this.#t(),this.#e.has(t)}remember(t){this.#A(t)}reserve(t){this.#A(t)}#A(t){if(!(typeof t!="string"||!t))for(this.#t(),this.#e.set(t,Date.now()+5*6e4);this.#e.size>256;)this.#e.delete(this.#e.keys().next().value)}#t(){let t=Date.now();for(let[o,i]of this.#e)i>t||this.#e.delete(o)}};function eIe(n){return n?.reason??new DOMException("The operation was aborted.","AbortError")}function Xce(n,t){return t?(t.throwIfAborted(),new Promise((o,i)=>{let e=!1,a=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>a(i,eIe(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>a(o,r),r=>a(i,r)),t.aborted&&A()})):n}function QZe(n){if(n?.code==="artifact-delivery-uncertain")return n;let t=new Error("WhatsApp could not confirm artifact delivery.");return t.code="artifact-delivery-uncertain",t.cause=n,t}function yZe(n){if(n?.code?.startsWith?.("artifact-"))return n;let t=n?.output?.statusCode??n?.data?.statusCode??n?.statusCode,o;if(t===401||t===403?o="artifact-permission-required":t===413?o="artifact-too-large":t===429?o="artifact-rate-limited":[400,404,405,406,410,415,422].includes(t)&&(o="artifact-provider-rejected"),!o)return QZe(n);let i=new Error("WhatsApp rejected artifact delivery.");return i.code=o,i.cause=n,i}var tK=class{#e;#A;#t;#r;#l=new Map;constructor(t,o,{signal:i,mediaUploadTimeoutMs:e=eK}={}){this.#e=t,this.#A=o,this.#t=i,this.#r=e}async sendText(t,o){await this.#a(t.jid);let i=[];for(let[e,a]of ss(o,4e3).entries()){let A=Wce(10).toString("hex").toUpperCase(),r={...e===0&&t.quoted?{quoted:t.quoted}:{},messageId:A};typeof this.#A.reserve=="function"?this.#A.reserve(A):this.#A.remember(A);let s=await this.#e.sendMessage(t.jid,{text:a},r);this.#A.remember(s?.key?.id),typeof s?.key?.id=="string"&&s.key.id&&i.push(s.key.id)}return{providerMessageIds:i}}async sendFile(t,o){return this.#i(t,o,{document:o.bytes,mimetype:o.mediaType??"application/octet-stream",fileName:o.fileName},"file")}async sendImage(t,o){return this.#i(t,o,{image:o.bytes,mimetype:o.mediaType??"image/jpeg"},"image")}async addReaction(t,o,{signal:i}={}){if(typeof o!="string"||!o.trim())throw new TypeError("A WhatsApp reaction emoji is required");let e=o.trim();return await this.#o(t,e,i),e}removeReaction(t,o,{signal:i}={}){return this.#o(t,"",i)}async#o(t,o,i){if(typeof t?.jid!="string"||!t.jid||!t.key?.id)throw new TypeError("A WhatsApp reaction target is required");let e=i??this.#t;e?.throwIfAborted();let a=Wce(10).toString("hex").toUpperCase();typeof this.#A.reserve=="function"?this.#A.reserve(a):this.#A.remember(a);let A=this.#e.sendMessage(t.jid,{react:{text:o,key:t.key}},{messageId:a}),r=await Xce(A,e);return this.#A.remember(r?.key?.id),r}async#i(t,o,i,e){this.#t?.throwIfAborted(),await this.#a(t.jid),this.#t?.throwIfAborted();let a=typeof o.deliveryKey=="string"&&o.deliveryKey?o.deliveryKey:o.artifactId,A=e==="image"?`${a}:image`:a,r=typeof A=="string"&&A?sZe("sha256").update(A).digest("hex").slice(0,20).toUpperCase():void 0,s={...t.quoted?{quoted:t.quoted}:{},...r?{messageId:r}:{},mediaUploadTimeoutMs:this.#r};this.#A.remember(r);let g;try{let c=this.#e.sendMessage(t.jid,i,s);un(o,c);let I=AbortSignal.timeout(this.#r),d=this.#t?AbortSignal.any([this.#t,I]):I;g=await Xce(c,d)}catch(c){throw this.#t?.aborted?eIe(this.#t):yZe(c)}return this.#t?.throwIfAborted(),this.#A.remember(g?.key?.id),g}async sendTyping(t){!t.selfChat&&t.quoted?.key&&await this.#e.readMessages([t.quoted.key]).catch(()=>{}),await this.#e.sendPresenceUpdate("composing",t.jid),await this.#a(t.jid,!1);let o=setInterval(()=>{this.#e.sendPresenceUpdate("composing",t.jid).catch(()=>{this.#a(t.jid)})},2e4);o.unref?.(),this.#l.set(t.jid,o)}async close(){let t=[...this.#l.keys()];await Promise.allSettled(t.map(o=>this.#a(o)))}async#a(t,o=!0){let i=this.#l.get(t);i&&clearInterval(i),this.#l.delete(t),o&&await this.#e.sendPresenceUpdate("paused",t).catch(()=>{})}};function mZe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...io()}}var Xf=class{#e;#A;#t;#r;#l;#o;#i;#a;#n;#s;#p;#c=mZe();#g=null;#I=null;#d=null;#h=null;#C=null;constructor({config:t,authDir:o,harness:i,state:e,contextEnhancement:a,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=3e4,mediaUploadTimeoutMs:c=eK,createSession:I=BM}){if(!t||!o||!i||!e||typeof I!="function")throw new TypeError("WhatsappRuntime requires config, auth directory, Harness, state, and session factory");if(this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#l=a,this.#o=A,this.#i=r,this.#a=s,this.#n=g,!Number.isSafeInteger(c)||c<=0)throw new TypeError("mediaUploadTimeoutMs must be a positive safe integer");this.#s=Math.min(c,eK),this.#p=I}get status(){return structuredClone(this.#c)}async start(){return this.#c.ready&&this.#I?this.status:this.#C?this.#C:(this.#C=this.#u().finally(()=>{this.#C=null}),this.#C)}async#u(){await this.stop(),this.#c.startedAt=new Date().toISOString(),this.#c.connectionState="connecting",this.#c.lastError=null,await this.#t.ensureRunning(),this.#c.harnessReachable=!0;let t=new AbortController;this.#g=t;let o=new AK,i,e=new Promise((a,A)=>{i=A});e.catch(()=>{});try{let a=await this.#p({authDir:this.#A,signal:t.signal,logger:this.#i,onQr:()=>i(Object.assign(new Error("WhatsApp linked-device session must be scanned again"),{code:"relink-required"})),onMessage:async(c,I)=>{let d=fZe(c,this.#e.accountJid,{download:BZe({socket:I?.socket,logger:this.#i})});!d||o.has(d.providerMessageId)||!this.#h||(this.#c.lastCheckedAt=Date.now(),await this.#h.accept(d))},onDisconnect:({error:c})=>{t.signal.aborted||(this.#c.ready=!1,this.#c.connectionState="failed",this.#c.lastError=c?.message??"WhatsApp Web connection closed")}});this.#I=a;let A,r=await Promise.race([a.ready,e,new Promise((c,I)=>{A=setTimeout(()=>I(new Error("WhatsApp Web did not connect in time")),this.#n)})]).finally(()=>clearTimeout(A));if(!Rt(r.accountJid,this.#e.accountJid))throw new Error("WhatsApp linked account does not match the saved bot");let s=new tK(a.socket,o,{signal:t.signal,mediaUploadTimeoutMs:this.#s});this.#d=s,this.#h=new uM({bot:s,harness:this.#t,state:this.#r,contextEnhancement:this.#l,accessPolicy:this.#o?{botId:this.#o.botId,getSettings:(...c)=>this.#o.getSettings(...c),...typeof this.#o.isPrivileged=="function"?{isPrivileged:(...c)=>this.#o.isPrivileged(...c)}:{},equals:rK}:void 0,status:this.#c,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let g=Date.now();return this.#c.ready=!0,this.#c.connectionState="connected",this.#c.lastCheckedAt=g,this.#c.lastConnectedAt=g,this.status}catch(a){throw this.#c.ready=!1,this.#c.connectionState="failed",this.#c.lastError=a?.message??String(a),await this.stop(),a}}async logout(){return await this.#I?.logout().catch(()=>{}),this.stop()}async sendConnectionTest(t){if(!this.#c.ready||!this.#d){let o=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw o.code="test-target-unavailable",o}if(typeof t!="string"||!t.trim())throw new TypeError("WhatsApp connection test text is required");return await this.#d.sendText({jid:this.#e.accountJid,selfChat:!0},t),{sent:!0}}async sendProactiveText(t,o,{signal:i}={}){let e=typeof t?.route?.jid=="string"?t.route.jid.trim():"",a=t?.kind==="user"&&/^[^@\s]+@(s\.whatsapp\.net|lid)$/.test(e),A=t?.kind==="group"&&/^[^@\s]+@g\.us$/.test(e);if(!a&&!A){let r=new TypeError("Invalid WhatsApp proactive delivery target");throw r.code="invalid-target",r}if(!this.#c.ready||!this.#d){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return i?.throwIfAborted(),this.#d.sendText({jid:e},o)}async stop(){let t=this.#I,o=this.#d,i=this.#h;return this.#g?.abort(),this.#g=null,this.#I=null,this.#d=null,this.#h=null,await o?.close().catch(()=>{}),await t?.close().catch(()=>{}),await Promise.race([i?.waitForIdle()??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),this.#c.ready=!1,this.#c.connectionState="idle",this.status}};var OZe=/^[a-f0-9-]{36}$/;function bZe(n){let t=ic(n.dshHome??process.env.DSH_HOME??ME(DZe(),".dsh")),o=ic(n.dataDir??ME(t,"integrations","dsh-whatsapp")),i=ic(n.authDir??ME(o,"auth")),e=a=>{if(!OZe.test(a??""))throw new TypeError("Invalid WhatsApp auth directory");return ic(i,a)};return{config:ic(n.configPath??ME(o,"config.json")),bots:ic(n.botsDir??ME(o,"bots")),workspaces:ic(n.workspacesPath??ME(o,"workspaces.json")),authPath:e}}async function aK(n,t={},o={}){let i=aa(n,t),e=typeof n.logger=="function"?n.logger("dsh-im:whatsapp"):n.logger??console,a=()=>La(n),A=o.ConfigStore??Rw,r=o.StateStore??Pw,s=o.HarnessClient??vw,g=o.Controller??dB,c=o.Runtime??Xf,I=o.createSession??BM,d=o.createConnectionSupervisor??jp,B=bZe(t),f=await new A(B.config).load(),Q=ic(t.workspace??process.cwd()),y=o.WorkspaceStore??ra,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("whatsapp",k)})));let _=typeof f.remove=="function"?Ha(f,{workspaces:m}):f,R=new Map,K=k=>ic(B.bots,k,"state.json"),L=async k=>{let z=R.get(k);return z||(z=await new r(K(k)).load(),R.set(k,z)),z},F=ja(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:V,fileIngressExecutor:x}=Ja(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new s({...i,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...V?{sessionMaintenanceExecutor:V}:{},...x?{fileIngressExecutor:x}:{}}),J=new g({configStore:_,authPath:B.authPath,createSession:I,logger:e,createRuntime:async({botId:k,config:z,authDir:Ae})=>{let ie=await L(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:nr("whatsapp",z)});let we=Ka(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:a});return new c({config:z,authDir:Ae,harness:we.harness,state:we.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:qa(m,k,{channel:"whatsapp",config:z,equals:rK}),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??3e4,createSession:I,logger:{error:(...se)=>e.error?.(`[${k}]`,...se),warn:(...se)=>e.warn?.(`[${k}]`,...se),info:(...se)=>e.info?.(`[${k}]`,...se),debug:(...se)=>e.debug?.(`[${k}]`,...se)}})},deleteAuth:k=>SZe(B.authPath(k),{recursive:!0,force:!0}),deleteState:async({botId:k})=>{let z=R.get(k);if(R.delete(k),z&&typeof z.remove=="function")await z.remove();else try{await wZe(K(k))}catch(Ae){if(Ae?.code!=="ENOENT")throw Ae}}}),U=xa(J,{workspaces:m,stateFor:L,agentPresetCatalog:a}),N=d({channel:"whatsapp",controller:U,harness:G,logger:e,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:U,deliveryAdapter:Ya({channel:"whatsapp",workspaces:m,coreController:J,stateFor:L}),ready:N.ready,async close(){await N.close(),await U.close(),G.stopManagedProcess()}}}import MZe from"qrcode";var AIe="/whatsapp",Mr=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setAccessPolicy:Va,setWorkspace:vi,setAgentPreset:Pi,setContextEnhancement:ki}),tIe=Object.freeze(Object.values(Mr)),_Ze=new Set(["qrValue","accountJid","authDirectory"]);function nK(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function fM(n,t){return nK(n)&&Object.keys(n).every(o=>t.includes(o))}function iK(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function TZe(n,t){return nK(t)?[Mr.status,Mr.beginProvisioning].includes(n)?fM(t,[])?null:`${n} does not accept fields.`:[Mr.pollProvisioning,Mr.cancelProvisioning].includes(n)?fM(t,["attemptId"])&&iK(t.attemptId)?null:`${n} requires an attemptId.`:n===Mr.reconnectBot?fM(t,["botId","sendTest"])&&iK(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId and optional sendTest flag.":n===Mr.deleteBot?fM(t,["botId","confirm"])&&iK(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Mr.setAccessPolicy?Wa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Mr.setWorkspace?Za(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Mr.setAgentPreset?$a(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Mr.setContextEnhancement?za(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":"Unknown WhatsApp endpoint.":"Payload must be an object."}function _E(n){if(Array.isArray(n))return n.map(_E);if(!nK(n))return n;let t={};for(let[o,i]of Object.entries(n))_Ze.has(o)||(t[o]=_E(i));return t}async function NZe(n){return MZe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function oK(n,t){return!n||typeof n.qrValue!="string"?_E(n):_E({...n,qrCodeDataUrl:await t(n.qrValue)})}async function Bp(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await oK(o.provisioning,t)),_E(o)}function rIe(n,{encodeQr:t=NZe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete WhatsApp controller is required (${e})`);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>t(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!tIe.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown WhatsApp endpoint."}};let r=TZe(e,a);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Mr.status)s=await Bp(await n.status(),i);else if(e===Mr.beginProvisioning)s=await oK(await n.startProvisioning(),i);else if(e===Mr.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await oK(g,i)}else if(e===Mr.cancelProvisioning)s=_E(await n.cancelProvisioning(a.attemptId));else if(e===Mr.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(s=await Bp(g,i),a.sendTest===!0){let c=null;if(!(g?.bots?.some(d=>d?.botId===a.botId&&d.connected===!0)===!0))c=new Error("WhatsApp bot is not connected"),c.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let d=new Error("Connection test is unavailable");throw d.code="test-target-unavailable",d}await n.sendConnectionTest(a.botId)}catch(d){c=d}s={...s,testMessage:or(c)}}}else if(e===Mr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Bp(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===Mr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(a.botId,a.config,g=>Bp(g,i))}else if(e===Mr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Bp(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else if(e===Mr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(a.botId,a.policy,g=>Bp(g,i))}else s=await Bp(await n.deleteBot(a.botId),i);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=Xa(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"whatsapp-operation-failed",message:"WhatsApp \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function QM(n,t,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(AIe,rIe(t,o),{authority:fr(i)})}async function aIe(n,t={}){if(t?.controller)return QM(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await aK(n,t,t.internals??{}),i=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=QM(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await i?.(),await o.close()},"dsh-im: close WhatsApp Web connections"),e}var RZe="/dsh-im-delivery",kZe="DSH-IM \u4E3B\u52A8\u6295\u9012\u6D4B\u8BD5\u6210\u529F\u3002",yi=Object.freeze({send:"message.send",listTargets:"target.list",listSuggestions:"target.suggestion.list",createTarget:"target.create",updateTarget:"target.update",deleteTarget:"target.delete",testTarget:"target.test"}),vZe=new Set(Object.values(yi)),PZe=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function eQ(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function OI(n,t){return eQ(n)&&Object.keys(n).length===t.length&&Object.keys(n).every(o=>t.includes(o))}function fp(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function $f(n){return typeof n=="string"&&/^[A-Za-z0-9._:@-]{1,128}$/.test(n)}function iIe(n,{targetId:t}){let o=t?["targetId","name","kind","route"]:["name","kind","route"];return!eQ(n)||Object.keys(n).some(i=>!o.includes(i))||t&&!$f(n.targetId)||n.name!==void 0&&(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)?!1:typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&eQ(n.route)}function GZe(n){return OI(n,["kind","route"])&&typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&eQ(n.route)}function FZe(n,t){return!vZe.has(n)||!eQ(t)?!1:n===yi.send?OI(t,["botId","targetId","text"])&&fp(t.botId)&&$f(t.targetId)&&typeof t.text=="string"&&!!t.text.trim():n===yi.listTargets||n===yi.listSuggestions?OI(t,["botId"])&&fp(t.botId):n===yi.createTarget?OI(t,["botId","target"])&&fp(t.botId)&&iIe(t.target,{targetId:!0}):n===yi.updateTarget?OI(t,["botId","targetId","target"])&&fp(t.botId)&&$f(t.targetId)&&iIe(t.target,{targetId:!1}):n===yi.testTarget?OI(t,["botId","targetId"])&&fp(t.botId)&&$f(t.targetId)||OI(t,["botId","target"])&&fp(t.botId)&&GZe(t.target):OI(t,["botId","targetId"])&&fp(t.botId)&&$f(t.targetId)}function LZe(n){let t=PZe.has(n?.code)?n.code:"delivery-failed";return{code:t,message:t,details:{}}}function sK(n){for(let t of["send","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget"])if(typeof n?.[t]!="function")throw new TypeError(`A complete delivery service is required (${t})`);return async(t,o,i)=>{if(!FZe(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid delivery request.",details:{}}};if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"cancelled",details:{}}};try{let e;return t===yi.send?e=await n.send(o.botId,o.targetId,o.text,{signal:i}):t===yi.listTargets?e=await n.listTargets(o.botId):t===yi.listSuggestions?e=await n.listSuggestions(o.botId):t===yi.createTarget?e=await n.createTarget(o.botId,o.target):t===yi.updateTarget?e=await n.updateTarget(o.botId,o.targetId,o.target):t===yi.deleteTarget?e=await n.deleteTarget(o.botId,o.targetId):e=await n.send(o.botId,Object.hasOwn(o,"target")?o.target:o.targetId,kZe,{signal:i}),{ok:!0,value:e}}catch(e){return{ok:!1,error:LZe(e)}}}}function oIe(n,t,{authority:o}={}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(RZe,sK(t),{authority:fr(o)})}var nIe="/api/dsh-im/delivery/messages",sIe=1024*1024,UZe=Object.freeze({"bad-request":400,"unknown-bot":404,"unknown-target":404,"target-conflict":409,"invalid-target":422,"bot-not-connected":503,"target-rejected":422,"delivery-failed":502,cancelled:408}),NE=class extends Error{constructor(t,o){super(o),this.status=t,this.code=o}};function TE(n,t,o,i={}){if(n.destroyed||n.writableEnded)return;let e=JSON.stringify(o);n.writeHead(t,{"cache-control":"no-store","content-type":"application/json; charset=utf-8","content-length":String(Buffer.byteLength(e)),...i}),n.end(e)}function HZe(n){return typeof n=="string"&&n.split(";",1)[0].trim().toLowerCase()==="application/json"}async function KZe(n){let t=Number(n.headers["content-length"]);if(Number.isFinite(t)&&t>sIe)throw new NE(413,"payload-too-large");let o=[],i=0;for await(let e of n){let a=Buffer.isBuffer(e)?e:Buffer.from(e);if(i+=a.length,i>sIe)throw new NE(413,"payload-too-large");o.push(a)}try{return JSON.parse(Buffer.concat(o,i).toString("utf8"))}catch{throw new NE(400,"bad-request")}}function xZe(n){let t=sK(n);return async(o,i)=>{if(o.method!=="POST"){TE(i,405,{error:{code:"method-not-allowed",message:"method-not-allowed",details:{}}},{allow:"POST"});return}if(!HZe(o.headers["content-type"])){TE(i,415,{error:{code:"unsupported-media-type",message:"unsupported-media-type",details:{}}});return}let e=new AbortController,a=()=>e.abort(),A=()=>{i.writableEnded||a()};o.once("aborted",a),i.once("close",A);try{let r=await KZe(o),s=await t(yi.send,r,e.signal);if(s.ok){TE(i,200,s.value);return}TE(i,UZe[s.error.code]??500,{error:s.error})}catch(r){if(r instanceof NE){TE(i,r.status,{error:{code:r.code,message:r.code,details:{}}});return}TE(i,500,{error:{code:"delivery-failed",message:"delivery-failed",details:{}}})}finally{o.off("aborted",a),i.off("close",A)}}}function gIe(n,t){if(!n?.webServer||typeof n.webServer.register!="function"||typeof n.effect!="function")throw new TypeError("DSH Host WebServer is required");let o={kind:"exact",path:nIe,handler:xZe(t)};return n.effect(()=>n.webServer.register(o),`dsh-im: ${nIe}`)}var YZe=/^[A-Za-z0-9_-]{1,128}$/,jZe=/^[A-Za-z0-9._:@-]{1,128}$/,JZe=/^[a-z][a-z0-9-]{0,31}$/,qZe="__test__",zZe=Object.freeze(["ownsBot","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget","sendText"]),VZe=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function pn(n,t=n,o){let i=new Error(t,o);return i.code=n,i}function RE(n){if(typeof n!="string"||!YZe.test(n))throw pn("bad-request","Invalid bot id");return n}function yM(n){if(typeof n!="string"||!jZe.test(n))throw pn("bad-request","Invalid target id");return n}function gK(n,{includesTargetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw pn("bad-request","Invalid target");if(t)yM(n.targetId);else if(Object.hasOwn(n,"targetId"))throw pn("bad-request","A target id cannot be changed");return n}function WZe(n){gK(n);let t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("route"))throw pn("bad-request","Invalid draft target");return n}function cIe(n){if(n?.aborted)throw pn("cancelled","Request cancelled")}function Qp(n,t="delivery-failed"){return n?.code==="workspace-bot-not-found"?pn("unknown-bot","Unknown bot",{cause:n}):VZe.has(n?.code)?n:pn(t,t,{cause:n})}function ZZe(n){if(!n||typeof n!="object"||typeof n.channel!="string"||!JZe.test(n.channel))throw new TypeError("A delivery adapter with a valid channel is required");for(let t of zZe)if(typeof n[t]!="function")throw new TypeError(`A complete delivery adapter is required (${t})`);return n}var cK=class{#e=new Map;registerAdapter(t){let o=ZZe(t),i=Object.freeze({adapter:o});return this.#e.set(o.channel,i),()=>this.#e.get(o.channel)!==i?!1:(this.#e.delete(o.channel),!0)}async listTargets(t){let o=RE(t),i=await this.#A(o);try{let e=await i.listTargets(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid targets");return{botId:o,channel:i.channel,targets:e}}catch(e){throw Qp(e)}}async listSuggestions(t){let o=RE(t),i=await this.#A(o);try{let e=await i.listSuggestions(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid suggestions");return{botId:o,channel:i.channel,suggestions:e.map(a=>Up(i.channel,a,{targetIdRequired:!1}))}}catch(e){throw Qp(e)}}async createTarget(t,o){let i=RE(t);gK(o,{includesTargetId:!0});let e=await this.#A(i);try{return await e.createTarget(i,o)}catch(a){throw Qp(a)}}async updateTarget(t,o,i){let e=RE(t),a=yM(o);gK(i);let A=await this.#A(e);try{return await A.updateTarget(e,a,i)}catch(r){throw Qp(r)}}async deleteTarget(t,o){let i=RE(t),e=yM(o),a=await this.#A(i);try{return await a.deleteTarget(i,e),{deleted:!0}}catch(A){throw Qp(A)}}async send(t,o,i,{signal:e}={}){let a=RE(t),A=typeof o=="string"?yM(o):null,r=A===null?WZe(o):null;if(typeof i!="string"||!i.trim())throw pn("bad-request","Message text is required");cIe(e);let s=await this.#A(a);try{let g;if(r)g={targetId:qZe,...r};else{let c=await s.listTargets(a);if(!Array.isArray(c))throw new TypeError("Adapter returned invalid targets");if(g=c.find(I=>I?.targetId===A),!g)throw pn("unknown-target","Unknown target")}return cIe(e),await s.sendText(a,g,i,{signal:e}),{sent:!0}}catch(g){throw e?.aborted||g?.name==="AbortError"||g?.code==="ABORT_ERR"?pn("cancelled","Request cancelled",{cause:g}):Qp(g)}}async#A(t){for(let{adapter:o}of this.#e.values()){let i;try{i=await o.ownsBot(t)}catch(e){throw Qp(e)}if(i)return o}throw pn("unknown-bot","Unknown bot")}};function IIe(){return new cK}var AQ=qe(PD(),1);import{createHash as XZe}from"node:crypto";import{readFile as dIe,realpath as Vn,stat as $Ze}from"node:fs/promises";import{homedir as e9e}from"node:os";import{basename as A9e,dirname as lK,isAbsolute as hK,join as oc,relative as t9e,resolve as SM,sep as r9e}from"node:path";import{fileURLToPath as a9e}from"node:url";var bI="@xmanrui/dsh-im",tQ="https://registry.npmjs.org/",i9e=15*6e4,o9e=1e4,lIe=16*1024;function Wn(n,t={}){return Object.assign(new Error(n),{code:n,...t})}function mM(n,t){return typeof n?.get=="function"?n.get(t):n?.[t]}function pK(n,t){let o=t9e(n,t);return o!==".."&&!o.startsWith(`..${r9e}`)&&!hK(o)}async function n9e(n){try{return await dIe(n,"utf8")}catch(t){if(t.code==="ENOENT")return"";throw t}}async function dK(n){let t=await dIe(oc(n,"package.json"),"utf8");return{directory:await Vn(n),manifest:JSON.parse(t),contents:t}}async function IK(n,t){let o=lK(await Vn(n));for(;;){try{let e=await dK(o);return e.manifest?.name===t?e:null}catch(e){if(e.code!=="ENOENT")throw e}let i=lK(o);if(i===o)return null;o=i}}function s9e(n){return typeof n=="string"&&n.length>0&&Buffer.byteLength(n)<=255&&!n.startsWith("-")&&![".","..","node_modules"].includes(n)&&!/[\\/\x00-\x1f\x7f<>:"|?*]/u.test(n)}function g9e(n){if(n[0]==="web")return"web";let t;for(let o=0;o0&&(AQ.default.validRange(n)!==null||/^[A-Za-z][A-Za-z0-9._-]*$/u.test(n))}async function l9e(n){if(n.manifest?.name!==bI||AQ.default.valid(n.manifest.version)===null)return!1;let t=[n.manifest.main,n.manifest.exports?.["./client"],n.manifest.dsh?.bundle?.patch];for(let o of t){if(typeof o!="string"||!o||hK(o)||o.includes("\0"))return!1;let i=SM(n.directory,o);if(!pK(n.directory,i)||!pK(n.directory,await Vn(i))||!(await $Ze(i)).isFile())return!1}return!0}function p9e(n){if(n==null||n==="")return!0;if(typeof n!="string")return!1;try{return new URL(n).href===tQ}catch{return!1}}async function pIe(n,{signal:t,timeoutMs:o,errorCode:i,capture:e=!1}){if(t?.aborted)throw Wn("install-interrupted");let a=new AbortController,A,r,s=B=>{A??=B,a.abort(),r?.cancel?.()},g=()=>s("install-interrupted");t?.addEventListener("abort",g,{once:!0});let c=setTimeout(()=>s("install-timeout"),o),I="",d="";try{r=n(a.signal),r.stdout?.on("data",f=>{e&&(I=(I+f.toString()).slice(-lIe))}),r.stderr?.on("data",f=>{d=(d+f.toString()).slice(-lIe)}),r.stdout?.on("error",()=>s(i)),r.stderr?.on("error",()=>s(i));let B=await r.done;if(A)throw Wn(A);if(B.exitCode!==0||B.signal)throw Wn(i,{exitCode:B.exitCode,diagnosticCode:d.match(/\bERR_PNPM_[A-Z0-9_]+\b/u)?.[0]});return{exitCode:0,signal:null,...e?{stdout:I}:{}}}catch(B){throw A?Wn(A):B.code===i?B:Wn(i)}finally{clearTimeout(c),t?.removeEventListener("abort",g)}}function hIe(n={}){let t=n.ctx,o=n.env??process.env,i=n.argv??process.argv,e=n.execArgv??process.execArgv,a=n.execPath??process.execPath,A=n.cwd??process.cwd(),r=n.platform??process.platform,s=n.osHome??e9e(),g=n.electron??process.versions.electron,c=n.moduleUrl??import.meta.url,I=IK(a9e(c),bI).catch(()=>null),d;async function B(){let T=mM(t,"desktopProfiles"),_=mM(t,"desktopPnpm"),R=mM(t,"desktopPnpmBootstrap"),K=!!(g||T||_||R),L=T?.current,F=K?L?.name:g9e(i.slice(2)),q=K&&R?.homeDir?SM(R.homeDir):c9e(o,s),V={environmentKind:K?"desktop":"cli",homeDir:q,profileName:F};if(!s9e(F))return{...V,blockedReason:"unknown-profile"};let x=await Vn(oc(q,"profiles",F)),G=await Vn(q),J={...V,homeDir:G,profileDir:x};if(K)try{if(typeof _?.runPlugin!="function"||typeof _?.run!="function"||!R||!L?.dir||R.activeProfileName!==F||await Vn(L.dir)!==x||await Vn(R.activeProfileDir)!==x||await Vn(R.appExecutable)!==await Vn(a))return{...J,blockedReason:"executor-unavailable"};let N=await IK(R.dshBootstrapPath,"dsh-plugin-desktop");return!N||A9e(R.dshBootstrapPath)!=="desktop-cli.js"||lK(await Vn(R.dshBootstrapPath))!==oc(N.directory,"lib")?{...J,blockedReason:"executor-unavailable"}:{...J,desktop:_,executable:a,cliEntry:R.dshBootstrapPath}}catch{return{...J,blockedReason:"executor-unavailable"}}let U=mM(t,"subprocess");if(typeof U?.spawn!="function"||typeof i[1]!="string"||!hK(i[1])||r==="win32")return{...J,blockedReason:"executor-unavailable"};try{let N=await IK(i[1],"@deepseek-ai/dsh");if(!N)return{...J,blockedReason:"executor-unavailable"};let k=await Vn(i[1]),z=typeof N.manifest.bin=="string"?N.manifest.bin:N.manifest.bin?.dsh,Ae=typeof z=="string"?SM(N.directory,z):"";return k!==Ae&&k!==oc(N.directory,"src","bin.ts")?{...J,blockedReason:"executor-unavailable"}:{...J,subprocess:U,executable:a,cliEntry:k}}catch{return{...J,blockedReason:"executor-unavailable"}}}function f(T,_,R,K=!1){let L=T.subprocess.spawn({argv:K?["pnpm",..._]:[a,...e,T.cliEntry,..._],cwd:K?T.profileDir:A,env:{DSH_HOME:T.homeDir,CI:"true"},stdio:{stdin:"ignore",stdout:"pipe",stderr:"pipe"},graceMs:3e3,signal:R});return{stdout:L.stdout,stderr:L.stderr,cancel:()=>L.terminate(),done:(async()=>{try{return await L.done}finally{await L.waitForExit()}})()}}async function Q(T,_){let R=["config","get","@xmanrui:registry","--json"],L=(await pIe(q=>T.desktop?T.desktop.run(R,q):f(T,R,q,!0),{signal:_,timeoutMs:n.configTimeoutMs??o9e,errorCode:"registry-check-failed",capture:!0})).stdout.trim(),F;try{F=L===""||L==="undefined"?void 0:JSON.parse(L)}catch{throw Wn("registry-check-failed")}if(!p9e(F))throw Wn("registry-conflict")}async function y({preflight:T=!1}={}){let _,R={installedVersion:null,packageValid:!1,eligible:!1,installationKey:null};try{_=await B();for(let G of["homeDir","profileDir","profileName","environmentKind","executable","cliEntry"])R[G]=_[G]??null;if(!_.profileDir)return{...R,blockedReason:_.blockedReason??"unknown-profile"};let K=await dK(_.profileDir),L=await dK(oc(_.profileDir,"node_modules",bI));R.sourceInstall=!I9e(K.manifest.dependencies?.[bI])||!pK(oc(_.profileDir,"node_modules"),L.directory),R.installedVersion=typeof L.manifest.version=="string"?L.manifest.version:null,R.packageValid=await l9e(L);let F=await I,q=`${_.homeDir}\0${_.profileDir}\0${_.profileName}`,V=F?.directory===L.directory&&F?.manifest.version===L.manifest.version;d===void 0&&V&&R.packageValid&&(d=q);let x=await Promise.all(["pnpm-lock.yaml","pnpm-workspace.yaml","package-lock.json"].map(G=>n9e(oc(_.profileDir,G))));return R.installationKey=XZe("sha256").update(JSON.stringify([q,K.contents,L.directory,L.contents,_.cliEntry,_.executable,...x])).digest("hex"),d!==void 0&&d!==q||!V&&d===void 0?R.blockedReason="installation-changed":R.packageValid?R.sourceInstall?R.blockedReason="source-install":_.blockedReason?R.blockedReason=_.blockedReason:V?T&&await Q(_):R.blockedReason="pending-restart":R.blockedReason="invalid-installation",R.eligible=!R.blockedReason,{...R,blockedReason:R.blockedReason??null}}catch(K){return{...R,blockedReason:["registry-conflict","registry-check-failed","install-timeout","install-interrupted"].includes(K.code)?K.code:_?.profileDir?"invalid-installation":"unknown-profile"}}}async function m(T,{signal:_,expectedInstallationKey:R}={}){if(AQ.default.valid(T)!==T||AQ.default.prerelease(T))throw Wn("invalid-version");let K=await y();if(R!==void 0&&K.installationKey!==R)throw Wn("installation-changed");if(!K.eligible)throw Wn(K.blockedReason);let L=await B();await Q(L,_);let F=await y();if(!F.eligible||F.installationKey!==K.installationKey)throw Wn("installation-changed");let q=["add","-w","--save-exact",`${bI}@${T}`,`--registry=${tQ}`];return pIe(V=>L.desktop?L.desktop.runPlugin(q,L.profileDir,V):f(L,["plugin","--profile",L.profileName,...q],V),{signal:_,timeoutMs:n.installTimeoutMs??i9e,errorCode:"install-failed"})}return Object.freeze({inspect:y,install:m})}var MI=qe(PD(),1);import{createHash as d9e,randomUUID as CK}from"node:crypto";import{mkdir as h9e,open as E9e,readFile as fIe,rename as C9e,stat as QIe,unlink as yIe,writeFile as u9e}from"node:fs/promises";import{isAbsolute as EIe,join as aQ}from"node:path";var iQ=new Set(["installing","verifying"]),B9e=new Set([...iQ,"restart-required","completed","failed","interrupted"]),CIe=256*1024,f9e=["package.json","pnpm-lock.yaml","pnpm-workspace.yaml"],wM=Symbol("no update lock");function bt(n){return Object.assign(new Error(n),{code:n})}async function uIe(n=globalThis.fetch,t=1e4){let o;try{if(o=await n(`${tQ}${encodeURIComponent(bI)}/latest`,{headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(t)}),!o.ok)throw bt("check-failed");if(Number(o.headers.get("content-length"))>CIe)throw bt("invalid-release");let i=[],e=0;for await(let c of o.body){if(e+=c.byteLength,e>CIe)throw bt("invalid-release");i.push(Buffer.from(c))}let a=JSON.parse(Buffer.concat(i).toString("utf8")),A=a.version;if(a.name!==bI||typeof A!="string"||MI.default.valid(A)!==A||MI.default.prerelease(A))throw bt("invalid-release");let r=a.engines?.node;if(r!==void 0&&(typeof r!="string"||!MI.default.validRange(r)))throw bt("invalid-release");let s=new URL(a.dist?.tarball),g=a.dist?.integrity;if(s.origin!==new URL(tQ).origin||s.username||s.password||s.search||s.hash||s.pathname!==`/@xmanrui/dsh-im/-/dsh-im-${A}.tgz`||typeof g!="string"||!/^sha512-[A-Za-z0-9+/]{86}==$/.test(g))throw bt("invalid-release");return{version:A,nodeRange:r??"*",integrity:g,tarball:s.href}}catch(i){throw i?.code==="invalid-release"||i instanceof SyntaxError||i instanceof TypeError&&o?.ok?bt("invalid-release"):bt("check-failed")}}function BIe(n){if(!EIe(n.homeDir??"")||!EIe(n.profileDir??""))return null;let t=d9e("sha256").update(n.profileDir).digest("hex").slice(0,24),o=aQ(n.homeDir,"updates","dsh-im",t);return{directory:o,state:aQ(o,"state.json"),lock:aQ(o,"install.lock"),backup:aQ(o,"before.json")}}async function EK(n,t=null){try{if((await QIe(n)).size>10*1024*1024)throw bt("state-unavailable");return JSON.parse(await fIe(n,"utf8"))}catch(o){if(o.code==="ENOENT")return t;throw bt("state-unavailable")}}async function rQ(n,t){let o=`${n}.${CK()}.tmp`;try{await u9e(o,`${JSON.stringify(t,null,2)} `,{mode:384,flag:"wx"}),await C9e(o,n)}catch{throw bt("state-unavailable")}finally{await yIe(o).catch(i=>{if(i.code!=="ENOENT")throw bt("state-unavailable")})}}function Q9e(n){if(!Number.isSafeInteger(n)||n<=0)return!1;try{return process.kill(n,0),!0}catch(t){return t.code!=="ESRCH"}}function y9e(n){if(!n)return null;let{id:t,state:o,targetVersion:i,message:e}=n;return{id:t,state:o,targetVersion:i,message:e}}function mIe({runtime:n,runningVersion:t=QQ.version,nodeVersion:o=process.versions.node,fetchImpl:i=globalThis.fetch,now:e=Date.now,checkTimeoutMs:a=1e4,confirmationTtlMs:A=10*6e4,installTimeoutMs:r=15*6e4}={}){let s={},g=null,c=null,I=-1/0,d=null,B=null,f=null,Q=null,y=!1;function m(){if(y)throw bt("disposed")}async function T(J){let U=BIe(J);if(!U)return null;if(Q?.statePath===U.state)return Q.job;let N=await EK(U.state),k=await EK(U.lock,wM);if(!N)return k!==wM?{id:"locked",state:"interrupted",message:"recovery-required",targetVersion:null}:null;if(!B9e.has(N.state)||typeof N.id!="string"||!MI.default.valid(N.targetVersion))throw bt("state-unavailable");if(iQ.has(N.state)&&N.id!==d?.id&&(k===wM||k?.id!==N.id||!Q9e(k?.pid))&&(N={...N,state:"interrupted",message:"recovery-required"}),N.id!==d?.id&&!iQ.has(N.state)){if(k!==wM)return{...N,state:"interrupted",message:"recovery-required"};if(["failed","interrupted"].includes(N.state)&&J.packageValid===!0&&J.installedVersion===t&&!J.blockedReason)return N.targetVersion===t?{...N,state:"completed",message:"recovered"}:{...N,recoverable:!0}}return N.state==="restart-required"||N.state==="completed"?J.installedVersion!==N.targetVersion||J.packageValid!==!0?{...N,state:"interrupted",message:"installation-changed"}:{...N,state:t===N.targetVersion?"completed":"restart-required"}:N}function _(J,U){let N=J.blockedReason??g?.blockedReason??null;U?.state==="interrupted"&&!U.recoverable||U?.state==="failed"&&J.installedVersion!==t?N="recovery-required":(U?.state==="restart-required"||J.installedVersion&&J.installedVersion!==t)&&(N="pending-restart");let k=iQ.has(U?.state),z=!!(J.eligible&&!N&&!k&&g?.checkId&&e(){try{let J=await n.inspect({preflight:!0}),U=await uIe(i,a);return m(),g={release:U,checkId:CK(),checkedAt:e(),expiresAt:e()+A,installationKey:J.installationKey,profileDir:J.profileDir,blockedReason:J.blockedReason??(MI.default.satisfies(o,U.nodeRange)?null:"incompatible-node")},_(J,await T(J))}catch(J){throw g&&(g={...g,checkId:null,expiresAt:0}),J}finally{c=null}})(),c))}async function L(J,U){(await EK(J.lock))?.id===U&&await yIe(J.lock)}async function F(J,U,N){let k={};for(let z of f9e)try{let Ae=aQ(J.profileDir,z);if((await QIe(Ae)).size>3*1024*1024)throw bt("state-unavailable");k[z]=await fIe(Ae,"utf8")}catch(Ae){if(Ae.code!=="ENOENT")throw bt("state-unavailable")}await rQ(U.backup,{jobId:N.id,previousVersion:N.previousVersion,files:k})}function q(J){d={...d,state:"interrupted",message:"state-unavailable"},Q={statePath:J.state,job:d}}async function V(J,U,N){let k=AbortSignal.timeout(r);try{if(await n.install(U.targetVersion,{signal:AbortSignal.any([f.signal,k]),expectedInstallationKey:N.installationKey}),y)throw bt("interrupted");d={...d,state:"verifying",updatedAt:e()},await rQ(J.state,d);let z=await n.inspect();if(z.homeDir!==N.homeDir||z.profileDir!==N.profileDir||z.profileName!==N.profileName||z.blockedReason==="installation-changed")throw bt("installation-changed");if(z.installedVersion!==U.targetVersion||z.packageValid!==!0||z.blockedReason&&z.blockedReason!=="pending-restart")throw bt("verify-failed");d={...d,state:"restart-required",message:null,updatedAt:e()},await rQ(J.state,d)}catch(z){let Ae=k.aborted||z.code==="install-timeout",ie=y||f.signal.aborted||!Ae&&["interrupted","install-interrupted"].includes(z.code);d={...d,state:ie?"interrupted":"failed",message:ie?"interrupted":Ae?"install-timeout":["verify-failed","state-unavailable","installation-changed","registry-conflict"].includes(z.code)?z.code:"install-failed",updatedAt:e()};try{await rQ(J.state,d)}catch{q(J);return}}await L(J,U.id)}function x({checkId:J,requestId:U}){return ag(s,"install",async()=>{m();let N=await n.inspect({preflight:!0}),k=await T(N);if(k?.requestId===U)return _(N,k);if(iQ.has(k?.state)||k?.state==="restart-required")throw bt("update-busy");let z=g;if(!z||!J||z.checkId!==J||e()>=z.expiresAt)throw bt("check-expired");if(N.profileDir!==z.profileDir||N.installationKey!==z.installationKey)throw bt("installation-changed");if(!_(N,k).canInstall)throw bt(N.blockedReason??"update-busy");let Ae=BIe(N);if(!Ae)throw bt("state-unavailable");let ie={id:CK(),requestId:U,state:"installing",message:null,targetVersion:z.release.version,previousVersion:N.installedVersion,startedAt:e(),updatedAt:e()},we=!1;try{await h9e(Ae.directory,{recursive:!0,mode:448});let se=await E9e(Ae.lock,"wx",384);we=!0;try{await se.writeFile(JSON.stringify({id:ie.id,pid:process.pid,startedAt:e()}))}finally{await se.close()}let Te=await uIe(i,a);if(JSON.stringify(Te)!==JSON.stringify(z.release))throw bt("check-expired");if(N=await n.inspect({preflight:!0}),N.profileDir!==z.profileDir||N.installationKey!==z.installationKey)throw bt("installation-changed");if(!N.eligible||N.blockedReason)throw bt(N.blockedReason??"update-busy");m(),await F(N,Ae,ie),await rQ(Ae.state,ie),m()}catch(se){throw we&&await L(Ae,ie.id),se.code==="EEXIST"?bt("update-busy"):se.code?.startsWith("E")?bt("state-unavailable"):se}return d=ie,f=new AbortController,B=V(Ae,ie,N).catch(()=>{q(Ae)}),_(N,ie)})}async function G(){y=!0,f?.abort(),B&&await B}return Object.freeze({status:R,check:K,install:x,close:G})}var m9e="/dsh-im",S9e=Object.freeze(["update.status","update.check","update.install"]);function w9e(n,t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let o=Object.keys(t);return n!=="update.install"?o.length===0:o.length===2&&o.every(i=>i==="checkId"||i==="requestId")&&["checkId","requestId"].every(i=>typeof t[i]=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(t[i]))}var D9e=new Set(["check-failed","invalid-release","check-expired","installation-changed","update-busy","install-failed","verify-failed","state-unavailable","interrupted","disposed","source-install","unknown-profile","unsupported-runtime","registry-conflict","incompatible-node","pending-restart","recovery-required","executor-unavailable","invalid-installation","registry-check-failed","install-timeout","install-interrupted","invalid-version"]);function O9e(n){return async(t,o,i)=>{if(!S9e.includes(t)||!w9e(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid update request."}};if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"Request cancelled."}};try{return{ok:!0,value:t==="update.install"?await n.install(o):t==="update.check"?await n.check():await n.status()}}catch(e){let a=D9e.has(e?.code)?e.code:"update-failed";return{ok:!1,error:{code:a,message:a}}}}}function SIe(n,t={}){let o=t.runtime??hIe({ctx:n,moduleUrl:import.meta.url}),i=t.service??mIe({runtime:o}),e=n.connection.rpc.handle(m9e,O9e(i),{authority:"loopback"});return n.effect(()=>()=>i.close(),"dsh-im: close update installer"),e}var wIe="dsh-im-host",b9e=["connection","credentials","typertGateway"];function M9e(n,t,o){let i=n[t]??{},e=n.rpcAuthority===void 0?i:{...i,rpcAuthority:n.rpcAuthority};return t==="office"?e:{...e,deliveryService:o}}function _9e(n={}){let t=n.installUpdateRpc??SIe,o=n.installDeliveryRpc??oIe,i=n.installDeliveryHttp??gIe,e=n.createDeliveryService??IIe,a=n.applyFeishu??Q5,A=n.applyWeixin??p9,r=n.applyDingtalk??N1,s=n.applyWecom??GZ,g=n.applyQq??U5,c=n.applySlack??rZ,I=n.applyTelegram??QZ,d=n.applyDiscord??a3,B=n.applyOffice??c3,f=n.applyWhatsapp??aIe,Q=[["feishu",a],["weixin",A],["dingtalk",r],["wecom",s],["qq",g],["slack",c],["telegram",I],["discord",d],["whatsapp",f],["office",B]];return Object.freeze({name:wIe,inject:b9e,async apply(m,T={}){let _=e();typeof m?.provide=="function"&&m.provide("dshIm",Object.freeze({send:(K,L,F,q)=>_.send(K,L,F,q),listTargets:async K=>(await _.listTargets(K)).targets}));let R=async K=>{await y(K,T,_)};if(typeof m?.inject=="function"){let K=typeof m?.typertGateway?.stream=="function";await m.inject(K?["sessionController","workspaceController"]:["apiProxy"],R),m.inject(["webServer"],L=>{i(L,_)});return}await R(m),m?.webServer?.register&&typeof m?.effect=="function"&&i(m,_)}});async function y(m,T,_){rx(T.language??process.env.DSH_IM_LANGUAGE),typeof m?.inject=="function"?m.inject(["tools","systemPrompt"],L=>{Q_(L)}):Q_(m);let R=typeof m?.logger=="function"?m.logger(wIe):m?.logger??console;if(m?.connection?.rpc){try{t(m)}catch(L){R.error?.("[dsh-im] failed to activate update management; continuing with channels",L)}try{o(m,_,{authority:T.rpcAuthority})}catch(L){R.error?.("[dsh-im] failed to activate delivery management; continuing with channels",L)}}let K=[];for(let[L,F]of Q)try{await F(m,M9e(T,L,_))}catch(q){K.push(q),R.error?.(`[dsh-im] failed to activate ${L}; continuing with the remaining channels`,q)}if(K.length===Q.length)throw new AggregateError(K,"dsh-im failed to activate every channel")}}async function A2A(n,t={}){return _9e().apply(n,t)}export{A2A as apply,_9e as createImHostPlugin,b9e as inject,wIe as name}; /*! Bundled license information: